diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index bb46de7b8ad443..70239a094fd32d 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 @@ -1201,3 +1172,81 @@ authorized_users: - klausholstjacobsen - xahon - jeremy-rifkin +- Christian-Prather +- Siarh199 +- liquiddaniel +- seppeon +- SavenkovIgor +- aliaksei135 +- ibosnic00 +- Xav83 +- matthewT53 +- sjlamerton +- marxin +- Arkokat +- adattatri +- jwfallawuiuc +- tgurriet +- mgfernan +- chrisc66 +- KevDi +- XVilka +- DoomHammer +- cschreib +- AleksandraVolosevich-TomTom +- p-groarke +- Kalixio +- temap +- vient +- bryce-cahill +- alfred-sa +- leducp +- mrjoel +- Nerixyz +- irieger +- Slashcash +- CJaccarino +- gagoi +- tux3 +- jan-grimo +- petermbauer +- Rdk-T +- fixstars-sonali +- FranzPoize +- SoShiny +- tamaskenezlego +- luizfeldmann +- ma30002000 +- thbeu +- HypoYoung +- technoyes +- Subash-Lamichhane +- rezvee6 +- SpiffGreen +- hegyizs +- kkloberdanz +- martin-olivier +- lucaskdc +- fnadeau +- '0x5ea1ed' +- Kischy +- MangaD +- fabiorossetto +- Bronek +- agdavydov81 +- sizeak +- johannes-wolf +- cyberflashguru +- OndrejSlamecka +- correaa +- jakeheke75 +- NelDav +- utelle +- har-bw +- abedra +- bennettgoble +- juansblanco +- jmalopoy +- mlutken +- hoyhoy +- stevenhartley diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index 24a3d8f44d6475..d212e2154e11f7 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -6,13 +6,17 @@ required_for_references: - aaplus - abseil - absent +- acado +- accellera-uvm-systemc - access_private - acl - ada - ade - aeron - aggeom-agg +- ags - alac +- alembic - alpaca - amgcl - amqp-cpp @@ -25,6 +29,8 @@ required_for_references: - apr - apr-util - apriltag +- aravis +- archicad-apidevkit - arcus - arduinojson - arg_router @@ -34,11 +40,16 @@ required_for_references: - args-parser - argtable2 - argtable3 +- armadillo +- arrow - arsenalgear - artery-font-format - asio +- asio-grpc - asmjit +- assimp - astc-codec +- astro-informatics-so3 - async_simple - asyncly - asyncplusplus @@ -46,6 +57,7 @@ required_for_references: - autoconf - autoconf-archive - automake +- avahi - avir - aws-c-auth - aws-c-cal @@ -55,21 +67,31 @@ required_for_references: - aws-c-http - aws-c-io - aws-c-mqtt +- aws-c-s3 - aws-c-sdkutils - aws-checksums +- aws-crt-cpp +- aws-kvs-pic +- aws-lambda-cpp +- aws-libfabric +- aws-sdk-cpp - b2 - b64 - backport-cpp - backward-cpp - bacnet-stack - baical-p7 +- bandit - base64 - bazel - bdwgc - bear +- beauty - benchmark - bertrand +- bgfx - bigint +- bimg - binutils - bison - bit-lite @@ -85,15 +107,19 @@ required_for_references: - boost - boost-ext-ut - boost-leaf +- boostdep - box2d - breakpad - brigand - brotli +- brunsli - brynet - bshoshany-thread-pool +- btyacc - bullet3 - butteraugli - bvdberg-ctest +- bx - byte-lite - bzip2 - bzip3 @@ -104,15 +130,19 @@ required_for_references: - c-dbg-macro - c4core - caf +- cairomm - cajun-jsonapi - calceph - canary - canvas_ity - capnproto - capstone +- cargs +- cassandra-cpp-driver - catch2 - ccache - cccl +- ccfits - cctz - cd3-boost-unit-definitions - celero @@ -123,11 +153,14 @@ required_for_references: - cfitsio - cgal - cgif +- cglm +- cgltf - cgns - chaiscript - charls - chef-fun - chipmunk2d +- choc - cimg - circularbuffer - cista @@ -138,12 +171,18 @@ required_for_references: - clhep - cli11 - clickhouse-cpp +- clipboard_lite +- clipp - clipper +- clipper2 - clove-unit - cmake +- cminpack - cmocka - cmp +- cn-cbor - cnpy +- cocoyaxi - coin-cgl - coin-clp - coin-lemon @@ -154,12 +193,19 @@ required_for_references: - concurrentqueue - console_bridge - continuable +- coost +- corrade +- cose-c +- cotila - cpp-httplib +- cpp-ipc - cpp-jwt - cpp-lazy - cpp-optparse - cpp-peglib - cpp-sort +- cpp-validator +- cpp_project_framework - cppbenchmark - cppcheck - cppcmd @@ -170,34 +216,45 @@ required_for_references: - cppitertools - cpprestsdk - cpptoml +- cpptrace - cppunit - cpputest +- cppzmq - cpr +- cprocessing - cpu_features - cpuinfo - cqrlib - crc32c +- crc_cpp - create-dmg - croncpp +- crossguid +- crowcpp-crow - crunch - cryptopp +- cryptopp-pem - cs_libguarded - csm - cspice - csvmonkey - ctml +- ctpg - ctre - cub - cubicinterpolation - cuda-api-wrappers - cuda-kat +- cuda-samples - cunit - cute_headers - cvplot - cwalk - cxxopts - cyclonedds +- cyclonedds-cxx - cyrus-sasl +- czmq - dacap-clip - darknet - dataframe @@ -209,11 +266,21 @@ required_for_references: - dbcppp - dbg-macro - dbus +- dcmtk - debug_assert - decimal_for_cpp +- deco +- detools +- dfp +- di - dice-template-library +- dime +- directx-headers - dirent - discount +- djinni-generator +- djinni-support-lib +- dlib - dlpack - docopt.cpp - doctest @@ -226,29 +293,51 @@ required_for_references: - drmp3 - drogon - drwav +- dsp-filters +- dtl - duckdb +- duktape +- dylib - eabase - earcut - eastl - easy_profiler +- easyhttpcpp +- easyloggingpp +- easylzma - ecos - editline - edlib +- edyn - effcee - effolkronium-random - egl +- egl-headers - eigen - elfio +- elfutils +- embag +- embedded_ringbuf_cpp - embree3 - emio +- emsdk +- enchant - enet +- enhex-generic_serialization +- enhex-strong_type +- enjincppsdk +- enkits +- ensmallen - entityx - entt - enum-flags - erikzenker-hsm - erkir +- etc2comp - eternal +- ethash - etl +- evmc - exiv2 - expat - expected-lite @@ -259,40 +348,70 @@ required_for_references: - fakeit - farmhash - fast-cdr +- fast-cpp-csv-parser - fast-dds +- fast_double_parser - fast_float - fastgltf +- fastnoise2 +- fastpfor +- fastprng - fernandovelcic-hexdump - fff - ffmpeg - fft - fftw +- fire-hpp - flac - flann - flatbuffers - flatbush +- flecs - flex +- fltk +- fmi1 +- fmi2 +- fmi3 - fmt - fmtlog - fontconfig - foonathan-lexy - foonathan-memory +- forestdb - foxglove-schemas-protobuf +- foxglove-websocket +- foxi - fp16 +- fpgen +- fpzip - freeglut +- freeimage - freetype +- freexl +- fribidi - frozen +- frugally-deep +- fruit +- ftjam - ftxui - function2 +- functionalplus +- functions-framework-cpp +- fusepp - fxdiv - g3log +- gainput - gamma +- gcem - gdbm - gdcm - gdk-pixbuf - gegles-spdlog_setup - gemmlowp +- genie +- geographiclib - geos +- geotrans - getopt-for-visual-studio - gettext - gflags @@ -303,23 +422,31 @@ required_for_references: - gklib - glad - glaze +- glbinding +- glew +- glext - glfw - gli - glib +- glibmm - glm - glog - glpk +- glshaderpp - glslang - glu +- gm2calc - gmp - gnu-config - gnutls +- godot_headers - googleapis - gperf - gperftools - graphene - graphthewy - greatest +- greg7mdp-gtl - grpc - grpc-proto - gsl @@ -329,13 +456,27 @@ required_for_references: - gtest - gtk - gtk-doc-stub +- gtsam +- guetzli +- gumbo-parser - gurkenlaeufer +- gzip-hpp - h3 - h5pp +- half - happly - harfbuzz +- hash-library +- hayai +- hazelcast-cpp-client +- hdf4 - hdf5 - hdrhistogram-c +- heatshrink +- hedley +- hexl +- hffix +- hictk - hidapi - highfive - highs @@ -343,16 +484,30 @@ required_for_references: - hipony-enumerate - hippomocks - hiredis +- hlslpp - homog2d - http_parser +- hunspell +- hwdata +- hwloc +- hyperscan +- i2c-tools - icecream-cpp +- iceoryx +- iconfontcppheaders - icu - id3v2lib +- ignition-cmake - iir1 - im95able-rea +- imagl - imake - imath - imgui +- imguizmo +- immer +- implot +- imutils-cpp - incbin - indicators - indirect_value @@ -360,124 +515,217 @@ required_for_references: - inih - inja - intel-neon2sse +- intx - inversify-cpp +- iowow +- iqa +- irrxml +- isa-l +- iso8601lib +- itk - itlib +- ittapi +- ixwebsocket +- jansson - jasper - jbig +- jeaiii-itoa +- jerryscript +- jfalcou-eve - jinja2cpp - joltphysics - jom - jpcre2 +- jpeg-compressor +- jsbsim +- jsmn - json-c - json-schema-validator +- json_dto - jsoncons - jsoncpp - jsonnet +- jthread-lite +- jungle +- jwasm - jwt-cpp - jxrlib - kainjow-mustache +- kaitai_struct_cpp_stl_runtime - kangaru +- kcp +- kdbindings - keychain - khrplatform +- kickcat +- kissfft +- kitten - kmod - ktx - kuba-zip +- lager +- laszip +- lazycsv - lcms - ldns - lefticus-tools +- lely-core - lemon - leptonica - lerc - lest +- leveldb - lexbor +- libaesgm +- libaio - libalsa +- libaom-av1 - libarchive - libassert - libatomic_ops - libattr +- libavif +- libb2 - libbacktrace +- libbasisu - libbigwig +- libbpf - libbsd - libcap - libcbor +- libccd - libcds +- libcheck +- libcoap +- libconfig - libconfuse - libcoro +- libcorrect +- libcpuid - libcuckoo - libcurl +- libdaemon +- libdb +- libdc1394 - libde265 - libdeflate +- libdicom - libdisasm +- libdisplay-info - libdivide +- libdmtx - libdrawille +- libdrm - libdwarf +- libdxfrw +- libe57format - libelf +- libenvpp - libepoxy - libev +- libevdev - libevent - libexif - libfdk_aac - libffi - libfreenect +- libfreenect2 +- libftdi - libfuse - libgcrypt +- libgd - libgeotiff - libgettext +- libglvnd - libgpg-error - libgphoto2 - libgpiod +- libgta +- libhal - libharu +- libheif +- libhydrogen - libiberty - libiconv - libinterpolate +- libipt - libjpeg - libjpeg-turbo - libkml +- libliftoff - liblsl - libltc - liblzf - libmad +- libmagic +- libmaxminddb +- libmbus - libmediainfo - libmemcached +- libmetalink +- libmicrohttpd - libmikmod +- libmnl - libmodbus - libmodplug - libmorton - libmount - libmp3lame +- libmpdclient - libmysqlclient - libnabo +- libnet +- libnetfilter_conntrack +- libnetfilter_queue +- libnfnetlink - libnfs - libnghttp2 +- libnice - libnl +- libnoise - libnop - libnova +- libnpy - libnuma +- liboping - libpcap - libpciaccess - libpfm4 - libpng - libpq - libpqxx +- libproperties - libpsl - libqrencode +- librasterlite - libraw - librdkafka - librealsense - libressl - librttopo +- libsafec - libsamplerate +- libsass +- libschrift +- libseat - libsecret - libselinux - libserial - libsgp4 +- libsigcpp +- libsixel +- libslz - libsmacker - libsndfile - libsodium +- libsolace - libspatialindex +- libspatialite - libspng +- libsquish - libsrtp - libssh2 +- libsvm - libsvtav1 - libsystemd - libtar @@ -486,12 +734,17 @@ required_for_references: - libtins - libtool - libtorrent +- libucl - libudev +- libunistring - libunwind +- liburing - libusb +- libusb-compat - libuuid - libuv - libuvc +- libvault - libverto - libvips - libvpx @@ -500,174 +753,343 @@ required_for_references: - libwebsockets - libx264 - libx265 +- libxcrypt +- libxft - libxls +- libxlsxwriter - libxml2 +- libxmlpp +- libxpm +- libxshmfence - libxslt +- libyaml - libyuv - libzen - libzip - libzippp - lief +- lightgbm +- lightpcapng +- linmath.h - linux-headers-generic - linux-syscall-support +- litehtml - llhttp +- llvm-openmp +- lmdb - lodepng +- log.c +- log4cplus +- log4cxx - logr - loguru +- ls-qpack - lua +- luajit - luau - lunasvg - luple +- lurlparser +- lyra - lz4 +- lzfse +- lzham +- lzip - lzma_sdk - lzo - m4 +- maddy - magic_enum - mailio - make +- mapbox-geometry +- mapbox-variant - mariadb-connector-c +- marisa - matchit +- mathfu - mathter +- matio - mattiasgustavsson-libs - maven - mawk - mbedtls - mbits-args +- mbits-diags +- mbits-lngs - mbits-mstch - mbits-semver - mbits-utfconv +- mcap - md4c - md4qt +- mdns - mdnsresponder - mdspan +- mesa-glu +- meshoptimizer - meson +- metall - metis +- mfast - mgs +- microprofile - microservice-essentials +- microtar - mikelankamp-fpm +- mikktspace - mimalloc - mingw-builds - miniaudio - minimp3 - minisat +- miniscript +- minitrace +- miniupnpc - miniz - minizip - minizip-ng +- mio +- mm_file +- modern-cpp-kafka +- mold +- moltenvk - mongo-c-driver - mongo-cxx-driver +- morton-nd +- mosquitto - mozilla-build - mozjpeg - mp-units +- mpark-variant +- mpc +- mpfr - mpg123 +- mpmcqueue - mppp - ms-gsl - msdf-atlas-gen +- msdfgen - msgpack-c - msgpack-cxx - msys2 +- mtdev +- mujs +- muparser +- muparserx - naive-tsearch - namedtype - nameof +- nanobench - nanodbc - nanoflann - nanomsg - nanorange - nanort +- nanosvg - nas - nasm +- ncurses +- neargye-semver - netcdf - nettle +- newmat - nextsilicon-cpp-subprocess +- nfrechette-acl +- nghttp3 - ninja - nlohmann_json +- nlopt +- nmea +- nmos-cpp +- nmslib - nng - nodejs +- nodesoup - norm +- npcap +- nsimd +- nspr - nsync +- ntv2 - nudb +- nuklear - numcpp - nuraft - nv-codec-headers +- nvtx +- oatpp +- oatpp-postgresql +- objectbox +- objectbox-generator +- observer-ptr-lite +- octo-encryption-cpp +- octo-keygen-cpp +- octo-logger-cpp +- octo-wildcardmatching-cpp - octomap - odbc +- ode - ogdf - ogg +- ohnet - ois +- onedpl - onetbb +- oniguruma - onnx - onnxruntime +- open-dis-cpp +- open-simulation-interface +- open62541 - openal - openal-soft - openapi-generator - openblas +- opencascade - opencl-clhpp-headers - opencl-headers - opencl-icd-loader - opencolorio - opencore-amr +- opencv +- openddl-parser +- opene57 - openexr +- openfbx +- openfst +- openfx - opengl +- opengl-registry - opengv - openh264 - openjdk - openjpeg - openmesh +- openmvg +- openpam - openssl - opensubdiv +- opentdf-client - opentelemetry-cpp - opentelemetry-proto +- opentracing-cpp +- openvino +- openxlsx - optional-lite - opus - opusfile - orcania - osqp - out_ptr +- outcome +- ozz-animation - p-ranav-glob - paho-mqtt-c - paho-mqtt-cpp +- panzi-portable-endian +- parallel-hashmap +- parg +- parson - patchelf +- pbtools - pcapplusplus - pcg-cpp +- pcl - pcre - pcre2 +- pdcurses +- pdf-writer - pdfgen +- pdfium +- pdqsort +- perf +- perfetto +- perlinnoise +- pexports +- pffft - pfr +- pgm-index +- physfs - physx - picobench - picojson +- picosha2 +- pipes - pixman - pkgconf +- platform.converters +- platform.delegates +- platform.equality +- platform.exceptions - platform.hashing +- platform.interfaces +- playrho +- plf_colony +- plf_indiesort +- plf_list +- plf_nanotimer +- plf_queue +- plf_stack +- plog +- plusaes - plutovg +- pngpp - poco +- poly2tri +- polylabel +- polylineencoder +- polymorphic_value +- poppler-data - popt - portable-file-dialogs +- poshlib - pprint - pranav-csv2 - pretty-name +- procxx-boost-ext-simd - proj - prometheus-cpp - proposal - protobuf - protobuf-c +- protopuf +- protozero - psimd +- psyinf-gmtl +- ptex - pthreadpool - pthreads4w - pugixml - pulseaudio +- pupnp - pybind11 +- pybind11_json - pystring +- qarchive +- qcbor +- qdbm - qhull - qpdf +- qpoases +- qr-code-generator +- qt +- qtawesome - quantlib - quaternions +- quazip +- quickfix +- quickjs - quill - quirc +- qwt - r8brain-free-src - rabbitmq-c - ragel - rang - range-v3 +- rangeless +- rangesnext - rapidcheck - rapidcsv - rapidfuzz @@ -676,143 +1098,284 @@ required_for_references: - rapidyaml - raylib - re2 +- re2c +- reactiveplusplus +- read-excel - readerwriterqueue - readline - readosm +- recastnavigation +- reckless +- rectanglebinpack - rectpack2d +- redboltz-mqtt_cpp - redis-plus-plus +- refl-cpp - replxx +- resource_pool - restbed - restinio +- rg-etc1 +- rgbcx - ring-span-lite - rmm - roaring - robin-hood-hashing +- rocksdb +- rpclib +- rply +- rsync +- rtklib - rtm +- rtmidi - rttr - ruy +- rvo2 +- rxcpp +- s2geometry - s2n +- safeint +- sail - samurai - sbepp - sbp +- scdoc - scip +- scippp - scnlib - scons +- scope-lite - screen_capture_lite - sdbus-cpp +- sdf - sdl - sdl_image +- sdl_net - sdl_ttf - seadex-essentials +- seasocks - semimap +- semver.c - sentry-breakpad - sentry-crashpad - sentry-native +- seqan +- seqan3 - serd - serdepp +- serf +- serial - sfml +- shapelib - shield +- si +- signals-light - sigslot - simde - simdjson - simdutf - simple-websocket-server +- simple-yaml - sjson-cpp - skyr-url - sml - snappy +- snitch - snowhouse +- so5extra +- sobjectizer - soci +- sofa +- sokol +- sol2 - sonic-cpp - sophus - soplex +- soundtouch - source_location - soxr - span-lite - spdlog +- spectra - spirv-cross - spirv-headers - spirv-tools +- spscqueue +- spy +- sqlcipher - sqlite3 - sqlite_orm - sqlitecpp - sqlpp11 +- sqlpp11-connector-sqlite3 +- squirrel - ssht +- ssp +- st_tree +- statslib - status-code +- status-value-lite - stb +- stc +- stdgpu +- stduuid - stlab - strawberryperl +- streamvbyte - string-view-lite - stringtoolbox +- stringzilla - strong_type - structopt +- stx +- subunit +- sundials +- suyash-ulid +- svector +- svgpp - svgwrite - symengine +- systemc +- systemc-cci - szip - tabulate +- taglib - taocpp-json +- taocpp-operators - taocpp-pegtl +- taocpp-sequences +- taocpp-taopq +- taocpp-tuple - taskflow +- taywee-args - tcb-span - tcl - tclap +- tcp-wrappers +- tcsbank-uconfig +- tcsbank-uri-template +- teemo - tensorflow-lite - tensorpipe - termcap - termcolor +- tesseract +- tgbot +- tgc - thelink2012-any - threadpool - thrift - thrust +- tidy-html5 - timsort +- tinkerforge-bindings +- tiny-aes-c +- tiny-bignum-c +- tiny-dnn +- tiny-regex-c +- tiny-utf8 +- tinyalsa +- tinycbor - tinycthread - tinycthreadpool - tinydir - tinyexif +- tinyexr - tinygltf - tinymidi +- tinyobjloader +- tinyply +- tinyspline - tinyxml - tinyxml2 +- tixi3 +- tk +- tl - tl-expected - tl-function-ref +- tl-optional - tllist - tlx +- tmx +- tmxlite +- tng - toml11 +- tomlplusplus +- tracy +- transwarp - trantor +- tre +- tree-sitter +- tree-sitter-c - troldal-zippy +- trompeloeil +- tscns +- tsil +- tsl-array-hash +- tsl-hat-trie - tsl-hopscotch-map +- tsl-ordered-map +- tsl-robin-map +- tsl-sparse-map +- tuplet - turtle +- tweetnacl +- twitch-native-ipc +- twitchtv-libsoundtrackutil - type_safe - tz - ua-nodeset +- uchardet +- ulfius +- uncrustify - uni-algo - unicorn +- units - unity - univalue - unordered_dense - unqlite +- upx +- urdfdom - uriparser - usockets +- usrsctp +- utf8.h - utf8proc - utfcpp +- uthash - util-linux-libuuid - uvw +- uwebsockets +- v-hacd - vaapi +- valijson - variant-lite +- vc +- vcglib - vdpau +- vectorclass +- vectorial - veque +- very-simple-smtps - vincentlaucsb-csv-parser - vir-simd - visit_struct +- vk-bootstrap - vo-amrwbenc - volk - vorbis +- voropp - vsg - vtu11 - vulkan-headers - vulkan-loader - vulkan-memory-allocator - vulkan-validationlayers +- vvenc +- waf +- wasm-micro-runtime +- wasmedge - wasmer - wasmtime - wasmtime-cpp @@ -823,19 +1386,27 @@ required_for_references: - websocketpp - wg21-linear_algebra - wglext +- whereami - whisper-cpp +- wide-integer - wil +- wildmidi - winflexbison +- winmd - wiringpi - wise_enum - wolfssl - wslay - wt - wtl +- wyhash - xapian-core +- xbyak +- xege - xerces-c - xkbcommon - xkeyboard-config +- xlnt - xlsxio - xmlsec - xnnpack @@ -845,7 +1416,11 @@ required_for_references: - xorg-macros - xorg-makedepend - xorg-proto +- xorstr - xoshiro-cpp +- xpack +- xproperty +- xsd - xsimd - xtensor - xtl @@ -853,21 +1428,33 @@ required_for_references: - xxhash - xxsds-sdsl-lite - xz_utils +- yaclib - yajl - yaml-cpp +- yandex-ozo +- yas - yasm +- yder +- yoga - yyjson - z3 - zbar - zeromq - zfp - zimg +- zint - zlib - zlib-ng - zmarok-semver +- zmqpp - zookeeper-client-c +- zopfli - zpp_bits +- zpp_throwing - zstd +- zstr - zug - zulu-openjdk - zxing-cpp +- zyre +- zziplib diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index 5241e481d134fb..bb61be1f4e1b0d 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 1.60.1 + version: 1.61.0 artifactory: url: "https://c3i.jfrog.io/c3i" @@ -41,14 +41,15 @@ tasks: - name: "license/cla" - name: "continuous-integration/jenkins/pr-merge" - name: "c3i/conan-v2/pr-merge" - required_for_references: "conan_v2_ready_references.yml" build_single_reference: package_id_cache_type: "none" timeout_minutes: 600 - large_timeout_minutes: 800 + large_timeout_minutes: 900 large_timeout_references: - boost - qt + - llvm + parallel_strategy: unlimited cci: conan_v2_run_export: false write_comments: true @@ -58,8 +59,13 @@ tasks: job_name: "prod-v2/cci" # e.g. "cci-v2/cci" -> this means waiting for cci-v2/cci/PR- timeout_seconds: 600 # Maximum time to wait for the multibranch job merge_messages: true # Merge messages from the multibranch job waited for + merge_labels: true # Merge labels from the multibranch job waited for + job_relauncher: + job_names: + - prod-v1/cci + - prod-v2/cci scheduled_export_check: - report_issue_url: https://github.com/conan-io/conan-center-index/issues/2232 + report_issue_url: https://github.com/conan-io/conan-center-index/issues/20516 report_issue_append: false validate_infrastructure: macos_executors: 2 @@ -68,17 +74,6 @@ tasks: # Profile configurations to build packages configurations: - - id: linux-gcc - epochs: [0] - hrname: "Linux, GCC" - content: - - os: [ "Linux" ] - arch: [ "x86_64" ] - compiler: - - "gcc": - compiler.libcxx: [ "libstdc++11" ] - compiler.version: [ "5", "7", "9", "10" ] - build_type: [ "Release", "Debug" ] - id: linux-gcc epochs: [20211221, 20220120, 20230606] hrname: "Linux, GCC" @@ -101,17 +96,6 @@ configurations: compiler.libcxx: ["libstdc++", "libc++"] compiler.version: ["12", "13"] build_type: ["Release", "Debug"] - - id: macos-clang - epochs: [0, 20211221] - hrname: "macOS, Clang" - content: - - os: [ "Macos" ] - arch: [ "x86_64" ] - compiler: - - "apple-clang": - compiler.version: [ "11.0", "12.0" ] - compiler.libcxx: [ "libc++" ] - build_type: [ "Release", "Debug" ] - id: macos-clang epochs: [20220120, 20230606] hrname: "macOS, Clang" @@ -123,20 +107,6 @@ configurations: compiler.version: [ "13.0" ] compiler.libcxx: [ "libc++" ] build_type: [ "Release", "Debug" ] - - id: macos-m1-clang - epochs: [0, 20211221] - hrname: "macOS, Clang (M1/arm64)" - build_profile: - os: "Macos" - arch: "x86_64" - content: - - os: [ "Macos" ] - arch: [ "armv8" ] - compiler: - - "apple-clang": - compiler.version: [ "12.0" ] - compiler.libcxx: [ "libc++" ] - build_type: [ "Release", "Debug" ] - id: macos-m1-clang epochs: [20220120, 20230606] hrname: "macOS, Clang (M1/arm64)" diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index 7aaabf1c918f16..69f002da7a5381 100644 --- a/.c3i/config_v2.yml +++ b/.c3i/config_v2.yml @@ -3,7 +3,15 @@ id: 'conan-io/conan-center-index' conan: - version: 2.0.8 + version: 2.0.12 + backup_sources: + upload_url: "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/" + download_url: "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/" + + globalconf: + - 'core.sources:download_cache={{ CONFIG_HOME }}/backup_sources_cache' + - 'core.sources:download_urls=["{{ ARTI_DOWNLOAD_URL }}", "origin"]' + - 'core.sources:upload_url={{ ARTI_UPLOAD_URL }}' artifactory: url: "https://c3i.jfrog.io/c3i" @@ -27,10 +35,13 @@ tasks: build_single_reference: package_id_cache_type: "none" timeout_minutes: 600 - large_timeout_minutes: 800 + large_timeout_minutes: 900 large_timeout_references: - boost - qt + - llvm + - gstreamer + parallel_strategy: unlimited cci: conan_v2_run_export: false detailed_status_checks: false @@ -38,9 +49,9 @@ tasks: update_labels: false user_feedback: title: "Conan v2 pipeline" - description: "> **Note**: Conan v2 builds may be required once they are on the [v2 ready](https://github.com/conan-io/conan-center-index/blob/master/.c3i/conan_v2_ready_references.yml) list" + description: "> **Note**: Conan v2 builds are now mandatory. Please read our [discussion](https://github.com/conan-io/conan-center-index/discussions/19104) about it." regression: "> **Regression**: Conan v2 builds are mandatory and they are required for the PR to be merged, because this recipe worked with Conan v2 previously." - text_on_failure: "The v2 pipeline failed. Please, review the errors and note this will be required for pull requests to be merged in the near future." + text_on_failure: "The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping `@conan-io/barbarians` on the PR and we will help you." collapse_on_success: false collapse_on_failure: true list_packages: @@ -95,21 +106,6 @@ configurations: compiler.version: ["13" ] compiler.libcxx: [ "libc++" ] build_type: [ "Release"] - - id: windows-msvc - epochs: [0, 20211221, 20220120, 20220628] - hrname: "Windows, MSVC" - build_profile: - os: "Windows" - content: - - os: [ "Windows" ] - arch: [ "x86_64" ] - compiler: - - "msvc": - compiler.version: [ "192" ] - build_type: - - "Release": - compiler.runtime: ["dynamic"] - compiler.runtime_type: [ "Release" ] - id: windows-msvc epochs: [20230606] hrname: "Windows, MSVC" diff --git a/.c3i/reviewers.yml b/.c3i/reviewers.yml index 6c7ecd5befbc8f..3578b7dccdc685 100644 --- a/.c3i/reviewers.yml +++ b/.c3i/reviewers.yml @@ -37,7 +37,7 @@ reviewers: type: "community" request_reviews: false - user: "prince-chrismc" - type: "team" + type: "community" request_reviews: false - user: "Croydon" type: "community" @@ -84,3 +84,6 @@ reviewers: - user: "davidsanfal" type: "team" request_reviews: false + - user: "juansblanco" + type: "team" + request_reviews: false diff --git a/.github/workflows/alert-community.yml b/.github/workflows/alert-community.yml index 2df6d8d62a6c1d..405926199ff5e9 100644 --- a/.github/workflows/alert-community.yml +++ b/.github/workflows/alert-community.yml @@ -24,12 +24,12 @@ jobs: - uses: ./.github/actions/alert-community with: files: ".github/*/*" - reviewers: "@ericLemanissier @prince-chrismc @Croydon" + reviewers: "@ericLemanissier @Croydon" - uses: ./.github/actions/alert-community with: files: "linter/*/*" - reviewers: "@ericLemanissier @prince-chrismc @Croydon" + reviewers: "@ericLemanissier @Croydon" - uses: ./.github/actions/alert-community with: @@ -430,3 +430,8 @@ jobs: with: files: "recipes/zstd/*/*" reviewers: "@Hopobcn" + + - uses: ./.github/actions/alert-community + with: + files: "recipes/libhal/*/*" + reviewers: "@kammce" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e3e7f52de2da86..6e24832e93e988 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ To contribute follow the next steps: 1. Comment in the corresponding issue that you want to contribute the package/fix proposed. If there is no open issue, we strongly suggest opening one to gather feedback. -2. Make sure to [request access](docs/adding_packages/README.md#request-access) and be aware there is a [CLA](docs/CONTRIBUTOR_LICENSE_AGREEMENT.md). +2. Make sure to [request access](docs/adding_packages/README.md#request-access) and be aware there is a [contributor licenses agreement](https://cla-assistant.io/conan-io/conan-center-index). 3. Get setup by following the [Developing Recipes](docs/developing_recipes_locally.md) guide and learn the basic commands. 4. Check the [How To Add Packages](docs/adding_packages/README.md) page for the break down of ConanCenterIndex specific conventions and practices. 5. In your fork create a `package/xxx` branch from the `master` branch and develop diff --git a/docs/CONTRIBUTOR_LICENSE_AGREEMENT.md b/docs/CONTRIBUTOR_LICENSE_AGREEMENT.md deleted file mode 100644 index 39acf20a7aebd5..00000000000000 --- a/docs/CONTRIBUTOR_LICENSE_AGREEMENT.md +++ /dev/null @@ -1,23 +0,0 @@ -Conan-Center-Index project Contributor License Agreement --------------------------------------------------------- - -The following terms are used throughout this agreement: - -- You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it. -- Contribution - any type of work that is submitted to the repository, including any modifications or additions to existing work. -- Project - Conan-Center-Index project (https://github.com/conan-io/conan-center-index) -- Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with the copyright owner, contributors or maintainers. - -1. Grant of Copyright License. - - Subject to the terms and conditions of this agreement, You grant to JFrog LTD, a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your contributions and such derivative works. - -2. Grant of Patent License. - - Subject to the terms and conditions of this agreement, You grant to JFrog LTD, a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your contributions, where such license applies only to those patent claims licensable by you that are necessarily infringed by your contribution or by combination of your contribution with the project to which this contribution was submitted. - - If any entity institutes patent litigation - including cross-claim or counterclaim in a lawsuit - against You alleging that your contribution or any project it was submitted to constitutes or is responsible for direct or contributory patent infringement, then any patent licenses granted to that entity under this agreement shall terminate as of the date such litigation is filed. - -3. Source of Contribution. - - Your contribution is either your original creation, based upon previous work that, to the best of your knowledge, is covered under an appropriate open source license and you have the right under that license to submit that work with modifications, whether created in whole or in part by you, or you have clearly identified the source of the contribution and any license or other restriction (like related patents, trademarks, and license agreements) of which you are personally aware. diff --git a/docs/adding_packages/README.md b/docs/adding_packages/README.md index 3f310562fdf6a1..409f61c38fc0eb 100644 --- a/docs/adding_packages/README.md +++ b/docs/adding_packages/README.md @@ -30,7 +30,7 @@ generally approved on a weekly basis. Feel free to continue to step :two: while > All interactions are subject to the expectations of the [code of conduct](../code_of_conduct.md). Any misuse or inappropriate behavior > are subject to the same principals. -When submitting a pull request for the first time, you will be prompted to sign the [CLA](../CONTRIBUTOR_LICENSE_AGREEMENT.md) for your +When submitting a pull request for the first time, you will be prompted to sign the [CLA](https://cla-assistant.io/conan-io/conan-center-index) for your code contributions. You can view your signed CLA's by going to and signing in. ## Inactivity and user removal diff --git a/docs/adding_packages/conandata_yml_format.md b/docs/adding_packages/conandata_yml_format.md index e1b7f89ee31733..ed96865802cc0a 100644 --- a/docs/adding_packages/conandata_yml_format.md +++ b/docs/adding_packages/conandata_yml_format.md @@ -127,7 +127,7 @@ Usually, `url` has a [https](https://tools.ietf.org/html/rfc2660) scheme, but ot [sha256](https://tools.ietf.org/html/rfc6234) is a preferred method to specify hash sum for the released sources. It allows to check the integrity of sources downloaded. You may use an [online service](https://hash.online-convert.com/sha256-generator) to compute `sha256` sum for the given `url`. -Also, you may use [sha256sum](https://linux.die.net/man/1/sha256sum) command ([windows](http://www.labtestproject.com/files/win/sha256sum/sha256sum.exe)). +Also, you may use [sha256sum](https://linux.die.net/man/1/sha256sum) command ([windows](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-filehash?view=powershell-7.4) you can use PowerShell). ## patches diff --git a/docs/adding_packages/conanfile_attributes.md b/docs/adding_packages/conanfile_attributes.md index 0044d960505ba4..fb7a767a13b959 100644 --- a/docs/adding_packages/conanfile_attributes.md +++ b/docs/adding_packages/conanfile_attributes.md @@ -49,14 +49,26 @@ In order to create reproducible builds, we also "commit-lock" to the latest comm ### License Attribute -The mandatory license attribute of each recipe **should** be a [SPDX license](https://spdx.org/licenses/) [short Identifiers](https://spdx.dev/ids/) when applicable. +The license attribute is a mandatory field which provides the legal information that summarizes the contents saved in the package. These follow the +[SPDX license](https://spdx.org/licenses/) as a standard. This is for consummers, in particular in the enterprise sector, that do rely on SDPX compliant identifiers so that they can flag this as a custom license text. -Where the SPDX guidelines do not apply, packages should do the following: +* If the library has a license that has a SPDX identifier, use the [short Identifiers](https://spdx.dev/ids/). +* If the library has a license text that does not match a SPDX identifier, including custom wording disclaiming copyright or dedicating the words to the ["public domain"](https://fairuse.stanford.edu/overview/public-domain/welcome/), use the [SPDX License Expressions](https://spdx.github.io/spdx-spec/v2-draft/SPDX-license-expressions/), this can follow: + * `LicenseRef-` as a prefix, followed by the name of the library. For example:`LicenseRef-libfoo-public-domain` +* If the library makes no mention of a license and the terms of use - it **shall not be accepted in ConanCenter** , even if the code is publicly available in GitHub or any other platforms. -* Packages without a license or closed source cannot be accepted in ConanCenter, even if the code is publicly available in Github or other platforms. -* When some package is under the ["public domain"](https://fairuse.stanford.edu/overview/public-domain/welcome/) - these are not a license by itself. The author original intent and files should be respected, and the relevant files defining the "public domain" status should be the ones packaged in the "licenses" folder, for example the source repository README. The ``license`` field should be as close as the original one as possible, like ``license = "Public-domain"``. -* When a custom (e.g. project specific) license is given, the value should be set to `LicenseRef-` as a prefix, followed by the name of the file which contains the custom license. See [this example](https://github.com/conan-io/conan-center-index/blob/e604534bbe0ef56bdb1f8513b83404eff02aebc8/recipes/fft/all/conanfile.py#L8). For more details, [read this conversation](https://github.com/conan-io/conan-center-index/pull/4928/files#r596216206). +In case the license changes in a new release, the recipe should update the license attribute accordingly: +```python +class LibfooConan(ConanFile): + license = ("MIT", "BSD-3-Clause") # keep both old and new licenses, so conan inspect can find it + + def configure (self): + # change the license according to the version, so conan graph info can show the correct one + + # INFO: Version < 2.0 the license was MIT, but changed to BSD-3-Clause now. + self.license = "BSD-3-Clause" if Version(self.version) >= "2.0.0" else "MIT" +``` ## Order of methods and attributes diff --git a/docs/adding_packages/dependencies.md b/docs/adding_packages/dependencies.md index a45c6c0f3c31c6..a69f895483ed0a 100644 --- a/docs/adding_packages/dependencies.md +++ b/docs/adding_packages/dependencies.md @@ -174,15 +174,21 @@ for consumer, we do impose some limits on Conan features to provide a smoother f * [`python_requires`](https://docs.conan.io/1/reference/conanfile/other.html#python-requires) are not allowed. ### Version Ranges - + Version ranges are a useful Conan feature, [documentation here](https://docs.conan.io/2/tutorial/versioning/version_ranges.html). With the introduction of Conan 2.0, we are currently working to allow the use of version ranges and are allowing this for a handful of dependencies. Currently, these are: * OpenSSL: `[>=1.1 <4]` for libraries known to be compatible with OpenSSL 1.x and 3.x -* CMake: `[>3.XX <4]`, where `3.XX` is the minimum version of CMake required by the relevant build scripts. +* CMake: `[>3.XX <4]`, where `3.XX` is the minimum version of CMake required by the relevant build scripts +* Libcurl: `[>=X.YY <9]`, where `X.YY` is the minimum version of Libcurl required, starting from `7.78` + +> **Note**: You might also see Zlib ranges in some PR by CCI maintainers. +> We're adding them little by little to avoid missing binaries and conflict errors. +> Please do not open PRs moving Zlib to ranges for now, we'll update this page when PRs are free to add new ranges. + -> **Warning**: With Conan 1.x, [version ranges](https://docs.conan.io/1/versioning/version_ranges.html) adhere to a much more strict sematic version spec, +> **Warning**: With Conan 1.x, [version ranges](https://docs.conan.io/1/versioning/version_ranges.html) adhere to a much more strict sematic version spec, > OpenSSL 1.1.x does not follow this so the client will not resolve to that range and will pick a 3.x version. In order to select a lower version you > can user the defunct `--require-override openssl/1.1.1t@` from the command line, or override from the recipe with `self.requires(openssl/1.1.1t, override=True)` > to ensure a lower version is picked. diff --git a/docs/adding_packages/folders_and_files.md b/docs/adding_packages/folders_and_files.md index 0136f36792b5b2..b5a51c8d603097 100644 --- a/docs/adding_packages/folders_and_files.md +++ b/docs/adding_packages/folders_and_files.md @@ -140,7 +140,7 @@ When a package needs other packages those can be include with the `requirements( ```python def requirements(self): - self.require("fmt/9.0.0") + self.requires("fmt/9.0.0") ``` For more information see the [Dependencies](dependencies.md) documentation. diff --git a/docs/adding_packages/sources_and_patches.md b/docs/adding_packages/sources_and_patches.md index 66f10a12327268..56ff5130c26e4c 100644 --- a/docs/adding_packages/sources_and_patches.md +++ b/docs/adding_packages/sources_and_patches.md @@ -16,8 +16,7 @@ These are a very important aspects and it helps us to establish the quality of t * [Format and Conventions](#format-and-conventions) * [Exporting Patches](#exporting-patches) * [Applying Patches](#applying-patches) - * [Rules](#rules) - * [Exceptions](#exceptions) + * [Policy on patches](#policy-on-patches) ## Picking the Sources @@ -138,62 +137,13 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "${CMAKE_SOURCE_DIR}", "${CMAKE_CURRENT_SOURCE_DIR}") ``` -### Rules - -These are the rules that apply to regular versions of Conan packages: - -**Build system patches.** In order to add libraries into ConanCenter sometimes -it is NEEDED to apply patches so they can consume existing packages -for requirements and binaries can be generated. These patches are totally -needed for the purpose of ConanCenter and Conan keeps adding features trying -to minimize these changes. - -**Source patches.** ConanCenter DOES NOT accept patches **backporting bugfixes or -features** from upcoming releases, they break the principle of minimum surprise, -they change the behavior of the library and it will no longer match the -documentation or the changelog originally delivered by the authors. - -However, ConanCenter DOES accept **working software patches**, these patches -are needed to generate the binaries for architectures not considered by -library maintainers, or to use some compilers or configurations. These patches -make it possible to generate binaries that cannot be generated otherwise, or -they can turn a crashing binary into a working software one (bugs, errors, or -faults are considered working software as long as they produce deterministic -results). - -Patches to sources to add support to newer versions of dependencies are -considered feature patches and they are not allowed either. They can -introduce new behaviors or bugs not considered when delivering the -library by maintainers. If a requirement is known not to work, the recipe -should raise a `ConanInvalidConfiguration` from the `validate()` method. - -**Vulnerability patches.** Patches published to CVE databases or declared as -vulnerabilities by the authors in non-mainstream libraries WILL be applied -to packages generated in Conan Center. - -**Official release patches.** If the library documents that a patch should be -applied to sources when building a tag/release from sources, ConanCenter WILL -apply that patch too. This is needed to match the documented behavior or the -binaries of that library offered by other means. -[Example here](https://www.boost.org/users/history/version_1_73_0.html). - -### Exceptions - -Exceptionally, we might find libraries that aren't actively developed and consumers -might benefit from having some bugfixes applied to previous versions while -waiting for the next release, or because the library is no longer maintained. These -are the rules for this exceptional scenario: - -* **new release**, based on some official release and clearly identifiable will - be created to apply these patches to: <>. -* **only patches backporting bugfixes** will be accepted after they have - been submitted to the upstream and there is a consensus that it's a bug and the patch is the solution. - -ConanCenter will build this patched release and serve its binaries like it does with -any other Conan reference. - -Notice that these <> releases are unique to ConanCenter -and they can get new patches or discard existing ones according to upstream -considerations. It means that these releases will modify their behavior without previous -notice, the documentation or changelog for these specific releases won't exist. Use -them carefully in your projects. +### Policy on patches + +Conan Center is a package repository, and the aim of the service is to provide the recipes to build libraries from the sources as provided by the library authors, and to provide binaries for Conan Center’s supported platforms and configurations. + +In general, patches to source code should be avoided and only done as a last resort. In situations where it is strictly necessary, the aim should be that the patches could be eventually merged upstream so that in the future they are no longer necessary. + +Pull Requests that introduce patches will be carefully reviewed by the Conan Team. We recognize that in some instances, patches are necessary in the build system/build scripts. +Patches that affect C and C++ code are strongly discouraged and will only be accepted at the discretion of the Conan Team, after a strict validation process. Patches are more likely to be accepted if they are first reported and acknowledged by the library authors. + +For scenarios that require patching source code, we greatly encourage raising a new issue explaining the need and motivation, reproducible steps and complete logs, behind the patch. Please note that for issues that strictly affect C and C++ source code, it is very unlikely that a patch will be accepted if an issue is not first raised with the original library authors, or if the patches are not addressing a known security advisory. diff --git a/docs/changelog.md b/docs/changelog.md index 4ea36e44e8667d..10cbbd6810dde2 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,6 +1,69 @@ # Changelog -### 19-Jul-2023 - 09:45 CEST +### 05-December-2023 - 16:23 CET + +- [fix] Use the correct profile to test a tool_require. +- [feature] Add armv8 extra flag in profile arch when building in Macos M1. +- [fix] Prioritization of non-shared builds. +- [fix] Do not raise an exception in case slack fails. +- [fix] Remove epochs. +- [fix] Remove some dead code. + +### 26-Oct-2023 - 12:13 CEST + +- [feature] Allow X.Y semver for version bumps +- [feature] Add assert message for parent commit checks on PR checkout +- [feature] JobRelauncher restarts both Conan v1 and v2 pipelines. +- [fix] Do not close the report issue of the recipe export check + +### 11-Oct-2023 - 12:17 CEST + +- [feature] Update Conan 2.x to the version 2.0.12 in the CI +- [feature] Update Conan 1.x to the version 1.61.0 in the CI + +### 06-Oct-2023 - 10:15 CEST + +- [feature] Label PRs with version conflict properly +- [feature] Add motivation message when under maintenance +- [feature] Wait for sibling job in master right before promote +- [fix] No longer run Conan v2 export step +- [fix] Ensure build order follows only static first +- [fix] Disable quiet period for all jobs except CCI multibranch + +### 25-Sep-2023 - 14:33 CEST + +- [feature] Label PRs that have missing dependencies. +- [feature] Remove check regression for Conan v2 pipeline. +- [feature] Start deprecating epochs support in profile configurations. +- [fix] Run TapaholesRepo job only once per week. +- [fix] Run ListPackages job only once per week. + +### 01-Sep-2023 - 19:58 CEST + +- [fix] Use Unix separators for Windows folder path when creating CI workspace. + +### 31-August-2023 - 12:57 CEST + +- [feature] Support specific PR number for Automatic Merge. +- [feature] Use temporary folder for build workspace. +- [fix] Rename BuildSingleReference folder to bsr to overcome Windows long path. +- [fix] Remove graph info from logs to avoid long loading. +- [fix] Remove deprecated search index for Conan Center. + +### 17-August-2023 - 11:42 CEST + +- [fix] Fix type error when catching generic exceptions in Jenkins +- [fix] Bump dependencies no longer allow version range +- [feature] Show recipe revision on the pull-request summary table + +### 04-August-2023 - 10:26 CEST + +- [feature] Enable Conan 2.0.8 +- [feature] Enable Conan 1.60.2 +- [feature] Update Jenkins server version +- [hotfix] Better error management when having CI build timeout + +### 19-July-2023 - 09:45 CEST - [fix] Fix message processing if no message is passed. - [fix] Fix automatic merge priority to follow the correct PR order. diff --git a/docs/developing_recipes_locally.md b/docs/developing_recipes_locally.md index e34902537f2b67..2d101facc3b5ee 100644 --- a/docs/developing_recipes_locally.md +++ b/docs/developing_recipes_locally.md @@ -22,6 +22,7 @@ This file is intended to provide all the commands you need to run in order to be * [Yamlschema](#yamlschema) * [Testing the different `test__package`](#testing-the-different-test__package) * [Testing more environments](#testing-more-environments) + * [Docker build images used by ConanCenterIndex](#docker-build-images-used-by-conancenterindex) * [Using Conan 2.0](#using-conan-20) * [Installing Conan 2.0 beta](#installing-conan-20-beta) * [Trying it out](#trying-it-out) @@ -42,7 +43,7 @@ This file is intended to provide all the commands you need to run in order to be ### Installing the ConanCenter Hooks -> **Warning**: This is not yet supported with Conan 2.0 +> **Warning**: This is not yet supported with Conan 2.0. Please, follow the instructions below only in case you are using Conan 1.0. The system will use the [conan-center hooks](https://github.com/conan-io/hooks) to perform some quality checks. You can install the hooks by running: @@ -221,6 +222,29 @@ If you are working with packages that have system dependencies that are managed docker run -e CONAN_SYSREQUIRES_MODE=enabled conanio/gcc11-ubuntu16.04 conan install fmt/9.0.0@ -if build --build missing -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=yes ``` +#### Docker build images used by ConanCenterIndex + +The Conan Center Index uses [Conan Docker Tools](https://github.com/conan-io/conan-docker-tools/) to build packages in a variety of environments. All images are hosted in [Docker Hub](https://hub.docker.com/u/conanio). The relation of the images with the build configurations is available according to the Conan configuration, as `node_labels.Linux`, for instance: + + +```yaml +node_labels: + Linux: + x86_64: + "gcc": + default: "linux_gcc_${compiler.version}" + "11": "linux_gcc_${compiler.version}_ubuntu16.04" + "clang": + default: "linux_clang_${compiler.version}_ubuntu16.04" + "11": "linux_clang_${compiler.version}" +``` + +The configuration files are located in the folder [../.c3i](../.c3i). Currently are the files [config_v1.yml](../.c3i/config_v1.yml) and [config_v2.yml](../.c3i/config_v2.yml). The configuration file `config_v1.yml` is used by the Conan 1.0 client, while `config_v2.yml` is used by the Conan 2.0 client. + +The label `linux` refers to any Docker image, while `gcc_${compiler.version}` refers to GCC + a compiler version. For example, `linux_gcc_10` refers to the image `conanio/gcc10`. +The suffix `_ubuntu16.04` refers to the base image used by the Docker image, in this case, `ubuntu16.04`. So, `"11": "linux_gcc_${compiler.version}_ubuntu16.04"` means that the image `conanio/gcc11-ubuntu16.04`. Thus, all GCC versions use `conanio/gcc`, except for the GCC 11, which uses `conanio/gcc11-ubuntu16.04`. The same applies to Clang. + + ## Using Conan 2.0 Everything you need to know about the methods, commands line, outputs can be found in the diff --git a/docs/faqs.md b/docs/faqs.md index b84d6e6a091023..8fc8cb331f1212 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -10,7 +10,6 @@ This section gathers the most common questions from the community related to pac * [What is the policy on creating packages from pre-compiled binaries?](#what-is-the-policy-on-creating-packages-from-pre-compiled-binaries) * [Should reference names use `-` or `_`?](#should-reference-names-use---or-_) * [Why are CMake find/config files and pkg-config files not packaged?](#why-are-cmake-findconfig-files-and-pkg-config-files-not-packaged) - * [Should recipes export a recipe's license?](#should-recipes-export-a-recipes-license) * [Why recipes that use build tools (like CMake) that have packages in Conan Center do not use it as a build require by default?](#why-recipes-that-use-build-tools-like-cmake-that-have-packages-in-conan-center-do-not-use-it-as-a-build-require-by-default) * [How are rare build systems without generators packaged?](#how-are-rare-build-systems-without-generators-packaged) * [Are python requires allowed in the `conan-center-index`?](#are-python-requires-allowed-in-the-conan-center-index) @@ -24,6 +23,7 @@ This section gathers the most common questions from the community related to pac * [Doesn't this make debug builds useless?](#doesnt-this-make-debug-builds-useless) * [Can I remove an option from a recipe?](#can-i-remove-an-option-from-a-recipe) * [Can I split a project into an installer and library package?](#can-i-split-a-project-into-an-installer-and-library-package) + * [Should recipes export a recipe's license?](#should-recipes-export-a-recipes-license) * [What license should I use for Public Domain?](#what-license-should-i-use-for-public-domain) * [What license should I use for a custom project specific license?](#what-license-should-i-use-for-a-custom-project-specific-license) * [How do I flag a problem to a recipe consumer?](#how-do-i-flag-a-problem-to-a-recipe-consumer) @@ -103,10 +103,6 @@ If you really think this is an issue and there is something missing to cover the \* Take a look at the integrations section to learn more: https://docs.conan.io/1/integrations/build_system/cmake/cmake_find_package_generator.html -## Should recipes export a recipe's license? - -No, recipes do not need to export a recipe license. Recipes and all files contributed to this repository are licensed under the license in the root of the repository. Using any recipe from this repository or directly from conan-center implies the same licensing. - ## Why recipes that use build tools (like CMake) that have packages in Conan Center do not use it as a build require by default? We generally consider tools like CMake as a standard tool to have installed in your system. Having the `cmake` package as a build require in **all** the recipes that use it will be an overkill, as every build requirement is installed like a requirement and takes time to download. However, `cmake` could still be useful to use in your profile: @@ -209,6 +205,10 @@ After one month, we will welcome a PR removing the option that was deprecated. No. Some projects provide more than a simple library, but also applications. For those projects, both libraries and executables should be kept together under the same Conan package. In the past, we tried to separate popular projects, like Protobuf, and it proved to be a complex and hard task to be maintained, requiring custom patches to disable parts of the building. Also, with the [context](https://docs.conan.io/1/systems_cross_building/cross_building.html#conan-v1-24-and-newer) feature, we can use the same package as build requirement, for the same build platform, and as a regular requirement, for the host platform, when cross-building. It's recommended using 2 profiles in that case, one for build platform (where the compilation tools are being executed) and one for host platform (where the generated binaries will run). +## Should recipes export a recipe's license? + +No, recipes do not need to export a recipe license. Recipes and all files contributed to this repository are licensed under the license in the root of the repository. Using any recipe from this repository or directly from conan-center implies the same licensing. + ## What license should I use for Public Domain? See [License Attribute](adding_packages/conanfile_attributes.md#license-attribute) for details. 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 51ea9a72fb9541..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 { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", "Visual Studio": "15", - "msvc": "14.1", - "gcc": "5", - "clang": "5", - "apple-clang": "5.1", } # 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 ef4bad7fd4d3b3..617e18d12f4ad3 100644 --- a/docs/package_templates/meson_package/all/conanfile.py +++ b/docs/package_templates/meson_package/all/conanfile.py @@ -7,7 +7,7 @@ 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.microsoft import is_msvc from conan.tools.scm import Version import os @@ -35,23 +35,27 @@ class PackageConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "feature": [True, False], } default_options = { "shared": False, "fPIC": True, + "feature": True, } @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 @@ -67,8 +71,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 @@ -82,13 +86,11 @@ def validate(self): # validate the minimum cpp standard supported. For C++ projects only 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." - ) + 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.info.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") @@ -96,20 +98,27 @@ 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/0.63.3") + 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/1.9.3") + self.tool_requires("pkgconf/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + # Meson feature options must be set to "enabled" or "disabled" + feature = lambda option: "enabled" if option else "disabled" + # default_library and b_staticpic are automatically parsed when self.options.shared and self.options.fpic exist # buildtype is automatically parsed for self.settings tc = MesonToolchain(self) # In case need to pass definitions directly to the compiler tc.preprocessor_definitions["MYDEFINE"] = "MYDEF_VALUE" + # Meson features are typically enabled automatically when possible. + # The default behavior can be changed to disable all features by setting "auto_features" to "disabled". + tc.project_options["auto_features"] = "disabled" + tc.project_options["feature"] = feature(self.options.get_safe("feature")) # Meson project options may vary their types tc.project_options["tests"] = False tc.generate() @@ -133,11 +142,12 @@ def build(self): meson.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")) meson = Meson(self) meson.install() # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + 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")) 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 61b7b28c28d9d0..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,9 +18,9 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("meson/0.63.3") + 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/1.9.3") + self.tool_requires("pkgconf/2.0.3") def build(self): meson = Meson(self) 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/docs/review_process.md b/docs/review_process.md index 55eadf1bd07381..cf9d98f130d9b9 100644 --- a/docs/review_process.md +++ b/docs/review_process.md @@ -101,7 +101,7 @@ The bot runs Automatic Merges every 20 minutes. Currently, it can only merge a s PR is selected for the merge only if: - Author is already [approved](https://github.com/conan-io/conan-center-index/issues/4). -- Author has signed the [CLA](CONTRIBUTOR_LICENSE_AGREEMENT.md). +- Author has signed the [CLA](https://cla-assistant.io/conan-io/conan-center-index). - PR is not a Draft. - PR has a green status (successful build). - PR doesn't have merge conflicts with `master` branch. 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/linter/conandata_yaml_linter.py b/linter/conandata_yaml_linter.py index 9e7133803906ea..51d27b850beec7 100644 --- a/linter/conandata_yaml_linter.py +++ b/linter/conandata_yaml_linter.py @@ -92,17 +92,6 @@ def main(): " reviewing and consumers to evaluate patches" ) - # v2 migrations suggestion - if "base_path" in parsed["patches"][version][i]: - base_path = parsed["patches"][version][i]["base_path"] - print( - f"::notice file={args.path},line={base_path.start_line},endline={base_path.end_line}," - f"title=conandata.yml v2 migration suggestion" - "::'base_path' should not be required once a recipe has been upgraded to take advantage of" - " layouts (see https://docs.conan.io/en/latest/reference/conanfile/tools/layout.html) and" - " the new helper (see https://docs.conan.io/en/latest/reference/conanfile/tools/files/patches.html#conan-tools-files-apply-conandata-patches)" - ) - def pretty_print_yaml_validate_error(args, error): snippet = error.context_mark.get_snippet().replace("\n", "%0A") diff --git a/recipes/7bitconf/all/conandata.yml b/recipes/7bitconf/all/conandata.yml index 62dda78f205157..71f022ca93c84b 100644 --- a/recipes/7bitconf/all/conandata.yml +++ b/recipes/7bitconf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/7bitCoder/7bitConf/archive/refs/tags/v1.1.0.tar.gz" + sha256: "07e5bff366d66c276032021c9a9ca5cdb1d8f097b29c032d07ee6ae1a10885a2" "1.0.0": url: "https://github.com/7bitCoder/7bitConf/archive/refs/tags/v1.0.0.tar.gz" sha256: "48a02d331f4281c8ff691d55c54abe744228637e9ad3af500daf526f4c77696d" diff --git a/recipes/7bitconf/all/conanfile.py b/recipes/7bitconf/all/conanfile.py index 50d4e6434d0f0d..4865b328bad13d 100644 --- a/recipes/7bitconf/all/conanfile.py +++ b/recipes/7bitconf/all/conanfile.py @@ -57,7 +57,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("taocpp-json/1.0.0-beta.13", transitive_headers=True) + self.requires("taocpp-json/1.0.0-beta.14", transitive_headers=True) def package_id(self): if self.info.options.header_only: @@ -137,4 +137,3 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - diff --git a/recipes/7bitconf/config.yml b/recipes/7bitconf/config.yml index 40341aa3db6cd3..73c245662b08d6 100644 --- a/recipes/7bitconf/config.yml +++ b/recipes/7bitconf/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.0": + folder: all "1.0.0": folder: all diff --git a/recipes/7zip/19.00/conandata.yml b/recipes/7zip/19.00/conandata.yml index a080fa528823a9..e62dc40aa34ed1 100644 --- a/recipes/7zip/19.00/conandata.yml +++ b/recipes/7zip/19.00/conandata.yml @@ -1,4 +1,9 @@ sources: + "23.01": + url: + - https://www.7-zip.org/a/7z2301-src.tar.xz + - https://sourceforge.net/projects/sevenzip/files/7-Zip/23.01/7z2301-src.tar.xz + sha256: "356071007360e5a1824d9904993e8b2480b51b570e8c9faf7c0f58ebe4bf9f74" "22.01": url: - https://www.7-zip.org/a/7z2201-src.tar.xz diff --git a/recipes/7zip/19.00/conanfile.py b/recipes/7zip/19.00/conanfile.py index 746b1dee843e59..b1fa099b52650c 100644 --- a/recipes/7zip/19.00/conanfile.py +++ b/recipes/7zip/19.00/conanfile.py @@ -90,6 +90,12 @@ def _patch_sources(self): os.chmod(fn, 0o644) replace_in_file(self, fn, "-MT", f"-{self.settings.compiler.runtime}") replace_in_file(self, fn, "-MD", f"-{self.settings.compiler.runtime}") + if self.version < Version("23.01"): + replace_in_file(self, fn, "-WX", "") + + pfc = os.path.join(self.source_folder, "CPP", "7zip", "UI", "FileManager", "PanelFolderChange.cpp") + os.chmod(pfc, 0o644) + replace_in_file(self, pfc, r'L"\\"', r'static_cast(L"\\")') def build(self): self._patch_sources() diff --git a/recipes/7zip/config.yml b/recipes/7zip/config.yml index 906f1e74d1d7b6..5f2a8f313a5d8a 100644 --- a/recipes/7zip/config.yml +++ b/recipes/7zip/config.yml @@ -1,4 +1,6 @@ versions: + "23.01": + folder: "19.00" "22.01": folder: "19.00" "19.00": diff --git a/recipes/aaf/all/conanfile.py b/recipes/aaf/all/conanfile.py index 080c644424a04b..ee7906ff059366 100644 --- a/recipes/aaf/all/conanfile.py +++ b/recipes/aaf/all/conanfile.py @@ -38,7 +38,7 @@ def requirements(self): self.requires("expat/2.5.0") self.requires("libjpeg/9e") if self.settings.os in ("FreeBSD", "Linux"): - self.requires("libuuid/1.0.3") + self.requires("util-linux-libuuid/2.39") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) 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/acado/all/CMakeLists.txt b/recipes/acado/all/CMakeLists.txt deleted file mode 100644 index bdffdd1faa9c7d..00000000000000 --- a/recipes/acado/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(cmake_wrapper) - -set(CMAKE_CXX_STANDARD 11) - -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cmake") - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/acado/all/cmake/qpoases.cmake b/recipes/acado/all/cmake/qpoases.cmake index d9442915538900..c37969b71a13d5 100644 --- a/recipes/acado/all/cmake/qpoases.cmake +++ b/recipes/acado/all/cmake/qpoases.cmake @@ -1,16 +1,16 @@ -SET( ACADO_QPOASES_EMBEDDED_SOURCES +SET( ACADO_QPOASES_EMBEDDED_SOURCES ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/Bounds.cpp - ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/CyclingManager.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/CyclingManager.cpp ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/MessageHandling.cpp ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/QProblem.cpp ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/Utils.cpp ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/Constraints.cpp - ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/Indexlist.cpp + ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/Indexlist.cpp ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/QProblemB.cpp ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/SubjectTo.cpp ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC/EXTRAS/SolutionAnalysis.cpp ) -SET( ACADO_QPOASES_EMBEDDED_INC_DIRS +SET( ACADO_QPOASES_EMBEDDED_INC_DIRS ${CMAKE_CURRENT_LIST_DIR}/qpoases/ ${CMAKE_CURRENT_LIST_DIR}/qpoases/INCLUDE ${CMAKE_CURRENT_LIST_DIR}/qpoases/SRC diff --git a/recipes/acado/all/conandata.yml b/recipes/acado/all/conandata.yml index b0f501df265627..648b840430e1f4 100644 --- a/recipes/acado/all/conandata.yml +++ b/recipes/acado/all/conandata.yml @@ -4,7 +4,10 @@ sources: sha256: "cf0779e64dd5d20989e97340c04ecccf542fe8d993c96b53e5c465693cb354b7" patches: "1.2.2-beta": - - base_path: "source_subfolder" - patch_file: "patches/0001-binding-temp-object.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-read-template-path-from-env.patch" + - patch_file: "patches/0001-binding-temp-object.patch" + - patch_file: "patches/0002-read-template-path-from-env.patch" + patch_description: "Get TEMPLATE_PATHS from envvar instead of hard-coding" + patch_type: "conan" + - patch_file: "patches/0003-unvendor-qpoases3.patch" + patch_description: "Replace vendored qpOASES-3 with Conan version" + patch_type: "conan" diff --git a/recipes/acado/all/conanfile.py b/recipes/acado/all/conanfile.py index d9e09e4b5548b9..96a368dbfe81f0 100644 --- a/recipes/acado/all/conanfile.py +++ b/recipes/acado/all/conanfile.py @@ -1,19 +1,24 @@ import os -import glob -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile, conan_version +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, rm, rmdir +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class AcadoConan(ConanFile): name = "acado" - description = "ACADO Toolkit is a software environment and algorithm collection for automatic control and dynamic optimization." + description = ("ACADO Toolkit is a software environment and algorithm " + "collection for automatic control and dynamic optimization.") license = "LGPL-3.0" - topics = ("conan", "acado", "control", "optimization", "mpc") - homepage = "https://github.com/acado/acado" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "cmake/qpoases.cmake", "patches/**"] - generators = "cmake" + homepage = "https://github.com/acado/acado" + topics = ("control", "optimization", "mpc") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,12 +30,11 @@ class AcadoConan(ConanFile): "fPIC": True, "codegen_only": True, } + short_paths = True - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) + copy(self, "cmake/qpoases.cmake", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -38,93 +42,120 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("acado-*/")[0] - os.rename(extracted_dir, self._source_subfolder) + self.options.rm_safe("fPIC") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def layout(self): + cmake_layout(self, src_folder="src") - self._cmake.definitions["ACADO_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["ACADO_BUILD_STATIC"] = not self.options.shared + def requirements(self): + # Note: ACADO also separately vendors and exports qpOASES v1.3 for code generation. + self.requires("qpoases/3.2.1") - self._cmake.definitions["ACADO_WITH_EXAMPLES"] = False - self._cmake.definitions["ACADO_WITH_TESTING"] = False - self._cmake.definitions["ACADO_DEVELOPER"] = False - self._cmake.definitions["ACADO_INTERNAL"] = False - self._cmake.definitions["ACADO_BUILD_CGT_ONLY"] = self.options.codegen_only - - # ACADO logs 170.000 lines of warnings, so we disable them - self._cmake.definitions["CMAKE_C_FLAGS"] = "-w" - self._cmake.definitions["CMAKE_CXX_FLAGS"] = "-w" + def validate(self): + if is_msvc(self) and self.options.shared: + # https://github.com/acado/acado/blob/b4e28f3131f79cadfd1a001e9fff061f361d3a0f/CMakeLists.txt#L77-L80 + raise ConanInvalidConfiguration("Acado does not support shared builds on Windows.") + if self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration("apple-clang not supported") + if self.settings.compiler == "clang" and self.settings.compiler.version == "9": + raise ConanInvalidConfiguration("acado can not be built by Clang 9.") + if conan_version.major < 2 and self.settings.compiler in ["clang", "gcc"] and self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration("libstdc++11 required") - self._cmake.configure() - return self._cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["ACADO_BUILD_SHARED"] = self.options.shared + tc.cache_variables["ACADO_BUILD_STATIC"] = not self.options.shared + tc.cache_variables["ACADO_BUILD_CGT_ONLY"] = self.options.codegen_only + tc.cache_variables["ACADO_WITH_EXAMPLES"] = False + tc.cache_variables["ACADO_WITH_TESTING"] = False + tc.cache_variables["ACADO_DEVELOPER"] = False + tc.cache_variables["ACADO_INTERNAL"] = False + # The build logs 170,000 lines of warnings otherwise + tc.variables["CMAKE_C_FLAGS"] = "-w" + tc.variables["CMAKE_CXX_FLAGS"] = "-w" + tc.variables["CMAKE_CXX_STANDARD"] = 11 + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + apply_conandata_patches(self) + # TODO: Use Eigen from Conan. Failed with static assert errors even if using matching eigen/3.2.0 version for some reason. + # rmdir(self, os.path.join(self.source_folder, "external_packages", "eigen3")) + # replace_in_file(self, os.path.join(self.source_folder, "acado/matrix_vector/matrix_vector_tools.hpp"), + # "external_packages/eigen3/", "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() @property def _qpoases_sources(self): - return os.path.join("lib", "cmake", "qpoases") + return os.path.join(self.package_folder, "lib", "cmake", "qpoases") def package(self): - self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() - cmake.install() + copy(self, "LICENSE.txt", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) - self.copy("*", src="lib", dst="lib") - self.copy("qpoases.cmake", src="cmake", dst="lib/cmake") - qpoases_sources_from = os.path.join(self.package_folder, "share", "acado", "external_packages", "qpoases") - self.copy("*", src=qpoases_sources_from, dst=self._qpoases_sources) + cmake = CMake(self) + cmake.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(self.package_folder, "*.pdb") + if not self.options.shared: + # Copy internal static acado_casadi lib + copy(self, "*acado_casadi*", + src=os.path.join(self.build_folder, "lib"), + dst=os.path.join(self.package_folder, "lib"), + keep_path=False) + + # Copy embedded qpOASES v1.3 sources for code generation + copy(self, "qpoases.cmake", + src=os.path.join(self.export_sources_folder, "cmake"), + dst=os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "*", + src=os.path.join(self.package_folder, "share", "acado", "external_packages", "qpoases"), + dst=self._qpoases_sources) + + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", self.package_folder, recursive=True) + rm(self, "*.exp", self.package_folder, recursive=True) def package_info(self): - acado_template_paths = os.path.join(self.package_folder, "include", "acado", "code_generation", "templates") - self.output.info("Setting ACADO_TEMPLATE_PATHS environment variable: {}".format(acado_template_paths)) - self.env_info.ACADO_TEMPLATE_PATHS = acado_template_paths + self.cpp_info.set_property("cmake_file_name", "ACADO") + self.cpp_info.set_property("cmake_target_name", "ACADO::ACADO") if self.options.shared: - self.cpp_info.libs = ["acado_toolkit_s", "acado_casadi"] + self.cpp_info.libs = ["acado_toolkit_s"] else: self.cpp_info.libs = ["acado_toolkit", "acado_casadi"] - self.cpp_info.names["cmake_find_package"] = "ACADO" - self.cpp_info.names["cmake_find_package_multi"] = "ACADO" + self.cpp_info.includedirs.append(os.path.join("include", "acado")) - self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) - self.cpp_info.build_modules.append(os.path.join("lib", "cmake", "qpoases.cmake")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") - self.cpp_info.includedirs.append(os.path.join("include", "acado")) - self.cpp_info.includedirs.append(self._qpoases_sources) - self.cpp_info.includedirs.append(os.path.join(self._qpoases_sources, "INCLUDE")) - self.cpp_info.includedirs.append(os.path.join(self._qpoases_sources, "SRC")) + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "cmake", "qpoases.cmake")]) + self.cpp_info.includedirs += [ + self._qpoases_sources, + os.path.join(self._qpoases_sources, "INCLUDE"), + os.path.join(self._qpoases_sources, "SRC"), + ] - def validate(self): - if self.settings.compiler == "Visual Studio" and self.options.shared: - # https://github.com/acado/acado/blob/b4e28f3131f79cadfd1a001e9fff061f361d3a0f/CMakeLists.txt#L77-L80 - raise ConanInvalidConfiguration("Acado does not support shared builds on Windows.") - if self.settings.compiler == "apple-clang": - raise ConanInvalidConfiguration("apple-clang not supported") - if self.settings.compiler == "clang" and self.settings.compiler.version == "9": - raise ConanInvalidConfiguration("acado can not be built by Clang 9.") + acado_template_paths = os.path.join(self.package_folder, "include", "acado", "code_generation", "templates") + self.conf_info.define("user.acado:template_paths", acado_template_paths) + self.buildenv_info.define_path("ACADO_TEMPLATE_PATHS", acado_template_paths) - # acado requires libstdc++11 for shared builds - # https://github.com/conan-io/conan-center-index/pull/3967#issuecomment-752985640 - if self.options.shared and self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libstdc++11": - raise ConanInvalidConfiguration("libstdc++11 required") - if self.options.shared and self.settings.compiler == "gcc" and self.settings.compiler.libcxx != "libstdc++11": - raise ConanInvalidConfiguration("libstdc++11 required") + # TODO: to remove in conan v2 + self.env_info.ACADO_TEMPLATE_PATHS = acado_template_paths + self.cpp_info.names["cmake_find_package"] = "ACADO" + self.cpp_info.names["cmake_find_package_multi"] = "ACADO" + self.cpp_info.build_modules["cmake_find_package"].append(os.path.join("lib", "cmake", "qpoases.cmake")) + self.cpp_info.build_modules["cmake_find_package_multi"].append(os.path.join("lib", "cmake", "qpoases.cmake")) diff --git a/recipes/acado/all/patches/0003-unvendor-qpoases3.patch b/recipes/acado/all/patches/0003-unvendor-qpoases3.patch new file mode 100644 index 00000000000000..fd5828c4a2a616 --- /dev/null +++ b/recipes/acado/all/patches/0003-unvendor-qpoases3.patch @@ -0,0 +1,40 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -25,7 +25,7 @@ + # + # Minimum required version of cmake + # +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) ++CMAKE_MINIMUM_REQUIRED( VERSION 3.15 ) + + # + # Project name and programming languages used +@@ -179,7 +179,6 @@ + ${PROJECT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR}/acado + ${PROJECT_SOURCE_DIR}/external_packages +- ${PROJECT_SOURCE_DIR}/external_packages/qpOASES-3.2.0/include + ${PROJECT_BINARY_DIR} + ) + +@@ -198,11 +197,6 @@ + ################################################################################ + + IF (NOT ACADO_BUILD_CGT_ONLY) +- # +- # Build qpOASES library +- # +- ADD_SUBDIRECTORY( ./external_packages/qpOASES-3.2.0 ) +- + # + # Build csparse library + # +@@ -378,7 +344,6 @@ + ${PROJECT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR}/acado + ${PROJECT_SOURCE_DIR}/external_packages +- ${PROJECT_SOURCE_DIR}/external_packages/qpOASES-3.2.0/include + ${PROJECT_BINARY_DIR} + ) + + CONFIGURE_FILE( diff --git a/recipes/acado/all/test_package/CMakeLists.txt b/recipes/acado/all/test_package/CMakeLists.txt index 29d9de3546c796..4aa2d543607d90 100644 --- a/recipes/acado/all/test_package/CMakeLists.txt +++ b/recipes/acado/all/test_package/CMakeLists.txt @@ -1,12 +1,13 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) project(test_package CXX C) -set(CMAKE_CXX_STANDARD 11) +if(NOT DEFINED ENV{ACADO_TEMPLATE_PATHS}) + message(FATAL_ERROR "ACADO_TEMPLATE_PATHS environment variable not set") +endif() -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) +set(CMAKE_CXX_STANDARD 11) -find_package(ACADO REQUIRED) +find_package(ACADO REQUIRED CONFIG) add_executable(codegen codegen.cpp) target_link_libraries(codegen PRIVATE ACADO::ACADO) @@ -30,10 +31,7 @@ add_custom_command( DEPENDS codegen) add_library(mpc_codegen STATIC ${codegen_GENERATED_FILES} ${ACADO_QPOASES_EMBEDDED_SOURCES}) -target_include_directories(mpc_codegen - SYSTEM PUBLIC - ${CODEGEN_DIR} - ${ACADO_QPOASES_EMBEDDED_INC_DIRS}) +target_include_directories(mpc_codegen PUBLIC ${CODEGEN_DIR} ${ACADO_QPOASES_EMBEDDED_INC_DIRS}) add_executable(test_package test_package.cpp) target_link_libraries(test_package PRIVATE mpc_codegen) diff --git a/recipes/acado/all/test_package/conanfile.py b/recipes/acado/all/test_package/conanfile.py index 3cdacb96b0c8cc..7019a80802df9e 100644 --- a/recipes/acado/all/test_package/conanfile.py +++ b/recipes/acado/all/test_package/conanfile.py @@ -1,19 +1,26 @@ -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", "VirtualBuildEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) - # FIXME: CCI infrastructure should provide cpu count input to avoid errors - cmake.parallel = False 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) + 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/acado/all/test_v1_package/CMakeLists.txt b/recipes/acado/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/acado/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/acado/all/test_v1_package/conanfile.py b/recipes/acado/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..e34dbc52de8488 --- /dev/null +++ b/recipes/acado/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi", "VirtualBuildEnv" + + def build(self): + cmake = CMake(self) + # FIXME: CCI infrastructure should provide cpu count input to avoid errors + cmake.parallel = False + 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/accellera-uvm-systemc/all/conanfile.py b/recipes/accellera-uvm-systemc/all/conanfile.py index 15689e9fd7ded7..edae984b0d813c 100644 --- a/recipes/accellera-uvm-systemc/all/conanfile.py +++ b/recipes/accellera-uvm-systemc/all/conanfile.py @@ -1,74 +1,80 @@ +import os + from conan import ConanFile -from conans import AutoToolsBuildEnvironment -from conan.tools.files import get, rmdir, rm, copy, rename -from conan.tools.scm import Version -from conan.tools.build import check_min_cppstd from conan.errors import ConanInvalidConfiguration -import os +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, rmdir, rm, copy, rename, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.50.0" class UvmSystemC(ConanFile): name = "accellera-uvm-systemc" - description = """Universal Verification Methodology for SystemC""" - homepage = "https://systemc.org/about/systemc-verification/uvm-systemc-faq" - url = "https://github.com/conan-io/conan-center-index" + description = "Universal Verification Methodology for SystemC" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://systemc.org/overview/uvm-systemc-faq" topics = ("systemc", "verification", "tlm", "uvm") - settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { - "fPIC": [True, False], "shared": [True, False], + "fPIC": [True, False], } default_options = { - "fPIC": True, "shared": False, + "fPIC": True, } - @property - def _source_subfolder(self): - return "source_subfolder" + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("systemc/2.3.3") - - def build_requirements(self): - self.tool_requires("cmake/3.24.0") + self.requires("systemc/2.3.4", transitive_headers=True, transitive_libs=True) - def configure(self): - if self.options.shared: - del self.options.fPIC - def validate(self): - if self.settings.os == "Macos": - raise ConanInvalidConfiguration("Macos build not supported") - if self.settings.os == "Windows": - raise ConanInvalidConfiguration("Windows build not yet supported") + if self.settings.os == "Windows" or is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.settings.os} build not supported") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": raise ConanInvalidConfiguration("GCC < version 7 is not supported") def source(self): - get(self, **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 = AutotoolsToolchain(self) + systemc_root = self.dependencies["systemc"].package_folder + tc.configure_args.append(f"--with-systemc={systemc_root}") + tc.generate() def build(self): - autotools = AutoToolsBuildEnvironment(self) - args = [f"--with-systemc={self.deps_cpp_info['systemc'].rootpath}"] - if self.options.shared: - args.extend(["--enable-shared", "--disable-static"]) - else: - args.extend(["--enable-static", "--disable-shared"]) - autotools.configure(configure_dir=self._source_subfolder, args=args) + autotools = Autotools(self) + autotools.configure() + # Replace lib-linux64/ with lib/ for the systemc dependency + replace_in_file(self, os.path.join(self.build_folder, "src", "uvmsc", "Makefile"), + "-linux64", "") autotools.make() def package(self): - copy(self, "LICENSE", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) - copy(self, "NOTICE", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) - copy(self, "COPYING", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) - autotools = AutoToolsBuildEnvironment(self) + for license in ["LICENSE", "NOTICE", "COPYING"]: + copy(self, license, + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) autotools.install() + rmdir(self, os.path.join(self.package_folder, "docs")) rmdir(self, os.path.join(self.package_folder, "examples")) rm(self, "AUTHORS", self.package_folder) @@ -80,7 +86,9 @@ def package(self): rm(self, "RELEASENOTES", self.package_folder) rm(self, "README", self.package_folder) rm(self, "INSTALL", self.package_folder) - rename(self, os.path.join(self.package_folder, "lib-linux64"), os.path.join(self.package_folder, "lib")) + rename(self, + os.path.join(self.package_folder, "lib-linux64"), + os.path.join(self.package_folder, "lib")) rm(self, "libuvm-systemc.la", os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) diff --git a/recipes/accellera-uvm-systemc/all/test_package/CMakeLists.txt b/recipes/accellera-uvm-systemc/all/test_package/CMakeLists.txt index 29a5f29bd60627..0dbdd7f01d3404 100644 --- a/recipes/accellera-uvm-systemc/all/test_package/CMakeLists.txt +++ b/recipes/accellera-uvm-systemc/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(accellera-uvm-systemc REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) target_link_libraries(${PROJECT_NAME} accellera-uvm-systemc::accellera-uvm-systemc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/accellera-uvm-systemc/all/test_package/conanfile.py b/recipes/accellera-uvm-systemc/all/test_package/conanfile.py index 7c46504cf008f9..ef5d7042163ecc 100644 --- a/recipes/accellera-uvm-systemc/all/test_package/conanfile.py +++ b/recipes/accellera-uvm-systemc/all/test_package/conanfile.py @@ -1,18 +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 -from conan.tools.build import cross_building -class UvmSystemcTestConan(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) 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) + 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/accellera-uvm-systemc/all/test_package/example.cpp b/recipes/accellera-uvm-systemc/all/test_package/example.cpp index db58543c274009..47640ade3dcac7 100644 --- a/recipes/accellera-uvm-systemc/all/test_package/example.cpp +++ b/recipes/accellera-uvm-systemc/all/test_package/example.cpp @@ -1,12 +1,17 @@ #include "uvmsc/base/uvm_version.h" +#include "systemc" #include using namespace uvm; +// Required for linking with SystemC +int sc_main(int, char*[]) +{ + return 0; +} + int main(int, char*[]) { std::cout << "uvm-systemc version " << uvm_revision_string() << " loaded successfully."; - return 0; } - diff --git a/recipes/accellera-uvm-systemc/all/test_v1_package/CMakeLists.txt b/recipes/accellera-uvm-systemc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/accellera-uvm-systemc/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/accellera-uvm-systemc/all/test_v1_package/conanfile.py b/recipes/accellera-uvm-systemc/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7c46504cf008f9 --- /dev/null +++ b/recipes/accellera-uvm-systemc/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake +from conan.tools.build import cross_building + +class UvmSystemcTestConan(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/ada/all/conandata.yml b/recipes/ada/all/conandata.yml index 377c8fab6dad4f..e07ea43a3e678f 100644 --- a/recipes/ada/all/conandata.yml +++ b/recipes/ada/all/conandata.yml @@ -1,4 +1,31 @@ sources: + "2.7.4": + url: "https://github.com/ada-url/ada/archive/v2.7.4.tar.gz" + sha256: "897942ba8c99153f916c25698a49604022f3e54441cfa9b76f657ad15b6ca041" + "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" + "2.7.0": + url: "https://github.com/ada-url/ada/archive/v2.7.0.tar.gz" + sha256: "08646b8a41cd6367b282aab2c87c82e5ce4876078a0cbe0799af7e51e4358591" + "2.6.10": + url: "https://github.com/ada-url/ada/archive/v2.6.10.tar.gz" + sha256: "a43e1ea0bcdd7585edf538afffe1fc3303b936752e18bac545fa11729de088bc" + "2.6.7": + url: "https://github.com/ada-url/ada/archive/v2.6.7.tar.gz" + sha256: "882a0aa6e19174b60b2fa00ee75d35a31ecd5158fb97d0e4e719ba21bb07acb9" + "2.6.4": + url: "https://github.com/ada-url/ada/archive/v2.6.4.tar.gz" + sha256: "5b488e9a7a700de5d40a749c96c4339bcc9c425e5f5406a0887b13e70bd90907" + "2.6.2": + url: "https://github.com/ada-url/ada/archive/v2.6.2.tar.gz" + sha256: "425b8696a28a22d19ee7aa4516c26fc8ae3ab574870a9a74ef58ba8a345b822e" + "2.6.0": + url: "https://github.com/ada-url/ada/archive/v2.6.0.tar.gz" + sha256: "09551bfbd92853e59d731e5f44a88a690425fd2906977ad03a6a1059615a02a5" "2.5.1": url: "https://github.com/ada-url/ada/archive/v2.5.1.tar.gz" sha256: "a7591d771822c3f16e6665311b0c6b4de7dd7615333183f35d89c7573be7f7fa" @@ -8,21 +35,3 @@ sources: "2.4.2": url: "https://github.com/ada-url/ada/archive/v2.4.2.tar.gz" sha256: "d865ab8828c14fc1e2217ca9f5d7918d50775175b2873faf2fbda0085e0623d2" - "2.4.1": - url: "https://github.com/ada-url/ada/archive/refs/tags/v2.4.1.tar.gz" - sha256: "e9359937e7aeb8e5889515c0a9e22cd5da50e9b053038eb092135a0e64888fe7" - "2.4.0": - url: "https://github.com/ada-url/ada/archive/refs/tags/v2.4.0.tar.gz" - sha256: "14624f1dfd966fee85272688064714172ff70e6e304a1e1850f352a07e4c6dc7" - "2.3.1": - url: "https://github.com/ada-url/ada/archive/refs/tags/v2.3.1.tar.gz" - sha256: "298992ec0958979090566c7835ea60c14f5330d6372ee092ef6eee1d2e6ac079" - "2.3.0": - url: "https://github.com/ada-url/ada/archive/refs/tags/v2.3.0.tar.gz" - sha256: "932a93f6a745775343ebdbaafca295e07b9513f6aaeb738f9e85dcb397925e33" - "2.2.0": - url: "https://github.com/ada-url/ada/archive/refs/tags/v2.2.0.tar.gz" - sha256: "40a6b3fe0d5c62936c081e8403790ec05d5afe3d0909eece894efcfef7e678ee" - "2.0.0": - url: "https://github.com/ada-url/ada/archive/refs/tags/v2.0.0.tar.gz" - sha256: "a18272e1c5d6580f62a333df88149e3810ffedcb61b3fb06c480a5b52e458b5e" diff --git a/recipes/ada/all/conanfile.py b/recipes/ada/all/conanfile.py index dcb06ed03de1ae..68040e85196714 100644 --- a/recipes/ada/all/conanfile.py +++ b/recipes/ada/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy, rmdir +from conan.tools.files import get, copy, 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 @@ -45,9 +45,6 @@ def config_options(self): del self.options.fPIC def configure(self): - if Version(self.version) <= "2.0.0": - self.options.rm_safe("shared") - self.package_type = "static-library" if self.options.get_safe("shared"): self.options.rm_safe("fPIC") @@ -55,7 +52,7 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler.cppstd: + 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: @@ -69,8 +66,7 @@ def validate(self): ) def build_requirements(self): - if Version(self.version) >= "0.6.0": - self.tool_requires("cmake/[>=3.16 <4]") + self.tool_requires("cmake/[>=3.16 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -78,12 +74,19 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + tc.variables["ADA_TOOLS"] = False tc.generate() deps = CMakeDeps(self) deps.generate() + def _patch_sources(self): + # solve APPLE RELOCATABLE SHARED LIBS (KB-H077) + if Version(self.version) < "2.6.10": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "ada-flags.cmake"), "set(CMAKE_MACOSX_RPATH OFF)", "") + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -97,3 +100,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["ada"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/ada/config.yml b/recipes/ada/config.yml index 7612786acc48cd..e97d7f2aa5a292 100644 --- a/recipes/ada/config.yml +++ b/recipes/ada/config.yml @@ -1,19 +1,25 @@ versions: - "2.5.1": + "2.7.4": folder: all - "2.5.0": + "2.7.3": folder: all - "2.4.2": + "2.7.2": folder: all - "2.4.1": + "2.7.0": folder: all - "2.4.0": + "2.6.10": folder: all - "2.3.1": + "2.6.7": folder: all - "2.3.0": + "2.6.4": folder: all - "2.2.0": + "2.6.2": folder: all - "2.0.0": + "2.6.0": + folder: all + "2.5.1": + folder: all + "2.5.0": + folder: all + "2.4.2": folder: all diff --git a/recipes/ade/all/conandata.yml b/recipes/ade/all/conandata.yml index 954c10dfe2c1d4..0ce2795d9939c3 100644 --- a/recipes/ade/all/conandata.yml +++ b/recipes/ade/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.1.2d": + url: "https://github.com/opencv/ade/archive/refs/tags/v0.1.2d.tar.gz" + sha256: "edefba61a33d6cd4b78a9976cb3309c95212610a81ba6dade09882d1794198ff" + "0.1.2c": + url: "https://github.com/opencv/ade/archive/refs/tags/v0.1.2c.tar.gz" + sha256: "1387891c707c6e5c76448ea09e2df2e8bce1645c11f262c10b3f3ebec88749c2" "0.1.2a": url: "https://github.com/opencv/ade/archive/refs/tags/v0.1.2a.tar.gz" sha256: "c022a688b0554017e46e1cbdeb0105e625ca090fc3755c15df8c4451a304e084" diff --git a/recipes/ade/config.yml b/recipes/ade/config.yml index cbf2f373fb6306..922bcf09467457 100644 --- a/recipes/ade/config.yml +++ b/recipes/ade/config.yml @@ -1,4 +1,8 @@ versions: + "0.1.2d": + folder: "all" + "0.1.2c": + folder: "all" "0.1.2a": folder: "all" "0.1.1f": diff --git a/recipes/aeron/all/conandata.yml b/recipes/aeron/all/conandata.yml index a888d0c7211200..c3ee6521cf6a55 100644 --- a/recipes/aeron/all/conandata.yml +++ b/recipes/aeron/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.41.4": + url: "https://github.com/real-logic/aeron/archive/1.41.4.tar.gz" + sha256: "681e2a045ca04672612b6edeb7a09c0d574e12c6875cfe26f677b12772d71ad5" "1.35.1": url: "https://github.com/real-logic/aeron/archive/1.35.1.tar.gz" sha256: "19b0f27c2cbc27b422e26a533e4a04a60592217e1c70fdbdd48a92a7b932cccb" diff --git a/recipes/aeron/all/conanfile.py b/recipes/aeron/all/conanfile.py index aef0519cfd69ad..813ca895247cdc 100644 --- a/recipes/aeron/all/conanfile.py +++ b/recipes/aeron/all/conanfile.py @@ -17,9 +17,10 @@ class AeronConan(ConanFile): description = "Efficient reliable UDP unicast, UDP multicast, and IPC message transport" topics = ("udp", "messaging", "low-latency") url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/real-logic/aeron/wiki" + homepage = "https://github.com/real-logic/aeron" license = "Apache-2.0" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -47,7 +48,7 @@ def _compilers_minimum_version(self): } def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC def configure(self): @@ -71,7 +72,7 @@ def validate(self): raise ConanInvalidConfiguration("This platform (os=Macos arch=armv8) is not yet supported by this recipe") def build_requirements(self): - self.tool_requires("zulu-openjdk/11.0.15") + self.tool_requires("zulu-openjdk/11.0.19") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -89,6 +90,12 @@ def generate(self): tc.cache_variables["AERON_BUILD_DOCUMENTATION"] = False tc.cache_variables["AERON_INSTALL_TARGETS"] = True tc.cache_variables["AERON_ENABLE_NONSTANDARD_OPTIMIZATIONS"] = True + # The finite-math-only optimization has no effect and can cause linking errors + # when linked against glibc >= 2.31 + tc.blocks["cmake_flags_init"].template += ( + 'string(APPEND CMAKE_CXX_FLAGS_INIT " -fno-finite-math-only")\n' + 'string(APPEND CMAKE_C_FLAGS_INIT " -fno-finite-math-only")\n' + ) tc.generate() def _patch_sources(self): diff --git a/recipes/aeron/all/test_v1_package/CMakeLists.txt b/recipes/aeron/all/test_v1_package/CMakeLists.txt index 0d20897301b68b..91630d79f4abb3 100644 --- a/recipes/aeron/all/test_v1_package/CMakeLists.txt +++ b/recipes/aeron/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/aeron/config.yml b/recipes/aeron/config.yml index 0c20e51036f8b7..9f6aea7a8f54b5 100644 --- a/recipes/aeron/config.yml +++ b/recipes/aeron/config.yml @@ -1,4 +1,6 @@ versions: + "1.41.4": + folder: all "1.35.1": folder: all "1.34.0": diff --git a/recipes/aggeom-agg/all/conandata.yml b/recipes/aggeom-agg/all/conandata.yml index 8b26697b0ef0d8..9203b7fc5e4241 100644 --- a/recipes/aggeom-agg/all/conandata.yml +++ b/recipes/aggeom-agg/all/conandata.yml @@ -2,3 +2,6 @@ sources: "2.6.1": url: "https://github.com/aggeom/agg-2.6/archive/refs/tags/agg-2.6.1.tar.gz" sha256: 685966f880f1c2aae19479b60525fafba8cbd88e4c62d1947767780df8f6a3d0 + "2.7.1": + url: "https://github.com/aggeom/agg-2.6/archive/refs/tags/agg-2.7.1.tar.gz" + sha256: 2174e55d7169502293e86f728d8698b5198dc7e42fbbda39e4d34c1411d1ac7a diff --git a/recipes/aggeom-agg/all/conanfile.py b/recipes/aggeom-agg/all/conanfile.py index 55a67e88a5f75c..de0179059224ed 100644 --- a/recipes/aggeom-agg/all/conanfile.py +++ b/recipes/aggeom-agg/all/conanfile.py @@ -1,49 +1,43 @@ +import os + from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir -from conan.errors import ConanInvalidConfiguration - -import os required_conan_version = ">=1.53.0" class AggConan(ConanFile): - name = 'aggeom-agg' - description = 'AGG Anti-Grain Geometry Library' - topics = ('graphics') + name = "aggeom-agg" + description = "AGG Anti-Grain Geometry Library" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" - homepage = 'https://github.com/aggeom' - license = 'BSD-3-Clause' + homepage = "https://github.com/aggeom" + topics = ("graphics",) - settings = 'os', 'arch', 'compiler', 'build_type' + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { - 'shared': [True, False], - 'fPIC': [True, False], - 'with_gpc': [True, False], - 'with_freetype': [True, False], - 'with_agg2d': [True, False], - 'with_agg2d_freetype': [True, False], - 'with_platform': [True, False], - 'with_controls': [True, False], + "shared": [True, False], + "fPIC": [True, False], + "with_gpc": [True, False], + "with_freetype": [True, False], + "with_agg2d": [True, False], + "with_agg2d_freetype": [True, False], + "with_platform": [True, False], + "with_controls": [True, False], } - default_options = { - 'shared': False, - 'fPIC': True, - 'with_gpc': True, - 'with_freetype': True, - 'with_agg2d': True, - 'with_agg2d_freetype': True, - 'with_platform': True, - 'with_controls': True, + "shared": False, + "fPIC": True, + "with_gpc": True, + "with_freetype": True, + "with_agg2d": True, + "with_agg2d_freetype": True, + "with_platform": True, + "with_controls": True, } - def validate(self): - if self.settings.os not in ("Windows", "Linux"): - raise ConanInvalidConfiguration("OS is not supported") - if self.options.shared: - raise ConanInvalidConfiguration("Invalid configuration") - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -51,31 +45,37 @@ def config_options(self): def configure(self): self.options.rm_safe("fPIC") - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_freetype: - self.requires('freetype/2.13.0') + self.requires("freetype/2.13.2") if self.options.with_platform and self.settings.os in ["Linux"]: self.requires("xorg/system") + def validate(self): + if self.settings.os not in ("Windows", "Linux"): + raise ConanInvalidConfiguration("OS is not supported") + if self.options.shared: + raise ConanInvalidConfiguration("Invalid configuration") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): tc = CMakeToolchain(self) - tc.variables['agg_USE_EXPAT'] = False - tc.variables['agg_USE_SDL_PLATFORM'] = False - tc.variables['agg_BUILD_DEMO'] = False - tc.variables['agg_BUILD_EXAMPLES'] = False - - tc.variables['agg_USE_GPC'] = self.options.with_gpc - tc.variables['agg_USE_FREETYPE'] = self.options.with_freetype - tc.variables['agg_USE_AGG2D'] = self.options.with_agg2d - tc.variables['agg_USE_AGG2D_FREETYPE'] = self.options.with_agg2d_freetype - tc.variables['agg_BUILD_PLATFORM'] = self.options.with_platform - tc.variables['agg_BUILD_CONTROLS'] = self.options.with_controls + tc.variables["agg_USE_EXPAT"] = False + tc.variables["agg_USE_SDL_PLATFORM"] = False + tc.variables["agg_BUILD_DEMO"] = False + tc.variables["agg_BUILD_EXAMPLES"] = False + + tc.variables["agg_USE_GPC"] = self.options.with_gpc + tc.variables["agg_USE_FREETYPE"] = self.options.with_freetype + tc.variables["agg_USE_AGG2D"] = self.options.with_agg2d + tc.variables["agg_USE_AGG2D_FREETYPE"] = self.options.with_agg2d_freetype + tc.variables["agg_BUILD_PLATFORM"] = self.options.with_platform + tc.variables["agg_BUILD_CONTROLS"] = self.options.with_controls tc.generate() @@ -95,12 +95,11 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "agg") - self.cpp_info.filenames["cmake_find_package"]="agg" - self.cpp_info.filenames["cmake_find_package_multi"]="agg" - self.cpp_info.names["cmake_find_package"]="agg" - self.cpp_info.names["cmake_find_package_multi"]="agg" + self.cpp_info.filenames["cmake_find_package"] = "agg" + self.cpp_info.filenames["cmake_find_package_multi"] = "agg" + self.cpp_info.names["cmake_find_package"] = "agg" + self.cpp_info.names["cmake_find_package_multi"] = "agg" self.cpp_info.components["agg"].set_property("cmake_target_name", "agg::agg") self.cpp_info.components["agg"].libs = ["agg"] @@ -109,33 +108,31 @@ def package_info(self): if self.options.with_freetype: self.cpp_info.components["fontfreetype"].set_property("cmake_target_name", "agg::fontfreetype") self.cpp_info.components["fontfreetype"].libs = ["aggfontfreetype"] - self.cpp_info.components["fontfreetype"].includedirs = [os.path.join("include", "agg","fontfreetype")] + self.cpp_info.components["fontfreetype"].includedirs = [os.path.join("include", "agg", "fontfreetype")] self.cpp_info.components["fontfreetype"].requires = ["agg", "freetype::freetype"] - + if self.options.with_gpc: self.cpp_info.components["gpc"].set_property("cmake_target_name", "agg::gpc") - self.cpp_info.components["gpc"].libs = [ "agggpc"] - self.cpp_info.components["gpc"].includedirs = [os.path.join("include", "agg","gpc")] - + self.cpp_info.components["gpc"].libs = ["agggpc"] + self.cpp_info.components["gpc"].includedirs = [os.path.join("include", "agg", "gpc")] if self.options.with_agg2d: self.cpp_info.components["2d"].set_property("cmake_target_name", "agg::2d") self.cpp_info.components["2d"].libs = ["agg2d"] - self.cpp_info.components["2d"].includedirs = [os.path.join("include", "agg","2d")] + self.cpp_info.components["2d"].includedirs = [os.path.join("include", "agg", "2d")] self.cpp_info.components["2d"].requires = ["agg"] if self.options.with_agg2d_freetype: self.cpp_info.components["2d"].requires = ["agg", "fontfreetype"] if self.options.with_platform: - self.cpp_info.components["platform"].set_property("cmake_target_name", "agg::platform") self.cpp_info.components["platform"].libs = ["aggplatform"] - self.cpp_info.components["platform"].includedirs = [os.path.join("include", "agg","platform")] + self.cpp_info.components["platform"].includedirs = [os.path.join("include", "agg", "platform")] if self.settings.os in ["Linux"]: self.cpp_info.components["platform"].requires = ["xorg::xorg", "agg"] if self.options.with_controls: self.cpp_info.components["controls"].set_property("cmake_target_name", "agg::controls") self.cpp_info.components["controls"].libs = ["aggctrl"] - self.cpp_info.components["controls"].includedirs = [os.path.join("include", "agg","ctrl")] + self.cpp_info.components["controls"].includedirs = [os.path.join("include", "agg", "ctrl")] self.cpp_info.components["controls"].requires = ["agg"] diff --git a/recipes/aggeom-agg/all/test_v1_package/CMakeLists.txt b/recipes/aggeom-agg/all/test_v1_package/CMakeLists.txt index 0d20897301b68b..91630d79f4abb3 100644 --- a/recipes/aggeom-agg/all/test_v1_package/CMakeLists.txt +++ b/recipes/aggeom-agg/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/aggeom-agg/config.yml b/recipes/aggeom-agg/config.yml index cfb13334b8b03d..54947af157488b 100644 --- a/recipes/aggeom-agg/config.yml +++ b/recipes/aggeom-agg/config.yml @@ -1,3 +1,5 @@ versions: "2.6.1": folder: "all" + "2.7.1": + folder: "all" 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/ags/all/test_v1_package/CMakeLists.txt b/recipes/ags/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/ags/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/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 bf7fb209af8bcf..cc8bcf0f12467d 100644 --- a/recipes/alembic/all/conandata.yml +++ b/recipes/alembic/all/conandata.yml @@ -1,12 +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/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: "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 73264829b63a37..81ce4ae17f4f7e 100644 --- a/recipes/alembic/all/conanfile.py +++ b/recipes/alembic/all/conanfile.py @@ -2,6 +2,7 @@ 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 +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -15,6 +16,7 @@ class AlembicConan(ConanFile): description = "Open framework for storing and sharing scene data." topics = ("3d", "scene", "geometry", "graphics") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -42,9 +44,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("imath/3.1.6") + self.requires("imath/3.1.9", transitive_headers=True) if self.options.with_hdf5: - self.requires("hdf5/1.14.0") + self.requires("hdf5/1.14.2") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -69,6 +71,8 @@ def generate(self): tc.variables["ALEMBIC_USING_IMATH_3"] = False tc.variables["ALEMBIC_ILMBASE_FOUND"] = 1 tc.variables["ALEMBIC_ILMBASE_LIBS"] = "OpenEXR::OpenEXR" + if Version(self.version) >= "1.8.4": + tc.variables["ALEMBIC_DEBUG_WARNINGS_AS_ERRORS"] = False tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/alembic/all/patches/1.8.5-0001-fix-cmake.patch b/recipes/alembic/all/patches/1.8.5-0001-fix-cmake.patch new file mode 100644 index 00000000000000..c048ccd304a2e2 --- /dev/null +++ b/recipes/alembic/all/patches/1.8.5-0001-fix-cmake.patch @@ -0,0 +1,56 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,9 +100,6 @@ SET(DARWIN FALSE) + IF ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") + SET(DARWIN TRUE) + # suppress rpath warning +- IF (POLICY CMP0042) +- CMAKE_POLICY(SET CMP0042 OLD) +- ENDIF() + ENDIF() + + SET(LINUX FALSE) +@@ -212,7 +209,6 @@ INCLUDE("./cmake/AlembicIlmBase.cmake") + + # HDF5 + IF (USE_HDF5) +- FIND_PACKAGE(ZLIB REQUIRED) + SET(ALEMBIC_WITH_HDF5 "1") + INCLUDE("./cmake/AlembicHDF5.cmake") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DH5_USE_18_API") +--- a/lib/Alembic/CMakeLists.txt ++++ b/lib/Alembic/CMakeLists.txt +@@ -68,28 +68,26 @@ IF (ALEMBIC_SHARED_LIBS) + + if (ALEMBIC_USING_IMATH_3) + if (APPLE OR UNIX) +- set_target_properties(Alembic PROPERTIES INSTALL_RPATH "$") + endif () + endif () + ENDIF() + + + TARGET_LINK_LIBRARIES(Alembic +- LINK_PUBLIC ++ PUBLIC + ${ALEMBIC_ILMBASE_LIBS} + ${CMAKE_THREAD_LIBS_INIT} + ${EXTERNAL_MATH_LIBS} +- LINK_PRIVATE ++ PRIVATE + ${HDF5_LIBRARIES} +- ${ZLIB_LIBRARY} + ) + + SET( ALEMBIC_LIB_INSTALL_DIR lib CACHE STRING "Where to install the Alembic libs") + INSTALL(TARGETS Alembic + EXPORT AlembicTargets +- LIBRARY DESTINATION ${ALEMBIC_LIB_INSTALL_DIR} +- ARCHIVE DESTINATION ${ALEMBIC_LIB_INSTALL_DIR} +- RUNTIME DESTINATION ${ALEMBIC_LIB_INSTALL_DIR}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + #-****************************************************************************** + # PACKAGE EXPORTS diff --git a/recipes/alembic/all/test_v1_package/CMakeLists.txt b/recipes/alembic/all/test_v1_package/CMakeLists.txt index 0d20897301b68b..b21cc49efde95c 100644 --- a/recipes/alembic/all/test_v1_package/CMakeLists.txt +++ b/recipes/alembic/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) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/alembic/config.yml b/recipes/alembic/config.yml index 68197c279a4ee3..079098b5ad92b4 100644 --- a/recipes/alembic/config.yml +++ b/recipes/alembic/config.yml @@ -1,4 +1,8 @@ versions: + "1.8.6": + folder: all + "1.8.5": + folder: all "1.8.3": folder: all "1.8.2": diff --git a/recipes/amqp-cpp/all/conandata.yml b/recipes/amqp-cpp/all/conandata.yml index d5f7ffbc385d2f..d9636b6750c964 100644 --- a/recipes/amqp-cpp/all/conandata.yml +++ b/recipes/amqp-cpp/all/conandata.yml @@ -1,47 +1,54 @@ sources: + "4.3.26": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.26.tar.gz" + sha256: "2baaab702f3fd9cce40563dc1e23f433cceee7ec3553bd529a98b1d3d7f7911c" "4.3.24": url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.24.tar.gz" sha256: "c3312f8af813cacabf6c257dfaf41bf9e66606bbf7d62d085a9b7da695355245" - "4.3.18": - url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.18.tar.gz" - sha256: "cc2c1fc5da00a1778c2804306e06bdedc782a5f74762b9d9b442d3a498dd0c4f" - "4.3.16": - url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.16.tar.gz" - sha256: "66c96e0db1efec9e7ddcf7240ff59a073d68c09752bd3e94b8bc4c506441fbf7" - "4.3.11": - url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.11.tar.gz" - sha256: "be2b11ada1020f77b859857310be54bd073c3a4f579d99a5e251a738576ca28c" - "4.3.10": - url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.10.tar.gz" - sha256: "4fa1e9650f7a08ae7217899431a3b3f0a173ad826dd819f0b8c760e4e2a65298" "4.2.1": url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.2.1.tar.gz" sha256: "33306d6cdb60554998afb304cdc3e3120a71ea539b4be187812065b1b9e59c2f" "4.1.7": url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.1.7.tar.gz" sha256: "71b504f21f62b69c76b371fe7044e0dfc6d42650a15c267431c5084badb0ade7" - "4.1.6": - url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.1.6.tar.gz" - sha256: "48832068dc1e25a5313dd9e96fb33ba954c19f9dc04eeca8f7b2c6cecde3afc9" - "4.1.5": - url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.1.5.tar.gz" - sha256: "9840c7fb17bb0c0b601d269e528b7f9cac5ec008dcf8d66bef22434423b468aa" patches: + "4.3.26": + - patch_file: "patches/4.3.24-0001-cmake-link-openssl.patch" + - patch_file: "patches/4.3.24-0002-cmake-install-dll-export-msvc.patch" + patch_description: "windows: Fix install directory of DLL and export symbols if msvc" + patch_type: "portability" + patch_source: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/pull/515" + - patch_file: "patches/4.3.24-0003-cmake-link-ws2_32.patch" + patch_description: "Link to ws2_32 if windows" + patch_type: "portability" + patch_source: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/pull/514" "4.3.24": - - patch_file: "patches/4.3.24-0001-cmake-openssl-install-directories.patch" - "4.3.18": - - patch_file: "patches/0001-cmake-openssl-install-directories.patch" - "4.3.16": - - patch_file: "patches/0001-cmake-openssl-install-directories.patch" - "4.3.11": - - patch_file: "patches/0001-cmake-openssl-install-directories.patch" - "4.3.10": - - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + - patch_file: "patches/4.3.24-0001-cmake-link-openssl.patch" + - patch_file: "patches/4.3.24-0002-cmake-install-dll-export-msvc.patch" + patch_description: "windows: Fix install directory of DLL and export symbols if msvc" + patch_type: "portability" + patch_source: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/pull/515" + - patch_file: "patches/4.3.24-0003-cmake-link-ws2_32.patch" + patch_description: "Link to ws2_32 if windows" + patch_type: "portability" + patch_source: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/pull/514" "4.2.1": - - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + - patch_file: "patches/4.1.7-0001-cmake-link-openssl.patch" + - patch_file: "patches/4.1.7-0002-cmake-install-dll-export-msvc.patch" + patch_description: "windows: Fix install directory of DLL and export symbols if msvc" + patch_type: "portability" + patch_source: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/pull/515" + - patch_file: "patches/4.1.7-0003-cmake-link-ws2_32.patch" + patch_description: "Link to ws2_32 if windows" + patch_type: "portability" + patch_source: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/pull/514" "4.1.7": - - patch_file: "patches/0001-cmake-openssl-install-directories.patch" - "4.1.6": - - patch_file: "patches/0001-cmake-openssl-install-directories.patch" - "4.1.5": - - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + - patch_file: "patches/4.1.7-0001-cmake-link-openssl.patch" + - patch_file: "patches/4.1.7-0002-cmake-install-dll-export-msvc.patch" + patch_description: "windows: Fix install directory of DLL and export symbols if msvc" + patch_type: "portability" + patch_source: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/pull/515" + - patch_file: "patches/4.1.7-0003-cmake-link-ws2_32.patch" + patch_description: "windows: Link to ws2_32" + patch_type: "portability" + patch_source: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/pull/514" diff --git a/recipes/amqp-cpp/all/conanfile.py b/recipes/amqp-cpp/all/conanfile.py index c1e0ec3696e4e9..3e26ef28cb2618 100644 --- a/recipes/amqp-cpp/all/conanfile.py +++ b/recipes/amqp-cpp/all/conanfile.py @@ -89,7 +89,6 @@ def generate(self): tc.variables["AMQP-CPP_BUILD_SHARED"] = self.options.shared tc.variables["AMQP-CPP_BUILD_EXAMPLES"] = False tc.variables["AMQP-CPP_LINUX_TCP"] = self.options.get_safe("linux_tcp_module", False) - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/amqp-cpp/all/patches/0001-cmake-openssl-install-directories.patch b/recipes/amqp-cpp/all/patches/0001-cmake-openssl-install-directories.patch deleted file mode 100644 index f47d6bd4b19df0..00000000000000 --- a/recipes/amqp-cpp/all/patches/0001-cmake-openssl-install-directories.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -88,7 +88,10 @@ - #add_library(${PROJECT_NAME} STATIC ${SRCS}) - add_library(${PROJECT_NAME} STATIC ${src_MAIN} ${src_LINUX_TCP}) - endif() -- -+if(AMQP-CPP_LINUX_TCP) -+find_package(OpenSSL REQUIRED) -+target_link_libraries(${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto) -+endif() - # install rules - # ------------------------------------------------------------------------------------------------------ - -@@ -97,7 +99,7 @@ - install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib -- RUNTIME DESTINATION lib -+ RUNTIME DESTINATION bin - ) - else() - # copy static lib diff --git a/recipes/amqp-cpp/all/patches/4.1.7-0001-cmake-link-openssl.patch b/recipes/amqp-cpp/all/patches/4.1.7-0001-cmake-link-openssl.patch new file mode 100644 index 00000000000000..4fd90bf502649e --- /dev/null +++ b/recipes/amqp-cpp/all/patches/4.1.7-0001-cmake-link-openssl.patch @@ -0,0 +1,9 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -129,4 +129,6 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC + + if(AMQP-CPP_LINUX_TCP) + target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS}) ++ find_package(OpenSSL REQUIRED) ++ target_link_libraries(${PROJECT_NAME} OpenSSL::SSL) + endif() diff --git a/recipes/amqp-cpp/all/patches/4.1.7-0002-cmake-install-dll-export-msvc.patch b/recipes/amqp-cpp/all/patches/4.1.7-0002-cmake-install-dll-export-msvc.patch new file mode 100644 index 00000000000000..a27f553a66fa51 --- /dev/null +++ b/recipes/amqp-cpp/all/patches/4.1.7-0002-cmake-install-dll-export-msvc.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -82,7 +82,7 @@ if(AMQP-CPP_BUILD_SHARED) + #add_library(${PROJECT_NAME} SHARED ${SRCS}) + add_library(${PROJECT_NAME} SHARED ${src_MAIN} ${src_LINUX_TCP}) + # set shared lib version +- set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${SO_VERSION}) ++ set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${SO_VERSION} WINDOWS_EXPORT_ALL_SYMBOLS ON) + else() + # create static lib + #add_library(${PROJECT_NAME} STATIC ${SRCS}) +@@ -97,7 +97,7 @@ if(AMQP-CPP_BUILD_SHARED) + install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib ++ RUNTIME DESTINATION bin + ) + else() + # copy static lib diff --git a/recipes/amqp-cpp/all/patches/4.1.7-0003-cmake-link-ws2_32.patch b/recipes/amqp-cpp/all/patches/4.1.7-0003-cmake-link-ws2_32.patch new file mode 100644 index 00000000000000..935f6704ae4e79 --- /dev/null +++ b/recipes/amqp-cpp/all/patches/4.1.7-0003-cmake-link-ws2_32.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -88,6 +88,9 @@ else() + #add_library(${PROJECT_NAME} STATIC ${SRCS}) + add_library(${PROJECT_NAME} STATIC ${src_MAIN} ${src_LINUX_TCP}) + endif() ++if(WIN32) ++ target_link_libraries(${PROJECT_NAME} PUBLIC ws2_32) ++endif() + + # install rules + # ------------------------------------------------------------------------------------------------------ diff --git a/recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-link-openssl.patch b/recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-link-openssl.patch new file mode 100644 index 00000000000000..69dd45f821f963 --- /dev/null +++ b/recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-link-openssl.patch @@ -0,0 +1,8 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -135,4 +135,5 @@ if(AMQP-CPP_LINUX_TCP) + # Find OpenSSL and provide include dirs + find_package(OpenSSL REQUIRED) + target_include_directories(${PROJECT_NAME} PRIVATE ${OPENSSL_INCLUDE_DIR}) ++ target_link_libraries(${PROJECT_NAME} OpenSSL::SSL) + endif() diff --git a/recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-openssl-install-directories.patch b/recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-openssl-install-directories.patch deleted file mode 100644 index 3ab0f791141189..00000000000000 --- a/recipes/amqp-cpp/all/patches/4.3.24-0001-cmake-openssl-install-directories.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 69deeaf..4623ab2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -91,7 +91,10 @@ else() - #add_library(${PROJECT_NAME} STATIC ${SRCS}) - add_library(${PROJECT_NAME} STATIC ${src_MAIN} ${src_LINUX_TCP}) - endif() -- -+if(AMQP-CPP_LINUX_TCP) -+find_package(OpenSSL REQUIRED) -+target_link_libraries(${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto) -+endif() - # install rules - # ------------------------------------------------------------------------------------------------------ - -@@ -100,7 +103,7 @@ if(AMQP-CPP_BUILD_SHARED) - install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib -- RUNTIME DESTINATION lib -+ RUNTIME DESTINATION bin - ) - else() - # copy static lib diff --git a/recipes/amqp-cpp/all/patches/4.3.24-0002-cmake-install-dll-export-msvc.patch b/recipes/amqp-cpp/all/patches/4.3.24-0002-cmake-install-dll-export-msvc.patch new file mode 100644 index 00000000000000..1e75ea7e91ac06 --- /dev/null +++ b/recipes/amqp-cpp/all/patches/4.3.24-0002-cmake-install-dll-export-msvc.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -85,7 +85,7 @@ if(AMQP-CPP_BUILD_SHARED) + #add_library(${PROJECT_NAME} SHARED ${SRCS}) + add_library(${PROJECT_NAME} SHARED ${src_MAIN} ${src_LINUX_TCP}) + # set shared lib version +- set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${SO_VERSION}) ++ set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${SO_VERSION} WINDOWS_EXPORT_ALL_SYMBOLS ON) + else() + # create static lib + #add_library(${PROJECT_NAME} STATIC ${SRCS}) +@@ -100,7 +100,7 @@ if(AMQP-CPP_BUILD_SHARED) + install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib ++ RUNTIME DESTINATION bin + ) + else() + # copy static lib diff --git a/recipes/amqp-cpp/all/patches/4.3.24-0003-cmake-link-ws2_32.patch b/recipes/amqp-cpp/all/patches/4.3.24-0003-cmake-link-ws2_32.patch new file mode 100644 index 00000000000000..98c5524cc4932f --- /dev/null +++ b/recipes/amqp-cpp/all/patches/4.3.24-0003-cmake-link-ws2_32.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -91,6 +91,9 @@ else() + #add_library(${PROJECT_NAME} STATIC ${SRCS}) + add_library(${PROJECT_NAME} STATIC ${src_MAIN} ${src_LINUX_TCP}) + endif() ++if(WIN32) ++ target_link_libraries(${PROJECT_NAME} PUBLIC ws2_32) ++endif() + + # install rules + # ------------------------------------------------------------------------------------------------------ diff --git a/recipes/amqp-cpp/config.yml b/recipes/amqp-cpp/config.yml index 31f91dc40c9199..3cdf4ddfdb5a3b 100644 --- a/recipes/amqp-cpp/config.yml +++ b/recipes/amqp-cpp/config.yml @@ -1,19 +1,9 @@ versions: - "4.3.24": - folder: all - "4.3.18": - folder: all - "4.3.16": - folder: all - "4.3.11": + "4.3.26": folder: all - "4.3.10": + "4.3.24": folder: all "4.2.1": folder: all "4.1.7": folder: all - "4.1.6": - folder: all - "4.1.5": - folder: all diff --git a/recipes/android-ndk/all/conandata.yml b/recipes/android-ndk/all/conandata.yml index 020850fb262026..788c3990884da0 100644 --- a/recipes/android-ndk/all/conandata.yml +++ b/recipes/android-ndk/all/conandata.yml @@ -1,4 +1,30 @@ sources: + "r26b": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26b-windows.zip" + sha256: "a478d43d4a45d0d345cda6be50d79642b92fb175868d9dc0dfc86181d80f691e" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26b-linux.zip" + sha256: "ad73c0370f0b0a87d1671ed2fd5a9ac9acfd1eb5c43a7fbfbd330f85d19dd632" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26b-darwin.zip" + sha256: "4b0ea6148a9a2337e62a0c0c7ac59ff1edc38d69b81d9c58251897d23f7fa321" + "r26": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26-windows.zip" + sha256: "a748c6634b96991e15cb8902ffa4a498bba2ec6aa8028526de3c4c9dfcf00663" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26-linux.zip" + sha256: "1505c2297a5b7a04ed20b5d44da5665e91bac2b7c0fbcd3ae99b6ccc3a61289a" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26-darwin.zip" + sha256: "b2ab2fd17f71e2d2994c8c0ba2e48e99377806e05bf7477093344c26ab71dec0" "r25c": "Windows": "x86_64": diff --git a/recipes/android-ndk/config.yml b/recipes/android-ndk/config.yml index abc38391659913..a7fa8c97dd42c7 100644 --- a/recipes/android-ndk/config.yml +++ b/recipes/android-ndk/config.yml @@ -1,4 +1,8 @@ versions: + "r26b": + folder: all + "r26": + folder: all "r25c": folder: all "r25b": diff --git a/recipes/angelscript/all/conandata.yml b/recipes/angelscript/all/conandata.yml index 1dec7ac1d3e717..edfe7e005b8552 100644 --- a/recipes/angelscript/all/conandata.yml +++ b/recipes/angelscript/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.36.1": + url: "https://www.angelcode.com/angelscript/sdk/files/angelscript_2.36.1.zip" + sha256: "58bb749af9c7e386304705f4e6e627ae41dfe03e0b6a73c3d0d2e017c4fc948f" "2.36.0": url: "https://www.angelcode.com/angelscript/sdk/files/angelscript_2.36.0.zip" sha256: "33f95f7597bc0d88b097d35e7b1320d15419ffc5779851d9d2a6cccec57811b3" diff --git a/recipes/angelscript/config.yml b/recipes/angelscript/config.yml index 22190418b16a22..f3cbb4fedf4543 100644 --- a/recipes/angelscript/config.yml +++ b/recipes/angelscript/config.yml @@ -1,4 +1,6 @@ versions: + "2.36.1": + folder: all "2.36.0": folder: all "2.35.1": diff --git a/recipes/antlr4-cppruntime/all/conandata.yml b/recipes/antlr4-cppruntime/all/conandata.yml index 28bc286ec79b58..f6974e320b5592 100644 --- a/recipes/antlr4-cppruntime/all/conandata.yml +++ b/recipes/antlr4-cppruntime/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.13.1": + url: "https://github.com/antlr/antlr4/archive/refs/tags/4.13.1.tar.gz" + sha256: "da20d487524d7f0a8b13f73a8dc326de7fc2e5775f5a49693c0a4e59c6b1410c" "4.13.0": url: "https://github.com/antlr/antlr4/archive/refs/tags/4.13.0.tar.gz" sha256: "b7082b539256e6de5137a7d57afe89493dce234a3ce686dbae709ef6cf2d2c81" diff --git a/recipes/antlr4-cppruntime/config.yml b/recipes/antlr4-cppruntime/config.yml index 62ba72dbb3e3f8..05c77e20051f93 100644 --- a/recipes/antlr4-cppruntime/config.yml +++ b/recipes/antlr4-cppruntime/config.yml @@ -1,4 +1,6 @@ versions: + "4.13.1": + folder: all "4.13.0": folder: all "4.12.0": diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py index 86dd0a9fc160cd..c6efeb71fc33d5 100644 --- a/recipes/apr-util/all/conanfile.py +++ b/recipes/apr-util/all/conanfile.py @@ -76,7 +76,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("apr/1.7.0", transitive_headers=True) + self.requires("apr/1.7.4", transitive_headers=True) if self.settings.os != "Windows": #cmake build doesn't allow injection of iconv yet # https://github.com/conan-io/conan-center-index/pull/16142#issuecomment-1494282164 @@ -84,15 +84,15 @@ def requirements(self): # are pulling it in - discovered in https://github.com/conan-io/conan-center-index/pull/16266 self.requires("libiconv/1.17", transitive_libs=True) if self.options.with_openssl: - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") if self.options.with_mysql: - self.requires("libmysqlclient/8.0.31") + self.requires("libmysqlclient/8.1.0") if self.options.with_sqlite3: - self.requires("sqlite3/3.41.1") + self.requires("sqlite3/3.44.2") if self.options.with_expat: self.requires("expat/2.5.0") if self.options.with_postgresql: - self.requires("libpq/14.5") + self.requires("libpq/15.4") def validate(self): if not self.options.with_expat: @@ -210,7 +210,7 @@ def package_info(self): self.runenv_info.define_path("APR_UTIL_ROOT", self.package_folder) deps = [dep for dep in reversed(self.dependencies.host.topological_sort.values())] - libdirs = [p for dep in deps for p in dep.cpp_info.aggregated_components().includedirs] + libdirs = [p for dep in deps for p in dep.cpp_info.aggregated_components().libdirs] aprutil_ldflags = " ".join([f"-L{p}" for p in libdirs]) self.runenv_info.define("APRUTIL_LDFLAGS", aprutil_ldflags) diff --git a/recipes/apr/all/conandata.yml b/recipes/apr/all/conandata.yml index 0e388265ecf5f4..6ce547b4ee2f4f 100644 --- a/recipes/apr/all/conandata.yml +++ b/recipes/apr/all/conandata.yml @@ -7,21 +7,26 @@ sources: sha256: "e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea" patches: "1.7.4": - - patch_file: "patches/0401-cmake-build-only-shared-static.patch" + - patch_file: "patches/1.7.4-0001-cmake-build-only-shared-static.patch" patch_type: "conan" patch_description: "Use BUILD_SHARED_LIBS to conditionally build static/dynamic libs" - - patch_file: "patches/0006-sys_siglist-fix.patch" + - patch_file: "patches/1.7.0-0002-apr-config-prefix-env.patch" + patch_type: "conan" + patch_description: "Allow downtream recipes to detect some helpr build files of apr in a relocatalbe context" + - patch_file: "patches/1.7.0-0006-sys_siglist-fix.patch" patch_type: "bugfix" patch_description: "Replace deprecated sys_siglist[] with strsignal()" "1.7.0": - - patch_file: "patches/0001-cmake-build-only-shared-static.patch" + - patch_file: "patches/1.7.0-0001-cmake-build-only-shared-static.patch" patch_type: "conan" patch_description: "Use BUILD_SHARED_LIBS to conditionally build static/dynamic libs" - - patch_file: "patches/0002-apr-config-prefix-env.patch" - - patch_file: "patches/0003-cmake-gen_test_char-use-target.patch" - - patch_file: "patches/0004-autotools-mingw.patch" - - patch_file: "patches/0005-clang12-apple.patch" - - patch_file: "patches/0006-sys_siglist-fix.patch" + - patch_file: "patches/1.7.0-0002-apr-config-prefix-env.patch" + patch_type: "conan" + patch_description: "Allow downtream recipes to detect some helpr build files of apr in a relocatalbe context" + - patch_file: "patches/1.7.0-0003-cmake-gen_test_char-use-target.patch" + - patch_file: "patches/1.7.0-0004-autotools-mingw.patch" + - patch_file: "patches/1.7.0-0005-clang12-apple.patch" + - patch_file: "patches/1.7.0-0006-sys_siglist-fix.patch" patch_type: "bugfix" patch_description: "Replace deprecated sys_siglist[] with strsignal()" - - patch_file: "patches/0007-cmake-minimum-required.patch" + - patch_file: "patches/1.7.0-0007-cmake-minimum-required.patch" diff --git a/recipes/apr/all/patches/0001-cmake-build-only-shared-static.patch b/recipes/apr/all/patches/1.7.0-0001-cmake-build-only-shared-static.patch similarity index 100% rename from recipes/apr/all/patches/0001-cmake-build-only-shared-static.patch rename to recipes/apr/all/patches/1.7.0-0001-cmake-build-only-shared-static.patch diff --git a/recipes/apr/all/patches/0002-apr-config-prefix-env.patch b/recipes/apr/all/patches/1.7.0-0002-apr-config-prefix-env.patch similarity index 100% rename from recipes/apr/all/patches/0002-apr-config-prefix-env.patch rename to recipes/apr/all/patches/1.7.0-0002-apr-config-prefix-env.patch diff --git a/recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch b/recipes/apr/all/patches/1.7.0-0003-cmake-gen_test_char-use-target.patch similarity index 100% rename from recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch rename to recipes/apr/all/patches/1.7.0-0003-cmake-gen_test_char-use-target.patch diff --git a/recipes/apr/all/patches/0004-autotools-mingw.patch b/recipes/apr/all/patches/1.7.0-0004-autotools-mingw.patch similarity index 100% rename from recipes/apr/all/patches/0004-autotools-mingw.patch rename to recipes/apr/all/patches/1.7.0-0004-autotools-mingw.patch diff --git a/recipes/apr/all/patches/0005-clang12-apple.patch b/recipes/apr/all/patches/1.7.0-0005-clang12-apple.patch similarity index 100% rename from recipes/apr/all/patches/0005-clang12-apple.patch rename to recipes/apr/all/patches/1.7.0-0005-clang12-apple.patch diff --git a/recipes/apr/all/patches/0006-sys_siglist-fix.patch b/recipes/apr/all/patches/1.7.0-0006-sys_siglist-fix.patch similarity index 100% rename from recipes/apr/all/patches/0006-sys_siglist-fix.patch rename to recipes/apr/all/patches/1.7.0-0006-sys_siglist-fix.patch diff --git a/recipes/apr/all/patches/0007-cmake-minimum-required.patch b/recipes/apr/all/patches/1.7.0-0007-cmake-minimum-required.patch similarity index 100% rename from recipes/apr/all/patches/0007-cmake-minimum-required.patch rename to recipes/apr/all/patches/1.7.0-0007-cmake-minimum-required.patch diff --git a/recipes/apr/all/patches/0401-cmake-build-only-shared-static.patch b/recipes/apr/all/patches/1.7.4-0001-cmake-build-only-shared-static.patch similarity index 100% rename from recipes/apr/all/patches/0401-cmake-build-only-shared-static.patch rename to recipes/apr/all/patches/1.7.4-0001-cmake-build-only-shared-static.patch diff --git a/recipes/aravis/all/conandata.yml b/recipes/aravis/all/conandata.yml index f4c6ccd2ff9e6b..768365163e373b 100644 --- a/recipes/aravis/all/conandata.yml +++ b/recipes/aravis/all/conandata.yml @@ -1,7 +1,30 @@ sources: + "0.8.30": + url: "https://github.com/AravisProject/aravis/releases/download/0.8.30/aravis-0.8.30.tar.xz" + sha256: "40380f06fa04524a7875bd456e5a5ea78b2c058fa84b5598bc6e0642fcef00b0" + "0.8.29": + url: "https://github.com/AravisProject/aravis/releases/download/0.8.29/aravis-0.8.29.tar.xz" + sha256: "12e5f2f0e1a966c3a6dce0a42d96b2f24497f42ae6051d6f026811124e986963" + "0.8.25": # latest version that supports GenDC data format (supported by U3V 1.1) + url: "https://github.com/AravisProject/aravis/releases/download/0.8.25/aravis-0.8.25.tar.xz" + sha256: "3ba18f941ae4e2c898fed1f63c4ce67ea41a800a902ee5684eef4ffdb87f1c09" "0.8.20": url: "https://github.com/AravisProject/aravis/releases/download/0.8.20/aravis-0.8.20.tar.xz" sha256: "0c0eb5a76109f29180c09c7e6a23fd403633bf22bbe8468a0ae44995c4449f46" patches: + "0.8.30": + - patch_file: "patches/0.8.29-gst-shared-lib.patch" + patch_description: "remove forcing of shared library built for gst-plugins" + patch_type: conan + "0.8.29": + - patch_file: "patches/0.8.29-gst-shared-lib.patch" + patch_description: "remove forcing of shared library built for gst-plugins" + patch_type: conan + "0.8.25": + - patch_file: "patches/0.8.25-gst-shared-lib.patch" + patch_description: "remove forcing of shared library built for gst-plugins" + patch_type: conan "0.8.20": - patch_file: "patches/0.8.19-gst-shared-lib.patch" + patch_description: "remove forcing of shared library built for gst-plugins" + patch_type: conan diff --git a/recipes/aravis/all/conanfile.py b/recipes/aravis/all/conanfile.py index aaa8cad5fb1b43..19795c53aec2d7 100644 --- a/recipes/aravis/all/conanfile.py +++ b/recipes/aravis/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.apple import fix_apple_shared_install_name, 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, rename, rm, rmdir @@ -12,16 +12,18 @@ import os import glob -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.56.0 <2 || >=2.0.6" class AravisConan(ConanFile): name = "aravis" + description = "A vision library for genicam based cameras." license = "LGPL-2.1-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/AravisProject/aravis" - description = "A vision library for genicam based cameras." topics = ("usb", "camera") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -31,6 +33,7 @@ class AravisConan(ConanFile): "gst_plugin": [True, False], "tools": [True, False], "introspection": [True, False], + "gv_n_buffers": ["ANY"], } default_options = { "shared": False, @@ -40,6 +43,7 @@ class AravisConan(ConanFile): "gst_plugin": False, "tools": True, "introspection": False, + "gv_n_buffers": 16, } def export_sources(self): @@ -48,8 +52,12 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.os != "Linux": + if self.settings.os not in ["Linux", "FreeBSD"]: del self.options.packet_socket + # https://github.com/AravisProject/aravis/commit/b4211e5e0266d0226e936818b3faefd6d0daaa3a#diff-f28598af2e23aa5d2bc7c72e022ae2c56a33802eb970afffaeca1e40607f97fe + if Version(self.version) < "0.8.21": + del self.options.gv_n_buffers + def configure(self): if self.options.shared: @@ -63,13 +71,15 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.75.2") - self.requires("libxml2/2.10.3") - self.requires("zlib/1.2.13") + # glib-object.h and gio/gio.h are used in several public headers + self.requires("glib/2.78.0", transitive_headers=True) + self.requires("libxml2/2.11.4") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.usb: self.requires("libusb/1.0.26") if self.options.gst_plugin: - self.requires("gstreamer/1.19.2") + self.requires("gstreamer/1.22.3") self.requires("gst-plugins-base/1.19.2") def validate(self): @@ -77,18 +87,27 @@ def validate(self): raise ConanInvalidConfiguration("Static runtime is not supported on Windows due to GLib issues") if self.options.shared and not self.dependencies["glib"].options.shared: raise ConanInvalidConfiguration("Shared Aravis cannot link to static GLib") - if self.settings.os == "Macos" and self.dependencies["glib"].options.shared: + if is_apple_os(self) and self.dependencies["glib"].options.shared: raise ConanInvalidConfiguration( "macOS builds are disabled when glib is shared until " "conan-io/conan#7324 gets merged to fix macOS SIP issue #8443" ) + if self.options.get_safe("gv_n_buffers"): + try: + gv_n_buffers_val = int(str(self.options.gv_n_buffers)) + if gv_n_buffers_val < 1: + raise ConanInvalidConfiguration( + f"gv_n_buffers_val must be greater than 1 Provided: {gv_n_buffers_val}") + except ValueError as e: + raise ConanInvalidConfiguration("gv_n_buffers_val must be an integer.") from e + def build_requirements(self): - self.tool_requires("meson/1.0.0") - if hasattr(self, "settings_build") and cross_building(self): - self.tool_requires("glib/2.75.2") + #windows build: meson/1.2.1 works, meson/1.2.2 breaks for some reason! + self.tool_requires("meson/1.2.1") + self.tool_requires("glib/") 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.introspection: self.tool_requires("gobject-introspection/1.72.0") @@ -110,6 +129,11 @@ def generate(self): tc.project_options["viewer"] = "disabled" tc.project_options["tests"] = False tc.project_options["documentation"] = "disabled" + + if self.options.get_safe("gv_n_buffers"): + tc.project_options["gv-n-buffers"] = int(str(self.options.gv_n_buffers)) + + tc.project_options["fast-heartbeat"] = False if self.settings.get_safe("compiler.runtime"): tc.project_options["b_vscrt"] = msvc_runtime_flag(self).lower() tc.generate() diff --git a/recipes/aravis/all/patches/0.8.25-gst-shared-lib.patch b/recipes/aravis/all/patches/0.8.25-gst-shared-lib.patch new file mode 100644 index 00000000000000..c4bdecffb39f14 --- /dev/null +++ b/recipes/aravis/all/patches/0.8.25-gst-shared-lib.patch @@ -0,0 +1,11 @@ +--- a/gst/meson.build 2023-10-03 14:55:30.481822400 -0700 ++++ b/gst/meson.build 2023-10-03 14:56:40.939480100 -0700 +@@ -17,7 +17,7 @@ + + gst_plugin_filename = 'gstaravis.@0@'.format (aravis_api_version) + +-gst_plugin = shared_library (gst_plugin_filename, ++gst_plugin = library (gst_plugin_filename, + gst_sources, gst_headers, + name_suffix: [], + link_with: aravis_library, diff --git a/recipes/aravis/all/patches/0.8.29-gst-shared-lib.patch b/recipes/aravis/all/patches/0.8.29-gst-shared-lib.patch new file mode 100644 index 00000000000000..3b6fa48c98a4ec --- /dev/null +++ b/recipes/aravis/all/patches/0.8.29-gst-shared-lib.patch @@ -0,0 +1,13 @@ +Index: src/gst/meson.build +=================================================================== +--- a/gst/meson.build 2023-10-04 20:46:34.452887470 +0100 ++++ b/gst/meson.build 2023-10-04 20:46:34.441887164 +0100 +@@ -17,7 +17,7 @@ + + gst_plugin_filename = 'gstaravis.@0@'.format (aravis_api_version) + +-gst_plugin = shared_library (gst_plugin_filename, ++gst_plugin = library (gst_plugin_filename, + gst_sources, gst_headers, + name_suffix: [], + link_with: aravis_library, diff --git a/recipes/aravis/all/test_package/CMakeLists.txt b/recipes/aravis/all/test_package/CMakeLists.txt index 8a5d8c220194f0..f8a36c47767ce3 100644 --- a/recipes/aravis/all/test_package/CMakeLists.txt +++ b/recipes/aravis/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(aravis REQUIRED CONFIG) diff --git a/recipes/aravis/all/test_package/test_package.c b/recipes/aravis/all/test_package/test_package.c index 9a63b9ea3a8648..762afa0db71a78 100644 --- a/recipes/aravis/all/test_package/test_package.c +++ b/recipes/aravis/all/test_package/test_package.c @@ -1,9 +1,8 @@ #include -#include #include +#include -int main(int argc, char **argv) -{ +int main() { printf("Enumerating Aravis interfaces:\n"); unsigned int if_count = arv_get_n_interfaces(); for (unsigned int if_index = 0; if_index < if_count; if_index++) { diff --git a/recipes/aravis/all/test_v1_package/CMakeLists.txt b/recipes/aravis/all/test_v1_package/CMakeLists.txt index 0d20897301b68b..91630d79f4abb3 100644 --- a/recipes/aravis/all/test_v1_package/CMakeLists.txt +++ b/recipes/aravis/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/aravis/config.yml b/recipes/aravis/config.yml index a7431a882c8d44..1aa8532edf0e6b 100644 --- a/recipes/aravis/config.yml +++ b/recipes/aravis/config.yml @@ -1,3 +1,10 @@ versions: + "0.8.30": + folder: all + "0.8.29": + folder: all + # 0.8.25 is the last version to support GenDC data format + "0.8.25": + folder: all "0.8.20": folder: all diff --git a/recipes/archicad-apidevkit/all/conanfile.py b/recipes/archicad-apidevkit/all/conanfile.py index 55e0ec99e9a6b8..2cdfa85c589273 100644 --- a/recipes/archicad-apidevkit/all/conanfile.py +++ b/recipes/archicad-apidevkit/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.files import copy, get +from conan.tools.layout import basic_layout from conan.tools.microsoft import check_min_vs, is_msvc -from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration import os @@ -14,11 +14,20 @@ class ArchicadApidevkitConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://archicadapi.graphisoft.com/" license = "LicenseRef-LICENSE" - settings = "os", "compiler", "arch", "build_type" + topics = ("api", "archicad", "development", "pre-built") + + package_type = "application" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - topics = "api", "archicad", "development" short_paths = True + def layout(self): + basic_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.build_type == "Debug": raise ConanInvalidConfiguration("Debug configuration is not supported") @@ -31,9 +40,6 @@ def validate(self): if not str(self.settings.arch) in ("x86_64"): raise ConanInvalidConfiguration( f"{self.ref} is not supported yet.") - if self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) < "16": - raise ConanInvalidConfiguration( - "This recipe does not support this compiler version") def build(self): devkit, licenses = self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)] 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/args-parser/all/conandata.yml b/recipes/args-parser/all/conandata.yml index 787c510a62b539..427c4c05d81dda 100644 --- a/recipes/args-parser/all/conandata.yml +++ b/recipes/args-parser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.3.3": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.3.3.tar.gz" + sha256: "67867d7ab624a8c2f391230c54c37830e6127f7f5c716ff634165f674d876b64" "6.3.2": url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.3.2.tar.gz" sha256: "cd89549a9f5b5cfd16db2f8b9c93fd164cea334147c58890d5322365789e05e5" diff --git a/recipes/args-parser/config.yml b/recipes/args-parser/config.yml index 08a70490fa0abe..b67bad0e21e0f9 100644 --- a/recipes/args-parser/config.yml +++ b/recipes/args-parser/config.yml @@ -1,4 +1,6 @@ versions: + "6.3.3": + folder: all "6.3.2": folder: all "6.3.1": diff --git a/recipes/armadillo/all/conandata.yml b/recipes/armadillo/all/conandata.yml index 0d2a3540e26f26..fafd7b841d70bd 100644 --- a/recipes/armadillo/all/conandata.yml +++ b/recipes/armadillo/all/conandata.yml @@ -11,6 +11,9 @@ sources: "12.2.0": url: "https://sourceforge.net/projects/arma/files/armadillo-12.2.0.tar.xz" sha256: "b0dce042297e865add3351dad77f78c2c7638d6632f58357b015e50edcbd2186" + "12.6.4": + url: "https://sourceforge.net/projects/arma/files/armadillo-12.6.4.tar.xz" + sha256: "eb7f243ffc32f18324bc7fa978d0358637e7357ca7836bec55b4eb56e9749380" patches: "10.7.0": @@ -29,3 +32,7 @@ patches: - patch_file: "patches/0003-Guard-dependency-discovery-12.2.x.patch" patch_description: "Add find_package statements to inject conan dependencies" patch_type: "conan" + "12.6.4": + - patch_file: "patches/0004-Guard-dependency-discovery-12.6.x.patch" + patch_description: "Add find_package statements to inject conan dependencies" + patch_type: "conan" diff --git a/recipes/armadillo/all/conanfile.py b/recipes/armadillo/all/conanfile.py index 5638fc2428e265..88da815dbce2ad 100644 --- a/recipes/armadillo/all/conanfile.py +++ b/recipes/armadillo/all/conanfile.py @@ -174,6 +174,9 @@ def validate(self): "The wrapper requires the use of an external RNG. Set use_extern_rng=True and try again." ) + if not self.options.shared and self.options.use_wrapper: + raise ConanInvalidConfiguration("Building the armadillo run-time wrapper library requires armadillo/*:shared=True") + def requirements(self): # Optional requirements # TODO: "atlas/3.10.3" # Pending https://github.com/conan-io/conan-center-index/issues/6757 @@ -186,10 +189,12 @@ def requirements(self): # See https://gitlab.com/conradsnicta/armadillo-code/-/issues/227 for more information. if self.options.use_hdf5 and Version(self.version) < "12": # Use the conan dependency if the system lib isn't being used - self.requires("hdf5/1.14.0") + # Libraries not required to be propagated transitively when the armadillo run-time wrapper is used + self.requires("hdf5/1.14.1", transitive_headers=True, transitive_libs=not self.options.use_wrapper) if self.options.use_blas == "openblas": - self.requires("openblas/0.3.20") + # Libraries not required to be propagated transitively when the armadillo run-time wrapper is used + self.requires("openblas/0.3.20", transitive_libs=not self.options.use_wrapper) if ( self.options.use_blas == "intel_mkl" and self.options.use_lapack == "intel_mkl" diff --git a/recipes/armadillo/all/patches/0004-Guard-dependency-discovery-12.6.x.patch b/recipes/armadillo/all/patches/0004-Guard-dependency-discovery-12.6.x.patch new file mode 100644 index 00000000000000..f374782089ebfd --- /dev/null +++ b/recipes/armadillo/all/patches/0004-Guard-dependency-discovery-12.6.x.patch @@ -0,0 +1,121 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a67ef80..91ef979 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -259,7 +259,11 @@ if(APPLE) + set(ARMA_USE_ACCELERATE true) + + if(ALLOW_OPENBLAS_MACOS) +- include(ARMA_FindOpenBLAS) ++ if(USE_OPENBLAS) ++ find_package(OpenBLAS) ++ else() ++ set(OpenBLAS_FOUND NO) ++ endif() + message(STATUS "OpenBLAS_FOUND = ${OpenBLAS_FOUND}") + message(STATUS "") + message(STATUS "*** If use of OpenBLAS is causing problems,") +@@ -274,8 +278,16 @@ if(APPLE) + endif() + + if(ALLOW_BLAS_LAPACK_MACOS) +- include(ARMA_FindBLAS) +- include(ARMA_FindLAPACK) ++ if(USE_SYSTEM_BLAS) ++ include(ARMA_FindBLAS) ++ else() ++ set(BLAS_FOUND NO) ++ endif() ++ if(USE_SYSTEM_LAPACK) ++ include(ARMA_FindLAPACK) ++ else() ++ set(LAPACK_FOUND NO) ++ endif() + message(STATUS " BLAS_FOUND = ${BLAS_FOUND}" ) + message(STATUS "LAPACK_FOUND = ${LAPACK_FOUND}") + message(STATUS "") +@@ -314,19 +326,45 @@ if(APPLE) + + else() + +- if(ALLOW_FLEXIBLAS_LINUX AND (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) +- include(ARMA_FindFlexiBLAS) ++ if(USE_MKL) ++ find_package(MKL) + else() +- set(FlexiBLAS_FOUND false) ++ set(MKL_FOUND NO) ++ endif() ++ ++ if(USE_OPENBLAS) ++ find_package(OpenBLAS) ++ else() ++ set(OpenBLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_ATLAS) ++ include(ARMA_FindATLAS) ++ else() ++ set(ATLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_BLAS) ++ include(ARMA_FindBLAS) ++ else() ++ set(BLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_LAPACK) ++ include(ARMA_FindLAPACK) ++ else() ++ set(LAPACK_FOUND NO) + endif() + +- include(ARMA_FindMKL) +- include(ARMA_FindOpenBLAS) +- include(ARMA_FindATLAS) # TODO: remove support for ATLAS in next major version +- include(ARMA_FindBLAS) +- include(ARMA_FindLAPACK) +- +- message(STATUS "FlexiBLAS_FOUND = ${FlexiBLAS_FOUND}" ) ++ if(ALLOW_FLEXIBLAS_LINUX AND (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) ++ if(USE_SYSTEM_FLEXIBLAS) ++ include(ARMA_FindFlexiBLAS) ++ else() ++ set(FlexiBLAS_FOUND NO) ++ endif() ++ endif() ++ ++ message(STATUS "FlexiBLAS_FOUND = ${FlexiBLAS_FOUND}" ) + message(STATUS " MKL_FOUND = ${MKL_FOUND}" ) + message(STATUS " OpenBLAS_FOUND = ${OpenBLAS_FOUND}" ) + message(STATUS " ATLAS_FOUND = ${ATLAS_FOUND}" ) +@@ -438,7 +476,11 @@ else() + endif() + + +-include(ARMA_FindARPACK) ++if(USE_SYSTEM_ARPACK) ++ include(ARMA_FindARPACK) ++else() ++ set(ARPACK_FOUND NO) ++endif() + message(STATUS "ARPACK_FOUND = ${ARPACK_FOUND}") + + if(ARPACK_FOUND) +@@ -446,7 +488,11 @@ if(ARPACK_FOUND) + set(ARMA_LIBS ${ARMA_LIBS} ${ARPACK_LIBRARY}) + endif() + +-include(ARMA_FindSuperLU5) ++if(USE_SYSTEM_SUPERLU) ++ include(ARMA_FindSuperLU5) ++else() ++ set(SuperLU_FOUND NO) ++endif() + message(STATUS "SuperLU_FOUND = ${SuperLU_FOUND}") + + if(SuperLU_FOUND) +-- +2.42.0 + diff --git a/recipes/armadillo/config.yml b/recipes/armadillo/config.yml index 3d54bf4d2f283f..7dfcb07b6f44b0 100644 --- a/recipes/armadillo/config.yml +++ b/recipes/armadillo/config.yml @@ -7,3 +7,5 @@ versions: folder: all "12.2.0": folder: all + "12.6.4": + folder: all diff --git a/recipes/arrow/all/conan_cmake_project_include.cmake b/recipes/arrow/all/conan_cmake_project_include.cmake new file mode 100644 index 00000000000000..1bf900def3e567 --- /dev/null +++ b/recipes/arrow/all/conan_cmake_project_include.cmake @@ -0,0 +1,13 @@ +if(ARROW_S3) + find_package(AWSSDK REQUIRED) + # Fix issue where scripts expect a variable called "AWSSDK_LINK_LIBRARIES" + # which is not defined by the generated AWSSDKConfig.cmake + if(NOT DEFINED AWSSDK_LINK_LIBRARIES) + set(AWSSDK_LINK_LIBRARIES "${AWSSDK_LIBRARIES}") + endif() + + # Causes logic used for generated .pc file to not run + # avoiding instropection of target `aws-cpp-sdk::aws-cpp-sdk` + # This is fine because the generated .pc file is not of use + set(AWSSDK_SOURCE "conan") +endif() diff --git a/recipes/arrow/all/conandata.yml b/recipes/arrow/all/conandata.yml index 772cdfef9c3c2d..3da635cfb03820 100644 --- a/recipes/arrow/all/conandata.yml +++ b/recipes/arrow/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "12.0.1": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-12.0.1/apache-arrow-12.0.1.tar.gz?action=download" + sha256: "3481c411393aa15c75e88d93cf8315faf7f43e180fe0790128d3840d417de858" "12.0.0": url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-12.0.0/apache-arrow-12.0.0.tar.gz?action=download" sha256: "ddd8347882775e53af7d0965a1902b7d8fcd0a030fd14f783d4f85e821352d52" diff --git a/recipes/arrow/all/conanfile.py b/recipes/arrow/all/conanfile.py index 50780c591a6e71..dcd80308b7b011 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -49,8 +49,9 @@ class ArrowConan(ConanFile): "with_glog": ["auto", True, False], "with_grpc": ["auto", True, False], "with_jemalloc": ["auto", True, False], - "with_mimalloc": ["auto", True, False], + "with_mimalloc": [True, False], "with_json": [True, False], + "with_thrift": ["auto", True, False], "with_llvm": ["auto", True, False], "with_openssl": ["auto", True, False], "with_opentelemetry": [True, False], @@ -99,6 +100,7 @@ class ArrowConan(ConanFile): "with_glog": "auto", "with_grpc": "auto", "with_json": False, + "with_thrift": "auto", "with_llvm": "auto", "with_openssl": "auto", "with_opentelemetry": False, @@ -137,6 +139,7 @@ def _compilers_minimum_version(self): def export_sources(self): export_conandata_patches(self) + copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -155,6 +158,22 @@ def config_options(self): if Version(self.version) < "8.0.0": del self.options.substrait + self.options.parquet = self._parquet() + self.options.compute = self._compute() + self.options.dataset_modules = self._dataset_modules() + self.options.with_boost = self._with_boost() + self.options.with_flight_rpc = self._with_flight_rpc() + self.options.with_gflags = self._with_gflags() + self.options.with_glog = self._with_glog() + self.options.with_grpc = self._with_grpc() + self.options.with_jemalloc = self._with_jemalloc() + self.options.with_thrift = self._with_thrift() + self.options.with_llvm = self._with_llvm() + self.options.with_openssl = self._with_openssl() + self.options.with_protobuf = self._with_protobuf() + self.options.with_re2 = self._with_re2() + self.options.with_utf8proc = self._with_utf8proc() + def configure(self): if self.options.shared: self.options.rm_safe("fPIC") @@ -162,32 +181,32 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - def _compute(self, required=False): - if required or self.options.compute == "auto": + def _compute(self): + if self.options.compute == "auto": return bool(self._parquet() or self._dataset_modules()) or bool(self.options.get_safe("substrait", False)) else: return bool(self.options.compute) - def _parquet(self, required=False): - if required or self.options.parquet == "auto": + def _parquet(self): + if self.options.parquet == "auto": return bool(self.options.get_safe("substrait", False)) else: return bool(self.options.parquet) - def _dataset_modules(self, required=False): - if required or self.options.dataset_modules == "auto": + def _dataset_modules(self): + if self.options.dataset_modules == "auto": return bool(self.options.get_safe("substrait", False)) else: return bool(self.options.dataset_modules) - def _with_jemalloc(self, required=False): - if required or self.options.with_jemalloc == "auto": + def _with_jemalloc(self): + if self.options.with_jemalloc == "auto": return bool("BSD" in str(self.settings.os)) else: return bool(self.options.with_jemalloc) - def _with_re2(self, required=False): - if required or self.options.with_re2 == "auto": + def _with_re2(self): + if self.options.with_re2 == "auto": if self.options.gandiva or self.options.parquet: return True if Version(self) >= "7.0.0" and (self._compute() or self._dataset_modules()): @@ -196,38 +215,38 @@ def _with_re2(self, required=False): else: return bool(self.options.with_re2) - def _with_protobuf(self, required=False): - if required or self.options.with_protobuf == "auto": + def _with_protobuf(self): + if self.options.with_protobuf == "auto": return bool(self.options.gandiva or self._with_flight_rpc() or self.options.with_orc or self.options.get_safe("substrait", False)) else: return bool(self.options.with_protobuf) - def _with_flight_rpc(self, required=False): - if required or self.options.with_flight_rpc == "auto": + def _with_flight_rpc(self): + if self.options.with_flight_rpc == "auto": return bool(self.options.get_safe("with_flight_sql", False)) else: return bool(self.options.with_flight_rpc) - def _with_gflags(self, required=False): - if required or self.options.with_gflags == "auto": + def _with_gflags(self): + if self.options.with_gflags == "auto": return bool(self._with_glog() or self._with_grpc()) else: return bool(self.options.with_gflags) - def _with_glog(self, required=False): - if required or self.options.with_glog == "auto": + def _with_glog(self): + if self.options.with_glog == "auto": return False else: return bool(self.options.with_glog) - def _with_grpc(self, required=False): - if required or self.options.with_grpc == "auto": + def _with_grpc(self): + if self.options.with_grpc == "auto": return self._with_flight_rpc() else: return bool(self.options.with_grpc) - def _with_boost(self, required=False): - if required or self.options.with_boost == "auto": + def _with_boost(self): + if self.options.with_boost == "auto": if self.options.gandiva: return True version = Version(self.version) @@ -241,29 +260,31 @@ def _with_boost(self, required=False): else: return bool(self.options.with_boost) - def _with_thrift(self, required=False): - # No self.options.with_thift exists - return bool(required or self._parquet()) + def _with_thrift(self): + if self.options.with_thrift == "auto": + return bool(self._parquet()) + else: + return bool(self.options.with_thrift) - def _with_utf8proc(self, required=False): - if required or self.options.with_utf8proc == "auto": + def _with_utf8proc(self): + if self.options.with_utf8proc == "auto": return bool(self._compute() or self.options.gandiva) else: return bool(self.options.with_utf8proc) - def _with_llvm(self, required=False): - if required or self.options.with_llvm == "auto": + def _with_llvm(self): + if self.options.with_llvm == "auto": return bool(self.options.gandiva) else: return bool(self.options.with_llvm) - def _with_openssl(self, required=False): - if required or self.options.with_openssl == "auto": + def _with_openssl(self): + if self.options.with_openssl == "auto": return bool(self.options.encryption or self._with_flight_rpc() or self.options.with_s3) else: return bool(self.options.with_openssl) - def _with_rapidjson(self): + def _requires_rapidjson(self): if self.options.with_json: return True if Version(self.version) >= "7.0.0" and self.options.encryption: @@ -271,40 +292,40 @@ def _with_rapidjson(self): return False def requirements(self): - if self._with_thrift(): + if self.options.with_thrift: self.requires("thrift/0.17.0") - if self._with_protobuf(): + if self.options.with_protobuf: self.requires("protobuf/3.21.9") - if self._with_jemalloc(): + if self.options.with_jemalloc: self.requires("jemalloc/5.3.0") if self.options.with_mimalloc: self.requires("mimalloc/1.7.6") - if self._with_boost(): - self.requires("boost/1.81.0") - if self._with_gflags(): + if self.options.with_boost: + self.requires("boost/1.83.0") + if self.options.with_gflags: self.requires("gflags/2.2.2") - if self._with_glog(): + if self.options.with_glog: self.requires("glog/0.6.0") if self.options.get_safe("with_gcs"): self.requires("google-cloud-cpp/1.40.1") - if self._with_grpc(): + if self.options.with_grpc: self.requires("grpc/1.50.0") - if self._with_rapidjson(): + if self._requires_rapidjson(): self.requires("rapidjson/1.1.0") - if self._with_llvm(): + if self.options.with_llvm: self.requires("llvm-core/13.0.0") - if self._with_openssl(): + if self.options.with_openssl: # aws-sdk-cpp requires openssl/1.1.1. it uses deprecated functions in openssl/3.0.0 if self.options.with_s3: - self.requires("openssl/1.1.1t") + self.requires("openssl/1.1.1w") else: - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") if self.options.get_safe("with_opentelemetry"): self.requires("opentelemetry-cpp/1.7.0") if self.options.with_s3: self.requires("aws-sdk-cpp/1.9.234") if self.options.with_brotli: - self.requires("brotli/1.0.9") + self.requires("brotli/1.1.0") if self.options.with_bz2: self.requires("bzip2/1.0.8") if self.options.with_lz4: @@ -316,27 +337,23 @@ def requirements(self): self.options.get_safe("runtime_simd_level") != None: self.requires("xsimd/9.0.1") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: - self.requires("zstd/1.5.2") - if self._with_re2(): - self.requires("re2/20220601") - if self._with_utf8proc(): + self.requires("zstd/1.5.5") + if self.options.with_re2: + self.requires("re2/20230301") + if self.options.with_utf8proc: self.requires("utf8proc/2.8.0") if self.options.with_backtrace: self.requires("libbacktrace/cci.20210118") - def package_id(self): - self.info.options.with_gflags = self._with_gflags() - self.info.options.with_protobuf = self._with_protobuf() - self.info.options.with_re2 = self._with_re2() - self.info.options.with_jemalloc = self._with_jemalloc() - self.info.options.with_openssl = self._with_openssl() - self.info.options.with_boost = self._with_boost() - self.info.options.with_glog = self._with_glog() - self.info.options.with_grpc = self._with_grpc() - def validate(self): + # validate options with 'auto' as default value + auto_options = ["parquet", "compute", "dataset_modules", "with_boost", "with_flight_rpc", "with_gflags", "with_glog", + "with_grpc", "with_jemalloc", "with_thrift", "with_llvm", "with_openssl", "with_protobuf", "with_re2", "with_utf8proc"] + for option in auto_options: + assert "auto" not in str(self.options.get_safe(option)), f"Option '{option}' contains 'auto' value, wich is not allowed. Generally the final value should be True/False" + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) @@ -346,32 +363,8 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if self.options.compute == False and not self._compute(True): - raise ConanInvalidConfiguration("compute options is required (or choose auto)") - if self.options.parquet == False and self._parquet(True): - raise ConanInvalidConfiguration("parquet options is required (or choose auto)") - if self.options.dataset_modules == False and self._dataset_modules(True): - raise ConanInvalidConfiguration("dataset_modules options is required (or choose auto)") if self.options.get_safe("skyhook", False): raise ConanInvalidConfiguration("CCI has no librados recipe (yet)") - if self.options.with_jemalloc == False and self._with_jemalloc(True): - raise ConanInvalidConfiguration("with_jemalloc option is required (or choose auto)") - if self.options.with_re2 == False and self._with_re2(True): - raise ConanInvalidConfiguration("with_re2 option is required (or choose auto)") - if self.options.with_protobuf == False and self._with_protobuf(True): - raise ConanInvalidConfiguration("with_protobuf option is required (or choose auto)") - if self.options.with_gflags == False and self._with_gflags(True): - raise ConanInvalidConfiguration("with_gflags options is required (or choose auto)") - if self.options.with_flight_rpc == False and self._with_flight_rpc(True): - raise ConanInvalidConfiguration("with_flight_rpc options is required (or choose auto)") - if self.options.with_grpc == False and self._with_grpc(True): - raise ConanInvalidConfiguration("with_grpc options is required (or choose auto)") - if self.options.with_boost == False and self._with_boost(True): - raise ConanInvalidConfiguration("with_boost options is required (or choose auto)") - if self.options.with_openssl == False and self._with_openssl(True): - raise ConanInvalidConfiguration("with_openssl options is required (or choose auto)") - if self.options.with_llvm == False and self._with_llvm(True): - raise ConanInvalidConfiguration("with_llvm options is required (or choose auto)") if self.options.with_cuda: raise ConanInvalidConfiguration("CCI has no cuda recipe (yet)") if self.options.with_orc: @@ -379,13 +372,17 @@ def validate(self): if self.options.with_s3 and not self.dependencies["aws-sdk-cpp"].options.config: raise ConanInvalidConfiguration("arrow:with_s3 requires aws-sdk-cpp:config is True.") - if self.options.shared and self._with_jemalloc(): + if self.options.shared and self.options.with_jemalloc: if self.dependencies["jemalloc"].options.enable_cxx: raise ConanInvalidConfiguration("jemmalloc.enable_cxx of a static jemalloc must be disabled") if Version(self.version) < "6.0.0" and self.options.get_safe("simd_level") == "default": raise ConanInvalidConfiguration(f"In {self.ref}, simd_level options is not supported `default` value.") + def build_requirements(self): + if Version(self.version) >= "13.0.0": + self.tool_requires("cmake/[>=3.16 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], filename=f"apache-arrow-{self.version}.tar.gz", strip_root=True) @@ -404,10 +401,10 @@ def generate(self): tc.variables["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" tc.variables["ARROW_PACKAGE_KIND"] = "conan" # See https://github.com/conan-io/conan-center-index/pull/14903/files#r1057938314 for details tc.variables["ARROW_GANDIVA"] = bool(self.options.gandiva) - tc.variables["ARROW_PARQUET"] = self._parquet() + tc.variables["ARROW_PARQUET"] = self.options.parquet tc.variables["ARROW_SUBSTRAIT"] = bool(self.options.get_safe("substrait", False)) tc.variables["ARROW_ACERO"] = bool(self.options.acero) - tc.variables["ARROW_DATASET"] = self._dataset_modules() + tc.variables["ARROW_DATASET"] = self.options.dataset_modules tc.variables["ARROW_FILESYSTEM"] = bool(self.options.filesystem_layer) tc.variables["PARQUET_REQUIRE_ENCRYPTION"] = bool(self.options.encryption) tc.variables["ARROW_HDFS"] = bool(self.options.hdfs_bridgs) @@ -415,12 +412,12 @@ def generate(self): tc.variables["ARROW_BUILD_SHARED"] = bool(self.options.shared) tc.variables["ARROW_BUILD_STATIC"] = not bool(self.options.shared) tc.variables["ARROW_NO_DEPRECATED_API"] = not bool(self.options.deprecated) - tc.variables["ARROW_FLIGHT"] = self._with_flight_rpc() + tc.variables["ARROW_FLIGHT"] = self.options.with_flight_rpc tc.variables["ARROW_FLIGHT_SQL"] = bool(self.options.get_safe("with_flight_sql", False)) - tc.variables["ARROW_COMPUTE"] = self._compute() + tc.variables["ARROW_COMPUTE"] = self.options.compute tc.variables["ARROW_CSV"] = bool(self.options.with_csv) tc.variables["ARROW_CUDA"] = bool(self.options.with_cuda) - tc.variables["ARROW_JEMALLOC"] = self._with_jemalloc() + tc.variables["ARROW_JEMALLOC"] = self.options.with_jemalloc tc.variables["jemalloc_SOURCE"] = "SYSTEM" tc.variables["ARROW_MIMALLOC"] = bool(self.options.with_mimalloc) tc.variables["ARROW_JSON"] = bool(self.options.with_json) @@ -428,13 +425,13 @@ def generate(self): tc.variables["ARROW_GCS"] = bool(self.options.get_safe("with_gcs", False)) tc.variables["BOOST_SOURCE"] = "SYSTEM" tc.variables["Protobuf_SOURCE"] = "SYSTEM" - if self._with_protobuf(): + if self.options.with_protobuf: tc.variables["ARROW_PROTOBUF_USE_SHARED"] = bool(self.dependencies["protobuf"].options.shared) tc.variables["gRPC_SOURCE"] = "SYSTEM" - if self._with_grpc(): + if self.options.with_grpc: tc.variables["ARROW_GRPC_USE_SHARED"] = bool(self.dependencies["grpc"].options.shared) - tc.variables["ARROW_USE_GLOG"] = self._with_glog() + tc.variables["ARROW_USE_GLOG"] = self.options.with_glog tc.variables["GLOG_SOURCE"] = "SYSTEM" tc.variables["ARROW_WITH_BACKTRACE"] = bool(self.options.with_backtrace) tc.variables["ARROW_WITH_BROTLI"] = bool(self.options.with_brotli) @@ -442,7 +439,7 @@ def generate(self): if self.options.with_brotli: tc.variables["ARROW_BROTLI_USE_SHARED"] = bool(self.dependencies["brotli"].options.shared) tc.variables["gflags_SOURCE"] = "SYSTEM" - if self._with_gflags(): + if self.options.with_gflags: tc.variables["ARROW_GFLAGS_USE_SHARED"] = bool(self.dependencies["gflags"].options.shared) tc.variables["ARROW_WITH_BZ2"] = bool(self.options.with_bz2) tc.variables["BZip2_SOURCE"] = "SYSTEM" @@ -471,16 +468,16 @@ def generate(self): if self.options.with_zstd: tc.variables["ARROW_ZSTD_USE_SHARED"] = bool(self.dependencies["zstd"].options.shared) tc.variables["ORC_SOURCE"] = "SYSTEM" - tc.variables["ARROW_WITH_THRIFT"] = self._with_thrift() + tc.variables["ARROW_WITH_THRIFT"] = bool(self.options.with_thrift) tc.variables["Thrift_SOURCE"] = "SYSTEM" - if self._with_thrift(): + if self.options.with_thrift: tc.variables["THRIFT_VERSION"] = bool(self.dependencies["thrift"].ref.version) # a recent thrift does not require boost tc.variables["ARROW_THRIFT_USE_SHARED"] = bool(self.dependencies["thrift"].options.shared) - tc.variables["ARROW_USE_OPENSSL"] = self._with_openssl() - if self._with_openssl(): + tc.variables["ARROW_USE_OPENSSL"] = self.options.with_openssl + if self.options.with_openssl: tc.variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") tc.variables["ARROW_OPENSSL_USE_SHARED"] = bool(self.dependencies["openssl"].options.shared) - if self._with_boost(): + if self.options.with_boost: tc.variables["ARROW_USE_BOOST"] = True tc.variables["ARROW_BOOST_USE_SHARED"] = bool(self.dependencies["boost"].options.shared) tc.variables["ARROW_S3"] = bool(self.options.with_s3) @@ -493,16 +490,18 @@ def generate(self): tc.variables["ARROW_ENABLE_TIMING_TESTS"] = False tc.variables["ARROW_BUILD_BENCHMARKS"] = False tc.variables["LLVM_SOURCE"] = "SYSTEM" - tc.variables["ARROW_WITH_UTF8PROC"] = self._with_utf8proc() - tc.variables["ARROW_BOOST_REQUIRED"] = self._with_boost() + tc.variables["ARROW_WITH_UTF8PROC"] = self.options.with_utf8proc + tc.variables["ARROW_BOOST_REQUIRED"] = self.options.with_boost tc.variables["utf8proc_SOURCE"] = "SYSTEM" - if self._with_utf8proc(): + if self.options.with_utf8proc: tc.variables["ARROW_UTF8PROC_USE_SHARED"] = bool(self.dependencies["utf8proc"].options.shared) tc.variables["BUILD_WARNING_LEVEL"] = "PRODUCTION" if is_msvc(self): tc.variables["ARROW_USE_STATIC_CRT"] = is_msvc_static_runtime(self) - if self._with_llvm(): + if self.options.with_llvm: tc.variables["LLVM_DIR"] = self.dependencies["llvm-core"].package_folder.replace("\\", "/") + + tc.cache_variables["CMAKE_PROJECT_arrow_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") tc.generate() deps = CMakeDeps(self) @@ -559,7 +558,7 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libarrow"].system_libs = ["pthread", "m", "dl", "rt"] - if self._parquet(): + if self.options.parquet: self.cpp_info.components["libparquet"].set_property("pkg_config_name", "parquet") self.cpp_info.components["libparquet"].libs = [f"parquet{suffix}"] self.cpp_info.components["libparquet"].requires = ["libarrow"] @@ -588,7 +587,7 @@ def package_info(self): if not self.options.shared: self.cpp_info.components["libgandiva"].defines = ["GANDIVA_STATIC"] - if self._with_flight_rpc(): + if self.options.with_flight_rpc: self.cpp_info.components["libarrow_flight"].set_property("pkg_config_name", "flight_rpc") self.cpp_info.components["libarrow_flight"].libs = [f"arrow_flight{suffix}"] self.cpp_info.components["libarrow_flight"].requires = ["libarrow"] @@ -598,54 +597,54 @@ def package_info(self): self.cpp_info.components["libarrow_flight_sql"].libs = [f"arrow_flight_sql{suffix}"] self.cpp_info.components["libarrow_flight_sql"].requires = ["libarrow", "libarrow_flight"] - if self._dataset_modules(): + if self.options.dataset_modules: self.cpp_info.components["dataset"].libs = ["arrow_dataset"] - if self._parquet(): + if self.options.parquet: self.cpp_info.components["dataset"].requires = ["libparquet"] - if self.options.cli and (self.options.with_cuda or self._with_flight_rpc() or self._parquet()): + if self.options.cli and (self.options.with_cuda or self.options.with_flight_rpc or self.options.parquet): binpath = os.path.join(self.package_folder, "bin") self.output.info(f"Appending PATH env var: {binpath}") self.env_info.PATH.append(binpath) - if self._with_boost(): + if self.options.with_boost: if self.options.gandiva: # FIXME: only filesystem component is used self.cpp_info.components["libgandiva"].requires.append("boost::boost") - if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): + if self.options.parquet and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): self.cpp_info.components["libparquet"].requires.append("boost::boost") if Version(self.version) >= "2.0": # FIXME: only headers components is used self.cpp_info.components["libarrow"].requires.append("boost::boost") - if self._with_openssl(): + if self.options.with_openssl: self.cpp_info.components["libarrow"].requires.append("openssl::openssl") - if self._with_gflags(): + if self.options.with_gflags: self.cpp_info.components["libarrow"].requires.append("gflags::gflags") - if self._with_glog(): + if self.options.with_glog: self.cpp_info.components["libarrow"].requires.append("glog::glog") - if self._with_jemalloc(): + if self.options.with_jemalloc: self.cpp_info.components["libarrow"].requires.append("jemalloc::jemalloc") if self.options.with_mimalloc: self.cpp_info.components["libarrow"].requires.append("mimalloc::mimalloc") - if self._with_re2(): + if self.options.with_re2: if self.options.gandiva: self.cpp_info.components["libgandiva"].requires.append("re2::re2") - if self._parquet(): + if self.options.parquet: self.cpp_info.components["libparquet"].requires.append("re2::re2") self.cpp_info.components["libarrow"].requires.append("re2::re2") - if self._with_llvm(): + if self.options.with_llvm: self.cpp_info.components["libgandiva"].requires.append("llvm-core::llvm-core") - if self._with_protobuf(): + if self.options.with_protobuf: self.cpp_info.components["libarrow"].requires.append("protobuf::protobuf") - if self._with_utf8proc(): + if self.options.with_utf8proc: self.cpp_info.components["libarrow"].requires.append("utf8proc::utf8proc") - if self._with_thrift(): + if self.options.with_thrift: self.cpp_info.components["libarrow"].requires.append("thrift::thrift") if self.options.with_backtrace: self.cpp_info.components["libarrow"].requires.append("libbacktrace::libbacktrace") if self.options.with_cuda: self.cpp_info.components["libarrow"].requires.append("cuda::cuda") - if self._with_rapidjson(): + if self._requires_rapidjson(): self.cpp_info.components["libarrow"].requires.append("rapidjson::rapidjson") if self.options.with_s3: self.cpp_info.components["libarrow"].requires.append("aws-sdk-cpp::s3") @@ -669,11 +668,11 @@ def package_info(self): self.cpp_info.components["libarrow"].requires.append("zlib::zlib") if self.options.with_zstd: self.cpp_info.components["libarrow"].requires.append("zstd::zstd") - if self._with_boost(): + if self.options.with_boost: self.cpp_info.components["libarrow"].requires.append("boost::boost") - if self._with_grpc(): + if self.options.with_grpc: self.cpp_info.components["libarrow"].requires.append("grpc::grpc") - if self._with_flight_rpc(): + if self.options.with_flight_rpc: self.cpp_info.components["libarrow_flight"].requires.append("protobuf::protobuf") # TODO: to remove in conan v2 @@ -681,7 +680,7 @@ def package_info(self): self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow" self.cpp_info.components["libarrow"].names["cmake_find_package"] = "arrow" self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = "arrow" - if self._parquet(): + if self.options.parquet: self.cpp_info.components["libparquet"].names["cmake_find_package"] = "parquet" self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = "parquet" if self.options.get_safe("substrait"): @@ -690,11 +689,11 @@ def package_info(self): if self.options.gandiva: self.cpp_info.components["libgandiva"].names["cmake_find_package"] = "gandiva" self.cpp_info.components["libgandiva"].names["cmake_find_package_multi"] = "gandiva" - if self._with_flight_rpc(): + if self.options.with_flight_rpc: self.cpp_info.components["libarrow_flight"].names["cmake_find_package"] = "flight_rpc" self.cpp_info.components["libarrow_flight"].names["cmake_find_package_multi"] = "flight_rpc" if self.options.get_safe("with_flight_sql"): self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package"] = "flight_sql" self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package_multi"] = "flight_sql" - if self.options.cli and (self.options.with_cuda or self._with_flight_rpc() or self._parquet()): + if self.options.cli and (self.options.with_cuda or self.options.with_flight_rpc or self.options.parquet): self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/arrow/config.yml b/recipes/arrow/config.yml index 06c575d489c3c2..b4c3d901fea57d 100644 --- a/recipes/arrow/config.yml +++ b/recipes/arrow/config.yml @@ -1,4 +1,12 @@ versions: + "14.0.1": + folder: all + "14.0.0": + folder: all + "13.0.0": + folder: all + "12.0.1": + folder: all "12.0.0": folder: all "11.0.0": diff --git a/recipes/arsenalgear/all/conanfile.py b/recipes/arsenalgear/all/conanfile.py index 94953657bcd46c..3c60d7e171cb39 100644 --- a/recipes/arsenalgear/all/conanfile.py +++ b/recipes/arsenalgear/all/conanfile.py @@ -57,7 +57,7 @@ def layout(self): def requirements(self): if Version(self.version) < "2.0.0": - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") if self.settings.os in ["Linux", "Macos"]: # exprtk is used in public header of arsenalgear # https://github.com/JustWhit3/arsenalgear-cpp/blob/v1.2.2/include/math.hpp diff --git a/recipes/asio-grpc/all/conandata.yml b/recipes/asio-grpc/all/conandata.yml index 67c8b715cb2d32..a64863b4c9e250 100644 --- a/recipes/asio-grpc/all/conandata.yml +++ b/recipes/asio-grpc/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.7.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.7.0.tar.gz" + sha256: "a4a3deeabbdef37a8e7238e25b6f26b63071151c4b49e1f2f86c528da54eed79" + "2.6.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.6.0.tar.gz" + sha256: "9f17f1dfe390667c71d8e0645937afa36f1a0e146f60f6036c7b4e12b09ed14e" + "2.5.1": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.5.1.tar.gz" + sha256: "571779a25be6eed77a345088e3ded2cccf880c16800ee0075ece57116f14fc35" "2.4.0": url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.4.0.tar.gz" sha256: "d71de4f8de91dc0ad44d6a161fc628496b80622a6f9030dcd4c53b516629b8b7" diff --git a/recipes/asio-grpc/all/conanfile.py b/recipes/asio-grpc/all/conanfile.py index 41ebfbae5f918b..fff2d0aaef3d84 100644 --- a/recipes/asio-grpc/all/conanfile.py +++ b/recipes/asio-grpc/all/conanfile.py @@ -38,6 +38,7 @@ def _compilers_minimum_version(self): return { "gcc": "7", "Visual Studio": "15.7", + "msvc": "191", "clang": "6", "apple-clang": "11", } @@ -57,9 +58,9 @@ def configure(self): def requirements(self): self.requires("grpc/1.50.1") if self._local_allocator_option == "boost_container" or self.options.backend == "boost": - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") if self.options.backend == "asio": - self.requires("asio/1.24.0") + self.requires("asio/1.28.2") if self.options.backend == "unifex": self.requires("libunifex/cci.20220430") @@ -84,6 +85,9 @@ def validate(self): f"{self.name} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports" f" C++{self._min_cppstd}." ) + if Version(self.version) == "2.7.0" and \ + self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "11": + raise ConanInvalidConfiguration(f"{self.ref} does not support gcc 11.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/asio-grpc/config.yml b/recipes/asio-grpc/config.yml index 25e51279385fd9..552070583e67ee 100644 --- a/recipes/asio-grpc/config.yml +++ b/recipes/asio-grpc/config.yml @@ -1,4 +1,10 @@ versions: + "2.7.0": + folder: all + "2.6.0": + folder: all + "2.5.1": + folder: all "2.4.0": folder: all "2.3.0": diff --git a/recipes/asio/all/conandata.yml b/recipes/asio/all/conandata.yml index 46bc4f8f41b43e..9f0189b8cd3f0c 100644 --- a/recipes/asio/all/conandata.yml +++ b/recipes/asio/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.28.2": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-28-2.tar.gz" + sha256: "5705a0e403017eba276625107160498518838064a6dd7fd8b00b2e30c0ffbdee" + "1.28.1": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-28-1.tar.gz" + sha256: "5ff6111ec8cbe73a168d997c547f562713aa7bd004c5c02326f0e9d579a5f2ce" "1.28.0": url: "https://github.com/chriskohlhoff/asio/archive/asio-1-28-0.tar.gz" sha256: "226438b0798099ad2a202563a83571ce06dd13b570d8fded4840dbc1f97fa328" diff --git a/recipes/asio/config.yml b/recipes/asio/config.yml index 06fbadd587b1ab..7bf4410d24d456 100644 --- a/recipes/asio/config.yml +++ b/recipes/asio/config.yml @@ -1,4 +1,8 @@ versions: + "1.28.2": + folder: all + "1.28.1": + folder: all "1.28.0": folder: all "1.27.0": diff --git a/recipes/asn1c/all/conanfile.py b/recipes/asn1c/all/conanfile.py index 83429575a7f315..c7d26af9b8d798 100644 --- a/recipes/asn1c/all/conanfile.py +++ b/recipes/asn1c/all/conanfile.py @@ -1,82 +1,101 @@ -from conans import AutoToolsBuildEnvironment, tools +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, rmdir, chdir -import os +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rmdir, chdir +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.47.0" +required_conan_version = ">=1.53.0" class Asn1cConan(ConanFile): name = "asn1c" description = "The ASN.1 Compiler" license = "BSD-2-Clause" - topics = ("asn.1", "compiler") - homepage = "https://lionet.info/asn1c" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://lionet.info/asn1c" + topics = ("asn.1", "compiler") + package_type = "application" settings = "os", "arch", "compiler", "build_type" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _datarootdir(self): - return os.path.join(self.package_folder, "res") + def _settings_build(self): + return getattr(self, "settings_build", self.settings) 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 build_requirements(self): - self.tool_requires("bison/3.7.6") - self.tool_requires("flex/2.6.4") + 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") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + self.tool_requires("winflexbison/2.5.24") + else: + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") self.tool_requires("libtool/2.4.7") def validate(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("Visual Studio is not supported") - def package_id(self): - del self.info.settings.compiler - 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 - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - conf_args = [ - "--datarootdir={}".format(tools.unix_path(self._datarootdir)), - ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + 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) + tc.configure_args += ["--datarootdir=${prefix}/res"] + tc.generate() def build(self): - with chdir(self, self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) - autotools = self._configure_autotools() - autotools.make() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() - autotools.install() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() rmdir(self, os.path.join(self.package_folder, "res", "doc")) rmdir(self, os.path.join(self.package_folder, "res", "man")) def package_info(self): - 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) + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = ["res"] # asn1c cannot use environment variables to specify support files path # so `SUPPORT_PATH` should be propagated to command line invocation to `-S` argument - self.env_info.SUPPORT_PATH = os.path.join(self.package_folder, "res/asn1c") + support_path = os.path.join(self.package_folder, "res", "asn1c") + self.buildenv_info.define_path("SUPPORT_PATH", support_path) - self.cpp_info.includedirs = [] + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) + self.env_info.SUPPORT_PATH = support_path diff --git a/recipes/asn1c/all/test_package/CMakeLists.txt b/recipes/asn1c/all/test_package/CMakeLists.txt index 72f86ddd2bed50..e24e73ab351bc4 100644 --- a/recipes/asn1c/all/test_package/CMakeLists.txt +++ b/recipes/asn1c/all/test_package/CMakeLists.txt @@ -1,8 +1,9 @@ -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) +if (NOT DEFINED ENV{SUPPORT_PATH}) + message(FATAL_ERROR "SUPPORT_PATH environment variable not defined") +endif() set(STANDARD_ASN1_FILES BIT_STRING.c @@ -39,7 +40,7 @@ set(GENERATED_FILES add_custom_command( OUTPUT ${GENERATED_FILES} ${STANDARD_ASN1_FILES} - COMMAND asn1c -S ${SUPPORT_PATH} MyModule.asn1 + COMMAND asn1c -S "$ENV{SUPPORT_PATH}" MyModule.asn1 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS MyModule.asn1 ) diff --git a/recipes/asn1c/all/test_package/conanfile.py b/recipes/asn1c/all/test_package/conanfile.py index 534923606ca415..ed96bb307a88d6 100644 --- a/recipes/asn1c/all/test_package/conanfile.py +++ b/recipes/asn1c/all/test_package/conanfile.py @@ -1,27 +1,30 @@ -from conans import CMake +import os + from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import cmake_layout, CMake from conan.tools.files import copy -from conan.tools.build import cross_building -import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" def build_requirements(self): - self.tool_requires(str(self.requires["asn1c"])) + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): if not cross_building(self): copy(self, "MyModule.asn1", src=self.source_folder, dst=self.build_folder) cmake = CMake(self) - cmake.definitions["SUPPORT_PATH"] = self.deps_env_info["asn1c"].SUPPORT_PATH 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) + 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/assimp/5.x/conanfile.py b/recipes/assimp/5.x/conanfile.py index 6f021e008adb44..375b192d925232 100644 --- a/recipes/assimp/5.x/conanfile.py +++ b/recipes/assimp/5.x/conanfile.py @@ -179,9 +179,9 @@ def requirements(self): if self._depends_on_rapidjson: self.requires("rapidjson/cci.20220822") if self._depends_on_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self._depends_on_draco: - self.requires("draco/1.5.5") + self.requires("draco/1.5.6") if self._depends_on_clipper: self.requires("clipper/4.10.0") # Only 4.x supported if self._depends_on_stb: diff --git a/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch b/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch index 1445d96a11b7ce..2797e985418437 100644 --- a/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch +++ b/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -437,7 +437,12 @@ IF(HUNTER_ENABLED) +@@ -437,10 +437,14 @@ IF(HUNTER_ENABLED) set(ASSIMP_BUILD_MINIZIP TRUE) ELSE(HUNTER_ENABLED) IF ( NOT ASSIMP_BUILD_ZLIB ) @@ -10,11 +10,25 @@ + ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) + find_package(ZLIB REQUIRED) + endif() -+ set(ZLIB_FOUND TRUE) ENDIF( NOT ASSIMP_BUILD_ZLIB ) - IF( NOT ZLIB_FOUND ) -@@ -470,14 +475,14 @@ ENDIF(HUNTER_ENABLED) +- IF( NOT ZLIB_FOUND ) ++ IF(0) + MESSAGE(STATUS "compiling zlib from sources") + INCLUDE(CheckIncludeFile) + INCLUDE(CheckTypeSize) +@@ -461,23 +465,23 @@ ELSE(HUNTER_ENABLED) + SET(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib) + # need to ensure we don't link with system zlib or minizip as well. + SET(ASSIMP_BUILD_MINIZIP 1) +- ELSE(NOT ZLIB_FOUND) ++ ELSE() + ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB) + SET(ZLIB_LIBRARIES_LINKED -lz) +- ENDIF(NOT ZLIB_FOUND) ++ ENDIF() + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) + ENDIF(HUNTER_ENABLED) IF( NOT IOS ) IF( NOT ASSIMP_BUILD_MINIZIP ) diff --git a/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch b/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch index fdd67862ddb24b..27151094d0e71c 100644 --- a/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch +++ b/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch @@ -1,6 +1,13 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -465,7 +465,12 @@ ELSE() +@@ -459,16 +459,20 @@ IF(ASSIMP_HUNTER_ENABLED) + set(ASSIMP_BUILD_MINIZIP TRUE) + ELSE() + # If the zlib is already found outside, add an export in case assimpTargets can't find it. +- IF( ZLIB_FOUND ) ++ IF(0) + INSTALL( TARGETS zlib zlibstatic + EXPORT "${TARGETS_EXPORT_NAME}") ENDIF() IF ( NOT ASSIMP_BUILD_ZLIB ) @@ -10,11 +17,14 @@ + ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) + find_package(ZLIB REQUIRED) + endif() -+ set(ZLIB_FOUND TRUE) ENDIF() - IF( NOT ZLIB_FOUND ) -@@ -498,12 +503,14 @@ ENDIF() +- IF( NOT ZLIB_FOUND ) ++ IF(0) + MESSAGE(STATUS "compiling zlib from sources") + INCLUDE(CheckIncludeFile) + INCLUDE(CheckTypeSize) +@@ -498,12 +502,14 @@ ENDIF() IF( NOT IOS ) IF( NOT ASSIMP_BUILD_MINIZIP ) diff --git a/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch b/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch index 67d2f67fd3661e..dedc3847ab7ea0 100644 --- a/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch +++ b/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch @@ -1,6 +1,13 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -466,7 +466,12 @@ ELSE() +@@ -460,16 +460,20 @@ IF(ASSIMP_HUNTER_ENABLED) + set(ASSIMP_BUILD_MINIZIP TRUE) + ELSE() + # If the zlib is already found outside, add an export in case assimpTargets can't find it. +- IF( ZLIB_FOUND ) ++ IF(0) + INSTALL( TARGETS zlib zlibstatic + EXPORT "${TARGETS_EXPORT_NAME}") ENDIF() IF ( NOT ASSIMP_BUILD_ZLIB ) @@ -10,11 +17,14 @@ + ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) + find_package(ZLIB REQUIRED) + endif() -+ set(ZLIB_FOUND TRUE) ENDIF() - IF( NOT ZLIB_FOUND ) -@@ -499,12 +504,14 @@ ENDIF() +- IF( NOT ZLIB_FOUND ) ++ IF(0) + MESSAGE(STATUS "compiling zlib from sources") + INCLUDE(CheckIncludeFile) + INCLUDE(CheckTypeSize) +@@ -499,12 +503,14 @@ ENDIF() IF( NOT IOS ) IF( NOT ASSIMP_BUILD_MINIZIP ) diff --git a/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch b/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch index 2a1e7bc39e6208..9642d329d9a0a5 100644 --- a/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch +++ b/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch @@ -1,6 +1,13 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -488,7 +488,12 @@ ELSE() +@@ -482,16 +482,20 @@ IF(ASSIMP_HUNTER_ENABLED) + set(ASSIMP_BUILD_MINIZIP TRUE) + ELSE() + # If the zlib is already found outside, add an export in case assimpTargets can't find it. +- IF( ZLIB_FOUND ) ++ IF(0) + INSTALL( TARGETS zlib zlibstatic + EXPORT "${TARGETS_EXPORT_NAME}") ENDIF() IF ( NOT ASSIMP_BUILD_ZLIB ) @@ -10,11 +17,14 @@ + ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) + find_package(ZLIB REQUIRED) + endif() -+ set(ZLIB_FOUND TRUE) ENDIF() - IF( NOT ZLIB_FOUND ) -@@ -521,12 +526,14 @@ ENDIF() +- IF( NOT ZLIB_FOUND ) ++ IF(0) + MESSAGE(STATUS "compiling zlib from sources") + INCLUDE(CheckIncludeFile) + INCLUDE(CheckTypeSize) +@@ -521,12 +525,14 @@ ENDIF() IF( NOT IOS ) IF( NOT ASSIMP_BUILD_MINIZIP ) diff --git a/recipes/astro-informatics-so3/all/CMakeLists.txt b/recipes/astro-informatics-so3/all/CMakeLists.txt deleted file mode 100644 index 0496b298385496..00000000000000 --- a/recipes/astro-informatics-so3/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/astro-informatics-so3/all/conanfile.py b/recipes/astro-informatics-so3/all/conanfile.py index 24be830f3db99a..e7486ed5b8c5a4 100644 --- a/recipes/astro-informatics-so3/all/conanfile.py +++ b/recipes/astro-informatics-so3/all/conanfile.py @@ -1,69 +1,78 @@ -from conans import CMake, 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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class AstroInformaticsSO3(ConanFile): name = "astro-informatics-so3" + description = "Fast and accurate Wigner transforms" license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/astro-informatics/so3" - description = "Fast and accurate Wigner transforms" - settings = "os", "arch", "compiler", "build_type" topics = ("physics", "astrophysics", "radio interferometry") - options = {"fPIC": [True, False]} - default_options = {"fPIC": True} - - generators = "cmake", "cmake_find_package" - exports_sources = ["CMakeLists.txt"] - - @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 config_options(self): if self.settings.os == "Windows": del self.options.fPIC 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): + cmake_layout(self, src_folder="src") def requirements(self): + self.requires("ssht/1.4.0", transitive_headers=True) self.requires("fftw/3.3.9") - self.requires("ssht/1.3.7") def validate(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration( "Visual Studio not supported, since SO3 requires C99 support for complex numbers" ) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @property - def cmake(self): - if not hasattr(self, "_cmake"): - self._cmake = CMake(self) - self._cmake.definitions["conan_deps"] = False - self._cmake.definitions["BUILD_TESTING"] = False - 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["conan_deps"] = False + tc.variables["CONAN_EXPORTED"] = True + tc.variables["BUILD_TESTING"] = False + tc.generate() + deps = CMakeDeps(self) + deps.set_property("fftw", "cmake_target_name", "FFTW3::FFTW3") + deps.generate() def build(self): - self.cmake.build() + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.cmake.install() + 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 = ["astro-informatics-so3"] diff --git a/recipes/astro-informatics-so3/all/test_package/CMakeLists.txt b/recipes/astro-informatics-so3/all/test_package/CMakeLists.txt index aecca63b59f686..6e7e3d57dba81f 100644 --- a/recipes/astro-informatics-so3/all/test_package/CMakeLists.txt +++ b/recipes/astro-informatics-so3/all/test_package/CMakeLists.txt @@ -1,10 +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(astro-informatics-so3 REQUIRED NO_MODULE) +find_package(astro-informatics-so3 REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.c) target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) diff --git a/recipes/astro-informatics-so3/all/test_package/conanfile.py b/recipes/astro-informatics-so3/all/test_package/conanfile.py index abcaeed3f89b67..ef5d7042163ecc 100644 --- a/recipes/astro-informatics-so3/all/test_package/conanfile.py +++ b/recipes/astro-informatics-so3/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", "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,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/astro-informatics-so3/all/test_v1_package/CMakeLists.txt b/recipes/astro-informatics-so3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/astro-informatics-so3/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/astro-informatics-so3/all/test_v1_package/conanfile.py b/recipes/astro-informatics-so3/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..abcaeed3f89b67 --- /dev/null +++ b/recipes/astro-informatics-so3/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/asyncly/all/conanfile.py b/recipes/asyncly/all/conanfile.py index 1f48e267d577a4..35a484db0a6f6c 100644 --- a/recipes/asyncly/all/conanfile.py +++ b/recipes/asyncly/all/conanfile.py @@ -52,8 +52,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0", transitive_headers=True) - self.requires("function2/4.2.2", transitive_headers=True) + self.requires("boost/1.83.0", 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/at-spi2-core/config.yml b/recipes/at-spi2-core/config.yml index 3a9a2fb50465f4..f0d6f514974e47 100644 --- a/recipes/at-spi2-core/config.yml +++ b/recipes/at-spi2-core/config.yml @@ -21,3 +21,5 @@ versions: folder: new "2.49.1": folder: new + "2.50.0": + folder: new diff --git a/recipes/at-spi2-core/new/conandata.yml b/recipes/at-spi2-core/new/conandata.yml index 14543d255e3d0d..b27bb3ef5a258f 100644 --- a/recipes/at-spi2-core/new/conandata.yml +++ b/recipes/at-spi2-core/new/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.50.0": + sha256: e9f5a8c8235c9dd963b2171de9120301129c677dde933955e1df618b949c4adc + url: https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.50/at-spi2-core-2.50.0.tar.xz "2.49.1": sha256: 53ed9eb77e4c48b3bf6ac4afb5689391e0d7d0f44f7ca4443d8b13c7dd26119c url: https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.49/at-spi2-core-2.49.1.tar.xz diff --git a/recipes/at-spi2-core/new/conanfile.py b/recipes/at-spi2-core/new/conanfile.py index 85d759b7547fc0..02a871957ee4fb 100644 --- a/recipes/at-spi2-core/new/conanfile.py +++ b/recipes/at-spi2-core/new/conanfile.py @@ -1,7 +1,8 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, 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 @@ -9,7 +10,8 @@ import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" + class AtSpi2CoreConan(ConanFile): name = "at-spi2-core" description = "It provides a Service Provider Interface for the Assistive Technologies available on the GNOME platform and a library against which applications can be linked" @@ -20,47 +22,56 @@ class AtSpi2CoreConan(ConanFile): provides = "at-spi2-atk", "atk" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "with_x11": [True, False], - } + } default_options = { "shared": False, "fPIC": True, "with_x11": False, - } + } 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") self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") - if self.options.shared: - self.options["glib"].shared = True def build_requirements(self): - self.tool_requires("meson/1.1.1") + self.tool_requires("meson/1.2.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") + self.tool_requires("glib/") def requirements(self): - self.requires("glib/2.76.3") + self.requires("glib/2.78.0") if self.options.with_x11: self.requires("xorg/system") - self.requires("dbus/1.15.6") + if self.settings.os == "Linux": + self.requires("dbus/1.15.8") def validate(self): - if self.options.shared and not self.options["glib"].shared: + if self.options.shared and not self.dependencies["glib"].options.shared: raise ConanInvalidConfiguration( "Linking a shared library against static glib can cause unexpected behaviour." ) - if self.settings.os != "Linux": - raise ConanInvalidConfiguration("only linux is supported by this recipe") + if Version(self.version) < "2.49.1": + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported before version 2.49.1") + if Version(self.version) < "2.50.0": + if self.settings.os == "Macos": + raise ConanInvalidConfiguration("macos is not supported before version 2.50.0") def layout(self): basic_layout(self, src_folder="src") @@ -79,6 +90,9 @@ def generate(self): else: tc.project_options["introspection"] = "no" tc.project_options["x11"] = "yes" if self.options.with_x11 else "no" + if self.settings.os != "Linux": + tc.project_options["atk_only"] = "true" + tc.project_options["docs"] = "false" tc.generate() tc = PkgConfigDeps(self) @@ -106,23 +120,42 @@ def package(self): meson.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "etc")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) def package_info(self): - self.cpp_info.components["atspi"].libs = ['atspi'] - self.cpp_info.components["atspi"].includedirs = ["include/at-spi-2.0"] - self.cpp_info.components["atspi"].requires = ["dbus::dbus", "glib::glib"] - self.cpp_info.components["atspi"].set_property("pkg_config_name", "atspi-2") + if self.settings.os == "Linux": + self.cpp_info.components["atspi"].libs = ['atspi'] + self.cpp_info.components["atspi"].includedirs = ["include/at-spi-2.0"] + self.cpp_info.components["atspi"].requires = ["dbus::dbus", "glib::glib"] + self.cpp_info.components["atspi"].set_property("pkg_config_name", "atspi-2") self.cpp_info.components["atk"].libs = ["atk-1.0"] self.cpp_info.components["atk"].includedirs = ['include/atk-1.0'] self.cpp_info.components["atk"].requires = ["glib::glib"] self.cpp_info.components["atk"].set_property("pkg_config_name", 'atk') - self.cpp_info.components["atk-bridge"].libs = ['atk-bridge-2.0'] - self.cpp_info.components["atk-bridge"].includedirs = [os.path.join('include', 'at-spi2-atk', '2.0')] - self.cpp_info.components["atk-bridge"].requires = ["dbus::dbus", "atk", "glib::glib", "atspi"] - self.cpp_info.components["atk-bridge"].set_property("pkg_config_name", 'atk-bridge-2.0') - - def package_id(self): - self.info.requires["glib"].full_package_mode() + if self.settings.os == "Linux": + self.cpp_info.components["atk-bridge"].libs = ['atk-bridge-2.0'] + self.cpp_info.components["atk-bridge"].includedirs = [os.path.join('include', 'at-spi2-atk', '2.0')] + self.cpp_info.components["atk-bridge"].requires = ["dbus::dbus", "atk", "glib::glib", "atspi"] + self.cpp_info.components["atk-bridge"].set_property("pkg_config_name", 'atk-bridge-2.0') + + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + if not conanfile.settings.get_safe("compiler.runtime"): + return + from conan.tools.files import rename + import glob + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/at-spi2-core/new/test_package/CMakeLists.txt b/recipes/at-spi2-core/new/test_package/CMakeLists.txt deleted file mode 100644 index afa24763570742..00000000000000 --- a/recipes/at-spi2-core/new/test_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/at-spi2-core/new/test_package/conanfile.py b/recipes/at-spi2-core/new/test_package/conanfile.py index d4128b04507778..5aab0703e7a4ef 100644 --- a/recipes/at-spi2-core/new/test_package/conanfile.py +++ b/recipes/at-spi2-core/new/test_package/conanfile.py @@ -1,17 +1,32 @@ -from conans import ConanFile, CMake, tools +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", "compiler", "build_type", "arch" - generators = "cmake" + 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.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() + meson = Meson(self) + meson.configure() + meson.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/at-spi2-core/new/test_package/meson.build b/recipes/at-spi2-core/new/test_package/meson.build new file mode 100644 index 00000000000000..896df272078652 --- /dev/null +++ b/recipes/at-spi2-core/new/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('atk') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/at-spi2-core/new/test_package/test_package.c b/recipes/at-spi2-core/new/test_package/test_package.c index c155308c155baf..284086622ab26a 100644 --- a/recipes/at-spi2-core/new/test_package/test_package.c +++ b/recipes/at-spi2-core/new/test_package/test_package.c @@ -1,9 +1,10 @@ -#include "atspi/atspi.h" -#include "assert.h" +#include +#include int main() { - atspi_init (); - assert(atspi_get_desktop_count() > 0); - return atspi_exit(); + printf("ATK version %d.%d.%d\n",atk_get_major_version(), atk_get_minor_version(), atk_get_micro_version()); + printf("binary age %d\n", atk_get_binary_age()); + printf("interface age %d\n", atk_get_interface_age()); + return 0; } diff --git a/recipes/audiofile/all/conandata.yml b/recipes/audiofile/all/conandata.yml index 042cc12d06dd13..288d8a5ec4d8c9 100644 --- a/recipes/audiofile/all/conandata.yml +++ b/recipes/audiofile/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.1": + url: "https://github.com/adamstark/AudioFile/archive/1.1.1.tar.gz" + sha256: "664f9d5fbbf1ff6c603ae054a35224f12e9856a1d8680be567909015ccaac328" "1.1.0": url: "https://github.com/adamstark/AudioFile/archive/1.1.0.tar.gz" sha256: "7546e39ca17ac09c653f46bfecce4a9936fae3784209ad53094915c78792a327" diff --git a/recipes/audiofile/all/conanfile.py b/recipes/audiofile/all/conanfile.py index 0d083108cea086..c9bd8f69c8aa34 100644 --- a/recipes/audiofile/all/conanfile.py +++ b/recipes/audiofile/all/conanfile.py @@ -1,4 +1,5 @@ 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 @@ -11,34 +12,60 @@ class AudiofileConan(ConanFile): name = "audiofile" description = "A simple C++11 library for reading and writing audio files." - topics = ("audiofile", "audio", "file-format", "wav", "aif") license = "MIT" - homepage = "https://github.com/adamstark/AudioFile" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/adamstark/AudioFile" + topics = ("audio", "file-format", "wav", "aif", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + # v1.1.1 uses is_signed_v + return 11 if Version(self.version) < "1.1.1" else 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + def configure(self): if Version(self.version) < "1.1.0": self.license = "GPL-3.0-or-later" + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) - - def layout(self): - basic_layout(self, src_folder="src") + check_min_cppstd(self, self._min_cppstd) + if self._min_cppstd > 11: + 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], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "AudioFile.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "AudioFile.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder) def package_info(self): self.cpp_info.bindirs = [] diff --git a/recipes/audiofile/all/test_package/CMakeLists.txt b/recipes/audiofile/all/test_package/CMakeLists.txt index 6f7178f4a89271..fab8ac8a0b20c3 100644 --- a/recipes/audiofile/all/test_package/CMakeLists.txt +++ b/recipes/audiofile/all/test_package/CMakeLists.txt @@ -5,4 +5,9 @@ find_package(audiofile REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE audiofile::audiofile) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if (audiofile_VERSION VERSION_GREATER_EQUAL "1.1.1") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/audiofile/all/test_package/test_package.cpp b/recipes/audiofile/all/test_package/test_package.cpp index 6943fcec35d572..d95bc64031cdab 100644 --- a/recipes/audiofile/all/test_package/test_package.cpp +++ b/recipes/audiofile/all/test_package/test_package.cpp @@ -1,3 +1,6 @@ +// workaround for a missing include in v1.0.9 and earlier +#include + #include #include diff --git a/recipes/audiofile/all/test_v1_package/CMakeLists.txt b/recipes/audiofile/all/test_v1_package/CMakeLists.txt index 60fb00c9f3f14b..91630d79f4abb3 100644 --- a/recipes/audiofile/all/test_v1_package/CMakeLists.txt +++ b/recipes/audiofile/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(audiofile REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE audiofile::audiofile) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/audiofile/config.yml b/recipes/audiofile/config.yml index 5fc24e2e9c1883..1b65530cbacc9d 100644 --- a/recipes/audiofile/config.yml +++ b/recipes/audiofile/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.1": + folder: all "1.1.0": folder: all "1.0.9": diff --git a/recipes/autoconf/all/conanfile.py b/recipes/autoconf/all/conanfile.py index e8f1925de206c2..6030c1664be5b7 100644 --- a/recipes/autoconf/all/conanfile.py +++ b/recipes/autoconf/all/conanfile.py @@ -108,29 +108,14 @@ def package_info(self): # TODO: These variables can be removed since the scripts now locate the resources # relative to themselves. dataroot_path = os.path.join(self.package_folder, "res", "autoconf") - self.output.info(f"Defining AC_MACRODIR environment variable: {dataroot_path}") self.buildenv_info.define_path("AC_MACRODIR", dataroot_path) - - self.output.info(f"Defining autom4te_perllibdir environment variable: {dataroot_path}") self.buildenv_info.define_path("autom4te_perllibdir", dataroot_path) bin_path = os.path.join(self.package_folder, "bin") - - autoconf_bin = os.path.join(bin_path, "autoconf") - self.output.info(f"Defining AUTOCONF environment variable: {autoconf_bin}") - self.buildenv_info.define_path("AUTOCONF", autoconf_bin) - - autoreconf_bin = os.path.join(bin_path, "autoreconf") - self.output.info(f"Defining AUTORECONF environment variable: {autoreconf_bin}") - self.buildenv_info.define_path("AUTORECONF", autoreconf_bin) - - autoheader_bin = os.path.join(bin_path, "autoheader") - self.output.info(f"Defining AUTOHEADER environment variable: {autoheader_bin}") - self.buildenv_info.define_path("AUTOHEADER", autoheader_bin) - - autom4te_bin = os.path.join(bin_path, "autom4te") - self.output.info(f"Defining AUTOM4TE environment variable: {autom4te_bin}") - self.buildenv_info.define_path("AUTOM4TE", autom4te_bin) + self.buildenv_info.define_path("AUTOCONF", os.path.join(bin_path, "autoconf")) + self.buildenv_info.define_path("AUTORECONF", os.path.join(bin_path, "autoreconf")) + self.buildenv_info.define_path("AUTOHEADER", os.path.join(bin_path, "autoheader")) + self.buildenv_info.define_path("AUTOM4TE", os.path.join(bin_path, "autom4te")) # TODO: to remove in conan v2 self.env_info.PATH.append(bin_path) diff --git a/recipes/autoconf/all/test_package/conanfile.py b/recipes/autoconf/all/test_package/conanfile.py index bb22349ed9696c..540a389d38f89b 100644 --- a/recipes/autoconf/all/test_package/conanfile.py +++ b/recipes/autoconf/all/test_package/conanfile.py @@ -29,6 +29,9 @@ def generate(self): env = VirtualBuildEnv(self) env.generate() tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") tc.generate() if is_msvc(self): env = Environment() diff --git a/recipes/autoconf/all/test_v1_package/conanfile.py b/recipes/autoconf/all/test_v1_package/conanfile.py index 422d5f44c10cf5..7098a4c30759bf 100644 --- a/recipes/autoconf/all/test_v1_package/conanfile.py +++ b/recipes/autoconf/all/test_v1_package/conanfile.py @@ -34,6 +34,8 @@ def build(self): self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), win_bash=tools.os_info.is_windows) autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + if is_msvc(self): + autotools.flags.append("-FS") with self._build_context(): autotools.configure() autotools.make() diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py index 828f628b5ac414..fdd5b5034805a1 100644 --- a/recipes/avahi/all/conanfile.py +++ b/recipes/avahi/all/conanfile.py @@ -1,7 +1,8 @@ import os from conan import ConanFile -from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.build import can_run +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv from conan.tools.files import copy, get, rmdir, rm from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout @@ -19,42 +20,43 @@ class AvahiConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lathiat/avahi" license = "LGPL-2.1-only" - settings = "os", "arch", "compiler", "build_type" + 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 + "fPIC": True, } + 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): - self.requires("glib/2.75.2") + self.requires("glib/2.78.1") self.requires("expat/2.5.0") self.requires("libdaemon/0.14") - self.requires("dbus/1.15.2") - self.requires("gdbm/1.19") + self.requires("dbus/1.15.8") + self.requires("gdbm/1.23") self.requires("libevent/2.1.12") - def build_requirements(self): - self.tool_requires("glib/2.75.2") - if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.3") - def validate(self): - if self.settings.os != "Linux": + if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration(f"{self.ref} only supports Linux.") - 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 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/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -62,6 +64,8 @@ def source(self): def generate(self): virtual_build_env = VirtualBuildEnv(self) virtual_build_env.generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") tc = AutotoolsToolchain(self) tc.configure_args.append("--enable-compat-libdns_sd") tc.configure_args.append("--disable-gtk3") @@ -70,7 +74,8 @@ def generate(self): tc.configure_args.append("--disable-python") tc.configure_args.append("--disable-qt5") tc.configure_args.append("--with-systemdsystemunitdir=/lib/systemd/system") - if self.settings.os == "Linux": + tc.configure_args.append("ac_cv_func_strlcpy=no") + if self.settings.os in ["Linux", "FreeBSD"]: tc.configure_args.append("ac_cv_func_setproctitle=no") tc.generate() AutotoolsDeps(self).generate() @@ -98,11 +103,11 @@ def package(self): def package_info(self): for lib in ("client", "common", "core", "glib", "gobject", "libevent", "compat-libdns_sd"): avahi_lib = f"avahi-{lib}" + self.cpp_info.components[lib].set_property("pkg_config_name", avahi_lib) self.cpp_info.components[lib].names["cmake_find_package"] = lib self.cpp_info.components[lib].names["cmake_find_package_multi"] = lib - self.cpp_info.components[lib].names["pkg_config"] = avahi_lib self.cpp_info.components[lib].libs = [avahi_lib] - self.cpp_info.components[lib].includedirs = [os.path.join("include", avahi_lib)] + self.cpp_info.components[lib].includedirs = ["include", os.path.join("include", avahi_lib)] self.cpp_info.components["compat-libdns_sd"].libs = ["dns_sd"] self.cpp_info.components["client"].requires = ["common", "dbus::dbus"] @@ -115,9 +120,9 @@ def package_info(self): for app in ("autoipd", "browse", "daemon", "dnsconfd", "publish", "resolve", "set-host-name"): avahi_app = f"avahi-{app}" + self.cpp_info.components[app].set_property("pkg_config_name", avahi_app) self.cpp_info.components[app].names["cmake_find_package"] = app self.cpp_info.components[app].names["cmake_find_package_multi"] = app - self.cpp_info.components[app].names["pkg_config"] = avahi_app self.cpp_info.components["autoipd"].requires = ["libdaemon::libdaemon"] self.cpp_info.components["browse"].requires = ["client", "gdbm::gdbm"] @@ -127,6 +132,7 @@ def package_info(self): self.cpp_info.components["resolve"].requires = ["client"] self.cpp_info.components["set-host-name"].requires = ["client"] + # TODO: Remove after dropping Conan 1.x support 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/avahi/all/test_package/CMakeLists.txt b/recipes/avahi/all/test_package/CMakeLists.txt index fce015c3405a96..595c0faefb42e6 100644 --- a/recipes/avahi/all/test_package/CMakeLists.txt +++ b/recipes/avahi/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) find_package(Avahi CONFIG REQUIRED) - + add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE avahi::compat-libdns_sd) +target_link_libraries(${PROJECT_NAME} PRIVATE avahi::compat-libdns_sd avahi::core) diff --git a/recipes/avahi/all/test_package/test_package.c b/recipes/avahi/all/test_package/test_package.c index bae1467c7d687f..0b5b2dd52d5e2a 100644 --- a/recipes/avahi/all/test_package/test_package.c +++ b/recipes/avahi/all/test_package/test_package.c @@ -1,18 +1,20 @@ -#include -#include +#include -int main() -{ +#include "dns_sd.h" +#include "avahi-core/log.h" + + +int main(void) { DNSServiceRef sdRef; DNSServiceErrorType err = DNSServiceBrowse(&sdRef, 0, 0, "_example._tcp", NULL, NULL, NULL); if (err == kDNSServiceErr_NoError) { - printf("DNSServiceBrowse succeeded\n"); + avahi_log_error("DNSServiceBrowse succeeded\n"); DNSServiceRefDeallocate(sdRef); } else { - printf("DNSServiceBrowse failed: %d\n", err); + avahi_log_info("DNSServiceBrowse failed: %d\n", err); } - return 0; + return EXIT_SUCCESS; } diff --git a/recipes/avahi/all/test_v1_package/CMakeLists.txt b/recipes/avahi/all/test_v1_package/CMakeLists.txt index 925ecbe19e448d..91630d79f4abb3 100644 --- a/recipes/avahi/all/test_v1_package/CMakeLists.txt +++ b/recipes/avahi/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) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/aws-c-auth/all/conandata.yml b/recipes/aws-c-auth/all/conandata.yml index 3f6bee7b4b086e..47648a4e54a571 100644 --- a/recipes/aws-c-auth/all/conandata.yml +++ b/recipes/aws-c-auth/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.7": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.7.7.tar.gz" + sha256: "ea3c9e75b59b36aaf9147deec655d1669f197745bbe914cd3b8e234740be29ba" "0.6.17": url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.17.tar.gz" sha256: "b43678ad3a779c9c7fccf8f931c162eaaf4d5d64d2955ac1fcfd32e538545c0f" @@ -14,3 +17,9 @@ sources: "0.6.0": url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.0.tar.gz" sha256: "5f5fff63110c3e8f619385ca563f77886bc101d3e054987eecbb87586e27b651" +patches: + "0.6.17": + - patch_file: "patches/0.6.17-0001-fix-macro-usage.patch" + patch_description: "Fix inconsistent usage of macros" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-auth/pull/181" diff --git a/recipes/aws-c-auth/all/conanfile.py b/recipes/aws-c-auth/all/conanfile.py index 93acb4732d6f3a..0181ea2ac5e2c5 100644 --- a/recipes/aws-c-auth/all/conanfile.py +++ b/recipes/aws-c-auth/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, save +from conan.tools.files import get, copy, rmdir, save, export_conandata_patches, apply_conandata_patches from conan.tools.scm import Version import os @@ -30,6 +30,9 @@ class AwsCAuth(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -44,19 +47,26 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) - self.requires("aws-c-cal/0.5.13") - if Version(self.version) < "0.6.17": - self.requires("aws-c-io/0.10.20", transitive_headers=True) - self.requires("aws-c-http/0.6.13", transitive_headers=True) + if Version(self.version) <= "0.6.17": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.13") + if Version(self.version) < "0.6.17": + self.requires("aws-c-io/0.10.20", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.6.13", transitive_headers=True) + else: + self.requires("aws-c-io/0.13.4", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.6.22", transitive_headers=True) + if Version(self.version) >= "0.6.5": + self.requires("aws-c-sdkutils/0.1.3", transitive_headers=True) else: - self.requires("aws-c-io/0.13.4", transitive_headers=True) - self.requires("aws-c-http/0.6.22", transitive_headers=True) - if Version(self.version) >= "0.6.5": - self.requires("aws-c-sdkutils/0.1.3", 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") + self.requires("aws-c-io/0.13.32", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.7.14", transitive_headers=True) + self.requires("aws-c-sdkutils/0.1.12", transitive_headers=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) @@ -67,6 +77,7 @@ def generate(self): deps.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/aws-c-auth/all/patches/0.6.17-0001-fix-macro-usage.patch b/recipes/aws-c-auth/all/patches/0.6.17-0001-fix-macro-usage.patch new file mode 100644 index 00000000000000..bed12b1bd563bb --- /dev/null +++ b/recipes/aws-c-auth/all/patches/0.6.17-0001-fix-macro-usage.patch @@ -0,0 +1,132 @@ +diff --git a/source/aws_signing.c b/source/aws_signing.c +index 940d7be..ecc1144 100644 +--- a/source/aws_signing.c ++++ b/source/aws_signing.c +@@ -2500,7 +2500,7 @@ int aws_verify_sigv4a_signing( + aws_credentials_release(signing_state->config.credentials); + signing_state->config.credentials = ecc_credentials; + if (signing_state->config.credentials == NULL) { +- AWS_LOGF_ERROR(AWS_LS_AUTH_SIGNING, "Unable to create ECC from provided credentials") ++ AWS_LOGF_ERROR(AWS_LS_AUTH_SIGNING, "Unable to create ECC from provided credentials"); + goto done; + } + } +diff --git a/source/credentials_provider_process.c b/source/credentials_provider_process.c +index 655df86..29f99d0 100644 +--- a/source/credentials_provider_process.c ++++ b/source/credentials_provider_process.c +@@ -187,7 +187,7 @@ static struct aws_string *s_get_command(struct aws_allocator *allocator, struct + if (!command_buf.len) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to resolve credentials_process command during process credentials provider initialization.") ++ "Failed to resolve credentials_process command during process credentials provider initialization."); + goto on_finish; + } + +@@ -202,7 +202,7 @@ static struct aws_string *s_get_command(struct aws_allocator *allocator, struct + + AWS_LOGF_DEBUG( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Successfully loaded credentials_process command for process credentials provider.") ++ "Successfully loaded credentials_process command for process credentials provider."); + + on_finish: + aws_string_destroy(profile_name); +diff --git a/source/credentials_provider_sts_web_identity.c b/source/credentials_provider_sts_web_identity.c +index cb03cb5..c3e4697 100644 +--- a/source/credentials_provider_sts_web_identity.c ++++ b/source/credentials_provider_sts_web_identity.c +@@ -231,7 +231,7 @@ static bool s_parse_retryable_error_from_response(struct aws_allocator *allocato + if (xml_parser == NULL) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to init xml parser for sts web identity credentials provider to parse error information.") ++ "Failed to init xml parser for sts web identity credentials provider to parse error information."); + return false; + } + bool get_retryable_error = false; +@@ -330,14 +330,14 @@ static struct aws_credentials *s_parse_credentials_from_response( + if (xml_parser == NULL) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to init xml parser for sts web identity credentials provider to parse error information.") ++ "Failed to init xml parser for sts web identity credentials provider to parse error information."); + return NULL; + } + uint64_t now = UINT64_MAX; + if (aws_sys_clock_get_ticks(&now) != AWS_OP_SUCCESS) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to get sys clock for sts web identity credentials provider to parse error information.") ++ "Failed to get sys clock for sts web identity credentials provider to parse error information."); + goto on_finish; + } + uint64_t now_seconds = aws_timestamp_convert(now, AWS_TIMESTAMP_NANOS, AWS_TIMESTAMP_SECS, NULL); +@@ -998,7 +998,7 @@ static struct sts_web_identity_parameters *s_parameters_new(struct aws_allocator + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, + "Failed to resolve either region, role arn or token file path during sts web identity provider " +- "initialization.") ++ "initialization."); + goto on_finish; + + } else { +@@ -1021,7 +1021,7 @@ static struct sts_web_identity_parameters *s_parameters_new(struct aws_allocator + aws_byte_buf_init_copy_from_cursor(¶meters->role_arn, allocator, aws_byte_cursor_from_string(role_arn))) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to resolve role arn during sts web identity provider initialization.") ++ "Failed to resolve role arn during sts web identity provider initialization."); + goto on_finish; + } + +@@ -1031,7 +1031,7 @@ static struct sts_web_identity_parameters *s_parameters_new(struct aws_allocator + ¶meters->token_file_path, allocator, aws_byte_cursor_from_string(token_file_path))) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to resolve token file path during sts web identity provider initialization.") ++ "Failed to resolve token file path during sts web identity provider initialization."); + goto on_finish; + } + +@@ -1047,7 +1047,7 @@ static struct sts_web_identity_parameters *s_parameters_new(struct aws_allocator + + AWS_LOGF_DEBUG( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Successfully loaded all required parameters for sts web identity credentials provider.") ++ "Successfully loaded all required parameters for sts web identity credentials provider."); + success = true; + + on_finish: +diff --git a/source/credentials_utils.c b/source/credentials_utils.c +index 061e26b..2cb61d6 100644 +--- a/source/credentials_utils.c ++++ b/source/credentials_utils.c +@@ -98,7 +98,7 @@ static bool s_parse_expiration_value_from_json_object( + + if (expiration_cursor.len == 0) { + AWS_LOGF_INFO( +- AWS_LS_AUTH_CREDENTIALS_PROVIDER, "Parsed a credentials json document with empty expiration.") ++ AWS_LS_AUTH_CREDENTIALS_PROVIDER, "Parsed a credentials json document with empty expiration."); + return false; + } + +@@ -211,7 +211,7 @@ struct aws_credentials *aws_parse_credentials_from_aws_json_object( + if (access_key_id_cursor.len == 0 || secrete_access_key_cursor.len == 0) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Parsed an unexpected credentials json document, either access key, secret key is empty.") ++ "Parsed an unexpected credentials json document, either access key, secret key is empty."); + goto done; + } + +@@ -222,7 +222,7 @@ struct aws_credentials *aws_parse_credentials_from_aws_json_object( + aws_json_value_get_string(token, &session_token_cursor); + if (options->token_required && session_token_cursor.len == 0) { + AWS_LOGF_ERROR( +- AWS_LS_AUTH_CREDENTIALS_PROVIDER, "Parsed an unexpected credentials json document with empty token.") ++ AWS_LS_AUTH_CREDENTIALS_PROVIDER, "Parsed an unexpected credentials json document with empty token."); + goto done; + } + } diff --git a/recipes/aws-c-auth/config.yml b/recipes/aws-c-auth/config.yml index 503ab418198f12..244301baade46b 100644 --- a/recipes/aws-c-auth/config.yml +++ b/recipes/aws-c-auth/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.7": + folder: all "0.6.17": folder: all "0.6.11": diff --git a/recipes/aws-c-cal/all/conandata.yml b/recipes/aws-c-cal/all/conandata.yml index e1b848e4dfa2d2..0bf0d966b7d3a2 100644 --- a/recipes/aws-c-cal/all/conandata.yml +++ b/recipes/aws-c-cal/all/conandata.yml @@ -1,4 +1,10 @@ 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" "0.5.20": url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.20.tar.gz" sha256: "acc352359bd06f8597415c366cf4ec4f00d0b0da92d637039a73323dd55b6cd0" @@ -14,10 +20,17 @@ 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" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" "0.5.20": - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" patch_description: "Link to CoreFoundation on Apple" @@ -44,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 bb8fb82e75aabe..de7ce7d5e222d9 100644 --- a/recipes/aws-c-cal/all/conanfile.py +++ b/recipes/aws-c-cal/all/conanfile.py @@ -48,13 +48,10 @@ 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) - else: + 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) if self._needs_openssl: self.requires("openssl/[>=1.1 <4]") diff --git a/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.1.patch b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.1.patch new file mode 100644 index 00000000000000..616d8257a2980a --- /dev/null +++ b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.1.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,7 +84,12 @@ 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) +--- a/source/darwin/securityframework_ecc.c ++++ b/source/darwin/securityframework_ecc.c +@@ -7,6 +7,7 @@ + #include + #include + ++#include + #include + #include + 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 f969df4acc5839..f62f1684b8f2a5 100644 --- a/recipes/aws-c-cal/config.yml +++ b/recipes/aws-c-cal/config.yml @@ -1,4 +1,8 @@ versions: + "0.6.9": + folder: all + "0.6.1": + folder: all "0.5.20": folder: all "0.5.19": @@ -9,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 773702bbe2c98e..9261747efd7d9b 100644 --- a/recipes/aws-c-common/all/conandata.yml +++ b/recipes/aws-c-common/all/conandata.yml @@ -1,56 +1,33 @@ sources: + "0.9.6": + url: "https://github.com/awslabs/aws-c-common/archive/v0.9.6.tar.gz" + sha256: "5c30cc066a7f05fb8e4728f93aeed0e0e2698197a6df76237ac4e1200977d090" + "0.9.3": + url: "https://github.com/awslabs/aws-c-common/archive/v0.9.3.tar.gz" + sha256: "389eaac7f64d7d5a91ca3decad6810429eb5a65bbba54798b9beffcb4d1d1ed6" + "0.9.0": + url: "https://github.com/awslabs/aws-c-common/archive/v0.9.0.tar.gz" + sha256: "9b62ab1dcece3107810ea4f4511fe8e1e010a83cb0cb502b6ec685ce752a7b0c" + "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" - "0.7.4": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.4.tar.gz" - sha256: "e9462a141b5db30006704f537d19b92357a59be38d590272e6118976b0356ccd" - "0.7.3": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.3.tar.gz" - sha256: "e4b80d368668814d9b76989fd2e3cd0fcf0be160bbb8bfeedf1f652e27f9c08c" - "0.7.2": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.2.tar.gz" - sha256: "455aed7447ed58eb7d5d3e8c952ed59f77c71dfed4115883e900f36d95f06dab" - "0.7.1": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.1.tar.gz" - sha256: "75c444a337e446e82d4f71c127118981656234b25cbdfd5913b8de713354fb43" - "0.7.0": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.0.tar.gz" - sha256: "a4e94d2c1d045a27467c9dfae51382f851a5223c3a0ecc15a96d1dba94f85ad6" "0.6.20": url: "https://github.com/awslabs/aws-c-common/archive/v0.6.20.tar.gz" sha256: "6eb0b806c78b36a32eec9bcba8d2833e3973491a29d46fe3d11edc3f8d3e7f73" - "0.6.19": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.19.tar.gz" - sha256: "91cb2b809687be19fce8d6ca03ddc00c78723854ead30dcb58bdc4172cb1796c" - "0.6.17": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.17.tar.gz" - sha256: "441156ecfabb84e41601d7173a7f88267f099899f0ae6091c3b745d9e02211f6" - "0.6.15": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.15.tar.gz" - sha256: "eb3ead3fb7a1f09c046393f776a96a0f50ae5f38c70d462273084280383669f1" - "0.6.14": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.14.tar.gz" - sha256: "1691c9dad5a0d236c2a0e351cc972231b176947e454c61d1c4b3ea4ab42f32e7" - "0.6.11": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.11.tar.gz" - sha256: "86159bd1128eee2813f705c275d319e14d1b77017fab46f6ca5dafcc66edaea9" - "0.6.9": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.9.tar.gz" - sha256: "928a3e36f24d1ee46f9eec360ec5cebfe8b9b8994fe39d4fa74ff51aebb12717" - "0.6.8": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.8.tar.gz" - sha256: "2997e851ed690a614507a43f4c393f45a198614d94da1660ecdf9b5a729535fc" - "0.6.7": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.7.tar.gz" - sha256: "643b35c62f948367f484f3a436bc37b5799538f47b08aa72deb3818b8bcdc631" "0.4.25": url: "https://github.com/awslabs/aws-c-common/archive/v0.4.25.tar.gz" sha256: "f85a8f74e42bd983a4615654457f8037876bc6b8dbf890e368bb516cbc2e9844" patches: "0.4.25": - patch_file: "patches/0001-disable-fPIC.patch" + patch_description: "Don't enable position independent code (will be handled by conan)" + patch_type: "conan" - patch_file: "patches/0002-no-warnings-as-errors.patch" + patch_description: "Don't make all warnings into errors" + patch_type: "portability" diff --git a/recipes/aws-c-common/config.yml b/recipes/aws-c-common/config.yml index 5a8e794412c2ff..86ea79fbcf2ffe 100644 --- a/recipes/aws-c-common/config.yml +++ b/recipes/aws-c-common/config.yml @@ -1,35 +1,17 @@ versions: - "0.8.2": - folder: all - "0.7.5": + "0.9.6": folder: all - "0.7.4": + "0.9.3": folder: all - "0.7.3": + "0.9.0": folder: all - "0.7.2": + "0.8.23": folder: all - "0.7.1": + "0.8.2": folder: all - "0.7.0": + "0.7.5": folder: all "0.6.20": folder: all - "0.6.19": - folder: all - "0.6.17": - folder: all - "0.6.15": - folder: all - "0.6.14": - folder: all - "0.6.11": - folder: all - "0.6.9": - folder: all - "0.6.8": - folder: all - "0.6.7": - folder: all "0.4.25": folder: all diff --git a/recipes/aws-c-compression/all/conandata.yml b/recipes/aws-c-compression/all/conandata.yml index 1baf0be5b106a8..d936f5ef9af185 100644 --- a/recipes/aws-c-compression/all/conandata.yml +++ b/recipes/aws-c-compression/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.17": + url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.17.tar.gz" + sha256: "703d1671e395ea26f8b0b70d678ed471421685a89e127f8aa125e2b2ecedb0e0" "0.2.15": url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.15.tar.gz" sha256: "11d58a229e2961b2b36493155a981dea2c8a0bc0d113b0073deb8c3189cfa04e" diff --git a/recipes/aws-c-compression/all/conanfile.py b/recipes/aws-c-compression/all/conanfile.py index 828f55f6431895..a6b8eb1260a1b3 100644 --- a/recipes/aws-c-compression/all/conanfile.py +++ b/recipes/aws-c-compression/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, rmdir, save +from conan.tools.scm import Version import os import textwrap @@ -13,7 +14,7 @@ class AwsCCompression(ConanFile): topics = ("aws", "amazon", "cloud", "compression", "huffman", ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-compression" - license = "Apache-2.0", + license = "Apache-2.0" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -39,7 +40,10 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + if Version(self.version) <= "0.2.15": + 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) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/aws-c-compression/config.yml b/recipes/aws-c-compression/config.yml index 5a381bb0e66743..aae181600c27e2 100644 --- a/recipes/aws-c-compression/config.yml +++ b/recipes/aws-c-compression/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.17": + folder: all "0.2.15": folder: all "0.2.14": diff --git a/recipes/aws-c-event-stream/all/conandata.yml b/recipes/aws-c-event-stream/all/conandata.yml index 61428e916296b3..dd1f6736ca7be6 100644 --- a/recipes/aws-c-event-stream/all/conandata.yml +++ b/recipes/aws-c-event-stream/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.3.2": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.3.2.tar.gz" + sha256: "3134b35a45e9f9d974c2b78ee44fd2ea0aebc04df80236b80692aa63bee2092e" + "0.3.1": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.3.1.tar.gz" + sha256: "bdbc420efc2572689fb167ac288e982a01224876eb79d80e2411fad4c43e9dc0" "0.2.15": url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.15.tar.gz" sha256: "4ff2ada07ede3c6afa4b8e6e20de541e717038307f29b38c27efa7c4d875ee26" diff --git a/recipes/aws-c-event-stream/all/conanfile.py b/recipes/aws-c-event-stream/all/conanfile.py index 2d51b3c4c313f0..e7d1df562c48bc 100644 --- a/recipes/aws-c-event-stream/all/conanfile.py +++ b/recipes/aws-c-event-stream/all/conanfile.py @@ -43,13 +43,19 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) - self.requires("aws-checksums/0.1.13") + if Version(self.version) < "0.3.1": + 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.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": self.requires("aws-c-io/0.10.20") - else: + elif Version(self.version) < "0.3.1": self.requires("aws-c-io/0.13.4") + else: + 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-event-stream/config.yml b/recipes/aws-c-event-stream/config.yml index 96ac653286f12a..38b22762f52739 100644 --- a/recipes/aws-c-event-stream/config.yml +++ b/recipes/aws-c-event-stream/config.yml @@ -1,4 +1,8 @@ versions: + "0.3.2": + folder: all + "0.3.1": + folder: all "0.2.15": folder: all "0.2.12": diff --git a/recipes/aws-c-http/all/conandata.yml b/recipes/aws-c-http/all/conandata.yml index 09a36b1a86c130..68fa29d3753e7a 100644 --- a/recipes/aws-c-http/all/conandata.yml +++ b/recipes/aws-c-http/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.14": + url: "https://github.com/awslabs/aws-c-http/archive/v0.7.14.tar.gz" + sha256: "afb935395c93427ac0853d6363900a71816a0508f18c86e84da0e6ebe7271429" "0.6.22": url: "https://github.com/awslabs/aws-c-http/archive/v0.6.22.tar.gz" sha256: "a178fd04bd1618469cd21afc5b84cbe436d1f9d9e036fefbd3a8f00356da4d4c" diff --git a/recipes/aws-c-http/all/conanfile.py b/recipes/aws-c-http/all/conanfile.py index 2d95021a30464c..a9bb3bc67dc422 100644 --- a/recipes/aws-c-http/all/conanfile.py +++ b/recipes/aws-c-http/all/conanfile.py @@ -40,12 +40,19 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) - self.requires("aws-c-compression/0.2.15") - if Version(self.version) < "0.6.22": - self.requires("aws-c-io/0.10.20", transitive_headers=True) + if Version(self.version) <= "0.6.22": + self.requires("aws-c-compression/0.2.15") + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) else: - self.requires("aws-c-io/0.13.4", transitive_headers=True) + self.requires("aws-c-compression/0.2.17") + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + + if Version(self.version) <= "0.6.13": + self.requires("aws-c-io/0.10.20", transitive_headers=True, transitive_libs=True) + elif Version(self.version) <= "0.6.22": + self.requires("aws-c-io/0.13.4", transitive_headers=True, transitive_libs=True) + else: + self.requires("aws-c-io/0.13.32", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/aws-c-http/config.yml b/recipes/aws-c-http/config.yml index ab4b9f0488086a..febd9410cb93fd 100644 --- a/recipes/aws-c-http/config.yml +++ b/recipes/aws-c-http/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.14": + folder: all "0.6.22": folder: all "0.6.13": diff --git a/recipes/aws-c-io/all/conandata.yml b/recipes/aws-c-io/all/conandata.yml index 4a9102a6ede26e..1e15f1d87d7c34 100644 --- a/recipes/aws-c-io/all/conandata.yml +++ b/recipes/aws-c-io/all/conandata.yml @@ -1,4 +1,10 @@ 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" "0.13.4": url: "https://github.com/awslabs/aws-c-io/archive/v0.13.4.tar.gz" sha256: "133bd0aa46caa2041962cd4f6d076209686ce2934af82f86d1a258df4cbdce8b" @@ -11,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 20a04052e80c52..36c3965b9abd8b 100644 --- a/recipes/aws-c-io/all/conanfile.py +++ b/recipes/aws-c-io/all/conanfile.py @@ -42,15 +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") - else: + 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.6", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.9", transitive_headers=True, transitive_libs=True) if self.settings.os in ["Linux", "FreeBSD", "Android"]: - self.requires("s2n/1.3.31") + 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 6dca88e3f05544..8a602cc8c0e604 100644 --- a/recipes/aws-c-io/config.yml +++ b/recipes/aws-c-io/config.yml @@ -1,4 +1,8 @@ versions: + "0.13.35": + folder: all + "0.13.32": + folder: all "0.13.4": folder: all "0.11.2": @@ -7,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-c-mqtt/all/conandata.yml b/recipes/aws-c-mqtt/all/conandata.yml index 6240cf10ee0f57..275052c56df7c9 100644 --- a/recipes/aws-c-mqtt/all/conandata.yml +++ b/recipes/aws-c-mqtt/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.9.10": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.9.10.tar.gz" + sha256: "a8f92cb045e2c1e0b7e87e5c43ca373eb020014b5d3ebd75ed67ffff430d9ab6" + "0.8.12": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.8.12.tar.gz" + sha256: "df02de478ab1806bb57bcb78e5faa21b567716dcb64f8a52ae90a2b84f43cba1" "0.7.12": url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.12.tar.gz" sha256: "cf80f1b4f37aa8a6b8698315fae32cbf2bd944b67784f07b5762f392f18e64df" diff --git a/recipes/aws-c-mqtt/all/conanfile.py b/recipes/aws-c-mqtt/all/conanfile.py index bb0adaf793c0c5..d97246f605d3f8 100644 --- a/recipes/aws-c-mqtt/all/conanfile.py +++ b/recipes/aws-c-mqtt/all/conanfile.py @@ -41,14 +41,16 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) - self.requires("aws-c-cal/0.5.13") - if Version(self.version) < "0.7.12": + if Version(self.version) <= "0.7.12": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.13") self.requires("aws-c-io/0.10.20", transitive_headers=True) self.requires("aws-c-http/0.6.13") else: - self.requires("aws-c-io/0.13.4", transitive_headers=True) - self.requires("aws-c-http/0.6.22") + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.9") + self.requires("aws-c-io/0.13.32", transitive_headers=True) + self.requires("aws-c-http/0.7.14") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/aws-c-mqtt/config.yml b/recipes/aws-c-mqtt/config.yml index edbab7e67d700e..788eeccfb09638 100644 --- a/recipes/aws-c-mqtt/config.yml +++ b/recipes/aws-c-mqtt/config.yml @@ -1,4 +1,8 @@ versions: + "0.9.10": + folder: all + "0.8.12": + folder: all "0.7.12": folder: all "0.7.10": diff --git a/recipes/aws-c-s3/all/conandata.yml b/recipes/aws-c-s3/all/conandata.yml index af6e82a742aa67..776d2c58fad6ac 100644 --- a/recipes/aws-c-s3/all/conandata.yml +++ b/recipes/aws-c-s3/all/conandata.yml @@ -11,6 +11,3 @@ sources: "0.1.27": url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.27.tar.gz" sha256: "8fccbf967c3b29f0feaa1ba3de158b7ead805c3b4302c45b7cad3429f045920c" - "0.1.19": - url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.19.tar.gz" - sha256: "30e17e31eed18e8d621cd3d3978b2e6eeeee5557bfc3a9d701d0d3e1c4a8a74d" diff --git a/recipes/aws-c-s3/all/conanfile.py b/recipes/aws-c-s3/all/conanfile.py index 131627214ba790..4854a0ec7c6d5e 100644 --- a/recipes/aws-c-s3/all/conanfile.py +++ b/recipes/aws-c-s3/all/conanfile.py @@ -1,18 +1,21 @@ from conan import ConanFile -from conan.tools.files import get, copy, rmdir -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, save +from conan.tools.scm import Version import os +import textwrap + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.47.0" class AwsCS3(ConanFile): name = "aws-c-s3" description = "C99 implementation of the S3 client" - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-s3" topics = ("aws", "amazon", "cloud", "s3") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,37 +32,29 @@ 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") def requirements(self): - self.requires("aws-c-common/0.8.2") + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.13") if Version(self.version) < "0.1.49": - self.requires("aws-c-io/0.10.20") + self.requires("aws-c-auth/0.6.11", transitive_headers=True) self.requires("aws-c-http/0.6.13") - self.requires("aws-c-auth/0.6.11") + self.requires("aws-c-io/0.10.20", transitive_headers=True) else: - self.requires("aws-c-io/0.13.4") + self.requires("aws-c-auth/0.6.17", transitive_headers=True) self.requires("aws-c-http/0.6.22") - self.requires("aws-c-auth/0.6.17") + self.requires("aws-c-io/0.13.4", transitive_headers=True) if Version(self.version) >= "0.1.36": self.requires("aws-checksums/0.1.13") 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) @@ -80,24 +75,34 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-s3")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-s3": "aws-c-s3::aws-c-s3"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + 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() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-s3") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-s3") + self.cpp_info.libs = ["aws-c-s3"] + if self.options.shared: + self.cpp_info.defines.append("AWS_S3_USE_IMPORT_EXPORT") - self.cpp_info.filenames["cmake_find_package"] = "aws-c-s3" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-s3" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-s3-lib"].names["cmake_find_package"] = "aws-c-s3" - self.cpp_info.components["aws-c-s3-lib"].names["cmake_find_package_multi"] = "aws-c-s3" - self.cpp_info.components["aws-c-s3-lib"].set_property("cmake_target_name", "AWS::aws-c-s3") - - self.cpp_info.components["aws-c-s3-lib"].libs = ["aws-c-s3"] - self.cpp_info.components["aws-c-s3-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-lib", - "aws-c-auth::aws-c-auth-lib" - ] - if Version(self.version) >= "0.1.36": - self.cpp_info.components["aws-c-s3-lib"].requires.append("aws-checksums::aws-checksums-lib") + # TODO: to remove in conan v2 once cmake_find_package* generators removed + 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/aws-c-s3/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt index 0778b2e2c7246d..0d20897301b68b 100644 --- a/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt +++ b/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-s3 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-s3) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-s3/config.yml b/recipes/aws-c-s3/config.yml index 182095498622bf..9a2f6a3845f5c9 100644 --- a/recipes/aws-c-s3/config.yml +++ b/recipes/aws-c-s3/config.yml @@ -7,5 +7,3 @@ versions: folder: all "0.1.27": folder: all - "0.1.19": - folder: all diff --git a/recipes/aws-c-sdkutils/all/conandata.yml b/recipes/aws-c-sdkutils/all/conandata.yml index 7ec4906cf9a7f3..4f2cc09884562a 100644 --- a/recipes/aws-c-sdkutils/all/conandata.yml +++ b/recipes/aws-c-sdkutils/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.12": + url: "https://github.com/awslabs/aws-c-sdkutils/archive/v0.1.12.tar.gz" + sha256: "c876c3ce2918f1181c24829f599c8f06e29733f0bd6556d4c4fb523390561316" "0.1.3": url: "https://github.com/awslabs/aws-c-sdkutils/archive/v0.1.3.tar.gz" sha256: "13d99c0877424a8fad40f312762968012dd54ec60a4438fb601ee65ff8b2484b" diff --git a/recipes/aws-c-sdkutils/all/conanfile.py b/recipes/aws-c-sdkutils/all/conanfile.py index f2158c8d10fa89..e2bfcefef68781 100644 --- a/recipes/aws-c-sdkutils/all/conanfile.py +++ b/recipes/aws-c-sdkutils/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 get, copy, rmdir, save +from conan.tools.scm import Version import os import textwrap @@ -39,7 +40,10 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + if Version(self.version) <= "0.1.3": + 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) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/aws-c-sdkutils/config.yml b/recipes/aws-c-sdkutils/config.yml index b2ced6f0d7ab75..c2aa05a42982f7 100644 --- a/recipes/aws-c-sdkutils/config.yml +++ b/recipes/aws-c-sdkutils/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.12": + folder: all "0.1.3": folder: all "0.1.2": diff --git a/recipes/aws-checksums/all/conandata.yml b/recipes/aws-checksums/all/conandata.yml index ddf66e3fcf5ae4..989708680b889a 100644 --- a/recipes/aws-checksums/all/conandata.yml +++ b/recipes/aws-checksums/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.17": + url: "https://github.com/awslabs/aws-checksums/archive/v0.1.17.tar.gz" + sha256: "83c1fbae826631361a529e9565e64a942c412baaec6b705ae5da3f056b97b958" "0.1.13": url: "https://github.com/awslabs/aws-checksums/archive/v0.1.13.tar.gz" sha256: "0f897686f1963253c5069a0e495b85c31635ba146cd3ac38cc2ea31eaf54694d" @@ -14,5 +17,11 @@ sources: patches: "0.1.5": - patch_file: "patches/0001-use-PROJECT_SOURCE_DIR.patch" + patch_description: "use PROJECT_NAME instead of CMAKE_PROJECT_NAME" + patch_type: "conan" - patch_file: "patches/0002-disable-overriding-fPIC.patch" + patch_description: "disable overriding -fPIC" + patch_type: "conan" - patch_file: "patches/0003-disable-building-tests.patch" + patch_description: "build no tests" + patch_type: "conan" diff --git a/recipes/aws-checksums/all/conanfile.py b/recipes/aws-checksums/all/conanfile.py index 80a0c88a8c55b4..e2711f6d5488f6 100644 --- a/recipes/aws-checksums/all/conanfile.py +++ b/recipes/aws-checksums/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 apply_conandata_patches, export_conandata_patches, copy, get, rmdir, save +from conan.tools.scm import Version import os import textwrap @@ -45,7 +46,10 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2") + if Version(self.version) < "0.1.17": + self.requires("aws-c-common/0.8.2") + else: + 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-checksums/config.yml b/recipes/aws-checksums/config.yml index 55fedf4c307f5e..efe23bdebe7e1b 100644 --- a/recipes/aws-checksums/config.yml +++ b/recipes/aws-checksums/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.17": + folder: all "0.1.13": folder: all "0.1.12": diff --git a/recipes/aws-crt-cpp/all/conanfile.py b/recipes/aws-crt-cpp/all/conanfile.py index 0b0f3153a28632..97c0f616bb653c 100644 --- a/recipes/aws-crt-cpp/all/conanfile.py +++ b/recipes/aws-crt-cpp/all/conanfile.py @@ -1,10 +1,11 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save 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 +import textwrap required_conan_version = ">=1.53.0" @@ -46,22 +47,23 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2") + self.requires("aws-c-cal/0.5.13", transitive_headers=True) + self.requires("aws-c-common/0.8.2", transitive_headers=True) self.requires("aws-checksums/0.1.13") if Version(self.version) < "0.17.29": - self.requires("aws-c-io/0.10.20") - self.requires("aws-c-http/0.6.13") - self.requires("aws-c-auth/0.6.11") - self.requires("aws-c-s3/0.1.37") - self.requires("aws-c-mqtt/0.7.10") + self.requires("aws-c-auth/0.6.11", transitive_headers=True) self.requires("aws-c-event-stream/0.2.7") + self.requires("aws-c-http/0.6.13", transitive_headers=True) + self.requires("aws-c-io/0.10.20", transitive_headers=True) + self.requires("aws-c-mqtt/0.7.10", transitive_headers=True) + self.requires("aws-c-s3/0.1.37") else: - self.requires("aws-c-io/0.13.4") - self.requires("aws-c-http/0.6.22") - self.requires("aws-c-auth/0.6.17") - self.requires("aws-c-s3/0.1.49") - self.requires("aws-c-mqtt/0.7.12") + self.requires("aws-c-auth/0.6.17", transitive_headers=True) self.requires("aws-c-event-stream/0.2.15") + self.requires("aws-c-http/0.6.22", transitive_headers=True) + self.requires("aws-c-io/0.13.4", transitive_headers=True) + self.requires("aws-c-mqtt/0.7.12", transitive_headers=True) + self.requires("aws-c-s3/0.1.49") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -91,26 +93,34 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-crt-cpp")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-crt-cpp": "aws-crt-cpp::aws-crt-cpp"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + 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() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-crt-cpp") self.cpp_info.set_property("cmake_target_name", "AWS::aws-crt-cpp") - - self.cpp_info.components["aws-crt-cpp-lib"].names["cmake_find_package"] = "aws-crt-cpp" - self.cpp_info.components["aws-crt-cpp-lib"].names["cmake_find_package_multi"] = "aws-crt-cpp" - self.cpp_info.components["aws-crt-cpp-lib"].libs = ["aws-crt-cpp"] - self.cpp_info.components["aws-crt-cpp-lib"].requires = [ - "aws-c-event-stream::aws-c-event-stream-lib", - "aws-c-common::aws-c-common-lib", - "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-lib", - "aws-c-auth::aws-c-auth-lib", - "aws-c-mqtt::aws-c-mqtt-lib", - "aws-c-s3::aws-c-s3-lib", - "aws-checksums::aws-checksums-lib" - ] + self.cpp_info.libs = ["aws-crt-cpp"] + if self.options.shared: + self.cpp_info.defines.append("AWS_CRT_CPP_USE_IMPORT_EXPORT") # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-crt-cpp" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-crt-cpp" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" + 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/aws-kvs-pic/all/CMakeLists.txt b/recipes/aws-kvs-pic/all/CMakeLists.txt deleted file mode 100644 index 6abb33ac667b00..00000000000000 --- a/recipes/aws-kvs-pic/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/aws-kvs-pic/all/conandata.yml b/recipes/aws-kvs-pic/all/conandata.yml index 3e715c54770317..4be3843841ab1c 100644 --- a/recipes/aws-kvs-pic/all/conandata.yml +++ b/recipes/aws-kvs-pic/all/conandata.yml @@ -1,8 +1,7 @@ sources: + "1.0.1": + url: "https://github.com/awslabs/amazon-kinesis-video-streams-pic/archive/refs/tags/v1.0.1.tar.gz" + sha256: "d04732217c74687c5498665b353cb089d725ca7f5b5da61a3f984f7fbefb2ac9" "cci.20210812": url: "https://github.com/awslabs/amazon-kinesis-video-streams-pic/archive/bbf0e4ba749a6c045fc3958951c1c3a61a808dd0.tar.gz" sha256: "5a6d8da62af766ec86423ead2a45d9ff00cd80ddea679ce228ff9696a490fae5" -patches: - "cci.20210812": - - base_path: "source_subfolder" - patch_file: "patches/0001-do-not-enforce-fpic.patch" diff --git a/recipes/aws-kvs-pic/all/conanfile.py b/recipes/aws-kvs-pic/all/conanfile.py index 3cdebbedda8639..a0653e082edea0 100644 --- a/recipes/aws-kvs-pic/all/conanfile.py +++ b/recipes/aws-kvs-pic/all/conanfile.py @@ -1,37 +1,31 @@ import os -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 awskvspicConan(ConanFile): name = "aws-kvs-pic" + description = "Platform Independent Code for Amazon Kinesis Video Streams" license = "Apache-2.0" - homepage = "https://github.com/awslabs/amazon-kinesis-video-streams-pic" url = "https://github.com/conan-io/conan-center-index" - description = ("Platform Independent Code for Amazon Kinesis Video Streams") - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {'shared': False, "fPIC": True} - generators = "cmake" + homepage = "https://github.com/awslabs/amazon-kinesis-video-streams-pic" topics = ("aws", "kvs", "kinesis", "video", "stream") - exports_sources = ["CMakeLists.txt", "patches/*"] - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["BUILD_DEPENDENCIES"] = False - self._cmake.configure() - return self._cmake - - def validate(self): - if (self.settings.os != "Linux" and self.options.shared): - raise ConanInvalidConfiguration("This library can only be built shared on Linux") + 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": @@ -39,38 +33,53 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + 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") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"] and self.options.shared: + raise ConanInvalidConfiguration("This library can only be built shared on 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_DEPENDENCIES"] = False + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), " -fPIC", "") 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("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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.components["kvspic"].libs = ["kvspic"] - self.cpp_info.components["kvspic"].names["pkg_config"] = "libkvspic" + self.cpp_info.components["kvspic"].set_property("pkg_config_name", "libkvspic") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["kvspic"].system_libs = ["dl", "rt", "pthread"] self.cpp_info.components["kvspicClient"].libs = ["kvspicClient"] - self.cpp_info.components["kvspicClient"].names["pkg_config"] = "libkvspicClient" + self.cpp_info.components["kvspicClient"].set_property("pkg_config_name", "libkvspicClient") self.cpp_info.components["kvspicState"].libs = ["kvspicState"] - self.cpp_info.components["kvspicState"].names["pkg_config"] = "libkvspicState" + self.cpp_info.components["kvspicState"].set_property("pkg_config_name", "libkvspicState") self.cpp_info.components["kvspicUtils"].libs = ["kvspicUtils"] - self.cpp_info.components["kvspicUtils"].names["pkg_config"] = "libkvspicUtils" + self.cpp_info.components["kvspicUtils"].set_property("pkg_config_name", "libkvspicUtils") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["kvspicUtils"].system_libs = ["dl", "rt", "pthread"] diff --git a/recipes/aws-kvs-pic/all/patches/0001-do-not-enforce-fpic.patch b/recipes/aws-kvs-pic/all/patches/0001-do-not-enforce-fpic.patch deleted file mode 100644 index 0286a964caa2c9..00000000000000 --- a/recipes/aws-kvs-pic/all/patches/0001-do-not-enforce-fpic.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt 2021-08-06 17:10:31.808434572 -0300 -+++ b/CMakeLists.txt 2021-08-06 17:10:31.888434646 -0300 -@@ -79,7 +79,7 @@ - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads) - --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") -+ - - if(MSVC) - add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING) diff --git a/recipes/aws-kvs-pic/all/test_package/CMakeLists.txt b/recipes/aws-kvs-pic/all/test_package/CMakeLists.txt index dbfb3fd9c78618..33561c82ed591a 100644 --- a/recipes/aws-kvs-pic/all/test_package/CMakeLists.txt +++ b/recipes/aws-kvs-pic/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(PkgConfig REQUIRED) pkg_check_modules(LIBKVSPIC REQUIRED IMPORTED_TARGET libkvspic) diff --git a/recipes/aws-kvs-pic/all/test_package/conanfile.py b/recipes/aws-kvs-pic/all/test_package/conanfile.py index 6fdab74d20c228..e8fb9d03fc8a5a 100644 --- a/recipes/aws-kvs-pic/all/test_package/conanfile.py +++ b/recipes/aws-kvs-pic/all/test_package/conanfile.py @@ -1,12 +1,23 @@ import os -from conans import ConanFile, CMake, tools -class TestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "pkg_config" +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def build_requirements(self): - self.build_requires("pkgconf/1.7.4") + self.tool_requires("pkgconf/2.0.3") + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -14,6 +25,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/aws-kvs-pic/all/test_package/test_package.c b/recipes/aws-kvs-pic/all/test_package/test_package.c index fe898105977799..08c9a0b45013e4 100644 --- a/recipes/aws-kvs-pic/all/test_package/test_package.c +++ b/recipes/aws-kvs-pic/all/test_package/test_package.c @@ -1,6 +1,7 @@ -#include #include "com/amazonaws/kinesis/video/client/Include.h" +#include + int main(int argc, char *argv[]) { diff --git a/recipes/aws-kvs-pic/all/test_v1_package/CMakeLists.txt b/recipes/aws-kvs-pic/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/aws-kvs-pic/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/aws-kvs-pic/all/test_v1_package/conanfile.py b/recipes/aws-kvs-pic/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..cba2c258bb2b41 --- /dev/null +++ b/recipes/aws-kvs-pic/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os +from conans import ConanFile, CMake, tools + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/2.0.3") + + 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/aws-kvs-pic/config.yml b/recipes/aws-kvs-pic/config.yml index e6b575a0288450..42adf0e62a4df0 100644 --- a/recipes/aws-kvs-pic/config.yml +++ b/recipes/aws-kvs-pic/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.1": + folder: all "cci.20210812": folder: all diff --git a/recipes/aws-lambda-cpp/all/conandata.yml b/recipes/aws-lambda-cpp/all/conandata.yml new file mode 100644 index 00000000000000..22a060a14124f5 --- /dev/null +++ b/recipes/aws-lambda-cpp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.2.10": + url: "https://github.com/awslabs/aws-lambda-cpp/archive/refs/tags/v0.2.10.tar.gz" + sha256: "fee8e465ac63efaa6252aa2a108183ef174cbc5ed3e56e4de4986846f89a76ee" + "0.2.9": + url: "https://github.com/awslabs/aws-lambda-cpp/archive/refs/tags/0.2.9.tar.gz" + sha256: "4fb98483248adf0a2b251cb1b06df8b19bbd40e7f015dccfc32b7eaae6a294e7" + "0.2.8": + url: "https://github.com/awslabs/aws-lambda-cpp/archive/refs/tags/v0.2.8.tar.gz" + sha256: "a236516331804a0a6e2ef2273042a583e55a135bb6478308829c51e7c425acdb" diff --git a/recipes/aws-lambda-cpp/all/conanfile.py b/recipes/aws-lambda-cpp/all/conanfile.py new file mode 100644 index 00000000000000..0b0de62c879d34 --- /dev/null +++ b/recipes/aws-lambda-cpp/all/conanfile.py @@ -0,0 +1,87 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + +class AwsLambdaRuntimeConan(ConanFile): + name = "aws-lambda-cpp" + description = "C++ implementation of the AWS Lambda runtime" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-lambda-cpp" + topics = ("aws", "lambda") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_backtrace": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_backtrace": False, + } + + @property + def _min_cppstd(self): + return 11 + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "0.2.9": + del self.options.with_backtrace + + 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("libcurl/[>=7.78.0 <9]") + if self.options.get_safe("with_backtrace", True): + self.requires("libbacktrace/cci.20210118") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} supports Linux only.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-lambda-runtime")) + + def package_info(self): + self.cpp_info.libs = ["aws-lambda-runtime"] + + self.cpp_info.set_property("cmake_file_name", "aws-lambda-runtime") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-lambda-runtime") + + self.cpp_info.system_libs.append("m") diff --git a/recipes/aws-lambda-cpp/all/test_package/CMakeLists.txt b/recipes/aws-lambda-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..073c5e204a51ee --- /dev/null +++ b/recipes/aws-lambda-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(aws-lambda-runtime REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-lambda-runtime) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/aws-lambda-cpp/all/test_package/conanfile.py b/recipes/aws-lambda-cpp/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/aws-lambda-cpp/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/aws-lambda-cpp/all/test_package/test_package.cpp b/recipes/aws-lambda-cpp/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..ae80b44bdeccb4 --- /dev/null +++ b/recipes/aws-lambda-cpp/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include "aws/lambda-runtime/version.h" + +int main() +{ + std::cout << aws::lambda_runtime::get_version() << '\n'; + + return 0; +} diff --git a/recipes/aws-lambda-cpp/config.yml b/recipes/aws-lambda-cpp/config.yml new file mode 100644 index 00000000000000..6cead73879d2a7 --- /dev/null +++ b/recipes/aws-lambda-cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "0.2.10": + folder: all + "0.2.9": + folder: all + "0.2.8": + folder: all diff --git a/recipes/aws-libfabric/all/conanfile.py b/recipes/aws-libfabric/all/conanfile.py index 134b19e72fb917..cdf0ee0dd31985 100644 --- a/recipes/aws-libfabric/all/conanfile.py +++ b/recipes/aws-libfabric/all/conanfile.py @@ -1,33 +1,44 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.35.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 cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, collect_libs, copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path + +required_conan_version = ">=1.53.0" + class LibfabricConan(ConanFile): name = "aws-libfabric" description = "AWS Libfabric" - topics = ("fabric", "communication", "framework", "service") + license = ("BSD-2-Clause", "GPL-2.0-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/aws/libfabric" - license = "BSD-2-Clause", "GPL-2.0-or-later" + topics = ("fabric", "communication", "framework", "service") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" _providers = ["gni", "psm", "psm2", "sockets", "rxm", "tcp", "udp", "usnic", "verbs", "bgq", "shm", "efa", "rxd", "mrail", "rstream", "perf", "hook_debug"] options = { + "shared": [True, False], + "fPIC": [True, False], **{ p: [True, False, "shared"] for p in _providers }, **{ - "shared": [True, False], - "fPIC": [True, False], "with_libnl": [True, False], "bgq_progress": ["auto", "manual"], "bgq_mr": ["basic", "scalable"] } } default_options = { + "shared": False, + "fPIC": True, **{ p: False for p in _providers }, **{ - "shared": False, - "fPIC": True, "tcp": True, "with_libnl": False, "bgq_progress": "manual", @@ -35,15 +46,6 @@ class LibfabricConan(ConanFile): } } - @property - def _source_subfolder(self): - return "source_subfolder" - - _autotools = None - - def build_requirements(self): - self.build_requires("libtool/2.4.6") - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -52,9 +54,12 @@ 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): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_libnl: @@ -64,52 +69,56 @@ def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration("The libfabric package cannot be built on Windows.") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + 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") yes_no_dl = lambda v: {"True": "yes", "False": "no", "shared": "dl"}[str(v)] - 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)), + tc = AutotoolsToolchain(self) + tc.configure_args += [ "--with-bgq-progress={}".format(self.options.bgq_progress), "--with-bgq-mr={}".format(self.options.bgq_mr), ] for p in self._providers: - args.append("--enable-{}={}".format(p, yes_no_dl(getattr(self.options, p)))) + tc.configure_args.append("--enable-{}={}".format(p, yes_no_dl(getattr(self.options, p)))) if self.options.with_libnl: - args.append("--with-libnl={}".format(tools.unix_path(self.deps_cpp_info["libnl"].rootpath))), + tc.configure_args.append("--with-libnl={}".format(unix_path(self, self.dependencies["libnl"].package_folder))) else: - args.append("--with-libnl=no") + tc.configure_args.append("--with-libnl=no") if self.settings.build_type == "Debug": - args.append("--enable-debug") - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools + tc.configure_args.append("--enable-debug") + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() def build(self): - autotools = self._configure_autotools() - autotools.make() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() - autotools.install() - - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.names["pkg_config"] = "libfabric" - self.cpp_info.libs = self.collect_libs() + self.cpp_info.set_property("pkg_config_name", "libfabric") + self.cpp_info.libs = collect_libs(self) if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["pthread", "m"] if not self.options.shared: diff --git a/recipes/aws-libfabric/all/test_package/CMakeLists.txt b/recipes/aws-libfabric/all/test_package/CMakeLists.txt index 34af13462f44f8..1af9ab7c6f511e 100644 --- a/recipes/aws-libfabric/all/test_package/CMakeLists.txt +++ b/recipes/aws-libfabric/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(aws-libfabric REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE aws-libfabric::aws-libfabric) diff --git a/recipes/aws-libfabric/all/test_package/conanfile.py b/recipes/aws-libfabric/all/test_package/conanfile.py index d4128b04507778..ef5d7042163ecc 100644 --- a/recipes/aws-libfabric/all/test_package/conanfile.py +++ b/recipes/aws-libfabric/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" + 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/aws-libfabric/all/test_v1_package/CMakeLists.txt b/recipes/aws-libfabric/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/aws-libfabric/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/lyra/all/test_v1_package/conanfile.py b/recipes/aws-libfabric/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/lyra/all/test_v1_package/conanfile.py rename to recipes/aws-libfabric/all/test_v1_package/conanfile.py diff --git a/recipes/aws-sdk-cpp/all/CMakeLists.txt b/recipes/aws-sdk-cpp/all/CMakeLists.txt deleted file mode 100644 index d19ff91050d959..00000000000000 --- a/recipes/aws-sdk-cpp/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -if(MSVC) - add_definitions(-D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-sdk-cpp/all/conandata.yml b/recipes/aws-sdk-cpp/all/conandata.yml index 8abd96ad2e0be1..5818aef791db03 100644 --- a/recipes/aws-sdk-cpp/all/conandata.yml +++ b/recipes/aws-sdk-cpp/all/conandata.yml @@ -10,29 +10,19 @@ sources: sha256: "5dd09baa28d3f6f4fb03fbba1a4269724d79bcca3d47752cd3e15caf97276bda" patches: "1.9.234": - - base_path: source_subfolder - patch_file: patches/1.9.234-0001-issue-1816.patch - - base_path: source_subfolder - patch_file: patches/1.9.234-0002-disable-sort-links.patch - - base_path: source_subfolder - patch_file: patches/1.9.100-0002-aws-plugin-conf.patch + - patch_file: patches/1.9.234-0001-issue-1816.patch + - patch_file: patches/1.9.234-0002-disable-sort-links.patch + - patch_file: patches/1.9.100-0002-aws-plugin-conf.patch + - patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch "1.9.100": - - base_path: source_subfolder - patch_file: patches/1.9.100-0001-disable-sort-links.patch - - base_path: source_subfolder - patch_file: patches/1.9.100-0002-aws-plugin-conf.patch - - base_path: source_subfolder - patch_file: patches/1.9.100-0003-issue-1816.patch + - patch_file: patches/1.9.100-0001-disable-sort-links.patch + - patch_file: patches/1.9.100-0002-aws-plugin-conf.patch + - patch_file: patches/1.9.100-0003-issue-1816.patch + - patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch "1.8.130": - - base_path: source_subfolder - patch_file: patches/1.8.130-0001-disable-sort-links.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0002-force-archive-directory-to-library-directory.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0005-aws-plugin-conf.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0006-issue-1816.patch + - patch_file: patches/1.8.130-0001-disable-sort-links.patch + - patch_file: patches/1.8.130-0002-force-archive-directory-to-library-directory.patch + - patch_file: patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch + - patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch + - patch_file: patches/1.8.130-0005-aws-plugin-conf.patch + - patch_file: patches/1.8.130-0006-issue-1816.patch diff --git a/recipes/aws-sdk-cpp/all/conanfile.py b/recipes/aws-sdk-cpp/all/conanfile.py index 91c2066868882a..678d3e32eb8c95 100644 --- a/recipes/aws-sdk-cpp/all/conanfile.py +++ b/recipes/aws-sdk-cpp/all/conanfile.py @@ -1,11 +1,14 @@ import os -from conan.tools.files import rename -from conan.tools.microsoft import msvc_runtime_flag -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 cross_building, 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, rename, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.54.0" class AwsSdkCppConan(ConanFile): @@ -15,7 +18,7 @@ class AwsSdkCppConan(ConanFile): homepage = "https://github.com/aws/aws-sdk-cpp" description = "AWS SDK for C++" topics = ("aws", "cpp", "cross-platform", "amazon", "cloud") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" _sdks = ( "access-management", @@ -304,17 +307,7 @@ class AwsSdkCppConan(ConanFile): default_options["transfer"] = True default_options["text-to-speech"] = True - generators = "cmake", "cmake_find_package" short_paths = True - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] @property def _internal_requirements(self): @@ -329,35 +322,36 @@ def _internal_requirements(self): @property def _use_aws_crt_cpp(self): - return tools.Version(self.version) >= "1.9" + return Version(self.version) >= "1.9" 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 - if tools.Version(self.version) < "1.9": - delattr(self.options, "s3-crt") + if Version(self.version) < "1.9": + self.options.rm_safe("s3-crt") 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("aws-c-common/0.6.19") + self.requires("aws-c-common/0.8.2") + self.requires("aws-c-event-stream/0.2.7") + self.requires("aws-checksums/0.1.13") if self._use_aws_crt_cpp: self.requires("aws-c-cal/0.5.13") self.requires("aws-c-http/0.6.13") self.requires("aws-c-io/0.10.20") - self.requires("aws-crt-cpp/0.17.23") - else: - self.requires("aws-c-event-stream/0.2.7") + self.requires("aws-crt-cpp/0.17.23", transitive_headers=True) if self.settings.os != "Windows": - self.requires("openssl/1.1.1n") - self.requires("libcurl/7.80.0") + self.requires("openssl/[>=1.1 <4]") + self.requires("libcurl/[>=7.78.0 <9]") if self.settings.os in ["Linux", "FreeBSD"]: if self.options.get_safe("text-to-speech"): self.requires("pulseaudio/14.2") @@ -365,21 +359,21 @@ def requirements(self): def validate(self): if (self.options.shared and self.settings.compiler == "gcc" - and tools.Version(self.settings.compiler.version) < "6.0"): + and Version(self.settings.compiler.version) < "6.0"): raise ConanInvalidConfiguration( "Doesn't support gcc5 / shared. " "See https://github.com/conan-io/conan-center-index/pull/4401#issuecomment-802631744" ) - if (tools.Version(self.version) < "1.9.234" + if (Version(self.version) < "1.9.234" and self.settings.compiler == "gcc" - and tools.Version(self.settings.compiler.version) >= "11.0" + and Version(self.settings.compiler.version) >= "11.0" and self.settings.build_type == "Release"): raise ConanInvalidConfiguration( "Versions prior to 1.9.234 don't support release builds on >= gcc 11 " "See https://github.com/aws/aws-sdk-cpp/issues/1505" ) if self._use_aws_crt_cpp: - if self._is_msvc and "MT" in msvc_runtime_flag(self): + if is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Static runtime is not working for more recent releases") else: if self.settings.os == "Macos" and self.settings.arch == "armv8": @@ -390,48 +384,60 @@ def validate(self): def package_id(self): for hl_comp in self._internal_requirements.keys(): - if getattr(self.options, hl_comp): + if getattr(self.info.options, hl_comp): for internal_requirement in self._internal_requirements[hl_comp]: setattr(self.info.options, internal_requirement, True) 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) + def generate(self): + tc = CMakeToolchain(self) + # All option() are defined before project() in upstream CMakeLists, + # therefore we must use cache_variables build_only = ["core"] for sdk in self._sdks: if self.options.get_safe(sdk): build_only.append(sdk) - self._cmake.definitions["BUILD_ONLY"] = ";".join(build_only) + tc.cache_variables["BUILD_ONLY"] = ";".join(build_only) - self._cmake.definitions["ENABLE_UNITY_BUILD"] = True - self._cmake.definitions["ENABLE_TESTING"] = False - self._cmake.definitions["AUTORUN_UNIT_TESTS"] = False - self._cmake.definitions["BUILD_DEPS"] = False + tc.cache_variables["ENABLE_UNITY_BUILD"] = True + tc.cache_variables["ENABLE_TESTING"] = False + tc.cache_variables["AUTORUN_UNIT_TESTS"] = False + tc.cache_variables["BUILD_DEPS"] = False if self.settings.os != "Windows": - self._cmake.definitions["ENABLE_OPENSSL_ENCRYPTION"] = True - - self._cmake.definitions["MINIMIZE_SIZE"] = self.options.min_size - if self._is_msvc and not self._use_aws_crt_cpp: - self._cmake.definitions["FORCE_SHARED_CRT"] = "MD" in msvc_runtime_flag(self) - - if tools.cross_building(self): - self._cmake.definitions["CURL_HAS_H2_EXITCODE"] = "0" - self._cmake.definitions["CURL_HAS_H2_EXITCODE__TRYRUN_OUTPUT"] = "" - self._cmake.definitions["CURL_HAS_TLS_PROXY_EXITCODE"] = "0" - self._cmake.definitions["CURL_HAS_TLS_PROXY_EXITCODE__TRYRUN_OUTPUT"] = "" - self._cmake.configure() - return self._cmake + tc.cache_variables["ENABLE_OPENSSL_ENCRYPTION"] = True + + tc.cache_variables["MINIMIZE_SIZE"] = self.options.min_size + if is_msvc(self) and not self._use_aws_crt_cpp: + tc.cache_variables["FORCE_SHARED_CRT"] = not is_msvc_static_runtime(self) + + if cross_building(self): + tc.cache_variables["CURL_HAS_H2_EXITCODE"] = "0" + tc.cache_variables["CURL_HAS_H2_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.cache_variables["CURL_HAS_TLS_PROXY_EXITCODE"] = "0" + tc.cache_variables["CURL_HAS_TLS_PROXY_EXITCODE__TRYRUN_OUTPUT"] = "" + if is_msvc(self): + tc.preprocessor_definitions["_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING"] = "1" + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Disable warnings as errors + replace_in_file( + self, os.path.join(self.source_folder, "cmake", "compiler_settings.cmake"), + 'list(APPEND AWS_COMPILER_WARNINGS "-Wall" "-Werror" "-pedantic" "-Wextra")', "", + ) 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() @property @@ -449,44 +455,56 @@ def _create_project_cmake_module(self): "toolchains/pkg-config.pc.in", "aws-cpp-sdk-core/include/aws/core/VersionConfig.h" ]: - self.copy(file, src=self._source_subfolder, dst=self._res_folder) - tools.replace_in_file(os.path.join(self.package_folder, self._res_folder, file), "CMAKE_CURRENT_SOURCE_DIR", "AWS_NATIVE_SDK_ROOT", strict=False) + copy(self, file, src=self.source_folder, dst=os.path.join(self.package_folder, self._res_folder)) + replace_in_file( + self, os.path.join(self.package_folder, self._res_folder, file), + "CMAKE_CURRENT_SOURCE_DIR", "AWS_NATIVE_SDK_ROOT", + strict=False, + ) # avoid getting error from hook - with tools.chdir(os.path.join(self.package_folder, self._res_folder)): - rename(self, os.path.join("toolchains", "cmakeProjectConfig.cmake"), os.path.join("toolchains", "cmakeProjectConf.cmake")) - tools.replace_in_file(os.path.join("cmake", "utilities.cmake"), "cmakeProjectConfig.cmake", "cmakeProjectConf.cmake") + rename(self, os.path.join(self.package_folder, self._res_folder, "toolchains", "cmakeProjectConfig.cmake"), + os.path.join(self.package_folder, self._res_folder, "toolchains", "cmakeProjectConf.cmake")) + replace_in_file( + self, os.path.join(self.package_folder, self._res_folder, "cmake", "utilities.cmake"), + "cmakeProjectConfig.cmake", "cmakeProjectConf.cmake", + ) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - if self._is_msvc: - self.copy(pattern="*.lib", dst="lib", keep_path=False) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.lib") + if is_msvc(self): + copy(self, "*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + rm(self, "*.lib", os.path.join(self.package_folder, "bin")) - 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")) self._create_project_cmake_module() def package_info(self): self.cpp_info.set_property("cmake_file_name", "AWSSDK") + sdk_plugin_conf = os.path.join(self._res_folder, "cmake", "sdk_plugin_conf.cmake") + self.cpp_info.set_property("cmake_build_modules", [sdk_plugin_conf]) + # core component self.cpp_info.components["core"].set_property("cmake_target_name", "AWS::aws-sdk-cpp-core") self.cpp_info.components["core"].set_property("pkg_config_name", "aws-sdk-cpp-core") self.cpp_info.components["core"].libs = ["aws-cpp-sdk-core"] - self.cpp_info.components["core"].requires = ["aws-c-common::aws-c-common-lib"] + self.cpp_info.components["core"].requires = [ + "aws-c-common::aws-c-common", + "aws-c-event-stream::aws-c-event-stream", + "aws-checksums::aws-checksums", + ] if self._use_aws_crt_cpp: self.cpp_info.components["core"].requires.extend([ - "aws-c-cal::aws-c-cal-lib", - "aws-c-http::aws-c-http-lib", - "aws-c-io::aws-c-io-lib", - "aws-crt-cpp::aws-crt-cpp-lib", + "aws-c-cal::aws-c-cal", + "aws-c-http::aws-c-http", + "aws-c-io::aws-c-io", + "aws-crt-cpp::aws-crt-cpp", ]) - else: - self.cpp_info.components["core"].requires.append("aws-c-event-stream::aws-c-event-stream-lib") # other components enabled_sdks = [sdk for sdk in self._sdks if self.options.get_safe(sdk)] @@ -500,8 +518,8 @@ def package_info(self): # TODO: there is no way to properly emulate COMPONENTS names for # find_package(AWSSDK COMPONENTS ) in set_property() # right now: see https://github.com/conan-io/conan/issues/10258 - self.cpp_info.components[sdk].set_property("cmake_target_name", "AWS::aws-sdk-cpp-{}".format(sdk)) - self.cpp_info.components[sdk].set_property("pkg_config_name", "aws-sdk-cpp-{}".format(sdk)) + self.cpp_info.components[sdk].set_property("cmake_target_name", f"AWS::aws-sdk-cpp-{sdk}") + self.cpp_info.components[sdk].set_property("pkg_config_name", f"aws-sdk-cpp-{sdk}") self.cpp_info.components[sdk].requires = ["core"] if sdk in self._internal_requirements: self.cpp_info.components[sdk].requires.extend(self._internal_requirements[sdk]) @@ -510,7 +528,7 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.components[sdk].names["cmake_find_package"] = "aws-sdk-cpp-" + sdk self.cpp_info.components[sdk].names["cmake_find_package_multi"] = "aws-sdk-cpp-" + sdk - component_alias = "aws-sdk-cpp-{}_alias".format(sdk) # to emulate COMPONENTS names for find_package() + component_alias = f"aws-sdk-cpp-{sdk}_alias" # to emulate COMPONENTS names for find_package() self.cpp_info.components[component_alias].names["cmake_find_package"] = sdk self.cpp_info.components[component_alias].names["cmake_find_package_multi"] = sdk self.cpp_info.components[component_alias].requires = [sdk] @@ -534,9 +552,14 @@ def package_info(self): if self.options.get_safe("text-to-speech"): self.cpp_info.components["text-to-speech"].frameworks.append("CoreAudio") - lib_stdcpp = tools.stdcpp_library(self) - if lib_stdcpp: - self.cpp_info.components["core"].system_libs.append(lib_stdcpp) + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["core"].system_libs.append(libcxx) + + self.cpp_info.components["plugin_scripts"].requires = ["core"] + self.cpp_info.components["plugin_scripts"].builddirs.extend([ + os.path.join(self._res_folder, "cmake"), + os.path.join(self._res_folder, "toolchains")]) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "AWSSDK" @@ -545,9 +568,5 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "AWS" self.cpp_info.components["core"].names["cmake_find_package"] = "aws-sdk-cpp-core" self.cpp_info.components["core"].names["cmake_find_package_multi"] = "aws-sdk-cpp-core" - - self.cpp_info.components["plugin_scripts"].requires = ["core"] - self.cpp_info.components["plugin_scripts"].builddirs.extend([ - os.path.join(self._res_folder, "cmake"), - os.path.join(self._res_folder, "toolchains")]) - self.cpp_info.components["plugin_scripts"].build_modules.append(os.path.join(self._res_folder, "cmake", "sdk_plugin_conf.cmake")) + self.cpp_info.components["plugin_scripts"].build_modules["cmake_find_package"] = [sdk_plugin_conf] + self.cpp_info.components["plugin_scripts"].build_modules["cmake_find_package_multi"] = [sdk_plugin_conf] diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch index 5a47717a4552ae..9930b981211f60 100644 --- a/recipes/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch +++ b/recipes/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch @@ -24,7 +24,7 @@ index b1054515d5..d1a34ddfc5 100644 message(STATUS "Pulse audio header files have been detected, included pulse audio as a possible sound driver implementation.") add_definitions("-DPULSE") - set(PLATFORM_LIBS ${PLATFORM_LIBS} pulse pulse-simple) -+ set(PLATFORM_LIBS ${PLATFORM_LIBS} "CONAN_PKG::pulseaudio") ++ set(PLATFORM_LIBS ${PLATFORM_LIBS} "pulseaudio::pulseaudio") else() message(WARNING "We've detected that you are building on linux, but the header files for pulseaudio are not available.\ If you are providing your own audio implementation or you will not be using the text-to-speech library, this is fine.\ diff --git a/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt b/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt index efb9a3d957583e..dda85fd047b73f 100644 --- a/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt +++ b/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt @@ -1,13 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(AWSSDK REQUIRED CONFIG) add_subdirectory(aws-sdk-cpp-plugin) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} aws-sdk-cpp-plugin) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE aws-sdk-cpp-plugin) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt b/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt index dddf745d2e4081..37d0edc6941d9d 100644 --- a/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt +++ b/recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) add_project(aws-sdk-cpp-plugin "C++ AWS SDK plugin" AWS::aws-sdk-cpp-s3) @@ -8,7 +8,7 @@ include(GenerateExportHeader) generate_export_header(${PROJECT_NAME} BASE_NAME aws_sdk_cpp_plugin) target_include_directories(${PROJECT_NAME} PUBLIC $ $) target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) setup_install() diff --git a/recipes/aws-sdk-cpp/all/test_package/conanfile.py b/recipes/aws-sdk-cpp/all/test_package/conanfile.py index 38f4483872d47f..e845ae751a3017 100644 --- a/recipes/aws-sdk-cpp/all/test_package/conanfile.py +++ b/recipes/aws-sdk-cpp/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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) 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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-common/all/test_v1_package/CMakeLists.txt b/recipes/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/aws-c-common/all/test_v1_package/CMakeLists.txt rename to recipes/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt diff --git a/recipes/aws-c-common/all/test_v1_package/conanfile.py b/recipes/aws-sdk-cpp/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/aws-c-common/all/test_v1_package/conanfile.py rename to recipes/aws-sdk-cpp/all/test_v1_package/conanfile.py diff --git a/recipes/azure-storage-cpp/all/conanfile.py b/recipes/azure-storage-cpp/all/conanfile.py index 692bc2ab703fed..92f05a255ac83f 100644 --- a/recipes/azure-storage-cpp/all/conanfile.py +++ b/recipes/azure-storage-cpp/all/conanfile.py @@ -51,7 +51,7 @@ def requirements(self): if self.settings.os != "Windows": self.requires("boost/1.76.0") self.requires("libxml2/2.9.10") - self.requires("libuuid/1.0.3") + self.requires("util-linux-libuuid/2.39") if self.settings.os == "Macos": self.requires("libgettext/0.20.1") diff --git a/recipes/b2/portable/conanfile.py b/recipes/b2/portable/conanfile.py index dad95965dea312..829c74015b1efe 100644 --- a/recipes/b2/portable/conanfile.py +++ b/recipes/b2/portable/conanfile.py @@ -1,6 +1,7 @@ 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 chdir, copy, get from conan.tools.layout import basic_layout @@ -107,6 +108,12 @@ def _bootstrap_env(self): os.environ.clear() os.environ.update(saved_env) + def _write_project_config(self, cxx): + with open(os.path.join(self.source_folder, "project-config.jam"), "w") as f: + f.write( + f"using {self.options.toolset} : : {cxx} ;\n" + ) + def build(self): # The order of the with:with: below is important. The first one changes # the current dir. While the second does env changes that guarantees @@ -139,10 +146,14 @@ def build(self): command += "build" if use_windows_commands else "./build.sh" if self.options.use_cxx_env: - cxx = os.environ.get("CXX") + envvars = VirtualBuildEnv(self).vars() + + cxx = envvars.get("CXX") if cxx: command += f" --cxx={cxx}" - cxxflags = os.environ.get("CXXFLAGS") + self._write_project_config(cxx) + + cxxflags = envvars.get("CXXFLAGS") if cxxflags: command += f" --cxxflags={cxxflags}" diff --git a/recipes/backport-cpp/all/conanfile.py b/recipes/backport-cpp/all/conanfile.py index a114a54bf9ff4e..7bd9c00c00321d 100644 --- a/recipes/backport-cpp/all/conanfile.py +++ b/recipes/backport-cpp/all/conanfile.py @@ -9,22 +9,22 @@ class BackportCppRecipe(ConanFile): name = "backport-cpp" description = "An ongoing effort to bring modern C++ utilities to be compatible with C++11" - topics = ("backport-cpp", "header-only", "backport") + topics = ("header-only", "backport") homepage = "https://github.com/bitwizeshift/BackportCpp" url = "https://github.com/conan-io/conan-center-index" license = "MIT" + 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 @@ -37,9 +37,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "Backport") self.cpp_info.set_property("cmake_target_name", "Backport::Backport") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "Backport" diff --git a/recipes/backward-cpp/all/conanfile.py b/recipes/backward-cpp/all/conanfile.py index df15db8d54d06c..66cfef012cf474 100644 --- a/recipes/backward-cpp/all/conanfile.py +++ b/recipes/backward-cpp/all/conanfile.py @@ -3,6 +3,7 @@ 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 +from conan.tools.layout import basic_layout from conan.tools.scm import Version import os @@ -20,12 +21,14 @@ class BackwardCppConan(ConanFile): package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { + "header_only": [True, False], "shared": [True, False], "fPIC": [True, False], "stack_walking": ["unwind", "libunwind", "backtrace"], "stack_details": ["dw", "bfd", "dwarf", "backtrace_symbol"], } default_options = { + "header_only": False, "shared": False, "fPIC": True, "stack_walking": "unwind", @@ -34,7 +37,7 @@ class BackwardCppConan(ConanFile): @property def _supported_os(self): - supported_os = ["Linux", "Macos", "Android"] + supported_os = ["Linux", "FreeBSD", "Android", "Macos"] if Version(self.version) >= "1.5": supported_os.append("Windows") return supported_os @@ -57,23 +60,33 @@ def config_options(self): self.options.stack_details = "backtrace_symbol" def configure(self): - if self.options.shared: + if self.options.header_only: + self.options.rm_safe("fPIC") + self.options.rm_safe("shared") + if self.options.get_safe("shared"): self.options.rm_safe("fPIC") def layout(self): - cmake_layout(self, src_folder="src") + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() def requirements(self): - if self.settings.os in ["Linux", "Android"]: + if self.settings.os in ["Linux", "FreeBSD", "Android"]: if self._has_stack_walking("libunwind"): - self.requires("libunwind/1.6.2", transitive_headers=True) + self.requires("libunwind/1.7.2", transitive_headers=True) if self._has_stack_details("dwarf"): self.requires("libdwarf/20191104", transitive_headers=True, transitive_libs=True) self.requires("libelf/0.8.13") if self._has_stack_details("dw"): - self.requires("elfutils/0.186", transitive_headers=True, transitive_libs=True) + self.requires("elfutils/0.190", transitive_headers=True) if self._has_stack_details("bfd"): - self.requires("binutils/2.38", transitive_headers=True, transitive_libs=True) + self.requires("binutils/2.41", transitive_headers=True) def validate(self): if self.settings.os not in self._supported_os: @@ -95,6 +108,8 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + if self.options.header_only: + return tc = CMakeToolchain(self) tc.variables["STACK_WALKING_UNWIND"] = self._has_stack_walking("unwind") tc.variables["STACK_WALKING_LIBUNWIND"] = self._has_stack_walking("libunwind") @@ -113,15 +128,22 @@ def generate(self): def build(self): apply_conandata_patches(self) + if self.options.header_only: + return 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", "backward")) + if self.options.header_only: + copy(self, pattern="*.hpp", + src=self.source_folder, + dst=os.path.join(self.package_folder, "include")) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "backward")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Backward") @@ -137,8 +159,12 @@ def package_info(self): self.cpp_info.defines.append(f"BACKWARD_HAS_DWARF={int(self._has_stack_details('dwarf'))}") self.cpp_info.defines.append(f"BACKWARD_HAS_PDB_SYMBOL={int(self.settings.os == 'Windows')}") - self.cpp_info.libs = ["backward"] - if self.settings.os == "Linux": + if self.options.header_only: + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] + else: + self.cpp_info.libs = ["backward"] + if self.settings.os in ["Linux", "FreeBSD", "Android"]: self.cpp_info.system_libs.extend(["dl", "m"]) if self.settings.os == "Windows": self.cpp_info.system_libs.extend(["psapi", "dbghelp"]) diff --git a/recipes/bandit/all/conanfile.py b/recipes/bandit/all/conanfile.py index 31fd2c6978fa44..5bc2e2513915d3 100644 --- a/recipes/bandit/all/conanfile.py +++ b/recipes/bandit/all/conanfile.py @@ -1,39 +1,41 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class BanditConan(ConanFile): name = "bandit" description = "Human-friendly unit testing for C++11" - topics = ("testing", "header-only") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/banditcpp/bandit" - license = "MIT" + topics = ("testing", "header-only") + package_type = "header-library" 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 requirements(self): - self.requires("snowhouse/5.0.0") + self.requires("snowhouse/5.0.0", transitive_headers=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 layout(self): - basic_layout(self) + basic_layout(self, src_folder="src") def build(self): apply_conandata_patches(self) def package(self): copy(self, "LICENSE.txt", src=os.path.join(self.source_folder, "docs"), dst=os.path.join(self.package_folder, "licenses")) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "include", "bandit"), src=os.path.join(self.source_folder, "bandit")) + copy(self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include", "bandit"), + src=os.path.join(self.source_folder, "bandit")) def package_id(self): self.info.clear() @@ -43,4 +45,3 @@ def package_info(self): self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] self.cpp_info.resdirs = [] - 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/all/conanfile.py b/recipes/base64/all/conanfile.py index d56ae8c5bcf103..e01cf8be42f58c 100644 --- a/recipes/base64/all/conanfile.py +++ b/recipes/base64/all/conanfile.py @@ -1,8 +1,7 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.env import Environment -from conan.tools.files import copy, get, apply_conandata_patches, chdir, export_conandata_patches, rmdir from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, apply_conandata_patches, chdir, export_conandata_patches, rmdir +from conan.tools.env import Environment from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc @@ -10,7 +9,8 @@ import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" + class Base64Conan(ConanFile): name = "base64" @@ -18,7 +18,8 @@ class Base64Conan(ConanFile): license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/aklomp/base64" - topics = ("base64", "codec", "encoder", "decoder") + topics = ("codec", "encoder", "decoder") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -33,23 +34,17 @@ def export_sources(self): export_conandata_patches(self) def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC 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 + if Version(self.version) < "0.5.0": + del self.options.shared + self.package_type = "static-library" + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): if self._use_cmake: @@ -57,13 +52,8 @@ def layout(self): else: basic_layout(self, src_folder="src") - def validate(self): - if Version(self.version) < "0.5.0" and self.info.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} doesn't support build shared.") - 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 _use_cmake(self): @@ -72,6 +62,10 @@ def _use_cmake(self): def generate(self): if self._use_cmake: tc = CMakeToolchain(self) + tc.variables["BASE64_BUILD_CLI"] = False + tc.variables["BASE64_WERROR"] = False + tc.variables["BASE64_BUILD_TESTS"] = False + tc.variables["BASE64_WITH_OpenMP"] = False tc.generate() else: tc = AutotoolsToolchain(self) @@ -82,10 +76,7 @@ def build(self): if self._use_cmake: cmake = CMake(self) cmake.configure() - if Version(self.version) >= "0.5.0": - cmake.build() - else: - cmake.build(target="base64") + cmake.build() else: env = Environment() if self.settings.arch == "x86" or self.settings.arch == "x86_64": @@ -111,14 +102,14 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) else: rmdir(self, os.path.join(self.package_folder, "cmake")) - rmdir(self, os.path.join(self.package_folder, "lib")) - copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) else: copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "base64") + self.cpp_info.set_property("cmake_target_name", "aklomp::base64") self.cpp_info.libs = ["base64"] if Version(self.version) >= "0.5.0" and not self.options.shared: diff --git a/recipes/base64/all/patches/0.4.0-0002-cmake.patch b/recipes/base64/all/patches/0.4.0-0002-cmake.patch index 4b833cc2f77c39..27b194373c8675 100644 --- a/recipes/base64/all/patches/0.4.0-0002-cmake.patch +++ b/recipes/base64/all/patches/0.4.0-0002-cmake.patch @@ -29,7 +29,7 @@ +# Compilation options +option(BASE64_INSTALL_TARGET "add an install target" ON) +option(BASE64_BUILD_TESTS "add test projects" ON) -+option(BASE64_WITH_OPENMP "use openmp" OFF) ++option(BASE64_WITH_OpenMP "use openmp" OFF) + +if (_TARGET_ARCH STREQUAL "x86" OR _TARGET_ARCH STREQUAL "x64") + option(BASE64_WITH_FAST_UNALIGNED_ACCESS "vectorization: unaligned access enabled" ON) @@ -49,7 +49,7 @@ + +################################################################### +# OpenMP -+if(BASE64_WITH_OPENMP) ++if(BASE64_WITH_OpenMP) + find_package(OpenMP) + if (OPENMP_FOUND) + option(BASE64_USE_OpenMP "Utilize OpenMP to parallelize encoding and decoding." ON) @@ -180,9 +180,9 @@ +# install target +if (BASE64_INSTALL_TARGET) + install(TARGETS base64 EXPORT base64-targets -+ RUNTIME DESTINATION bin/$ -+ LIBRARY DESTINATION lib/$ -+ ARCHIVE DESTINATION lib/$ ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib + INCLUDES DESTINATION include + ) + install(FILES include/libbase64.h DESTINATION include) diff --git a/recipes/base64/all/test_package/CMakeLists.txt b/recipes/base64/all/test_package/CMakeLists.txt index 195fdf269b250b..d13d382a6be8a7 100644 --- a/recipes/base64/all/test_package/CMakeLists.txt +++ b/recipes/base64/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) - -project(test_package C) +project(test_package LANGUAGES C) find_package(base64 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE base64::base64) +target_link_libraries(${PROJECT_NAME} PRIVATE aklomp::base64) diff --git a/recipes/base64/all/test_v1_package/CMakeLists.txt b/recipes/base64/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 6c32de99d28f71..00000000000000 --- a/recipes/base64/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(base64 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE base64::base64) 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/beauty/all/conanfile.py b/recipes/beauty/all/conanfile.py index db4a11b8cb7245..2c01e08705dd5b 100644 --- a/recipes/beauty/all/conanfile.py +++ b/recipes/beauty/all/conanfile.py @@ -57,8 +57,11 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.79.0"), - self.requires("openssl/1.1.1s") + # beauty public headers include some boost headers. + # For example beauty/application.hpp includes boost/asio.hpp + self.requires("boost/1.79.0", transitive_headers=True) + # dependency of asio in boost, exposed in boost/asio/ssl/detail/openssl_types.hpp + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/benchmark/all/conandata.yml b/recipes/benchmark/all/conandata.yml index 91541bdc04e27f..8a3c24a77b927d 100644 --- a/recipes/benchmark/all/conandata.yml +++ b/recipes/benchmark/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.3": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz" + sha256: "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce" "1.8.2": url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.2.tar.gz" sha256: "2aab2980d0376137f969d92848fbb68216abb07633034534fc8c65cc4e7a0e93" diff --git a/recipes/benchmark/config.yml b/recipes/benchmark/config.yml index b76259067bc586..f3ed1f1e957435 100644 --- a/recipes/benchmark/config.yml +++ b/recipes/benchmark/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.3": + folder: all "1.8.2": folder: all "1.8.1": diff --git a/recipes/bertrand/all/conanfile.py b/recipes/bertrand/all/conanfile.py index 3e410daba2d590..1373f8df7a23f3 100644 --- a/recipes/bertrand/all/conanfile.py +++ b/recipes/bertrand/all/conanfile.py @@ -15,6 +15,7 @@ class BertrandConan(ConanFile): homepage = "https://github.com/bernedom/bertrand" description = "A C++ header only library providing a trivial implementation for design by contract." topics = ("design by contract", "dbc", "cplusplus-library", "cplusplus-17") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @property @@ -31,6 +32,9 @@ def _compilers_minimum_version(self): "apple-clang": "10", } + def layout(self): + cmake_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -50,12 +54,8 @@ def loose_lt_semver(v1, v2): f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", ) - def layout(self): - cmake_layout(self, src_folder="src") - 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) @@ -78,6 +78,4 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "bertrand") self.cpp_info.set_property("cmake_target_name", "bertrand::bertrand") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/bgfx/all/conandata.yml b/recipes/bgfx/all/conandata.yml new file mode 100644 index 00000000000000..47606f9539fe5a --- /dev/null +++ b/recipes/bgfx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230216": + url: "https://github.com/bkaradzic/bgfx/archive/9d5b980f5c060e54cc30dec18500a5b54db00405.tar.gz" + sha256: "291739720E369C5C2422273D887AEC590084B29E5C9DC5C9441F5A68869B6736" diff --git a/recipes/bgfx/all/conanfile.py b/recipes/bgfx/all/conanfile.py new file mode 100644 index 00000000000000..9de812b7f94ea5 --- /dev/null +++ b/recipes/bgfx/all/conanfile.py @@ -0,0 +1,321 @@ +from conan import ConanFile +from conan.tools.files import copy, get, rename +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, check_min_vs, is_msvc_static_runtime +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import MSBuild, VCVars +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.env import VirtualBuildEnv +from pathlib import Path +import os + +required_conan_version = ">=1.50.0" + +class bgfxConan(ConanFile): + name = "bgfx" + license = "BSD-2-Clause" + homepage = "https://github.com/bkaradzic/bgfx" + url = "https://github.com/conan-io/conan-center-index" + description = "Cross-platform, graphics API agnostic, \"Bring Your Own Engine/Framework\" style rendering library." + topics = ("rendering", "graphics") + settings = "os", "compiler", "arch", "build_type" + options = {"shared": [True, False], "tools": [True, False]} + default_options = {"shared": False, "tools": False} + + @property + def _bx_folder(self): + return "bx" + + @property + def _bimg_folder(self): + return "bimg" + + @property + def _bgfx_folder(self): + return "bgfx" + + @property + def _bgfx_path(self): + return os.path.join(self.source_folder, self._bgfx_folder) + + @property + def _genie_extra(self): + genie_extra = "" + if is_msvc(self) and not is_msvc_static_runtime(self): + genie_extra += " --with-dynamic-runtime" + if self.options.shared: + genie_extra += " --with-shared-lib" + if self.options.tools: + genie_extra += " --with-tools" + return genie_extra + + @property + def _lib_target_prefix(self): + if self.settings.os == "Windows": + return "libs\\" + else: + return "" + + @property + def _tool_target_prefix(self): + if self.settings.os == "Windows": + return "tools\\" + else: + return "" + + @property + def _shaderc_target_prefix(self): + if self.settings.os == "Windows": + return "shaderc\\" + else: + return "" + + @property + def _projs(self): + if self.options.shared: + projs = [f"{self._lib_target_prefix}bgfx-shared-lib"] + else: + projs = [f"{self._lib_target_prefix}bgfx"] + if self.options.tools: + projs.extend([f"{self._tool_target_prefix}{self._shaderc_target_prefix}shaderc", + f"{self._tool_target_prefix}texturev", + f"{self._tool_target_prefix}geometryc", + f"{self._tool_target_prefix}geometryv"]) + return projs + + @property + def _compiler_required(self): + return { + "gcc": "8", + "clang": "3.3", + "apple-clang": "12", #to keep CCI compiling on osx 11.0 or higher, for now + "msvc": "191", + "Visual Studio": "15" #TODO remove with conan 2.0 + } + + @property + def _bx_version(self): #mapping of bgfx version to required/used bx version + return {"cci.20230216": "cci.20221116"} + + @property + def _bimg_version(self): #mapping of bgfx version to required/used bimg version + return {"cci.20230216": "cci.20230114"} + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + # bgfx's C99 API absolutely requires a header from bx so we need those to be transitive + self.requires(f"bx/{self._bx_version[self.version]}", transitive_headers=True) + self.requires(f"bimg/{self._bimg_version[self.version]}") + self.requires("opengl/system") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + check_min_vs(self, 191) + if not is_msvc(self): + try: + minimum_required_compiler_version = self._compiler_required[str(self.settings.compiler)] + if Version(self.settings.compiler.version) < minimum_required_compiler_version: + raise ConanInvalidConfiguration("This package requires C++14 support. The current compiler does not support it.") + except KeyError: + self.output.warn("This recipe has no checking for the current compiler. Please consider adding it.") + + def build_requirements(self): + self.tool_requires("genie/1170") + if not is_msvc(self) and 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): + get(self, **self.conan_data["sources"][self.version], strip_root=True, + destination=os.path.join(self.source_folder, self._bgfx_folder)) + # bgfx's genie project, and the projects generated by it, expect bx and bimg source to be present on the same relative root as bimg's in order to build + # usins a pre-built bx and bimg instead would require significant changes to the genie project but may be worth looking into in the future + get(self, **self.dependencies["bx"].conan_data["sources"][self._bx_version[self.version]], strip_root=True, + destination=os.path.join(self.source_folder, self._bx_folder)) + get(self, **self.dependencies["bimg"].conan_data["sources"][self._bimg_version[self.version]], strip_root=True, + destination=os.path.join(self.source_folder, self._bimg_folder)) + + def generate(self): + vbe = VirtualBuildEnv(self) + vbe.generate() + if is_msvc(self): + tc = VCVars(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + if is_msvc(self): + # Conan to Genie translation maps + vs_ver_to_genie = {"17": "2022", "16": "2019", "15": "2017", + "193": "2022", "192": "2019", "191": "2017"} + + # Use genie directly, then msbuild on specific projects based on requirements + genie_VS = f"vs{vs_ver_to_genie[str(self.settings.compiler.version)]}" + genie_gen = f"{self._genie_extra} {genie_VS}" + self.run(f"genie {genie_gen}", cwd=self._bgfx_path) + + msbuild = MSBuild(self) + # customize to Release when RelWithDebInfo + msbuild.build_type = "Debug" if self.settings.build_type == "Debug" else "Release" + # use Win32 instead of the default value when building x86 + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(self._bgfx_path, ".build", "projects", genie_VS, "bgfx.sln"), targets=self._projs) + else: + # Not sure if XCode can be spefically handled by conan for building through, so assume everything not VS is make + # gcc-multilib and g++-multilib required for 32bit cross-compilation, should see if we can check and install through conan + + # Conan to Genie translation maps + compiler_str = str(self.settings.compiler) + compiler_and_os_to_genie = {"Windows": f"--gcc=mingw-{compiler_str}", "Linux": f"--gcc=linux-{compiler_str}", + "FreeBSD": "--gcc=freebsd", "Macos": "--gcc=osx", + "Android": "--gcc=android", "iOS": "--gcc=ios"} + gmake_os_to_proj = {"Windows": "mingw", "Linux": "linux", "FreeBSD": "freebsd", "Macos": "osx", "Android": "android", "iOS": "ios"} + gmake_arch_to_genie_suffix = {"x86": "-x86", "x86_64": "-x64", "armv8": "-arm64", "armv7": "-arm"} + os_to_use_arch_config_suffix = {"Windows": False, "Linux": False, "FreeBSD": False, "Macos": True, "Android": True, "iOS": True} + + build_type_to_make_config = {"Debug": "config=debug", "Release": "config=release"} + arch_to_make_config_suffix = {"x86": "32", "x86_64": "64"} + os_to_use_make_config_suffix = {"Windows": True, "Linux": True, "FreeBSD": True, "Macos": False, "Android": False, "iOS": False} + + # Generate projects through genie + genieGen = f"{self._genie_extra} {compiler_and_os_to_genie[str(self.settings.os)]}" + if os_to_use_arch_config_suffix[str(self.settings.os)]: + genieGen += f"{gmake_arch_to_genie_suffix[str(self.settings.arch)]}" + genieGen += " gmake" + self.run(f"genie {genieGen}", cwd=self._bgfx_path) + + # Build project folder and path from given settings + projFolder = f"gmake-{gmake_os_to_proj[str(self.settings.os)]}" + if self.settings.os == "Windows" or compiler_str not in ["gcc", "apple-clang"]: + projFolder += f"-{compiler_str}" #mingw-gcc or mingw-clang for windows; -clang for linux (where gcc on linux has no extra) + if os_to_use_arch_config_suffix[str(self.settings.os)]: + projFolder += gmake_arch_to_genie_suffix[str(self.settings.arch)] + proj_path = os.path.sep.join([self._bgfx_path, ".build", "projects", projFolder]) + + # Build make args from settings + conf = build_type_to_make_config[str(self.settings.build_type)] + if os_to_use_make_config_suffix[str(self.settings.os)]: + conf += arch_to_make_config_suffix[str(self.settings.arch)] + if self.settings.os == "Windows": + mingw = "MINGW=$MINGW_PREFIX" + proj_path = proj_path.replace("\\", "/") # Fix path for msys... + else: + mingw = "" + autotools = Autotools(self) + # Build with make + for proj in self._projs: + autotools.make(target=proj, args=["-R", f"-C {proj_path}", mingw, conf]) + + def package(self): + # Set platform suffixes and prefixes + if self.settings.os == "Windows": + if self.options.shared: + lib_pat = "*bgfx-shared-lib*.lib" + else: + lib_pat = "*bgfx*.lib" + package_lib_prefix = "" + elif self.settings.os in ["Linux", "FreeBSD"]: + if self.options.shared: + lib_pat = "*bgfx*.so" + else: + lib_pat = "*bgfx*.a" + package_lib_prefix = "lib" + elif self.settings.os in ["Macos", "iOS"]: + if self.options.shared: + lib_pat = "*bgfx*.dylib" + else: + lib_pat = "*bgfx*.a" + package_lib_prefix = "lib" + + # Get build bin folder + for bimg_out_dir in os.listdir(os.path.join(self._bgfx_path, ".build")): + if not bimg_out_dir=="projects": + build_bin = os.path.join(self._bgfx_path, ".build", bimg_out_dir, "bin") + break + + # Copy license + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self._bgfx_path) + # Copy includes + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self._bgfx_path, "include")) + # Copy libs + copy(self, pattern=lib_pat, dst=os.path.join(self.package_folder, "lib"), src=build_bin, keep_path=False) + if self.options.shared: + copy(self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=build_bin, keep_path=False) + + # Copy tools + if self.options.tools: + copy(self, pattern="shaderc*", dst=os.path.join(self.package_folder, "bin"), src=build_bin, keep_path=False) + copy(self, pattern="texturev*", dst=os.path.join(self.package_folder, "bin"), src=build_bin, keep_path=False) + copy(self, pattern="geometryc*", dst=os.path.join(self.package_folder, "bin"), src=build_bin, keep_path=False) + copy(self, pattern="geometryv*", dst=os.path.join(self.package_folder, "bin"), src=build_bin, keep_path=False) + + # Rename for consistency across platforms and configs + if not (is_apple_os(self) and self.options.shared): #Apparently apple dylibs break if renamed + for bgfx_file in Path(os.path.join(self.package_folder, "lib")).glob("*bgfx*"): + rename(self, os.path.join(self.package_folder, "lib", bgfx_file.name), + os.path.join(self.package_folder, "lib", f"{package_lib_prefix}bgfx{bgfx_file.suffix}")) + if self.options.tools: + for bgfx_file in Path(os.path.join(self.package_folder, "bin")).glob("*shaderc*"): + rename(self, os.path.join(self.package_folder, "bin", bgfx_file.name), + os.path.join(self.package_folder, "bin", f"shaderc{bgfx_file.suffix}")) + for bgfx_file in Path(os.path.join(self.package_folder, "bin")).glob("*texturev*"): + rename(self, os.path.join(self.package_folder, "bin", bgfx_file.name), + os.path.join(self.package_folder, "bin", f"texturev{bgfx_file.suffix}")) + for bgfx_file in Path(os.path.join(self.package_folder, "bin")).glob("*geometryc*"): + rename(self, os.path.join(self.package_folder, "bin", bgfx_file.name), + os.path.join(self.package_folder, "bin", f"geometryc{bgfx_file.suffix}")) + for bgfx_file in Path(os.path.join(self.package_folder, "bin")).glob("*geometryv*"): + rename(self, os.path.join(self.package_folder, "bin", bgfx_file.name), + os.path.join(self.package_folder, "bin", f"geometryv{bgfx_file.suffix}")) + + # Maybe this helps + if is_apple_os(self): + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.includedirs = ["include"] + if self.options.shared and self.settings.os in ["Macos", "iOS"]: + self.cpp_info.libs = [f"bgfx-shared-lib{self.settings.build_type}"] + else: + self.cpp_info.libs = ["bgfx"] + + if self.options.shared: + self.cpp_info.defines.extend(["BGFX_SHARED_LIB_USE=1"]) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["gdi32"]) + if not is_msvc(self): + self.cpp_info.system_libs.extend(["comdlg32"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["X11", "GL"]) + elif self.settings.os in ["Macos", "iOS"]: + self.cpp_info.frameworks.extend(["CoreFoundation", "AppKit", "IOKit", "QuartzCore", "Metal"]) + if self.settings.os in ["Macos"]: + self.cpp_info.frameworks.extend(["OpenGL"]) + else: + self.cpp_info.frameworks.extend(["OpenGLES", "UIKit"]) + elif self.settings.os in ["Android"]: + self.cpp_info.system_libs.extend(["EGL", "GLESv2"]) + + self.cpp_info.set_property("cmake_file_name", "bgfx") + self.cpp_info.set_property("cmake_target_name", "bgfx::bgfx") + self.cpp_info.set_property("pkg_config_name", "bgfx") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "bgfx" + self.cpp_info.filenames["cmake_find_package_multi"] = "bgfx" + self.cpp_info.names["cmake_find_package"] = "bgfx" + self.cpp_info.names["cmake_find_package_multi"] = "bgfx" diff --git a/recipes/bgfx/all/test_package/CMakeLists.txt b/recipes/bgfx/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..2c968e2dda7184 --- /dev/null +++ b/recipes/bgfx/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(bgfx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +target_link_libraries(${PROJECT_NAME} bgfx::bgfx) diff --git a/recipes/bgfx/all/test_package/conanfile.py b/recipes/bgfx/all/test_package/conanfile.py new file mode 100644 index 00000000000000..4e578144a798ad --- /dev/null +++ b/recipes/bgfx/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/bgfx/all/test_package/test_package.cpp b/recipes/bgfx/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..630c14bc99ec9a --- /dev/null +++ b/recipes/bgfx/all/test_package/test_package.cpp @@ -0,0 +1,36 @@ +//Important: bgfx shared on windows only works with the C99 API, the C++ API is not exported +#include + +#if BGFX_SHARED_LIB_USE && (BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT) +#include +#else +#include +#endif + +int main() { +#if BGFX_SHARED_LIB_USE && (BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT) + bgfx_init_t init; + bgfx_init_ctor(&init); + init.type = bgfx_renderer_type::BGFX_RENDERER_TYPE_NOOP; + init.vendorId = BGFX_PCI_ID_NONE; + init.platformData.nwh = nullptr; + init.platformData.ndt = nullptr; + init.resolution.width = 0; + init.resolution.height = 0; + init.resolution.reset = BGFX_RESET_NONE; + bgfx_init(&init); + bgfx_shutdown(); + return 0; +#else + bgfx::Init init; + init.type = bgfx::RendererType::Noop; + init.vendorId = BGFX_PCI_ID_NONE; + init.platformData.nwh = nullptr; + init.platformData.ndt = nullptr; + init.resolution.width = 0; + init.resolution.height = 0; + init.resolution.reset = BGFX_RESET_NONE; + bgfx::init(init); + bgfx::shutdown(); +#endif +} diff --git a/recipes/bgfx/all/test_v1_package/CMakeLists.txt b/recipes/bgfx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..667976629550a3 --- /dev/null +++ b/recipes/bgfx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +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/bgfx/all/test_v1_package/conanfile.py b/recipes/bgfx/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..056e75eddb91cb --- /dev/null +++ b/recipes/bgfx/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class BimgTestPackageConan(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/bgfx/config.yml b/recipes/bgfx/config.yml new file mode 100644 index 00000000000000..0fa69d015c8447 --- /dev/null +++ b/recipes/bgfx/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230216": + folder: all diff --git a/recipes/bimg/all/test_package/conanfile.py b/recipes/bimg/all/test_package/conanfile.py index 4100c3ff4959c1..17cae798801223 100644 --- a/recipes/bimg/all/test_package/conanfile.py +++ b/recipes/bimg/all/test_package/conanfile.py @@ -1,10 +1,8 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.layout import cmake_layout -from conan.tools.cmake import CMake +from conan.tools.cmake import CMake, cmake_layout import os -required_conan_version = ">=1.50.0" class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" diff --git a/recipes/binutils/all/conandata.yml b/recipes/binutils/all/conandata.yml index 24c6d4be967982..92a40425b25909 100644 --- a/recipes/binutils/all/conandata.yml +++ b/recipes/binutils/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.41": + url: "https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.gz" + sha256: "48d00a8dc73aa7d2394a7dc069b96191d95e8de8f0da6dc91da5cce655c20e45" "2.40": url: "https://ftp.gnu.org/gnu/binutils/binutils-2.40.tar.gz" sha256: "d7f82c4047decf43a6f769ac32456a92ddb6932409a585c633cdd4e9df23d956" @@ -9,6 +12,10 @@ sources: url: "https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.gz" sha256: "c44968b97cd86499efbc4b4ab7d98471f673e5414c554ef54afa930062dbbfcb" patches: + "2.41": + - patch_file: "patches/2.41-0001-no-texinfo.patch" + patch_type: conan + patch_description: "disable texinfo" "2.40": - patch_file: "patches/2.40-0001-no-texinfo.patch" patch_type: conan diff --git a/recipes/binutils/all/conanfile.py b/recipes/binutils/all/conanfile.py index c5bddfc4331b08..1e04fbc03a87b2 100644 --- a/recipes/binutils/all/conanfile.py +++ b/recipes/binutils/all/conanfile.py @@ -138,7 +138,7 @@ def build_requirements(self): self.tool_requires("flex/2.6.4") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/binutils/all/patches/2.41-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.41-0001-no-texinfo.patch new file mode 100644 index 00000000000000..f6d719e75f24ea --- /dev/null +++ b/recipes/binutils/all/patches/2.41-0001-no-texinfo.patch @@ -0,0 +1,57 @@ +diff --git a/bfd/Makefile.in b/bfd/Makefile.in +index 4edfedee..47c7de53 100644 +--- a/bfd/Makefile.in ++++ b/bfd/Makefile.in +@@ -253,7 +253,7 @@ am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) + am__v_texidevnull_0 = > /dev/null + am__v_texidevnull_1 = + am__dirstamp = $(am__leading_dot)dirstamp +-INFO_DEPS = doc/bfd.info ++INFO_DEPS = + am__TEXINFO_TEX_DIR = $(srcdir) + DVIS = doc/bfd.dvi + PDFS = doc/bfd.pdf +@@ -2022,7 +2022,7 @@ distclean-tags: + check-am: all-am + check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +-all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) $(HEADERS) config.h ++all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h + installdirs: installdirs-recursive + installdirs-am: + for dir in "$(DESTDIR)$(bfdlibdir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(bfdincludedir)"; do \ +@@ -2089,8 +2089,7 @@ info: info-recursive + + info-am: $(INFO_DEPS) + +-install-data-am: install-bfdincludeHEADERS install-bfdlibLTLIBRARIES \ +- install-info-am ++install-data-am: install-bfdincludeHEADERS install-bfdlibLTLIBRARIES + + install-dvi: install-dvi-recursive + +diff --git a/gas/Makefile.in b/gas/Makefile.in +index 427f42df..535ad3f3 100644 +--- a/gas/Makefile.in ++++ b/gas/Makefile.in +@@ -1793,7 +1793,7 @@ distclean-DEJAGNU: + check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU + check: check-recursive +-all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h ++all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h + installdirs: installdirs-recursive + installdirs-am: + for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ +@@ -1869,7 +1869,7 @@ info: info-recursive + + info-am: $(INFO_DEPS) info-local + +-install-data-am: install-info-am install-man ++install-data-am: install-man + + install-dvi: install-dvi-recursive + +-- +2.34.1 + diff --git a/recipes/binutils/config.yml b/recipes/binutils/config.yml index 8d19abd9678f78..97d0d2ecab157c 100644 --- a/recipes/binutils/config.yml +++ b/recipes/binutils/config.yml @@ -1,4 +1,6 @@ versions: + "2.41": + folder: all "2.40": folder: all "2.38": diff --git a/recipes/bit-lite/all/conanfile.py b/recipes/bit-lite/all/conanfile.py index b0529cb7abe9ab..9057f4c627521d 100644 --- a/recipes/bit-lite/all/conanfile.py +++ b/recipes/bit-lite/all/conanfile.py @@ -14,18 +14,18 @@ class BitLiteConan(ConanFile): in a single-file header-only library.") topics = ("bit-lite", "bit", "manipulation", ) license = "BSL-1.0" + 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 @@ -38,9 +38,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "bit-lite") self.cpp_info.set_property("cmake_target_name", "nonstd::bit-lite") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "bit-lite" diff --git a/recipes/bitserializer/all/conandata.yml b/recipes/bitserializer/all/conandata.yml index 9b5b2264c84bba..1571f9c56284c3 100644 --- a/recipes/bitserializer/all/conandata.yml +++ b/recipes/bitserializer/all/conandata.yml @@ -1,10 +1,13 @@ sources: + "0.65": + url: "https://github.com/PavelKisliak/BitSerializer/archive/v0.65.tar.gz" + sha256: "b4d90f13dd424faebe3ee57ee0cb86ff304e893990afd259c6a29d1f8533b2ef" "0.50": - url: "https://bitbucket.com/Pavel_Kisliak/BitSerializer/get/0.50.tar.gz" - sha256: "dc000b6516db60337d5dd56fb1b60e29ce700bd2e6f4e609ca548b84d1f1dcee" + url: "https://github.com/PavelKisliak/BitSerializer/archive/0.50.tar.gz" + sha256: "0ba9d57f1546b9c9245a97ced0ed05ec9fb969e0542093da3a8bf9dcfe7f7a6d" "0.44": - url: "https://bitbucket.com/Pavel_Kisliak/BitSerializer/get/0.44.tar.gz" - sha256: "39ee0b038c9f38a012f96913c9738a68514d2e923431fbd83ddf3f454e02bc6c" + url: "https://github.com/PavelKisliak/BitSerializer/archive/0.44.tar.gz" + sha256: "ab0f74914d8120ee5e7a8ed10b0e9d83ed8135cd9e3356b5d0dcefc1cc88e47f" "0.10": - url: "https://bitbucket.com/Pavel_Kisliak/BitSerializer/get/0.10.tar.gz" - sha256: "d5ae211aead17acb91d9fb7df7e72a30202f39412159dd0b46fe0e5046b29f94" + url: "https://github.com/PavelKisliak/BitSerializer/archive/0.10.tar.gz" + sha256: "e9b898e453c66742a3c9d762c3e9f64f478fdb79680792b8725f953342fcc348" diff --git a/recipes/bitserializer/all/conanfile.py b/recipes/bitserializer/all/conanfile.py index e4f6815698c022..5acbd3659a4cb2 100644 --- a/recipes/bitserializer/all/conanfile.py +++ b/recipes/bitserializer/all/conanfile.py @@ -126,7 +126,7 @@ def generate(self): deps.generate() def _patch_sources(self): - if Version(self.version) >= "0.50": + if Version(self.version) >= "0.50" and self.options.with_rapidyaml: # Remove 'ryml' subdirectory from #include replace_in_file( self, os.path.join(self.source_folder, "include", "bitserializer", "rapidyaml_archive.h"), diff --git a/recipes/bitserializer/config.yml b/recipes/bitserializer/config.yml index 31b18058643087..7319ee088f9060 100644 --- a/recipes/bitserializer/config.yml +++ b/recipes/bitserializer/config.yml @@ -1,4 +1,6 @@ versions: + "0.65": + folder: "all" "0.50": folder: "all" "0.44": diff --git a/recipes/blaze/all/conanfile.py b/recipes/blaze/all/conanfile.py index a5d62edf842a50..576d4573728236 100644 --- a/recipes/blaze/all/conanfile.py +++ b/recipes/blaze/all/conanfile.py @@ -12,11 +12,15 @@ class BlazeConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://bitbucket.org/blaze-lib/blaze" description = "open-source, high-performance C++ math library for dense and sparse arithmetic" - topics = ("blaze", "math", "algebra", "linear algebra", "high-performance") + topics = ("math", "algebra", "linear algebra", "high-performance") license = "BSD-3-Clause" + 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() @@ -24,9 +28,6 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 14) - def layout(self): - basic_layout(self, src_folder="src") - def source(self): base_source_dir = os.path.join(self.source_folder, os.pardir) get(self, **self.conan_data["sources"][self.version], @@ -46,6 +47,4 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "blaze") self.cpp_info.set_property("cmake_target_name", "blaze::blaze") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/blend2d/all/conandata.yml b/recipes/blend2d/all/conandata.yml index a8918f809e2b06..06ef79b273e89a 100644 --- a/recipes/blend2d/all/conandata.yml +++ b/recipes/blend2d/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "0.10.4": + url: "https://blend2d.com/download/blend2d-0.10.4.tar.xz" + sha256: "6363e5c13c1c9e4709f949585a6af772ee13a16f75b0084f91b3918dece2fff3" + "0.10": + url: "https://blend2d.com/download/blend2d-0.10.tar.xz" + sha256: "eaed6cc5f1fc33061a99d70cf166836994d952f75762bfacb397ee388e13ccc9" "0.9": url: "https://blend2d.com/download/blend2d-0.9.tar.xz" sha256: "a70a2a57c67017afa1067a11807fef9808788c69b4012ba4d56a5c47a5ba87c3" @@ -12,6 +24,22 @@ 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" + patch_type: "conan" + "0.10.4": + - patch_file: "patches/0.10-0001-disable-embed-asmjit.patch" + patch_description: "use asmjit cci package" + patch_type: "conan" + "0.10": + - patch_file: "patches/0.10-0001-disable-embed-asmjit.patch" + patch_description: "use asmjit cci package" + patch_type: "conan" "0.9": - patch_file: "patches/0.9-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-0001-disable-embed-asmjit.patch b/recipes/blend2d/all/patches/0.10-0001-disable-embed-asmjit.patch new file mode 100644 index 00000000000000..29e6457e6c6f5a --- /dev/null +++ b/recipes/blend2d/all/patches/0.10-0001-disable-embed-asmjit.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 02507bc..8fa7dcf 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) +@@ -410,10 +410,9 @@ if (NOT BLEND2D_NO_JIT) + endif() + + set(ASMJIT_NO_FOREIGN TRUE) +- 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) ++ 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) 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 bf1e95c0dd1d18..219f4d22f536c2 100644 --- a/recipes/blend2d/config.yml +++ b/recipes/blend2d/config.yml @@ -1,4 +1,12 @@ versions: + "0.10.6": + folder: all + "0.10.5": + folder: all + "0.10.4": + folder: all + "0.10": + folder: all "0.9": folder: all "0.8": diff --git a/recipes/boolean-lite/all/conanfile.py b/recipes/boolean-lite/all/conanfile.py index 312d87af871640..d7d42e0dd8b35a 100644 --- a/recipes/boolean-lite/all/conanfile.py +++ b/recipes/boolean-lite/all/conanfile.py @@ -11,20 +11,20 @@ class BooleanLiteConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinmoene/boolean-lite" description = "boolean lite - A strong boolean type for C++98 and later in a single-file header-only library" - topics = ("boolean-lite", "strong bool", "cpp98/11/17") + topics = ("strong bool", "cpp98/11/17") license = "BSL-1.0" + 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 @@ -37,9 +37,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "boolean-lite") self.cpp_info.set_property("cmake_target_name", "nonstd::boolean-lite") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "boolean-lite" @@ -49,3 +47,5 @@ def package_info(self): self.cpp_info.components["booleanlite"].names["cmake_find_package"] = "boolean-lite" self.cpp_info.components["booleanlite"].names["cmake_find_package_multi"] = "boolean-lite" self.cpp_info.components["booleanlite"].set_property("cmake_target_name", "nonstd::boolean-lite") + self.cpp_info.components["booleanlite"].bindirs = [] + self.cpp_info.components["booleanlite"].libdirs = [] diff --git a/recipes/boolinq/all/conanfile.py b/recipes/boolinq/all/conanfile.py index b9eaad3c63e476..6aee6c7437722f 100644 --- a/recipes/boolinq/all/conanfile.py +++ b/recipes/boolinq/all/conanfile.py @@ -10,13 +10,17 @@ class BoolinqConan(ConanFile): name = "boolinq" description = "Super tiny C++11 single-file header-only LINQ template library" - topics = ("boolinq", "linq", "header-only") + topics = ("linq", "header-only") license = "MIT" homepage = "https://github.com/k06a/boolinq" url = "https://github.com/conan-io/conan-center-index" + 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() @@ -24,12 +28,8 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -40,6 +40,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/boost-ext-ut/all/conandata.yml b/recipes/boost-ext-ut/all/conandata.yml index 81ce02efd2b42d..f123657f3fbe37 100644 --- a/recipes/boost-ext-ut/all/conandata.yml +++ b/recipes/boost-ext-ut/all/conandata.yml @@ -1,12 +1,15 @@ sources: - "1.1.8": - url: "https://github.com/boost-ext/ut/archive/v1.1.8.tar.gz" - sha256: "3cc426dcf38397637e889efd9567b06d55dd23fb4e65cc0381eb8103a411d104" + "2.0.0": + url: "https://github.com/boost-ext/ut/archive/v2.0.0.tar.gz" + sha256: "8b5b11197d1308dfc1fe20efd6a656e0c833dbec2807e2292967f6e2f7c0420f" "1.1.9": url: "https://github.com/boost-ext/ut/archive/v1.1.9.tar.gz" sha256: "1a666513157905aa0e53a13fac602b5673dcafb04a869100a85cd3f000c2ed0d" -patches: "1.1.8": - - patch_file: "patches/license.patch" + url: "https://github.com/boost-ext/ut/archive/v1.1.8.tar.gz" + sha256: "3cc426dcf38397637e889efd9567b06d55dd23fb4e65cc0381eb8103a411d104" +patches: "1.1.9": - patch_file: "patches/1.1.9_cmake_project_version.patch" + "1.1.8": + - patch_file: "patches/license.patch" diff --git a/recipes/boost-ext-ut/all/conanfile.py b/recipes/boost-ext-ut/all/conanfile.py index bce6579a06de79..a73d7aef01853d 100644 --- a/recipes/boost-ext-ut/all/conanfile.py +++ b/recipes/boost-ext-ut/all/conanfile.py @@ -3,8 +3,9 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir -from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.microsoft import is_msvc from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration @@ -31,9 +32,11 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): return { - "apple-clang": "11" if Version(self.version) < "1.1.8" else "12", - "clang": "9", - "gcc": "9", + "apple-clang": "12" if Version(self.version) < "2.0.0" else "14", + "clang": "9" if Version(self.version) < "2.0.0" else "10", + "gcc": "9" if Version(self.version) < "2.0.0" else "10", + "msvc": "192", + "Visual Studio": "14", } def export_sources(self): @@ -54,9 +57,13 @@ def validate(self): if Version(self.version) <= "1.1.8" and is_msvc(self): raise ConanInvalidConfiguration(f"{self.ref} may not be built with MSVC. " "Please use at least version 1.1.9 with MSVC.") + 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 at least version {minimum_version} of the {self.settings.compiler} compiler." + ) if is_msvc(self): - check_min_vs(self, "192") if not self.options.get_safe("disable_module", True): self.output.warn("The 'disable_module' option must be enabled when using MSVC.") if not is_msvc(self): @@ -71,6 +78,10 @@ def validate(self): f"{self.ref} requires C++{self._minimum_cpp_standard} support. " f"The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") + def build_requirements(self): + if Version(self.version) >= "2.0.0": + self.tool_requires("cmake/[>=3.21 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -84,7 +95,9 @@ def generate(self): if disable_module: tc.cache_variables["BOOST_UT_DISABLE_MODULE"] = disable_module tc.generate() - + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + def build(self): apply_conandata_patches(self) cmake = CMake(self) diff --git a/recipes/boost-ext-ut/config.yml b/recipes/boost-ext-ut/config.yml index 968159344a038f..483296a860daad 100644 --- a/recipes/boost-ext-ut/config.yml +++ b/recipes/boost-ext-ut/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.0": + folder: "all" "1.1.8": folder: "all" "1.1.9": diff --git a/recipes/boost-leaf/all/conandata.yml b/recipes/boost-leaf/all/conandata.yml index 7ea0efeaa464d5..593e982ab983b3 100644 --- a/recipes/boost-leaf/all/conandata.yml +++ b/recipes/boost-leaf/all/conandata.yml @@ -5,3 +5,6 @@ sources: "1.82.0": url: "https://github.com/boostorg/leaf/archive/refs/tags/boost-1.82.0.tar.gz" sha256: "0917b22b60a2980bf5e33a393a8545dc6a4a7006c8ca8b78280d1cdb965d75f3" + "1.83.0": + url: "https://github.com/boostorg/leaf/archive/refs/tags/boost-1.83.0.tar.gz" + sha256: "559b16ac2cd287885104f6d2b93cc777f136d98e89e3b9915013561d893f5128" diff --git a/recipes/boost-leaf/config.yml b/recipes/boost-leaf/config.yml index e86af291ae99fb..7468e5b2998336 100644 --- a/recipes/boost-leaf/config.yml +++ b/recipes/boost-leaf/config.yml @@ -3,3 +3,5 @@ versions: folder: "all" "1.82.0": folder: "all" + "1.83.0": + folder: "all" diff --git a/recipes/boost/all/conandata.yml b/recipes/boost/all/conandata.yml index b2ef58c60ab75a..ee7228b61bc726 100644 --- a/recipes/boost/all/conandata.yml +++ b/recipes/boost/all/conandata.yml @@ -1,9 +1,14 @@ sources: + "1.83.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.bz2" + sha256: "6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e" "1.82.0": url: - "https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.bz2" - "https://sourceforge.net/projects/boost/files/boost/1.82.0/boost_1_82_0.tar.bz2" - sha256: a6e1ab9b0860e6a2881dd7b21fe9f737a095e5f33a3a874afc6a345228597ee6 + sha256: "a6e1ab9b0860e6a2881dd7b21fe9f737a095e5f33a3a874afc6a345228597ee6" "1.81.0": url: - "https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2" @@ -58,6 +63,10 @@ sources: url: "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2" sha256: "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee" patches: + "1.83.0": + - patch_file: "patches/1.82.0-locale-iconv-library-option.patch" + patch_description: "Optional flag to specify iconv from either libc of libiconv" + patch_type: "conan" "1.82.0": - patch_file: "patches/1.82.0-locale-iconv-library-option.patch" patch_description: "Optional flag to specify iconv from either libc of libiconv" diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index d845fca4e54daf..5bab9c6c7ebdd4 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -531,18 +531,18 @@ def _with_stacktrace_backtrace(self): def requirements(self): if self._with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self._with_bzip2: self.requires("bzip2/1.0.8") if self._with_lzma: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.4") if self._with_zstd: self.requires("zstd/1.5.5") if self._with_stacktrace_backtrace: self.requires("libbacktrace/cci.20210118", transitive_headers=True, transitive_libs=True) if self._with_icu: - self.requires("icu/72.1") + self.requires("icu/73.2") if self._with_iconv: self.requires("libiconv/1.17") @@ -561,7 +561,7 @@ def package_id(self): def build_requirements(self): if not self.options.header_only: - self.tool_requires("b2/4.9.6") + self.tool_requires("b2/4.10.1") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -1444,6 +1444,7 @@ def package_info(self): # - Use '_libboost' component to attach extra system_libs, ... self.cpp_info.components["headers"].libs = [] + self.cpp_info.components["headers"].libdirs = [] self.cpp_info.components["headers"].set_property("cmake_target_name", "Boost::headers") self.cpp_info.components["headers"].names["cmake_find_package"] = "headers" self.cpp_info.components["headers"].names["cmake_find_package_multi"] = "headers" @@ -1490,6 +1491,8 @@ def package_info(self): self.cpp_info.components["_boost_cmake"].set_property("cmake_target_name", "Boost::boost") self.cpp_info.components["_boost_cmake"].names["cmake_find_package"] = "boost" self.cpp_info.components["_boost_cmake"].names["cmake_find_package_multi"] = "boost" + if self.options.header_only: + self.cpp_info.components["_boost_cmake"].libdirs = [] if not self.options.header_only: self.cpp_info.components["_libboost"].requires = ["headers"] diff --git a/recipes/boost/all/dependencies/dependencies-1.83.0.yml b/recipes/boost/all/dependencies/dependencies-1.83.0.yml new file mode 100644 index 00000000000000..7200adb04009d3 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.83.0.yml @@ -0,0 +1,278 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: [] + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + url: + - system + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + url: + - boost_url + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.83.0 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/boost/config.yml b/recipes/boost/config.yml index 38ecaf5c73d635..f81f4b5e8e72b0 100644 --- a/recipes/boost/config.yml +++ b/recipes/boost/config.yml @@ -1,4 +1,6 @@ versions: + "1.83.0": + folder: all "1.82.0": folder: all "1.81.0": diff --git a/recipes/boostdep/all/CMakeLists.txt b/recipes/boostdep/all/CMakeLists.txt deleted file mode 100644 index 5e53cb70bdf381..00000000000000 --- a/recipes/boostdep/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(source_subfolder) diff --git a/recipes/boostdep/all/conandata.yml b/recipes/boostdep/all/conandata.yml index 3831a32bc89c95..943785c9b1d4a5 100644 --- a/recipes/boostdep/all/conandata.yml +++ b/recipes/boostdep/all/conandata.yml @@ -1,6 +1,11 @@ sources: + 1.82.0: + - url: "https://github.com/boostorg/boostdep/archive/refs/tags/boost-1.82.0.tar.gz" + sha256: "b3bffa292709ad74bf2fa50831890161ad7b9ef33f9f4ffa83d474da4482a452" + - url: "https://www.boost.org/LICENSE_1_0.txt" + sha256: "c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566" 1.75.0: - url: "https://github.com/boostorg/boostdep/archive/boost-1.75.0.tar.gz" sha256: "7eecd835eb5b0fd602ff3615a6b663b45917689386d11073d961b86710f428af" - - url: "http://www.boost.org/LICENSE_1_0.txt" + - url: "https://www.boost.org/LICENSE_1_0.txt" sha256: "c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566" diff --git a/recipes/boostdep/all/conanfile.py b/recipes/boostdep/all/conanfile.py index 01a84ccc90d698..bd8dd57eb93dc9 100644 --- a/recipes/boostdep/all/conanfile.py +++ b/recipes/boostdep/all/conanfile.py @@ -1,58 +1,68 @@ -from conans import CMake, ConanFile, tools import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, download, get + +required_conan_version = ">=1.52.0" + class BoostDepConan(ConanFile): name = "boostdep" - settings = "os", "arch", "compiler", "build_type" description = "A tool to create Boost module dependency reports" + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/boostorg/boostdep" - license = "BSL-1.0" - topics = ("conan", "boostdep", "dependency", "tree") - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" + topics = ("dependency", "tree") - _cmake = None + package_type = "application" + settings = "os", "arch", "compiler", "build_type" - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) - @property - def _build_subfolder(self): - return "build_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.75.0") + self.requires(f"boost/{self.version}") def package_id(self): del self.info.settings.compiler def source(self): - tools.get(**self.conan_data["sources"][self.version][0]) - os.rename("boostdep-boost-{}".format(self.version), self._source_subfolder) - license_info = self.conan_data["sources"][self.version][1] - tools.download(filename=os.path.basename(license_info["url"]), **license_info) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + sources_info, license_info = self.conan_data["sources"][self.version] + get(self, **sources_info, strip_root=True) + download(self, **license_info, filename=os.path.basename(license_info["url"])) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared + tc.generate() + 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*", dst="licenses") - 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): - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) - self.deps_env_info.PATH.append(bin_path) + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + # TODO: Legacy, to be removed on Conan 2.0 + bin_folder = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_folder) diff --git a/recipes/boostdep/all/test_package/conanfile.py b/recipes/boostdep/all/test_package/conanfile.py index 190cc18502e119..2b15ef763d620a 100644 --- a/recipes/boostdep/all/test_package/conanfile.py +++ b/recipes/boostdep/all/test_package/conanfile.py @@ -1,17 +1,20 @@ -from conans import ConanFile, tools -import os +from conan import ConanFile +from conan.tools.env import Environment +from conan.tools.files import mkdir, save -class DefaultNameConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" - def build(self): - pass + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - if tools.cross_building(self.settings): - return - tools.mkdir("libs") - tools.save("Jamroot", "") - with tools.environment_append({"BOOST_ROOT": self.build_folder}): - self.run("boostdep --list-modules", run_environment=True) + mkdir(self, "libs") + save(self, "Jamroot", "") + env = Environment() + env.define("BOOST_ROOT", self.build_folder) + with env.vars(self).apply(): + self.run("boostdep --list-modules") diff --git a/recipes/boostdep/all/test_v1_package/conanfile.py b/recipes/boostdep/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..190cc18502e119 --- /dev/null +++ b/recipes/boostdep/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, tools +import os + + +class DefaultNameConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + + def build(self): + pass + + def test(self): + if tools.cross_building(self.settings): + return + tools.mkdir("libs") + tools.save("Jamroot", "") + with tools.environment_append({"BOOST_ROOT": self.build_folder}): + self.run("boostdep --list-modules", run_environment=True) diff --git a/recipes/boostdep/config.yml b/recipes/boostdep/config.yml index 640761587c2aee..1cbe5a69a954fc 100644 --- a/recipes/boostdep/config.yml +++ b/recipes/boostdep/config.yml @@ -1,3 +1,5 @@ versions: + "1.82.0": + folder: "all" "1.75.0": folder: "all" diff --git a/recipes/brigand/all/conanfile.py b/recipes/brigand/all/conanfile.py index d205988b4830f0..21dde9eb4313f6 100644 --- a/recipes/brigand/all/conanfile.py +++ b/recipes/brigand/all/conanfile.py @@ -14,7 +14,7 @@ class BrigandConan(ConanFile): topics = ("meta-programming", "boost", "runtime", "header-only") homepage = "https://github.com/edouarda/brigand" license = "BSL-1.0" - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_boost": [True, False], @@ -25,9 +25,11 @@ class BrigandConan(ConanFile): no_copy_source = True + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): if self.options.with_boost: - # TODO: add transitive_headers=True & bump required_conan_version to >=1.52.0 self.requires("boost/1.79.0") def package_id(self): @@ -37,12 +39,8 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -55,9 +53,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("pkg_config_name", "libbrigand") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] if self.options.with_boost: self.cpp_info.requires = ["boost::headers"] else: diff --git a/recipes/brotli/all/conandata.yml b/recipes/brotli/all/conandata.yml index c664dae35678ec..35c9587456f430 100644 --- a/recipes/brotli/all/conandata.yml +++ b/recipes/brotli/all/conandata.yml @@ -1,12 +1,23 @@ sources: + "1.1.0": + url: "https://github.com/google/brotli/archive/v1.1.0.tar.gz" + sha256: "e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff" "1.0.9": - url: https://github.com/google/brotli/archive/v1.0.9.tar.gz - sha256: f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46 + url: "https://github.com/google/brotli/archive/v1.0.9.tar.gz" + sha256: "f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46" "1.0.7": - url: https://github.com/google/brotli/archive/v1.0.7.tar.gz - sha256: 4c61bfb0faca87219ea587326c467b95acb25555b53d1a421ffa3c8a9296ee2c + url: "https://github.com/google/brotli/archive/v1.0.7.tar.gz" + sha256: "4c61bfb0faca87219ea587326c467b95acb25555b53d1a421ffa3c8a9296ee2c" patches: + "1.1.0": + - patch_file: "patches/1.1.0-target-props.patch" + patch_description: "add target properties, disable command build" + patch_type: "conan" "1.0.9": - - patch_file: "patches/0002-target-props.patch" + - patch_file: "patches/1.0.9-target-props.patch" + patch_description: "add target properties, disable command build, separate shared and static build" + patch_type: "conan" "1.0.7": - - patch_file: "patches/0001-target-props.patch" + - patch_file: "patches/1.0.7-target-props.patch" + patch_description: "add target properties, disable command build, separate shared and static build" + patch_type: "conan" diff --git a/recipes/brotli/all/conanfile.py b/recipes/brotli/all/conanfile.py index 5ba9ac6bd939f9..47e559afcc649d 100644 --- a/recipes/brotli/all/conanfile.py +++ b/recipes/brotli/all/conanfile.py @@ -1,6 +1,7 @@ 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 +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -9,11 +10,10 @@ class BrotliConan(ConanFile): name = "brotli" description = "Brotli compression format" - topics = ("brotli", "compression") + license = "MIT", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/brotli" - license = "MIT", - + topics = ("brotli", "compression") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -78,8 +78,9 @@ def generate(self): tc.preprocessor_definitions["BROTLI_DEBUG"] = 1 if self.options.enable_log: tc.preprocessor_definitions["BROTLI_ENABLE_LOG"] = 1 - # To install relocatable shared libs on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "1.1.0": + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() def build(self): @@ -125,6 +126,6 @@ def package_info(self): def _get_decorated_lib(self, name): libname = name - if not self.options.shared: + if Version(self.version) < "1.1.0" and not self.options.shared: libname += "-static" return libname diff --git a/recipes/brotli/all/patches/0001-target-props.patch b/recipes/brotli/all/patches/1.0.7-target-props.patch similarity index 100% rename from recipes/brotli/all/patches/0001-target-props.patch rename to recipes/brotli/all/patches/1.0.7-target-props.patch diff --git a/recipes/brotli/all/patches/0002-target-props.patch b/recipes/brotli/all/patches/1.0.9-target-props.patch similarity index 100% rename from recipes/brotli/all/patches/0002-target-props.patch rename to recipes/brotli/all/patches/1.0.9-target-props.patch diff --git a/recipes/brotli/all/patches/1.1.0-target-props.patch b/recipes/brotli/all/patches/1.1.0-target-props.patch new file mode 100644 index 00000000000000..0c9b697569cec8 --- /dev/null +++ b/recipes/brotli/all/patches/1.1.0-target-props.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -113,7 +113,6 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + add_definitions(-DOS_MACOSX) + set(CMAKE_MACOS_RPATH TRUE) +- set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + if(BROTLI_EMSCRIPTEN) +@@ -171,14 +170,10 @@ endif() + # Build the brotli executable + add_executable(brotli c/tools/brotli.c) + target_link_libraries(brotli ${BROTLI_LIBRARIES}) ++set_target_properties(brotli PROPERTIES EXCLUDE_FROM_ALL ON EXCLUDE_FROM_DEFAULT ON) + + # Installation + if(NOT BROTLI_BUNDLED_MODE) +- install( +- TARGETS brotli +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" +- ) +- + install( + TARGETS ${BROTLI_LIBRARIES_CORE} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" diff --git a/recipes/brotli/all/test_package/CMakeLists.txt b/recipes/brotli/all/test_package/CMakeLists.txt index 8339b11b6d1f4a..00f09fcd401222 100644 --- a/recipes/brotli/all/test_package/CMakeLists.txt +++ b/recipes/brotli/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES CXX) find_package(brotli REQUIRED CONFIG) diff --git a/recipes/brotli/config.yml b/recipes/brotli/config.yml index 39d54f0009ed08..f4b59633d9f839 100644 --- a/recipes/brotli/config.yml +++ b/recipes/brotli/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "1.0.9": folder: all "1.0.7": diff --git a/recipes/brunsli/all/conandata.yml b/recipes/brunsli/all/conandata.yml new file mode 100644 index 00000000000000..8a8c640caa1152 --- /dev/null +++ b/recipes/brunsli/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "cci.20231024": + url: "https://github.com/google/brunsli/archive/0b7bd7b47d1f8fd8682d4818180e0ab42f26d4c3.tar.gz" + sha256: "b4ca17e1bbb3a6cae6b840d78422490b75733b4165e5ba066302154d971ec32e" + "0.1": + url: "https://github.com/google/brunsli/archive/refs/tags/v0.1.tar.gz" + sha256: "62762dc740f9fcc9706449c078f12c2a366416486d2882be50a9f201f99ac0bc" +patches: + "cci.20231024": + - patch_file: "patches/cci.20230730/001-cmake-use-conan-deps.patch" + patch_description: "Use Conan dependencies in CMake" + patch_type: "conan" + - patch_file: "patches/cci.20230730/002-fix-shared-windows-build.patch" + patch_description: "Fix shared Windows build, do not build executables" + patch_type: "conan" + "0.1": + - patch_file: "patches/0.1/001-cmake-use-conan-deps.patch" + patch_description: "Use Conan dependencies in CMake" + patch_type: "conan" + - patch_file: "patches/0.1/002-fix-shared-windows-build.patch" + patch_description: "Fix shared Windows build, do not build executables" + patch_type: "conan" diff --git a/recipes/brunsli/all/conanfile.py b/recipes/brunsli/all/conanfile.py new file mode 100644 index 00000000000000..d437851b72dc54 --- /dev/null +++ b/recipes/brunsli/all/conanfile.py @@ -0,0 +1,100 @@ +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 apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file, save + +required_conan_version = ">=1.53.0" + +class PackageConan(ConanFile): + name = "brunsli" + description = "Practical JPEG Repacker" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/brunsli" + topics = ("jpeg", "repacker", "codec", "brotli", "wasm") + + 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): + 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") + self.options["brotli"].shared = False + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("brotli/1.0.9", transitive_libs=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if self.dependencies["brotli"].options.shared: + raise ConanInvalidConfiguration("brotli must be built as a static library") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + # TODO: add WASM support + tc.cache_variables["BRUNSLI_EMSCRIPTEN"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("brotli::brotlidec", "cmake_target_name", "brotlidec-static") + deps.set_property("brotli::brotlienc", "cmake_target_name", "brotlienc-static") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Allow Conan to control the linkage type of the output libraries + if not self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "brunsli.cmake"), " SHARED", "") + save(self, os.path.join(self.source_folder, "brunsli.cmake"), + "\ninstall(TARGETS brunslicommon-static brunslidec-static brunslienc-static)", + append=True) + # Fix DLL installation + replace_in_file(self, os.path.join(self.source_folder, "brunsli.cmake"), + 'LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"', + 'LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ' + 'RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"') + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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.components["brunslidec-c"].libs = ["brunslidec-c"] + self.cpp_info.components["brunslienc-c"].libs = ["brunslienc-c"] + if not self.options.shared: + self.cpp_info.components["brunslidec-c"].libs += ["brunslicommon-static", "brunslidec-static"] + self.cpp_info.components["brunslienc-c"].libs += ["brunslicommon-static", "brunslienc-static"] diff --git a/recipes/brunsli/all/patches/0.1/001-cmake-use-conan-deps.patch b/recipes/brunsli/all/patches/0.1/001-cmake-use-conan-deps.patch new file mode 100644 index 00000000000000..addcf9825b6bab --- /dev/null +++ b/recipes/brunsli/all/patches/0.1/001-cmake-use-conan-deps.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -26,7 +26,7 @@ + set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD_REQUIRED YES) + +-add_subdirectory(third_party) ++find_package(Brotli REQUIRED CONFIG) + + # The Brunsli library definition. + include(brunsli.cmake) diff --git a/recipes/brunsli/all/patches/0.1/002-fix-shared-windows-build.patch b/recipes/brunsli/all/patches/0.1/002-fix-shared-windows-build.patch new file mode 100644 index 00000000000000..d0055137f9a836 --- /dev/null +++ b/recipes/brunsli/all/patches/0.1/002-fix-shared-windows-build.patch @@ -0,0 +1,43 @@ +Linked static libraries do not export symbols on Windows, +so build the shared libraries from scratch instead. +--- brunsli.cmake ++++ brunsli.cmake +@@ -74,13 +74,21 @@ + + if(NOT BRUNSLI_EMSCRIPTEN) + add_library(brunslidec-c SHARED ++ ${BRUNSLI_COMMON_SOURCES} ++ ${BRUNSLI_COMMON_HEADERS} ++ ${BRUNSLI_DEC_SOURCES} ++ ${BRUNSLI_DEC_HEADERS} + c/dec/decode.cc + ) +-target_link_libraries(brunslidec-c PRIVATE brunslidec-static) ++target_link_libraries(brunslidec-c PRIVATE brotlidec-static) + add_library(brunslienc-c SHARED ++ ${BRUNSLI_COMMON_SOURCES} ++ ${BRUNSLI_COMMON_HEADERS} ++ ${BRUNSLI_ENC_SOURCES} ++ ${BRUNSLI_ENC_HEADERS} + c/enc/encode.cc + ) +-target_link_libraries(brunslienc-c PRIVATE brunslienc-static) ++target_link_libraries(brunslienc-c PRIVATE brotlienc-static) + list(APPEND BRUNSLI_LIBRARIES brunslidec-c brunslienc-c) + endif() # BRUNSLI_EMSCRIPTEN + +@@ -95,14 +103,6 @@ + endforeach() + + if(NOT BRUNSLI_EMSCRIPTEN) +-add_executable(cbrunsli c/tools/cbrunsli.cc) +-target_link_libraries(cbrunsli PRIVATE +- brunslienc-static +-) +-add_executable(dbrunsli c/tools/dbrunsli.cc) +-target_link_libraries(dbrunsli PRIVATE +- brunslidec-static +-) + else() # BRUNSLI_EMSCRIPTEN + set(WASM_MODULES brunslicodec-wasm brunslidec-wasm brunslienc-wasm) + foreach(module IN LISTS WASM_MODULES) diff --git a/recipes/brunsli/all/patches/cci.20230730/001-cmake-use-conan-deps.patch b/recipes/brunsli/all/patches/cci.20230730/001-cmake-use-conan-deps.patch new file mode 100644 index 00000000000000..b78a5ce6624901 --- /dev/null +++ b/recipes/brunsli/all/patches/cci.20230730/001-cmake-use-conan-deps.patch @@ -0,0 +1,31 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -25,27 +25,7 @@ + set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD_REQUIRED YES) + +-include(FetchContent) +- +-# Add GTest +-FetchContent_Declare( +- GTest +- GIT_REPOSITORY https://github.com/google/googletest +- GIT_TAG e2239ee6043f73722e7aa812a459f54a28552929 # v1.11.0 +-) +-# For Windows: Prevent overriding the parent project's compiler/linker settings +-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +-set(BUILD_GMOCK OFF CACHE INTERNAL "") +-FetchContent_MakeAvailable(GTest) +- +-# Add Brotli +-FetchContent_Declare( +- Brotli +- GIT_REPOSITORY https://github.com/google/brotli +- GIT_TAG e61745a6b7add50d380cfd7d3883dd6c62fc2c71 # v1.0.9 +-) +-set(BROTLI_DISABLE_TESTS ON CACHE INTERNAL "") +-FetchContent_MakeAvailable(Brotli) ++find_package(Brotli REQUIRED CONFIG) + + include(CTest) + diff --git a/recipes/brunsli/all/patches/cci.20230730/002-fix-shared-windows-build.patch b/recipes/brunsli/all/patches/cci.20230730/002-fix-shared-windows-build.patch new file mode 100644 index 00000000000000..cec4a0e274d892 --- /dev/null +++ b/recipes/brunsli/all/patches/cci.20230730/002-fix-shared-windows-build.patch @@ -0,0 +1,72 @@ +Linked static libraries do not export symbols on Windows, +so build the shared libraries from scratch instead. +--- brunsli.cmake ++++ brunsli.cmake +@@ -77,13 +77,21 @@ + + if(NOT BRUNSLI_EMSCRIPTEN) + add_library(brunslidec-c SHARED ++ ${BRUNSLI_COMMON_SOURCES} ++ ${BRUNSLI_COMMON_HEADERS} ++ ${BRUNSLI_DEC_SOURCES} ++ ${BRUNSLI_DEC_HEADERS} + c/dec/decode.cc + ) +-target_link_libraries(brunslidec-c PRIVATE brunslidec-static) ++target_link_libraries(brunslidec-c PRIVATE brotlidec-static) + add_library(brunslienc-c SHARED ++ ${BRUNSLI_COMMON_SOURCES} ++ ${BRUNSLI_COMMON_HEADERS} ++ ${BRUNSLI_ENC_SOURCES} ++ ${BRUNSLI_ENC_HEADERS} + c/enc/encode.cc + ) +-target_link_libraries(brunslienc-c PRIVATE brunslienc-static) ++target_link_libraries(brunslienc-c PRIVATE brotlienc-static) + list(APPEND BRUNSLI_LIBRARIES brunslidec-c brunslienc-c) + endif() # BRUNSLI_EMSCRIPTEN + +@@ -95,14 +103,6 @@ + set_property(TARGET ${lib} PROPERTY POSITION_INDEPENDENT_CODE ON) + endforeach() + +-add_executable(cbrunsli c/tools/cbrunsli.cc) +-target_link_libraries(cbrunsli PRIVATE +- brunslienc-static +-) +-add_executable(dbrunsli c/tools/dbrunsli.cc) +-target_link_libraries(dbrunsli PRIVATE +- brunslidec-static +-) + if(BRUNSLI_EMSCRIPTEN) + set(WASM_MODULES brunslicodec-wasm brunslidec-wasm brunslienc-wasm) + foreach(module IN LISTS WASM_MODULES) +@@ -121,14 +121,6 @@ + ${WASM_BASE_FLAGS} \ + -s MODULARIZE=1 \ + -s FILESYSTEM=0 \ +-") +-set_target_properties(cbrunsli PROPERTIES LINK_FLAGS "\ +- ${WASM_BASE_FLAGS} \ +- -s NODERAWFS=1 \ +-") +-set_target_properties(dbrunsli PROPERTIES LINK_FLAGS "\ +- ${WASM_BASE_FLAGS} \ +- -s NODERAWFS=1 \ + ") + set(WASM_COMMON_EXPORT "\"_malloc\",\"_free\"") + set(WASM_DEC_EXPORT "\"_BrunsliToJpeg\",\"_GetJpegData\",\"_GetJpegLength\",\"_FreeJpeg\",\"_BrunsliDecoderInit\",\"_BrunsliDecoderProcess\",\"_BrunsliDecoderCleanup\"") +@@ -163,13 +155,6 @@ + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) + endif() # BRUNSLI_EMSCRIPTEN +- +-# Gather artifacts in a single directory for easier uploading. +-set_target_properties(cbrunsli dbrunsli ${BRUNSLI_LIBRARIES} PROPERTIES +- ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/artifacts" +- LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/artifacts" +- RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/artifacts" +-) + + if (${BUILD_TESTING}) + diff --git a/recipes/brunsli/all/test_package/CMakeLists.txt b/recipes/brunsli/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..f9b1ede7bb029a --- /dev/null +++ b/recipes/brunsli/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(brunsli REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE brunsli::brunsli) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/brunsli/all/test_package/conanfile.py b/recipes/brunsli/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/brunsli/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/brunsli/all/test_package/test_package.cpp b/recipes/brunsli/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..6be850a9c3ae98 --- /dev/null +++ b/recipes/brunsli/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() { + brunsli::JPEGData jpg; + const size_t input_size = 100; + const uint8_t input_data[input_size] = {}; + bool ok = brunsli::ReadJpeg(input_data, input_size, brunsli::JPEG_READ_ALL, &jpg); +} diff --git a/recipes/brunsli/config.yml b/recipes/brunsli/config.yml new file mode 100644 index 00000000000000..579cbcab9768e6 --- /dev/null +++ b/recipes/brunsli/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20231024": + folder: all + "0.1": + folder: all diff --git a/recipes/bshoshany-thread-pool/all/conanfile.py b/recipes/bshoshany-thread-pool/all/conanfile.py index 29f20f3aa9b914..3da6e90d6c057e 100644 --- a/recipes/bshoshany-thread-pool/all/conanfile.py +++ b/recipes/bshoshany-thread-pool/all/conanfile.py @@ -4,20 +4,22 @@ 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.43.0" class BShoshanyThreadPoolConan(ConanFile): + name = "bshoshany-thread-pool" description = "BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library" homepage = "https://github.com/bshoshany/thread-pool" license = "MIT" - name = "bshoshany-thread-pool" - no_copy_source = True - settings = "arch", "build_type", "compiler", "os" topics = ("concurrency", "cpp17", "header-only", "library", "multi-threading", "parallel-computing", "thread-pool", "threads") url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "arch", "build_type", "compiler", "os" + no_copy_source = True @property def _minimum_compilers_version(self): @@ -33,27 +35,12 @@ def _minimum_compilers_version(self): def _min_cppstd(self): return "17" - @property - def _source_subfolder(self): - return "source_subfolder" - - def package(self): - copy(self, "*.hpp", self.source_folder, os.path.join(self.package_folder, "include")) - copy(self, "*.hpp", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) - copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() - def package_info(self): - if self.settings.os == "Linux": - self.cpp_info.system_libs = ["pthread"] - self.cpp_info.names["cmake_find_package"] = "bshoshany-thread-pool" - self.cpp_info.names["cmake_find_package_multi"] = "bshoshany-thread-pool" - - def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def validate(self): if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._min_cppstd) @@ -63,3 +50,19 @@ def validate(self): 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 package(self): + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + if Version(self.version) < "3.5.0": + copy(self, "*.hpp", self.source_folder, os.path.join(self.package_folder, "include")) + else: + copy(self, "*.hpp", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/bshoshany-thread-pool/all/test_package/CMakeLists.txt b/recipes/bshoshany-thread-pool/all/test_package/CMakeLists.txt index ef975b6d66e035..28d8252a78110a 100644 --- a/recipes/bshoshany-thread-pool/all/test_package/CMakeLists.txt +++ b/recipes/bshoshany-thread-pool/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) - find_package(bshoshany-thread-pool REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} bshoshany-thread-pool::bshoshany-thread-pool) +target_link_libraries(${PROJECT_NAME} PRIVATE bshoshany-thread-pool::bshoshany-thread-pool) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/bshoshany-thread-pool/all/test_package/conanfile.py b/recipes/bshoshany-thread-pool/all/test_package/conanfile.py index a154ce8fd694ec..b16654fc86e82e 100644 --- a/recipes/bshoshany-thread-pool/all/test_package/conanfile.py +++ b/recipes/bshoshany-thread-pool/all/test_package/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.cmake import CMake, cmake_layout -class BshoshanyThreadPoolTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" diff --git a/recipes/bshoshany-thread-pool/all/test_v1_package/CMakeLists.txt b/recipes/bshoshany-thread-pool/all/test_v1_package/CMakeLists.txt index 0ad87e39bce01c..be00a8c7f57c71 100644 --- a/recipes/bshoshany-thread-pool/all/test_v1_package/CMakeLists.txt +++ b/recipes/bshoshany-thread-pool/all/test_v1_package/CMakeLists.txt @@ -1,14 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) +cmake_minimum_required(VERSION 3.8) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(bshoshany-thread-pool REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} bshoshany-thread-pool::bshoshany-thread-pool) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/bshoshany-thread-pool/all/test_v1_package/conanfile.py b/recipes/bshoshany-thread-pool/all/test_v1_package/conanfile.py index e3619171241a69..2fc6ad2a6a2ba9 100644 --- a/recipes/bshoshany-thread-pool/all/test_v1_package/conanfile.py +++ b/recipes/bshoshany-thread-pool/all/test_v1_package/conanfile.py @@ -3,7 +3,7 @@ from conans import CMake, ConanFile, tools -class BshoshanyThreadPoolTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake", "cmake_find_package_multi" diff --git a/recipes/btyacc/all/CMakeLists.txt b/recipes/btyacc/all/CMakeLists.txt deleted file mode 100644 index b598faf845d1a3..00000000000000 --- a/recipes/btyacc/all/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.2) - -project(btyacc_wrapper C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/btyacc/all/conanfile.py b/recipes/btyacc/all/conanfile.py index 392605b08cf53b..d34d04d75a89b5 100644 --- a/recipes/btyacc/all/conanfile.py +++ b/recipes/btyacc/all/conanfile.py @@ -1,10 +1,11 @@ -import functools import os import textwrap -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class BtyaccConan(ConanFile): @@ -14,6 +15,7 @@ class BtyaccConan(ConanFile): description = "Backtracking yacc" topics = "yacc", "parser" license = "Unlicense" + package_type = "application" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -21,60 +23,54 @@ class BtyaccConan(ConanFile): default_options = { "fPIC": True, } - generators = "cmake" - exports_sources = "CMakeLists.txt" - no_copy_source = True - - @property - def _source_subfolder(self): - return "source_subfolder" def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") 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.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - self._configure_cmake().build() + cmake = CMake(self) + cmake.configure() + cmake.build() @property - def _variables(self): - return os.path.join("bin", "conan-official-btyacc-variables.cmake") + def _cmake_variables(self): + return os.path.join("bin", "cmake", f"conan-official-{self.name}-variables.cmake") def package(self): - self.copy("README", "licenses", self._source_subfolder) - self.copy("README.BYACC", "licenses", self._source_subfolder) - self._configure_cmake().install() - tools.rmdir(os.path.join(self.package_folder, "share")) - variables = os.path.join(self.package_folder, self._variables) + copy(self, "README*", 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, "share")) content = textwrap.dedent("""\ - set(BTYACC_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/btyacc") + set(BTYACC_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/../btyacc") if(NOT EXISTS "${BTYACC_EXECUTABLE}") - set(BTYACC_EXECUTABLE "${BTYACC_EXECUTABLE}.exe") + set(BTYACC_EXECUTABLE "${BTYACC_EXECUTABLE}.exe") endif() """) - tools.save(variables, content) + save(self, os.path.join(self.package_folder, self._cmake_variables), content) def package_info(self): - bindir = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bindir}") - self.env_info.PATH.append(bindir) - self.cpp_info.build_modules["cmake"] = [self._variables] - self.cpp_info.build_modules["cmake_find_package"] = [self._variables] - self.cpp_info.build_modules["cmake_find_package_multi"] = \ - [self._variables] - self.cpp_info.builddirs = ["bin"] + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_build_modules", [self._cmake_variables]) + + # TODO: to remove after conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.cpp_info.build_modules["cmake"] = [self._cmake_variables] + self.cpp_info.build_modules["cmake_find_package"] = [self._cmake_variables] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._cmake_variables] diff --git a/recipes/btyacc/all/test_package/CMakeLists.txt b/recipes/btyacc/all/test_package/CMakeLists.txt index 80f7ff14861ac7..d2daa6eb3e6527 100644 --- a/recipes/btyacc/all/test_package/CMakeLists.txt +++ b/recipes/btyacc/all/test_package/CMakeLists.txt @@ -1,13 +1,11 @@ cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) -project(test_package C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS KEEP_RPATHS) +enable_testing() find_package(btyacc REQUIRED CONFIG) if(NOT DEFINED BTYACC_EXECUTABLE) - message(FATAL_ERROR "BTYACC_EXECUTABLE is not defined") + message(FATAL_ERROR "BTYACC_EXECUTABLE is not defined") endif() set(bin "${PROJECT_BINARY_DIR}") @@ -24,7 +22,6 @@ add_custom_command( add_executable(test_package "${bin}/main.c") -enable_testing() add_test( NAME main COMMAND "${CMAKE_COMMAND}" -E echo "(())()(())" | test_package diff --git a/recipes/btyacc/all/test_package/conanfile.py b/recipes/btyacc/all/test_package/conanfile.py index 84bba6ad911d3b..fe825a55c4c797 100644 --- a/recipes/btyacc/all/test_package/conanfile.py +++ b/recipes/btyacc/all/test_package/conanfile.py @@ -1,23 +1,48 @@ -import functools -import os - -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeDeps, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + # TODO: Only keep logic under if hasattr(self, "settings_build") after conan v2. + # Indeed, v1 pipeline of c3i uses 1 profile, which can't work with + # build_context_activated & build_context_build_modules of CMakeDeps + + def requirements(self): + if not hasattr(self, "settings_build"): + self.requires(self.tested_reference_str) + + def build_requirements(self): + if hasattr(self, "settings_build"): + self.tool_requires(self.tested_reference_str) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def generate(self): + if hasattr(self, "settings_build"): + VirtualBuildEnv(self).generate() + deps = CMakeDeps(self) + deps.build_context_activated = ["btyacc"] + deps.build_context_build_modules = ["btyacc"] + deps.generate() + else: + if can_run(self): + VirtualRunEnv(self).generate(scope="build") + deps = CMakeDeps(self) + deps.generate() def build(self): - if not tools.cross_building(self): - self._configure_cmake().build() + if hasattr(self, "settings_build") or can_run(self): + cmake = CMake(self) + cmake.configure() + cmake.build() def test(self): - if not tools.cross_building(self): - self._configure_cmake().test() + if can_run(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun") diff --git a/recipes/btyacc/all/test_v1_package/CMakeLists.txt b/recipes/btyacc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..c23ed5cfe6d983 --- /dev/null +++ b/recipes/btyacc/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/btyacc/all/test_v1_package/conanfile.py b/recipes/btyacc/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..1b50aeffd40ff3 --- /dev/null +++ b/recipes/btyacc/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): + if not tools.cross_building(self): + cmake = CMake(self) + 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/bvdberg-ctest/all/conanfile.py b/recipes/bvdberg-ctest/all/conanfile.py index ac8c63a98f38c2..7786a8fb5c6c82 100644 --- a/recipes/bvdberg-ctest/all/conanfile.py +++ b/recipes/bvdberg-ctest/all/conanfile.py @@ -14,9 +14,13 @@ class BvdbergCtestConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "ctest is a unit test framework for software written in C." topics = ("testing", "testing-framework", "unit-testing") + 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() @@ -24,12 +28,8 @@ def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration("Windows not supported") - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -40,6 +40,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/bx/all/test_package/conanfile.py b/recipes/bx/all/test_package/conanfile.py index 7914baa4343981..d3dd545ae68baf 100644 --- a/recipes/bx/all/test_package/conanfile.py +++ b/recipes/bx/all/test_package/conanfile.py @@ -1,10 +1,8 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.layout import cmake_layout -from conan.tools.cmake import CMake +from conan.tools.cmake import CMake, cmake_layout import os -required_conan_version = ">=1.50.0" class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" diff --git a/recipes/bzip3/all/conandata.yml b/recipes/bzip3/all/conandata.yml index 0de00365a28f1a..464608d61d50ae 100644 --- a/recipes/bzip3/all/conandata.yml +++ b/recipes/bzip3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.2": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.3.2/bzip3-1.3.2.tar.xz" + sha256: "b1d04b8b1b89a3c490cf2b89ea8cee1281584b07f25276fcfd8d40ec2c488e94" "1.3.1": url: "https://github.com/kspalaiologos/bzip3/releases/download/1.3.1/bzip3-1.3.1.tar.xz" sha256: "b023c261307ff4e0e64935ea32bba0216377fd8fc2fd19ba86509a32cbb8a35a" @@ -18,32 +21,5 @@ sources: url: "https://github.com/kspalaiologos/bzip3/releases/download/1.2.0/bzip3-1.2.0.tar.xz" sha256: "f0441519321070e03708638b37bdeb9105aff8f0a5c838e45aff1b0cbe752572" "1.1.8": - url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.8/bzip3-1.1.8.tar.bz2" - sha256: "bc15d0e4599aad18d9ed71ee0f7e859af89051bf5105b0751e8ca3a26117567d" - "1.1.7": - url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.7/bzip3-1.1.7.tar.bz2" - sha256: "1f74768dd1a76c45417f84779cc04d8d8b1f595ac564a2ea2aeb0248defca803" - "1.1.6": - url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.6/bzip3-1.1.6.tar.bz2" - sha256: "2bfd35dd57ab80b35b25e3ad628e0ff8f1f5e6dea02a8d472914823ea2e07e96" - "1.1.5": - url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.5/bzip3-1.1.5.tar.bz2" - sha256: "2f5012b0004b6c23d5f606deed9191fdce44849234edbcf26e0316bf7856d114" - "1.1.4": - url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.4/bzip3-1.1.4.tar.bz2" - sha256: "e23a06ae17fc36192e79d0151950b3bbd4e26381af50ba4b4fd7a2d9797e498f" -patches: - "1.1.5": - - patch_file: "patches/1.1.5-0002-export-symbols.patch" - patch_description: "fix hidden public symbols on shard build" - patch_type: "portability" - patch_source: "https://github.com/kspalaiologos/bzip3/issues/46" - "1.1.4": - - patch_file: "patches/1.1.4-0001-make-restrict-alias.patch" - patch_description: "make restrict alias" - patch_type: "portability" - patch_source: "https://github.com/kspalaiologos/bzip3/commit/c5bba99d1a655a177eef9aeb71207326929c66d9" - - patch_file: "patches/1.1.4-0002-export-symbols.patch" - patch_description: "fix hidden public symbols on shard build" - patch_type: "portability" - patch_source: "https://github.com/kspalaiologos/bzip3/issues/46" + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.8/bzip3-1.1.8.tar.xz" + sha256: "80a226950832df5674e012a38cf5f45efc6405d51a1caceb96f80ec2861a6111" diff --git a/recipes/bzip3/all/conanfile.py b/recipes/bzip3/all/conanfile.py index 484c139e122f38..2102c952e4cf1c 100644 --- a/recipes/bzip3/all/conanfile.py +++ b/recipes/bzip3/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get +from conan.tools.files import copy, get import os required_conan_version = ">=1.53.0" @@ -30,7 +30,6 @@ class BZip3Conan(ConanFile): def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) - export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -62,7 +61,6 @@ def generate(self): tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() diff --git a/recipes/bzip3/all/patches/1.1.4-0001-make-restrict-alias.patch b/recipes/bzip3/all/patches/1.1.4-0001-make-restrict-alias.patch deleted file mode 100644 index 20195b834da7ba..00000000000000 --- a/recipes/bzip3/all/patches/1.1.4-0001-make-restrict-alias.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff --git a/src/crc32.c b/src/crc32.c -index 856fcd4..d9fb87a 100644 ---- a/src/crc32.c -+++ b/src/crc32.c -@@ -19,6 +19,14 @@ - - #include "crc32.h" - -+#if defined(__GNUC__) || defined(__clang__) -+ #define RESTRICT __restrict__ -+#elif defined(_MSC_VER) || defined(__INTEL_COMPILER) -+ #define RESTRICT __restrict -+#else -+ #error Your compiler, configuration or platform is not supported. -+#endif -+ - static const u32 crc32Table[256] = { - 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 0x8AD958CFL, - 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, 0x105EC76FL, 0xE235446CL, -@@ -51,7 +59,7 @@ static const u32 crc32Table[256] = { - 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L - }; - --u32 crc32sum(u32 crc, u8 * restrict buf, size_t size) { -+u32 crc32sum(u32 crc, u8 * RESTRICT buf, size_t size) { - while (size--) crc = crc32Table[(crc ^ *(buf++)) & 0xff] ^ (crc >> 8); - return crc; - } -diff --git a/src/lzp.c b/src/lzp.c -index c19580d..2206673 100644 ---- a/src/lzp.c -+++ b/src/lzp.c -@@ -11,8 +11,16 @@ - - #define MATCH 0xf2 - --static s32 lzp_encode_block(const u8 * restrict in, const u8 * in_end, u8 * restrict out, u8 * out_end, -- s32 * restrict lut, s32 mask, s32 m_len) { -+#if defined(__GNUC__) || defined(__clang__) -+ #define RESTRICT __restrict__ -+#elif defined(_MSC_VER) || defined(__INTEL_COMPILER) -+ #define RESTRICT __restrict -+#else -+ #error Your compiler, configuration or platform is not supported. -+#endif -+ -+static s32 lzp_encode_block(const u8 * RESTRICT in, const u8 * in_end, u8 * RESTRICT out, u8 * out_end, -+ s32 * RESTRICT lut, s32 mask, s32 m_len) { - const u8 *ins = in, *outs = out; - const u8 * out_eob = out_end - 8; - const u8 * heur = in; -@@ -28,7 +36,7 @@ static s32 lzp_encode_block(const u8 * restrict in, const u8 * in_end, u8 * rest - s32 val = lut[idx]; - lut[idx] = in - ins; - if (val > 0) { -- const u8 * restrict ref = ins + val; -+ const u8 * RESTRICT ref = ins + val; - if (memcmp(in + m_len - 4, ref + m_len - 4, sizeof(u32)) == 0 && memcmp(in, ref, sizeof(u32)) == 0) { - if (heur > in && *(u32 *)heur != *(u32 *)(ref + (heur - in))) goto not_found; - -@@ -85,7 +93,7 @@ static s32 lzp_encode_block(const u8 * restrict in, const u8 * in_end, u8 * rest - return out >= out_eob ? -1 : (s32)(out - outs); - } - --static s32 lzp_decode_block(const u8 * restrict in, const u8 * in_end, s32 * restrict lut, u8 * restrict out, s32 hash, -+static s32 lzp_decode_block(const u8 * RESTRICT in, const u8 * in_end, s32 * RESTRICT lut, u8 * RESTRICT out, s32 hash, - s32 m_len) { - if (in_end - in < 4) return -1; - -@@ -129,7 +137,7 @@ static s32 lzp_decode_block(const u8 * restrict in, const u8 * in_end, s32 * res - return out - outs; - } - --s32 lzp_compress(const u8 * restrict in, u8 * restrict out, s32 n, s32 hash, s32 m_len, s32 * restrict lut) { -+s32 lzp_compress(const u8 * RESTRICT in, u8 * RESTRICT out, s32 n, s32 hash, s32 m_len, s32 * RESTRICT lut) { - if (n - m_len < 32) return -1; - - memset(lut, 0, sizeof(s32) * (1 << hash)); -@@ -137,6 +145,6 @@ s32 lzp_compress(const u8 * restrict in, u8 * restrict out, s32 n, s32 hash, s32 - return lzp_encode_block(in, in + n, out, out + n, lut, (s32)(1 << hash) - 1, m_len); - } - --s32 lzp_decompress(const u8 * restrict in, u8 * restrict out, s32 n, s32 hash, s32 m_len, s32 * restrict lut) { -+s32 lzp_decompress(const u8 * RESTRICT in, u8 * RESTRICT out, s32 n, s32 hash, s32 m_len, s32 * RESTRICT lut) { - return lzp_decode_block(in, in + n, lut, out, hash, m_len); - } -diff --git a/src/rle.c b/src/rle.c -index b1f0340..2cb2e53 100644 ---- a/src/rle.c -+++ b/src/rle.c -@@ -19,6 +19,14 @@ - - #include "rle.h" - -+#if defined(__GNUC__) || defined(__clang__) -+ #define RESTRICT __restrict__ -+#elif defined(_MSC_VER) || defined(__INTEL_COMPILER) -+ #define RESTRICT __restrict -+#else -+ #error Your compiler, configuration or platform is not supported. -+#endif -+ - s32 mrlec(u8 * in, s32 inlen, u8 * out) { - u8 *ip = in, *in_end = in + inlen; - s32 op = 0; -@@ -57,7 +65,7 @@ s32 mrlec(u8 * in, s32 inlen, u8 * out) { - return op; - } - --void mrled(u8 * restrict in, u8 * restrict out, s32 outlen) { -+void mrled(u8 * RESTRICT in, u8 * RESTRICT out, s32 outlen) { - s32 op = 0, ip = 0; - - s32 c, pc = -1; diff --git a/recipes/bzip3/all/patches/1.1.4-0002-export-symbols.patch b/recipes/bzip3/all/patches/1.1.4-0002-export-symbols.patch deleted file mode 100644 index 3bdf13582cc593..00000000000000 --- a/recipes/bzip3/all/patches/1.1.4-0002-export-symbols.patch +++ /dev/null @@ -1,95 +0,0 @@ ---- a/include/common.h -+++ b/include/common.h -@@ -46,10 +46,6 @@ static void write_neutral_s32(u8 * data, s32 value) { - data[3] = (value >> 24) & 0xFF; - } - --#ifdef __MINGW32__ -- #define PUBLIC_API __declspec(dllexport) --#else -- #define PUBLIC_API --#endif -+#define PUBLIC_API - - #endif ---- a/include/libbz3.h -+++ b/include/libbz3.h -@@ -22,6 +22,16 @@ - - #include - -+#ifdef bzip3_EXPORTS -+#ifdef _WIN32 -+ #define BZIP3_API __declspec(dllexport) -+#else -+ #define BZIP3_API __attribute__((visibility("default"))) -+#endif -+#else -+ #define BZIP3_API -+#endif -+ - #define BZ3_OK 0 - #define BZ3_ERR_OUT_OF_BOUNDS -1 - #define BZ3_ERR_BWT -2 -@@ -35,31 +45,31 @@ struct bz3_state; - /** - * @brief Get the last error number associated with a given state. - */ --int8_t bz3_last_error(struct bz3_state * state); -+BZIP3_API int8_t bz3_last_error(struct bz3_state * state); - - /** - * @brief Return a user-readable message explaining the cause of the last error. - */ --const char * bz3_strerror(struct bz3_state * state); -+BZIP3_API const char * bz3_strerror(struct bz3_state * state); - - /** - * @brief Construct a new block encoder state, which will encode blocks as big as the given block size. - * The decoder will be able to decode blocks at most as big as the given block size. - * Returns NULL in case allocation fails or the block size is not between 65K and 511M - */ --struct bz3_state * bz3_new(int32_t block_size); -+BZIP3_API struct bz3_state * bz3_new(int32_t block_size); - - /** - * @brief Free the memory occupied by a block encoder state. - */ --void bz3_free(struct bz3_state * state); -+BZIP3_API void bz3_free(struct bz3_state * state); - - /** - * @brief Encode a single block. Returns the amount of bytes written to `buffer'. - * `buffer' must be able to hold at least `size + size / 50 + 32' bytes. The size must not - * exceed the block size associated with the state. - */ --int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); -+BZIP3_API int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); - - /** - * @brief Decode a single block. -@@ -68,7 +78,7 @@ int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz - * @param size The size of the compressed data in `buffer' - * @param orig_size The original size of the data before compression. - */ --int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); -+BZIP3_API int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); - - /** - * @brief Encode `n' blocks, all in parallel. -@@ -80,13 +90,13 @@ int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz - * - * Present in the shared library only if -lpthread was present during building. - */ --void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); -+BZIP3_API void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); - - /** - * @brief Decode `n' blocks, all in parallel. - * Same specifics as `bz3_encode_blocks', but doesn't overwrite `sizes'. - */ --void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], -+BZIP3_API void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], - int32_t n); - - #endif diff --git a/recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch b/recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch deleted file mode 100644 index e76dc6e0d184eb..00000000000000 --- a/recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch +++ /dev/null @@ -1,83 +0,0 @@ -diff --git a/include/libbz3.h b/include/libbz3.h -index a5ac58a..a9b13fd 100644 ---- a/include/libbz3.h -+++ b/include/libbz3.h -@@ -22,6 +22,16 @@ - - #include - -+#ifdef bzip3_EXPORTS -+#ifdef _WIN32 -+ #define BZIP3_API __declspec(dllexport) -+#else -+ #define BZIP3_API __attribute__((visibility("default"))) -+#endif -+#else -+ #define BZIP3_API -+#endif -+ - #define BZ3_OK 0 - #define BZ3_ERR_OUT_OF_BOUNDS -1 - #define BZ3_ERR_BWT -2 -@@ -35,31 +45,31 @@ struct bz3_state; - /** - * @brief Get the last error number associated with a given state. - */ --int8_t bz3_last_error(struct bz3_state * state); -+BZIP3_API int8_t bz3_last_error(struct bz3_state * state); - - /** - * @brief Return a user-readable message explaining the cause of the last error. - */ --const char * bz3_strerror(struct bz3_state * state); -+BZIP3_API const char * bz3_strerror(struct bz3_state * state); - - /** - * @brief Construct a new block encoder state, which will encode blocks as big as the given block size. - * The decoder will be able to decode blocks at most as big as the given block size. - * Returns NULL in case allocation fails or the block size is not between 65K and 511M - */ --struct bz3_state * bz3_new(int32_t block_size); -+BZIP3_API struct bz3_state * bz3_new(int32_t block_size); - - /** - * @brief Free the memory occupied by a block encoder state. - */ --void bz3_free(struct bz3_state * state); -+BZIP3_API void bz3_free(struct bz3_state * state); - - /** - * @brief Encode a single block. Returns the amount of bytes written to `buffer'. - * `buffer' must be able to hold at least `size + size / 50 + 32' bytes. The size must not - * exceed the block size associated with the state. - */ --int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); -+BZIP3_API int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); - - /** - * @brief Decode a single block. -@@ -68,7 +78,7 @@ int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz - * @param size The size of the compressed data in `buffer' - * @param orig_size The original size of the data before compression. - */ --int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); -+BZIP3_API int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); - - /** - * @brief Encode `n' blocks, all in parallel. -@@ -80,13 +90,13 @@ int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz - * - * Present in the shared library only if -lpthread was present during building. - */ --void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); -+BZIP3_API void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); - - /** - * @brief Decode `n' blocks, all in parallel. - * Same specifics as `bz3_encode_blocks', but doesn't overwrite `sizes'. - */ --void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], -+BZIP3_API void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], - int32_t n); - - #endif diff --git a/recipes/bzip3/config.yml b/recipes/bzip3/config.yml index 014fd9d9039685..b6e0a161eb7bfe 100644 --- a/recipes/bzip3/config.yml +++ b/recipes/bzip3/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.2": + folder: all "1.3.1": folder: all "1.3.0": @@ -13,11 +15,3 @@ versions: folder: all "1.1.8": folder: all - "1.1.7": - folder: all - "1.1.6": - folder: all - "1.1.5": - folder: all - "1.1.4": - folder: all diff --git a/recipes/c-ares/all/conandata.yml b/recipes/c-ares/all/conandata.yml index e6549888363362..71897bd8283d0c 100644 --- a/recipes/c-ares/all/conandata.yml +++ b/recipes/c-ares/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.22.1": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_22_1/c-ares-1.22.1.tar.gz" + sha256: "f67c180deb799c670d9dda995a18ce06f6c7320b6c6363ff8fa85b77d0da9db8" + "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" + "1.20.1": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_20_1/c-ares-1.20.1.tar.gz" + sha256: "de24a314844cb157909730828560628704f4f896d167dd7da0fa2fb93ea18b10" "1.19.1": url: "https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz" sha256: "321700399b72ed0e037d0074c629e7741f6b2ec2dda92956abe3e9671d3e268e" diff --git a/recipes/c-ares/config.yml b/recipes/c-ares/config.yml index 402bb147b757b9..fcaa8574925875 100644 --- a/recipes/c-ares/config.yml +++ b/recipes/c-ares/config.yml @@ -1,4 +1,12 @@ versions: + "1.22.1": + folder: all + "1.22.0": + folder: all + "1.21.0": + folder: all + "1.20.1": + folder: all "1.19.1": folder: all "1.19.0": diff --git a/recipes/c-blosc/all/conandata.yml b/recipes/c-blosc/all/conandata.yml index d2e82d3ed6ffbf..a47eb694abb4af 100644 --- a/recipes/c-blosc/all/conandata.yml +++ b/recipes/c-blosc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.21.5": + url: "https://github.com/Blosc/c-blosc/archive/v1.21.5.tar.gz" + sha256: "32e61961bbf81ffea6ff30e9d70fca36c86178afd3e3cfa13376adec8c687509" "1.21.4": url: "https://github.com/Blosc/c-blosc/archive/v1.21.4.tar.gz" sha256: "e72bd03827b8564bbb3dc3ea0d0e689b4863871ce3861d946f2efd7a186ecf3e" @@ -27,6 +30,10 @@ sources: url: "https://github.com/Blosc/c-blosc/archive/v1.17.1.tar.gz" sha256: "19a6948b579c27e8ac440b4f077f99fc90e7292b1d9cb896bec0fd781d68fba2" patches: + "1.21.5": + - patch_file: "patches/cmake-dependencies-1.21.4+.patch" + patch_description: "use cci package" + patch_type: "conan" "1.21.4": - patch_file: "patches/cmake-dependencies-1.21.4+.patch" patch_description: "use cci package" diff --git a/recipes/c-blosc/all/conanfile.py b/recipes/c-blosc/all/conanfile.py index 5967507ab8e974..9f604b7efb4910 100644 --- a/recipes/c-blosc/all/conanfile.py +++ b/recipes/c-blosc/all/conanfile.py @@ -60,7 +60,7 @@ def requirements(self): if self.options.with_snappy: self.requires("snappy/1.1.10") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: self.requires("zstd/1.5.5") diff --git a/recipes/c-blosc/config.yml b/recipes/c-blosc/config.yml index 0bea6e6e853db9..cd2301b24b5b42 100644 --- a/recipes/c-blosc/config.yml +++ b/recipes/c-blosc/config.yml @@ -1,4 +1,6 @@ versions: + "1.21.5": + folder: all "1.21.4": folder: all "1.21.3": diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 09b337eb1d3e7a..0708127cd17a6f 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "2.11.3": + url: "https://github.com/Blosc/c-blosc2/archive/v2.11.3.tar.gz" + sha256: "7273ec3ab42adc247425ab34b0601db86a6e2a6aa1a97a11e29df02e078f5037" + "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" + "2.10.2": + url: "https://github.com/Blosc/c-blosc2/archive/v2.10.2.tar.gz" + sha256: "069785bc14c006c7dab40ea0c620bdf3eb8752663fd55c706d145bceabc2a31d" "2.10.0": url: "https://github.com/Blosc/c-blosc2/archive/v2.10.0.tar.gz" sha256: "cb7f7c0c62af78982140ecff21a2f3ca9ce6a0a1c02e314fcdce1a98da0fe231" @@ -14,16 +29,27 @@ 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.3": + - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "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" + patch_type: "conan" + "2.10.2": + - patch_file: "patches/2.10.2-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.10.0": - patch_file: "patches/2.10.0-0001-fix-cmake.patch" patch_description: "use cci package" @@ -44,15 +70,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 3d06cc9c0ee524..9f202af9628432 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], @@ -67,15 +68,20 @@ def requirements(self): if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_zlib in ["zlib-ng", "zlib-ng-compat"]: - self.requires("zlib-ng/2.1.2") + self.requires("zlib-ng/2.1.5") elif self.options.with_zlib == "zlib": - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") 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 @@ -132,6 +139,8 @@ def package(self): 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")) + rmdir(self, os.path.join(self.package_folder, "cmake")) # Remove MS runtime files for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: diff --git a/recipes/c-blosc2/all/patches/2.10.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.10.0-0001-fix-cmake.patch index 4ccea534729cbd..17ad6d731a77c6 100644 --- a/recipes/c-blosc2/all/patches/2.10.0-0001-fix-cmake.patch +++ b/recipes/c-blosc2/all/patches/2.10.0-0001-fix-cmake.patch @@ -16,15 +16,15 @@ index 85d1e03..00e6cad 100644 if(PREFER_EXTERNAL_ZLIB) - find_package(ZLIB_NG) - if(ZLIB_NG_FOUND) -+ 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)) ++ if(NOT (zlib-ng_FOUND OR ZLIB_FOUND)) message(STATUS "No ZLIB found. Using ZLIB-NG internal sources.") endif() endif() @@ -88,8 +88,8 @@ index a6d566d..ba65bae 100644 if(NOT DEACTIVATE_ZLIB) - if(ZLIB_NG_FOUND) - set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) -+ if(zlib_ng_FOUND) -+ set(LIBS ${LIBS} ${zlib_ng_LIBRARIES}) ++ if(zlib-ng_FOUND) ++ set(LIBS ${LIBS} ${zlib-ng_LIBRARIES}) elseif(ZLIB_FOUND) set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) else() diff --git a/recipes/c-blosc2/all/patches/2.10.2-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.10.2-0001-fix-cmake.patch new file mode 100644 index 00000000000000..fb1f3b574be595 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.10.2-0001-fix-cmake.patch @@ -0,0 +1,139 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4b4fc6a..79d61da 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -152,26 +152,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) +@@ -192,8 +192,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 b44b710..681705e 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,18 +138,18 @@ 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_LIBRARY}) + 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_LIBRARY}) + endif() + if(BUILD_TESTS) +- target_include_directories(blosc_testing PUBLIC ${ZSTD_INCLUDE_DIR}) +- target_link_libraries(blosc_testing PUBLIC ${ZSTD_LIBRARY}) ++ target_include_directories(blosc_testing PUBLIC ${zstd_INCLUDE_DIR}) ++ target_link_libraries(blosc_testing PUBLIC ${zstd_LIBRARY}) + endif() + else() + set(ZSTD_LOCAL_DIR ${INTERNAL_LIBS}/zstd-1.5.5) +@@ -190,8 +190,8 @@ else() + 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}) +@@ -199,8 +199,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() +@@ -212,8 +212,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 +@@ -268,7 +268,7 @@ list(APPEND SOURCES + blosc/directories.c + blosc/blosc2-stdio.c + blosc/b2nd.c +- blosc/b2nd_utils.c ++ blosc/b2nd_utils.c + ) + if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL arm64) + if(COMPILER_SUPPORT_SSE2) diff --git a/recipes/c-blosc2/all/patches/2.10.5-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.10.5-0001-fix-cmake.patch new file mode 100644 index 00000000000000..743a69c503d245 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.10.5-0001-fix-cmake.patch @@ -0,0 +1,138 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 19e203a..aa6ccdd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -167,26 +167,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) +@@ -207,8 +207,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 8c7cf90..f7efbf5 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,18 +138,18 @@ 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_LIBRARY}) + endif() + if(BUILD_STATIC) + target_include_directories(blosc2_static PUBLIC ${ZSTD_INCLUDE_DIR}) +- target_link_libraries(blosc2_static PUBLIC ${ZSTD_LIBRARY}) ++ target_link_libraries(blosc2_static PUBLIC ${zstd_LIBRARY}) + endif() + if(BUILD_TESTS) +- target_include_directories(blosc_testing PUBLIC ${ZSTD_INCLUDE_DIR}) +- target_link_libraries(blosc_testing PUBLIC ${ZSTD_LIBRARY}) ++ target_include_directories(blosc_testing PUBLIC ${zstd_INCLUDE_DIR}) ++ target_link_libraries(blosc_testing PUBLIC ${zstd_LIBRARY}) + endif() + else() + set(ZSTD_LOCAL_DIR ${INTERNAL_LIBS}/zstd-1.5.5) +@@ -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 +@@ -262,7 +262,7 @@ list(APPEND SOURCES + blosc/directories.c + blosc/blosc2-stdio.c + blosc/b2nd.c +- blosc/b2nd_utils.c ++ blosc/b2nd_utils.c + ) + if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL arm64) + if(COMPILER_SUPPORT_SSE2) 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/all/patches/2.8.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.8.0-0001-fix-cmake.patch index 4ca392bba22b45..a0812cb90ffab1 100644 --- a/recipes/c-blosc2/all/patches/2.8.0-0001-fix-cmake.patch +++ b/recipes/c-blosc2/all/patches/2.8.0-0001-fix-cmake.patch @@ -16,15 +16,15 @@ index bb7882f..92ac61c 100644 if(PREFER_EXTERNAL_ZLIB) - find_package(ZLIB_NG) - if(ZLIB_NG_FOUND) -+ 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)) ++ if(NOT (zlib-ng_FOUND OR ZLIB_FOUND)) message(STATUS "No ZLIB found. Using ZLIB-NG internal sources.") endif() endif() @@ -65,8 +65,8 @@ index 365de33..74ed32e 100644 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}) ++ 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() @@ -98,8 +98,8 @@ index 365de33..74ed32e 100644 if(NOT DEACTIVATE_ZLIB) - if(ZLIB_NG_FOUND) - set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) -+ if(zlib_ng_FOUND) -+ set(LIBS ${LIBS} ${zlib_ng_LIBRARY}) ++ if(zlib-ng_FOUND) ++ set(LIBS ${LIBS} ${zlib-ng_LIBRARY}) elseif(ZLIB_FOUND) - set(LIBS ${LIBS} ${ZLIB_LIBRARY}) + set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) diff --git a/recipes/c-blosc2/config.yml b/recipes/c-blosc2/config.yml index 94edc65e4565ad..217462db7de181 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,4 +1,14 @@ versions: + "2.11.3": + folder: all + "2.11.2": + folder: all + "2.11.1": + folder: all + "2.10.5": + folder: all + "2.10.2": + folder: all "2.10.0": folder: all "2.8.0": @@ -9,9 +19,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/c-client/all/conanfile.py b/recipes/c-client/all/conanfile.py index 45fc29f13df14b..795f25ff9b207d 100644 --- a/recipes/c-client/all/conanfile.py +++ b/recipes/c-client/all/conanfile.py @@ -43,7 +43,7 @@ def layout(self): def requirements(self): if not is_msvc(self): - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.os == "Windows" and not is_msvc(self): diff --git a/recipes/c-dbg-macro/all/conanfile.py b/recipes/c-dbg-macro/all/conanfile.py index d30bb72e433f78..96423bd2a8bacf 100644 --- a/recipes/c-dbg-macro/all/conanfile.py +++ b/recipes/c-dbg-macro/all/conanfile.py @@ -5,7 +5,8 @@ import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.50.0" + class DbgMacroConan(ConanFile): name = "c-dbg-macro" @@ -14,18 +15,22 @@ class DbgMacroConan(ConanFile): license = "MIT" description = "A dbg(...) macro for C" topics = ("debugging", "macro", "pretty-printing", "header-only") + package_type = "header-library" settings = ("compiler", "build_type", "os", "arch") no_copy_source = True + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration("This library is not compatible with Windows") - def layout(self): - basic_layout(self, src_folder="src") - 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 package(self): copy(self, "dbg.h", @@ -34,6 +39,6 @@ def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - - def package_id(self): - self.info.clear() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] 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/caf/all/conandata.yml b/recipes/caf/all/conandata.yml index 71354ad6bae80a..4b177005e2f51c 100644 --- a/recipes/caf/all/conandata.yml +++ b/recipes/caf/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.19.4": + url: "https://github.com/actor-framework/actor-framework/archive/0.19.4.tar.gz" + sha256: "114d43e3a7a2305ca1d2106cd0daeff471564f62b90db1e453ba9eb5c47c02f6" + "0.19.3": + url: "https://github.com/actor-framework/actor-framework/archive/0.19.3.tar.gz" + sha256: "97ca81bda2e8451505dbaf2aafddc99ffcee7af3db51ae9cbc5c11a3c46c921c" + "0.19.2": + url: "https://github.com/actor-framework/actor-framework/archive/0.19.2.tar.gz" + sha256: "aa3fcc494424e0e20b177125458a6a6ed39c751a3d3d5193054e88bdf8a146d2" "0.18.6": url: "https://github.com/actor-framework/actor-framework/archive/0.18.6.tar.gz" sha256: "c2ead63a0322d992fea8813a7f7d15b4d16cbb8bbe026722f2616a79109b91cc" @@ -11,3 +20,24 @@ sources: "0.18.0": url: "https://github.com/actor-framework/actor-framework/archive/0.18.0.tar.gz" sha256: "df765fa78861e67d44e2587c0ac0c1c662d8c93fe5ffc8757f552fc7ac15941f" +patches: + "0.18.6": + - patch_file: "patches/0001-fix-gcc-13-include.patch" + patch_description: "add missing include to support gcc 13" + patch_type: "bugfix" + patch_source: "https://github.com/actor-framework/actor-framework/commit/c2ee99c" + "0.18.5": + - patch_file: "patches/0001-fix-gcc-13-include.patch" + patch_description: "add missing include to support gcc 13" + patch_type: "bugfix" + patch_source: "https://github.com/actor-framework/actor-framework/commit/c2ee99c" + "0.18.2": + - patch_file: "patches/0001-fix-gcc-13-include.patch" + patch_description: "add missing include to support gcc 13" + patch_type: "bugfix" + patch_source: "https://github.com/actor-framework/actor-framework/commit/c2ee99c" + "0.18.0": + - patch_file: "patches/0001-fix-gcc-13-include.patch" + patch_description: "add missing include to support gcc 13" + patch_type: "bugfix" + patch_source: "https://github.com/actor-framework/actor-framework/commit/c2ee99c" diff --git a/recipes/caf/all/conanfile.py b/recipes/caf/all/conanfile.py index 7a5cb98c5ded6f..08713d4f8b3b0f 100644 --- a/recipes/caf/all/conanfile.py +++ b/recipes/caf/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd, valid_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir from conan.tools.scm import Version import os @@ -47,6 +47,9 @@ def _minimum_compilers_version(self): "apple-clang": "10", } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -97,6 +100,7 @@ def generate(self): deps.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/caf/all/patches/0001-fix-gcc-13-include.patch b/recipes/caf/all/patches/0001-fix-gcc-13-include.patch new file mode 100644 index 00000000000000..3ad9d6d3ba42fa --- /dev/null +++ b/recipes/caf/all/patches/0001-fix-gcc-13-include.patch @@ -0,0 +1,21 @@ +--- a/libcaf_core/caf/detail/ripemd_160.hpp ++++ b/libcaf_core/caf/detail/ripemd_160.hpp +@@ -42,6 +42,7 @@ + + #include + #include ++#include + + #include "caf/detail/core_export.hpp" + +--- a/libcaf_core/caf/telemetry/metric_type.hpp ++++ b/libcaf_core/caf/telemetry/metric_type.hpp +@@ -4,6 +4,8 @@ + + #pragma once + ++#include ++ + namespace caf::telemetry { + + enum class metric_type : uint8_t { diff --git a/recipes/caf/config.yml b/recipes/caf/config.yml index 1e73f6993a4549..548a9345742d50 100644 --- a/recipes/caf/config.yml +++ b/recipes/caf/config.yml @@ -1,4 +1,10 @@ versions: + "0.19.4": + folder: all + "0.19.3": + folder: all + "0.19.2": + folder: all "0.18.6": folder: all "0.18.5": diff --git a/recipes/cairo/all/conanfile.py b/recipes/cairo/all/conanfile.py index e1166eb30e7ea1..1e8675e64a203b 100644 --- a/recipes/cairo/all/conanfile.py +++ b/recipes/cairo/all/conanfile.py @@ -91,10 +91,10 @@ def requirements(self): if self.options.with_xlib or self.options.with_xlib_xrender or self.options.with_xcb: self.requires("xorg/system") if self.options.get_safe("with_glib", True): - self.requires("glib/2.76.2") + self.requires("glib/2.76.3") self.requires("zlib/1.2.13") self.requires("pixman/0.40.0") - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") def package_id(self): if self.options.get_safe("with_glib") and not self.dependencies["glib"].options.shared: diff --git a/recipes/cairo/config.yml b/recipes/cairo/config.yml index 248b8521fe8ea3..8e74221deaa9fb 100644 --- a/recipes/cairo/config.yml +++ b/recipes/cairo/config.yml @@ -1,4 +1,8 @@ versions: + "1.18.0": + folder: meson + "1.17.8": + folder: meson "1.17.6": folder: meson "1.17.4": diff --git a/recipes/cairo/meson/conandata.yml b/recipes/cairo/meson/conandata.yml index da5f9312509754..278a3653016c59 100644 --- a/recipes/cairo/meson/conandata.yml +++ b/recipes/cairo/meson/conandata.yml @@ -1,7 +1,13 @@ sources: + "1.18.0": + sha256: "abf8fba4d510086a492783c3e0828e90b32734738fd80906595617d229d02bab" + url: "https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.18.0/cairo-1.18.0.tar.bz2" + "1.17.8": + url: "https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.17.8/cairo-1.17.8.tar.bz2" + sha256: "ead4724423eb969f98b456fe1e3ee1e1741fe1c8dfb1a41ca12afa81a6c1665f" "1.17.6": - sha256: "90496d135c9ef7612c98f8ee358390cdec0825534573778a896ea021155599d2" url: "https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.17.6/cairo-1.17.6.tar.bz2" + sha256: "90496d135c9ef7612c98f8ee358390cdec0825534573778a896ea021155599d2" "1.17.4": url: - "https://www.cairographics.org/snapshots/cairo-1.17.4.tar.xz" diff --git a/recipes/cairo/meson/conanfile.py b/recipes/cairo/meson/conanfile.py index 22c79e1b6951e7..76c7813fd5b69f 100644 --- a/recipes/cairo/meson/conanfile.py +++ b/recipes/cairo/meson/conanfile.py @@ -5,15 +5,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.env import VirtualBuildEnv -from conan.tools.files import ( - apply_conandata_patches, - copy, - export_conandata_patches, - get, - rename, - replace_in_file, - rm, - rmdir) +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, 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 @@ -75,12 +67,12 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.os != "Linux": + if self.settings.os not in ["Linux", "FreeBSD"]: del self.options.with_xlib del self.options.with_xlib_xrender del self.options.with_xcb del self.options.with_symbol_lookup - if self.settings.os in ["Macos", "Windows"]: + if Version(self.version) >= "1.17.8" or self.settings.os == "Windows" or is_apple_os(self): del self.options.with_opengl def configure(self): @@ -93,32 +85,32 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("pixman/0.40.0") + self.requires("pixman/0.42.2") if self.options.with_zlib and self.options.with_png: self.requires("expat/2.5.0") if self.options.with_lzo: self.requires("lzo/2.10") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_freetype: - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2", transitive_headers=True, transitive_libs=True) if self.options.with_fontconfig: - self.requires("fontconfig/2.14.2") + self.requires("fontconfig/2.14.2", transitive_headers=True, transitive_libs=True) if self.options.with_png: self.requires("libpng/1.6.40") if self.options.with_glib: - self.requires("glib/2.76.3") - if self.settings.os == "Linux": + self.requires("glib/2.78.1") + if self.settings.os in ["Linux", "FreeBSD"]: if self.options.with_xlib or self.options.with_xlib_xrender or self.options.with_xcb: - self.requires("xorg/system") + self.requires("xorg/system", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_opengl") == "desktop": - self.requires("opengl/system") + self.requires("opengl/system", transitive_headers=True, transitive_libs=True) if self.settings.os == "Windows": self.requires("glext/cci.20210420") self.requires("wglext/cci.20200813") self.requires("khrplatform/cci.20200529") if self.options.get_safe("with_opengl") and self.settings.os in ["Linux", "FreeBSD"]: - self.requires("egl/system") + self.requires("egl/system", transitive_headers=True, transitive_libs=True) def validate(self): if self.options.get_safe("with_xlib_xrender") and not self.options.get_safe("with_xlib"): @@ -135,9 +127,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.1.1") + self.tool_requires("meson/1.3.0") 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) @@ -158,22 +150,23 @@ def is_enabled(value): options["png"] = is_enabled(self.options.with_png) options["freetype"] = is_enabled(self.options.with_freetype) options["fontconfig"] = is_enabled(self.options.with_fontconfig) - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: options["xcb"] = is_enabled(self.options.with_xcb) options["xlib"] = is_enabled(self.options.with_xlib) else: options["xcb"] = "disabled" options["xlib"] = "disabled" - if self.options.get_safe("with_opengl") == "desktop": - options["gl-backend"] = "gl" - elif self.options.get_safe("with_opengl") == "gles2": - options["gl-backend"] = "glesv2" - elif self.options.get_safe("with_opengl") == "gles3": - options["gl-backend"] = "glesv3" - else: - options["gl-backend"] = "disabled" - options["glesv2"] = is_enabled(self.options.get_safe("with_opengl") == "gles2") - options["glesv3"] = is_enabled(self.options.get_safe("with_opengl") == "gles3") + if Version(self.version) < "1.17.8": + if self.options.get_safe("with_opengl") == "desktop": + options["gl-backend"] = "gl" + elif self.options.get_safe("with_opengl") == "gles2": + options["gl-backend"] = "glesv2" + elif self.options.get_safe("with_opengl") == "gles3": + options["gl-backend"] = "glesv3" + else: + options["gl-backend"] = "disabled" + options["glesv2"] = is_enabled(self.options.get_safe("with_opengl") == "gles2") + options["glesv3"] = is_enabled(self.options.get_safe("with_opengl") == "gles3") options["tee"] = is_enabled(self.options.tee) options["symbol-lookup"] = is_enabled(self.options.get_safe("with_symbol_lookup")) @@ -187,7 +180,7 @@ def is_enabled(value): options["drm"] = "disabled" # not yet compilable in cairo 1.17.4 options["openvg"] = "disabled" # https://www.khronos.org/openvg/ options["qt"] = "disabled" # not yet compilable in cairo 1.17.4 - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: options["xlib-xrender"] = is_enabled(self.options.with_xlib_xrender) options["gtk2-utils"] = "disabled" @@ -251,7 +244,7 @@ def add_component_and_base_requirements(component, requirements, system_libs=Non self.cpp_info.components["cairo_"].libs = ["cairo"] self.cpp_info.components["cairo_"].includedirs.insert(0, os.path.join("include", "cairo")) - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["cairo_"].system_libs.extend(["m", "dl", "pthread"]) if self.options.get_safe("with_symbol_lookup"): self.cpp_info.components["cairo_"].system_libs.append("bfd") @@ -315,7 +308,7 @@ def add_component_and_base_requirements(component, requirements, system_libs=Non if self.options.with_opengl == "desktop": add_component_and_base_requirements("cairo-gl", ["opengl::opengl"]) - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: add_component_and_base_requirements("cairo-glx", ["opengl::opengl"]) if self.settings.os == "Windows": diff --git a/recipes/cairo/meson/test_package/CMakeLists.txt b/recipes/cairo/meson/test_package/CMakeLists.txt index 4f33d55898eb29..83adc4effa23ed 100644 --- a/recipes/cairo/meson/test_package/CMakeLists.txt +++ b/recipes/cairo/meson/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.2) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(cairo CONFIG REQUIRED) diff --git a/recipes/cairo/meson/test_v1_package/CMakeLists.txt b/recipes/cairo/meson/test_v1_package/CMakeLists.txt index 692a4909c85a77..91630d79f4abb3 100644 --- a/recipes/cairo/meson/test_v1_package/CMakeLists.txt +++ b/recipes/cairo/meson/test_v1_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1.2) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) 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/cairomm/all/test_v1_package/conanfile.py b/recipes/cairomm/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a691174f8ed160 --- /dev/null +++ b/recipes/cairomm/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.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/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/cajun-jsonapi/all/conanfile.py b/recipes/cajun-jsonapi/all/conanfile.py index 55cd07447203fa..4c40bccc4e9458 100644 --- a/recipes/cajun-jsonapi/all/conanfile.py +++ b/recipes/cajun-jsonapi/all/conanfile.py @@ -1,34 +1,37 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.files import get, copy, load, save +from conan.tools.layout import basic_layout from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.50.0" class CajunJsonApiConan(ConanFile): name = "cajun-jsonapi" description = "CAJUN* is a C++ API for the JSON object interchange format." - topics = ("conan", "cajun", "json") + topics = ("cajun", "json") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/cajun-jsonapi/cajun-jsonapi" license = "BSD-3-Clause" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True - ) + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, 11) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def _extract_license(self): file_content = load(self, os.path.join(self.source_folder, "test.cpp")) return ( @@ -82,8 +85,7 @@ def package(self): src=self.source_folder, ) - def package_id(self): - self.info.clear() - def package_info(self): + self.cpp_info.bindirs = [] self.cpp_info.includedirs.append(os.path.join("include", "cajun")) + self.cpp_info.libdirs = [] diff --git a/recipes/canary/all/conanfile.py b/recipes/canary/all/conanfile.py index 1a102a8feb0358..a8399d13089c47 100644 --- a/recipes/canary/all/conanfile.py +++ b/recipes/canary/all/conanfile.py @@ -3,7 +3,7 @@ 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 +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir required_conan_version = ">=1.53.0" @@ -16,7 +16,7 @@ class SocketcanCanaryConan(ConanFile): license = "BSL-1.0" homepage = "https://github.com/djarek/canary" topics = ("socketcan", "can-bus", "can") - + package_type = "header-library" settings = "os", "compiler", "build_type", "arch" no_copy_source = True @@ -24,17 +24,23 @@ class SocketcanCanaryConan(ConanFile): def _min_cppstd(self): return 11 + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.74.0") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration(f"{self.ref} only supports Linux.") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - def requirements(self): - self.requires("boost/1.74.0", transitive_headers=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) @@ -43,19 +49,19 @@ def generate(self): tc.generate() def build(self): - pass + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): copy(self, "LICENSE_1_0.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) - cmake.configure() cmake.install() rmdir(self, os.path.join(self.package_folder, "lib")) - def package_id(self): - self.info.clear() - def package_info(self): self.cpp_info.requires = ["boost::headers", "boost::system"] self.cpp_info.set_property("cmake_file_name", "canary") self.cpp_info.set_property("cmake_target_name", "canary::canary") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/canvas_ity/all/conanfile.py b/recipes/canvas_ity/all/conanfile.py index b4527ac4677c73..9b0e2c5ceee1da 100644 --- a/recipes/canvas_ity/all/conanfile.py +++ b/recipes/canvas_ity/all/conanfile.py @@ -14,6 +14,7 @@ class CanvasItyConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/a-e-k/canvas_ity" topics = ("rasterizer", "canvas", "2d", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -24,7 +25,7 @@ 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 diff --git a/recipes/capnproto/all/conandata.yml b/recipes/capnproto/all/conandata.yml index 8a6eeaab5a8d19..e635b41da8f05d 100644 --- a/recipes/capnproto/all/conandata.yml +++ b/recipes/capnproto/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.0.1": + url: "https://github.com/capnproto/capnproto/archive/v1.0.1.tar.gz" + sha256: "5bdb16f6b389a9e29b04214b9bae1759e8b7fe2b45049d7e3f1f286ba050a200" + "1.0.0": + url: "https://github.com/capnproto/capnproto/archive/v1.0.0.tar.gz" + sha256: "bcd44dde78055313a7786cb6ab020cbef19b9045b53857f90cce101c9453f715" + "0.10.4": + url: "https://github.com/capnproto/capnproto/archive/v0.10.4.tar.gz" + sha256: "c6f25940688c87ddb24e0c4e475c3213d9b044aad2ba305439cc8c224f559da6" "0.10.3": url: "https://github.com/capnproto/capnproto/archive/v0.10.3.tar.gz" sha256: "e07446f56043c983e009038e69d18ff86a2924909f0b518ccf47eccf5ac03919" @@ -16,26 +25,75 @@ sources: sha256: "6d8b43a7ec2a764b4dfe4139a7cdd070ad9057f106898050d9f4db3754b98820" "0.7.0": url: "https://github.com/capnproto/capnproto/archive/v0.7.0.tar.gz" - sha256: 76c7114a3d142ad08b7208b3964a26e72a6320ee81331d3f0b87569fc9c47a28 + sha256: "76c7114a3d142ad08b7208b3964a26e72a6320ee81331d3f0b87569fc9c47a28" patches: + "1.0.1": + - patch_file: "patches/0015-disable-tests-for-1.0.0.patch" + patch_description: "disable test build" + patch_type: "conan" + "1.0.0": + - patch_file: "patches/0015-disable-tests-for-1.0.0.patch" + patch_description: "disable test build" + patch_type: "conan" + "0.10.4": + - patch_file: "patches/0014-disable-tests-for-0.10.1.patch" + patch_description: "disable test build" + patch_type: "conan" "0.10.3": - - patch_file: patches/0014-disable-tests-for-0.10.1.patch + - patch_file: "patches/0014-disable-tests-for-0.10.1.patch" + patch_description: "disable test build" + patch_type: "conan" "0.10.1": - - patch_file: patches/0014-disable-tests-for-0.10.1.patch + - patch_file: "patches/0014-disable-tests-for-0.10.1.patch" + patch_description: "disable test build" + patch_type: "conan" "0.10.0": - - patch_file: patches/0013-disable-tests-for-0.10.0.patch + - patch_file: "patches/0013-disable-tests-for-0.10.0.patch" + patch_description: "disable test build" + patch_type: "conan" "0.9.1": - - patch_file: patches/0010-disable-tests-for-0.9.1.patch - - patch_file: patches/0011-msvc-cpp17-hassubstring-fix-0.9.1.patch - - patch_file: patches/0012-msvc-nogdi-fix-0.9.1.patch + - patch_file: "patches/0010-disable-tests-for-0.9.1.patch" + patch_description: "disable test build" + patch_type: "conan" + - patch_file: "patches/0011-msvc-cpp17-hassubstring-fix-0.9.1.patch" + patch_description: "fix compilation errors on Windows Clang" + patch_type: "portability" + patch_source: "https://github.com/capnproto/capnproto/pull/1344" + - patch_file: "patches/0012-msvc-nogdi-fix-0.9.1.patch" + patch_description: "fix compilation error on Windows" + patch_type: "portability" + patch_source: "https://github.com/capnproto/capnproto/issues/1421" "0.8.0": - - patch_file: patches/0001-disable-tests.patch - - patch_file: patches/0002-cmake-compat-header-install.patch - - patch_file: patches/0003-kj-tls-windows.patch - - patch_file: patches/0004-cmake-module-path.patch - - patch_file: patches/0005-msvc-16.7-ice-workaround.patch - - patch_file: patches/0009-windows-symlink-fix-0.8.0.patch + - patch_file: "patches/0001-disable-tests.patch" + patch_description: "disable test build" + patch_type: "conan" + - patch_file: "patches/0002-cmake-compat-header-install.patch" + patch_description: "fix compilation error for std::copy with list types" + patch_type: "portability" + patch_source: "https://github.com/capnproto/capnproto/pull/895" + - patch_file: "patches/0003-kj-tls-windows.patch" + patch_description: "add kj-tls target" + patch_type: "portability" + patch_source: "https://github.com/capnproto/capnproto/commit/7da6abf233fdf74a4ad4db56b6e98778b162dd7d" + - patch_file: "patches/0004-cmake-module-path.patch" + patch_description: "append cmake module path instead set" + patch_type: "conan" + - patch_file: "patches/0005-msvc-16.7-ice-workaround.patch" + patch_description: "Workaround for internal compiler error with msvc 16.7.x" + patch_type: "portability" + patch_source: "https://github.com/capnproto/capnproto/pull/1058" + - patch_file: "patches/0009-windows-symlink-fix-0.8.0.patch" + patch_description: "orkaround for install step on Windows where symlinks might be not supported." + patch_type: "portability" + patch_source: "https://github.com/capnproto/capnproto/pull/1240" "0.7.0": - - patch_file: patches/0006-symlink.patch - - patch_file: patches/0007-cmake-module-path.patch - - patch_file: patches/0008-disable-tests.patch + - patch_file: "patches/0006-symlink.patch" + patch_description: "Fix capnpc extension handling on Windows" + patch_type: "portability" + patch_source: "https://github.com/capnproto/capnproto/pull/804" + - patch_file: "patches/0007-cmake-module-path.patch" + patch_description: "append cmake module path instead set" + patch_type: "conan" + - patch_file: "patches/0008-disable-tests.patch" + patch_description: "disable test build" + patch_type: "conan" diff --git a/recipes/capnproto/all/conanfile.py b/recipes/capnproto/all/conanfile.py index f101073a53368f..591f5effa85d6a 100644 --- a/recipes/capnproto/all/conanfile.py +++ b/recipes/capnproto/all/conanfile.py @@ -47,7 +47,7 @@ def _minimum_compilers_version(self): return { "Visual Studio": "15", "msvc": "191", - "gcc": "5", + "gcc": "5" if Version(self.version) < "1.0.0" else "7", "clang": "5", "apple-clang": "5.1", } @@ -79,7 +79,7 @@ def requirements(self): if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") if self.options.get_safe("with_zlib"): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -93,6 +93,10 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared libraries for Visual Studio") if self.settings.os == "Windows" and Version(self.version) < "0.8.0" and self.options.with_openssl: raise ConanInvalidConfiguration(f"{self.ref} doesn't support OpenSSL on Windows pre 0.8.0") + # MSVC Release build is not supported in 1.0.0 + # https://github.com/capnproto/capnproto/issues/1740 + if Version(self.version) == "1.0.0" and is_msvc(self) and self.settings.build_type == "Release": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC Release build") def build_requirements(self): if self.settings.os != "Windows": @@ -189,53 +193,54 @@ def package(self): "function(CAPNP_GENERATE_CPP SOURCES HEADERS)", find_execs) - def package_info(self): - self.cpp_info.set_property("cmake_file_name", "CapnProto") - capnprotomacros = os.path.join(self._cmake_folder, "CapnProtoMacros.cmake") - self.cpp_info.set_property("cmake_build_modules", [capnprotomacros]) + @property + def _capnp_components(self): + def libm(): + return ["m"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def pthread(): + return ["pthread"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def ws2_32(): + return ["ws2_32"] if self.settings.os == "Windows" else [] + + components = { + "capnp": {"requires": ["kj"]}, + "capnp-json": {"requires": ["capnp", "kj"]}, + "capnp-rpc": {"requires": ["capnp", "kj", "kj-async"]}, + "capnpc": {"requires": ["capnp", "kj"], "system_libs": libm() + pthread()}, + "kj": {"system_libs": libm() + pthread()}, + "kj-async": {"requires": ["kj"], "system_libs": libm() + pthread() + ws2_32()}, + "kj-http": {"requires": ["kj", "kj-async"]}, + "kj-test": {"requires": ["kj"]}, + } - components = [ - {"name": "capnp", "requires": ["kj"]}, - {"name": "capnp-json", "requires": ["capnp", "kj"]}, - {"name": "capnp-rpc", "requires": ["capnp", "kj", "kj-async"]}, - {"name": "capnpc", "requires": ["capnp", "kj"]}, - {"name": "kj", "requires": []}, - {"name": "kj-async", "requires": ["kj"]}, - {"name": "kj-http", "requires": ["kj", "kj-async"]}, - {"name": "kj-test", "requires": ["kj"]}, - ] if self.options.get_safe("with_zlib"): - components.append({"name": "kj-gzip", "requires": ["kj", "kj-async", "zlib::zlib"]}) + components.update({"kj-gzip": {"requires": ["kj", "kj-async", "zlib::zlib"]}}) + if Version(self.version) >= "1.0.0": + components["kj-http"].setdefault("requires", []).append("zlib::zlib") if self.options.with_openssl: - components.append({"name": "kj-tls", "requires": ["kj", "kj-async", "openssl::openssl"]}) + components.update({"kj-tls": {"requires": ["kj", "kj-async", "openssl::openssl"]}}) if Version(self.version) >= "0.9.0": - components.append({ - "name": "capnp-websocket", - "requires": ["capnp", "capnp-rpc", "kj-http", "kj-async", "kj"], - }) + components.update({"capnp-websocket": {"requires": ["capnp", "capnp-rpc", "kj-http", "kj-async", "kj"]}}) - for component in components: - self._register_component(component) + return components + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CapnProto") + capnprotomacros = os.path.join(self._cmake_folder, "CapnProtoMacros.cmake") + self.cpp_info.set_property("cmake_build_modules", [capnprotomacros]) - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["capnpc"].system_libs = ["pthread"] - self.cpp_info.components["kj"].system_libs = ["pthread"] - self.cpp_info.components["kj-async"].system_libs = ["pthread"] - elif self.settings.os == "Windows": - self.cpp_info.components["kj-async"].system_libs = ["ws2_32"] + for name, comp_info in self._capnp_components.items(): + self.cpp_info.components[name].set_property("cmake_target_name", f"CapnProto::{name}") + self.cpp_info.components[name].builddirs.append(self._cmake_folder) + self.cpp_info.components[name].set_property("pkg_config_name", name) + self.cpp_info.components[name].libs = [name] + self.cpp_info.components[name].requires = comp_info.get("requires", []) + self.cpp_info.components[name].system_libs = comp_info.get("system_libs", []) # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "CapnProto" self.cpp_info.names["cmake_find_package_multi"] = "CapnProto" self.cpp_info.components["kj"].build_modules = [capnprotomacros] - bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH env var with: {bin_path}") - self.env_info.PATH.append(bin_path) - - def _register_component(self, component): - name = component["name"] - self.cpp_info.components[name].set_property("cmake_target_name", f"CapnProto::{name}") - self.cpp_info.components[name].builddirs.append(self._cmake_folder) - self.cpp_info.components[name].set_property("pkg_config_name", name) - self.cpp_info.components[name].libs = [name] - self.cpp_info.components[name].requires = component["requires"] + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/capnproto/all/patches/0015-disable-tests-for-1.0.0.patch b/recipes/capnproto/all/patches/0015-disable-tests-for-1.0.0.patch new file mode 100644 index 00000000000000..38c9dd1ee414b4 --- /dev/null +++ b/recipes/capnproto/all/patches/0015-disable-tests-for-1.0.0.patch @@ -0,0 +1,176 @@ +diff --git a/c++/Makefile.am b/c++/Makefile.am +index 1567491..95ebc4a 100644 +--- a/c++/Makefile.am ++++ b/c++/Makefile.am +@@ -457,171 +457,4 @@ endif LITE_MODE + # src/capnp/benchmark/... + # src/capnp/compiler/... + +-# Tests ============================================================== +- +-test_capnpc_inputs = \ +- src/capnp/test.capnp \ +- src/capnp/test-import.capnp \ +- src/capnp/test-import2.capnp \ +- src/capnp/compat/json-test.capnp +- +-test_capnpc_outputs = \ +- src/capnp/test.capnp.c++ \ +- src/capnp/test.capnp.h \ +- src/capnp/test-import.capnp.c++ \ +- src/capnp/test-import.capnp.h \ +- src/capnp/test-import2.capnp.c++ \ +- src/capnp/test-import2.capnp.h \ +- src/capnp/compat/json-test.capnp.c++ \ +- src/capnp/compat/json-test.capnp.h +- +-if USE_EXTERNAL_CAPNP +- +-test_capnpc_middleman: $(test_capnpc_inputs) +- @$(MKDIR_P) src +- $(CAPNP) compile --src-prefix=$(srcdir)/src -o$(CAPNPC_CXX):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman + +-else +- +-test_capnpc_middleman: capnp$(EXEEXT) capnpc-c++$(EXEEXT) $(test_capnpc_inputs) +- @$(MKDIR_P) src +- ./capnp$(EXEEXT) compile --src-prefix=$(srcdir)/src -o./capnpc-c++$(EXEEXT):src -I$(srcdir)/src $$(for FILE in $(test_capnpc_inputs); do echo $(srcdir)/$$FILE; done) +- touch test_capnpc_middleman +- +-endif +- +-$(test_capnpc_outputs): test_capnpc_middleman +- +-BUILT_SOURCES = $(test_capnpc_outputs) +- +-check_LIBRARIES = libcapnp-test.a +-libcapnp_test_a_SOURCES = \ +- src/capnp/test-util.c++ \ +- src/capnp/test-util.h +-nodist_libcapnp_test_a_SOURCES = $(test_capnpc_outputs) +- +-if LITE_MODE +- +-check_PROGRAMS = capnp-test +-compiler_tests = +-capnp_test_LDADD = libcapnp-test.a libcapnp.la libkj-test.la libkj.la +- +-else !LITE_MODE +- +-check_PROGRAMS = capnp-test capnp-evolution-test capnp-afl-testcase +-if HAS_FUZZING_ENGINE +- check_PROGRAMS += capnp-llvm-fuzzer-testcase +-endif +-heavy_tests = \ +- src/kj/async-test.c++ \ +- src/kj/async-xthread-test.c++ \ +- src/kj/async-coroutine-test.c++ \ +- src/kj/async-unix-test.c++ \ +- src/kj/async-unix-xthread-test.c++ \ +- src/kj/async-win32-test.c++ \ +- src/kj/async-win32-xthread-test.c++ \ +- src/kj/async-io-test.c++ \ +- src/kj/async-queue-test.c++ \ +- src/kj/parse/common-test.c++ \ +- src/kj/parse/char-test.c++ \ +- src/kj/std/iostream-test.c++ \ +- src/kj/compat/url-test.c++ \ +- src/kj/compat/http-test.c++ \ +- $(MAYBE_KJ_GZIP_TESTS) \ +- $(MAYBE_KJ_TLS_TESTS) \ +- src/capnp/canonicalize-test.c++ \ +- src/capnp/capability-test.c++ \ +- src/capnp/membrane-test.c++ \ +- src/capnp/schema-test.c++ \ +- src/capnp/schema-loader-test.c++ \ +- src/capnp/schema-parser-test.c++ \ +- src/capnp/dynamic-test.c++ \ +- src/capnp/stringify-test.c++ \ +- src/capnp/serialize-async-test.c++ \ +- src/capnp/serialize-text-test.c++ \ +- src/capnp/rpc-test.c++ \ +- src/capnp/rpc-twoparty-test.c++ \ +- src/capnp/ez-rpc-test.c++ \ +- src/capnp/compat/json-test.c++ \ +- src/capnp/compat/websocket-rpc-test.c++ \ +- src/capnp/compiler/lexer-test.c++ \ +- src/capnp/compiler/type-id-test.c++ +-capnp_test_LDADD = \ +- libcapnp-test.a \ +- libcapnpc.la \ +- libcapnp-rpc.la \ +- libcapnp-websocket.la \ +- libcapnp-json.la \ +- libcapnp.la \ +- libkj-http.la \ +- $(MAYBE_KJ_GZIP_LA) \ +- $(MAYBE_KJ_TLS_LA) \ +- libkj-async.la \ +- libkj-test.la \ +- libkj.la \ +- $(ASYNC_LIBS) \ +- $(PTHREAD_LIBS) +- +-endif !LITE_MODE +- +-capnp_test_CPPFLAGS = -Wno-deprecated-declarations +-capnp_test_SOURCES = \ +- src/kj/common-test.c++ \ +- src/kj/memory-test.c++ \ +- src/kj/refcount-test.c++ \ +- src/kj/array-test.c++ \ +- src/kj/list-test.c++ \ +- src/kj/string-test.c++ \ +- src/kj/string-tree-test.c++ \ +- src/kj/table-test.c++ \ +- src/kj/map-test.c++ \ +- src/kj/encoding-test.c++ \ +- src/kj/exception-test.c++ \ +- src/kj/debug-test.c++ \ +- src/kj/arena-test.c++ \ +- src/kj/units-test.c++ \ +- src/kj/tuple-test.c++ \ +- src/kj/one-of-test.c++ \ +- src/kj/function-test.c++ \ +- src/kj/io-test.c++ \ +- src/kj/mutex-test.c++ \ +- src/kj/time-test.c++ \ +- src/kj/threadlocal-test.c++ \ +- src/kj/filesystem-test.c++ \ +- src/kj/filesystem-disk-test.c++ \ +- src/kj/test-test.c++ \ +- src/capnp/common-test.c++ \ +- src/capnp/blob-test.c++ \ +- src/capnp/endian-test.c++ \ +- src/capnp/endian-fallback-test.c++ \ +- src/capnp/endian-reverse-test.c++ \ +- src/capnp/layout-test.c++ \ +- src/capnp/any-test.c++ \ +- src/capnp/message-test.c++ \ +- src/capnp/encoding-test.c++ \ +- src/capnp/orphan-test.c++ \ +- src/capnp/serialize-test.c++ \ +- src/capnp/serialize-packed-test.c++ \ +- src/capnp/fuzz-test.c++ \ +- $(heavy_tests) +- +-if !LITE_MODE +-capnp_evolution_test_LDADD = libcapnpc.la libcapnp.la libkj.la +-capnp_evolution_test_SOURCES = src/capnp/compiler/evolution-test.c++ +- +-capnp_afl_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +-capnp_afl_testcase_SOURCES = src/capnp/afl-testcase.c++ +- +-if HAS_FUZZING_ENGINE +- capnp_llvm_fuzzer_testcase_LDADD = libcapnp-test.a libcapnp-rpc.la libcapnp.la libkj.la libkj-async.la +- capnp_llvm_fuzzer_testcase_SOURCES = src/capnp/llvm-fuzzer-testcase.c++ +- capnp_llvm_fuzzer_testcase_LDFLAGS = $(LIB_FUZZING_ENGINE) +-endif +-endif !LITE_MODE +- +-if LITE_MODE +-TESTS = capnp-test +-else !LITE_MODE +-TESTS = capnp-test capnp-evolution-test src/capnp/compiler/capnp-test.sh +-endif !LITE_MODE diff --git a/recipes/capnproto/config.yml b/recipes/capnproto/config.yml index 89d97bce3d8502..887e41e533af81 100644 --- a/recipes/capnproto/config.yml +++ b/recipes/capnproto/config.yml @@ -1,4 +1,10 @@ versions: + "1.0.1": + folder: all + "1.0.0": + folder: all + "0.10.4": + folder: all "0.10.3": folder: all "0.10.1": diff --git a/recipes/cargs/all/CMakeLists.txt b/recipes/cargs/all/CMakeLists.txt deleted file mode 100644 index 42d6e7408fb330..00000000000000 --- a/recipes/cargs/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.9.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/cargs/all/conanfile.py b/recipes/cargs/all/conanfile.py index 6aeeae1d3b488d..6de6ac89acce0d 100644 --- a/recipes/cargs/all/conanfile.py +++ b/recipes/cargs/all/conanfile.py @@ -1,34 +1,37 @@ import os -from conans import ConanFile, CMake, tools -required_conan_version = ">=1.33.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 copy, get + +required_conan_version = ">=1.53.0" class CargsConan(ConanFile): name = "cargs" - description = "A lightweight getopt replacement that works on Linux, " \ - "Windows and macOS. Command line argument parser library" \ - " for C/C++. Can be used to parse argv and argc parameters." - url = "https://github.com/conan-io/conan-center-index" + description = ( + "A lightweight getopt replacement that works on Linux, " + "Windows and macOS. Command line argument parser library" + " for C/C++. Can be used to parse argv and argc parameters." + ) license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://likle.github.io/cargs/" topics = ("cargs", "cross-platform", "windows", "macos", "osx", "linux", "getopt", "getopt-long", "command-line-parser", "command-line", "arguments", "argument-parser") - exports_sources = ["CMakeLists.txt"] - generators = "cmake" + 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_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def config_options(self): if self.settings.os == "Windows": @@ -36,33 +39,48 @@ 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 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], - 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["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared and self.settings.os == "Windows" - cmake.configure(build_folder=self._build_subfolder) + cmake.configure() cmake.build(target="cargs") def package(self): - include_dir = os.path.join(self._source_subfolder, 'include') - lib_dir = os.path.join(self._build_subfolder, "lib") - bin_dir = os.path.join(self._build_subfolder, "bin") - - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) - self.copy("cargs.h", dst="include", src=include_dir) - self.copy(pattern="*.a", dst="lib", src=lib_dir, keep_path=False) - self.copy(pattern="*.lib", dst="lib", src=lib_dir, keep_path=False) - self.copy(pattern="*.dylib", dst="lib", src=lib_dir, keep_path=False) - self.copy(pattern="*.so*", dst="lib", src=lib_dir, keep_path=False, - symlinks=True) - self.copy(pattern="*.dll", dst="bin", src=bin_dir, keep_path=False) + copy(self, "LICENSE.md", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "cargs.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + for pattern in ["*.a", "*.so*", "*.dylib", "*.lib"]: + copy(self, pattern, + dst=os.path.join(self.package_folder, "lib"), + src=self.build_folder, + keep_path=False) + copy(self, "*.dll", + dst=os.path.join(self.package_folder, "bin"), + src=self.build_folder, + keep_path=False) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["cargs"] diff --git a/recipes/cargs/all/test_package/CMakeLists.txt b/recipes/cargs/all/test_package/CMakeLists.txt index f6bb6f79f518f1..2d259c06a7d890 100644 --- a/recipes/cargs/all/test_package/CMakeLists.txt +++ b/recipes/cargs/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 C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cargs REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE cargs::cargs) set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 11) diff --git a/recipes/cargs/all/test_package/conanfile.py b/recipes/cargs/all/test_package/conanfile.py index 4903f1a7e8fa0f..ef5d7042163ecc 100644 --- a/recipes/cargs/all/test_package/conanfile.py +++ b/recipes/cargs/all/test_package/conanfile.py @@ -1,9 +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" + 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.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/cargs/all/test_v1_package/CMakeLists.txt b/recipes/cargs/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cargs/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/cargs/all/test_v1_package/conanfile.py b/recipes/cargs/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6c9d5dba712c72 --- /dev/null +++ b/recipes/cargs/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cassandra-cpp-driver/all/CMakeLists.txt b/recipes/cassandra-cpp-driver/all/CMakeLists.txt deleted file mode 100644 index 7f03984bd91495..00000000000000 --- a/recipes/cassandra-cpp-driver/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cassandra C CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/cassandra-cpp-driver/all/conandata.yml b/recipes/cassandra-cpp-driver/all/conandata.yml index 0ca8371b0b30f9..169437d0e897cf 100644 --- a/recipes/cassandra-cpp-driver/all/conandata.yml +++ b/recipes/cassandra-cpp-driver/all/conandata.yml @@ -1,10 +1,70 @@ sources: + "2.17.1": + url: "https://github.com/datastax/cpp-driver/archive/2.17.1.tar.gz" + sha256: "53b4123aad59b39f2da0eb0ce7fe0e92559f7bba0770b2e958254f17bffcd7cf" + "2.17.0": + url: "https://github.com/datastax/cpp-driver/archive/2.17.0.tar.gz" + sha256: "075af6a6920b0a8b12e37b8e5aa335b0c7919334aa1b451642668e6e37c5372f" + "2.16.2": + url: "https://github.com/datastax/cpp-driver/archive/2.16.2.tar.gz" + sha256: "de60751bd575b5364c2c5a17a24a40f3058264ea2ee6fef19de126ae550febc9" "2.15.3": - url: "https://github.com/datastax/cpp-driver/archive/2.15.3.zip" - sha256: "494b35418f1eaa86d80572a4254b7fae88a1341dcda83788ed038ce4f39117cb" + url: "https://github.com/datastax/cpp-driver/archive/2.15.3.tar.gz" + sha256: "eccb53c5151621c3b647fc83781a542cfb93e76687b4178ebce418fc4c817293" patches: + "2.17.1": + - patch_file: "patches/2.16.2/fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/2.15.3/fix-rapidjson.patch" + patch_description: "fix include path for cci package" + patch_type: "conan" + - patch_file: "patches/2.15.3/fix-atomic.patch" + patch_description: "Adapt MemoryOrder definition for C++ 20" + patch_type: "portability" + patch_source: "https://github.com/datastax/cpp-driver/pull/533" + - patch_file: "patches/2.15.3/remove-attribute-for-msvc.patch" + patch_description: "remove attribute for msvc" + patch_type: "portability" + "2.17.0": + - patch_file: "patches/2.16.2/fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/2.15.3/fix-rapidjson.patch" + patch_description: "fix include path for cci package" + patch_type: "conan" + - patch_file: "patches/2.15.3/fix-atomic.patch" + patch_description: "Adapt MemoryOrder definition for C++ 20" + patch_type: "portability" + patch_source: "https://github.com/datastax/cpp-driver/pull/533" + - patch_file: "patches/2.15.3/remove-attribute-for-msvc.patch" + patch_description: "remove attribute for msvc" + patch_type: "portability" + "2.16.2": + - patch_file: "patches/2.16.2/fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/2.15.3/fix-rapidjson.patch" + patch_description: "fix include path for cci package" + patch_type: "conan" + - patch_file: "patches/2.15.3/fix-atomic.patch" + patch_description: "Adapt MemoryOrder definition for C++ 20" + patch_type: "portability" + patch_source: "https://github.com/datastax/cpp-driver/pull/533" + - patch_file: "patches/2.15.3/remove-attribute-for-msvc.patch" + patch_description: "remove attribute for msvc" + patch_type: "portability" "2.15.3": - - base_path: "source_subfolder" - patch_file: "patches/2.15.3/fix-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/2.15.3/fix-rapidjson.patch" + - patch_file: "patches/2.15.3/fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/2.15.3/fix-rapidjson.patch" + patch_description: "fix include path for cci package" + patch_type: "conan" + - patch_file: "patches/2.15.3/fix-atomic.patch" + patch_description: "Adapt MemoryOrder definition for C++ 20" + patch_type: "portability" + patch_source: "https://github.com/datastax/cpp-driver/pull/533" + - patch_file: "patches/2.15.3/remove-attribute-for-msvc.patch" + patch_description: "remove attribute for msvc" + patch_type: "portability" diff --git a/recipes/cassandra-cpp-driver/all/conanfile.py b/recipes/cassandra-cpp-driver/all/conanfile.py index 76b1d99adf12b9..5cfe8683bd139a 100644 --- a/recipes/cassandra-cpp-driver/all/conanfile.py +++ b/recipes/cassandra-cpp-driver/all/conanfile.py @@ -1,19 +1,21 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file, rm +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.build import check_min_cppstd import os -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.53.0" class CassandraCppDriverConan(ConanFile): name = "cassandra-cpp-driver" + description = "DataStax C/C++ Driver for Apache Cassandra and DataStax Products" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://docs.datastax.com/en/developer/cpp-driver/" - description = "DataStax C/C++ Driver for Apache Cassandra and DataStax Products" - topics = ("cassandra", "cpp-driver", "database", "conan-recipe") - - settings = "os", "compiler", "build_type", "arch" + topics = ("cassandra", "cpp-driver", "database") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -34,19 +36,14 @@ class CassandraCppDriverConan(ConanFile): "with_kerberos": False, "use_timerfd": True, } - short_paths = True - generators = "cmake" - exports_sources = [ - "CMakeLists.txt", - "patches/*" - ] - - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -55,24 +52,30 @@ 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("libuv/1.44.1") + self.requires("libuv/1.46.0") self.requires("http_parser/2.9.4") - self.requires("rapidjson/cci.20211112") + self.requires("rapidjson/cci.20220822") if self.options.with_openssl: - self.requires("openssl/1.1.1q") + self.requires("openssl/[>=1.1 <4]") if self.options.with_zlib: - self.requires("minizip/1.2.12") - self.requires("zlib/1.2.12") + self.requires("minizip/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.use_atomic == "boost": - self.requires("boost/1.79.0") + self.requires("boost/1.83.0") def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if self.options.use_atomic == "boost": # Compilation error on Linux if self.settings.os == "Linux": @@ -84,72 +87,77 @@ def validate(self): "Kerberos is not supported at the moment") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - 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, "CMakeLists.txt"), - "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"", - "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\" OR \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"AppleClang\"") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["VERSION"] = self.version - self._cmake.definitions["CASS_BUILD_EXAMPLES"] = False - self._cmake.definitions["CASS_BUILD_INTEGRATION_TESTS"] = False - self._cmake.definitions["CASS_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["CASS_BUILD_STATIC"] = not self.options.shared - self._cmake.definitions["CASS_BUILD_TESTS"] = False - self._cmake.definitions["CASS_BUILD_UNIT_TESTS"] = False - self._cmake.definitions["CASS_DEBUG_CUSTOM_ALLOC"] = False - self._cmake.definitions["CASS_INSTALL_HEADER_IN_SUBDIR"] = self.options.install_header_in_subdir - self._cmake.definitions["CASS_INSTALL_PKG_CONFIG"] = False + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["VERSION"] = self.version + tc.variables["CASS_BUILD_EXAMPLES"] = False + tc.variables["CASS_BUILD_INTEGRATION_TESTS"] = False + tc.variables["CASS_BUILD_SHARED"] = self.options.shared + tc.variables["CASS_BUILD_STATIC"] = not self.options.shared + tc.variables["CASS_BUILD_TESTS"] = False + tc.variables["CASS_BUILD_UNIT_TESTS"] = False + tc.variables["CASS_DEBUG_CUSTOM_ALLOC"] = False + tc.variables["CASS_INSTALL_HEADER_IN_SUBDIR"] = self.options.install_header_in_subdir + tc.variables["CASS_INSTALL_PKG_CONFIG"] = False if self.options.use_atomic == "boost": - self._cmake.definitions["CASS_USE_BOOST_ATOMIC"] = True - self._cmake.definitions["CASS_USE_STD_ATOMIC"] = False + tc.variables["CASS_USE_BOOST_ATOMIC"] = True + tc.variables["CASS_USE_STD_ATOMIC"] = False elif self.options.use_atomic == "std": - self._cmake.definitions["CASS_USE_BOOST_ATOMIC"] = False - self._cmake.definitions["CASS_USE_STD_ATOMIC"] = True + tc.variables["CASS_USE_BOOST_ATOMIC"] = False + tc.variables["CASS_USE_STD_ATOMIC"] = True else: - self._cmake.definitions["CASS_USE_BOOST_ATOMIC"] = False - self._cmake.definitions["CASS_USE_STD_ATOMIC"] = False + tc.variables["CASS_USE_BOOST_ATOMIC"] = False + tc.variables["CASS_USE_STD_ATOMIC"] = False - self._cmake.definitions["CASS_USE_OPENSSL"] = self.options.with_openssl - self._cmake.definitions["CASS_USE_STATIC_LIBS"] = False - self._cmake.definitions["CASS_USE_ZLIB"] = self.options.with_zlib - self._cmake.definitions["CASS_USE_LIBSSH2"] = False + tc.variables["CASS_USE_OPENSSL"] = self.options.with_openssl + tc.variables["CASS_USE_STATIC_LIBS"] = False + tc.variables["CASS_USE_ZLIB"] = self.options.with_zlib + tc.variables["CASS_USE_LIBSSH2"] = False # FIXME: To use kerberos, its conan package is needed. Uncomment this when kerberos conan package is ready. - # self._cmake.definitions["CASS_USE_KERBEROS"] = self.options.with_kerberos + # tc.variables["CASS_USE_KERBEROS"] = self.options.with_kerberos if self.settings.os == "Linux": - self._cmake.definitions["CASS_USE_TIMERFD"] = self.options.use_timerfd + tc.variables["CASS_USE_TIMERFD"] = self.options.use_timerfd + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() - self._cmake.configure() - return self._cmake + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"", + "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\" OR \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"AppleClang\"") + rm(self, "Findlibssh2.cmake", os.path.join(self.source_folder, "cmake")) + rm(self, "Findlibuv.cmake", os.path.join(self.source_folder, "cmake")) + rm(self, "FindOpenSSL.cmake", os.path.join(self.source_folder, "cmake")) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE.txt", 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 = tools.collect_libs(self) + self.cpp_info.libs = ["cassandra" if self.options.shared else "cassandra_static"] if self.settings.os == "Windows": self.cpp_info.system_libs.extend(["iphlpapi", "psapi", "wsock32", "crypt32", "ws2_32", "userenv", "version"]) if not self.options.shared: self.cpp_info.defines = ["CASS_STATIC"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + diff --git a/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-atomic.patch b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-atomic.patch new file mode 100644 index 00000000000000..64a29de126f9f6 --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-atomic.patch @@ -0,0 +1,28 @@ +diff --git a/src/atomic/atomic_std.hpp b/src/atomic/atomic_std.hpp +index 2ad0103..08418a9 100644 +--- a/src/atomic/atomic_std.hpp ++++ b/src/atomic/atomic_std.hpp +@@ -18,16 +18,17 @@ + #define DATASTAX_INTERNAL_ATOMIC_STD_HPP + + #include ++#include + + namespace datastax { namespace internal { + + enum MemoryOrder { +- MEMORY_ORDER_RELAXED = std::memory_order_relaxed, +- MEMORY_ORDER_CONSUME = std::memory_order_consume, +- MEMORY_ORDER_ACQUIRE = std::memory_order_acquire, +- MEMORY_ORDER_RELEASE = std::memory_order_release, +- MEMORY_ORDER_ACQ_REL = std::memory_order_acq_rel, +- MEMORY_ORDER_SEQ_CST = std::memory_order_seq_cst ++ MEMORY_ORDER_RELAXED = static_cast::type>(std::memory_order_relaxed), ++ MEMORY_ORDER_CONSUME = static_cast::type>(std::memory_order_consume), ++ MEMORY_ORDER_ACQUIRE = static_cast::type>(std::memory_order_acquire), ++ MEMORY_ORDER_RELEASE = static_cast::type>(std::memory_order_release), ++ MEMORY_ORDER_ACQ_REL = static_cast::type>(std::memory_order_acq_rel), ++ MEMORY_ORDER_SEQ_CST = static_cast::type>(std::memory_order_seq_cst) + }; + + template diff --git a/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-cmake.patch b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-cmake.patch index 191d2eb7e8174a..9406ccc60d7aa9 100644 --- a/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-cmake.patch +++ b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-cmake.patch @@ -1,43 +1,87 @@ - CMakeLists.txt | 4 --- - src/CMakeLists.txt | 84 ++++++++++++++++++++++++++++++++++++------------------ - 2 files changed, 57 insertions(+), 31 deletions(-) - diff --git a/CMakeLists.txt b/CMakeLists.txt -index c6150948b..669eb086e 100644 +index c615094..b10d9c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1,6 +1,3 @@ --cmake_minimum_required(VERSION 2.8.12) --project(cassandra C CXX) -- - set(CASS_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - set(CASS_SRC_DIR "${CASS_ROOT_DIR}/src") - set(CASS_INCLUDE_DIR "${CASS_ROOT_DIR}/include") -@@ -81,7 +78,6 @@ endif() - # Dependencies - #------------------------ +@@ -164,7 +164,7 @@ endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR + "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # Enable C++11 support to use std::atomic +- if(CASS_USE_STD_ATOMIC) ++ if(1) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() + +diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake +index 9052472..3f65adb 100644 +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -21,28 +21,28 @@ if(NOT LIBUV_ROOT_DIR) + endif() + + # Ensure libuv was found +-find_package(Libuv "1.0.0") +-if(WIN32 AND NOT LIBUV_FOUND) ++find_package(libuv "1.0.0") ++if(WIN32 AND NOT libuv_FOUND) + message(STATUS "Unable to Locate libuv: Third party build step will be performed") + include(ExternalProject-libuv) +-elseif(NOT LIBUV_FOUND) ++elseif(NOT libuv_FOUND) + message(FATAL_ERROR "Unable to Locate libuv: libuv v1.0.0+ is required") + endif() + +-if(LIBUV_VERSION VERSION_LESS "1.0") +- message(FATAL_ERROR "Libuv version ${LIBUV_VERSION} is not " ++if(libuv_VERSION VERSION_LESS "1.0") ++ message(FATAL_ERROR "libuv version ${libuv_VERSION} is not " + " supported. Please updgrade to libuv version 1.0 or greater in order to " + "utilize the driver.") + endif() --include(Dependencies) - include(ClangFormat) +-if(LIBUV_VERSION VERSION_LESS "1.6") +- message(WARNING "Libuv version ${LIBUV_VERSION} does not support custom " ++if(libuv_VERSION VERSION_LESS "1.6") ++ message(WARNING "libuv version ${libuv_VERSION} does not support custom " + "memory allocators (version 1.6 or greater required)") + endif() + + # Assign libuv include and libraries +-set(CASS_INCLUDES ${CASS_INCLUDES} ${LIBUV_INCLUDE_DIRS}) +-set(CASS_LIBS ${CASS_LIBS} ${LIBUV_LIBRARIES}) ++set(CASS_INCLUDES ${CASS_INCLUDES} ${libuv_INCLUDE_DIRS}) ++set(CASS_LIBS ${CASS_LIBS} ${libuv_LIBRARIES}) + + # libuv and gtests require thread library + if(NOT WIN32) +@@ -192,3 +192,20 @@ if(CASS_USE_BOOST_ATOMIC) + endif() + endif() - #------------------------ ++#------------------------ ++# RapidJSON ++#------------------------ ++find_package(RapidJSON REQUIRED CONFIG) ++set(CASS_LIBS ${CASS_LIBS} rapidjson) ++ ++#------------------------ ++# http_parser ++#------------------------ ++find_package(http_parser REQUIRED CONFIG) ++set(CASS_LIBS ${CASS_LIBS} http_parser::http_parser) ++ ++#------------------------ ++# minizip ++#------------------------ ++find_package(minizip REQUIRED CONFIG) ++set(CASS_LIBS ${CASS_LIBS} minizip::minizip) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 06b84b759..7e81b2a06 100644 +index 06b84b7..41b23f2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -1,6 +1,50 @@ +@@ -1,6 +1,41 @@ include(CheckSymbolExists) include(CheckCXXSourceCompiles) -+#------------------------ -+# Windows libraries -+#------------------------ -+ -+if(WIN32) -+ # Assign additional library requirements for Windows -+ set(CASS_LIBS iphlpapi psapi wsock32 crypt32 ws2_32 userenv version) -+endif() -+ +#------------------------ +# Libuv +#------------------------ @@ -76,7 +120,7 @@ index 06b84b759..7e81b2a06 100644 file(GLOB SOURCES *.cpp *.hpp) if(APPLE) -@@ -38,18 +82,14 @@ endif() +@@ -38,18 +73,14 @@ endif() add_subdirectory(third_party/curl) add_subdirectory(third_party/hdr_histogram) @@ -90,16 +134,17 @@ index 06b84b759..7e81b2a06 100644 - third_party/http-parser - third_party/minizip - third_party/mt19937_64 +- third_party/rapidjson/rapidjson +- third_party/sparsehash/src) + third_party/curl # FIXME: Use conan package + third_party/hdr_histogram # FIXME: Use conan package + third_party/mt19937_64 # FIXME: Use conan package -+ third_party/sparsehash/src) # FIXME: Use conan package - third_party/rapidjson/rapidjson -- third_party/sparsehash/src) ++ third_party/sparsehash/src # FIXME: Use conan package ++) list(APPEND INCLUDE_DIRS ${CASS_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) -@@ -69,12 +109,6 @@ if(WIN32) +@@ -69,12 +100,6 @@ if(WIN32) endif() endif() @@ -112,40 +157,27 @@ index 06b84b759..7e81b2a06 100644 #------------------------------ # Build configured header #------------------------------ -@@ -130,11 +164,11 @@ if(CASS_BUILD_SHARED) - add_library(cassandra SHARED +@@ -131,8 +156,7 @@ if(CASS_BUILD_SHARED) ${SOURCES} $ -- $ + $ - $ - $) -+ $) ++ ) target_link_libraries(cassandra ${CASS_LIBS}) -- target_include_directories(cassandra PRIVATE ${INCLUDE_DIRS} ${CASS_INCLUDES}) -+ target_include_directories(cassandra PRIVATE ${INCLUDE_DIRS}) -+ -+ conan_target_link_libraries(cassandra) - - set_target_properties(cassandra PROPERTIES OUTPUT_NAME cassandra) - set_target_properties(cassandra PROPERTIES VERSION ${PROJECT_VERSION_STRING} SOVERSION ${PROJECT_VERSION_MAJOR}) -@@ -167,11 +201,12 @@ if(CASS_BUILD_STATIC) - add_library(cassandra_static STATIC + target_include_directories(cassandra PRIVATE ${INCLUDE_DIRS} ${CASS_INCLUDES}) + +@@ -168,8 +192,7 @@ if(CASS_BUILD_STATIC) ${SOURCES} $ -- $ + $ - $ - $) -+ $) -+ ++ ) target_link_libraries(cassandra_static ${CASS_LIBS}) -- target_include_directories(cassandra_static PRIVATE ${INCLUDE_DIRS} ${CASS_INCLUDES}) -+ target_include_directories(cassandra_static PRIVATE ${INCLUDE_DIRS}) -+ -+ conan_target_link_libraries(cassandra_static) - - set_target_properties(cassandra_static PROPERTIES OUTPUT_NAME cassandra_static) - set_target_properties(cassandra_static PROPERTIES VERSION ${PROJECT_VERSION_STRING} SOVERSION ${PROJECT_VERSION_MAJOR}) -@@ -274,11 +309,6 @@ if(CASS_BUILD_SHARED) + target_include_directories(cassandra_static PRIVATE ${INCLUDE_DIRS} ${CASS_INCLUDES}) + +@@ -274,11 +297,6 @@ if(CASS_BUILD_SHARED) endif() endif() endif() diff --git a/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-rapidjson.patch b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-rapidjson.patch index 7c7b5d16994d78..91811710ffbe44 100644 --- a/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-rapidjson.patch +++ b/recipes/cassandra-cpp-driver/all/patches/2.15.3/fix-rapidjson.patch @@ -1,21 +1,5 @@ - src/CMakeLists.txt | 1 - - src/json.hpp | 8 ++++---- - 2 files changed, 4 insertions(+), 5 deletions(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 7e81b2a06..2f3229292 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -89,7 +89,6 @@ list(APPEND INCLUDE_DIRS - third_party/hdr_histogram # FIXME: Use conan package - third_party/mt19937_64 # FIXME: Use conan package - third_party/sparsehash/src) # FIXME: Use conan package -- third_party/rapidjson/rapidjson - - list(APPEND INCLUDE_DIRS ${CASS_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) - diff --git a/src/json.hpp b/src/json.hpp -index 620536e55..6003f2521 100644 +index 620536e..6003f25 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -48,13 +48,13 @@ static void delete_(T* ptr) { diff --git a/recipes/cassandra-cpp-driver/all/patches/2.15.3/remove-attribute-for-msvc.patch b/recipes/cassandra-cpp-driver/all/patches/2.15.3/remove-attribute-for-msvc.patch new file mode 100644 index 00000000000000..216ee8df654e9c --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/patches/2.15.3/remove-attribute-for-msvc.patch @@ -0,0 +1,18 @@ +diff --git a/src/third_party/sparsehash/src/sparsehash/internal/hashtable-common.h b/src/third_party/sparsehash/src/sparsehash/internal/hashtable-common.h +index bac2b88..e802b5c 100644 +--- a/src/third_party/sparsehash/src/sparsehash/internal/hashtable-common.h ++++ b/src/third_party/sparsehash/src/sparsehash/internal/hashtable-common.h +@@ -50,8 +50,13 @@ + _START_GOOGLE_NAMESPACE_ + + template struct SparsehashCompileAssert { }; ++#if defined(_MSC_VER) ++#define SPARSEHASH_COMPILE_ASSERT(expr, msg) \ ++ typedef SparsehashCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] ++#else + #define SPARSEHASH_COMPILE_ASSERT(expr, msg) \ + __attribute__((unused)) typedef SparsehashCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] ++#endif + + namespace sparsehash_internal { + diff --git a/recipes/cassandra-cpp-driver/all/patches/2.16.2/fix-cmake.patch b/recipes/cassandra-cpp-driver/all/patches/2.16.2/fix-cmake.patch new file mode 100644 index 00000000000000..5a69b0d7d12b14 --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/patches/2.16.2/fix-cmake.patch @@ -0,0 +1,201 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c615094..b10d9c9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -164,7 +164,7 @@ endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR + "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # Enable C++11 support to use std::atomic +- if(CASS_USE_STD_ATOMIC) ++ if(1) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() + +diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake +index 9052472..4701133 100644 +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -21,28 +21,28 @@ if(NOT LIBUV_ROOT_DIR) + endif() + + # Ensure libuv was found +-find_package(Libuv "1.0.0") +-if(WIN32 AND NOT LIBUV_FOUND) ++find_package(libuv "1.0.0") ++if(WIN32 AND NOT libuv_FOUND) + message(STATUS "Unable to Locate libuv: Third party build step will be performed") + include(ExternalProject-libuv) +-elseif(NOT LIBUV_FOUND) ++elseif(NOT libuv_FOUND) + message(FATAL_ERROR "Unable to Locate libuv: libuv v1.0.0+ is required") + endif() + +-if(LIBUV_VERSION VERSION_LESS "1.0") +- message(FATAL_ERROR "Libuv version ${LIBUV_VERSION} is not " ++if(libuv_VERSION VERSION_LESS "1.0") ++ message(FATAL_ERROR "Libuv version ${libuv_VERSION} is not " + " supported. Please updgrade to libuv version 1.0 or greater in order to " + "utilize the driver.") + endif() + +-if(LIBUV_VERSION VERSION_LESS "1.6") +- message(WARNING "Libuv version ${LIBUV_VERSION} does not support custom " ++if(libuv_VERSION VERSION_LESS "1.6") ++ message(WARNING "Libuv version ${libuv_VERSION} does not support custom " + "memory allocators (version 1.6 or greater required)") + endif() + + # Assign libuv include and libraries +-set(CASS_INCLUDES ${CASS_INCLUDES} ${LIBUV_INCLUDE_DIRS}) +-set(CASS_LIBS ${CASS_LIBS} ${LIBUV_LIBRARIES}) ++set(CASS_INCLUDES ${CASS_INCLUDES} ${libuv_INCLUDE_DIRS}) ++set(CASS_LIBS ${CASS_LIBS} ${libuv_LIBRARIES}) + + # libuv and gtests require thread library + if(NOT WIN32) +@@ -192,3 +192,20 @@ if(CASS_USE_BOOST_ATOMIC) + endif() + endif() + ++#------------------------ ++# RapidJSON ++#------------------------ ++find_package(RapidJSON REQUIRED CONFIG) ++set(CASS_LIBS ${CASS_LIBS} rapidjson) ++ ++#------------------------ ++# http_parser ++#------------------------ ++find_package(http_parser REQUIRED CONFIG) ++set(CASS_LIBS ${CASS_LIBS} http_parser::http_parser) ++ ++#------------------------ ++# minizip ++#------------------------ ++find_package(minizip REQUIRED CONFIG) ++set(CASS_LIBS ${CASS_LIBS} minizip::minizip) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d662718..088a153 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,6 +1,42 @@ + include(CheckSymbolExists) + include(CheckCXXSourceCompiles) + ++#------------------------ ++# Libuv ++#------------------------ ++ ++if(NOT WIN32) ++ set(CMAKE_THREAD_PREFER_PTHREAD 1) ++ set(THREADS_PREFER_PTHREAD_FLAG 1) ++endif() ++ ++find_package(Threads REQUIRED) ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_THREAD_LIBS_INIT}") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_THREAD_LIBS_INIT}") ++if(NOT WIN32 AND ${CMAKE_VERSION} VERSION_LESS "3.1.0") ++ # FindThreads in CMake versions < v3.1.0 do not have the THREADS_PREFER_PTHREAD_FLAG to prefer -pthread ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") ++endif() ++ ++#------------------------ ++# Boost ++#------------------------ ++ ++if(CASS_USE_BOOST_ATOMIC) ++ # Ensure Boost auto linking is disabled (defaults to auto linking on Windows) ++ if(WIN32) ++ add_definitions(-DBOOST_ALL_NO_LIB) ++ endif() ++ ++ # Determine if additional Boost definitions are required for driver/executables ++ if(NOT WIN32) ++ # Handle explicit initialization warning in atomic/details/casts ++ add_definitions(-Wno-missing-field-initializers) ++ endif() ++endif() ++ ++ + file(GLOB SOURCES *.cpp *.hpp) + + if(APPLE) +@@ -38,18 +74,14 @@ endif() + + add_subdirectory(third_party/curl) + add_subdirectory(third_party/hdr_histogram) +-add_subdirectory(third_party/http-parser) +-add_subdirectory(third_party/minizip) + add_subdirectory(third_party/sparsehash) + + list(APPEND INCLUDE_DIRS +- third_party/curl +- third_party/hdr_histogram +- third_party/http-parser +- third_party/minizip +- third_party/mt19937_64 +- third_party/rapidjson/rapidjson +- third_party/sparsehash/src) ++ third_party/curl # FIXME: Use conan package ++ third_party/hdr_histogram # FIXME: Use conan package ++ third_party/mt19937_64 # FIXME: Use conan package ++ third_party/sparsehash/src # FIXME: Use conan package ++) + + list(APPEND INCLUDE_DIRS ${CASS_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + +@@ -69,13 +101,6 @@ if(WIN32) + endif() + endif() + +-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion -Wno-sign-conversion -Wno-shorten-64-to-32 -Wno-undefined-var-template -Werror") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-implicit-int-float-conversion") +-elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # To many superfluous warnings generated with GCC when using -Wconversion (see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40752) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") +-endif() +- + #------------------------------ + # Build configured header + #------------------------------ +@@ -122,7 +147,6 @@ configure_file( + ${CASS_ROOT_DIR}/driver_config.hpp.in + ${CMAKE_CURRENT_SOURCE_DIR}/driver_config.hpp) + +- + #------------------------------ + # Targets + #------------------------------ +@@ -132,8 +156,7 @@ if(CASS_BUILD_SHARED) + ${SOURCES} + $ + $ +- $ +- $) ++ ) + target_link_libraries(cassandra ${CASS_LIBS}) + target_include_directories(cassandra PRIVATE ${INCLUDE_DIRS} ${CASS_INCLUDES}) + +@@ -169,8 +192,7 @@ if(CASS_BUILD_STATIC) + ${SOURCES} + $ + $ +- $ +- $) ++ ) + target_link_libraries(cassandra_static ${CASS_LIBS}) + target_include_directories(cassandra_static PRIVATE ${INCLUDE_DIRS} ${CASS_INCLUDES}) + +@@ -275,11 +297,6 @@ if(CASS_BUILD_SHARED) + endif() + endif() + endif() +- if(WIN32) +- install(FILES $ +- DESTINATION "${INSTALL_DLL_EXE_DIR}" +- OPTIONAL) +- endif() + endif() + + if(CASS_BUILD_STATIC) diff --git a/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt b/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt index 1a95218e3d7a51..4d590e1005c294 100644 --- a/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt +++ b/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cassandra-cpp-driver REQUIRED CONFIG) -add_executable(${PROJECT_NAME} main.cpp) - -conan_target_link_libraries(${PROJECT_NAME}) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cassandra-cpp-driver::cassandra-cpp-driver) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cassandra-cpp-driver/all/test_package/conanfile.py b/recipes/cassandra-cpp-driver/all/test_package/conanfile.py index 0399475aec9873..a9fb96656f2039 100644 --- a/recipes/cassandra-cpp-driver/all/test_package/conanfile.py +++ b/recipes/cassandra-cpp-driver/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -import os.path -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 CassandraCppDriverTestConan(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) @@ -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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cassandra-cpp-driver/all/test_package/main.cpp b/recipes/cassandra-cpp-driver/all/test_package/test_package.cpp similarity index 100% rename from recipes/cassandra-cpp-driver/all/test_package/main.cpp rename to recipes/cassandra-cpp-driver/all/test_package/test_package.cpp diff --git a/recipes/cassandra-cpp-driver/all/test_v1_package/CMakeLists.txt b/recipes/cassandra-cpp-driver/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..925ecbe19e448d --- /dev/null +++ b/recipes/cassandra-cpp-driver/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +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/base64/all/test_v1_package/conanfile.py b/recipes/cassandra-cpp-driver/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/base64/all/test_v1_package/conanfile.py rename to recipes/cassandra-cpp-driver/all/test_v1_package/conanfile.py diff --git a/recipes/cassandra-cpp-driver/config.yml b/recipes/cassandra-cpp-driver/config.yml index 9792bd17fcc93c..c8b1c8ef4703a6 100644 --- a/recipes/cassandra-cpp-driver/config.yml +++ b/recipes/cassandra-cpp-driver/config.yml @@ -1,3 +1,9 @@ versions: + "2.17.1": + folder: all + "2.17.0": + folder: all + "2.16.2": + folder: all "2.15.3": folder: all diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml index 49bcf956ad89ac..85ef2d28e9683d 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.5.0": + url: "https://github.com/catchorg/Catch2/archive/v3.5.0.tar.gz" + sha256: "f6d4f8d78a9b59ec72a81d49f58d18eb317372ac07f8d9432710a079e69fd66a" "3.4.0": url: "https://github.com/catchorg/Catch2/archive/v3.4.0.tar.gz" sha256: "122928b814b75717316c71af69bd2b43387643ba076a6ec16e7882bfb2dfacbb" diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index 846bd38ba4e58b..df92faa46a85a3 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.0": + folder: 3.x.x "3.4.0": folder: 3.x.x "3.3.2": diff --git a/recipes/ccache/all/conandata.yml b/recipes/ccache/all/conandata.yml index 1eab23f47e9eba..ca431f6e0685ba 100644 --- a/recipes/ccache/all/conandata.yml +++ b/recipes/ccache/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.8.3": + url: "https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3.tar.xz" + sha256: "e47374c810b248cfca3665ee1d86c7c763ffd68d9944bc422d9c1872611f2b11" "4.8.2": url: "https://github.com/ccache/ccache/releases/download/v4.8.2/ccache-4.8.2.tar.xz" sha256: "3d3fb3f888a5b16c4fa7ee5214cca76348afd6130e8443de5f6f2424f2076a49" @@ -12,6 +15,10 @@ sources: url: "https://github.com/ccache/ccache/releases/download/v4.7.4/ccache-4.7.4.tar.xz" sha256: "df0c64d15d3efaf0b4f6837dd6b1467e40eeaaa807db25ce79c3a08a46a84e36" patches: + "4.8.3": + - patch_file: "patches/4.8-cmake-msvc-runtime.patch" + patch_description: "fixup MSVC runtime" + patch_type: "conan" "4.8.2": - patch_file: "patches/4.8-cmake-msvc-runtime.patch" patch_description: "fixup MSVC runtime" diff --git a/recipes/ccache/config.yml b/recipes/ccache/config.yml index a08cbff67b8116..98dd3df9a94deb 100644 --- a/recipes/ccache/config.yml +++ b/recipes/ccache/config.yml @@ -1,4 +1,6 @@ versions: + "4.8.3": + folder: all "4.8.2": folder: all "4.8.1": diff --git a/recipes/ccfits/all/conanfile.py b/recipes/ccfits/all/conanfile.py index c9d53caa2f748a..ddf9d5732efd3a 100644 --- a/recipes/ccfits/all/conanfile.py +++ b/recipes/ccfits/all/conanfile.py @@ -1,21 +1,21 @@ -from conan import ConanFile +from conan import ConanFile, conan_version 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 from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.54.0" class CcfitsConan(ConanFile): name = "ccfits" description = "CCfits is an object oriented interface to the cfitsio library." - license = "ISC" - topics = ("ccfits", "fits", "image", "nasa", "astronomy", "astrophysics", "space") + license = "CFITSIO" + topics = ("fits", "image", "nasa", "astronomy", "astrophysics", "space") homepage = "https://heasarc.gsfc.nasa.gov/fitsio/ccfits" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,32 +35,35 @@ 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("cfitsio/4.1.0") + # transitive_headers: CCfits/CCfits.h includes fitsio.h + self.requires("cfitsio/4.2.0", transitive_headers=True) def validate_build(self): if Version(self.version) >= "2.6": if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) + else: + if conan_version >= "2": + # FIXME: c3i linter complains, but function is there + # https://docs.conan.io/2.0/reference/tools/build.html?highlight=check_min_cppstd#conan-tools-build-check-max-cppstd + import sys + check_max_cppstd = getattr(sys.modules["conan.tools.build"], "check_max_cppstd") + # C++17 and higher not supported in ccfits < 2.6 due to auto_ptr + check_max_cppstd(self, 14) 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) # Export symbols for msvc shared tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True - # 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() diff --git a/recipes/ccfits/all/test_v1_package/CMakeLists.txt b/recipes/ccfits/all/test_v1_package/CMakeLists.txt index 20c81e8e8eb120..0d20897301b68b 100644 --- a/recipes/ccfits/all/test_v1_package/CMakeLists.txt +++ b/recipes/ccfits/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(ccfits REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE ccfits::ccfits) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cd3-boost-unit-definitions/all/conanfile.py b/recipes/cd3-boost-unit-definitions/all/conanfile.py index 23bdb146d0b4ea..2b48b57aef4a19 100644 --- a/recipes/cd3-boost-unit-definitions/all/conanfile.py +++ b/recipes/cd3-boost-unit-definitions/all/conanfile.py @@ -10,13 +10,14 @@ required_conan_version = ">=1.52.0" -class PackageConan(ConanFile): +class Cd3BoostUnitDefinitionsConan(ConanFile): name = "cd3-boost-unit-definitions" description = "A collection of pre-defined types and unit instances for working with Boost.Units quantities." license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/CD3/BoostUnitDefinitions" topics = ("physical dimensions", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,20 +29,17 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "Visual Studio": "15", - "msvc": "19.0", + "msvc": "191", "gcc": "5", "clang": "5", "apple-clang": "5.1", } - def export_sources(self): - pass - def layout(self): - basic_layout(self) + basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.80.0", transitive_headers=True) + self.requires("boost/1.80.0") def package_id(self): self.info.clear() diff --git a/recipes/cereal/all/conanfile.py b/recipes/cereal/all/conanfile.py index 7523bebc550cf3..c0fce5f2a6d25c 100644 --- a/recipes/cereal/all/conanfile.py +++ b/recipes/cereal/all/conanfile.py @@ -11,10 +11,10 @@ class CerealConan(ConanFile): name = "cereal" description = "Serialization header-only library for C++11." license = "BSD-3-Clause" - topics = ("cereal", "header-only", "serialization", "cpp11") + topics = ("header-only", "serialization", "cpp11") homepage = "https://github.com/USCiLab/cereal" url = "https://github.com/conan-io/conan-center-index" - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "thread_safe": [True, False], @@ -23,15 +23,14 @@ class CerealConan(ConanFile): "thread_safe": False, } - def package_id(self): - self.info.clear() - def layout(self): cmake_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 generate(self): tc = CMakeToolchain(self) @@ -81,9 +80,7 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "cereal::cereal") self.cpp_info.set_property("cmake_target_aliases", ["cereal"]) # target before 1.3.1 self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] if self.options.thread_safe: self.cpp_info.defines = ["CEREAL_THREAD_SAFE=1"] if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/cereal/all/test_package/conanfile.py b/recipes/cereal/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/cereal/all/test_package/conanfile.py +++ b/recipes/cereal/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/ceres-solver/all/conandata.yml b/recipes/ceres-solver/all/conandata.yml index 47afe48e93634f..7118801d3af547 100644 --- a/recipes/ceres-solver/all/conandata.yml +++ b/recipes/ceres-solver/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "http://ceres-solver.org/ceres-solver-2.2.0.tar.gz" + sha256: "48b2302a7986ece172898477c3bcd6deb8fb5cf19b3327bc49969aad4cede82d" "2.1.0": url: "http://ceres-solver.org/ceres-solver-2.1.0.tar.gz" sha256: "f7d74eecde0aed75bfc51ec48c91d01fe16a6bf16bce1987a7073286701e2fc6" @@ -9,6 +12,13 @@ sources: url: "http://ceres-solver.org/ceres-solver-1.14.0.tar.gz" sha256: "4744005fc3b902fed886ea418df70690caa8e2ff6b5a90f3dd88a3d291ef8e8e" patches: + "2.2.0": + - patch_file: "patches/2.2.0-0001-find-libraries-conan.patch" + patch_description: "Robust dependencies handling" + patch_type: "conan" + - patch_file: "patches/2.2.0-0002-fix-mingw-build.patch" + patch_description: "Fix MinGW build" + patch_type: "portability" "2.1.0": - patch_file: "patches/2.1.0-0001-find-libraries-conan.patch" patch_description: "Robust dependencies handling" diff --git a/recipes/ceres-solver/all/conanfile.py b/recipes/ceres-solver/all/conanfile.py index e4ca7cba349d0b..b676ebea4436f7 100644 --- a/recipes/ceres-solver/all/conanfile.py +++ b/recipes/ceres-solver/all/conanfile.py @@ -1,12 +1,14 @@ +import os +import textwrap + 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, 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, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version -import os required_conan_version = ">=1.54.0" @@ -51,7 +53,11 @@ class CeressolverConan(ConanFile): @property def _min_cppstd(self): - return "98" if Version(self.version) < "2.0.0" else "14" + if Version(self.version) >= "2.2.0": + return "17" + if Version(self.version) >= "2.0.0": + return "14" + return "98" @property def _compilers_minimum_version(self): @@ -63,6 +69,13 @@ def _compilers_minimum_version(self): "msvc": "190", "Visual Studio": "14", }, + "17": { + "apple-clang": "10", + "clang": "7", + "gcc": "8", + "msvc": "191", + "Visual Studio": "15", + }, }.get(self._min_cppstd, {}) def export_sources(self): @@ -105,6 +118,10 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) + def build_requirements(self): + if Version(self.version) >= "2.2.0": + self.tool_requires("cmake/[>=3.16 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -113,7 +130,6 @@ def generate(self): tc.variables["MINIGLOG"] = not self.options.use_glog tc.variables["GFLAGS"] = False # useless for the lib itself, gflags is not a direct dependency tc.variables["SUITESPARSE"] = False - tc.variables["CXSPARSE"] = False tc.variables["LAPACK"] = False tc.variables["SCHUR_SPECIALIZATIONS"] = self.options.use_schur_specializations tc.variables["CUSTOM_BLAS"] = self.options.use_custom_blas @@ -122,21 +138,32 @@ def generate(self): tc.variables["BUILD_DOCUMENTATION"] = False tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_BENCHMARKS"] = False - if is_msvc(self): - tc.variables["MSVC_USE_STATIC_CRT"] = is_msvc_static_runtime(self) - if Version(self.version) >= "2.1.0": + + ceres_version = Version(self.version) + if ceres_version >= "2.2.0": + tc.variables["USE_CUDA"] = False + elif ceres_version >= "2.1.0": tc.variables["CUDA"] = False - if Version(self.version) >= "2.0.0": + if ceres_version >= "2.2.0": + tc.variables["EIGENMETIS"] = False + if ceres_version >= "2.0.0": tc.variables["PROVIDE_UNINSTALL_TARGET"] = False if is_apple_os(self): tc.variables["ACCELERATESPARSE"] = True - if Version(self.version) < "2.1.0": + if ceres_version < "2.2.0": + tc.variables["CXSPARSE"] = False + if is_msvc(self): + tc.variables["MSVC_USE_STATIC_CRT"] = is_msvc_static_runtime(self) + if ceres_version < "2.1.0": tc.variables["LIB_SUFFIX"] = "" - if Version(self.version) < "2.0": + if ceres_version < "2.0.0": tc.variables["CXX11"] = self.options.use_CXX11 tc.variables["OPENMP"] = False tc.variables["TBB"] = self.options.use_TBB tc.variables["CXX11_THREADS"] = self.options.use_CXX11_threads + # IOS_DEPLOYMENT_TARGET variable was added to iOS.cmake file in 1.12.0 version + if self.settings.os == "iOS": + tc.variables["IOS_DEPLOYMENT_TARGET"] = self.settings.os.version tc.generate() CMakeDeps(self).generate() @@ -153,10 +180,31 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "CMake")) + self._create_cmake_module_variables(os.path.join(self.package_folder, self._module_variables_file_rel_path)) + + def _create_cmake_module_variables(self, module_file): + # Define several variables of upstream CMake config file which are not + # defined out of the box by CMakeDeps. + # See https://github.com/ceres-solver/ceres-solver/blob/master/cmake/CeresConfig.cmake.in + content = textwrap.dedent(f"""\ + set(CERES_FOUND TRUE) + set(CERES_VERSION {self.version}) + if(NOT DEFINED CERES_LIBRARIES) + set(CERES_LIBRARIES Ceres::ceres) + endif() + """) + save(self, module_file, content) + + @property + def _module_variables_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "Ceres") self.cpp_info.set_property("cmake_target_name", "Ceres::ceres") + # see https://github.com/ceres-solver/ceres-solver/blob/2.2.0/cmake/CeresConfig.cmake.in#L334-L340 + self.cpp_info.set_property("cmake_target_aliases", ["ceres"]) + self.cpp_info.set_property("cmake_build_modules", [self._module_variables_file_rel_path]) libsuffix = "" if self.settings.build_type == "Debug": @@ -186,4 +234,6 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "Ceres" self.cpp_info.names["cmake_find_package_multi"] = "Ceres" + self.cpp_info.components["ceres"].build_modules["cmake_find_package"] = [self._module_variables_file_rel_path] + self.cpp_info.components["ceres"].build_modules["cmake_find_package_multi"] = [self._module_variables_file_rel_path] self.cpp_info.components["ceres"].set_property("cmake_target_name", "Ceres::ceres") diff --git a/recipes/ceres-solver/all/patches/2.2.0-0001-find-libraries-conan.patch b/recipes/ceres-solver/all/patches/2.2.0-0001-find-libraries-conan.patch new file mode 100644 index 00000000000000..aabc47a84c9554 --- /dev/null +++ b/recipes/ceres-solver/all/patches/2.2.0-0001-find-libraries-conan.patch @@ -0,0 +1,54 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -433,13 +433,14 @@ else (MINIGLOG) + unset(MINIGLOG_MAX_LOG_LEVEL CACHE) + # Don't search with REQUIRED so that configuration continues if not found and + # we can output an error messages explaining MINIGLOG option. +- find_package(Glog) +- if (NOT GLOG_FOUND) ++ find_package(glog REQUIRED CONFIG) ++ if (0) + message(FATAL_ERROR "Can't find Google Log (glog). Please set either: " + "glog_DIR (newer CMake built versions of glog) or GLOG_INCLUDE_DIR & " + "GLOG_LIBRARY or enable MINIGLOG option to use minimal glog " + "implementation.") +- endif(NOT GLOG_FOUND) ++ endif() ++ if(0) + # By default, assume gflags was found, updating the message if it was not. + set(GLOG_GFLAGS_DEPENDENCY_MESSAGE + " Assuming glog was built with gflags support as gflags was found. " +@@ -452,7 +453,8 @@ else (MINIGLOG) + "Otherwise, Ceres may fail to link due to missing gflags symbols.") + endif(NOT gflags_FOUND) + message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE}) +-endif (MINIGLOG) ++ endif() ++endif () + + if (NOT SCHUR_SPECIALIZATIONS) + list(APPEND CERES_COMPILE_OPTIONS CERES_RESTRICT_SCHUR_SPECIALIZATION) +--- a/internal/ceres/CMakeLists.txt ++++ b/internal/ceres/CMakeLists.txt +@@ -85,9 +85,9 @@ endif (SCHUR_SPECIALIZATIONS) + set_source_files_properties(${CERES_INTERNAL_SCHUR_FILES} PROPERTIES + SKIP_UNITY_BUILD_INCLUSION ON) + +-if (NOT MINIGLOG AND GLOG_FOUND) +- list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES ${GLOG_LIBRARIES}) +- if (gflags_FOUND) ++if (NOT MINIGLOG) ++ list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES glog::glog) ++ if (0) + # If glog & gflags are both found, we assume that glog was built with + # gflags, as it is awkward to perform a try_compile() to verify this + # when gflags is an imported target (as it is in newer versions). +@@ -95,7 +95,7 @@ if (NOT MINIGLOG AND GLOG_FOUND) + # gflags, it is thus a public dependency for Ceres in this case. + list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES gflags) + endif() +-endif (NOT MINIGLOG AND GLOG_FOUND) ++endif () + + if (SUITESPARSE AND SuiteSparse_FOUND) + # Define version information for use in Solver::FullReport. diff --git a/recipes/ceres-solver/all/patches/2.2.0-0002-fix-mingw-build.patch b/recipes/ceres-solver/all/patches/2.2.0-0002-fix-mingw-build.patch new file mode 100644 index 00000000000000..2978c914e5d8dc --- /dev/null +++ b/recipes/ceres-solver/all/patches/2.2.0-0002-fix-mingw-build.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -514,6 +514,9 @@ if (MINGW) + "to a MinGW bug: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556") + string(REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + update_cache_variable(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") ++ # Add the equivalent of /bigobj for MSVC for MinGW to fix 'too many sections' ++ # compile errors due to extensive use of templates. ++ add_compile_options(-Wa,-mbig-obj) + endif (MINGW) + + # After the tweaks for the compile settings, disable some warnings on MSVC. diff --git a/recipes/ceres-solver/config.yml b/recipes/ceres-solver/config.yml index 95ff77359ef247..c6e7e2c9240857 100644 --- a/recipes/ceres-solver/config.yml +++ b/recipes/ceres-solver/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.0": + folder: all "2.1.0": folder: all "2.0.0": diff --git a/recipes/certify/all/conanfile.py b/recipes/certify/all/conanfile.py index c1cb170b0ac8ca..89408b2501d3b5 100644 --- a/recipes/certify/all/conanfile.py +++ b/recipes/certify/all/conanfile.py @@ -38,7 +38,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.82.0") + self.requires("boost/1.83.0") self.requires("openssl/[>=1.1 <4]") def package_id(self): diff --git a/recipes/cfitsio/all/conandata.yml b/recipes/cfitsio/all/conandata.yml index 4b0ca8e4490913..8fe35bec67203a 100644 --- a/recipes/cfitsio/all/conandata.yml +++ b/recipes/cfitsio/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.3.0": + url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.3.0.tar.gz" + sha256: "734ab0198714fe43eab94a67d6987085bde5573e6babde4d05799a8d04ebb04c" "4.2.0": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.2.0.tar.gz" sha256: "ef9881973ecb9fe55732a4c1bb5ca96e63b624728f6319556939e0fe25f495e8" @@ -18,6 +21,9 @@ sources: url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.47.tar.gz" sha256: "985606e058403c073a68d95be74e9696f0ded9414520784457a1d4cba8cca7e2" patches: + "4.3.0": + - patch_file: "patches/windows-use-strtok_s.patch" + - patch_file: "patches/fix-cmake-4.2.0.patch" "4.2.0": - patch_file: "patches/windows-use-strtok_s.patch" - patch_file: "patches/fix-cmake-4.2.0.patch" diff --git a/recipes/cfitsio/all/conanfile.py b/recipes/cfitsio/all/conanfile.py index b5849b0ae29466..782f21cb2a73bc 100644 --- a/recipes/cfitsio/all/conanfile.py +++ b/recipes/cfitsio/all/conanfile.py @@ -12,7 +12,7 @@ class CfitsioConan(ConanFile): name = "cfitsio" description = "C library for reading and writing data files in FITS " \ "(Flexible Image Transport System) data format" - license = "ISC" + license = "CFITSIO" topics = ("fits", "image", "nasa", "astronomy", "astrophysics", "space") homepage = "https://heasarc.gsfc.nasa.gov/fitsio/" url = "https://github.com/conan-io/conan-center-index" @@ -56,14 +56,14 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.threadsafe and self.settings.os == "Windows" and \ self.settings.compiler.get_safe("threads") != "posix": self.requires("pthreads4w/3.0.0") if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.get_safe("with_curl"): - self.requires("libcurl/8.0.0") + self.requires("libcurl/[>=7.78.0 <9]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -109,6 +109,7 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", f"cfitsio-{self.version}")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "cfitsio") diff --git a/recipes/cfitsio/config.yml b/recipes/cfitsio/config.yml index cfbf4d00aea10e..052075e2e1199f 100644 --- a/recipes/cfitsio/config.yml +++ b/recipes/cfitsio/config.yml @@ -1,4 +1,6 @@ versions: + "4.3.0": + folder: all "4.2.0": folder: all "4.1.0": diff --git a/recipes/cgal/all/conandata.yml b/recipes/cgal/all/conandata.yml index 243b9320511a51..eda02a9fb3ec44 100644 --- a/recipes/cgal/all/conandata.yml +++ b/recipes/cgal/all/conandata.yml @@ -11,6 +11,12 @@ sources: "5.5.2": sha256: b2b05d5616ecc69facdc24417cce0b04fb4321491d107db45103add520e3d8c3 url: https://github.com/CGAL/cgal/releases/download/v5.5.2/CGAL-5.5.2.tar.xz + "5.5.3": + sha256: 0a04f662693256328b05babfabb5e3a5b7db2f5a58d52e3c520df9d0828ddd73 + url: https://github.com/CGAL/cgal/releases/download/v5.5.3/CGAL-5.5.3.tar.xz + "5.6": + sha256: dcab9b08a50a06a7cc2cc69a8a12200f8d8f391b9b8013ae476965c10b45161f + url: https://github.com/CGAL/cgal/releases/download/v5.6/CGAL-5.6.tar.xz patches: "5.3.2": - patch_file: "patches/0001-fix-for-conan.patch" @@ -32,3 +38,8 @@ patches: patch_type: bugfix patch_source: https://github.com/CGAL/cgal/pull/7502 patch_description: Fix Eigen3 support in CGAL + "5.5.3": + - patch_file: "patches/0001-fix-for-conan.patch" + patch_type: bugfix + patch_source: https://github.com/CGAL/cgal/pull/7502 + patch_description: Fix Eigen3 support in CGAL diff --git a/recipes/cgal/all/conanfile.py b/recipes/cgal/all/conanfile.py index 3a63d4857c1679..2d4d74dba1bec9 100644 --- a/recipes/cgal/all/conanfile.py +++ b/recipes/cgal/all/conanfile.py @@ -163,6 +163,10 @@ def _create_cmake_module_variables(self, module_file): endfunction() CGAL_setup_CGAL_flags(CGAL::CGAL) + +# CGAL use may rely on the presence of those two variables +set(CGAL_USE_GMP TRUE CACHE INTERNAL "CGAL library is configured to use GMP") +set(CGAL_USE_MPFR TRUE CACHE INTERNAL "CGAL library is configured to use MPFR") ''') save(self, module_file, content) diff --git a/recipes/cgal/config.yml b/recipes/cgal/config.yml index 48232844708f0d..3d807cdb944c78 100644 --- a/recipes/cgal/config.yml +++ b/recipes/cgal/config.yml @@ -7,3 +7,7 @@ versions: folder: all "5.5.2": folder: all + "5.5.3": + folder: all + "5.6": + folder: all diff --git a/recipes/cgif/all/conandata.yml b/recipes/cgif/all/conandata.yml index f6abd559f85fbd..6cfe1b1bc6c905 100644 --- a/recipes/cgif/all/conandata.yml +++ b/recipes/cgif/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.3.2": + url: "https://github.com/dloebl/cgif/archive/V0.3.2.tar.gz" + sha256: "0abf83b7617f4793d9ab3a4d581f4e8d7548b56a29e3f95b0505f842cbfd7f95" "0.3.0": url: "https://github.com/dloebl/cgif/archive/refs/tags/V0.3.0.tar.gz" sha256: "c4f70bbae4c6afee3a524e65be31ae495201fd26687cb8429d7aded8be96306a" diff --git a/recipes/cgif/all/conanfile.py b/recipes/cgif/all/conanfile.py index ef47a850d95dc7..0f4eab97dfc4f8 100644 --- a/recipes/cgif/all/conanfile.py +++ b/recipes/cgif/all/conanfile.py @@ -47,7 +47,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared build with Visual Studio") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.2.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/cgif/config.yml b/recipes/cgif/config.yml index d126790212e0c4..be2ba90eb4dc70 100644 --- a/recipes/cgif/config.yml +++ b/recipes/cgif/config.yml @@ -1,3 +1,5 @@ versions: + "0.3.2": + folder: all "0.3.0": folder: all diff --git a/recipes/cglm/all/CMakeLists.txt b/recipes/cglm/all/CMakeLists.txt deleted file mode 100644 index 3a14ce35d533b8..00000000000000 --- a/recipes/cglm/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory("source_subfolder") diff --git a/recipes/cglm/all/conandata.yml b/recipes/cglm/all/conandata.yml index d63882c55fca8d..59f16765ad5b3e 100644 --- a/recipes/cglm/all/conandata.yml +++ b/recipes/cglm/all/conandata.yml @@ -1,4 +1,10 @@ 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" "0.8.5": url: "https://github.com/recp/cglm/archive/refs/tags/v0.8.5.tar.gz" sha256: "baefa21342d228a83c90708459a745d5aa9b0ebb381555eea42db1f37fdf7a5a" diff --git a/recipes/cglm/all/conanfile.py b/recipes/cglm/all/conanfile.py index 023c54a31f51b3..26cabc85e9ca11 100644 --- a/recipes/cglm/all/conanfile.py +++ b/recipes/cglm/all/conanfile.py @@ -1,19 +1,22 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.29.1" +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", ) - generators = "cmake" options = { "shared": [True, False], "fPIC": [True, False], @@ -25,77 +28,58 @@ class CglmConan(ConanFile): "header_only": False, } - _cmake = None - - @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 - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + if self.options.get_safe("shared") or self.options.header_only: + self.options.rm_safe("fPIC") if self.options.header_only: - del self.settings.arch - del self.settings.build_type - del self.settings.compiler - del self.settings.os + self.options.rm_safe("shared") + self.settings.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + def layout(self): + cmake_layout(self, src_folder="src") - def _configure_cmake(self): - if self._cmake: - return self._cmake + def package_id(self): + if self.info.options.header_only: + self.info.clear() - self._cmake = CMake(self) - self._cmake.definitions["CGLM_STATIC"] = not self.options.shared - self._cmake.definitions["CGLM_SHARED"] = self.options.shared - self._cmake.definitions["CGLM_USE_TEST"] = False - self._cmake.configure() - return self._cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + def generate(self): + if not self.options.header_only: + tc = CMakeToolchain(self) + tc.cache_variables["CGLM_STATIC"] = not self.options.shared + tc.cache_variables["CGLM_SHARED"] = self.options.shared + tc.cache_variables["CGLM_USE_TEST"] = False + tc.generate() + def build(self): if not self.options.header_only: - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() 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.options.header_only: - self.copy("*", src=os.path.join(self._source_subfolder, "include"), dst="include") + copy(self, "*", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include")) else: - cmake = self._configure_cmake() + 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", "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 511cf63c2b9e2a..a77b4ddd272993 100644 --- a/recipes/cglm/all/test_package/CMakeLists.txt +++ b/recipes/cglm/all/test_package/CMakeLists.txt @@ -1,10 +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(TARGETS) - -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 38f4483872d47f..bd5b26ca954ad5 100644 --- a/recipes/cglm/all/test_package/conanfile.py +++ b/recipes/cglm/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, cmake_layout 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/cglm/all/test_v1_package/CMakeLists.txt b/recipes/cglm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..9735bda16bdf41 --- /dev/null +++ b/recipes/cglm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package 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/highs/all/test_v1_package/conanfile.py b/recipes/cglm/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/highs/all/test_v1_package/conanfile.py rename to recipes/cglm/all/test_v1_package/conanfile.py diff --git a/recipes/cglm/config.yml b/recipes/cglm/config.yml index dacc103c54543e..7b9de138a3994a 100644 --- a/recipes/cglm/config.yml +++ b/recipes/cglm/config.yml @@ -1,3 +1,7 @@ versions: + "0.9.1": + folder: all + "0.8.9": + folder: all "0.8.5": folder: all diff --git a/recipes/cgltf/all/CMakeLists.txt b/recipes/cgltf/all/CMakeLists.txt index 083b3a7d15fec0..86b1d0c12f5415 100644 --- a/recipes/cgltf/all/CMakeLists.txt +++ b/recipes/cgltf/all/CMakeLists.txt @@ -1,16 +1,15 @@ cmake_minimum_required(VERSION 3.4) project(cgltf C) -include(conanbuildinfo.cmake) -conan_basic_setup() +set(SOURCES_DIR ${CMAKE_CURRENT_LIST_DIR}/src) set(SRC_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cgltf.c - ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cgltf_write.c + ${SOURCES_DIR}/cgltf.c + ${SOURCES_DIR}/cgltf_write.c ) set(HEADER_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cgltf.h - ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cgltf_write.h + ${SOURCES_DIR}/cgltf.h + ${SOURCES_DIR}/cgltf_write.h ) add_library(${PROJECT_NAME} ${SRC_FILES}) @@ -20,10 +19,5 @@ if(MSVC AND BUILD_SHARED_LIBS) endif() include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -) +install(TARGETS ${PROJECT_NAME}) install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/cgltf/all/conanfile.py b/recipes/cgltf/all/conanfile.py index bc0e435d4c8c58..df487c5e826cd2 100644 --- a/recipes/cgltf/all/conanfile.py +++ b/recipes/cgltf/all/conanfile.py @@ -1,26 +1,34 @@ -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 copy, export_conandata_patches, get, load, replace_in_file, save, rename + +required_conan_version = ">=1.53.0" + class CgltfConan(ConanFile): name = "cgltf" description = "Single-file glTF 2.0 loader and writer written in C99." license = "MIT" - topics = ("conan", "cgltf", "gltf", "header-only") - homepage = "https://github.com/jkuhlmann/cgltf" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jkuhlmann/cgltf" + topics = ("gltf", "header-only") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - - exports_sources = "CMakeLists.txt" - generators = "cmake" - _cmake = None + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -28,62 +36,53 @@ 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]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _create_source_files(self): - cgltf_c = ( - "#define CGLTF_IMPLEMENTATION\n" - "#include \"cgltf.h\"\n" - ) - cgltf_write_c = ( - "#define CGLTF_WRITE_IMPLEMENTATION\n" - "#include \"cgltf_write.h\"\n" - ) - tools.save(os.path.join(self.build_folder, self._source_subfolder, "cgltf.c"), cgltf_c) - tools.save(os.path.join(self.build_folder, self._source_subfolder, "cgltf_write.c"), cgltf_write_c) + cgltf_c = '#define CGLTF_IMPLEMENTATION\n#include "cgltf.h"\n' + cgltf_write_c = '#define CGLTF_WRITE_IMPLEMENTATION\n#include "cgltf_write.h"\n' + save(self, os.path.join(self.build_folder, self.source_folder, "cgltf.c"), cgltf_c) + save(self, os.path.join(self.build_folder, self.source_folder, "cgltf_write.c"), cgltf_write_c) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): self._create_source_files() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() - def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() - cmake.install() - for header_file in ["cgltf.h", "cgltf_write.h"]: - header_fullpath = os.path.join(self.package_folder, "include", header_file) - self._remove_implementation(header_fullpath) - - @staticmethod - def _remove_implementation(header_fullpath): - header_content = tools.load(header_fullpath) + def _remove_implementation(self, header_fullpath): + header_content = load(self, header_fullpath) begin = header_content.find("/*\n *\n * Stop now, if you are only interested in the API.") end = header_content.find("/* cgltf is distributed under MIT license:", begin) implementation = header_content[begin:end] - tools.replace_in_file( + replace_in_file( + self, header_fullpath, implementation, - ( - "/**\n" - " * Implementation removed by conan during packaging.\n" - " * Don't forget to link libs provided in this package.\n" - " */\n\n" - ) + "/**\n * Implementation removed by conan during packaging.\n * Don't forget to link libs provided in this package.\n */\n\n", ) + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + for header_file in ["cgltf.h", "cgltf_write.h"]: + header_fullpath = os.path.join(self.package_folder, "include", header_file) + self._remove_implementation(header_fullpath) + for dll in (self.package_path / "lib").glob("*.dll"): + rename(self, dll, self.package_path / "bin" / dll.name) + def package_info(self): self.cpp_info.libs = ["cgltf"] diff --git a/recipes/cgltf/all/test_package/CMakeLists.txt b/recipes/cgltf/all/test_package/CMakeLists.txt index 5f056d0a34a03b..ca0a3cec6c73ec 100644 --- a/recipes/cgltf/all/test_package/CMakeLists.txt +++ b/recipes/cgltf/all/test_package/CMakeLists.txt @@ -1,11 +1,10 @@ -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(cgltf REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE cgltf::cgltf) if(MSVC) target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) endif() diff --git a/recipes/cgltf/all/test_package/conanfile.py b/recipes/cgltf/all/test_package/conanfile.py index ea57a464900be9..ef5d7042163ecc 100644 --- a/recipes/cgltf/all/test_package/conanfile.py +++ b/recipes/cgltf/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/cgltf/all/test_v1_package/CMakeLists.txt b/recipes/cgltf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cgltf/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/cgltf/all/test_v1_package/conanfile.py b/recipes/cgltf/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..84ee68733e5167 --- /dev/null +++ b/recipes/cgltf/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/chef-fun/all/conandata.yml b/recipes/chef-fun/all/conandata.yml index b1d88fa4a923cc..9532bc9181c942 100644 --- a/recipes/chef-fun/all/conandata.yml +++ b/recipes/chef-fun/all/conandata.yml @@ -1,6 +1,4 @@ sources: - # Newer versions at the top "1.0.1": - url: - - "https://gitlab.com/libchef/chef-fun/-/archive/1.0.1/chef-fun-1.0.1.tar.gz" + url: "https://gitlab.com/libchef/chef-fun/-/archive/1.0.1/chef-fun-1.0.1.tar.gz" sha256: "52a4facb3b1de9f1a8ed4f3314fc5e2190fab1f5564c04c7071361fb08ca837e" diff --git a/recipes/chef-fun/all/conanfile.py b/recipes/chef-fun/all/conanfile.py index e764b383caf1bd..8958e9403c1fa7 100644 --- a/recipes/chef-fun/all/conanfile.py +++ b/recipes/chef-fun/all/conanfile.py @@ -1,13 +1,13 @@ 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 get, copy from conan.tools.layout import basic_layout from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.50.0" class ChefFunConan(ConanFile): @@ -17,40 +17,28 @@ class ChefFunConan(ConanFile): topics = ("functional programming", "cpp", "library" ) url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - # Keep these or explain why it's not required for this particular case - # Do not copy sources to build folder for header only projects, unless you need to apply patches no_copy_source = True @property def _min_cppstd(self): return 20 - # In case the project requires C++14/17/20/... the minimum compiler version should be listed - # Not tested on "msvc", "clang", and "apple-clang". Possibly it works there - # given a sufficient recent version @property def _compilers_minimum_version(self): return { "gcc": "9.4.0", } - # Use the export_sources(self) method instead of the exports_sources attribute. - # This allows finer grain exportation of patches per version - def export_sources(self): - export_conandata_patches(self) - def layout(self): - # src_folder must use the same source folder name than the project basic_layout(self, src_folder="src") - # same package ID for any package def package_id(self): self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - # Validate the minimum cpp standard supported when installing the package. For C++ projects only 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: @@ -58,21 +46,9 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) -# def requirements(self): -# # Prefer self.requires method instead of requires attribute -# # Direct dependencies of header only libs are always transitive since they are included in public headers -# self.requires("dependency/0.8.1", transitive_headers=True) - def source(self): - # Download source package and extract to source folder get(self, **self.conan_data["sources"][self.version], strip_root=True) - # Not mandatory when there is no patch, but will suppress warning message about missing build() method - def build(self): - # The attribute no_copy_source should not be used when applying patches in build - apply_conandata_patches(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( @@ -89,29 +65,5 @@ def package(self): ) def package_info(self): - # Folders not used for header-only self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - - # Set these to the appropriate values if the package has an official FindPACKAGE.cmake - # listed in https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules - # examples: bzip2, freetype, gdal, icu, libcurl, libjpeg, libpng, libtiff, openssl, sqlite3, zlib... - self.cpp_info.set_property("cmake_module_file_name", "ChefFun") - self.cpp_info.set_property("cmake_module_target_name", "ChefFun::ChefFun") - # Set these to the appropriate values if package provides a CMake config file - # (package-config.cmake or packageConfig.cmake, with package::package target, usually installed in /lib/cmake//) - self.cpp_info.set_property("cmake_file_name", "chef-fun") - self.cpp_info.set_property("cmake_target_name", "chef-fun::chef-fun") - # Set this to the appropriate value if the package provides a pkgconfig file - # (package.pc, usually installed in /lib/pkgconfig/) - self.cpp_info.set_property("pkg_config_name", "chef-fun") - - ## Add m, pthread and dl if needed in Linux/FreeBSD - #if self.settings.os in ["Linux", "FreeBSD"]: - # self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "chef-fun" - self.cpp_info.names["cmake_find_package_multi"] = "chef-fun" - self.cpp_info.filenames["cmake_find_package"] = "chef-fun" - self.cpp_info.filenames["cmake_find_package_multi"] = "chef-fun" diff --git a/recipes/chef-fun/all/test_package/conanfile.py b/recipes/chef-fun/all/test_package/conanfile.py index 48499fa0989d9c..e845ae751a3017 100644 --- a/recipes/chef-fun/all/test_package/conanfile.py +++ b/recipes/chef-fun/all/test_package/conanfile.py @@ -4,7 +4,6 @@ import os -# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" diff --git a/recipes/chef-fun/config.yml b/recipes/chef-fun/config.yml index d8a13868268e63..715e55357a17be 100644 --- a/recipes/chef-fun/config.yml +++ b/recipes/chef-fun/config.yml @@ -1,4 +1,3 @@ versions: - # Newer versions at the top "1.0.1": folder: all diff --git a/recipes/chipmunk2d/all/conanfile.py b/recipes/chipmunk2d/all/conanfile.py index 72a9a9cadd3ff7..785d8d95d890df 100644 --- a/recipes/chipmunk2d/all/conanfile.py +++ b/recipes/chipmunk2d/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get +from conan.tools.files import copy, get, replace_in_file import os required_conan_version = ">=1.53.0" @@ -52,7 +52,14 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() + def _patch_sources(self): + # 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, "CMakeLists.txt"), + "-ffast-math", "-ffast-math -fno-finite-math-only") + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/choc/all/conandata.yml b/recipes/choc/all/conandata.yml new file mode 100644 index 00000000000000..c9e73e3a7173c0 --- /dev/null +++ b/recipes/choc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230918": + url: "https://github.com/Tracktion/choc/archive/8572719d3b9085ccc88893cdaf8c2c703fa55adb.tar.gz" + sha256: "f98e4bc8e0be19b416a4c01a2673280a63dec45e444175cca85f06bd29748ac4" diff --git a/recipes/choc/all/conanfile.py b/recipes/choc/all/conanfile.py new file mode 100644 index 00000000000000..c7f6cc492b72bc --- /dev/null +++ b/recipes/choc/all/conanfile.py @@ -0,0 +1,49 @@ +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 +import os + +required_conan_version = ">=1.52.0" + +class ChocConan(ConanFile): + name = "choc" + description = "A collection of header only classes, permissively licensed, to provide basic useful tasks with the bare-minimum of dependencies." + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tracktion/choc/" + topics = ("audio", "json", "containers", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + 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) + + def package(self): + copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include", "choc"), + src=self.source_folder, + excludes=("tests"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/choc/all/test_package/CMakeLists.txt b/recipes/choc/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..3d6e4b5e02fcd7 --- /dev/null +++ b/recipes/choc/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(choc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE choc::choc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/choc/all/test_package/conanfile.py b/recipes/choc/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e845ae751a3017 --- /dev/null +++ b/recipes/choc/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/choc/all/test_package/test_package.cpp b/recipes/choc/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..e7b235a639ba22 --- /dev/null +++ b/recipes/choc/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include "choc/platform/choc_Platform.h" + +int main(void) { + std::cout << CHOC_OPERATING_SYSTEM_NAME << '\n'; + + return EXIT_SUCCESS; +} diff --git a/recipes/choc/config.yml b/recipes/choc/config.yml new file mode 100644 index 00000000000000..55bc2cddc1b4a2 --- /dev/null +++ b/recipes/choc/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230918": + folder: all diff --git a/recipes/cimg/all/conandata.yml b/recipes/cimg/all/conandata.yml index c4ba41f9e21b54..df56684723fbda 100644 --- a/recipes/cimg/all/conandata.yml +++ b/recipes/cimg/all/conandata.yml @@ -1,25 +1,16 @@ sources: - "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.3.0": + url: "https://cimg.eu/files/CImg_3.3.0.zip" + sha256: "d5eecb3551fc1966a9aac8637dc643bf6049e2b1b1a1f9deec3069e289ee1d65" + "3.2.6": + url: "https://cimg.eu/files/CImg_3.2.6.zip" + sha256: "8da3aa995027231bb18f97bb986e12788ef464b3ab8a34151650bf1217baeda7" "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 cbed93e0b8d513..b626bca664ae66 100644 --- a/recipes/cimg/all/conanfile.py +++ b/recipes/cimg/all/conanfile.py @@ -68,17 +68,11 @@ def requirements(self): if self.options.enable_jpeg: self.requires("libjpeg/9e") if self.options.enable_openexr: - if self.options.enable_opencv: - self.requires("openexr/3.1.7") - else: - self.requires("openexr/3.1.7") + self.requires("openexr/3.2.1") if self.options.enable_png: self.requires("libpng/1.6.40") if self.options.enable_tiff: - if self.options.enable_opencv: - self.requires("libtiff/4.5.1") - else: - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") if self.options.enable_ffmpeg: if self.options.enable_opencv: self.requires("ffmpeg/4.4") diff --git a/recipes/cimg/config.yml b/recipes/cimg/config.yml index b39649938fc2eb..0ba296b3e93c66 100644 --- a/recipes/cimg/config.yml +++ b/recipes/cimg/config.yml @@ -1,17 +1,11 @@ versions: - "3.2.5": + "3.3.0": folder: all - "3.2.0": + "3.2.6": 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/circularbuffer/all/conanfile.py b/recipes/circularbuffer/all/conanfile.py index c3948bef41ba84..695a6ea119334e 100644 --- a/recipes/circularbuffer/all/conanfile.py +++ b/recipes/circularbuffer/all/conanfile.py @@ -1,11 +1,10 @@ from conan import ConanFile from conan.tools.files import get, copy from conan.tools.layout import basic_layout -from conan.tools.cmake import CMakeToolchain import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.50.0" class CircularBufferConan(ConanFile): @@ -15,37 +14,26 @@ class CircularBufferConan(ConanFile): license = "LGPL-3.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/rlogiacco/CircularBuffer" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=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", dst=os.path.join(self.package_folder, - "licenses"), src=self.source_folder) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(self, "CircularBuffer.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) copy(self, "CircularBuffer.tpp", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) - def package_id(self): - self.info.clear() - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() - def package_info(self): - self.cpp_info.set_property("cmake_file_name", "CircularBuffer") - self.cpp_info.set_property( - "cmake_target_name", "CircularBuffer::CircularBuffer") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "CircularBuffer" - self.cpp_info.filenames["cmake_find_package_multi"] = "CircularBuffer" - self.cpp_info.names["cmake_find_package"] = "CircularBuffer" - self.cpp_info.names["cmake_find_package_multi"] = "CircularBuffer" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/circularbuffer/all/test_package/CMakeLists.txt b/recipes/circularbuffer/all/test_package/CMakeLists.txt index d331e75f3a1add..933c1c7ab13f6e 100644 --- a/recipes/circularbuffer/all/test_package/CMakeLists.txt +++ b/recipes/circularbuffer/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) - -find_package(CircularBuffer CONFIG REQUIRED) +find_package(circularbuffer CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE CircularBuffer::CircularBuffer) +target_link_libraries(${PROJECT_NAME} PRIVATE circularbuffer::circularbuffer) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt b/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt index 3ddfb18ba1fed4..0d20897301b68b 100644 --- a/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt +++ b/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,8 @@ - cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(CircularBuffer CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} CircularBuffer::CircularBuffer) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/circularbuffer/all/test_v1_package/conanfile.py b/recipes/circularbuffer/all/test_v1_package/conanfile.py index 0a93a273ba575c..90eb89e3f2f46b 100644 --- a/recipes/circularbuffer/all/test_v1_package/conanfile.py +++ b/recipes/circularbuffer/all/test_v1_package/conanfile.py @@ -2,7 +2,7 @@ from conans import ConanFile, CMake, tools -class TestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake", "cmake_find_package_multi" diff --git a/recipes/circularbuffer/all/test_v1_package/test_package.cpp b/recipes/circularbuffer/all/test_v1_package/test_package.cpp deleted file mode 100644 index c9d59e4b258c60..00000000000000 --- a/recipes/circularbuffer/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main() { - CircularBuffer buffer; - - buffer.push(5); - buffer.unshift(1); - - return 0; -} diff --git a/recipes/cista/all/conanfile.py b/recipes/cista/all/conanfile.py index a5a461c964a048..98e6da7d482b1f 100644 --- a/recipes/cista/all/conanfile.py +++ b/recipes/cista/all/conanfile.py @@ -18,6 +18,7 @@ class CistaConan(ConanFile): topics = ("cista", "serialization", "deserialization", "reflection") homepage = "https://github.com/felixguendling/cista" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -35,6 +36,9 @@ def _compilers_minimum_version(self): "apple-clang": "9.1" } + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -54,9 +58,6 @@ def loose_lt_semver(v1, v2): f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", ) - def layout(self): - basic_layout(self, src_folder="src") - def source(self): for file in self.conan_data["sources"][self.version]: filename = os.path.basename(file["url"]) diff --git a/recipes/cista/all/test_package/conanfile.py b/recipes/cista/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/cista/all/test_package/conanfile.py +++ b/recipes/cista/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() 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/civetweb/all/conanfile.py b/recipes/civetweb/all/conanfile.py index 4d048e6a27d5bf..b393da542821b2 100644 --- a/recipes/civetweb/all/conanfile.py +++ b/recipes/civetweb/all/conanfile.py @@ -83,11 +83,11 @@ def layout(self): def requirements(self): if self.options.with_ssl: if Version(self.version) < "1.16": - self.requires("openssl/1.1.1t") + self.requires("openssl/1.1.1w") else: self.requires("openssl/[>=1 <4]") if self.options.get_safe("with_zlib"): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.options.get_safe("ssl_dynamic_loading") and not self.dependencies["openssl"].options.shared: diff --git a/recipes/clhep/all/conandata.yml b/recipes/clhep/all/conandata.yml index 2745e50b6c689d..048d5c59d63e14 100644 --- a/recipes/clhep/all/conandata.yml +++ b/recipes/clhep/all/conandata.yml @@ -1,9 +1,28 @@ sources: + "2.4.6.4": + url: "https://proj-clhep.web.cern.ch/proj-clhep/dist1/clhep-2.4.6.4.tgz" + sha256: "49c89330f1903ef707d3c5d79c16a7c5a6f2c90fc290e2034ee3834809489e57" "2.4.1.3": url: "https://proj-clhep.web.cern.ch/proj-clhep/dist1/clhep-2.4.1.3.tgz" sha256: "27c257934929f4cb1643aa60aeaad6519025d8f0a1c199bc3137ad7368245913" patches: + "2.4.6.4": + - 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_file: "patches/mingw-support.patch" - - patch_file: "patches/msvc-2015-no-SFINAE.patch" + - 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/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/2.4.6.4-0001-fix-cmake.patch b/recipes/clhep/all/patches/2.4.6.4-0001-fix-cmake.patch new file mode 100644 index 00000000000000..7137344105ea31 --- /dev/null +++ b/recipes/clhep/all/patches/2.4.6.4-0001-fix-cmake.patch @@ -0,0 +1,72 @@ +--- a/CLHEP/CMakeLists.txt ++++ b/CLHEP/CMakeLists.txt +@@ -121,10 +121,8 @@ add_subdirectory(RefCount) + add_subdirectory(Exceptions) + + # libCLHEP.a and libCLHEP.so +-clhep_build_libclhep( ${CLHEP_libraries} ) + + # provide tools for other packages to include CLHEP easily +-clhep_toolchain() + + # - Build docucumentation if required + if(CLHEP_BUILD_DOCS) +@@ -151,4 +149,3 @@ if(CLHEP_BUILD_DOCS) + endif() + + # Custom Packaging +-include(ClhepPackaging) +--- a/CLHEP/cmake/Modules/ClhepBuildTest.cmake ++++ b/CLHEP/cmake/Modules/ClhepBuildTest.cmake +@@ -17,6 +17,8 @@ include(ClhepParseArgs) + + + macro( clhep_test testname ) ++# disable tests ++if(FALSE) + clhep_parse_args( CTST "LIBS;DEPENDS" "SIMPLE;FAIL;NOLIB" ${ARGN}) + + # automake/autoconf variables for ${testname}.sh.in +@@ -68,4 +70,5 @@ macro( clhep_test testname ) + endif() + endif() + ++endif() + endmacro( clhep_test ) +--- a/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake ++++ b/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake +@@ -30,29 +30,24 @@ macro(clhep_build_library package) + endif() + + # Add the libraries and set properties +- ADD_LIBRARY(${package} SHARED ${CLHEP_${package}_SOURCES}) +- ADD_LIBRARY(${package}S STATIC ${CLHEP_${package}_SOURCES}) ++ # Build shared or static, not both, because: ++ # - slower build ++ # - lot of issues because output names are the same + msvc shared is broken ++ ADD_LIBRARY(${package} ${CLHEP_${package}_SOURCES}) + SET_TARGET_PROPERTIES (${package} + PROPERTIES + OUTPUT_NAME CLHEP-${package}-${VERSION} + ) +- SET_TARGET_PROPERTIES(${package}S +- PROPERTIES +- OUTPUT_NAME CLHEP-${package}-${VERSION} +- ) + + # Do not add -Dname_EXPORTS to the command-line when building files in this + # target. Doing so is actively harmful for the modules build because it + # creates extra module variants, and not useful because we don't use these + # macros. + SET_TARGET_PROPERTIES(${package} PROPERTIES DEFINE_SYMBOL "") +- SET_TARGET_PROPERTIES(${package}S PROPERTIES DEFINE_SYMBOL "") +- + target_link_libraries(${package} ${package_library_list} ) +- target_link_libraries(${package}S ${package_library_list_static} ) + + # Install the libraries +- INSTALL (TARGETS ${package} ${package}S ++ INSTALL (TARGETS ${package} + EXPORT CLHEPLibraryDepends + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib${LIB_SUFFIX} 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/clhep/config.yml b/recipes/clhep/config.yml index e3d64184919efb..ad9dd349ce89d4 100644 --- a/recipes/clhep/config.yml +++ b/recipes/clhep/config.yml @@ -1,3 +1,5 @@ versions: + "2.4.6.4": + folder: all "2.4.1.3": folder: all diff --git a/recipes/clickhouse-cpp/all/conandata.yml b/recipes/clickhouse-cpp/all/conandata.yml index 67cb91f1f1a6cf..16d1b5fbe21b5c 100644 --- a/recipes/clickhouse-cpp/all/conandata.yml +++ b/recipes/clickhouse-cpp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.5.1": + url: "https://github.com/ClickHouse/clickhouse-cpp/archive/refs/tags/v2.5.1.tar.gz" + sha256: "8942fc702eca1f656e59c680c7e464205bffea038b62c1a0ad1f794ee01e7266" + "2.5.0": + url: "https://github.com/ClickHouse/clickhouse-cpp/archive/refs/tags/v2.5.0.tar.gz" + sha256: "7eead6beb47a64be9b1f12f2435f0fb6304e8363823ed72178c76faf0d835801" "2.4.0": url: "https://github.com/ClickHouse/clickhouse-cpp/archive/refs/tags/v2.4.0.tar.gz" sha256: "336a1d0b4c4d6bd67bd272afab3bdac51695f8b0e93dd6c85d4d774d6c7df8ad" diff --git a/recipes/clickhouse-cpp/all/conanfile.py b/recipes/clickhouse-cpp/all/conanfile.py index 442d24123399e2..4f321b7e267a75 100644 --- a/recipes/clickhouse-cpp/all/conanfile.py +++ b/recipes/clickhouse-cpp/all/conanfile.py @@ -10,39 +10,24 @@ class ClickHouseCppConan(ConanFile): name = "clickhouse-cpp" - homepage = "https://github.com/ClickHouse/clickhouse-cpp" - url = "https://github.com/conan-io/conan-center-index" description = "ClickHouse C++ API" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ClickHouse/clickhouse-cpp" topics = ("database", "db", "clickhouse") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "enable_benchmark": [True, False], - "with_openssl": [True, False] + "with_openssl": [True, False], } default_options = { "shared": False, "fPIC": True, - "enable_benchmark": False, - "with_openssl": False + "with_openssl": False, } - def requirements(self): - - self.requires("lz4/1.9.4") - - self.requires("abseil/20230125.3", transitive_headers=True) - - self.requires("cityhash/cci.20130801") - if self.options.with_openssl: - self.requires("openssl/[>=1.1 <4]") - - def build_requirements(self): - if self.options.enable_benchmark: - self.requires("benchmark/1.8.0") - @property def _min_cppstd(self): return "17" @@ -58,17 +43,9 @@ def _compilers_minimum_version(self): @property def _requires_compiler_rt(self): - return self.settings.compiler == "clang" and (( self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] and not self.options.shared) or self.settings.compiler.libcxx == "libc++" ) - - 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++17, which your compiler does not support.") - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("f{self.ref} does not support shared library on Windows.") - # look at https://github.com/ClickHouse/clickhouse-cpp/pull/226 + return self.settings.compiler == "clang" and \ + ((self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] and not self.options.shared) or \ + self.settings.compiler.libcxx == "libc++") def config_options(self): if self.settings.os == "Windows": @@ -81,18 +58,36 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + self.requires("lz4/1.9.4") + self.requires("abseil/20230125.3", transitive_headers=True) + self.requires("cityhash/cci.20130801") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + 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 does not support.") + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support shared library on Windows.") + # look at https://github.com/ClickHouse/clickhouse-cpp/pull/226 + 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) - tc.variables["BUILD_BENCHMARK"] = self.options.enable_benchmark tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared - tc.variables["WITH_OPENSSL"] = self.options.with_openssl + tc.cache_variables["WITH_OPENSSL"] = self.options.with_openssl tc.cache_variables["WITH_SYSTEM_ABSEIL"] = True tc.cache_variables["WITH_SYSTEM_LZ4"] = True tc.cache_variables["WITH_SYSTEM_CITYHASH"] = True + # TODO: enable DEBUG_DEPENDENCIES on >= 2.5.0 + if Version(self.version) >= "2.5.0": + tc.cache_variables["DEBUG_DEPENDENCIES"] = False tc.generate() cd = CMakeDeps(self) @@ -118,10 +113,11 @@ def package_info(self): self.cpp_info.sharedlinkflags = ldflags self.cpp_info.system_libs.append("gcc_s") + if self.settings.os == 'Windows': + self.cpp_info.system_libs = ['ws2_32', 'wsock32'] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "clickhouse-cpp" self.cpp_info.filenames["cmake_find_package_multi"] = "clickhouse-cpp" self.cpp_info.names["cmake_find_package"] = "clickhouse-cpp-lib" self.cpp_info.names["cmake_find_package_multi"] = "clickhouse-cpp-lib" - - if self.settings.os == 'Windows': - self.cpp_info.system_libs = ['ws2_32', 'wsock32'] diff --git a/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt b/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt index b042c5663ae081..ede8071f6e7444 100644 --- a/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt +++ b/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt @@ -4,6 +4,5 @@ project(test_package LANGUAGES CXX) find_package(clickhouse-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE clickhouse-cpp-lib::clickhouse-cpp-lib ) - -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE clickhouse-cpp-lib::clickhouse-cpp-lib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/clickhouse-cpp/config.yml b/recipes/clickhouse-cpp/config.yml index e1d4aed9fe78fa..b99c6305af1052 100644 --- a/recipes/clickhouse-cpp/config.yml +++ b/recipes/clickhouse-cpp/config.yml @@ -1,3 +1,7 @@ versions: + "2.5.1": + folder: all + "2.5.0": + folder: all "2.4.0": folder: all diff --git a/recipes/clipboard_lite/all/conandata.yml b/recipes/clipboard_lite/all/conandata.yml new file mode 100644 index 00000000000000..3299b8b622e6db --- /dev/null +++ b/recipes/clipboard_lite/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.4": + url: "https://github.com/smasherprog/clipboard_lite/archive/refs/tags/3.4.tar.gz" + sha256: "d8206c9c97381645b1a5a6662414d199f46fb4e160d0f914774ed8dcc0369cc4" +patches: + "3.4": + - patch_file: "patches/0001-include-string.patch" + patch_description: "include string header" + patch_type: "portability" + patch_source: "https://github.com/smasherprog/clipboard_lite/pull/3" diff --git a/recipes/clipboard_lite/all/conanfile.py b/recipes/clipboard_lite/all/conanfile.py new file mode 100644 index 00000000000000..28bed6034cb232 --- /dev/null +++ b/recipes/clipboard_lite/all/conanfile.py @@ -0,0 +1,105 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +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.apple import is_apple_os +import os + +required_conan_version = ">=1.53.0" + +class ClipboardLiteConan(ConanFile): + name = "clipboard_lite" + description = "cross platform clipboard library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/smasherprog/clipboard_lite" + topics = ("clipboard") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + 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): + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("xorg/system") + + 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 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["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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 = ["clipboard_lite"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.requires.extend(["xorg::xcb", "xorg::x11", "xorg::xfixes"]) + self.cpp_info.system_libs.extend(["m", "pthread"]) + elif is_apple_os(self): + self.cpp_info.frameworks = ['Cocoa', 'Carbon', 'CoreFoundation', 'CoreGraphics', 'Foundation', 'AppKit'] + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend([ + "shlwapi", + "windowscodecs", + ]) diff --git a/recipes/clipboard_lite/all/patches/0001-include-string.patch b/recipes/clipboard_lite/all/patches/0001-include-string.patch new file mode 100644 index 00000000000000..9f99123d7753c8 --- /dev/null +++ b/recipes/clipboard_lite/all/patches/0001-include-string.patch @@ -0,0 +1,12 @@ +diff --git a/include/Clipboard_Lite.h b/include/Clipboard_Lite.h +index 4f98756..b68e0f4 100644 +--- a/include/Clipboard_Lite.h ++++ b/include/Clipboard_Lite.h +@@ -1,6 +1,7 @@ + #pragma once + #include + #include ++#include + + #if defined(WINDOWS) || defined(WIN32) + #if defined(CLIPBOARD_LITE_DLL) diff --git a/recipes/clipboard_lite/all/test_package/CMakeLists.txt b/recipes/clipboard_lite/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..2d472ecc585a32 --- /dev/null +++ b/recipes/clipboard_lite/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(clipboard_lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE clipboard_lite::clipboard_lite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/clipboard_lite/all/test_package/conanfile.py b/recipes/clipboard_lite/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/clipboard_lite/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/clipboard_lite/all/test_package/test_package.cpp b/recipes/clipboard_lite/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..8244a75adf8157 --- /dev/null +++ b/recipes/clipboard_lite/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include "Clipboard_Lite.h" + +// just compile it, don't execute it. +// clipboard_lite execute `assert()` with false when test_package runs in headless environment. +auto create_impl() { + auto clipboard = SL::Clipboard_Lite::CreateClipboard() + ->onText([](const std::string& text) { + std::cout << text << std::endl; + }) + ->onImage([&](const SL::Clipboard_Lite::Image& image) { + std::cout << "onImage Height=" << image.Height << " Width=" << image.Width << std::endl; + }) + ->run(); + + return clipboard; +} + +int main(void) { + auto* create = create_impl; + + return 0; +} diff --git a/recipes/clipboard_lite/config.yml b/recipes/clipboard_lite/config.yml new file mode 100644 index 00000000000000..a020f54c411ba0 --- /dev/null +++ b/recipes/clipboard_lite/config.yml @@ -0,0 +1,3 @@ +versions: + "3.4": + folder: all diff --git a/recipes/clipp/all/conanfile.py b/recipes/clipp/all/conanfile.py index 2a4b7c31a6543c..772d6c4ae0f5d9 100644 --- a/recipes/clipp/all/conanfile.py +++ b/recipes/clipp/all/conanfile.py @@ -1,25 +1,50 @@ import os -from conan import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout required_conan_version = ">=1.50.0" + class ClippConan(ConanFile): name = "clipp" - description = """Easy to use, powerful & expressive command line argument parsing for modern C++ / single header / usage & doc generation.""" - topics = ("clipp", "argparse", "cli", "usage", "options", "subcommands") + description = ( + "Easy to use, powerful & expressive command line argument parsing " + "for modern C++ / single header / usage & doc generation." + ) + topics = ("argparse", "cli", "usage", "options", "subcommands") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/muellan/clipp" license = "MIT" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def source(self): - tools.files.get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + @property + def _min_cppstd(self): + return "11" - def package(self): - tools.files.copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - tools.files.copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() + + def validate(self): + 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) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "clipp") + self.cpp_info.set_property("cmake_target_name", "clipp::clipp") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/clipp/all/test_package/CMakeLists.txt b/recipes/clipp/all/test_package/CMakeLists.txt index 829b5ca81b9ceb..a7580c7f51d5d7 100644 --- a/recipes/clipp/all/test_package/CMakeLists.txt +++ b/recipes/clipp/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(clipp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE clipp::clipp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/clipp/all/test_package/conanfile.py b/recipes/clipp/all/test_package/conanfile.py index 70924c438164ec..81d4d29e64c73d 100644 --- a/recipes/clipp/all/test_package/conanfile.py +++ b/recipes/clipp/all/test_package/conanfile.py @@ -1,11 +1,17 @@ import os -from conans import CMake -from conan import ConanFile, tools + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) def requirements(self): self.requires(self.tested_reference_str) @@ -16,6 +22,6 @@ def build(self): cmake.build() def test(self): - if not tools.build.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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/doxygen/all/test_v1_package/CMakeLists.txt b/recipes/clipp/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/doxygen/all/test_v1_package/CMakeLists.txt rename to recipes/clipp/all/test_v1_package/CMakeLists.txt diff --git a/recipes/gli/all/test_v1_package/conanfile.py b/recipes/clipp/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/gli/all/test_v1_package/conanfile.py rename to recipes/clipp/all/test_v1_package/conanfile.py diff --git a/recipes/clipper2/all/conandata.yml b/recipes/clipper2/all/conandata.yml new file mode 100644 index 00000000000000..317fd4373a1def --- /dev/null +++ b/recipes/clipper2/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.3.0": + url: "https://github.com/AngusJohnson/Clipper2/archive/refs/tags/Cliper2_1.3.0.tar.gz" + sha256: "f7e1a706f5f786ed1be8ae969ce15ca569ce36d8de1c3d3f3dacfb3ce0c493e8" + "1.2.4": + url: "https://github.com/AngusJohnson/Clipper2/archive/refs/tags/Clipper2_1.2.4.tar.gz" + sha256: "a013d391c25c5f665cdb5cbd75cdd842dcc28f6e1bd098454beb359f6f212f33" + "1.2.3": + url: "https://github.com/AngusJohnson/Clipper2/archive/refs/tags/Clipper2_1.2.3.tar.gz" + sha256: "d65bd45f50331e9dd2de3c68137c6be069fe25732095bef0128d547c997b1fda" + "1.2.2": + url: "https://github.com/AngusJohnson/Clipper2/files/11071418/Clipper2_1.2.2.zip" + sha256: "ec28bc4e05a86cb0be81a872e8d90a4d575b63882ef3ac78f06662358e410f89" +patches: + "1.2.4": + - patch_file: "patches/1.2.4-0001-remove-macos-suffix.patch" + patch_description: "fix install for windows shared build" + patch_type: "portability" + "1.2.2": + - patch_file: "patches/1.2.2-0001-fix-install.patch" + patch_description: "fix install for windows shared build" + patch_type: "portability" diff --git a/recipes/clipper2/all/conanfile.py b/recipes/clipper2/all/conanfile.py new file mode 100644 index 00000000000000..fe88fd67b3e807 --- /dev/null +++ b/recipes/clipper2/all/conanfile.py @@ -0,0 +1,107 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir, export_conandata_patches, apply_conandata_patches +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class Clipper2Conan(ConanFile): + name = "clipper2" + description = " A Polygon Clipping and Offsetting library in C++" + license = "BSL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AngusJohnson/Clipper2" + topics = ("geometry", "polygon", "clipping") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "usingz": ["ON", "OFF", "ONLY"], + } + default_options = { + "shared": False, + "fPIC": True, + "usingz": "ON", + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + 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 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 = Version(self.version) >= "1.2.3") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["CLIPPER2_UTILS"] = False + tc.variables["CLIPPER2_EXAMPLES"] = False + tc.variables["CLIPPER2_TESTS"] = False + tc.variables["CLIPPER2_USINGZ"] = self.options.usingz + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "CPP")) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + if self.options.usingz != "ONLY": + self.cpp_info.components["clipper2"].set_property("cmake_target_name", "Clipper2::clipper2") + self.cpp_info.components["clipper2"].set_property("pkg_config_name", "Clipper2") + self.cpp_info.components["clipper2"].libs = ["Clipper2"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["clipper2"].system_libs.append("m") + + if self.options.usingz != "OFF": + self.cpp_info.components["clipper2z"].set_property("cmake_target_name", "Clipper2::clipper2z") + self.cpp_info.components["clipper2z"].set_property("pkg_config_name", "Clipper2Z") + self.cpp_info.components["clipper2z"].libs = ["Clipper2Z"] + self.cpp_info.components["clipper2z"].defines.append("USINGZ") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["clipper2z"].system_libs.append("m") diff --git a/recipes/clipper2/all/patches/1.2.2-0001-fix-install.patch b/recipes/clipper2/all/patches/1.2.2-0001-fix-install.patch new file mode 100644 index 00000000000000..4f4848313e0763 --- /dev/null +++ b/recipes/clipper2/all/patches/1.2.2-0001-fix-install.patch @@ -0,0 +1,14 @@ +diff --git a/CPP/CMakeLists.txt b/CPP/CMakeLists.txt +index 58b41c2..cd2f96b 100644 +--- a/CPP/CMakeLists.txt ++++ b/CPP/CMakeLists.txt +@@ -245,6 +245,9 @@ endforeach() + + install(TARGETS ${CLIPPER2_LIBS} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/clipper2 ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + install(FILES ${CLIPPER2_PCFILES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + diff --git a/recipes/clipper2/all/patches/1.2.4-0001-remove-macos-suffix.patch b/recipes/clipper2/all/patches/1.2.4-0001-remove-macos-suffix.patch new file mode 100644 index 00000000000000..bdf115e1c468c8 --- /dev/null +++ b/recipes/clipper2/all/patches/1.2.4-0001-remove-macos-suffix.patch @@ -0,0 +1,13 @@ +diff --git a/CPP/CMakeLists.txt b/CPP/CMakeLists.txt +index 817cf01..cd17e84 100644 +--- a/CPP/CMakeLists.txt ++++ b/CPP/CMakeLists.txt +@@ -19,7 +19,7 @@ set(CLIPPER2_USINGZ "ON" CACHE STRING "Build Clipper2Z, either \"ON\" or \"OFF\" + set(CLIPPER2_MAX_PRECISION 8 CACHE STRING "Maximum precision allowed for double to int64 scaling") + + if (APPLE) +- set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") ++# set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif () + + include(GNUInstallDirs) diff --git a/recipes/clipper2/all/test_package/CMakeLists.txt b/recipes/clipper2/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..6b344661830838 --- /dev/null +++ b/recipes/clipper2/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(clipper2 REQUIRED CONFIG) + +if(TARGET Clipper2::clipper2) + add_executable(${PROJECT_NAME} test_package.cpp) + target_link_libraries(${PROJECT_NAME} PRIVATE Clipper2::clipper2) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() + +if(TARGET Clipper2::clipper2z) + add_executable(${PROJECT_NAME}_z test_package_z.cpp) + target_link_libraries(${PROJECT_NAME}_z PRIVATE Clipper2::clipper2z) + target_compile_features(${PROJECT_NAME}_z PRIVATE cxx_std_17) +endif() + diff --git a/recipes/clipper2/all/test_package/conanfile.py b/recipes/clipper2/all/test_package/conanfile.py new file mode 100644 index 00000000000000..87531c64cc6a25 --- /dev/null +++ b/recipes/clipper2/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +from conan import ConanFile, conan_version +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): + if conan_version.major >= 2: + usingz = self.dependencies["clipper2"].options.usingz + else: + usingz = self.options["clipper2"].usingz + + if usingz != "ONLY": + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") + if usingz != "OFF": + bin_path = os.path.join(self.cpp.build.bindir, "test_package_z") + self.run(bin_path, env="conanrun") diff --git a/recipes/clipper2/all/test_package/test_package.cpp b/recipes/clipper2/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..f8b893dade24d6 --- /dev/null +++ b/recipes/clipper2/all/test_package/test_package.cpp @@ -0,0 +1,45 @@ +#include +#include + +#include "clipper2/clipper.h" + +using namespace Clipper2Lib; + +void DoSimpleTest(bool show_solution_coords = false); +Path64 MakeRandomPoly(int width, int height, unsigned vertCnt); + +int main() +{ + DoSimpleTest(); +} + +inline Path64 MakeStar(const Point64& center, int radius, int points) +{ + if (!(points % 2)) --points; + if (points < 5) points = 5; + Path64 tmp = Ellipse(center, radius, radius, points); + Path64 result; + result.reserve(points); + result.push_back(tmp[0]); + for (int i = points - 1, j = i / 2; j;) + { + result.push_back(tmp[j--]); + result.push_back(tmp[i--]); + } + return result; +} + +void DoSimpleTest(bool show_solution_coords) +{ + Paths64 tmp, solution; + FillRule fr = FillRule::NonZero; + + Paths64 subject, clip; + subject.push_back(MakeStar(Point64(225, 225), 220, 9)); + clip.push_back(Ellipse(Point64(225,225), 150, 150)); + + //Intersect both shapes and then 'inflate' result -10 (ie deflate) + solution = Intersect(subject, clip, fr); + solution = InflatePaths(solution, -10, JoinType::Round, EndType::Polygon); +} + diff --git a/recipes/clipper2/all/test_package/test_package_z.cpp b/recipes/clipper2/all/test_package/test_package_z.cpp new file mode 100644 index 00000000000000..3713bf124619af --- /dev/null +++ b/recipes/clipper2/all/test_package/test_package_z.cpp @@ -0,0 +1,46 @@ +#include +#include "clipper2/clipper.h" + +using namespace std; +using namespace Clipper2Lib; + +void TestingZ_Double(); + +// use the Z callback to flag intersections by setting z = 1; + +class MyClass { +public: + + // Point64 callback - see TestingZ_Int64() + void myZCB(const Point64& e1bot, const Point64& e1top, + const Point64& e2bot, const Point64& e2top, Point64& pt) + { + pt.z = 1; + } + + // PointD callback - see TestingZ_Double() + void myZCBD(const PointD& e1bot, const PointD& e1top, + const PointD& e2bot, const PointD& e2top, PointD& pt) + { + pt.z = 1; + } +}; + +int main(int argc, char* argv[]) +{ + TestingZ_Double(); +} +void TestingZ_Double() +{ + PathsD subject, solution; + MyClass mc; + ClipperD c; + + subject.push_back(MakePathD({ 100, 50, 10, 79, 65, 2, 65, 98, 10, 21 })); + c.AddSubject(subject); + c.SetZCallback( + std::bind(&MyClass::myZCBD, mc, std::placeholders::_1, + std::placeholders::_2, std::placeholders::_3, + std::placeholders::_4, std::placeholders::_5)); + c.Execute(ClipType::Union, FillRule::NonZero, solution); +} diff --git a/recipes/clipper2/config.yml b/recipes/clipper2/config.yml new file mode 100644 index 00000000000000..49b239cf22a6f0 --- /dev/null +++ b/recipes/clipper2/config.yml @@ -0,0 +1,9 @@ +versions: + "1.3.0": + folder: all + "1.2.4": + folder: all + "1.2.3": + folder: all + "1.2.2": + folder: all diff --git a/recipes/clove-unit/all/conandata.yml b/recipes/clove-unit/all/conandata.yml index 8be6c1dd9a9524..b80516fa1a9755 100644 --- a/recipes/clove-unit/all/conandata.yml +++ b/recipes/clove-unit/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.1": + url: "https://github.com/fdefelici/clove-unit/archive/v2.4.1.tar.gz" + sha256: ede833e361b5b62052bd0976386307d1d962c7ab20a0e24eb6e970d409c726fe "2.4.0": url: "https://github.com/fdefelici/clove-unit/archive/v2.4.0.tar.gz" sha256: d5005854d7b3b6ed1b470c2df353fadd80a2ed5a80bb85efc074b9d55315e78d diff --git a/recipes/clove-unit/config.yml b/recipes/clove-unit/config.yml index 48ff824f790748..e5228fd78f3812 100644 --- a/recipes/clove-unit/config.yml +++ b/recipes/clove-unit/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.1": + folder: "all" "2.4.0": folder: "all" "2.3.0": diff --git a/recipes/cmake/binary/conandata.yml b/recipes/cmake/binary/conandata.yml index b8c5dfe2bfbee8..6eae0c6e974271 100644 --- a/recipes/cmake/binary/conandata.yml +++ b/recipes/cmake/binary/conandata.yml @@ -1,23 +1,137 @@ sources: - "3.26.4": + "3.27.9": Linux: armv8: - url: "https://cmake.org/files/v3.26/cmake-3.26.4-linux-aarch64.tar.gz" - sha256: "1c9843c92f40bee1a16baa12871693d3e190c9a222259a89e406d4d9aae6cf74" + url: "https://cmake.org/files/v3.27/cmake-3.27.9-linux-aarch64.tar.gz" + sha256: "11bf3d30697df465cdf43664a9473a586f010c528376a966fd310a3a22082461" x86_64: - url: "https://cmake.org/files/v3.26/cmake-3.26.4-linux-x86_64.tar.gz" - sha256: "ba1e0dcc710e2f92be6263f9617510b3660fa9dc409ad2fb8190299563f952a0" + url: "https://cmake.org/files/v3.27/cmake-3.27.9-linux-x86_64.tar.gz" + sha256: "72b01478eeb312bf1a0136208957784fe55a7b587f8d9f9142a7fc9b0b9e9a28" Macos: universal: - url: "https://cmake.org/files/v3.26/cmake-3.26.4-macos10.10-universal.tar.gz" - sha256: "f30362daae58788ada07f9f0fe2b49a53dde4262e2d8fe73640045d9d6055183" + url: "https://cmake.org/files/v3.27/cmake-3.27.9-macos10.10-universal.tar.gz" + sha256: "2ced09b99b265d18c5e215984e5898b7e3a0cc7a1293c3f3b45e4bec87a46814" Windows: armv8: - url: "https://cmake.org/files/v3.26/cmake-3.26.4-windows-arm64.zip" - sha256: "6a9b28f318e766e40ac032b7fd2064fa9e026ff329f0ea175cbc8b15af51c45c" + url: "https://cmake.org/files/v3.27/cmake-3.27.9-windows-arm64.zip" + sha256: "bca795134956264ede142f79aa513476985f4f410f6501a727d602760e9212dd" x86_64: - url: "https://cmake.org/files/v3.26/cmake-3.26.4-windows-x86_64.zip" - sha256: "62c35427104a4f8205226f72708d71334bd36a72cf72c60d0e3a766d71dcc78a" + url: "https://cmake.org/files/v3.27/cmake-3.27.9-windows-x86_64.zip" + sha256: "c14e8b5d1c7be0baf0e7936ce8b5a39c5ee3450b14d7e3b32435083eddd9aff7" + "3.27.7": + Linux: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-linux-aarch64.tar.gz" + sha256: "f40ec1b7d41e94efd6c79cf0b7fc45ed6068543af0fea47b0c9fbf2b1b1b3fbc" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-linux-x86_64.tar.gz" + sha256: "a8c92ecb139bcc7a1f92a8108179bd1d021bdb158a5ee759cba6d60010b83ae9" + Macos: + universal: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-macos10.10-universal.tar.gz" + sha256: "4a366d07fbe0be7e1efcf0dbd743d09a5dc6609da79035e4036b12296ec679cf" + Windows: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-windows-arm64.zip" + sha256: "d9b19fd6830510022156621042759af2374111dc4f431b58c8828a17a68633dc" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-windows-x86_64.zip" + sha256: "5588e50030cda3e6fa96724444d8539916ac808d78d608cda6ae6ff7c4c4c9c8" + "3.27.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-linux-aarch64.tar.gz" + sha256: "811e5040ad7f3fb4924a875373d2a1a174a01400233a81a638a989157438a5e3" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-linux-x86_64.tar.gz" + sha256: "26373a283daa8490d772dc8a179450cd6d391cb2a9db8d4242fe09e361efc42e" + Macos: + universal: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-macos10.10-universal.tar.gz" + sha256: "3977258c8d30f03f6506fdb12dac9b8570db7d5e54f541285ee540de433a9cff" + Windows: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-windows-arm64.zip" + sha256: "980b7e532d77bfb4e5814c76403242c503019f1c0699440220cf2d527c8ff350" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-windows-x86_64.zip" + sha256: "f013a0cca091aa953f9a60a99292ec7a20ae3f9ceb05cb5c08ebe164097c526f" + "3.27.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-linux-aarch64.tar.gz" + sha256: "2ffaf176d0f93c332abaffbf3ce82fc8c90e49e0fcee8dc16338bcfbb150ead7" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-linux-x86_64.tar.gz" + sha256: "138c68addae825b16ed78d792dafef5e0960194833f48bd77e7e0429c6bc081c" + Macos: + universal: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-macos10.10-universal.tar.gz" + sha256: "1f776640e6ad35b2b3fe2ab5e39cff363b2c3034ecb56e45597402b7bf010e47" + Windows: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-windows-arm64.zip" + sha256: "3fcc84d34e3213b0e4261295eaddfc645685ab366dc570421555e7f3d3080d3a" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-windows-x86_64.zip" + sha256: "1e8e06c8ecf63d5f213019e1cd39ea41a6cf952db5f2c8e69b8e47f5bc302684" + "3.27.4": + Linux: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-linux-aarch64.tar.gz" + sha256: "45538d394bd4ef2a423fa78dff5cad16bcf437a4a6dc655e999177170632b039" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-linux-x86_64.tar.gz" + sha256: "186c53121cf6ef4e48b51e88690e6ef84f268611064a42e5a2e829c3d6b2efde" + Macos: + universal: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-macos10.10-universal.tar.gz" + sha256: "1fa092bad6daf9715c6d72ff766813fd3423427696042a74f2208a2b4704ac1c" + Windows: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-windows-arm64.zip" + sha256: "6c1df7ad85ed902ad615cd0c05bca0d3c9c3f67b3980ca9dd2e39b0821d50937" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-windows-x86_64.zip" + sha256: "e5e060756444d0b2070328a8821c1ceb62bd6d267aae61bfff06f96c7ec943a6" + "3.26.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-linux-aarch64.tar.gz" + sha256: "7b91a212b9e8ca38c1482ae40ff2d3e33e9d1c7b337b39f74bd4f34fd070bb1d" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-linux-x86_64.tar.gz" + sha256: "2dd48ccd3e3d872ee4cc916f3f4e24812612421007e895f82bf9fc7e49831d62" + Macos: + universal: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-macos10.10-universal.tar.gz" + sha256: "7a4500989351e1319bb86802ead09a13d2394636efeb5da6d78212e12f2cb961" + Windows: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-windows-arm64.zip" + sha256: "16cf13c42d3f4d63ad1d61d0333b6101c0e88f893ac39f435ef472b46f50e9b2" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-windows-x86_64.zip" + sha256: "07b1c4cae3182ca1782a4d9775b5e5d164b475eb010e1dd98ce0c206c38fa73d" + "3.26.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-linux-aarch64.tar.gz" + sha256: "737b990dcbc71f060b75193b2ddd5cf9d18c199e7a94c7169c80cf9314fe714a" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-linux-x86_64.tar.gz" + sha256: "130941ae3ffe4a9ee3395514787115a273a8d1ce15cb971494bb45f7e58bb3c3" + Macos: + universal: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-macos10.10-universal.tar.gz" + sha256: "30ff04703b5973414decde82860045afdf88e6da381aca6aeb2d625b05f53f2d" + Windows: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-windows-arm64.zip" + sha256: "1d5dd0e8a316290944e3c84bd6950df7ff650c5edde311af8903e88cb6cbc0ae" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-windows-x86_64.zip" + sha256: "b95d6d8113593e001ae64df615358ea47185ad52a79d0c420332e052bd30c283" "3.25.3": Linux: armv8: diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index 174b2ccab05518..cdf491b2833f0c 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,17 +1,29 @@ versions: - "3.19.8": + "3.27.9": folder: "binary" - "3.20.6": + "3.27.7": folder: "binary" - "3.21.7": + "3.27.6": folder: "binary" - "3.22.6": + "3.27.5": folder: "binary" - "3.23.5": + "3.27.4": folder: "binary" - "3.24.4": + "3.26.6": + folder: "binary" + "3.26.5": folder: "binary" "3.25.3": folder: "binary" - "3.26.4": + "3.24.4": + folder: "binary" + "3.23.5": + folder: "binary" + "3.22.6": + folder: "binary" + "3.21.7": + folder: "binary" + "3.20.6": + folder: "binary" + "3.19.8": folder: "binary" diff --git a/recipes/cminpack/all/conanfile.py b/recipes/cminpack/all/conanfile.py index a1da35f69dd6af..e6918dedc922aa 100644 --- a/recipes/cminpack/all/conanfile.py +++ b/recipes/cminpack/all/conanfile.py @@ -1,9 +1,9 @@ -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools import files from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir import os -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.54.0" class CMinpackConan(ConanFile): @@ -14,7 +14,7 @@ class CMinpackConan(ConanFile): topics = ("nonlinear", "solver") homepage = "http://devernay.free.fr/hacks/cminpack/" license = "LicenseRef-CopyrightMINPACK.txt" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,40 +25,27 @@ class CMinpackConan(ConanFile): "fPIC": True, } - def generate(self): - tc = CMakeToolchain(self) - tc.variables["BUILD_EXAMPLES"] = "OFF" - tc.variables["CMINPACK_LIB_INSTALL_DIR"] = "lib" - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" - tc.generate() - - def layout(self): - cmake_layout(self) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - - # cminpack is a c library - 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") def source(self): - files.get(self, **self.conan_data["sources"][self.version], - strip_root=True, destination=self.source_folder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_EXAMPLES"] = "OFF" + tc.variables["CMINPACK_LIB_INSTALL_DIR"] = "lib" + tc.generate() def build(self): cmake = CMake(self) @@ -66,12 +53,11 @@ def build(self): cmake.build() def package(self): + copy(self, "CopyrightMINPACK.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() - - files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - files.copy(self, "CopyrightMINPACK.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - files.rmdir(self, os.path.join(self.package_folder, "share")) # contains cmake config files + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) # contains cmake config files def _library_postfix(self): postfix = "" @@ -92,7 +78,7 @@ def package_info(self): self.cpp_info.components["cminpack-double"].names["cmake_find_package"] = "cminpack" self.cpp_info.components["cminpack-double"].names["cmake_find_package_multi"] = "cminpack" self.cpp_info.components["cminpack-double"].names["pkg_config"] = "cminpack" - + # the single precision version self.cpp_info.components['cminpack-single'].libs = ['cminpacks' + self._library_postfix()] self.cpp_info.components['cminpack-single'].includedirs.append(minpack_include_dir) @@ -102,7 +88,6 @@ def package_info(self): self.cpp_info.components["cminpack-single"].names["cmake_find_package_multi"] = "cminpacks" self.cpp_info.components["cminpack-single"].names["pkg_config"] = "cminpacks" - if self.settings.os != "Windows": self.cpp_info.components['cminpack-double'].system_libs.append("m") self.cpp_info.components['cminpack-single'].system_libs.append("m") diff --git a/recipes/cminpack/all/test_package/CMakeLists.txt b/recipes/cminpack/all/test_package/CMakeLists.txt index fa33c20512fe46..cc33b8b3543efd 100644 --- a/recipes/cminpack/all/test_package/CMakeLists.txt +++ b/recipes/cminpack/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.12) -project(CMinPack-Conan-TestPackage C) +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) -find_package(CMinpack REQUIRED) +find_package(CMinpack REQUIRED CONFIG) # This builds one of the original cminpack examples against # both types of the library diff --git a/recipes/cminpack/all/test_package/conanfile.py b/recipes/cminpack/all/test_package/conanfile.py index db7d5f7ac5bc33..434bb3861fb76b 100644 --- a/recipes/cminpack/all/test_package/conanfile.py +++ b/recipes/cminpack/all/test_package/conanfile.py @@ -1,17 +1,20 @@ - from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout 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() diff --git a/recipes/cminpack/all/test_v1_package/CMakeLists.txt b/recipes/cminpack/all/test_v1_package/CMakeLists.txt index 124290cb0ab4b9..0d20897301b68b 100644 --- a/recipes/cminpack/all/test_v1_package/CMakeLists.txt +++ b/recipes/cminpack/all/test_v1_package/CMakeLists.txt @@ -1,16 +1,8 @@ -cmake_minimum_required(VERSION 3.1.2) -project(CMinPack-ConanV1-TestPackage C) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(CMinpack REQUIRED CONFIG) - -# This builds one of the original cminpack examples against -# both types of the library - -add_executable(cminpack_test_double ../test_package/tchkderc.c) -target_link_libraries(cminpack_test_double PRIVATE cminpack::cminpack) - -add_executable(cminpack_test_float ../test_package/tchkderc.c) -target_link_libraries(cminpack_test_float PRIVATE cminpack::cminpacks) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cn-cbor/all/CMakeLists.txt b/recipes/cn-cbor/all/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9a..00000000000000 --- a/recipes/cn-cbor/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/cn-cbor/all/conanfile.py b/recipes/cn-cbor/all/conanfile.py index 74e90a06cc919f..91eccd3167699e 100644 --- a/recipes/cn-cbor/all/conanfile.py +++ b/recipes/cn-cbor/all/conanfile.py @@ -1,82 +1,79 @@ 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, rmdir + +required_conan_version = ">=1.53.0" class CnCborStackConan(ConanFile): name = "cn-cbor" + description = "A constrained node implementation of CBOR in C" license = "MIT" - homepage = "https://github.com/jimsch/cn-cbor/" url = "https://github.com/conan-io/conan-center-index" - description = "A constrained node implementation of CBOR in C" - topics = "cbor", "nodes", "messaging" - exports_sources = ['CMakeLists.txt'] - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/jimsch/cn-cbor/" + topics = ("cbor", "nodes", "messaging") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], } default_options = { "shared": False, - "fPIC": True + "fPIC": True, } - generators = "cmake", "cmake_find_package" - - _cmake = None - - @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): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd if self.options.shared: - del self.options.fPIC + 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 validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("Windows shared builds are not supported right now") 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 _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["fatal_warnings"] = False - self._cmake.definitions["coveralls"] = False - self._cmake.definitions["build_tests"] = False - self._cmake.definitions["build_docs"] = False - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["fatal_warnings"] = False + tc.variables["coveralls"] = False + tc.variables["build_tests"] = False + tc.variables["build_docs"] = False + tc.generate() def build(self): - cmake = self._configure_cmake() + 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() os.remove(os.path.join(self.package_folder, "README.md")) os.remove(os.path.join(self.package_folder, "LICENSE")) - 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, "lib", "cn-cbor", "cmake")) + 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, "lib", "cn-cbor", "cmake")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["cn-cbor"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/cn-cbor/all/test_package/CMakeLists.txt b/recipes/cn-cbor/all/test_package/CMakeLists.txt index 33ae887aa6aea3..50e6a7de0b4eaf 100644 --- a/recipes/cn-cbor/all/test_package/CMakeLists.txt +++ b/recipes/cn-cbor/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(cn-cbor REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE cn-cbor::cn-cbor) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/cn-cbor/all/test_package/conanfile.py b/recipes/cn-cbor/all/test_package/conanfile.py index 933dbf96533ae4..fae501d0afb9e4 100644 --- a/recipes/cn-cbor/all/test_package/conanfile.py +++ b/recipes/cn-cbor/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" + test_type = "explicit" -class TestConan(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,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") - 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/cn-cbor/all/test_v1_package/CMakeLists.txt b/recipes/cn-cbor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cn-cbor/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/cn-cbor/all/test_v1_package/conanfile.py b/recipes/cn-cbor/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..9de3689208f00b --- /dev/null +++ b/recipes/cn-cbor/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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) + 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) diff --git a/recipes/cnpy/all/conanfile.py b/recipes/cnpy/all/conanfile.py index 93cc4c7d5cadca..f6babc5b8b09b8 100644 --- a/recipes/cnpy/all/conanfile.py +++ b/recipes/cnpy/all/conanfile.py @@ -41,7 +41,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13", transitive_headers=True, transitive_libs=True) + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/cocoyaxi/all/conanfile.py b/recipes/cocoyaxi/all/conanfile.py index 217d2d1b7c4e18..1209ab9f837645 100644 --- a/recipes/cocoyaxi/all/conanfile.py +++ b/recipes/cocoyaxi/all/conanfile.py @@ -30,6 +30,7 @@ class CocoyaxiConan(ConanFile): "with_libcurl": False, "with_openssl": False, } + deprecated = "coost" def config_options(self): if self.settings.os == "Windows": @@ -37,13 +38,13 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): if self.options.with_libcurl: - self.requires("libcurl/7.80.0") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.with_libcurl or self.options.with_openssl: - self.requires("openssl/1.1.1q") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.info.settings.compiler.cppstd: @@ -95,3 +96,7 @@ def package_info(self): self.cpp_info.components["co"].requires.append("libcurl::libcurl") if self.options.with_libcurl or self.options.with_openssl: self.cpp_info.components["co"].requires.append("openssl::openssl") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["co"].system_libs.extend(["pthread", "dl", "m"]) + elif self.settings.os == "Windows": + self.cpp_info.components["co"].system_libs.append("ws2_32") diff --git a/recipes/coin-cgl/all/conandata.yml b/recipes/coin-cgl/all/conandata.yml index 5fc7e9f24039c8..9cf464447df6f1 100644 --- a/recipes/coin-cgl/all/conandata.yml +++ b/recipes/coin-cgl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.60.7": + url: "https://github.com/coin-or/Cgl/archive/releases/0.60.7.tar.gz" + sha256: "93b30a80b5d2880c2e72d5877c64bdeaf4d7c1928b3194ea2f88b1aa4517fb1b" "0.60.6": url: "https://github.com/coin-or/Cgl/archive/refs/tags/releases/0.60.6.tar.gz" sha256: "9e2c51ffad816ab408763d6b931e2a3060482ee4bf1983148969de96d4b2c9ce" @@ -6,6 +9,8 @@ sources: url: "https://github.com/coin-or/Cgl/archive/refs/tags/releases/0.60.3.tar.gz" sha256: "cfeeedd68feab7c0ce377eb9c7b61715120478f12c4dd0064b05ad640e20f3fb" patches: + "0.60.7": + - patch_file: "patches/0.60.6-0001-no-pkg-config-check.patch" "0.60.6": - patch_file: "patches/0.60.6-0001-no-pkg-config-check.patch" "0.60.3": diff --git a/recipes/coin-cgl/all/conanfile.py b/recipes/coin-cgl/all/conanfile.py index 8da58a4cb04879..df23309955a251 100644 --- a/recipes/coin-cgl/all/conanfile.py +++ b/recipes/coin-cgl/all/conanfile.py @@ -49,14 +49,14 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("coin-utils/2.11.6") + self.requires("coin-utils/2.11.9") self.requires("coin-osi/0.108.7") self.requires("coin-clp/1.17.7") 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 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/coin-cgl/all/test_package/conanfile.py b/recipes/coin-cgl/all/test_package/conanfile.py index af1af0ebb3d7f1..7ab87ca07735c6 100644 --- a/recipes/coin-cgl/all/test_package/conanfile.py +++ b/recipes/coin-cgl/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-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-cgl/config.yml b/recipes/coin-cgl/config.yml index c588b8cdfa7674..19787257e6449a 100644 --- a/recipes/coin-cgl/config.yml +++ b/recipes/coin-cgl/config.yml @@ -1,4 +1,6 @@ versions: + "0.60.7": + folder: "all" "0.60.6": folder: "all" "0.60.3": diff --git a/recipes/coin-clp/all/conanfile.py b/recipes/coin-clp/all/conanfile.py index 94e548dfba6550..7d2a72db5923b8 100644 --- a/recipes/coin-clp/all/conanfile.py +++ b/recipes/coin-clp/all/conanfile.py @@ -50,7 +50,7 @@ def layout(self): def requirements(self): # Symbols are exposed https://github.com/conan-io/conan-center-index/pull/16053#issuecomment-1512637106 - self.requires("coin-utils/2.11.6", transitive_headers=True, transitive_libs=True) + self.requires("coin-utils/2.11.9", transitive_headers=True, transitive_libs=True) self.requires("coin-osi/0.108.7", transitive_headers=True) def validate(self): @@ -63,7 +63,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.1.0") 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/coin-clp/all/test_package/conanfile.py b/recipes/coin-clp/all/test_package/conanfile.py index 160bdaf5610e03..f085dad93e3838 100644 --- a/recipes/coin-clp/all/test_package/conanfile.py +++ b/recipes/coin-clp/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.1.0") def build(self): cmake = CMake(self) diff --git a/recipes/coin-clp/all/test_v1_package/conanfile.py b/recipes/coin-clp/all/test_v1_package/conanfile.py index 9b15feda1ca300..6b31eec8506a43 100644 --- a/recipes/coin-clp/all/test_v1_package/conanfile.py +++ b/recipes/coin-clp/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.1.0") def build(self): cmake = CMake(self) diff --git a/recipes/coin-osi/all/conanfile.py b/recipes/coin-osi/all/conanfile.py index af104a9d3fcbba..25195bd85f4c67 100644 --- a/recipes/coin-osi/all/conanfile.py +++ b/recipes/coin-osi/all/conanfile.py @@ -49,7 +49,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("coin-utils/2.11.6") + self.requires("coin-utils/2.11.9") def validate(self): if self.settings.os == "Windows" and self.options.shared: @@ -61,7 +61,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 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/coin-osi/all/test_package/conanfile.py b/recipes/coin-osi/all/test_package/conanfile.py index af1af0ebb3d7f1..7ab87ca07735c6 100644 --- a/recipes/coin-osi/all/test_package/conanfile.py +++ b/recipes/coin-osi/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-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/conanfile.py b/recipes/coin-utils/all/conanfile.py index e953f7c06f6759..98f96c3d122012 100644 --- a/recipes/coin-utils/all/conanfile.py +++ b/recipes/coin-utils/all/conanfile.py @@ -54,7 +54,7 @@ def layout(self): def requirements(self): self.requires("bzip2/1.0.8") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.settings.os == "Windows" and self.options.shared: 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 f3b0e9f61cd278..0bbd21e7700bf2 100644 --- a/recipes/commata/all/conandata.yml +++ b/recipes/commata/all/conandata.yml @@ -1,4 +1,10 @@ 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" "0.2.5": url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.5.tar.gz" sha256: "d1be1f366267af6c466c29f846f5968f57626a8a6635a2ea9a3de3f6fb88e53b" diff --git a/recipes/commata/config.yml b/recipes/commata/config.yml index 5000ff084e2004..02125db50fd0d7 100644 --- a/recipes/commata/config.yml +++ b/recipes/commata/config.yml @@ -1,4 +1,8 @@ versions: + "0.2.6-bug1": + folder: all + "0.2.6": + folder: all "0.2.5": folder: all "0.2.4-bug1": diff --git a/recipes/continuable/all/conandata.yml b/recipes/continuable/all/conandata.yml index 13887549bde390..15db65fb152edd 100644 --- a/recipes/continuable/all/conandata.yml +++ b/recipes/continuable/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.2.2": + url: "https://github.com/Naios/continuable/archive/4.2.2.tar.gz" + sha256: "49bf82a349b26c01194631e4fe5d1dbad080b3b4a347eebc5cf95326ea130fba" "4.2.1": url: "https://github.com/Naios/continuable/archive/4.2.1.tar.gz" sha256: "19c7c2371c94ec759eac8169dea593703b54057551322b5d682643548c9c0146" @@ -6,5 +9,5 @@ sources: url: "https://github.com/Naios/continuable/archive/4.2.0.tar.gz" sha256: "d85bed930ac19d4b36b23778ad9ae943c2981f7492982bd51dadb89e8908d53f" "4.1.0": - sha256: "CBCF50B1B73D8B4EB54734C827D6736CD038960E13F80699958DBB87F1827650" url: "https://github.com/Naios/continuable/archive/4.1.0.tar.gz" + sha256: "CBCF50B1B73D8B4EB54734C827D6736CD038960E13F80699958DBB87F1827650" diff --git a/recipes/continuable/all/conanfile.py b/recipes/continuable/all/conanfile.py index 40af36527241ef..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.1.0") + self.requires("function2/4.2.4") def package_id(self): self.info.clear() diff --git a/recipes/continuable/all/test_package/CMakeLists.txt b/recipes/continuable/all/test_package/CMakeLists.txt index f98eae0c75bf8e..9a7b7e199f5b87 100644 --- a/recipes/continuable/all/test_package/CMakeLists.txt +++ b/recipes/continuable/all/test_package/CMakeLists.txt @@ -5,7 +5,7 @@ find_package(continuable REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) set_target_properties(${PROJECT_NAME} PROPERTIES - CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON ) target_link_libraries(${PROJECT_NAME} PRIVATE continuable::continuable) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/continuable/config.yml b/recipes/continuable/config.yml index 52fa67bcd41e8a..955cd0773fc58e 100644 --- a/recipes/continuable/config.yml +++ b/recipes/continuable/config.yml @@ -1,4 +1,6 @@ versions: + "4.2.2": + folder: all "4.2.1": folder: all "4.2.0": diff --git a/recipes/coost/all/conandata.yml b/recipes/coost/all/conandata.yml new file mode 100644 index 00000000000000..4e8bd45da11a53 --- /dev/null +++ b/recipes/coost/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.0.2": + url: "https://github.com/idealvin/coost/archive/refs/tags/v3.0.2.tar.gz" + sha256: "922ba21fb9a922c84f6a4b3bd568ed3b3463ccb1ae906cd7c49d90c7f0359b24" + "3.0.1": + url: "https://github.com/idealvin/coost/archive/refs/tags/v3.0.1.tar.gz" + sha256: "f2285d59dc8317dd2494d7628a56f10de9b814d90b86aedf93a3305f94c6ae1a" diff --git a/recipes/coost/all/conanfile.py b/recipes/coost/all/conanfile.py new file mode 100644 index 00000000000000..6b2e612afc5c5d --- /dev/null +++ b/recipes/coost/all/conanfile.py @@ -0,0 +1,109 @@ +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 +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class CoostConan(ConanFile): + name = "coost" + description = "A tiny boost library in C++11." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/idealvin/coost" + topics = ("coroutine", "cpp11", "boost") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libcurl": [True, False], + "with_openssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libcurl": False, + "with_openssl": False, + } + + @property + def _min_cppstd(self): + return 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 requirements(self): + if self.options.with_libcurl: + self.requires("libcurl/[>=7.78.0 <9]") + if self.options.with_libcurl or self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.settings.os == "Linux": + self.requires("libbacktrace/cci.20210118") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if Version(self.version) >= "3.0.2" and is_msvc(self) and self.options.shared: + # INFO: src\include\co\thread.h: error C2492: 'g_tid': data with thread storage duration may not have dll interface + raise ConanInvalidConfiguration(f"{self.ref} Conan recipe does not support -o shared=True with Visual Studio. Contributions are welcome.") + if self.info.options.with_libcurl: + if not self.info.options.with_openssl: + raise ConanInvalidConfiguration(f"{self.ref} requires with_openssl=True when using with_libcurl=True") + if self.dependencies["libcurl"].options.with_ssl != "openssl": + raise ConanInvalidConfiguration(f"{self.ref} requires libcurl/*:with_ssl='openssl' to be enabled") + if not self.dependencies["libcurl"].options.with_zlib: + raise ConanInvalidConfiguration(f"{self.ref} requires libcurl/*:with_zlib=True to be enabled") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if is_msvc(self): + tc.variables["STATIC_VS_CRT"] = is_msvc_static_runtime(self) + tc.variables["WITH_LIBCURL"] = self.options.with_libcurl + tc.variables["WITH_OPENSSL"] = self.options.with_openssl + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", 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, "share")) + 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.libs = ["co"] + + self.cpp_info.set_property("cmake_file_name", "coost") + self.cpp_info.set_property("cmake_target_name", "coost::co") + self.cpp_info.set_property("pkg_config_name", "coost") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "dl", "m"] + if self.settings.os == "Linux": + self.cpp_info.requires.append("libbacktrace::libbacktrace") + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/coost/all/test_package/CMakeLists.txt b/recipes/coost/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..f7ac5b551babf3 --- /dev/null +++ b/recipes/coost/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(coost REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE coost::co) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/coost/all/test_package/conanfile.py b/recipes/coost/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/coost/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/coost/all/test_package/test_package.cpp b/recipes/coost/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..46b92d23f68309 --- /dev/null +++ b/recipes/coost/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "co/str.h" +#include + +int main() { + std::cout << str::from(123) << std::endl; + return 0; +} diff --git a/recipes/coost/config.yml b/recipes/coost/config.yml new file mode 100644 index 00000000000000..a300de211104be --- /dev/null +++ b/recipes/coost/config.yml @@ -0,0 +1,5 @@ +versions: + "3.0.2": + folder: all + "3.0.1": + folder: all diff --git a/recipes/corrade/all/CMakeLists.txt b/recipes/corrade/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2bb..00000000000000 --- a/recipes/corrade/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/corrade/all/conandata.yml b/recipes/corrade/all/conandata.yml index 4b0cd1b7fd3fb8..82a5660e749504 100644 --- a/recipes/corrade/all/conandata.yml +++ b/recipes/corrade/all/conandata.yml @@ -7,8 +7,7 @@ sources: url: https://github.com/mosra/corrade/archive/v2019.10.tar.gz patches: "2020.06": - - base_path: "source_subfolder" - patch_file: "patches/2020.06/0001-emscripten-toolchain.patch" - # patch_type: "portability" - # description: "Remove unnecessary dependency on UseEmscripten" - # source: "https://github.com/mosra/corrade/issues/104" + - patch_file: "patches/2020.06/0001-emscripten-toolchain.patch" + patch_type: "portability" + patch_description: "Remove unnecessary dependency on UseEmscripten" + patch_source: "https://github.com/mosra/corrade/issues/104" diff --git a/recipes/corrade/all/conanfile.py b/recipes/corrade/all/conanfile.py index dcff18b711642d..347781614d5e33 100644 --- a/recipes/corrade/all/conanfile.py +++ b/recipes/corrade/all/conanfile.py @@ -1,21 +1,24 @@ -from conan.tools.microsoft import is_msvc -from conan.tools.microsoft.visual import vs_ide_version -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools import os -required_conan_version = ">=1.45.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, check_min_vs + +required_conan_version = ">=1.52.0" class CorradeConan(ConanFile): name = "corrade" description = "Corrade is a multiplatform utility library written in C++11/C++14." - topics = ("corrade", "magnum", "filesystem", "console", "environment", "os") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://magnum.graphics/corrade" - license = "MIT" + topics = ("magnum", "filesystem", "console", "environment", "os") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -38,22 +41,9 @@ class CorradeConan(ConanFile): "with_utility": True, } - generators = "cmake" - 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") - self.copy("cmake/*") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "cmake/*", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -61,79 +51,96 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - def validate(self): - if is_msvc(self) and tools.Version(vs_ide_version(self)) < 14: - raise ConanInvalidConfiguration("Corrade requires Visual Studio version 14 or greater") + def layout(self): + cmake_layout(self, src_folder="src") - if not self.options.with_utility and (self.options.with_testsuite or self.options.with_interconnect or self.options.with_pluginmanager): - raise ConanInvalidConfiguration("Component 'utility' is required for 'test_suite', 'interconnect' and 'plugin_manager'") + def validate(self): + check_min_vs(self, 190) + if not self.options.with_utility and ( + self.options.with_testsuite or self.options.with_interconnect or self.options.with_pluginmanager + ): + raise ConanInvalidConfiguration( + "Component 'utility' is required for 'test_suite', 'interconnect' and 'plugin_manager'" + ) def build_requirements(self): - if hasattr(self, "settings_build") and tools.cross_building(self, skip_x64_x86=True): - self.build_requires("corrade/{}".format(self.version)) + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + self.tool_requires(f"corrade/{self.version}") 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["BUILD_STATIC"] = not self.options.shared - cmake.definitions["BUILD_STATIC_PIC"] = self.options.get_safe("fPIC", False) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_STATIC_PIC"] = self.options.get_safe("fPIC", False) - cmake.definitions["BUILD_DEPRECATED"] = self.options.build_deprecated - cmake.definitions["WITH_INTERCONNECT"] = self.options.with_interconnect - cmake.definitions["WITH_MAIN"] = self.options.with_main - cmake.definitions["WITH_PLUGINMANAGER"] = self.options.with_pluginmanager - cmake.definitions["WITH_TESTSUITE"] = self.options.with_testsuite - cmake.definitions["WITH_UTILITY"] = self.options.with_utility - cmake.definitions["WITH_RC"] = self.options.with_utility + tc.variables["BUILD_DEPRECATED"] = self.options.build_deprecated + tc.variables["WITH_INTERCONNECT"] = self.options.with_interconnect + tc.variables["WITH_MAIN"] = self.options.with_main + tc.variables["WITH_PLUGINMANAGER"] = self.options.with_pluginmanager + tc.variables["WITH_TESTSUITE"] = self.options.with_testsuite + tc.variables["WITH_UTILITY"] = self.options.with_utility + tc.variables["WITH_RC"] = self.options.with_utility # Corrade uses suffix on the resulting "lib"-folder when running cmake.install() # Set it explicitly to empty, else Corrade might set it implicitly (eg. to "64") - cmake.definitions["LIB_SUFFIX"] = "" + tc.variables["LIB_SUFFIX"] = "" if is_msvc(self): - cmake.definitions["MSVC2015_COMPATIBILITY"] = vs_ide_version(self) == "14" - cmake.definitions["MSVC2017_COMPATIBILITY"] = vs_ide_version(self) == "15" - cmake.definitions["MSVC2019_COMPATIBILITY"] = vs_ide_version(self) == "16" + if check_min_vs(self, 193, raise_invalid=False): + tc.variables["MSVC2019_COMPATIBILITY"] = True + elif check_min_vs(self, 192, raise_invalid=False): + tc.variables["MSVC2017_COMPATIBILITY"] = True + elif check_min_vs(self, 191, raise_invalid=False): + tc.variables["MSVC2015_COMPATIBILITY"] = True - cmake.configure(build_folder=self._build_subfolder) - - return cmake + 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("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() - share_cmake = os.path.join(self.package_folder, "share", "cmake", "Corrade") - self.copy("UseCorrade.cmake", src=share_cmake, dst=os.path.join(self.package_folder, "lib", "cmake")) - self.copy("CorradeLibSuffix.cmake", src=share_cmake, dst=os.path.join(self.package_folder, "lib", "cmake")) - self.copy("*.cmake", src=os.path.join(self.source_folder, "cmake"), dst=os.path.join("lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "UseCorrade.cmake", + src=share_cmake, + dst=os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "CorradeLibSuffix.cmake", + src=share_cmake, + dst=os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "*.cmake", + src=os.path.join(self.export_sources_folder, "cmake"), + dst=os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "Corrade") - self.cpp_info.names["cmake_find_package"] = "Corrade" - self.cpp_info.names["cmake_find_package_multi"] = "Corrade" + self.cpp_info.set_property("cmake_target_name", "Corrade::Corrade") suffix = "-d" if self.settings.build_type == "Debug" else "" - # The FindCorrade.cmake file provided by the library populates some extra stuff - self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "cmake", "conan-corrade-vars.cmake")]) - self.cpp_info.components["_corrade"].build_modules.append(os.path.join("lib", "cmake", "conan-corrade-vars.cmake")) + cmake_modules = [ + # Reproduces the variables and calls performed by the FindCorrade.cmake provided by the library + os.path.join("lib", "cmake", "conan-corrade-vars.cmake"), + # Autodetects LIB_SUFFIX (either "64" or "") + os.path.join("lib", "cmake", "CorradeLibSuffix.cmake"), + # Exports build flags and macros + os.path.join("lib", "cmake", "UseCorrade.cmake"), + ] + self.cpp_info.set_property("cmake_build_modules", cmake_modules) + self.cpp_info.components["_corrade"].build_modules["cmake_find_package"] = cmake_modules + self.cpp_info.components["_corrade"].build_modules["cmake_find_package_multi"] = cmake_modules if self.options.with_main: self.cpp_info.components["main"].set_property("cmake_target_name", "Corrade::Main") @@ -153,10 +160,10 @@ def package_info(self): self.cpp_info.components["utility"].requires = ["_corrade"] # This one is statically linked into utility - #self.cpp_info.components["containers"].set_property("cmake_target_name", "Corrade::Containers") - #self.cpp_info.components["containers"].names["cmake_find_package"] = "Containers" - #self.cpp_info.components["containers"].names["cmake_find_package_multi"] = "Containers" - #self.cpp_info.components["containers"].libs = ["CorradeContainers" + suffix] + # self.cpp_info.components["containers"].set_property("cmake_target_name", "Corrade::Containers") + # self.cpp_info.components["containers"].names["cmake_find_package"] = "Containers" + # self.cpp_info.components["containers"].names["cmake_find_package_multi"] = "Containers" + # self.cpp_info.components["containers"].libs = ["CorradeContainers" + suffix] if self.options.with_interconnect: self.cpp_info.components["interconnect"].set_property("cmake_target_name", "Corrade::Interconnect") @@ -181,9 +188,12 @@ def package_info(self): if self.options.with_utility: 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) # pkg_config: Add more explicit naming to generated files (avoid filesystem collision). - for key, cmp in self.cpp_info.components.items(): - self.cpp_info.components[key].names["pkg_config"] = "{}_{}".format(self.name, key) + for key, component in self.cpp_info.components.items(): + component.set_property("pkg_config_name", f"{self.name}_{key}") + + self.cpp_info.names["cmake_find_package"] = "Corrade" + self.cpp_info.names["cmake_find_package_multi"] = "Corrade" diff --git a/recipes/corrade/all/test_package/CMakeLists.txt b/recipes/corrade/all/test_package/CMakeLists.txt index e4c1f34b721de4..94206f42ad33ea 100644 --- a/recipes/corrade/all/test_package/CMakeLists.txt +++ b/recipes/corrade/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ -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(TARGETS) - -find_package(Corrade REQUIRED) +find_package(Corrade REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} Corrade::Main) -if(VERSION_2019_10) +if(VERSION_2019_10) target_compile_definitions(${PROJECT_NAME} PRIVATE VERSION_2019_10) endif() if(WITH_UTILITY) diff --git a/recipes/corrade/all/test_package/conanfile.py b/recipes/corrade/all/test_package/conanfile.py index be914f107e1214..9c0893a63e85bc 100644 --- a/recipes/corrade/all/test_package/conanfile.py +++ b/recipes/corrade/all/test_package/conanfile.py @@ -1,28 +1,37 @@ -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, CMakeToolchain import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_UTILITY"] = self.dependencies["corrade"].options.with_utility + if self.dependencies["corrade"].ref.version == "2019.10": + tc.variables["VERSION_2019_10"] = True + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["WITH_UTILITY"] = self.options["corrade"].with_utility - if self.deps_cpp_info["corrade"].version == "2019.10": - cmake.definitions["VERSION_2019_10"] = True 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) - - if self.options["corrade"].with_utility: - # Run corrade-rc - self.run("corrade-rc --help", run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") if self.settings.os == "Emscripten": - bin_path = os.path.join("bin", "test_package.js") - self.run("node {}".format(bin_path), run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, "test_package.js") + self.run(f"node {bin_path}", env="conanrun") diff --git a/recipes/corrade/all/test_package/test_package.cpp b/recipes/corrade/all/test_package/test_package.cpp index 8f5dc321a44de1..c0e1a6d7932b20 100644 --- a/recipes/corrade/all/test_package/test_package.cpp +++ b/recipes/corrade/all/test_package/test_package.cpp @@ -1,5 +1,4 @@ -#include -#include // Here it is 'nothing' +#include // Here it is 'nothing' #ifndef VERSION_2019_10 #include @@ -9,10 +8,11 @@ #include #endif +#include int main() { std::cout << "Test package for Corrade\n"; - + #ifndef VERSION_2019_10 std::cout << "Corrade " << CORRADE_VERSION_YEAR << "." << CORRADE_VERSION_MONTH << std::endl; #endif diff --git a/recipes/cose-c/all/CMakeLists.txt b/recipes/cose-c/all/CMakeLists.txt deleted file mode 100644 index 6ba47d078b3894..00000000000000 --- a/recipes/cose-c/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/cose-c/all/conandata.yml b/recipes/cose-c/all/conandata.yml index 19b29a5db955d3..b9c689437dd445 100644 --- a/recipes/cose-c/all/conandata.yml +++ b/recipes/cose-c/all/conandata.yml @@ -2,7 +2,3 @@ sources: "cci.20200430": sha256: fef43742cba828a35640eefba774be11562cab6d7bcbdcfd62613019965f87c3 url: https://github.com/cose-wg/COSE-C/archive/4432ae11f7a9711c46e8b4442fa2b35055c5cf98.zip -patches: - "cci.20200430": - - patch_file: "patches/001-fix-cmake-targets.patch" - base_path: "source_subfolder" diff --git a/recipes/cose-c/all/conanfile.py b/recipes/cose-c/all/conanfile.py index 35e896e14c7d99..a6fffdcbbb029e 100644 --- a/recipes/cose-c/all/conanfile.py +++ b/recipes/cose-c/all/conanfile.py @@ -1,38 +1,33 @@ -from conans import CMake, ConanFile, tools -import glob import os +from conan import ConanFile +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 collect_libs, copy, get, rmdir, replace_in_file + +required_conan_version = ">=1.53.0" + class CoseCConan(ConanFile): name = "cose-c" + description = "Implementation of COSE in C using cn-cbor and openssl" license = "BSD-3-Clause" - homepage = "https://github.com/cose-wg/COSE-C" url = "https://github.com/conan-io/conan-center-index" - description = """Implementation of COSE in C using cn-cbor and openssl""" - topics = ("cbor") - exports_sources = ["CMakeLists.txt", "patches/**"] - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/cose-wg/COSE-C" + topics = "cbor" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "with_ssl": ["openssl", "mbedtls"] + "with_ssl": ["openssl", "mbedtls"], } default_options = { "shared": False, "fPIC": True, - "with_ssl": "openssl" + "with_ssl": "openssl", } - generators = "cmake", "cmake_find_package" - - _cmake = None - - @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": @@ -40,53 +35,66 @@ 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) def requirements(self): - self.requires("cn-cbor/1.0.0") + self.requires("cn-cbor/1.0.0", transitive_headers=True) if self.options.with_ssl == "mbedtls": - self.requires("mbedtls/2.23.0") + self.requires("mbedtls/2.16.12", transitive_headers=True) else: - self.requires("openssl/1.1.1h") + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(glob.glob("COSE-C-*")[0], self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["COSE_C_COVERALLS"] = False - self._cmake.definitions["COSE_C_BUILD_TESTS"] = False - self._cmake.definitions["COSE_C_BUILD_DOCS"] = False - self._cmake.definitions["COSE_C_BUILD_DUMPER"] = False - self._cmake.definitions["COSE_C_USE_MBEDTLS"] = self.options.with_ssl == "mbedtls" - self._cmake.definitions["COSE_C_USE_FIND_PACKAGE"] = True - self._cmake.definitions["COSE_C_EXPORT_TARGETS"] = 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.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.cache_variables["COSE_C_COVERALLS"] = False + tc.cache_variables["COSE_C_BUILD_TESTS"] = False + tc.cache_variables["COSE_C_BUILD_DOCS"] = False + tc.cache_variables["COSE_C_BUILD_DUMPER"] = False + tc.cache_variables["COSE_C_USE_MBEDTLS"] = self.options.with_ssl == "mbedtls" + tc.cache_variables["COSE_C_USE_FIND_PACKAGE"] = True + tc.cache_variables["COSE_C_EXPORT_TARGETS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.set_property("openssl", "cmake_file_name", "OPENSSL") + deps.set_property("mbedtls", "cmake_target_name", "mbedtls") + deps.generate() + + def _patch_sources(self): + # For ${OPENSSL_LIBRARIES} and ${OPENSSL_INCLUDE_DIR} + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "OpenSSL", "OPENSSL") 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("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")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.settings.os == "Windows": self.cpp_info.system_libs.extend(["ws2_32", "secur32", "crypt32", "bcrypt"]) - if self.settings.os == "Macos": + if is_apple_os(self): self.cpp_info.frameworks.extend(["CoreFoundation", "Security"]) if self.options.with_ssl == "mbedtls": self.cpp_info.defines.append("COSE_C_USE_MBEDTLS") diff --git a/recipes/cose-c/all/patches/001-fix-cmake-targets.patch b/recipes/cose-c/all/patches/001-fix-cmake-targets.patch deleted file mode 100644 index 0c13544696d165..00000000000000 --- a/recipes/cose-c/all/patches/001-fix-cmake-targets.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5522b29..1e9700b 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -62,10 +62,10 @@ target_include_directories( - target_link_libraries(${PROJECT_NAME} PRIVATE cn-cbor::cn-cbor) - - if(COSE_C_USE_MBEDTLS) -- target_link_libraries(${PROJECT_NAME} PRIVATE mbedtls) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::mbedtls) - else() - target_include_directories(${PROJECT_NAME} PRIVATE ${OPENSSL_INCLUDE_DIR}) -- target_link_libraries(${PROJECT_NAME} PRIVATE ${OPENSSL_LIBRARIES}) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl) - endif() - - if(MSVC) diff --git a/recipes/cose-c/all/test_package/CMakeLists.txt b/recipes/cose-c/all/test_package/CMakeLists.txt index fcda1859bb6104..c29edc1ca6a27e 100644 --- a/recipes/cose-c/all/test_package/CMakeLists.txt +++ b/recipes/cose-c/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -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(cose-c REQUIRED) +find_package(cose-c REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} cose-c::cose-c) diff --git a/recipes/cose-c/all/test_package/conanfile.py b/recipes/cose-c/all/test_package/conanfile.py index aab3b289eb8cf7..ef5d7042163ecc 100644 --- a/recipes/cose-c/all/test_package/conanfile.py +++ b/recipes/cose-c/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 TestConan(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") - 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/cose-c/all/test_v1_package/CMakeLists.txt b/recipes/cose-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cose-c/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/cose-c/all/test_v1_package/conanfile.py b/recipes/cose-c/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6dffe66394a26e --- /dev/null +++ b/recipes/cose-c/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) + 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) diff --git a/recipes/cose-c/config.yml b/recipes/cose-c/config.yml index 6a4771df04b831..b452f13eb25c14 100644 --- a/recipes/cose-c/config.yml +++ b/recipes/cose-c/config.yml @@ -1,4 +1,3 @@ ---- versions: "cci.20200430": folder: "all" diff --git a/recipes/cotila/all/conanfile.py b/recipes/cotila/all/conanfile.py index eb47a8c74e0c9c..cbc8f6be750649 100644 --- a/recipes/cotila/all/conanfile.py +++ b/recipes/cotila/all/conanfile.py @@ -1,66 +1,71 @@ -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.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class CotilaConan(ConanFile): name = "cotila" description = "A compile time linear algebra system" - homepage = "https://github.com/calebzulawski/cotila" - topics = ("c++", "math", "linear algebra", "compile-time") license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - no_copy_source = True + homepage = "https://github.com/calebzulawski/cotila" + topics = ("c++", "math", "linear algebra", "compile-time", "header-only") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): - return "17" + return 17 @property def _compilers_minimum_version(self): return { "gcc": "7", - "Visual Studio": "15.7", "clang": "6.0", "apple-clang": "10", + "Visual Studio": "15.7", + "msvc": "193", } - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") + def layout(self): + basic_layout(self, src_folder="src") - def lazy_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] + def package_id(self): + self.info.clear() + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("cotila currently does not support MSVC. " + "See https://github.com/calebzulawski/cotila/issues/36.") + 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 not minimum_version: - self.output.warn("{} {} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name, self.version)) - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("{} {} requires C++17, which your compiler does not support.".format(self.name, self.version)) - - - def package_id(self): - self.info.header_only() + 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], strip_root=True, - destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="include/*", src=self._source_subfolder) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "cotila" - self.cpp_info.names["cmake_find_package_multi"] = "cotila" - + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cotila/all/test_package/CMakeLists.txt b/recipes/cotila/all/test_package/CMakeLists.txt index fb76dc36e1dc69..cf3db6db5cc451 100644 --- a/recipes/cotila/all/test_package/CMakeLists.txt +++ b/recipes/cotila/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -find_package(cotila CONFIG REQUIRED) +find_package(cotila REQUIRED CONFIG) add_executable(test_package test_package.cpp) target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/cotila/all/test_package/conanfile.py b/recipes/cotila/all/test_package/conanfile.py index e1ab7e3d234d6b..ef5d7042163ecc 100644 --- a/recipes/cotila/all/test_package/conanfile.py +++ b/recipes/cotila/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 CotilaTestConan(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) @@ -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/cotila/all/test_v1_package/CMakeLists.txt b/recipes/cotila/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cotila/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/cotila/all/test_v1_package/conanfile.py b/recipes/cotila/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..e1ab7e3d234d6b --- /dev/null +++ b/recipes/cotila/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class CotilaTestConan(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/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml index dff9808ae31f26..7e54c58b1975d1 100644 --- a/recipes/cpp-httplib/all/conandata.yml +++ b/recipes/cpp-httplib/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "0.14.2": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.14.2.tar.gz" + sha256: "dbcf5590e8ed35c6745c2ad659a5ebec92f05187d1506eec24449d6db95e5084" + "0.14.1": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.14.1.tar.gz" + sha256: "2d4fb5544da643e5d0a82585555d8b7502b4137eb321a4abbb075e21d2f00e96" + "0.14.0": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.14.0.tar.gz" + sha256: "3a92248ef8cf2c32ad07f910b8e3052ff2427022b2adb871cf326fb620d2438e" + "0.13.3": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.13.3.tar.gz" + sha256: "2a4503f9f2015f6878baef54cd94b01849cc3ed19dfe95f2c9775655bea8b73f" "0.13.1": url: "https://github.com/yhirose/cpp-httplib/archive/v0.13.1.tar.gz" sha256: "9b837d290b61e3f0c4239da0b23bbf14c382922e2bf2a9bac21c1e3feabe1ff9" diff --git a/recipes/cpp-httplib/all/conanfile.py b/recipes/cpp-httplib/all/conanfile.py index ce51d51a2071d7..a9367f94e5c405 100644 --- a/recipes/cpp-httplib/all/conanfile.py +++ b/recipes/cpp-httplib/all/conanfile.py @@ -38,7 +38,7 @@ def requirements(self): if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.get_safe("with_brotli"): self.requires("brotli/1.0.9") diff --git a/recipes/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml index 7af780ed5d22db..190ca8b3404191 100644 --- a/recipes/cpp-httplib/config.yml +++ b/recipes/cpp-httplib/config.yml @@ -1,4 +1,12 @@ versions: + "0.14.2": + folder: all + "0.14.1": + folder: all + "0.14.0": + folder: all + "0.13.3": + folder: all "0.13.1": folder: all "0.12.6": diff --git a/recipes/cpp-ipc/all/CMakeLists.txt b/recipes/cpp-ipc/all/CMakeLists.txt deleted file mode 100644 index e17d82eddcc5dd..00000000000000 --- a/recipes/cpp-ipc/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/cpp-ipc/all/conandata.yml b/recipes/cpp-ipc/all/conandata.yml index c463e509b6004f..d1b80928e2b246 100644 --- a/recipes/cpp-ipc/all/conandata.yml +++ b/recipes/cpp-ipc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.0": + url: "https://github.com/mutouyun/cpp-ipc/archive/refs/tags/v1.3.0.tar.gz" + sha256: "a5ffb67ff451aa28726ab7801509c5c67feb737db49d2be4f7c70a4e9fad2fee" "1.2.0": url: "https://github.com/mutouyun/cpp-ipc/archive/refs/tags/v1.2.0.tar.gz" sha256: "c8df492e08b55e0722eb3e5684163709c1758f3282f05358ff78c694eadb6e60" diff --git a/recipes/cpp-ipc/all/conanfile.py b/recipes/cpp-ipc/all/conanfile.py index b11041af3f5940..5baa058938b2bf 100644 --- a/recipes/cpp-ipc/all/conanfile.py +++ b/recipes/cpp-ipc/all/conanfile.py @@ -1,17 +1,26 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +import os + +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 copy, get +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.33.0" class CppIPCConan(ConanFile): name = "cpp-ipc" description = "C++ IPC Library: A high-performance inter-process communication using shared memory on Linux/Windows." - topics = ("ipc", "shared memory", ) + license = ("MIT",) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mutouyun/cpp-ipc" - license = "MIT", + topics = ("ipc", "shared memory") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - exports_sources = ["CMakeLists.txt"] options = { "shared": [True, False], "fPIC": [True, False], @@ -21,19 +30,18 @@ class CppIPCConan(ConanFile): "fPIC": True, } - generators = "cmake" - - _compiler_required_cpp17 = { - "Visual Studio": "17", - "gcc": "8", - "clang": "4", - } - - _cmake = None + @property + def _min_cppstd(self): + return 17 @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "4", + "msvc": "193", + "Visual Studio": "17", + } def config_options(self): if self.settings.os == "Windows": @@ -41,47 +49,51 @@ 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 tools.is_apple_os(self.settings.os): - raise ConanInvalidConfiguration("{} does not support Apple platform".format(self.name)) + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.name} does not support Apple platform") if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, self._min_cppstd) - minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++{self._min_cppstd}, " + "which your compiler does not support.") else: - self.output.warn("{0} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + self.output.warning(f"{self.name} requires C++{self._min_cppstd}. Your compiler is unknown. " + f"Assuming it supports C++{self._min_cppstd}.") if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": - raise ConanInvalidConfiguration("{} doesn't support clang with libc++".format(self.name)) + raise ConanInvalidConfiguration(f"{self.name} doesn't support clang with libc++") 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["LIBIPC_BUILD_SHARED_LIBS"] = self.options.shared - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBIPC_BUILD_SHARED_LIBS"] = self.options.shared + tc.generate() def build(self): - cmake = self._configure_cmake() + 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 = ["ipc"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["rt", "pthread"] + self.cpp_info.system_libs = ["rt", "pthread", "m"] diff --git a/recipes/cpp-ipc/all/test_package/CMakeLists.txt b/recipes/cpp-ipc/all/test_package/CMakeLists.txt index c258338b9324e3..ad0594de35161f 100644 --- a/recipes/cpp-ipc/all/test_package/CMakeLists.txt +++ b/recipes/cpp-ipc/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(cpp-ipc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/cpp-ipc/all/test_package/conanfile.py b/recipes/cpp-ipc/all/test_package/conanfile.py index 49a3a66ea5bad4..fae501d0afb9e4 100644 --- a/recipes/cpp-ipc/all/test_package/conanfile.py +++ b/recipes/cpp-ipc/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" + 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/cpp-ipc/all/test_v1_package/CMakeLists.txt b/recipes/cpp-ipc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cpp-ipc/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/cpp-ipc/all/test_v1_package/conanfile.py b/recipes/cpp-ipc/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/cpp-ipc/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/cpp-ipc/config.yml b/recipes/cpp-ipc/config.yml index 797b8dd0140540..3d3b2788da655c 100644 --- a/recipes/cpp-ipc/config.yml +++ b/recipes/cpp-ipc/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.0": + folder: all "1.2.0": folder: all "1.1.1": diff --git a/recipes/cpp-jwt/all/conanfile.py b/recipes/cpp-jwt/all/conanfile.py index a9da0afcb17e47..0fc99db4a9b5af 100644 --- a/recipes/cpp-jwt/all/conanfile.py +++ b/recipes/cpp-jwt/all/conanfile.py @@ -39,8 +39,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("nlohmann_json/3.11.2") - self.requires("openssl/1.1.1s") + self.requires("nlohmann_json/3.11.3") + self.requires("openssl/[>=1.1 <4]") def package_id(self): self.info.clear() diff --git a/recipes/cpp-lazy/all/conanfile.py b/recipes/cpp-lazy/all/conanfile.py index 431ebcb132c22c..eff5d319df9908 100644 --- a/recipes/cpp-lazy/all/conanfile.py +++ b/recipes/cpp-lazy/all/conanfile.py @@ -16,8 +16,8 @@ class CpplazyConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/MarcDirven/cpp-lazy" topics = ("lazy evaluation", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True @property def _min_cppstd(self): @@ -55,5 +55,7 @@ def package(self): ) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cpp-lazy") + self.cpp_info.set_property("cmake_target_name", "cpp-lazy::cpp-lazy") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/cpp-peglib/1.x.x/conandata.yml b/recipes/cpp-peglib/1.x.x/conandata.yml index cd54a6a1b9b282..22a75880404673 100644 --- a/recipes/cpp-peglib/1.x.x/conandata.yml +++ b/recipes/cpp-peglib/1.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.5": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.5.tar.gz" + sha256: "2813f7ffdeb570959b879ce2bf3921bf4f2edc0d9f1568c4429eceadff9ab114" "1.8.4": url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.4.tar.gz" sha256: "002cec65f659180ba90c0b04ee30a349ca18f0732fbe00e7638f1ead44aeb701" diff --git a/recipes/cpp-peglib/config.yml b/recipes/cpp-peglib/config.yml index a30fecf91ce926..e7a9a93559bfa8 100644 --- a/recipes/cpp-peglib/config.yml +++ b/recipes/cpp-peglib/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.5": + folder: "1.x.x" "1.8.4": folder: "1.x.x" "1.8.3": diff --git a/recipes/cpp-sort/all/conandata.yml b/recipes/cpp-sort/all/conandata.yml index 092fe59db4a196..48e52896326749 100644 --- a/recipes/cpp-sort/all/conandata.yml +++ b/recipes/cpp-sort/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.15.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.15.0.tar.gz" + sha256: "886e813a4b87c6361e9b50c0a66c73b3b812f0ce0b7039ff3991eddce77e0dc7" "1.14.0": url: "https://github.com/Morwenn/cpp-sort/archive/1.14.0.tar.gz" sha256: "3b85cd4580f54ae3f171777d0630b4f7c89c33cf96e9ae24a1dbebbf200c3195" @@ -23,21 +26,3 @@ sources: "1.10.0": url: "https://github.com/Morwenn/cpp-sort/archive/1.10.0.tar.gz" sha256: "48951cac0051d48fee286c3bc02804975f9d83269d80c10dfc5589e76a542765" - "1.9.0": - url: "https://github.com/Morwenn/cpp-sort/archive/1.9.0.tar.gz" - sha256: "e83f3daad30bd91fed668bdb56ad379c4aeea39d7dc640484fdcc55149b6d0e4" - "1.8.1": - url: "https://github.com/Morwenn/cpp-sort/archive/1.8.1.tar.gz" - sha256: "04d518dabb422614fcb4a2b4e258c515f31dd01d51c26e9eaaec76e77c4d3d40" - "1.8.0": - sha256: a3de426a66cffbe9f8865feb7518ff4f4d1b3aadf3725161b8e118dcbf6fe9b9 - url: https://github.com/Morwenn/cpp-sort/archive/1.8.0.tar.gz - "1.7.0": - sha256: 4a8230be2c63a92395e140cb7e6593171638a41c46f4cd14d6ffc354ba830e2b - url: https://github.com/Morwenn/cpp-sort/archive/1.7.0.tar.gz - "1.6.0": - sha256: df048d15ff555030eb90d3c96f560a75bbec8baee256f2ced647f359c892c9c8 - url: https://github.com/Morwenn/cpp-sort/archive/1.6.0.tar.gz - "1.5.1": - sha256: 39925958dbd773f15d36d74d4ded48f075c05feef7fe604c7c5c4bfae2a4ec55 - url: https://github.com/Morwenn/cpp-sort/archive/1.5.1.tar.gz diff --git a/recipes/cpp-sort/all/conanfile.py b/recipes/cpp-sort/all/conanfile.py index cfda199bf6a781..e0e093c1fa1654 100644 --- a/recipes/cpp-sort/all/conanfile.py +++ b/recipes/cpp-sort/all/conanfile.py @@ -1,5 +1,3 @@ -import os.path - from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd @@ -7,6 +5,7 @@ from conan.tools.files import copy, get, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import Version +import os required_conan_version = ">=1.50.0" @@ -17,12 +16,13 @@ class CppSortConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Morwenn/cpp-sort" - topics = "cpp-sort", "sorting", "algorithms" + topics = ("sorting", "algorithms", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 14 @property @@ -43,7 +43,7 @@ def package_id(self): def validate(self): if self.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._min_cppstd) if is_msvc(self) and Version(self.version) < "1.10.0": raise ConanInvalidConfiguration(f"{self.ref} versions older than 1.10.0 do not support MSVC") @@ -60,19 +60,19 @@ def loose_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version[str(compiler)] if minimum_version and loose_lt_semver(version, minimum_version): msg = ( - f"{self.ref} requires C++{self._minimum_cpp_standard} features " + f"{self.ref} requires C++{self._min_cppstd} features " f"which are not supported by compiler {compiler} {version}." ) raise ConanInvalidConfiguration(msg) except KeyError: msg = ( f"{self.ref} recipe lacks information about the {compiler} compiler, " - f"support for the required C++{self._minimum_cpp_standard} features is assumed" + f"support for the required C++{self._min_cppstd} features is assumed" ) self.output.warn(msg) 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/cpp-sort/config.yml b/recipes/cpp-sort/config.yml index c097db627e4151..acbaa54fefe9ca 100644 --- a/recipes/cpp-sort/config.yml +++ b/recipes/cpp-sort/config.yml @@ -1,4 +1,6 @@ versions: + "1.15.0": + folder: all "1.14.0": folder: all "1.13.2": @@ -15,15 +17,3 @@ versions: folder: all "1.10.0": folder: all - "1.9.0": - folder: all - "1.8.1": - folder: all - "1.8.0": - folder: all - "1.7.0": - folder: all - "1.6.0": - folder: all - "1.5.1": - folder: all diff --git a/recipes/cpp-validator/all/conandata.yml b/recipes/cpp-validator/all/conandata.yml new file mode 100644 index 00000000000000..77d92b9be932b1 --- /dev/null +++ b/recipes/cpp-validator/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.3": + url: "https://github.com/evgeniums/cpp-validator/archive/refs/tags/v2.0.3.tar.gz" + sha256: "0afc607377518edd6adc1612962ed5d5808d96e5b40944d9ce7e91a1aa9ab1d8" diff --git a/recipes/cpp-validator/all/conanfile.py b/recipes/cpp-validator/all/conanfile.py new file mode 100644 index 00000000000000..3da277d18f9a61 --- /dev/null +++ b/recipes/cpp-validator/all/conanfile.py @@ -0,0 +1,89 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 + + +required_conan_version = ">=1.52.0" + + +class CPPValidatorConan(ConanFile): + name = "cpp-validator" + description = "C++ header-only library for generic data validation" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/evgeniums/cpp-validator" + topics = ("validator", "validation", "boost", "hana", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + # cpp-validator rquires C++17 on MSVC + # https://github.com/evgeniums/cpp-validator/blob/v2.0.3/CMakeLists.txt#L241 + return "17" if is_msvc(self) else "14" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + }.get(self._min_cppstd, {}) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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 does not support." + ) + + def requirements(self): + self.requires("boost/1.83.0") + self.requires("fmt/10.1.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + copy( + self, + pattern="*.ipp", + 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.libdirs = [] diff --git a/recipes/cpp-validator/all/test_package/CMakeLists.txt b/recipes/cpp-validator/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..aaf79983c7d603 --- /dev/null +++ b/recipes/cpp-validator/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cpp-validator REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} cpp-validator::cpp-validator) +if(MSVC) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/cpp-validator/all/test_package/conanfile.py b/recipes/cpp-validator/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/cpp-validator/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/cpp-validator/all/test_package/test_package.cpp b/recipes/cpp-validator/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..9b71de3f6c7abd --- /dev/null +++ b/recipes/cpp-validator/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include + +#include "dracosha/validator/validator.hpp" +#include "dracosha/validator/validate.hpp" +using namespace DRACOSHA_VALIDATOR_NAMESPACE; + +int main() +{ + + // define validator + auto v=validator(gt,100); // value must be greater than 100 + + // validate variables + error err; + + validate(90,v,err); + assert(err); // validation failed, 90 is less than 100 + + validate(200,v,err); + assert(!err); // validation succeeded, 200 is greater than 100 + + std::cout << "Example 1 done" << std::endl; + + return 0; +} diff --git a/recipes/cpp-validator/config.yml b/recipes/cpp-validator/config.yml new file mode 100644 index 00000000000000..7f57148a20478a --- /dev/null +++ b/recipes/cpp-validator/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.3": + folder: all diff --git a/recipes/cpp_project_framework/all/conanfile.py b/recipes/cpp_project_framework/all/conanfile.py index 5a2a5fe5679e4b..00ce6a88bd9212 100644 --- a/recipes/cpp_project_framework/all/conanfile.py +++ b/recipes/cpp_project_framework/all/conanfile.py @@ -1,24 +1,26 @@ +import os + from conan import ConanFile -from conan.tools.files import get +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 -from conans.errors import ConanInvalidConfiguration -from conans.tools import check_min_cppstd -import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class CppProjectFrameworkConan(ConanFile): name = "cpp_project_framework" + description = "C++ Project Framework is a framework for creating C++ projects." license = "AGPL-3.0" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/sheepgrass/cpp_project_framework" - url = "https://github.com/conan-io/conan-center-index" # Package recipe repository url here, for issues about the package - description = "C++ Project Framework is a framework for creating C++ project." - topics = ("cpp", "project", "framework") - settings = "os", "compiler", "build_type", "arch" + topics = ("cpp", "project", "framework", "header-only") - def package_id(self): - self.info.header_only() + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _minimum_cpp_standard(self): @@ -28,38 +30,52 @@ def _minimum_cpp_standard(self): def _minimum_compilers_version(self): return { "Visual Studio": "16", + "msvc": "192", "gcc": "7", "clang": "6", "apple-clang": "10", } + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): - if self.settings.os not in ('Linux', 'Windows'): - raise ConanInvalidConfiguration(f"{self.name} is just supported for Linux and Windows") + if self.settings.os not in ("Linux", "FreeBSD", "Windows"): + raise ConanInvalidConfiguration(f"{self.name} is only supported on Linux and Windows") compiler = self.settings.compiler if compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) - if compiler in ('gcc', 'clang'): - if compiler.get_safe("libcxx") != "libstdc++": - raise ConanInvalidConfiguration(f"only supported {compiler} with libstdc++") + if compiler in ("gcc", "clang"): + if not compiler.get_safe("libcxx", "").startswith("libstdc++"): + raise ConanInvalidConfiguration(f"{self.name} is only supported {compiler} with libstdc++") min_version = self._minimum_compilers_version.get(str(compiler)) if not min_version: - self.output.warn(f"{self.name} recipe lacks information about the {compiler} compiler support.") + self.output.warning(f"{self.name} recipe lacks information about the {compiler} compiler support.") else: if Version(compiler.version) < min_version: - raise ConanInvalidConfiguration(f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler {compiler} {compiler.version} does not support it.") - - @property - def _source_subfolder(self): - return "source_subfolder" + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._minimum_cpp_standard} support. " + f"The current compiler {compiler} {compiler.version} does not support it." + ) def source(self): - get(self, **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", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst=os.path.join("include", self.name), src=os.path.join(self._source_subfolder, self.name)) + 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", self.name), + src=os.path.join(self.source_folder, self.name)) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cpp_project_framework/all/test_package/CMakeLists.txt b/recipes/cpp_project_framework/all/test_package/CMakeLists.txt index d3c22a987a39d2..9edc8bb602af7d 100644 --- a/recipes/cpp_project_framework/all/test_package/CMakeLists.txt +++ b/recipes/cpp_project_framework/all/test_package/CMakeLists.txt @@ -1,18 +1,14 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED True) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(cpp_project_framework REQUIRED) -find_package(GTest REQUIRED) +find_package(cpp_project_framework REQUIRED CONFIG) +find_package(GTest REQUIRED CONFIG) add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE cpp_project_framework::cpp_project_framework GTest::gtest GTest::gtest_main) if(UNIX) - target_link_libraries(test_package cpp_project_framework::cpp_project_framework GTest::gtest GTest::gtest_main stdc++fs) -else() - target_link_libraries(test_package cpp_project_framework::cpp_project_framework GTest::gtest GTest::gtest_main) + target_link_libraries(test_package PRIVATE stdc++fs) endif() diff --git a/recipes/cpp_project_framework/all/test_package/conanfile.py b/recipes/cpp_project_framework/all/test_package/conanfile.py index ed8a4e73713c64..c31dc0dd89d148 100644 --- a/recipes/cpp_project_framework/all/test_package/conanfile.py +++ b/recipes/cpp_project_framework/all/test_package/conanfile.py @@ -1,13 +1,20 @@ from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -class CppProjectFrameworkTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - requires = "gtest/1.10.0" +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) + self.requires("gtest/1.13.0") + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -15,6 +22,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/cpp_project_framework/all/test_v1_package/CMakeLists.txt b/recipes/cpp_project_framework/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cpp_project_framework/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/cpp_project_framework/all/test_v1_package/conanfile.py b/recipes/cpp_project_framework/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..0761aa549fc918 --- /dev/null +++ b/recipes/cpp_project_framework/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +import os + + +class CppProjectFrameworkTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + requires = "gtest/1.13.0" + + 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/cppbenchmark/all/conandata.yml b/recipes/cppbenchmark/all/conandata.yml index 2873a6dc352ca5..798d4ebbff0a7b 100644 --- a/recipes/cppbenchmark/all/conandata.yml +++ b/recipes/cppbenchmark/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.4.0": + url: "https://github.com/chronoxor/CppBenchmark/archive/1.0.4.0.tar.gz" + sha256: "44fec3d4264b6654999dfa0f6ceb8a7aeef4eca32db0d229fba70819e11cede0" "1.0.3.0": url: "https://github.com/chronoxor/CppBenchmark/archive/1.0.3.0.tar.gz" sha256: "6a62cfdb2aacf91523f74c6d0e42a3e2388ff94a2b7b983bec543c88554cc3e9" @@ -9,6 +12,10 @@ sources: url: "https://github.com/chronoxor/CppBenchmark/archive/8605a8e886647e964180cb7a622424404a1da01f.tar.gz" sha256: "f0b88802b4418b13c04ae4dfdb859b2cb81142a47ca473ad447a8be087e0adee" patches: + "1.0.4.0": + - patch_file: "patches/1.0.3.0-0001-fix-cmake.patch" + patch_description: "fix install path, use cci packages, disable tests" + patch_type: "conan" "1.0.3.0": - patch_file: "patches/1.0.3.0-0001-fix-cmake.patch" patch_description: "fix install path, use cci packages, disable tests" diff --git a/recipes/cppbenchmark/config.yml b/recipes/cppbenchmark/config.yml index d05d94032be0f0..6a65865cd6cb1d 100644 --- a/recipes/cppbenchmark/config.yml +++ b/recipes/cppbenchmark/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.4.0": + folder: all "1.0.3.0": folder: all "1.0.0.0": diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index 35bee8612638ba..309e9e9115ce02 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -1,35 +1,32 @@ sources: + "2.12.1": + url: "https://github.com/danmar/cppcheck/archive/2.12.1.tar.gz" + sha256: "2a3d4ba1179419612183ab3d6aed6d3b18be75e98cd6f138ea8e2020905dced2" + "2.12": + url: "https://github.com/danmar/cppcheck/archive/2.12.0.tar.gz" + sha256: "7d67776118aee9a4f0214f993a4baa4a168b2dbb10c14b6ec5baf2ca147565b8" "2.11.1": url: "https://github.com/danmar/cppcheck/archive/2.11.1.tar.gz" sha256: "fef6ef868d562d49136f158e1d0f7a38237e7e1c0a91d9189bdd465f1fe54316" "2.10.3": url: "https://github.com/danmar/cppcheck/archive/2.10.3.tar.gz" sha256: "8aae5e116daeaaf5d19f3efa61b91c06f161cb97412a1d1af6e1e20686e48967" - "2.10": - url: "https://github.com/danmar/cppcheck/archive/2.10.tar.gz" - sha256: "785dcbf711048dfe43ae920b6eff2eeebb4a096e88188a40e173ca4c030f57c3" "2.9.3": url: "https://github.com/danmar/cppcheck/archive/2.9.3.tar.gz" sha256: "46319ca73e33e4b2bd91981a76a0d4f184cd3f86b62dc18e8938eabacd3ad2e3" - "2.9.2": - url: "https://github.com/danmar/cppcheck/archive/2.9.2.tar.gz" - sha256: "93920d24d4442856bf7916ee0e3fc31308bc23948e7029b4fd332e01cac63c3e" "2.8.2": url: "https://github.com/danmar/cppcheck/archive/2.8.2.tar.gz" sha256: "30ba99ab54089c44b83f02e2453da046a7edff5237950d4A0eb1eba4afcb4f45" patches: - "2.11.1": - - patch_file: "patches/0003-pcre-debuglib-name.patch" + "2.12": + - patch_file: "patches/0004-pcre-debuglib-name-2.12.patch" patch_description: "Consider the Debug suffix for Windows" patch_type: "portability" - "2.10.3": - - patch_file: "patches/0001-cli-remove-dmake-cmake-2.10.patch" - patch_description: "Remove dmake tool from target ALL" - patch_type: "portability" + "2.11.1": - patch_file: "patches/0003-pcre-debuglib-name.patch" patch_description: "Consider the Debug suffix for Windows" patch_type: "portability" - "2.10": + "2.10.3": - patch_file: "patches/0001-cli-remove-dmake-cmake-2.10.patch" patch_description: "Remove dmake tool from target ALL" patch_type: "portability" @@ -46,16 +43,6 @@ patches: - patch_file: "patches/0003-pcre-debuglib-name.patch" patch_description: "Consider the Debug suffix for Windows" patch_type: "portability" - "2.9.2": - - patch_file: "patches/0001-cli-remove-dmake-cmake.patch" - patch_description: "Remove dmake tool from target ALL" - patch_type: "portability" - - patch_file: "patches/0002-htmlreport-python3.patch" - patch_description: "Use Python 3 in Shebang Header" - patch_type: "portability" - - patch_file: "patches/0003-pcre-debuglib-name.patch" - patch_description: "Consider the Debug suffix for Windows" - patch_type: "portability" "2.8.2": - patch_file: "patches/0001-cli-remove-dmake-cmake-2.8.patch" patch_description: "Remove dmake tool from target ALL" diff --git a/recipes/cppcheck/all/patches/0004-pcre-debuglib-name-2.12.patch b/recipes/cppcheck/all/patches/0004-pcre-debuglib-name-2.12.patch new file mode 100644 index 00000000000000..7f30a7cb1d7d43 --- /dev/null +++ b/recipes/cppcheck/all/patches/0004-pcre-debuglib-name-2.12.patch @@ -0,0 +1,11 @@ +--- a/cmake/findDependencies.cmake 2023-09-09 15:10:31.000000000 +0200 ++++ b/cmake/findDependencies.cmake 2023-09-11 08:44:40.220863900 +0200 +@@ -31,7 +31,7 @@ + + if (HAVE_RULES) + find_path(PCRE_INCLUDE pcre.h) +- find_library(PCRE_LIBRARY pcre) ++ find_library(PCRE_LIBRARY NAMES pcre pcred) + if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) + message(FATAL_ERROR "pcre dependency for RULES has not been found") + endif() diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml index 6325a54f72873f..0fb8b3e88183bc 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -1,13 +1,13 @@ versions: + "2.12.1": + folder: all + "2.12": + folder: all "2.11.1": folder: all "2.10.3": folder: all - "2.10": - folder: all "2.9.3": folder: all - "2.9.2": - folder: all "2.8.2": folder: all diff --git a/recipes/cppcodec/all/conanfile.py b/recipes/cppcodec/all/conanfile.py index 59f96dbe4a59f6..abb2abaee1872b 100644 --- a/recipes/cppcodec/all/conanfile.py +++ b/recipes/cppcodec/all/conanfile.py @@ -17,6 +17,7 @@ class CppcodecConan(ConanFile): "base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32" ) topics = ("base64", "cpp11", "codec", "base32") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -31,8 +32,7 @@ def validate(self): check_min_cppstd(self, 11) 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 @@ -45,4 +45,3 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", "cppcodec-1") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/cppcommon/all/conandata.yml b/recipes/cppcommon/all/conandata.yml index c2897878ad2bc7..0a74dfd6a553f8 100644 --- a/recipes/cppcommon/all/conandata.yml +++ b/recipes/cppcommon/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.4.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.4.0.tar.gz" + sha256: "724865a64309ab24b3e10d29b04dfec821003013635eff84dd2108f98e7a6fc3" "1.0.3.0": url: "https://github.com/chronoxor/CppCommon/archive/1.0.3.0.tar.gz" sha256: "af530d3550a050d4ed73a680b016e043ea6f4f56e11163226f2a6e24d9eae4ca" @@ -15,6 +18,13 @@ sources: url: "https://github.com/chronoxor/CppCommon/archive/cacfa9554d367467808663d9d5a695933ae566bb.tar.gz" sha256: "d2e717798e1668c831ee977763eaff7413ef48e6e0914a6322c9918016092048" patches: + "1.0.4.0": + - patch_file: "patches/0001-update-cmakelists-1-0-4-0.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0003-define-win32-winnt-1-0-4-0.patch" + patch_description: "define _WIN32_WINNT" + patch_type: "portability" "1.0.3.0": - patch_file: "patches/0001-update-cmakelists-1-0-3-0.patch" patch_description: "use cci packages" diff --git a/recipes/cppcommon/all/conanfile.py b/recipes/cppcommon/all/conanfile.py index c289f88e777b01..9e2726f3581c59 100644 --- a/recipes/cppcommon/all/conanfile.py +++ b/recipes/cppcommon/all/conanfile.py @@ -62,12 +62,12 @@ def requirements(self): if Version(self.version) < "1.0.3" or self.version == "cci.20201104": self.requires("fmt/8.1.1") else: - self.requires("fmt/10.0.0") + self.requires("fmt/10.1.0", transitive_headers=True) if self.settings.os == "Linux": - self.requires("libuuid/1.0.3") + self.requires("util-linux-libuuid/2.39") def validate(self): - if self.settings.compiler.cppstd: + 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: diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-4-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-4-0.patch new file mode 100644 index 00000000000000..0d4c06013abe8a --- /dev/null +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-4-0.patch @@ -0,0 +1,108 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index daa796b..c76bfef 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,30 +18,31 @@ if(DOXYGEN_FOUND) + endif() + + # CMake module path +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") ++#set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + + # Compiler features +-include(SetCompilerFeatures) +-include(SetCompilerWarnings) +-include(SetPlatformFeatures) +-include(SystemInformation) ++#include(SetCompilerFeatures) ++#include(SetCompilerWarnings) ++#include(SetPlatformFeatures) ++#include(SystemInformation) + + # External packages + find_package(Threads REQUIRED) ++find_package(fmt REQUIRED) + if(UNIX AND NOT APPLE AND NOT MSYS) + find_package(LibBFD) + find_package(LibDL) + find_package(LibRT) +- find_package(LibUUID) ++ find_package(libuuid) + endif() + if(WIN32 OR MSYS) + find_package(DbgHelp) + find_package(RPC) +- find_package(Userenv) ++# find_package(Userenv) + endif() + + # Modules +-add_subdirectory("modules") ++#add_subdirectory("modules") + + # Link libraries + list(APPEND LINKLIBS Threads::Threads) +@@ -49,17 +50,18 @@ if(UNIX AND NOT APPLE AND NOT MSYS) + list(APPEND LINKLIBS ${LIBBFD_LIBRARIES}) + list(APPEND LINKLIBS ${LIBDL_LIBRARIES}) + list(APPEND LINKLIBS ${LIBRT_LIBRARIES}) +- list(APPEND LINKLIBS ${LIBUUID_LIBRARIES}) ++ list(APPEND LINKLIBS libuuid::libuuid) + endif() + if(WIN32 OR MSYS) + list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) + list(APPEND LINKLIBS ${RPC_LIBRARIES}) +- list(APPEND LINKLIBS ${USERENV_LIBRARIES}) ++ list(APPEND LINKLIBS userenv) ++ list(APPEND LINKLIBS rpcrt4) + list(APPEND LINKLIBS ${VLD_LIBRARIES}) + endif() + + # System directories +-include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") ++#include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") + include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") + + # Library +@@ -68,8 +70,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") + file(GLOB_RECURSE LIB_SOURCE_FILES "include/*.cpp" "source/*.cpp") + add_library(cppcommon ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) + set_target_properties(cppcommon PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") +-target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" PUBLIC ${vld}) +-target_link_libraries(cppcommon ${LINKLIBS} fmt) ++target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") ++target_compile_features(cppcommon PUBLIC cxx_std_17) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) + list(APPEND INSTALL_TARGETS cppcommon) + list(APPEND LINKLIBS cppcommon) + +@@ -91,6 +94,7 @@ if(NOT CPPCOMMON_MODULE) + list(APPEND INSTALL_TARGETS_PDB ${PLUGIN_TARGET}) + endforeach() + ++ if (0) + # Examples + file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") + file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") +@@ -136,15 +140,16 @@ if(NOT CPPCOMMON_MODULE) + # CTest + enable_testing() + add_test(cppcommon-tests cppcommon-tests --durations yes --order lex) ++ endif() + + # Install + install(TARGETS ${INSTALL_TARGETS} +- RUNTIME DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/bin" +- ARCHIVE DESTINATION "${PROJECT_SOURCE_DIR}/bin") +- ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ + # Install *.pdb files +- if(MSVC) ++ if(FALSE) + foreach(INSTALL_TARGET_PDB ${INSTALL_TARGETS_PDB}) + install(FILES $ DESTINATION "${PROJECT_SOURCE_DIR}/bin") + endforeach() diff --git a/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-4-0.patch b/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-4-0.patch new file mode 100644 index 00000000000000..076bc12bf2beb6 --- /dev/null +++ b/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-4-0.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c76bfef..f57f05b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -75,6 +75,9 @@ target_compile_features(cppcommon PUBLIC cxx_std_17) + target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) + list(APPEND INSTALL_TARGETS cppcommon) + list(APPEND LINKLIBS cppcommon) ++if(WIN32 AND NOT MSVC) ++ target_compile_definitions(cppcommon PUBLIC -D_WIN32_WINNT=_WIN32_WINNT_VISTA) ++endif() + + # Additional module components: benchmarks, examples, plugins, tests, tools and install + if(NOT CPPCOMMON_MODULE) diff --git a/recipes/cppcommon/config.yml b/recipes/cppcommon/config.yml index ee34523110204d..dfd13b4693a862 100644 --- a/recipes/cppcommon/config.yml +++ b/recipes/cppcommon/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.4.0": + folder: all "1.0.3.0": folder: all "1.0.2.0": diff --git a/recipes/cppfront/all/conandata.yml b/recipes/cppfront/all/conandata.yml index 3db3937d63c0d5..4a9575e4249b63 100644 --- a/recipes/cppfront/all/conandata.yml +++ b/recipes/cppfront/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231017": + url: "https://github.com/hsutter/cppfront/archive/789cd382ed4c2fb1a9e306e73b6876228d22207d.tar.gz" + sha256: "a004c27bbc732f7a60735cee45aa89f066b79266ccc2c881f4723afee2ad1d8d" "cci.20230103": url: "https://github.com/hsutter/cppfront/archive/808db2bd6ae92f869166827dfda66cfa42dde0ab.zip" sha256: "479252c99d66db477c4cd98a6e1707a8929a70afdf000c75589841d944c539f4" diff --git a/recipes/cppfront/config.yml b/recipes/cppfront/config.yml index 50c5629b6e0252..5474e123fd52d5 100644 --- a/recipes/cppfront/config.yml +++ b/recipes/cppfront/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20231017": + folder: all "cci.20230103": folder: all "cci.20221024": diff --git a/recipes/cppitertools/all/conandata.yml b/recipes/cppitertools/all/conandata.yml index b8a68ed038695c..03371485048710 100644 --- a/recipes/cppitertools/all/conandata.yml +++ b/recipes/cppitertools/all/conandata.yml @@ -1,4 +1,4 @@ sources: "2.1": - url: https://github.com/ryanhaining/cppitertools/archive/v2.1.tar.gz - sha256: f7bcd4531e37083609bb92c3f0ae03b56e7197002d0dc9c695104dcef445f2ab + url: "https://github.com/ryanhaining/cppitertools/archive/v2.1.tar.gz" + sha256: "f7bcd4531e37083609bb92c3f0ae03b56e7197002d0dc9c695104dcef445f2ab" diff --git a/recipes/cppitertools/all/conanfile.py b/recipes/cppitertools/all/conanfile.py index 15118a8925b22e..d59270a8f393ac 100644 --- a/recipes/cppitertools/all/conanfile.py +++ b/recipes/cppitertools/all/conanfile.py @@ -1,69 +1,75 @@ import os from conan import ConanFile from conan.tools.build import check_min_cppstd -from conan.tools.files import get, copy, rename +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 -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class CppItertoolsConan(ConanFile): name = "cppitertools" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/ryanhaining/cppitertools" description = "Implementation of python itertools and builtin iteration functions for C++17" - topics = ("cpp17", "iter", "itertools") license = "BSD-2-Clause" - no_copy_source = True - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ryanhaining/cppitertools" + topics = ("cpp17", "iter", "itertools", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - options = {'zip_longest': [True, False]} - default_options = {'zip_longest': False} + options = { + 'zip_longest': [True, False], + } + default_options = { + 'zip_longest': False, + } + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - def source(self): - get(self, **self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - rename(self, extracted_dir, self._source_subfolder) - - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 17) + def _min_cppstd(self): + return 17 - minimal_version = { + @property + def _compilers_minimum_version(self): + return { "Visual Studio": "15", "msvc": "191", "gcc": "7", "clang": "5.0", "apple-clang": "9.1" } - compiler = str(self.settings.compiler) - compiler_version = Version(self.settings.compiler.version) - - if compiler not in minimal_version: - self.output.info("{} requires a compiler that supports at least C++17".format(self.name)) - return - # Exclude compilers not supported by cppitertools - if compiler_version < minimal_version[compiler]: - raise ConanInvalidConfiguration("{} requires a compiler that supports at least C++17. {} {} is not".format( - self.name, compiler, Version(self.settings.compiler.version.value))) + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.zip_longest: - self.requires('boost/1.75.0') + self.requires('boost/1.83.0') + + def package_id(self): + self.info.clear() + + 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 does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - copy(self, "*.hpp", src=os.path.join(self.source_folder, self._source_subfolder), dst=os.path.join(self.package_folder,"include", "cppitertools"), excludes=('examples/**', 'test/**')) - copy(self, "LICENSE.md", src=os.path.join(self.source_folder, self._source_subfolder), dst=os.path.join(self.package_folder,"licenses")) + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "cppitertools"), excludes=('examples/**', 'test/**')) + def package_info(self): - self.cpp_info.set_property("cmake_file_name", "cppitertools") - self.cpp_info.set_property("cmake_target_name", "cppitertools::cppitertools") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - def package_id(self): - self.info.clear() + + self.cpp_info.set_property("cmake_file_name", "cppitertools") + self.cpp_info.set_property("cmake_target_name", "cppitertools::cppitertools") + diff --git a/recipes/cppitertools/all/test_package/CMakeLists.txt b/recipes/cppitertools/all/test_package/CMakeLists.txt index 39161129005c36..18b263b57ca6f8 100644 --- a/recipes/cppitertools/all/test_package/CMakeLists.txt +++ b/recipes/cppitertools/all/test_package/CMakeLists.txt @@ -1,14 +1,14 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(cppitertools REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} cppitertools::cppitertools) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE cppitertools::cppitertools) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) if(ZIP_LONGEST) add_executable(test_zip_longest test_zip_longest.cpp) - target_link_libraries(test_zip_longest cppitertools::cppitertools) - set_property(TARGET test_zip_longest PROPERTY CXX_STANDARD 17) + target_link_libraries(test_zip_longest PRIVATE cppitertools::cppitertools) + target_compile_features(test_zip_longest PRIVATE cxx_std_17) endif() diff --git a/recipes/cppitertools/all/test_package/conanfile.py b/recipes/cppitertools/all/test_package/conanfile.py index 758d48b5853bac..fac50abb3d577a 100644 --- a/recipes/cppitertools/all/test_package/conanfile.py +++ b/recipes/cppitertools/all/test_package/conanfile.py @@ -7,6 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/cpprestsdk/all/conandata.yml b/recipes/cpprestsdk/all/conandata.yml index 5216074c76f9db..632826ffef0408 100644 --- a/recipes/cpprestsdk/all/conandata.yml +++ b/recipes/cpprestsdk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.10.19": + url: "https://github.com/microsoft/cpprestsdk/archive/refs/tags/v2.10.19.tar.gz" + sha256: "4b0d14e5bfe77ce419affd253366e861968ae6ef2c35ae293727c1415bd145c8" "2.10.18": url: "https://github.com/Microsoft/cpprestsdk/archive/2.10.18.tar.gz" sha256: "6bd74a637ff182144b6a4271227ea8b6b3ea92389f88b25b215e6f94fd4d41cb" @@ -12,6 +15,13 @@ sources: url: "https://github.com/Microsoft/cpprestsdk/archive/v2.10.15.tar.gz" sha256: "1c027a53457e87b0b3a475e5c8045b94400c475898c8bd51b0fbd218b99a7f7b" patches: + "2.10.19": + - patch_file: "patches/0003-find-cmake-targets.patch" + patch_type: "conan" + patch_description: "CMake: internal targets" + - patch_file: "patches/0002-remove-wconversion.patch" + patch_type: "conan" + patch_description: "fix warnings" "2.10.18": - patch_file: "patches/0003-find-cmake-targets.patch" patch_type: "conan" diff --git a/recipes/cpprestsdk/all/conanfile.py b/recipes/cpprestsdk/all/conanfile.py index 9f8dbc8d6fec8b..c75c41fcad7c4f 100644 --- a/recipes/cpprestsdk/all/conanfile.py +++ b/recipes/cpprestsdk/all/conanfile.py @@ -57,10 +57,10 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") self.requires("openssl/[>=1.1 <4]") if self.options.with_compression: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_websockets: self.requires("websocketpp/0.8.2") diff --git a/recipes/cpprestsdk/config.yml b/recipes/cpprestsdk/config.yml index d4be51c9a70c33..00ffc5b18bc362 100644 --- a/recipes/cpprestsdk/config.yml +++ b/recipes/cpprestsdk/config.yml @@ -1,4 +1,6 @@ versions: + "2.10.19": + folder: "all" "2.10.18": folder: "all" "2.10.17": diff --git a/recipes/cpptrace/all/conandata.yml b/recipes/cpptrace/all/conandata.yml new file mode 100644 index 00000000000000..d032d0a5a873d9 --- /dev/null +++ b/recipes/cpptrace/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + # Newer versions at the top + "0.3.1": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.3.1.tar.gz" + sha256: "3c4c5b3406c2b598e5cd2a8cb97f9e8e1f54d6df087a0e62564e6fb68fed852d" + "0.3.0": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.3.0.tar.gz" + sha256: "1650d760ff0c0f9763de7e1e04285033f2b0189df87398ba8bf76e9937d5a4ee" + "0.2.1": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.2.1.tar.gz" + sha256: "3184f404c61b6b8ba6fe7c64fc40d1c3d6d87df59bcacf1845d846101bc22f9a" +patches: + "0.3.0": + - patch_file: "patches/0.3.0/0001-cpptrace_export.patch" + patch_type: "bugfix" + patch_source: "https://github.com/jeremy-rifkin/cpptrace/commit/b3b9d5fda6c7f53b069848e7e79454f3618ca356" + patch_description: "Fix an incorrect CPPTRACE_EXPORT annotation" + "0.2.1": + - patch_file: "patches/0.2.1/0001-to_uintptr.patch" + patch_type: "bugfix" + patch_source: "https://github.com/jeremy-rifkin/cpptrace/commit/bda3e2b169796f2e9c7e751b27306aac6b4a7c26" + patch_description: "Fix for to_uintptr" + - patch_file: "patches/0.2.1/0002-conan-libdwarf.patch" + patch_type: "conan" + patch_description: "Tweaks to use libdwarf provided by conan" diff --git a/recipes/cpptrace/all/conanfile.py b/recipes/cpptrace/all/conanfile.py new file mode 100644 index 00000000000000..f96b276006f6d1 --- /dev/null +++ b/recipes/cpptrace/all/conanfile.py @@ -0,0 +1,112 @@ +from conan import ConanFile +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.files import get, copy, rm, rmdir +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, export_conandata_patches +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class CpptraceConan(ConanFile): + name = "cpptrace" + description = "Simple, portable, and self-contained stacktrace library for C++11 and newer " + license = ("MIT", "LGPL-2.1-only", "BSD-2-Clause-Views") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jeremy-rifkin/cpptrace" + topics = ("stacktrace", "backtrace", "stack-trace", "back-trace", "trace", "utilities", "error-handling") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 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("libdwarf/0.8.0") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + if Version(self.version) >= Version("0.3.0"): + tc.variables["CPPTRACE_USE_EXTERNAL_LIBDWARF"] = True + tc.variables["CPPTRACE_CONAN"] = True + else: + if not self.options.shared: + tc.variables["CPPTRACE_STATIC"] = True + tc.variables["CPPTRACE_USE_SYSTEM_LIBDWARF"] = True + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), 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")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + 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 = ["cpptrace"] + + self.cpp_info.set_property("cmake_module_file_name", "cpptrace") + self.cpp_info.set_property("cmake_module_target_name", "cpptrace") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("dl") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("dbghelp") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "CPPTRACE" + self.cpp_info.filenames["cmake_find_package_multi"] = "cpptrace" + self.cpp_info.names["cmake_find_package"] = "CPPTRACE" + self.cpp_info.names["cmake_find_package_multi"] = "cpptrace" diff --git a/recipes/cpptrace/all/patches/0.2.1/0001-to_uintptr.patch b/recipes/cpptrace/all/patches/0.2.1/0001-to_uintptr.patch new file mode 100644 index 00000000000000..5268df0edea762 --- /dev/null +++ b/recipes/cpptrace/all/patches/0.2.1/0001-to_uintptr.patch @@ -0,0 +1,13 @@ +diff --git src/platform/utils.hpp src/platform/utils.hpp +index 51395fe..7853960 100644 +--- src/platform/utils.hpp ++++ src/platform/utils.hpp +@@ -334,7 +334,7 @@ namespace detail { + return static_cast(t); + } + template +- unsigned long long to_uintptr(T t) { ++ uintptr_t to_uintptr(T t) { + return static_cast(t); + } + diff --git a/recipes/cpptrace/all/patches/0.2.1/0002-conan-libdwarf.patch b/recipes/cpptrace/all/patches/0.2.1/0002-conan-libdwarf.patch new file mode 100644 index 00000000000000..70f3a48f3de5a7 --- /dev/null +++ b/recipes/cpptrace/all/patches/0.2.1/0002-conan-libdwarf.patch @@ -0,0 +1,62 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ce5dbcf..085a1aa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -218,7 +218,6 @@ + add_library(cpptrace STATIC ${sources} include/cpptrace/cpptrace.hpp) + else() + add_library(cpptrace SHARED ${sources} include/cpptrace/cpptrace.hpp) +- set_property(TARGET cpptrace PROPERTY POSITION_INDEPENDENT_CODE ON) + endif() + + target_include_directories( +@@ -298,7 +298,7 @@ + target_compile_definitions(cpptrace PUBLIC CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF) + if(CPPTRACE_USE_SYSTEM_LIBDWARF) + find_package(libdwarf REQUIRED) +- target_link_libraries(cpptrace PRIVATE libdwarf) ++ target_link_libraries(cpptrace PRIVATE libdwarf::libdwarf) + else() + add_subdirectory(bundled/libdwarf) + target_link_libraries(cpptrace PRIVATE dwarf) +@@ -379,7 +379,7 @@ + include(CMakePackageConfigHelpers) + + if(CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF) +- set(CPPTRACE_STATIC_EXPORT_TARGETS cpptrace dwarf) ++ set(CPPTRACE_STATIC_EXPORT_TARGETS cpptrace) + else() + set(CPPTRACE_STATIC_EXPORT_TARGETS cpptrace) + endif() + +diff --git a/src/symbols/symbols_with_libdwarf.cpp b/src/symbols/symbols_with_libdwarf.cpp +index ce5dbcf..085a1aa 100644 +--- a/src/symbols/symbols_with_libdwarf.cpp ++++ b/src/symbols/symbols_with_libdwarf.cpp +@@ -20,8 +20,8 @@ + #include + #include + +-#include +-#include ++#include ++#include + + // It's been tricky to piece together how to handle all this dwarf stuff. Some resources I've used are + // https://www.prevanders.net/libdwarf.pdf + +diff --git a/src/platform/dwarf.hpp b/src/platform/dwarf.hpp +index ce5dbcf..085a1aa 100644 +--- a/src/platform/dwarf.hpp ++++ b/src/platform/dwarf.hpp +@@ -9,8 +9,8 @@ + #include + #include + +-#include +-#include ++#include ++#include + + namespace cpptrace { + namespace detail { diff --git a/recipes/cpptrace/all/patches/0.3.0/0001-cpptrace_export.patch b/recipes/cpptrace/all/patches/0.3.0/0001-cpptrace_export.patch new file mode 100644 index 00000000000000..d75b21cd35c7f0 --- /dev/null +++ b/recipes/cpptrace/all/patches/0.3.0/0001-cpptrace_export.patch @@ -0,0 +1,13 @@ +diff --git a/include/cpptrace/cpptrace.hpp b/include/cpptrace/cpptrace.hpp +index b35bed1..27b626b 100644 +--- a/include/cpptrace/cpptrace.hpp ++++ b/include/cpptrace/cpptrace.hpp +@@ -90,7 +90,7 @@ namespace cpptrace { + // This is used over std::optional because the library is C++11 and also std::optional is a bit heavy-duty for this + // use. + template::value, int>::type = 0> +- struct CPPTRACE_EXPORT nullable { ++ struct nullable { + T raw_value; + nullable& operator=(T value) { + raw_value = value; diff --git a/recipes/cpptrace/all/test_package/CMakeLists.txt b/recipes/cpptrace/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..413751877cee83 --- /dev/null +++ b/recipes/cpptrace/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(cpptrace REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE cpptrace::cpptrace) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpptrace/all/test_package/conanfile.py b/recipes/cpptrace/all/test_package/conanfile.py new file mode 100644 index 00000000000000..1e7a9ff877d531 --- /dev/null +++ b/recipes/cpptrace/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 + +# It will become the standard on Conan 2.x +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/cpptrace/all/test_package/test_package.cpp b/recipes/cpptrace/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..bc640e59ffc246 --- /dev/null +++ b/recipes/cpptrace/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + +int main() { + cpptrace::generate_trace().print(); + + return EXIT_SUCCESS; +} diff --git a/recipes/cpptrace/config.yml b/recipes/cpptrace/config.yml new file mode 100644 index 00000000000000..c4a25b816da1e7 --- /dev/null +++ b/recipes/cpptrace/config.yml @@ -0,0 +1,8 @@ +versions: + # Newer versions at the top + "0.3.1": + folder: all + "0.3.0": + folder: all + "0.2.1": + folder: all diff --git a/recipes/cppzmq/all/conanfile.py b/recipes/cppzmq/all/conanfile.py index 44e3718dd5de34..5a976b586d2ffb 100644 --- a/recipes/cppzmq/all/conanfile.py +++ b/recipes/cppzmq/all/conanfile.py @@ -12,25 +12,23 @@ class CppZmqConan(ConanFile): description = "C++ binding for 0MQ" homepage = "https://github.com/zeromq/cppzmq" license = "MIT" - topics = ("cppzmq", "zmq-cpp", "zmq", "cpp-bind") + topics = ("zmq-cpp", "zmq", "cpp-bind") url = "https://github.com/conan-io/conan-center-index" - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("zeromq/4.3.4", transitive_headers=True, transitive_libs=True) + self.requires("zeromq/4.3.5") 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 diff --git a/recipes/cpr/all/conandata.yml b/recipes/cpr/all/conandata.yml index 21c7cc656ba73b..02059bab669a97 100644 --- a/recipes/cpr/all/conandata.yml +++ b/recipes/cpr/all/conandata.yml @@ -1,44 +1,25 @@ 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.3.tar.gz" - sha256: "7b9d3504ffdaf7ce3189f1b91d135888776b6a1b26ea1bf2c3c4986b8a5af06f" - "1.10.1": - url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.1.tar.gz" - sha256: "dc22ab9d34e6013e024e2c4a64e665b126573c0f125f0e02e6a7291cb7e04c4b" - "1.10.0": - url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.0.tar.gz" - sha256: "d669c028bd63a1c8827c32b348ecc85e46747bb33be3b00ce59b77717b91aee8" + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.4.tar.gz" + sha256: "88462d059cd3df22c4d39ae04483ed50dfd2c808b3effddb65ac3b9aa60b542d" "1.9.3": url: "https://github.com/libcpr/cpr/archive/refs/tags/1.9.3.tar.gz" sha256: "df53e7213d80fdc24583528521f7d3349099f5bb4ed05ab05206091a678cc53c" - "1.9.0": - url: "https://github.com/libcpr/cpr/archive/refs/tags/1.9.0.tar.gz" - sha256: "67023cde8979e8371f5ee7d6e586d6d0761af4a3a3a3be6270256353c9bf411f" "1.8.1": url: "https://github.com/libcpr/cpr/archive/refs/tags/1.8.1.tar.gz" sha256: "9155ec36fcafe8cf8d61c98cde8dc6bd27c146740002069bf990855eecb2b95f" "1.7.2": url: "https://github.com/libcpr/cpr/archive/refs/tags/1.7.2.tar.gz" sha256: "aa38a414fe2ffc49af13a08b6ab34df825fdd2e7a1213d032d835a779e14176f" - "1.6.2": - url: "https://github.com/libcpr/cpr/archive/1.6.2.tar.gz" - sha256: "c45f9c55797380c6ba44060f0c73713fbd7989eeb1147aedb8723aa14f3afaa3" - "1.5.2": - url: "https://github.com/libcpr/cpr/archive/1.5.2.tar.gz" - sha256: "6fc9102dd63b549912d7af1ec95ee41ece1a2fe27f759864306b07f6fcf24fe1" - "1.4.0": - url: "https://github.com/libcpr/cpr/archive/1.4.0.tar.gz" - sha256: "13baffba95445e02291684e31906b04df41d8c6a3020a1a55253047c6756a004" patches: - "1.10.4": + "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.1": - - 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.0": + "1.10.4": - patch_file: "patches/008-1.10.0-remove-warning-flags.patch" patch_description: "disable warning flags and warning as error" patch_type: "portability" @@ -49,13 +30,6 @@ patches: - patch_file: "patches/008-1.9.3-remove-warning-flags.patch" patch_description: "disable warning flags and warning as error" patch_type: "portability" - "1.9.0": - - patch_file: "patches/005-1.9.0-fix-curl-components.patch" - patch_description: "use cci package" - patch_type: "conan" - - patch_file: "patches/008-1.8.1-remove-warning-flags.patch" - patch_description: "disable warning flags and warning as error" - patch_type: "portability" "1.8.1": - patch_file: "patches/005-1.8.1-fix-curl-components.patch" patch_description: "use cci package" @@ -76,21 +50,3 @@ patches: - patch_file: "patches/008-1.7.2-remove-warning-flags.patch" patch_description: "disable warning flags and warning as error" patch_type: "portability" - "1.6.2": - - patch_file: "patches/005-1.6.2-fix-curl-components.patch" - patch_description: "use cci package" - patch_type: "conan" - "1.5.2": - - patch_file: "patches/005-1.5.2-fix-curl-components.patch" - patch_description: "use cci package" - patch_type: "conan" - "1.4.0": - - patch_file: "patches/002-1.4.0-create-install.patch" - patch_description: "add install definition" - patch_type: "conan" - - patch_file: "patches/003-1.4.0-curl-use-target.patch" - patch_description: "link curl library as target name" - patch_type: "portability" - - patch_file: "patches/004-1.4.0-curl-global-scope.patch" - patch_description: "use cci package" - patch_type: "conan" diff --git a/recipes/cpr/all/conanfile.py b/recipes/cpr/all/conanfile.py index 811d7ddeeebd74..b2e254935a1fd3 100644 --- a/recipes/cpr/all/conanfile.py +++ b/recipes/cpr/all/conanfile.py @@ -55,43 +55,11 @@ def _compilers_minimum_version(self): }, }.get(self._min_cppstd, {}) - @property - def _supports_openssl(self): - # https://github.com/libcpr/cpr/commit/b036a3279ba62720d1e43362d32202bf412ea152 - # https://github.com/libcpr/cpr/releases/tag/1.5.0 - return Version(self.version) >= "1.5.0" and not is_apple_os(self) - - @property - def _supports_winssl(self): - # https://github.com/libcpr/cpr/commit/18e1fc5c3fc0ffc07695f1d78897fb69e7474ea9 - # https://github.com/libcpr/cpr/releases/tag/1.5.1 - return Version(self.version) >= "1.5.1" and self.settings.os == "Windows" - - @property - def _supports_darwinssl(self): - # https://github.com/libcpr/cpr/releases/tag/1.6.1 - return Version(self.version) >= "1.6.1" and is_apple_os(self) - - @property - def _can_auto_ssl(self): - # https://github.com/libcpr/cpr/releases/tag/1.6.0 - return not self._uses_old_cmake_options and not ( - # https://github.com/libcpr/cpr/issues/546 - Version(self.version) in ["1.6.0", "1.6.1"] - and is_apple_os(self) - ) - - @property - def _uses_old_cmake_options(self): - # https://github.com/libcpr/cpr/releases/tag/1.6.0 - return Version(self.version) < "1.6.0" - @property def _uses_valid_abi_and_compiler(self): # https://github.com/conan-io/conan-center-index/pull/5194#issuecomment-821908385 return not ( - Version(self.version) >= "1.6.0" - and self.settings.compiler == "clang" + self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libstdc++" and Version(self.settings.compiler.version) < "9" ) @@ -103,15 +71,6 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - ssl_library = str(self.options.get_safe("with_ssl")) - if not self._can_auto_ssl and ssl_library == CprConan._AUTO_SSL: - if self._supports_openssl: - self.output.info("Auto SSL is not available below version 1.6.0. Falling back to openssl") - self.options.with_ssl = "openssl" - else: - self.output.info("Auto SSL is not available below version 1.6.0 (or below 1.6.2 on macOS), and openssl not supported. Disabling SSL") - self.options.with_ssl = CprConan._NO_SSL - if Version(self.version) < "1.10.0": del self.options.verbose_logging @@ -123,30 +82,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libcurl/8.0.1", transitive_headers=True, transitive_libs=True) + self.requires("libcurl/[>=7.78.0 <9]", 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. if self.settings.os in ["Linux", "FreeBSD"] and self.options.with_ssl in ["openssl", CprConan._AUTO_SSL]: self.requires("openssl/[>=1.1 <4]") - # Check if the system supports the given ssl library - def _supports_ssl_library(self, library): - if library == CprConan._NO_SSL: - return True - elif library == CprConan._AUTO_SSL: - return self._can_auto_ssl - - validators = { - "openssl": self._supports_openssl, - "darwinssl": self._supports_darwinssl, - "winssl": self._supports_winssl, - CprConan._AUTO_SSL: self._can_auto_ssl - } - - # A KeyError should never happen, as the options are validated by conan. - return validators[library] - def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) @@ -156,23 +98,17 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - SSL_FAILURE_MESSAGES = { - "openssl": "OpenSSL is not supported on macOS or on CPR versions < 1.5.0", - "darwinssl": "DarwinSSL is only supported on macOS and on CPR versions >= 1.6.1", - "winssl": "WinSSL is only on Windows and on CPR versions >= 1.5.1", - CprConan._AUTO_SSL: "Automatic SSL selection is only available on CPR versions >= 1.6.0 (and only >= 1.6.2 on macOS)" - } - if not self._uses_valid_abi_and_compiler: raise ConanInvalidConfiguration(f"Cannot compile {self.ref} with libstdc++ on clang < 9") ssl_library = str(self.options.with_ssl) - if not self._supports_ssl_library(ssl_library): - raise ConanInvalidConfiguration( - f"Invalid SSL selection for the given configuration: {SSL_FAILURE_MESSAGES[ssl_library]}" - if ssl_library in SSL_FAILURE_MESSAGES - else f"Invalid value of ssl option, {ssl_library}" - ) + + if ssl_library == "openssl" and is_apple_os(self): + raise ConanInvalidConfiguration("OpenSSL is not supported on macOS") + if ssl_library == "darwinssl" and not is_apple_os(self): + raise ConanInvalidConfiguration("DarwinSSL is only supported on macOS") + if ssl_library == "winssl" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("WinSSL is only on Windows") if ssl_library not in (CprConan._AUTO_SSL, CprConan._NO_SSL, "winssl") and ssl_library != self.dependencies["libcurl"].options.with_ssl: raise ConanInvalidConfiguration( @@ -193,47 +129,22 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _get_cmake_option(self, option): - CPR_1_6_CMAKE_OPTIONS_TO_OLD = { - "CPR_FORCE_USE_SYSTEM_CURL": "USE_SYSTEM_CURL", - "CPR_BUILD_TESTS": "BUILD_CPR_TESTS", - "CPR_BUILD_TESTS_SSL": "BUILD_CPR_TESTS_SSL", - "CPR_GENERATE_COVERAGE": "GENERATE_COVERAGE", - "CPR_USE_SYSTEM_GTEST": "USE_SYSTEM_GTEST", - "CPR_FORCE_OPENSSL_BACKEND": "USE_OPENSSL", - "CPR_FORCE_WINSSL_BACKEND": "USE_WINSSL", - } - - if self._uses_old_cmake_options: - # Get the translated option if we can, or the original if one isn't defined. - return CPR_1_6_CMAKE_OPTIONS_TO_OLD.get(option, option) - - CPR_1_6_CMAKE_OPTIONS_TO_1_10 = { - "CPR_FORCE_USE_SYSTEM_CURL": "CPR_USE_SYSTEM_CURL" - } - - if Version(self.version) >= "1.10.0": - return CPR_1_6_CMAKE_OPTIONS_TO_1_10.get(option, option) - return option - def generate(self): tc = CMakeToolchain(self) - tc.variables[self._get_cmake_option("CPR_FORCE_USE_SYSTEM_CURL")] = True - tc.variables[self._get_cmake_option("CPR_BUILD_TESTS")] = False - tc.variables[self._get_cmake_option("CPR_GENERATE_COVERAGE")] = False - tc.variables[self._get_cmake_option("CPR_USE_SYSTEM_GTEST")] = False + if Version(self.version) >= "1.10.0": + tc.variables["CPR_USE_SYSTEM_CURL"] = True + else: + tc.variables["CPR_FORCE_USE_SYSTEM_CURL"] = True + tc.variables["CPR_BUILD_TESTS"] = False + tc.variables["CPR_GENERATE_COVERAGE"] = False + tc.variables["CPR_USE_SYSTEM_GTEST"] = False tc.variables["CPR_CURL_NOSIGNAL"] = not self.options.signal - ssl_value = str(self.options.get_safe("with_ssl")) - SSL_OPTIONS = { - "CPR_FORCE_DARWINSSL_BACKEND": ssl_value == "darwinssl", - "CPR_FORCE_OPENSSL_BACKEND": ssl_value == "openssl", - "CPR_FORCE_WINSSL_BACKEND": ssl_value == "winssl", - "CMAKE_USE_OPENSSL": ssl_value == "openssl" - } - for cmake_option, value in SSL_OPTIONS.items(): - tc.variables[self._get_cmake_option(cmake_option)] = value + tc.variables["CPR_FORCE_DARWINSSL_BACKEND"] = (self.options.with_ssl == "darwinssl") + tc.variables["CPR_FORCE_OPENSSL_BACKEND"] = (self.options.with_ssl == "openssl") + tc.variables["CPR_FORCE_WINSSL_BACKEND"] = (self.options.with_ssl == "winssl") + tc.variables["CMAKE_USE_OPENSSL"] = (self.options.with_ssl == "openssl") # If we are on a version where disabling SSL requires a cmake option, disable it - if not self._uses_old_cmake_options and str(self.options.get_safe("with_ssl")) == CprConan._NO_SSL: + if self.options.with_ssl == CprConan._NO_SSL: tc.variables["CPR_ENABLE_SSL"] = False if self.options.get_safe("verbose_logging", False): diff --git a/recipes/cpr/all/patches/002-1.4.0-create-install.patch b/recipes/cpr/all/patches/002-1.4.0-create-install.patch deleted file mode 100644 index 42f7f34ab13fe9..00000000000000 --- a/recipes/cpr/all/patches/002-1.4.0-create-install.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- cpr/CMakeLists.txt -+++ cpr/CMakeLists.txt -@@ -46,3 +46,11 @@ - message(STATUS "Using CURL_LIBRARIES: ${CURL_LIBRARIES}.") - target_link_libraries(${CPR_LIBRARIES} - ${CURL_LIBRARIES}) -+ -+include(GNUInstallDirs) -+install(TARGETS cpr -+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" -+) -+install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/cpr" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch b/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch deleted file mode 100644 index 61ba93886b977b..00000000000000 --- a/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt -diff --git a/a/cpr/CMakeLists.txt b/b/cpr/CMakeLists.txt -index c4f9b5b..7e2279d 100644 ---- a/a/cpr/CMakeLists.txt -+++ b/b/cpr/CMakeLists.txt -@@ -44,8 +44,7 @@ add_library(${CPR_LIBRARIES} - "${CPR_INCLUDE_DIRS}/cpr/unix_socket.h") - - message(STATUS "Using CURL_LIBRARIES: ${CURL_LIBRARIES}.") --target_link_libraries(${CPR_LIBRARIES} -- ${CURL_LIBRARIES}) -+target_link_libraries(cpr PUBLIC CURL::libcurl) - - include(GNUInstallDirs) - install(TARGETS cpr diff --git a/recipes/cpr/all/patches/004-1.4.0-curl-global-scope.patch b/recipes/cpr/all/patches/004-1.4.0-curl-global-scope.patch deleted file mode 100644 index b4fe11b69536a6..00000000000000 --- a/recipes/cpr/all/patches/004-1.4.0-curl-global-scope.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt -index aa9f35d..86500d9 100644 ---- a/a/CMakeLists.txt -+++ b/b/CMakeLists.txt -@@ -86,7 +86,8 @@ if(BUILD_CPR_TESTS) - enable_testing() - endif() - --add_subdirectory(opt) -+# add_subdirectory(opt) # With Conan, none of this is used -+find_package(CURL) - add_subdirectory(cpr) - if(BUILD_CPR_TESTS) - add_subdirectory(test) diff --git a/recipes/cpr/all/patches/005-1.5.2-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.5.2-fix-curl-components.patch deleted file mode 100644 index fda5c28eafd1d8..00000000000000 --- a/recipes/cpr/all/patches/005-1.5.2-fix-curl-components.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c065227d..c1c19155 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -55,15 +55,7 @@ include(cmake/code_coverage.cmake) - - # Curl configuration - if(USE_SYSTEM_CURL) -- find_package(CURL COMPONENTS PROTOCOLS HTTP HTTPS FEATURES SSL) -- if (CURL_FOUND) -- set(SSL_ENABLED ON CACHE INTERNAL "" FORCE) -- else() -- find_package(CURL COMPONENTS PROTOCOLS HTTP) -- if(CURL_FOUND) -- set(SSL_ENABLED OFF CACHE INTERNAL "" FORCE) -- endif() -- endif() -+ find_package(CURL) - endif() - if(NOT USE_SYSTEM_CURL OR NOT CURL_FOUND) - message(STATUS "Not using system Curl, using built-in curl project instead.") diff --git a/recipes/cpr/all/patches/005-1.6.2-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.6.2-fix-curl-components.patch deleted file mode 100644 index 04da489547e84b..00000000000000 --- a/recipes/cpr/all/patches/005-1.6.2-fix-curl-components.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -120,29 +120,11 @@ endif() - - # Curl configuration - if(CPR_FORCE_USE_SYSTEM_CURL) -- if(CPR_ENABLE_SSL) -- find_package(CURL COMPONENTS HTTP HTTPS SSL) -- if(CURL_FOUND) -- message(STATUS "Curl ${CURL_VERSION_STRING} found on this system.") -- # To be able to load certificates under Windows when using OpenSSL: -- if(CMAKE_USE_OPENSSL AND WIN32 AND (NOT (CURL_VERSION_STRING VERSION_GREATER_EQUAL "7.71.0"))) -- message(FATAL_ERROR "Your system curl version (${CURL_VERSION_STRING}) is too old to support OpenSSL on Windows which requires curl >= 7.71.0. Update your curl version, use WinSSL, disable SSL or use the build in version of curl.") -- endif() -- else() -- find_package(CURL COMPONENTS HTTP) -- if(CURL_FOUND) -- message(FATAL_ERROR "Curl found on this system but WITHOUT HTTPS/SSL support. Either disable SSL by setting CPR_ENABLE_SSL to OFF or use the build in version of curl by setting CPR_FORCE_USE_SYSTEM_CURL to OFF.") -- else() -- message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") -- endif() -- endif() -+ find_package(CURL REQUIRED) -+ if(CURL_FOUND) -+ message(STATUS "Curl found on this system.") - else() -- find_package(CURL COMPONENTS HTTP) -- if(CURL_FOUND) -- message(STATUS "Curl found on this system.") -- else() -- message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") -- endif() -+ message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") - endif() - else() - message(STATUS "Configuring build in curl...") diff --git a/recipes/cpr/all/patches/005-1.9.0-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.9.0-fix-curl-components.patch deleted file mode 100644 index f20781e9ef90e8..00000000000000 --- a/recipes/cpr/all/patches/005-1.9.0-fix-curl-components.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cb7c5f0..c6c19e4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -162,6 +162,8 @@ endif() - - # Curl configuration - if(CPR_FORCE_USE_SYSTEM_CURL) -+ find_package(CURL REQUIRED) -+ if(0) - if(CPR_ENABLE_SSL) - find_package(CURL COMPONENTS HTTP HTTPS) - if(CURL_FOUND) -@@ -186,6 +188,7 @@ if(CPR_FORCE_USE_SYSTEM_CURL) - message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") - endif() - endif() -+ endif() - else() - message(STATUS "Configuring build in curl...") - diff --git a/recipes/cpr/config.yml b/recipes/cpr/config.yml index 66e2467c8e5312..48b580f3173d95 100644 --- a/recipes/cpr/config.yml +++ b/recipes/cpr/config.yml @@ -1,21 +1,11 @@ versions: - "1.10.4": - folder: all - "1.10.1": + "1.10.5": folder: all - "1.10.0": + "1.10.4": folder: all "1.9.3": folder: all - "1.9.0": - folder: all "1.8.1": folder: all "1.7.2": folder: all - "1.6.2": - folder: all - "1.5.2": - folder: all - "1.4.0": - folder: all diff --git a/recipes/cprocessing/all/conanfile.py b/recipes/cprocessing/all/conanfile.py index f1d8d20922d764..cfb3a6e0339a8f 100644 --- a/recipes/cprocessing/all/conanfile.py +++ b/recipes/cprocessing/all/conanfile.py @@ -1,84 +1,80 @@ -from conans import ConanFile, tools -from conans.tools import ConanInvalidConfiguration import os import re -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.files import copy, get, load, replace_in_file, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class CProcessingConan(ConanFile): name = "cprocessing" - description = "Processsing programming for C++ " + description = "Processing programming for C++ " license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/maksmakuta/CProcessing" - topics = ("processing", "opengl", "sketch") + topics = ("processing", "opengl", "sketch", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 20 @property def _compilers_minimum_version(self): return { - "gcc": "9", - "Visual Studio": "16.2", - "msvc": "19.22", - "clang": "10", - "apple-clang": "11" + "gcc": "9", + "Visual Studio": "16.2", + "msvc": "192", + "clang": "10", + "apple-clang": "11", } + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): - self.requires("glfw/3.3.7") + self.requires("glfw/3.3.8") self.requires("glm/0.9.9.8") self.requires("glew/2.2.0") - self.requires("stb/cci.20210910") + self.requires("stb/cci.20220909") self.requires("opengl/system") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 20) - - def lazy_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] - - compiler_version = str(self.settings.compiler.version) - + 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("{} requires C++20. Your compiler is unknown. Assuming it supports C++20.".format(self.name)) - elif lazy_lt_semver(compiler_version, minimum_version): - raise ConanInvalidConfiguration("{} requires some C++20 features,".format(self.name)) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires some C++{self._min_cppstd} features, which your compiler does not support." + ) 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 build(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "lib", "PImage.h"), - "stb/stb_image.h", - "stb_image.h") - - def package(self): - self.copy("*.h", "include", os.path.join(self._source_subfolder, "lib")) + replace_in_file(self, os.path.join(self.source_folder, "lib", "PImage.h"), "stb/stb_image.h", "stb_image.h") + def _extract_license(self): # Extract the License/s from README.md to a file - tmp = tools.load(os.path.join(self._source_subfolder, "README.md")) + tmp = load(self, os.path.join(self.source_folder, "README.md")) license_contents = re.search("(## Author.*)", tmp, re.DOTALL)[1] - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE.md"), license_contents) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE.md"), license_contents) - def package_info(self): - self.cpp_info.set_property("cmake_file_name", "CProcessing") - self.cpp_info.set_property("cmake_target_name", "CProcessing::CProcessing") + def package(self): + self._extract_license() + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "lib")) - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "CProcessing" - self.cpp_info.filenames["cmake_find_package_multi"] = "CProcessing" - self.cpp_info.names["cmake_find_package"] = "CProcessing" - self.cpp_info.names["cmake_find_package_multi"] = "CProcessing" + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cprocessing/all/test_package/CMakeLists.txt b/recipes/cprocessing/all/test_package/CMakeLists.txt index 05121b9bfe4148..81c78689deb641 100644 --- a/recipes/cprocessing/all/test_package/CMakeLists.txt +++ b/recipes/cprocessing/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(CProcessing REQUIRED CONFIG) +find_package(cprocessing REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} CProcessing::CProcessing) +target_link_libraries(${PROJECT_NAME} cprocessing::cprocessing) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/cprocessing/all/test_package/conanfile.py b/recipes/cprocessing/all/test_package/conanfile.py index 51cf79f1d6887b..ef5d7042163ecc 100644 --- a/recipes/cprocessing/all/test_package/conanfile.py +++ b/recipes/cprocessing/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): - test_file = os.path.join("bin", "test_package") - if self.settings.os == "Windows": - test_file += ".exe" - assert os.path.exists(test_file) + 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/cprocessing/all/test_package/test_package.cpp b/recipes/cprocessing/all/test_package/test_package.cpp index 479e221b8ea06e..e8aaee04efe2bf 100644 --- a/recipes/cprocessing/all/test_package/test_package.cpp +++ b/recipes/cprocessing/all/test_package/test_package.cpp @@ -6,67 +6,74 @@ * Part 2: https://youtube.com/shorts/IS6_apBewlI */ +// Disable the main function from from processing.h +// to disable the interactive GUI for the purposes of this test +#define main _main #include +#undef main float speed; -class Star{ +class Star { private: - float x,y,z,pz; + float x, y, z, pz; + public: - Star(){ - this->x = random(-width,width); - this->y = random(-height,height); - this->z = random(width); - this->pz = z; + Star() { + this->x = random(-width, width); + this->y = random(-height, height); + this->z = random(width); + this->pz = z; } - void update(){ - this->z -= speed; - if(this->z < 1.f){ - this->z = width; - this->x = random(-width,width); - this->y = random(-height,height); - this->pz = z; - } + void update() { + this->z -= speed; + if (this->z < 1.f) { + this->z = width; + this->x = random(-width, width); + this->y = random(-height, height); + this->pz = z; + } } - void show(){ - fill(255); + void show() { + fill(255); - float sx = map(this->x / this->z,0,1,0, width); - float sy = map(this->y / this->z,0,1,0,height); + float sx = map(this->x / this->z, 0, 1, 0, width); + float sy = map(this->y / this->z, 0, 1, 0, height); - float r = map(this->z,0,width,16,0); - circle(sx,sy,r); + float r = map(this->z, 0, width, 16, 0); + circle(sx, sy, r); - float zx = map(this->x / this->pz,0,1,0, width); - float zy = map(this->y / this->pz,0,1,0,height); + float zx = map(this->x / this->pz, 0, 1, 0, width); + float zy = map(this->y / this->pz, 0, 1, 0, height); - this->pz = z; + this->pz = z; - stroke(255); - line(zx,zy,sx,sy); + stroke(255); + line(zx, zy, sx, sy); } - }; std::vector stars; -void setup(){ - size(640,480); - for(int a = 0;a < 100;a++) - stars.push_back(Star()); +void setup() { + size(640, 480); + for (int a = 0; a < 100; a++) + stars.push_back(Star()); } -void draw(){ - speed = map(mouseX,0,width,0.f,50.f); - background(0); - translate(width/2,height/2); +void draw() { + speed = map(mouseX, 0, width, 0.f, 50.f); + background(0); + translate(width / 2, height / 2); - for(int a = 0;a < stars.size();a++){ - stars[a].update(); - stars[a].show(); - } + for (int a = 0; a < stars.size(); a++) { + stars[a].update(); + stars[a].show(); + } +} +int main() { + return 0; } diff --git a/recipes/cprocessing/all/test_v1_package/CMakeLists.txt b/recipes/cprocessing/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cprocessing/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/gtsam/all/test_v1_package/conanfile.py b/recipes/cprocessing/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/gtsam/all/test_v1_package/conanfile.py rename to recipes/cprocessing/all/test_v1_package/conanfile.py diff --git a/recipes/cpu_features/all/conandata.yml b/recipes/cpu_features/all/conandata.yml index 8e0a68b98fb045..b0a209ae1c3e88 100644 --- a/recipes/cpu_features/all/conandata.yml +++ b/recipes/cpu_features/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.0": + url: "https://github.com/google/cpu_features/archive/refs/tags/v0.9.0.tar.gz" + sha256: "bdb3484de8297c49b59955c3b22dba834401bc2df984ef5cfc17acbe69c5018e" "0.8.0": url: "https://github.com/google/cpu_features/archive/refs/tags/v0.8.0.tar.gz" sha256: "7021729f2db97aa34f218d12727314f23e8b11eaa2d5a907e8426bcb41d7eaac" diff --git a/recipes/cpu_features/config.yml b/recipes/cpu_features/config.yml index a4fbe67cb54a0d..7f1513eea2fa95 100644 --- a/recipes/cpu_features/config.yml +++ b/recipes/cpu_features/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.0": + folder: "all" "0.8.0": folder: "all" "0.7.0": diff --git a/recipes/cpuinfo/all/conandata.yml b/recipes/cpuinfo/all/conandata.yml index 6231a9e8c3b977..56ce9c275f3d91 100644 --- a/recipes/cpuinfo/all/conandata.yml +++ b/recipes/cpuinfo/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "cci.20230118": + url: "https://github.com/pytorch/cpuinfo/archive/3dc310302210c1891ffcfb12ae67b11a3ad3a150.tar.gz" + sha256: "f2f4df6d2b01036f36c5e372954e536881cdd59f5c2461c67aa0a92c6d755c61" + "cci.20220618": + url: "https://github.com/pytorch/cpuinfo/archive/082deffc80ce517f81dc2f3aebe6ba671fcd09c9.tar.gz" + sha256: "4379348ec3127b37e854a0a66f85ea1d3c606e5f3a6dce235dc9c69ce663c026" "cci.20220228": url: "https://github.com/pytorch/cpuinfo/archive/6288930068efc8dff4f3c0b95f062fc5ddceba04.tar.gz" sha256: "9e9e937b3569320d23d8b1c8c26ed3603affe55c3e4a3e49622e8a2c6d6e1696" diff --git a/recipes/cpuinfo/all/conanfile.py b/recipes/cpuinfo/all/conanfile.py index 3a1f62573cb435..24edf5382c77cf 100644 --- a/recipes/cpuinfo/all/conanfile.py +++ b/recipes/cpuinfo/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.53.0" @@ -15,7 +15,7 @@ class CpuinfoConan(ConanFile): topics = ("cpu", "cpuid", "cpu-cache", "cpu-model", "instruction-set", "cpu-topology") homepage = "https://github.com/pytorch/cpuinfo" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -33,7 +33,12 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.shared: + if is_msvc(self): + # Only static for msvc + # Injecting CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is not sufficient since there are global symbols + del self.options.shared + self.package_type = "static-library" + if self.options.get_safe("shared"): self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") @@ -41,10 +46,6 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("shared cpuinfo not supported on Windows") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -65,9 +66,19 @@ def generate(self): tc.generate() def _patch_sources(self): - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON)", - "") + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + + # Fix install dir of dll + replace_in_file( + self, + cmakelists, + "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}", + "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}", + ) + + if self.version < "cci.20230118": + # Honor fPIC option + replace_in_file(self, cmakelists, "SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON)", "") def build(self): self._patch_sources() @@ -80,9 +91,20 @@ def package(self): cmake = CMake(self) cmake.install() 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("cmake_file_name", "cpuinfo") self.cpp_info.set_property("pkg_config_name", "libcpuinfo") - self.cpp_info.libs = ["cpuinfo", "clog"] + + if self.version < "cci.20230118": + self.cpp_info.components["clog"].libs = ["clog"] + cpuinfo_clog_target = "clog" if self.version < "cci.20220618" else "cpuinfo::clog" + self.cpp_info.components["clog"].set_property("cmake_target_name", cpuinfo_clog_target) + + self.cpp_info.components["cpuinfo"].set_property("cmake_target_name", "cpuinfo::cpuinfo") + self.cpp_info.components["cpuinfo"].libs = ["cpuinfo"] + if self.version < "cci.20230118": + self.cpp_info.components["cpuinfo"].requires = ["clog"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["pthread"] + self.cpp_info.components["cpuinfo"].system_libs.append("pthread") diff --git a/recipes/cpuinfo/all/test_package/CMakeLists.txt b/recipes/cpuinfo/all/test_package/CMakeLists.txt index f7fd88969d977e..96ba94c8edef55 100644 --- a/recipes/cpuinfo/all/test_package/CMakeLists.txt +++ b/recipes/cpuinfo/all/test_package/CMakeLists.txt @@ -4,5 +4,11 @@ project(test_package LANGUAGES C) find_package(cpuinfo REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE cpuinfo::cpuinfo) +if ((${CPUINFO_VERSION} GREATER_EQUAL "20220618") AND (${CPUINFO_VERSION} LESS "20230118")) + # in that version range cpuinfo exposed cpuinfo::clog. Check that is available through conan recipe + target_link_libraries(${PROJECT_NAME} PRIVATE cpuinfo::cpuinfo cpuinfo::clog) +else () + target_link_libraries(${PROJECT_NAME} PRIVATE cpuinfo::cpuinfo) +endif() + target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/cpuinfo/all/test_package/conanfile.py b/recipes/cpuinfo/all/test_package/conanfile.py index 0a6bc68712d901..2690818e475701 100644 --- a/recipes/cpuinfo/all/test_package/conanfile.py +++ b/recipes/cpuinfo/all/test_package/conanfile.py @@ -1,12 +1,12 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, cmake_layout +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def layout(self): @@ -15,6 +15,11 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CPUINFO_VERSION"] = str(self.dependencies["cpuinfo"].ref.version).split('.')[1] + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/cpuinfo/all/test_v1_package/conanfile.py b/recipes/cpuinfo/all/test_v1_package/conanfile.py index 38f4483872d47f..ea57bb8b3a514c 100644 --- a/recipes/cpuinfo/all/test_v1_package/conanfile.py +++ b/recipes/cpuinfo/all/test_v1_package/conanfile.py @@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): def build(self): cmake = CMake(self) + cmake.definitions["CPUINFO_VERSION"] = self.deps_cpp_info["cpuinfo"].version.split('.')[1] cmake.configure() cmake.build() diff --git a/recipes/cpuinfo/config.yml b/recipes/cpuinfo/config.yml index a6383a8ac8924b..8e98d8506c888d 100644 --- a/recipes/cpuinfo/config.yml +++ b/recipes/cpuinfo/config.yml @@ -1,4 +1,8 @@ versions: + "cci.20230118": + folder: all + "cci.20220618": + folder: all "cci.20220228": folder: all "cci.20201217": diff --git a/recipes/crc_cpp/all/conandata.yml b/recipes/crc_cpp/all/conandata.yml index 09ada265a56575..ae324a0321c623 100644 --- a/recipes/crc_cpp/all/conandata.yml +++ b/recipes/crc_cpp/all/conandata.yml @@ -1,13 +1,13 @@ sources: - "1.0.0": - url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.0.tar.gz" - sha256: "035ed616e0662eddbe7db7c920faaef99bbeb8953ebf98c3bb76cb81a2c4de2b" - "1.0.1": - url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.1.tar.gz" - sha256: "865a0e110bf7e94061ceef1683947a7788b54f932c7ce3848edc89d36e1aea26" - "1.1.0": - url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.1.0.tar.gz" - sha256: "50e46e3c44eb39809f6697b253f7b36c089642d7b7f2ebe2f75adf23c50676be" "1.2.0": url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.2.0.tar.gz" sha256: "508a609d9ef12c3088ed17a8ed820c965161a36dd90738c7358333fbfbe96af5" + "1.1.0": + url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.1.0.tar.gz" + sha256: "50e46e3c44eb39809f6697b253f7b36c089642d7b7f2ebe2f75adf23c50676be" + "1.0.1": + url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.1.tar.gz" + sha256: "865a0e110bf7e94061ceef1683947a7788b54f932c7ce3848edc89d36e1aea26" + "1.0.0": + url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.0.tar.gz" + sha256: "035ed616e0662eddbe7db7c920faaef99bbeb8953ebf98c3bb76cb81a2c4de2b" diff --git a/recipes/crc_cpp/all/conanfile.py b/recipes/crc_cpp/all/conanfile.py index 4ccb993ef97a21..c77936e91ebeab 100644 --- a/recipes/crc_cpp/all/conanfile.py +++ b/recipes/crc_cpp/all/conanfile.py @@ -1,6 +1,9 @@ -from conan import ConanFile, tools -from conan.tools.scm import Version +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 import os required_conan_version = ">=1.50.0" @@ -9,45 +12,51 @@ class Crc_CppConan(ConanFile): name = "crc_cpp" description = "A header only constexpr / compile time small-table based CRC library for C++17 and newer" - topics = "crc_cpp", "crc", "constexpr", "cpp17", "cpp20", "header-only" - settings = "compiler", "os" + topics = ("crc", "constexpr", "cpp17", "cpp20", "header-only") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/AshleyRoll/crc_cpp" license = "MIT" + 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 _supported_compiler(self): - compiler = str(self.settings.compiler) - version = Version(self.settings.compiler.version) - if compiler == "Visual Studio" and version >= "15": - return True - elif compiler == "gcc" and version >= "9": - return True - elif compiler == "clang" and version >= "5": - return True - elif compiler == "apple-clang" and version >= "10": - return True - else: - self.output.warn("{} recipe lacks information about the {} compiler standard version support".format(self.name, compiler)) - return False + def _compilers_minimum_version(self): + return { + "gcc": "9", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.build.check_min_cppstd(self, "17") - if not self._supported_compiler: - raise ConanInvalidConfiguration("crc_cpp: Unsupported compiler: {}-{} " - "Minimum C++17 constexpr features required.".format(self.settings.compiler, self.settings.compiler.version)) + 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.files.get(self, **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="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/crc_cpp/all/test_package/CMakeLists.txt b/recipes/crc_cpp/all/test_package/CMakeLists.txt index d41bc6dd30265f..ba67401c34bccb 100644 --- a/recipes/crc_cpp/all/test_package/CMakeLists.txt +++ b/recipes/crc_cpp/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(crc_cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE crc_cpp::crc_cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/crc_cpp/all/test_package/conanfile.py b/recipes/crc_cpp/all/test_package/conanfile.py index 34a0bcae95438f..0a6bc68712d901 100644 --- a/recipes/crc_cpp/all/test_package/conanfile.py +++ b/recipes/crc_cpp/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -from conan import ConanFile, tools -from conans import CMake +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "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) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.build.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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gli/all/test_v1_package/CMakeLists.txt b/recipes/crc_cpp/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/gli/all/test_v1_package/CMakeLists.txt rename to recipes/crc_cpp/all/test_v1_package/CMakeLists.txt diff --git a/recipes/openjpeg/all/test_v1_package/conanfile.py b/recipes/crc_cpp/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/openjpeg/all/test_v1_package/conanfile.py rename to recipes/crc_cpp/all/test_v1_package/conanfile.py diff --git a/recipes/crc_cpp/config.yml b/recipes/crc_cpp/config.yml index 0d463a277e7325..de59a653e157c9 100644 --- a/recipes/crc_cpp/config.yml +++ b/recipes/crc_cpp/config.yml @@ -1,9 +1,9 @@ versions: - "1.0.0": - folder: "all" - "1.0.1": + "1.2.0": folder: "all" "1.1.0": folder: "all" - "1.2.0": + "1.0.1": + folder: "all" + "1.0.0": folder: "all" 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/conandata.yml b/recipes/crossguid/all/conandata.yml new file mode 100644 index 00000000000000..2fdb90ed9775b8 --- /dev/null +++ b/recipes/crossguid/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.2.2": + url: "https://github.com/graeme-hill/crossguid/archive/refs/tags/v0.2.2.tar.gz" + sha256: "48321928473c682b0cdc7e17bbd3390f79f4b98ab22fef3b81a852dda81fd195" +patches: + "0.2.2": + - patch_file: "patches/0001-add-installer.patch" + patch_description: "add installer definition" + patch_type: "conan" diff --git a/recipes/crossguid/all/conanfile.py b/recipes/crossguid/all/conanfile.py new file mode 100644 index 00000000000000..562232c007b4ac --- /dev/null +++ b/recipes/crossguid/all/conanfile.py @@ -0,0 +1,84 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.apple import is_apple_os +import os + +required_conan_version = ">=1.53.0" + +class CrossGUIDConan(ConanFile): + name = "crossguid" + description = "Lightweight cross platform C++ GUID/UUID library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/graeme-hill/crossguid" + topics = ("guid", "uuid") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 11 + + 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): + 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"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + 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.variables["XG_TESTS"] = False + tc.generate() + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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 = ["xg"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.settings.os == "Android": + self.cpp_info.defines.append("GUID_ANDROID") + if is_apple_os(self): + self.cpp_info.frameworks.append("CoreFoundation") diff --git a/recipes/crossguid/all/patches/0001-add-installer.patch b/recipes/crossguid/all/patches/0001-add-installer.patch new file mode 100644 index 00000000000000..c3a387902568ca --- /dev/null +++ b/recipes/crossguid/all/patches/0001-add-installer.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 761dbc6..b5ddd74 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,13 +27,32 @@ elseif(APPLE) + elseif(ANDROID) + target_compile_definitions(xg PRIVATE GUID_ANDROID) + else() +- find_package(Libuuid REQUIRED) +- if (NOT LIBUUID_FOUND) ++ find_package(libuuid REQUIRED) ++ if (NOT libuuid_FOUND) + message(FATAL_ERROR + "You might need to run 'sudo apt-get install uuid-dev' or similar") + endif() +- 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() ++ ++include(GNUInstallDirs) ++ ++set(CROSSGUID_INC_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}") ++set(CROSSGUID_RUNTIME_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}") ++set(CROSSGUID_LIBRARY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") ++set(CROSSGUID_ARCHIVE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") ++set(CROSSGUID_FRAMEWORK_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") ++ ++# Install target ++install(TARGETS xg EXPORT crossguidTargets ++ RUNTIME DESTINATION ${CROSSGUID_RUNTIME_INSTALL_DIR} ++ LIBRARY DESTINATION ${CROSSGUID_LIBRARY_INSTALL_DIR} ++ ARCHIVE DESTINATION ${CROSSGUID_ARCHIVE_INSTALL_DIR} ++ FRAMEWORK DESTINATION ${CROSSGUID_FRAMEWORK_INSTALL_DIR}) ++ ++# Install headers ++install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/Guid.hpp" ++ DESTINATION ${CROSSGUID_INC_INSTALL_DIR}) diff --git a/recipes/crossguid/all/test_package/CMakeLists.txt b/recipes/crossguid/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d1140285930251 --- /dev/null +++ b/recipes/crossguid/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(crossguid REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE crossguid::crossguid) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/crossguid/all/test_package/conanfile.py b/recipes/crossguid/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/crossguid/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/crossguid/all/test_package/test_package.cpp b/recipes/crossguid/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..1fcc33b8fd5e86 --- /dev/null +++ b/recipes/crossguid/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include "Guid.hpp" + +int main(void) { + auto const g = xg::newGuid(); + + std::cout << "Here is a guid: " << g << std::endl; + + return 0; +} diff --git a/recipes/crossguid/config.yml b/recipes/crossguid/config.yml new file mode 100644 index 00000000000000..cd4b8da537c38c --- /dev/null +++ b/recipes/crossguid/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.2": + folder: all diff --git a/recipes/crowcpp-crow/all/conanfile.py b/recipes/crowcpp-crow/all/conanfile.py index 001767af2d0fdb..ff4bbd7ba2b660 100644 --- a/recipes/crowcpp-crow/all/conanfile.py +++ b/recipes/crowcpp-crow/all/conanfile.py @@ -42,14 +42,14 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") if self.version == "0.2": - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") if Version(self.version) >= "1.0": if self.options.with_ssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <3]") if self.options.with_compression: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def package_id(self): self.info.settings.clear() @@ -121,10 +121,13 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "Crow") self.cpp_info.set_property("cmake_target_name", "Crow::Crow") + if Version(self.version) == "0.2": + self.cpp_info.requires.append("openssl::ssl") + if Version(self.version) >= "1.0": if self.options.with_ssl: self.cpp_info.defines.append("CROW_ENABLE_SSL") - self.cpp_info.requires.append("OpenSSL::ssl") + self.cpp_info.requires.append("openssl::ssl") if self.options.with_compression: self.cpp_info.defines.append("CROW_ENABLE_COMPRESSION") self.cpp_info.requires.append("zlib::zlib") diff --git a/recipes/crowcpp-crow/all/test_package/conanfile.py b/recipes/crowcpp-crow/all/test_package/conanfile.py index 3022a3897300e8..6fce18aff0519b 100644 --- a/recipes/crowcpp-crow/all/test_package/conanfile.py +++ b/recipes/crowcpp-crow/all/test_package/conanfile.py @@ -6,7 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def requirements(self): diff --git a/recipes/cryptopp-pem/all/CMakeLists.txt b/recipes/cryptopp-pem/all/CMakeLists.txt deleted file mode 100644 index f36a181c680d32..00000000000000 --- a/recipes/cryptopp-pem/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 (WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/cryptopp-pem/all/conandata.yml b/recipes/cryptopp-pem/all/conandata.yml index 47bad604295539..d25975ebafd938 100644 --- a/recipes/cryptopp-pem/all/conandata.yml +++ b/recipes/cryptopp-pem/all/conandata.yml @@ -9,12 +9,7 @@ sources: patches: "8.2.0": - patch_file: "patches/fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/rename-output-library.patch" - base_path: "source_subfolder" - patch_file: "patches/link-to-cryptopp.patch" - base_path: "source_subfolder" - patch_file: "patches/remove-cryptopp-sources-from-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/use-cryptopp-include-from-conan.patch" - base_path: "source_subfolder" diff --git a/recipes/cryptopp-pem/all/conanfile.py b/recipes/cryptopp-pem/all/conanfile.py index 12b7d953de0b62..b4e39431490764 100644 --- a/recipes/cryptopp-pem/all/conanfile.py +++ b/recipes/cryptopp-pem/all/conanfile.py @@ -1,20 +1,30 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os import shutil import textwrap -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.microsoft import is_msvc +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, export_conandata_patches, get, replace_in_file, rmdir, save, download, load +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class CryptoPPPEMConan(ConanFile): name = "cryptopp-pem" + description = ("The PEM Pack is a partial implementation of message encryption " + "which allows you to read and write PEM encoded keys and parameters, " + "including encrypted private keys.") + # TODO: Fix license syntax, this is not proper spdx terminology + license = "DocumentRef-README.md:LicenseRef-Cryptopp-Pem-PublicDomain" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.cryptopp.com/wiki/PEM_Pack" - license = "Unlicense" - description = "The PEM Pack is a partial implementation of message encryption which allows you to read and write PEM encoded keys and parameters, including encrypted private keys." topics = ("cryptopp", "crypto", "cryptographic", "security", "PEM") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,21 +35,8 @@ class CryptoPPPEMConan(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" - _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": @@ -47,66 +44,81 @@ 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(f"cryptopp/{self.version}", transitive_headers=True, transitive_libs=True) + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support shared library on Windows.") + # look at https://github.com/conan-io/conan-center-index/pull/18863#issuecomment-1779940892 def source(self): - suffix = "CRYPTOPP_{}".format(self.version.replace(".", "_")) + suffix = f"CRYPTOPP_{self.version.replace('.', '_')}" # Get sources - tools.get(**self.conan_data["sources"][self.version]["source"], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version]["source"], strip_root=True) # Get CMakeLists - tools.get(**self.conan_data["sources"][self.version]["cmake"]) + get(self, **self.conan_data["sources"][self.version]["cmake"]) src_folder = os.path.join(self.source_folder, "cryptopp-cmake-" + suffix) - dst_folder = os.path.join(self.source_folder, self._source_subfolder) - shutil.move(os.path.join(src_folder, "CMakeLists.txt"), os.path.join(dst_folder, "CMakeLists.txt")) - shutil.move(os.path.join(src_folder, "cryptopp-config.cmake"), os.path.join(dst_folder, "cryptopp-config.cmake")) - tools.rmdir(src_folder) - - # Get license - tools.download("https://unlicense.org/UNLICENSE", "UNLICENSE", sha256="7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c") + shutil.move(os.path.join(src_folder, "CMakeLists.txt"), os.path.join(self.source_folder, "CMakeLists.txt")) + shutil.move(os.path.join(src_folder, "cryptopp-config.cmake"), os.path.join(self.source_folder, "cryptopp-config.cmake")) + rmdir(self, src_folder) + # LICENSE not packaged with release tar + download(self, "https://raw.githubusercontent.com/noloader/cryptopp-pem/0cfc1a8590f2395cd5b976be0e95e10de9a15a92/README.md", + os.path.join(self.source_folder, "LICENSE"), + sha256="efa5140027e396a3844f9f48d65e014c9a710939ac02e22d32c33a51e1750eef") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["USE_INTERMEDIATE_OBJECTS_TARGET"] = False + tc.variables["DISABLE_ASM"] = True + if self.settings.os == "Android": + tc.variables["CRYPTOPP_NATIVE_ARCH"] = True + if is_apple_os(self) and self.settings.arch == "armv8" and Version(self.version) <= "8.4.0": + tc.variables["CMAKE_CXX_FLAGS"] = "-march=armv8-a" + tc.generate() + + # cryptopp-pem expects cryptopp headers to be without a cryptopp/ prefix + cryptopp_info = self.dependencies["cryptopp"].cpp_info.components["libcryptopp"] + cryptopp_info.includedirs.append(os.path.join(self.dependencies["cryptopp"].package_folder, "include", "cryptopp")) + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): if self.settings.os == "Android" and "ANDROID_NDK_HOME" in os.environ: - shutil.copyfile(os.path.join(tools.get_env("ANDROID_NDK_HOME"), "sources", "android", "cpufeatures", "cpu-features.h"), - os.path.join(self._source_subfolder, "cpu-features.h")) - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + shutil.copyfile( + os.path.join(os.environ.get("ANDROID_NDK_HOME"), "sources", "android", "cpufeatures", "cpu-features.h"), + os.path.join(self.source_folder, "cpu-features.h")) + apply_conandata_patches(self) # Honor fPIC option - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "SET(CMAKE_POSITION_INDEPENDENT_CODE 1)", "") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_STATIC"] = not self.options.shared - self._cmake.definitions["BUILD_SHARED"] = self.options.shared - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["BUILD_DOCUMENTATION"] = False - self._cmake.definitions["USE_INTERMEDIATE_OBJECTS_TARGET"] = False - self._cmake.definitions["DISABLE_ASM"] = True - if self.settings.os == "Android": - self._cmake.definitions["CRYPTOPP_NATIVE_ARCH"] = True - if self.settings.os == "Macos" and self.settings.arch == "armv8" and tools.Version(self.version) <= "8.4.0": - self._cmake.definitions["CMAKE_CXX_FLAGS"] = "-march=armv8-a" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - - def requirements(self): - self.requires("cryptopp/" + self.version) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "SET(CMAKE_POSITION_INDEPENDENT_CODE 1)", "") - def build(self): + def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() + def _extract_license(self): + readme = load(self, os.path.join(self.source_folder, "LICENSE"),) + return readme[readme.find("## License"):] + def package(self): - self.copy(pattern="UNLICENSE", dst="licenses") - cmake = self._configure_cmake() + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + 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")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), @@ -115,31 +127,30 @@ def package(self): "cryptopp-pem-static": "cryptopp-pem::cryptopp-pem-static" } ) + fix_apple_shared_install_name(self) - @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): cmake_target = "cryptopp-pem-shared" if self.options.shared else "cryptopp-pem-static" - self.cpp_info.set_property("cmake_file_name", "cryptopp-pem") - self.cpp_info.set_property("cmake_target_name", cmake_target) + self.cpp_info.set_property("cmake_target_aliases", [cmake_target]) self.cpp_info.set_property("pkg_config_name", "libcryptopp-pem") # TODO: back to global scope once cmake_find_package* generators removed - self.cpp_info.components["libcryptopp-pem"].libs = tools.collect_libs(self) + self.cpp_info.components["libcryptopp-pem"].libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libcryptopp-pem"].system_libs = ["pthread", "m"] elif self.settings.os == "SunOS": @@ -148,7 +159,6 @@ def package_info(self): self.cpp_info.components["libcryptopp-pem"].system_libs = ["ws2_32"] # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.names["pkg_config"] = "libcryptopp-pem" self.cpp_info.components["libcryptopp-pem"].names["cmake_find_package"] = cmake_target self.cpp_info.components["libcryptopp-pem"].names["cmake_find_package_multi"] = cmake_target self.cpp_info.components["libcryptopp-pem"].build_modules["cmake_find_package"] = [self._module_file_rel_path] @@ -156,6 +166,4 @@ def package_info(self): self.cpp_info.components["libcryptopp-pem"].set_property("cmake_target_name", cmake_target) self.cpp_info.components["libcryptopp-pem"].set_property("pkg_config_name", "libcryptopp-pem") - self.cpp_info.components["libcryptopp-pem"].requires = [ - "cryptopp::cryptopp", - ] + self.cpp_info.components["libcryptopp-pem"].requires = ["cryptopp::cryptopp"] diff --git a/recipes/cryptopp-pem/all/patches/use-cryptopp-include-from-conan.patch b/recipes/cryptopp-pem/all/patches/use-cryptopp-include-from-conan.patch index e7c0d678e73638..3ca6e7dc9287cb 100644 --- a/recipes/cryptopp-pem/all/patches/use-cryptopp-include-from-conan.patch +++ b/recipes/cryptopp-pem/all/patches/use-cryptopp-include-from-conan.patch @@ -21,23 +21,6 @@ NAMESPACE_BEGIN(CryptoPP) ---- a/pem_common.cpp -+++ b/pem_common.cpp -@@ -6,10 +6,10 @@ - // http://www.cryptopp.com/wiki/PEM_Pack - /////////////////////////////////////////////////////////////////////////// - --#include "cryptlib.h" --#include "secblock.h" --#include "base64.h" --#include "osrng.h" -+#include -+#include -+#include -+#include - - #include - #include --- a/pem_common.h +++ b/pem_common.h @@ -10,9 +10,10 @@ @@ -54,119 +37,3 @@ #include "pem.h" #include ---- a/pem_read.cpp -+++ b/pem_read.cpp -@@ -10,27 +10,27 @@ - #include - #include - --#include "cryptlib.h" --#include "secblock.h" --#include "nbtheory.h" --#include "gfpcrypt.h" --#include "camellia.h" --#include "smartptr.h" --#include "filters.h" --#include "base64.h" --#include "queue.h" --#include "modes.h" --#include "asn.h" --#include "aes.h" --#include "idea.h" --#include "hex.h" -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #include "pem.h" - #include "pem_common.h" - - #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 --#include "des.h" --#include "md5.h" -+#include -+#include - - ////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////// ---- a/pem_test.cxx -+++ b/pem_test.cxx -@@ -4,13 +4,14 @@ - #include - #include - --#include "cryptlib.h" --#include "integer.h" --#include "eccrypto.h" --#include "osrng.h" --#include "files.h" --#include "rsa.h" --#include "dsa.h" -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ - #include "pem.h" - - int main(int argc, char* argv[]) ---- a/pem_write.cpp -+++ b/pem_write.cpp -@@ -10,27 +10,27 @@ - #include - #include - --#include "cryptlib.h" --#include "secblock.h" --#include "camellia.h" --#include "smartptr.h" --#include "filters.h" --#include "base64.h" --#include "files.h" --#include "queue.h" --#include "modes.h" --#include "osrng.h" --#include "asn.h" --#include "aes.h" --#include "idea.h" --#include "hex.h" -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #include "pem.h" - #include "pem_common.h" - - #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 --#include "des.h" --#include "md5.h" -+#include -+#include - - ////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////// diff --git a/recipes/cryptopp-pem/all/test_package/CMakeLists.txt b/recipes/cryptopp-pem/all/test_package/CMakeLists.txt index f9ceeed7804cbd..fdb362acfd0cf5 100644 --- a/recipes/cryptopp-pem/all/test_package/CMakeLists.txt +++ b/recipes/cryptopp-pem/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -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(TARGETS) +find_package(cryptopp-pem REQUIRED CONFIG) find_package(cryptopp-pem) diff --git a/recipes/cryptopp-pem/all/test_package/conanfile.py b/recipes/cryptopp-pem/all/test_package/conanfile.py index 19e6a0c06e3d81..ef5d7042163ecc 100644 --- a/recipes/cryptopp-pem/all/test_package/conanfile.py +++ b/recipes/cryptopp-pem/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" + 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/cryptopp-pem/all/test_v1_package/CMakeLists.txt b/recipes/cryptopp-pem/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cryptopp-pem/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/cryptopp-pem/all/test_v1_package/conanfile.py b/recipes/cryptopp-pem/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/cryptopp-pem/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/cryptopp/all/conandata.yml b/recipes/cryptopp/all/conandata.yml index 2bc29cced3bfe2..8b52a60c80d57e 100644 --- a/recipes/cryptopp/all/conandata.yml +++ b/recipes/cryptopp/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "8.8.0": + source: + url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_8_0.tar.gz" + sha256: "f8b8f632533b279ee297694e651e9204824bba6022ce66e60ebebb08b551fe7a" + cmake: + url: "https://github.com/abdes/cryptopp-cmake/archive/CRYPTOPP_8_8_0.tar.gz" + sha256: "a10068ab47fb46785dfe43ebe45369008855b03f6711ac7d1af6f45aa9238290" "8.7.0": source: url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_7_0.tar.gz" diff --git a/recipes/cryptopp/all/conanfile.py b/recipes/cryptopp/all/conanfile.py index f16bdf4f4f23d6..d61c97a23b4e49 100644 --- a/recipes/cryptopp/all/conanfile.py +++ b/recipes/cryptopp/all/conanfile.py @@ -97,6 +97,7 @@ def generate(self): tc.cache_variables["CRYPTOPP_USE_INTERMEDIATE_OBJECTS_TARGET"] = False if self.settings.os == "Android": tc.cache_variables["CRYPTOPP_NATIVE_ARCH"] = True + tc.cache_variables["CMAKE_DISABLE_FIND_PACKAGE_Git"] = True tc.generate() def _patch_sources(self): diff --git a/recipes/cryptopp/config.yml b/recipes/cryptopp/config.yml index 0cf6dab66b6c74..58c17b09dbebf5 100644 --- a/recipes/cryptopp/config.yml +++ b/recipes/cryptopp/config.yml @@ -1,4 +1,6 @@ versions: + "8.8.0": + folder: "all" "8.7.0": folder: "all" "8.6.0": diff --git a/recipes/cs_libguarded/all/conandata.yml b/recipes/cs_libguarded/all/conandata.yml index 6464993e20067b..da0b7dc2228882 100644 --- a/recipes/cs_libguarded/all/conandata.yml +++ b/recipes/cs_libguarded/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.1": + url: "https://github.com/copperspice/cs_libguarded/archive/libguarded-1.4.1.tar.gz" + sha256: "e91235d4f5e5edb4a479fccfcd1bdc2a411dd3e3344f5c973ce5870edbab13b0" "1.4.0": url: "https://github.com/copperspice/cs_libguarded/archive/libguarded-1.4.0.tar.gz" sha256: "3911c56db6e7b222e2ec4c45513021f819ce647e7e6e803ca64dc720e8645d8e" diff --git a/recipes/cs_libguarded/all/conanfile.py b/recipes/cs_libguarded/all/conanfile.py index 39578ddadb4233..7a321e4ffe7291 100644 --- a/recipes/cs_libguarded/all/conanfile.py +++ b/recipes/cs_libguarded/all/conanfile.py @@ -15,6 +15,7 @@ class CsLibguardedConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/copperspice/libguarded" topics = ("multithreading", "templates", "cpp14", "mutexes", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -66,7 +67,7 @@ def loose_lt_semver(v1, v2): f"{self.ref} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support") 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 package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) diff --git a/recipes/cs_libguarded/config.yml b/recipes/cs_libguarded/config.yml index 942362a3d6c938..e039584f8837c7 100644 --- a/recipes/cs_libguarded/config.yml +++ b/recipes/cs_libguarded/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.1": + folder: all "1.4.0": folder: all "1.3.0": diff --git a/recipes/cspice/all/CMakeLists.txt b/recipes/cspice/all/CMakeLists.txt index 3812708448a9a5..4e032190639fa8 100644 --- a/recipes/cspice/all/CMakeLists.txt +++ b/recipes/cspice/all/CMakeLists.txt @@ -65,7 +65,7 @@ if(CSPICE_BUILD_UTILITIES) file(GLOB CSPICE_UTILITIES_SUBDIRS RELATIVE ${SRC_DIR} "${SRC_DIR}/*_c") list(REMOVE_ITEM CSPICE_UTILITIES_SUBDIRS "cook_c") foreach(CSPICE_SUBDIR ${CSPICE_UTILITIES_SUBDIRS}) - set(UTILITY_SRC_DIR "${SRC_DIR}/${CSPICE_SUBDIR}") + get_filename_component(UTILITY_SRC_DIR "${SRC_DIR}/${CSPICE_SUBDIR}" ABSOLUTE) # Each .pgm file is the entry point of an executable file(GLOB PGM_FILES "${UTILITY_SRC_DIR}/*.pgm") diff --git a/recipes/csvmonkey/all/conanfile.py b/recipes/csvmonkey/all/conanfile.py index 49542ed86e55ce..821a19ed460963 100644 --- a/recipes/csvmonkey/all/conanfile.py +++ b/recipes/csvmonkey/all/conanfile.py @@ -14,7 +14,8 @@ class CSVMONEKYConan(ConanFile): license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/dw/csvmonkey/" - topics = ("csv-parser", "header-only", "vectorized") + topics = ("csv-parser", "header-only", "vectorized", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_spirit": [True, False], @@ -33,7 +34,7 @@ def layout(self): def requirements(self): if self.options.with_spirit: - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") def package_id(self): self.info.clear() diff --git a/recipes/cthash/all/conandata.yml b/recipes/cthash/all/conandata.yml new file mode 100644 index 00000000000000..49dc0097b55edc --- /dev/null +++ b/recipes/cthash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20231025": + url: "https://github.com/hanickadot/cthash/archive/21d581e0a6bd7040c282af1e43faab9d44f47744.tar.gz" + sha256: "03bf073f0c8a362d26186dab39482418aaf59a1bc17d92ec6b49053147c0fba0" diff --git a/recipes/cthash/all/conanfile.py b/recipes/cthash/all/conanfile.py new file mode 100644 index 00000000000000..3cf7e23d7eec7e --- /dev/null +++ b/recipes/cthash/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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.microsoft import is_msvc +import os + + +required_conan_version = ">=1.53.0" + + +class CtHashConan(ConanFile): + name = "cthash" + description = "constexpr implementation of SHA-2 and SHA-3 family of hashes" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hanickadot/cthash/" + topics = ("constexpr", "xxhash", "sha", "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": "12.2", + "clang": "15.0.7", + "apple-clang": "14", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC.") + + 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 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." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.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.libdirs = [] diff --git a/recipes/cthash/all/test_package/CMakeLists.txt b/recipes/cthash/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..0fedcbfdc51995 --- /dev/null +++ b/recipes/cthash/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cthash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cthash::cthash) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/cthash/all/test_package/conanfile.py b/recipes/cthash/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e845ae751a3017 --- /dev/null +++ b/recipes/cthash/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cthash/all/test_package/test_package.cpp b/recipes/cthash/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..561e9a5d45e574 --- /dev/null +++ b/recipes/cthash/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include "cthash/cthash.hpp" + +using namespace cthash::literals; + +int main(void) { + constexpr auto my_hash = cthash::sha3_256{}.update("hello there!").final(); + + std::cout << my_hash << std::endl; + + return 0; +} diff --git a/recipes/cthash/config.yml b/recipes/cthash/config.yml new file mode 100644 index 00000000000000..52ddbe7872fd0b --- /dev/null +++ b/recipes/cthash/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20231025": + folder: all diff --git a/recipes/ctpg/all/conandata.yml b/recipes/ctpg/all/conandata.yml index e352628a7b1dd7..35ba92c0e04759 100644 --- a/recipes/ctpg/all/conandata.yml +++ b/recipes/ctpg/all/conandata.yml @@ -2,9 +2,3 @@ sources: "1.3.7": url: "https://github.com/peter-winter/ctpg/archive/refs/tags/v1.3.7.tar.gz" sha256: "6cc7c34de4983e21070599fd5693b65ef08cd5c8f42612e43b47eda723623429" - "1.3.6": - url: "https://github.com/peter-winter/ctpg/archive/refs/tags/v1.3.6.tar.gz" - sha256: "8ad5e06ab551fe30ff10faf6b53b85c862a873e3827505d5f5b63aae2b836ba2" - "1.3.5": - url: "https://github.com/peter-winter/ctpg/archive/refs/tags/v1.3.5.tar.gz" - sha256: "6874e71aecace33a07dd202c5c6c53277653d54daa13b460f4e1eb5b0c902d42" diff --git a/recipes/ctpg/all/conanfile.py b/recipes/ctpg/all/conanfile.py index bd69eefe8c5a2e..6e511a34160b52 100644 --- a/recipes/ctpg/all/conanfile.py +++ b/recipes/ctpg/all/conanfile.py @@ -1,59 +1,73 @@ -from conans.errors import ConanInvalidConfiguration -from conans import ConanFile, tools 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.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class CTPGConan(ConanFile): name = "ctpg" - license = "MIT" description = ( "Compile Time Parser Generator is a C++ single header library which takes a language description as a C++ code " "and turns it into a LR1 table parser with a deterministic finite automaton lexical analyzer, all in compile time." ) - topics = ("regex", "parser", "grammar", "compile-time") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/peter-winter/ctpg" - settings = "compiler", + topics = ("regex", "parser", "grammar", "compile-time", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _compiler_required_cpp17 = { - "Visual Studio": "16", - "gcc": "8", - "clang": "12", - "apple-clang": "12.0", - } + @property + def _min_cppstd(self): + return 17 @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "12", + "apple-clang": "12.0", + "msvc": "192", + "Visual Studio": "16", + } - def validate(self): - ## TODO: In ctpg<=1.3.5, Visual Studio C++ failed to compile ctpg with "error MSB6006: "CL.exe" exited with code -1073741571." - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("{} does not support Visual Studio currently.".format(self.name)) + def layout(self): + basic_layout(self, src_folder="src") - if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "17") + def package_id(self): + self.info.clear() - minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) - if minimum_version: - if tools.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)) + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - def package_id(self): - self.info.header_only() + 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], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - if tools.Version(self.version) >= "1.3.7": - self.copy("ctpg.hpp", - os.path.join("include", "ctpg"), - os.path.join(self._source_subfolder, "include", "ctpg")) - else: - self.copy("ctpg.hpp", "include", os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + include_dir = os.path.join("include", "ctpg") + copy(self, "ctpg.hpp", + dst=os.path.join(self.package_folder, include_dir), + src=os.path.join(self.source_folder, include_dir)) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/ctpg/all/test_package/CMakeLists.txt b/recipes/ctpg/all/test_package/CMakeLists.txt index b09bb90b2f88d4..72fdf15fd58d71 100644 --- a/recipes/ctpg/all/test_package/CMakeLists.txt +++ b/recipes/ctpg/all/test_package/CMakeLists.txt @@ -1,17 +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(ctpg CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} ctpg::ctpg) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) -if(CTPG_PLACED_CPTG_FOLDER) - target_compile_definitions(${PROJECT_NAME} PUBLIC CTPG_PLACED_CPTG_FOLDER) -endif() if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") target_compile_options(${PROJECT_NAME} PUBLIC -constexpr:depth3000000) diff --git a/recipes/ctpg/all/test_package/conanfile.py b/recipes/ctpg/all/test_package/conanfile.py index 34c01340114eff..c5591f2deebdb2 100644 --- a/recipes/ctpg/all/test_package/conanfile.py +++ b/recipes/ctpg/all/test_package/conanfile.py @@ -1,18 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps +from conan.tools.scm import Version 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" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["CTPG_PLACED_CPTG_FOLDER"] = tools.Version(self.deps_cpp_info["ctpg"].version) >= "1.3.7" 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) + 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/ctpg/all/test_package/test_package.cpp b/recipes/ctpg/all/test_package/test_package.cpp index bcd377f23cbd81..0d99b97395ccd2 100644 --- a/recipes/ctpg/all/test_package/test_package.cpp +++ b/recipes/ctpg/all/test_package/test_package.cpp @@ -1,8 +1,4 @@ -#ifdef CTPG_PLACED_CPTG_FOLDER -# include "ctpg/ctpg.hpp" -#else -# include "ctpg.hpp" -#endif +#include "ctpg/ctpg.hpp" #include @@ -28,7 +24,7 @@ constexpr ctpg::parser p( ) ); -int main(int argc, char* argv[]) { +int main() { auto res = p.parse(ctpg::buffers::string_buffer("10, 20, 30"), std::cerr); bool success = res.has_value(); if (success) diff --git a/recipes/ctpg/all/test_v1_package/CMakeLists.txt b/recipes/ctpg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/ctpg/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/ctpg/all/test_v1_package/conanfile.py b/recipes/ctpg/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..90eb89e3f2f46b --- /dev/null +++ b/recipes/ctpg/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") + self.run(bin_path, run_environment=True) diff --git a/recipes/ctpg/config.yml b/recipes/ctpg/config.yml index 3da45bc7782505..fba76735a90139 100644 --- a/recipes/ctpg/config.yml +++ b/recipes/ctpg/config.yml @@ -1,7 +1,3 @@ versions: "1.3.7": folder: all - "1.3.6": - folder: all - "1.3.5": - folder: all diff --git a/recipes/ctre/all/conandata.yml b/recipes/ctre/all/conandata.yml index 0cbb6fc297fa12..c31706ca559c2e 100644 --- a/recipes/ctre/all/conandata.yml +++ b/recipes/ctre/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.8.1": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.8.1.tar.gz" + sha256: "0ce8760d43b3b97b43364cd32ee663e5c8b8b4bfd58e7890042eff6ac52db605" + "3.8": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.8.tar.gz" + sha256: "6462ee41fa6aa12075f6b9d13f42358091d32963087443a6669d2c94232eea04" "3.7.2": url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.7.2.tar.gz" sha256: "0711a6f97496e010f72adab69839939a9e50ba35ad87779e422ae3ff3b0edfc3" diff --git a/recipes/ctre/all/conanfile.py b/recipes/ctre/all/conanfile.py index 4a9068c2ee4fea..7170bf3ad64257 100644 --- a/recipes/ctre/all/conanfile.py +++ b/recipes/ctre/all/conanfile.py @@ -17,6 +17,7 @@ class CtreConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/hanickadot/compile-time-regular-expressions" topics = ("cpp17", "regex", "compile-time-regular-expressions", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -38,8 +39,11 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC < 16") elif compiler == "gcc" and compiler_version < min_gcc: raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < {min_gcc}") - elif compiler == "clang" and compiler_version < "6.0": - raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang < 6.0") + elif compiler == "clang": + if compiler_version < "6.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang < 6.0") + if ctre_version == "3.4.1" and compiler_version >= "12.0" and not self.settings.compiler.get_safe("cppstd"): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang >= 12.0 without cppstd. Please set cppstd.") elif compiler == "apple-clang": if compiler_version < "10.0": raise ConanInvalidConfiguration(f"{self.ref} doesn't support Apple clang < 10.0") @@ -53,7 +57,7 @@ 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 package(self): copy(self, pattern="*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) diff --git a/recipes/ctre/config.yml b/recipes/ctre/config.yml index 791985db544208..02f3f62c0a4518 100644 --- a/recipes/ctre/config.yml +++ b/recipes/ctre/config.yml @@ -1,4 +1,8 @@ versions: + "3.8.1": + folder: all + "3.8": + folder: all "3.7.2": folder: all "3.7.1": diff --git a/recipes/cub/all/conanfile.py b/recipes/cub/all/conanfile.py index 2cde129243380d..c19b0eb6a89020 100644 --- a/recipes/cub/all/conanfile.py +++ b/recipes/cub/all/conanfile.py @@ -15,8 +15,9 @@ class CubConan(ConanFile): description = "Cooperative primitives for CUDA C++" license = "BSD 3-Clause" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/project/cub" - topics = ("algorithms", "cuda", "gpu", "nvidia", "nvidia-hpc-sdk") + homepage = "https://github.com/NVIDIA/cub" + topics = ("algorithms", "cuda", "gpu", "nvidia", "nvidia-hpc-sdk", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -29,7 +30,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "Visual Studio": "15", - "msvc": "14.1", + "msvc": "191", "gcc": "5", "clang": "5", "apple-clang": "5.1", @@ -54,29 +55,23 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - copy( - self, - pattern="LICENSE.TXT", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) - copy( - self, - pattern="*.cuh", - dst=os.path.join(self.package_folder, "include", "cub"), - src=os.path.join(self.source_folder, "cub"), - ) + copy(self, "LICENSE.TXT", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*.cuh", + dst=os.path.join(self.package_folder, "include", "cub"), + src=os.path.join(self.source_folder, "cub")) def package_info(self): self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] # Follows the naming conventions of the official CMake config file: # https://github.com/NVIDIA/cub/blob/main/cub/cmake/cub-config.cmake - self.cpp_info.set_property("cmake_file_name", "cub") self.cpp_info.set_property("cmake_target_name", "CUB::CUB") - self.cpp_info.set_property("pkg_config_name", "cub") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "cub" diff --git a/recipes/cubicinterpolation/all/CMakeLists.txt b/recipes/cubicinterpolation/all/CMakeLists.txt deleted file mode 100644 index 0ed622c3eb5d7a..00000000000000 --- a/recipes/cubicinterpolation/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_RPATH) - -add_subdirectory("source_subfolder") diff --git a/recipes/cubicinterpolation/all/conanfile.py b/recipes/cubicinterpolation/all/conanfile.py index 722cbaa5424a18..2525795c99b747 100644 --- a/recipes/cubicinterpolation/all/conanfile.py +++ b/recipes/cubicinterpolation/all/conanfile.py @@ -11,10 +11,10 @@ class CubicInterpolationConan(ConanFile): name = "cubicinterpolation" - homepage = "https://github.com/MaxSac/cubic_interpolation" + description = "Leightweight interpolation library based on boost and eigen." license = "MIT" + homepage = "https://github.com/MaxSac/cubic_interpolation" url = "https://github.com/conan-io/conan-center-index" - description = "Leightweight interpolation library based on boost and eigen." topics = ("interpolation", "splines", "cubic", "bicubic", "boost", "eigen3") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -27,8 +27,6 @@ class CubicInterpolationConan(ConanFile): "fPIC": True, } - _cmake = None - def export_sources(self): export_conandata_patches(self) @@ -45,15 +43,14 @@ def layout(self): def requirements(self): # TODO: update boost dependency as soon as we deprecate conan1.x (see discussion in #11207) - self.requires("boost/1.75.0") - self.requires("eigen/3.3.9") + self.requires("boost/1.83.0") + self.requires("eigen/3.4.0") @property def _required_boost_components(self): return ["filesystem", "math", "serialization"] def validate(self): - miss_boost_required_comp = any(getattr(self.dependencies["boost"].options, 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( @@ -64,7 +61,7 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "14") - if not check_min_vs(self, 192, raise_invalid=False): + if not check_min_vs(self, 192, raise_invalid=False): raise ConanInvalidConfiguration(f"{self.ref} currently Visual Studio < 2019 not yet supported in this recipe. Contributions are welcome") if is_msvc(self) and self.options.shared: @@ -74,7 +71,7 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - tc = CMakeToolchain(self) + tc = CMakeToolchain(self) tc.variables["BUILD_EXAMPLE"] = False tc.variables["BUILD_DOCUMENTATION"] = False tc.generate() diff --git a/recipes/cubicinterpolation/all/test_package/CMakeLists.txt b/recipes/cubicinterpolation/all/test_package/CMakeLists.txt index b98fa443a53683..0ce4681457d9e3 100644 --- a/recipes/cubicinterpolation/all/test_package/CMakeLists.txt +++ b/recipes/cubicinterpolation/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) find_package(CubicInterpolation REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} CubicInterpolation::CubicInterpolation) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE CubicInterpolation::CubicInterpolation) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cubicinterpolation/config.yml b/recipes/cubicinterpolation/config.yml index 5185d65a2df905..5c83127c63d755 100644 --- a/recipes/cubicinterpolation/config.yml +++ b/recipes/cubicinterpolation/config.yml @@ -1,6 +1,6 @@ versions: "0.1.5": - folder: all + folder: all "0.1.4": folder: all "0.1.3": diff --git a/recipes/cuda-api-wrappers/all/conandata.yml b/recipes/cuda-api-wrappers/all/conandata.yml index fa4742f5cc3204..5990b0d96ecd68 100644 --- a/recipes/cuda-api-wrappers/all/conandata.yml +++ b/recipes/cuda-api-wrappers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7": + url: "https://github.com/eyalroz/cuda-api-wrappers/archive/0.7b1.tar.gz" + sha256: "1ed5912d8f602ccd176865b824de17f462cb57142eb2a685d7cc034831e54a71" "0.6.3": url: "https://github.com/eyalroz/cuda-api-wrappers/archive/refs/tags/v0.6.3.tar.gz" sha256: "45d896136dbb4df6c75c36071899b9fe47df9a03629c95208c2d5bda979d109e" diff --git a/recipes/cuda-api-wrappers/config.yml b/recipes/cuda-api-wrappers/config.yml index a98729f2af8b08..b1edd3de7d7ae3 100644 --- a/recipes/cuda-api-wrappers/config.yml +++ b/recipes/cuda-api-wrappers/config.yml @@ -1,3 +1,5 @@ versions: + "0.7": + folder: all "0.6.3": folder: all diff --git a/recipes/cuda-samples/all/conandata.yml b/recipes/cuda-samples/all/conandata.yml new file mode 100644 index 00000000000000..0fc2e78f080c82 --- /dev/null +++ b/recipes/cuda-samples/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "12.2": + url: "https://github.com/NVIDIA/cuda-samples/archive/refs/tags/v12.2.tar.gz" + sha256: "c9fbdee420fd4567edb1239420e2a5c93d9652b4ccf3a828fcb3e0de3152e466" + "11.8": + url: "https://github.com/NVIDIA/cuda-samples/archive/refs/tags/v11.8.tar.gz" + sha256: "1bc02c0ca42a323f3c7a05b5682eae703681a91e95b135bfe81f848b2d6a2c51" + "10.2": + url: "https://github.com/NVIDIA/cuda-samples/archive/refs/tags/v10.2.tar.gz" + sha256: "f3d224dcc7028d055617360b481947c27346d87dd1ccfbdd134ab24648c084e8" diff --git a/recipes/cuda-samples/all/conanfile.py b/recipes/cuda-samples/all/conanfile.py new file mode 100644 index 00000000000000..aa2ee3b794d8a8 --- /dev/null +++ b/recipes/cuda-samples/all/conanfile.py @@ -0,0 +1,51 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy, get, rmdir +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + + +class CudaSamplesConan(ConanFile): + name = "cuda-samples" + description = ("Common headers from NVIDIA CUDA Samples - " + "samples for CUDA developers which demonstrate features in CUDA Toolkit") + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/NVIDIA/cuda-samples" + topics = ("cuda", "cuda-kernels", "cuda-driver-api", "cuda-opengl", "nvcudasamples") + + 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) + # Package only headers under Common/ folder + rmdir(self, os.path.join(self.source_folder, "Samples")) + rmdir(self, os.path.join(self.source_folder, "bin")) + # Skip GL headers and precompiled libs, since these should be provided by separate Conan packages + rmdir(self, os.path.join(self.source_folder, "Common", "GL")) + rmdir(self, os.path.join(self.source_folder, "Common", "lib")) + rmdir(self, os.path.join(self.source_folder, "Common", "data")) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include", "Common"), + src=os.path.join(self.source_folder, "Common")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "Common")) diff --git a/recipes/cuda-samples/all/test_package/CMakeLists.txt b/recipes/cuda-samples/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..fc3bd6fda4c9c5 --- /dev/null +++ b/recipes/cuda-samples/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cuda-samples REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cuda-samples::cuda-samples) diff --git a/recipes/cuda-samples/all/test_package/conanfile.py b/recipes/cuda-samples/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/cuda-samples/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/cuda-samples/all/test_package/test_package.cpp b/recipes/cuda-samples/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..041e701c086ac5 --- /dev/null +++ b/recipes/cuda-samples/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +// One of the few non-CUDA-specific headers in the CUDA Samples. +#include "helper_string.h" + + +int main() { + char file[] = "hello_world.jpg"; + char *ext = NULL; + getFileExtension(file, &ext); + + std::cout << "getFileExtension(\"" << file << "\") returned \"" << ext << "\"." << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/cuda-samples/config.yml b/recipes/cuda-samples/config.yml new file mode 100644 index 00000000000000..0cc56090a313f6 --- /dev/null +++ b/recipes/cuda-samples/config.yml @@ -0,0 +1,7 @@ +versions: + "12.2": + folder: all + "11.8": + folder: all + "10.2": + folder: all diff --git a/recipes/cxxopts/all/conanfile.py b/recipes/cxxopts/all/conanfile.py index 03ec452dcf0b88..face2572c75ddf 100644 --- a/recipes/cxxopts/all/conanfile.py +++ b/recipes/cxxopts/all/conanfile.py @@ -15,7 +15,7 @@ class CxxOptsConan(ConanFile): description = "Lightweight C++ option parser library, supporting the standard GNU style syntax for options." license = "MIT" topics = ("option-parser", "positional-arguments ", "header-only") - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "unicode": [True, False], @@ -44,7 +44,7 @@ def layout(self): def requirements(self): if self.options.unicode: - self.requires("icu/72.1") + self.requires("icu/74.1") def package_id(self): self.info.clear() diff --git a/recipes/cyclonedds-cxx/all/cmake/Generate.cmake b/recipes/cyclonedds-cxx/all/cmake/Generate.cmake new file mode 100644 index 00000000000000..a399ac1aa2efed --- /dev/null +++ b/recipes/cyclonedds-cxx/all/cmake/Generate.cmake @@ -0,0 +1,64 @@ +# +# Copyright(c) 2020 to 2022 ZettaScale Technology and others +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License +# v. 1.0 which is available at +# http://www.eclipse.org/org/documents/edl-v10.php. +# +# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause +# + +# NOTE: This function was leveraged from the upstream cyclonedds-cxx project +# and modified to find the direct path to the cycloneddsidlcxx library as +# opposed to leveraging the native CycloneDDS-CXX::idlcxx cmake target. +# Because Conan redeclares its own targets using INTERFACE libs, the upstream +# version of this function was incompatible. If the upstream implementation of +# this functionality changes, a modification to this file may be required. +# See: https://github.com/eclipse-cyclonedds/cyclonedds-cxx/blob/master/src/idlcxx/Generate.cmake + +find_package(CycloneDDS REQUIRED) + +# find idlcxx shared library +set(CMAKE_FIND_LIBRARY_SUFFIXES .dll ${CMAKE_FIND_LIBRARY_SUFFIXES}) +if(CMAKE_CROSSCOMPILING) + find_library(_idlcxx_shared_lib cycloneddsidlcxx NO_CMAKE_FIND_ROOT_PATH REQUIRED) +else() + find_library(_idlcxx_shared_lib + NAMES cycloneddsidlcxx + PATHS ${CMAKE_CURRENT_LIST_DIR}/../../bin/ + ${CMAKE_CURRENT_LIST_DIR}/../../lib/ + NO_DEFAULT_PATH) +endif() + +if(_idlcxx_shared_lib) + set(_idlcxx_depends "") +else() + message(FATAL_ERROR "Cannot find idlcxx shared library") +endif() + +function(IDLCXX_GENERATE) + set(one_value_keywords TARGET DEFAULT_EXTENSIBILITY BASE_DIR OUTPUT_DIR) + set(multi_value_keywords FILES FEATURES INCLUDES WARNINGS) + cmake_parse_arguments( + IDLCXX "" "${one_value_keywords}" "${multi_value_keywords}" "" ${ARGN}) + + idlc_generate_generic(TARGET ${IDLCXX_TARGET} + BACKEND ${_idlcxx_shared_lib} + BASE_DIR ${IDLCXX_BASE_DIR} + FILES ${IDLCXX_FILES} + FEATURES ${IDLCXX_FEATURES} + INCLUDES ${IDLCXX_INCLUDES} + WARNINGS ${IDLCXX_WARNINGS} + DEFAULT_EXTENSIBILITY ${IDLCXX_DEFAULT_EXTENSIBILITY} + SUFFIXES .hpp .cpp + OUTPUT_DIR ${IDLCXX_OUTPUT_DIR} + DEPENDS ${_idlcxx_depends} + ) + if(CYCLONEDDS_CXX_ENABLE_LEGACY) + target_include_directories(${IDLCXX_TARGET} + INTERFACE ${Boost_INCLUDE_DIR} + ) + endif() +endfunction() diff --git a/recipes/cyclonedds-cxx/all/conandata.yml b/recipes/cyclonedds-cxx/all/conandata.yml new file mode 100644 index 00000000000000..46c0203bb55c27 --- /dev/null +++ b/recipes/cyclonedds-cxx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.10.4": + url: "https://github.com/eclipse-cyclonedds/cyclonedds-cxx/archive/refs/tags/0.10.4.tar.gz" + sha256: "ca09d738b150a7dc1fa63dcb5ad211a4ba516c92710ebff7b9fe817c7c5a257e" diff --git a/recipes/cyclonedds-cxx/all/conanfile.py b/recipes/cyclonedds-cxx/all/conanfile.py new file mode 100644 index 00000000000000..723b2660aff690 --- /dev/null +++ b/recipes/cyclonedds-cxx/all/conanfile.py @@ -0,0 +1,162 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.files import copy, get, rm, rmdir, replace_in_file +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.61.0" + +class CycloneDDSCXXConan(ConanFile): + name = "cyclonedds-cxx" + license = "EPL-2.0" + homepage = "https://cyclonedds.io/" + url = "https://github.com/conan-io/conan-center-index" + description = "Eclipse Cyclone DDS C++ Binding- An implementation"\ + " of the OMG Data Distribution Service (DDS) specification" + topics = ("dds", "ipc", "ros", "middleware") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "16", + "msvc": "192", + "clang": "7", + "apple-clang": "10", + } + + def _has_idlc(self, info=False): + # don't build idllib 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", "Generate.cmake"), self.recipe_folder, self.export_sources_folder) + + 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): + # Use the corresponding version of cyclonedds with transitive headers + #INFO: is used in several public headers including: + # :29 + # :31 + # :26 + # :34 + self.requires("cyclonedds/{}".format(self.version), transitive_headers=True) + + 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 does not support." + ) + + def build_requirements(self): + 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) + tc.variables["BUILD_DDSLIB"] = True + tc.variables["BUILD_IDLLIB"] = self._has_idlc() + tc.variables["BUILD_DOCS"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_EXAMPLES"] = False + # variables which effects build + tc.variables["ENABLE_LEGACY"] = False + tc.variables["ENABLE_SHM"] = self.dependencies["cyclonedds"].options.with_shm + tc.variables["ENABLE_TYPE_DISCOVERY"] = self.dependencies["cyclonedds"].options.enable_discovery + tc.variables["ENABLE_TOPIC_DISCOVERY"] = self.dependencies["cyclonedds"].options.enable_discovery + tc.variables["ENABLE_COVERAGE"] = False + tc.generate() + cd = CMakeDeps(self) + cd.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, + "get_target_property(cyclonedds_has_shm CycloneDDS::ddsc SHM_SUPPORT_IS_AVAILABLE)", + "set(cyclonedds_has_shm {})".format(self.dependencies["cyclonedds"].options.with_shm)) + replace_in_file(self, cmakelists, + "get_target_property(cyclonedds_has_type_discovery CycloneDDS::ddsc TYPE_DISCOVERY_IS_AVAILABLE)", + "set(cyclonedds_has_type_discovery {})".format(self.dependencies["cyclonedds"].options.enable_discovery)) + replace_in_file(self, cmakelists, + "get_target_property(cyclonedds_has_topic_discovery CycloneDDS::ddsc TOPIC_DISCOVERY_IS_AVAILABLE)", + "set(cyclonedds_has_topic_discovery {})".format(self.dependencies["cyclonedds"].options.enable_discovery)) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + 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", "CycloneDDS-CXX")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "Generate.cmake", + src=os.path.join(self.source_folder, os.pardir, "cmake"), + dst=os.path.join(self.package_folder, self._module_path)) + 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")) + + @property + def _module_path(self): + return os.path.join("lib", "cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "CycloneDDS-CXX") + self.cpp_info.set_property("cmake_file_name", "CycloneDDS-CXX") + self.cpp_info.set_property("cmake_target_name", "CycloneDDS-CXX::CycloneDDS-CXX") + self.cpp_info.set_property("pkg_config_name", "CycloneDDS-CXX") + build_modules = [ + os.path.join(self._module_path, "Generate.cmake"), + ] + self.cpp_info.set_property("cmake_build_modules", build_modules) + self.cpp_info.includedirs = ["include/ddscxx"] + self.cpp_info.builddirs = [self._module_path] + self.cpp_info.components["ddscxx"].libs = ["ddscxx"] + self.cpp_info.components["ddscxx"].includedirs = ["include/ddscxx"] + self.cpp_info.components["ddscxx"].set_property("cmake_target_name", "CycloneDDS-CXX::ddscxx") + self.cpp_info.components["ddscxx"].set_property("pkg_config_name", "CycloneDDS-CXX") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ddscxx"].system_libs = ["m"] + self.cpp_info.components["idlcxx"].libs = ["cycloneddsidlcxx"] + self.cpp_info.components["idlcxx"].set_property("cmake_target_name", "CycloneDDS-CXX::idlcxx") + 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")) diff --git a/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt b/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..4092a05fa5b944 --- /dev/null +++ b/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +find_package(CycloneDDS-CXX REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE CycloneDDS-CXX::ddscxx CycloneDDS::ddsc) + +if(NOT CMAKE_CROSSCOMPILING) + IDLCXX_GENERATE(TARGET MessageLib FILES Message.idl) + add_executable(test_message test_message.cpp) + target_link_libraries(test_message PRIVATE MessageLib CycloneDDS-CXX::ddscxx CycloneDDS::ddsc) +endif() diff --git a/recipes/cyclonedds-cxx/all/test_package/Message.idl b/recipes/cyclonedds-cxx/all/test_package/Message.idl new file mode 100644 index 00000000000000..46b201f63a8784 --- /dev/null +++ b/recipes/cyclonedds-cxx/all/test_package/Message.idl @@ -0,0 +1,6 @@ +module conan { + struct Message { + sequence payload; + }; + #pragma keylist Message +}; diff --git a/recipes/cyclonedds-cxx/all/test_package/conanfile.py b/recipes/cyclonedds-cxx/all/test_package/conanfile.py new file mode 100644 index 00000000000000..50b7ececfcd179 --- /dev/null +++ b/recipes/cyclonedds-cxx/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + +class CycloneDDSCXXTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_message") + self.run(bin_path, env="conanrun") diff --git a/recipes/cyclonedds-cxx/all/test_package/test_message.cpp b/recipes/cyclonedds-cxx/all/test_package/test_message.cpp new file mode 100644 index 00000000000000..2bc38e32ae1abd --- /dev/null +++ b/recipes/cyclonedds-cxx/all/test_package/test_message.cpp @@ -0,0 +1,12 @@ +#include +#include "dds/dds.hpp" +#include "Message.hpp" + +int main() { + dds::domain::DomainParticipant domain_(0); + + conan::Message message; + std::vector payload; + message.payload(std::move(payload)); + return 0; +} diff --git a/recipes/cyclonedds-cxx/all/test_package/test_package.cpp b/recipes/cyclonedds-cxx/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..b4cf37cb3f9e23 --- /dev/null +++ b/recipes/cyclonedds-cxx/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include "dds/dds.hpp" + +int main() { + + dds::domain::DomainParticipant participant(0); + dds::topic::PublicationBuiltinTopicData topic; + dds::sub::Subscriber subscriber(participant); + + return 0; +} diff --git a/recipes/cyclonedds-cxx/config.yml b/recipes/cyclonedds-cxx/config.yml new file mode 100644 index 00000000000000..87e6038632c054 --- /dev/null +++ b/recipes/cyclonedds-cxx/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.4": + folder: all 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/conandata.yml b/recipes/cyclonedds/all/conandata.yml index d51b6cdca669c5..8d9fa515082f8b 100644 --- a/recipes/cyclonedds/all/conandata.yml +++ b/recipes/cyclonedds/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.10.4": + url: "https://github.com/eclipse-cyclonedds/cyclonedds/archive/0.10.4.tar.gz" + sha256: "fe7bb5a4348e31656a935f72dec909a7d2b0fcf10840614fb552f08eb2da8484" "0.10.3": url: "https://github.com/eclipse-cyclonedds/cyclonedds/archive/refs/tags/0.10.3.tar.gz" sha256: "bc79696209febfe66d97e7af6b11e92f9db663caf608a922b6c201b1d6a5eb62" @@ -6,6 +9,10 @@ sources: url: "https://github.com/eclipse-cyclonedds/cyclonedds/archive/refs/tags/0.10.2.tar.gz" sha256: "bc84e137e0c8a055b8cd97fbeafec94e36de1b0c2e88800896a82384fd867ae5" patches: + "0.10.4": + - patch_file: "patches/0.10.2-0001-fix-find-iceoryx.patch" + patch_description: "Fix cmake find for iceoryx package" + patch_type: "conan" "0.10.3": - patch_file: "patches/0.10.2-0001-fix-find-iceoryx.patch" patch_description: "Fix cmake find for iceoryx package" 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/cyclonedds/config.yml b/recipes/cyclonedds/config.yml index 6fdde61015259e..b770b060712653 100644 --- a/recipes/cyclonedds/config.yml +++ b/recipes/cyclonedds/config.yml @@ -1,4 +1,6 @@ versions: + "0.10.4": + folder: all "0.10.3": folder: all "0.10.2": diff --git a/recipes/cyrus-sasl/all/conandata.yml b/recipes/cyrus-sasl/all/conandata.yml index 0fe894820dcdfc..d24e3377974b4b 100644 --- a/recipes/cyrus-sasl/all/conandata.yml +++ b/recipes/cyrus-sasl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.28": + url: "https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.28/cyrus-sasl-2.1.28.tar.gz" + sha256: "7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c" "2.1.27": url: "https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.27/cyrus-sasl-2.1.27.tar.gz" sha256: "26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5" diff --git a/recipes/cyrus-sasl/all/conanfile.py b/recipes/cyrus-sasl/all/conanfile.py index 53ce5027335572..d9623fba3aec4a 100644 --- a/recipes/cyrus-sasl/all/conanfile.py +++ b/recipes/cyrus-sasl/all/conanfile.py @@ -80,11 +80,11 @@ def requirements(self): if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_postgresql: - self.requires("libpq/14.7") + self.requires("libpq/15.4") if self.options.with_mysql: - self.requires("libmysqlclient/8.0.31") + self.requires("libmysqlclient/8.1.0") if self.options.with_sqlite3: - self.requires("sqlite3/3.41.1") + self.requires("sqlite3/3.44.2") def validate(self): if self.settings.os == "Windows": diff --git a/recipes/cyrus-sasl/config.yml b/recipes/cyrus-sasl/config.yml index d7a18807b44948..85cdd658d04077 100644 --- a/recipes/cyrus-sasl/config.yml +++ b/recipes/cyrus-sasl/config.yml @@ -1,3 +1,5 @@ versions: + "2.1.28": + folder: "all" "2.1.27": folder: "all" diff --git a/recipes/czmq/all/conanfile.py b/recipes/czmq/all/conanfile.py index 88618f4797ed7c..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") + 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/7.87.0") + 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("libuuid/1.0.3") + 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 daa1ee060995e7..f4f5540f11df5c 100644 --- a/recipes/dacap-clip/all/conandata.yml +++ b/recipes/dacap-clip/all/conandata.yml @@ -1,4 +1,10 @@ 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" "1.5": url: "https://github.com/dacap/clip/archive/refs/tags/v1.5.tar.gz" sha256: "8f6f8a427075a09011fafbb75bfdbf1213e4492a13cff4a70975aab361c99382" diff --git a/recipes/dacap-clip/all/conanfile.py b/recipes/dacap-clip/all/conanfile.py index e2bd672a9b3d1b..c4021d403c55f7 100644 --- a/recipes/dacap-clip/all/conanfile.py +++ b/recipes/dacap-clip/all/conanfile.py @@ -8,7 +8,7 @@ from conan.tools.apple import is_apple_os from conan.tools.build import check_min_cppstd -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.53.0" class DacapClipConan(ConanFile): name = "dacap-clip" @@ -17,6 +17,7 @@ class DacapClipConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/dacap/clip/" topics = ("clipboard", "copy", "paste") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,8 +30,9 @@ class DacapClipConan(ConanFile): "with_png": True, } - def export_sources(self): - copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + @property + def _min_cppstd(self): + return 11 def config_options(self): if self.settings.os == "Windows": @@ -38,10 +40,7 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") if self.settings.os not in ["Linux", "FreeBSD"]: del self.options.with_png @@ -56,12 +55,12 @@ def requirements(self): def validate(self): if self.info.settings.compiler.cppstd: - check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) if is_msvc(self) and self.info.settings.build_type == "Debug" and self.info.options.shared == True: raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC debug shared build (now).") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): toolchain = CMakeToolchain(self) diff --git a/recipes/dacap-clip/all/test_package/CMakeLists.txt b/recipes/dacap-clip/all/test_package/CMakeLists.txt index 63e11b22a301b2..39137234722695 100644 --- a/recipes/dacap-clip/all/test_package/CMakeLists.txt +++ b/recipes/dacap-clip/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(clip REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} clip::clip) +target_link_libraries(${PROJECT_NAME} PRIVATE clip::clip) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/dacap-clip/config.yml b/recipes/dacap-clip/config.yml index 84f49b28508708..f10766e09880a8 100644 --- a/recipes/dacap-clip/config.yml +++ b/recipes/dacap-clip/config.yml @@ -1,3 +1,7 @@ versions: + "1.7": + folder: "all" + "1.6": + folder: "all" "1.5": folder: "all" diff --git a/recipes/dataframe/all/conandata.yml b/recipes/dataframe/all/conandata.yml index 06380e6e2f3cf4..6ea3f55c476e46 100644 --- a/recipes/dataframe/all/conandata.yml +++ b/recipes/dataframe/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/2.2.0.tar.gz" + sha256: "289e8f86c9d468ee62508167c202c34d662915922582af73b9d31691feb2b0af" "2.1.0": url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/2.1.0.tar.gz" sha256: "7f131c608dccd14599e5765e1a919550f08f5c334764f0e20ec181e7e8cbddae" @@ -20,21 +23,6 @@ sources: "1.18.0": url: "https://github.com/hosseinmoein/DataFrame/archive/1.18.0.tar.gz" sha256: "8cdb8b246263fbd8fcef07b6300f6aefb58b3a54cd67e5cbe5383bc948305844" - "1.17.0": - url: "https://github.com/hosseinmoein/DataFrame/archive/1.17.0.tar.gz" - sha256: "669e9663de358330b15eacaa783ccf42fe16db27b9556fdcd18f1114c0335557" - "1.16.0": - url: "https://github.com/hosseinmoein/DataFrame/archive/1.16.0.tar.gz" - sha256: "a5a24ec07fb4761a294a291d7bed7c72e82e2dde8bba8bfc1ca2f68e07afd7fc" - "1.15.0": - url: "https://github.com/hosseinmoein/DataFrame/archive/1.15.0.tar.gz" - sha256: "68eb3fca66dff3f8473722d561e9391800957a09c2c6d4dde5f9ad37cbf88954" - "1.14.0": - url: "https://github.com/hosseinmoein/DataFrame/archive/1.14.0.tar.gz" - sha256: "45991cc16e478b24641d0548aab24fd59ad534ada30fca8776fd9990e1914ac7" - "1.12.0": - url: "https://github.com/hosseinmoein/DataFrame/archive/1.12.0.tar.gz" - sha256: "e951a699bd048bd7a034ac60bdd45f15cf066a04fda33cb22030d192b91a836c" patches: "2.0.0": - patch_file: "patches/2.0.0-0001-use-abs.patch" diff --git a/recipes/dataframe/all/conanfile.py b/recipes/dataframe/all/conanfile.py index d8ecb6217a53ff..33deb412912f9d 100644 --- a/recipes/dataframe/all/conanfile.py +++ b/recipes/dataframe/all/conanfile.py @@ -13,13 +13,13 @@ class DataFrameConan(ConanFile): name = "dataframe" - license = "BSD-3-Clause" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/hosseinmoein/DataFrame" description = ( "C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ " "using native types, continuous memory storage, and no pointers are involved" ) + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hosseinmoein/DataFrame" topics = ( "dataframe", "data-science", @@ -37,7 +37,6 @@ class DataFrameConan(ConanFile): "financial-engineering", "large-data", ) - package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -72,8 +71,6 @@ def _minimum_compilers_version(self): }, }.get(self._min_cppstd, {}) - return {} - def export_sources(self): export_conandata_patches(self) @@ -94,13 +91,20 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - 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." ) + if Version(self.version) >= "2.2.0": + if (self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "13.0.0" and \ + self.settings.compiler.libcxx == "libc++"): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang < 13.0.0 with libc++.") + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14.0.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support apple-clang < 14.0.0.") + + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/dataframe/all/test_package/CMakeLists.txt b/recipes/dataframe/all/test_package/CMakeLists.txt index 541c6ae64fbf1c..b1fa419a617f6a 100644 --- a/recipes/dataframe/all/test_package/CMakeLists.txt +++ b/recipes/dataframe/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.12) project(test_package LANGUAGES CXX) find_package(DataFrame REQUIRED CONFIG) diff --git a/recipes/dataframe/config.yml b/recipes/dataframe/config.yml index 0bd7dd9ecfa099..7972770297f04b 100644 --- a/recipes/dataframe/config.yml +++ b/recipes/dataframe/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.0": + folder: all "2.1.0": folder: all "2.0.0": @@ -13,13 +15,3 @@ versions: folder: all "1.18.0": folder: all - "1.17.0": - folder: all - "1.16.0": - folder: all - "1.15.0": - folder: all - "1.14.0": - folder: all - "1.12.0": - folder: all diff --git a/recipes/date/all/conanfile.py b/recipes/date/all/conanfile.py index a42b06fc8f951c..315ca73f8ae1fb 100644 --- a/recipes/date/all/conanfile.py +++ b/recipes/date/all/conanfile.py @@ -16,7 +16,7 @@ class DateConan(ConanFile): description = "A date and time library based on the C++11/14/17 header" topics = ("datetime", "timezone", "calendar", "time", "iana-database") license = "MIT" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -47,13 +47,14 @@ def configure(self): self.options.rm_safe("fPIC") if self.options.header_only: del self.options.shared + self.package_type = "header-library" def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if not self.options.header_only and not self.options.use_system_tz_db: - self.requires("libcurl/8.0.1") + self.requires("libcurl/[>=7.78 <9]") def package_id(self): if self.info.options.header_only: @@ -106,20 +107,19 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "CMake")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "date") self.cpp_info.set_property("cmake_target_name", "date::date") - # TODO: Remove legacy .names attribute when conan 2.0 is released - self.cpp_info.names["cmake_find_package"] = "date" - self.cpp_info.names["cmake_find_package_multi"] = "date" # date-tz - if not self.options.header_only: + if self.options.header_only: + self.cpp_info.bindirs = [] + self.cpp_info.defines.append("DATE_HEADER_ONLY") + self.cpp_info.libdirs = [] + else: self.cpp_info.components["date-tz"].set_property("cmake_target_name", "date::date-tz") - # TODO: Remove legacy .names attribute when conan 2.0 is released - self.cpp_info.components["date-tz"].names["cmake_find_package"] = "date-tz" - self.cpp_info.components["date-tz"].names["cmake_find_package_multi"] = "date-tz" lib_name = "{}tz".format("date-" if Version(self.version) >= "3.0.0" else "") self.cpp_info.components["date-tz"].libs = [lib_name] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["date-tz"].system_libs.append("pthread") self.cpp_info.components["date-tz"].system_libs.append("m") @@ -136,5 +136,3 @@ def package_info(self): defines.append("DATE_USE_DLL=1") self.cpp_info.components["date-tz"].defines.extend(defines) - else: - self.cpp_info.defines.append("DATE_HEADER_ONLY") diff --git a/recipes/dav1d/all/conandata.yml b/recipes/dav1d/all/conandata.yml index 960fc25c0f85a4..7841b712b35c99 100644 --- a/recipes/dav1d/all/conandata.yml +++ b/recipes/dav1d/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.1": + url: "http://ftp.videolan.org/pub/videolan/dav1d/1.2.1/dav1d-1.2.1.tar.xz" + sha256: "4e33eb61ec54c768a16da0cf8fa0928b4c4593f5f804a3c887d4a21c318340b2" "1.1.0": url: "http://ftp.videolan.org/pub/videolan/dav1d/1.1.0/dav1d-1.1.0.tar.xz" sha256: "fb57aae7875f28c30fb3dbae4a3683d27e2f91dde09ce5c60c22cef9bc58dfd1" diff --git a/recipes/dav1d/all/conanfile.py b/recipes/dav1d/all/conanfile.py index 8a1651ceed7087..5882f930a7dbde 100644 --- a/recipes/dav1d/all/conanfile.py +++ b/recipes/dav1d/all/conanfile.py @@ -58,7 +58,7 @@ def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): - self.tool_requires("meson/1.1.0") + self.tool_requires("meson/1.2.1") if self.options.assembly: self.tool_requires("nasm/2.15.05") diff --git a/recipes/dav1d/config.yml b/recipes/dav1d/config.yml index 1807dabd0bac46..2ef77329e43db9 100644 --- a/recipes/dav1d/config.yml +++ b/recipes/dav1d/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.1": + folder: "all" "1.1.0": folder: "all" "1.0.0": diff --git a/recipes/daw_header_libraries/all/conandata.yml b/recipes/daw_header_libraries/all/conandata.yml index 29376e7702ee0c..f07d3ecdd0bdb8 100644 --- a/recipes/daw_header_libraries/all/conandata.yml +++ b/recipes/daw_header_libraries/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.96.1": + url: "https://github.com/beached/header_libraries/archive/v2.96.1.tar.gz" + sha256: "2a9a5c33baa9e3adc1d82fa13a56522638af13cc39372a0c1c8f5c5d984f1464" + "2.95.0": + url: "https://github.com/beached/header_libraries/archive/v2.95.0.tar.gz" + sha256: "8799c06f0587b202fd6049d95e70b04675acbfdbf6e86ac3bbd061cbb9d42b54" "2.93.1": url: "https://github.com/beached/header_libraries/archive/v2.93.1.tar.gz" sha256: "200690094237e4a2c37ac81c23c8c5138ba90ccdeeb2a1dda37690a9d32301ad" @@ -23,18 +29,3 @@ sources: "2.74.2": url: "https://github.com/beached/header_libraries/archive/v2.74.2.tar.gz" sha256: "32871df3d314cc9b4e293a9a8c79968d1c963dfd3dd60965dbf704eb18acb218" - "2.73.1": - url: "https://github.com/beached/header_libraries/archive/v2.73.1.tar.gz" - sha256: "62bd26398afa7eba1aae7bbbf107865044b8be0539d266085c36aed82557ae07" - "2.72.0": - url: "https://github.com/beached/header_libraries/archive/v2.72.0.tar.gz" - sha256: "f681755183af4af35f4741f3bcb7d99c6707911806e39e3acc982f9532aacc08" - "2.71.0": - url: "https://github.com/beached/header_libraries/archive/v2.71.0.tar.gz" - sha256: "50b9ddebdbc808a5714408a45f686fafe9d1d3b78c988df3973c12c9928828b9" - "2.68.3": - url: "https://github.com/beached/header_libraries/archive/v2.68.3.tar.gz" - sha256: "9bb7d25d161b89ad4a0ac857c28734c061cf53f6e80212c7fe70b8e0fd14789f" - "1.29.7": - url: "https://github.com/beached/header_libraries/archive/refs/tags/v1.29.7.tar.gz" - sha256: "524c34f3f5d2af498e7bcaff7802b914ba42acde29f7e3ecce41a035db0bf5bd" diff --git a/recipes/daw_header_libraries/config.yml b/recipes/daw_header_libraries/config.yml index 1983a1c07c0153..e5da3ea85fe212 100644 --- a/recipes/daw_header_libraries/config.yml +++ b/recipes/daw_header_libraries/config.yml @@ -1,4 +1,8 @@ versions: + "2.96.1": + folder: all + "2.95.0": + folder: all "2.93.1": folder: all "2.92.0": @@ -15,13 +19,3 @@ versions: folder: all "2.74.2": folder: all - "2.73.1": - folder: all - "2.72.0": - folder: all - "2.71.0": - folder: all - "2.68.3": - folder: all - "1.29.7": - folder: all diff --git a/recipes/daw_json_link/all/conandata.yml b/recipes/daw_json_link/all/conandata.yml index c72c7afca87692..3262aaa6ca6666 100644 --- a/recipes/daw_json_link/all/conandata.yml +++ b/recipes/daw_json_link/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.23.0": + url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.23.0.tar.gz" + sha256: "a01e9a3a48784a47dbb60bd21ecbe7e05a7d30cec75ea6d55b1789f6aefe5f05" + "3.20.1": + url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.20.1.tar.gz" + sha256: "046638bc4437d138cc8bdc882027d318ca3e267f33d1b419c5bdecb45b595a47" "3.19.0": url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.19.0.tar.gz" sha256: "85c2f6a84878925eb692c53b321b9b237481969c8caa3a9324b78540096a3559" diff --git a/recipes/daw_json_link/all/conanfile.py b/recipes/daw_json_link/all/conanfile.py index 7a1455d0e9bdad..a22aa6b41c06b3 100644 --- a/recipes/daw_json_link/all/conanfile.py +++ b/recipes/daw_json_link/all/conanfile.py @@ -39,7 +39,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("daw_header_libraries/2.93.1") + self.requires("daw_header_libraries/2.96.1") self.requires("daw_utf_range/2.2.3") def package_id(self): diff --git a/recipes/daw_json_link/config.yml b/recipes/daw_json_link/config.yml index b1d3c03d355078..cd93a25c552553 100644 --- a/recipes/daw_json_link/config.yml +++ b/recipes/daw_json_link/config.yml @@ -1,4 +1,8 @@ versions: + "3.23.0": + folder: "all" + "3.20.1": + folder: "all" "3.19.0": folder: "all" "3.17.2": diff --git a/recipes/daw_utf_range/all/conanfile.py b/recipes/daw_utf_range/all/conanfile.py index 98739a79d16226..23fff04d5723fe 100644 --- a/recipes/daw_utf_range/all/conanfile.py +++ b/recipes/daw_utf_range/all/conanfile.py @@ -38,7 +38,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("daw_header_libraries/2.93.1") + self.requires("daw_header_libraries/2.96.1") def package_id(self): self.info.clear() diff --git a/recipes/dbg-macro/all/conandata.yml b/recipes/dbg-macro/all/conandata.yml index 695393e722d3f4..3c855c0c751259 100644 --- a/recipes/dbg-macro/all/conandata.yml +++ b/recipes/dbg-macro/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.5.1": + url: "https://github.com/sharkdp/dbg-macro/archive/v0.5.1.tar.gz" + sha256: "fffea75f067c69995853dc790626887788e2c4c9eb0a5a0014a4501d2b6b9909" + "0.5.0": + url: "https://github.com/sharkdp/dbg-macro/archive/v0.5.0.tar.gz" + sha256: "dac4907aadf39dbd9eac279a214c59ad30af6c0c3d585688242f73cb1a9ce243" "0.4.0": - sha256: e44a1206fbfd1d3dc8ad649f387df479d288b08c80cf2f1239ccb4e26148d781 - url: https://github.com/sharkdp/dbg-macro/archive/v0.4.0.tar.gz + url: "https://github.com/sharkdp/dbg-macro/archive/v0.4.0.tar.gz" + sha256: "e44a1206fbfd1d3dc8ad649f387df479d288b08c80cf2f1239ccb4e26148d781" diff --git a/recipes/dbg-macro/all/conanfile.py b/recipes/dbg-macro/all/conanfile.py index 7fdad007c10704..c4b00757159daa 100644 --- a/recipes/dbg-macro/all/conanfile.py +++ b/recipes/dbg-macro/all/conanfile.py @@ -1,41 +1,58 @@ import os + from conan import ConanFile -from conan.tools.files import get, copy -from conan.tools.build import check_min_cppstd 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 DbgMacroConan(ConanFile): name = "dbg-macro" + description = "A dbg(...) macro for C++" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/sharkdp/dbg-macro" - license = "MIT" - description = "A dbg(...) macro for C++" topics = ("debugging", "macro", "pretty-printing", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 17 - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.get_safe('cppstd'): - check_min_cppstd(self, 17) + check_min_cppstd(self, self._min_cppstd) - min_versions = { - "gcc": 8 - } + 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." + ) - compiler = self.settings.compiler - if str(compiler) in min_versions and Version(compiler.version) < min_versions[str(compiler)]: - raise ConanInvalidConfiguration("dbg-macro requires C++17 which your compiler does not support.") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "dbg.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - def package_id(self): - self.info.clear() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/dbg-macro/all/test_package/CMakeLists.txt b/recipes/dbg-macro/all/test_package/CMakeLists.txt index 38914f6edfd7d4..535b1e583d6c52 100644 --- a/recipes/dbg-macro/all/test_package/CMakeLists.txt +++ b/recipes/dbg-macro/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 CXX) find_package(dbg-macro REQUIRED CONFIG) diff --git a/recipes/dbg-macro/all/test_package/conanfile.py b/recipes/dbg-macro/all/test_package/conanfile.py index 61ef483bce0670..2ee2f747a7393e 100644 --- a/recipes/dbg-macro/all/test_package/conanfile.py +++ b/recipes/dbg-macro/all/test_package/conanfile.py @@ -1,16 +1,14 @@ import os from conan import ConanFile +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout -from conan.tools.build import cross_building, can_run -from conan.tools.files import mkdir class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "CMakeToolchain" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" - def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/dbg-macro/all/test_v1_package/CMakeLists.txt b/recipes/dbg-macro/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/dbg-macro/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/dbg-macro/all/test_v1_package/conanfile.py b/recipes/dbg-macro/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..e9e25c6e641afe --- /dev/null +++ b/recipes/dbg-macro/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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): + tools.mkdir("logs/") + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/dbg-macro/config.yml b/recipes/dbg-macro/config.yml index da269653d6e6bc..e820923f0c236b 100644 --- a/recipes/dbg-macro/config.yml +++ b/recipes/dbg-macro/config.yml @@ -1,3 +1,7 @@ versions: + "0.5.1": + folder: "all" + "0.5.0": + folder: "all" "0.4.0": folder: "all" diff --git a/recipes/dbus/1.x.x/conandata.yml b/recipes/dbus/1.x.x/conandata.yml index c3b193cfa06c5e..04a0982deff4bf 100644 --- a/recipes/dbus/1.x.x/conandata.yml +++ b/recipes/dbus/1.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.15.8": + url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.15.8.tar.xz" + sha256: "84fc597e6ec82f05dc18a7d12c17046f95bad7be99fc03c15bc254c4701ed204" "1.15.6": url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.15.6.tar.xz" sha256: "f97f5845f9c4a5a1fb3df67dfa9e16b5a3fd545d348d6dc850cb7ccc9942bd8c" @@ -8,12 +11,6 @@ sources: "1.15.0": url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.15.0.tar.xz" sha256: "5073c8cb9ad20226647bb38f4965182b762a6e1f595ccdc8e59411014bfd640a" - "1.14.0": - url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.14.0.tar.xz" - sha256: "ccd7cce37596e0a19558fd6648d1272ab43f011d80c8635aea8fd0bad58aebd4" - "1.12.20": - url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.12.20.tar.gz" - sha256: "f77620140ecb4cdc67f37fb444f8a6bea70b5b6461f12f1cbe2cec60fa7de5fe" patches: "1.15.2": - patch_file: "patches/0003-meson-monotonic-clock-check.patch" @@ -25,9 +22,3 @@ patches: patch_type: "portability" patch_description: "Fix detection of necessary monotonic clock functions in pthread" patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/352" - "1.12.20": - - patch_file: "patches/0001-cmake-project.patch" - - patch_file: "patches/0002-cmake_configure_checks_list_separator.patch" - patch_type: "portability" - url: "https://gitlab.freedesktop.org/dbus/dbus/-/commit/8cd1c2155252938ed38d2612e4d054c7fc0244c3.patch" - patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/issues/324" diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index 7be295c8d86058..c20fd3f03b189c 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -1,7 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name, is_apple_os -from conan.tools.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save from conan.tools.gnu import PkgConfigDeps @@ -21,10 +20,12 @@ class DbusConan(ConanFile): homepage = "https://www.freedesktop.org/wiki/Software/dbus" description = "D-Bus is a simple system for interprocess communication and coordination." topics = "bus", "interprocess", "message" - package_type = "shared-library" + package_type = "library" settings = "os", "arch", "compiler", "build_type" short_paths = True options = { + "shared": [True, False], + "fPIC": [True, False], "system_socket": [None, "ANY"], "system_pid_file": [None, "ANY"], "with_x11": [True, False], @@ -34,6 +35,8 @@ class DbusConan(ConanFile): "session_socket_dir": ["ANY"], } default_options = { + "shared": False, + "fPIC": True, "system_socket": None, "system_pid_file": None, "with_x11": False, @@ -43,28 +46,25 @@ class DbusConan(ConanFile): "session_socket_dir": "/tmp", } - @property - def _meson_available(self): - return Version(self.version) >= "1.15.0" - def export_sources(self): export_conandata_patches(self) def config_options(self): - if self.settings.os not in ("Linux", "FreeBSD") or Version(self.version) < "1.14.0": + if self.settings.os not in ("Linux", "FreeBSD"): del self.options.with_systemd if self.settings.os not in ("Linux", "FreeBSD"): del self.options.with_x11 + if self.settings.os == "Windows": + del self.options.fPIC def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if self.options.shared: + self.options.rm_safe("fPIC") def layout(self): - if self._meson_available: - basic_layout(self, src_folder="src") - else: - cmake_layout(self, src_folder="src") + basic_layout(self, src_folder="src") def requirements(self): self.requires("expat/2.5.0") @@ -78,19 +78,13 @@ def requirements(self): self.requires("xorg/system") def validate(self): - if Version(self.version) >= "1.14.0": - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 7: - raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.") - - if not self._meson_available and self.settings.os == "Windows": - raise ConanInvalidConfiguration(f"{self.ref} does not support Windows. Contributions welcome.") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 7: + raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.") def build_requirements(self): - if self._meson_available: - self.tool_requires("meson/1.2.0") - if self._meson_available or self.options.get_safe("with_systemd"): - if not self.conf.get("tools.gnu:pkg_config",check_type=str): - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("meson/1.2.0") + if not self.conf.get("tools.gnu:pkg_config",check_type=str): + self.tool_requires("pkgconf/1.9.5") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -98,77 +92,38 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if self._meson_available: - tc = MesonToolchain(self) - tc.project_options["asserts"] = not is_apple_os(self) - tc.project_options["checks"] = False - tc.project_options["doxygen_docs"] = "disabled" - tc.project_options["modular_tests"] = "disabled" - tc.project_options["system_socket"] = str(self.options.get_safe("system_socket", "")) - tc.project_options["system_pid_file"] = str(self.options.get_safe("system_pid_file", "")) - tc.project_options["session_socket_dir"] = str(self.options.get_safe("session_socket_dir", "")) - tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux", False) else "disabled" - tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd", False) else "disabled" - if self.options.get_safe("with_systemd", False): - tc.project_options["systemd_system_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "system") - tc.project_options["systemd_user_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "user") - if is_apple_os(self): - tc.project_options["launchd_agent_dir"] = os.path.join(self.package_folder, "res", "LaunchAgents") - tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11", False) else "disabled" - tc.project_options["xml_docs"] = "disabled" - tc.generate() - deps = PkgConfigDeps(self) - deps.generate() - else: - tc = CMakeToolchain(self) - tc.variables["DBUS_BUILD_TESTS"] = False - tc.variables["DBUS_ENABLE_DOXYGEN_DOCS"] = False - tc.variables["DBUS_ENABLE_XML_DOCS"] = False - tc.variables["DBUS_BUILD_X11"] = bool(self.options.get_safe("with_x11", False)) - tc.variables["ENABLE_SYSTEMD"] = "ON" if self.options.get_safe("with_systemd", False) else "OFF" - tc.variables["DBUS_WITH_GLIB"] = bool(self.options.get_safe("with_glib", False)) - tc.variables["DBUS_DISABLE_ASSERT"] = is_apple_os(self) - tc.variables["DBUS_DISABLE_CHECKS"] = False - tc.variables["DBUS_SYSTEM_BUS_DEFAULT_ADDRESS"] = str(self.options.get_safe("system_socket", "")) - - # Conan does not provide an EXPAT_LIBRARIES CMake variable for the Expat library. - # Define EXPAT_LIBRARIES to be the expat::expat target provided by Conan to fix linking. - tc.variables["EXPAT_LIBRARIES"] = "expat::expat" - - # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a - tc.variables["DBUS_SESSION_SOCKET_DIR"] = str(self.options.get_safe("session_socket_dir", "")) - - tc.cache_variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = False - tc.generate() - cmake_deps = CMakeDeps(self) - cmake_deps.generate() - if self.options.get_safe("with_systemd"): - deps = PkgConfigDeps(self) - deps.generate() + tc = MesonToolchain(self) + tc.project_options["asserts"] = not is_apple_os(self) + tc.project_options["checks"] = False + tc.project_options["doxygen_docs"] = "disabled" + tc.project_options["modular_tests"] = "disabled" + tc.project_options["system_socket"] = str(self.options.get_safe("system_socket", "")) + tc.project_options["system_pid_file"] = str(self.options.get_safe("system_pid_file", "")) + tc.project_options["session_socket_dir"] = str(self.options.get_safe("session_socket_dir", "")) + tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux", False) else "disabled" + tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd", False) else "disabled" + if self.options.get_safe("with_systemd", False): + tc.project_options["systemd_system_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "system") + tc.project_options["systemd_user_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "user") + if is_apple_os(self): + tc.project_options["launchd_agent_dir"] = os.path.join(self.package_folder, "res", "LaunchAgents") + tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11", False) else "disabled" + tc.project_options["xml_docs"] = "disabled" + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) - if self._meson_available: - replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('test')", "# subdir('test')") - meson = Meson(self) - meson.configure() - meson.build() - else: - cmake = CMake(self) - build_script_folder = None - if Version(self.version) < "1.14.0": - build_script_folder = "cmake" - cmake.configure(build_script_folder=build_script_folder) - cmake.build() + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('test')", "# subdir('test')") + meson = Meson(self) + meson.configure() + meson.build() def package(self): copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - if self._meson_available: - meson = Meson(self) - meson.install() - else: - cmake = CMake(self) - cmake.install() + meson = Meson(self) + meson.install() rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) rmdir(self, os.path.join(self.package_folder, "share", "doc")) @@ -180,6 +135,8 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "systemd")) fix_apple_shared_install_name(self) + if self.settings.os == "Windows" and not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libdbus-1.a"), os.path.join(self.package_folder, "lib", "dbus-1.lib")) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self._create_cmake_module_alias_targets( @@ -219,6 +176,9 @@ def package_info(self): else: self.cpp_info.system_libs.append("pthread") + if not self.options.shared: + self.cpp_info.defines.append("DBUS_STATIC_BUILD") + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.filenames["cmake_find_package"] = "DBus1" self.cpp_info.filenames["cmake_find_package_multi"] = "DBus1" diff --git a/recipes/dbus/1.x.x/patches/0001-cmake-project.patch b/recipes/dbus/1.x.x/patches/0001-cmake-project.patch deleted file mode 100644 index 2d00f57d33527d..00000000000000 --- a/recipes/dbus/1.x.x/patches/0001-cmake-project.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -1,10 +1,3 @@ --# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked --list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") -- --# we do not need to have WIN32 defined --set(CMAKE_LEGACY_CYGWIN_WIN32 0) -- --project(dbus) - - # we need to be up to date - CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2 FATAL_ERROR) -@@ -19,6 +12,9 @@ if(CMAKE_MAJOR_VERSION GREATER 2) - cmake_policy(SET CMP0054 NEW) - endif() - endif() -+set(CMAKE_LEGACY_CYGWIN_WIN32 0) -+project(dbus) -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") - - # detect version - include(MacrosAutotools) diff --git a/recipes/dbus/1.x.x/patches/0002-cmake_configure_checks_list_separator.patch b/recipes/dbus/1.x.x/patches/0002-cmake_configure_checks_list_separator.patch deleted file mode 100644 index 7c60bf52d5ec22..00000000000000 --- a/recipes/dbus/1.x.x/patches/0002-cmake_configure_checks_list_separator.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake -index a9a5fc90..1a59461a 100644 ---- a/cmake/ConfigureChecks.cmake -+++ b/cmake/ConfigureChecks.cmake -@@ -43,7 +43,7 @@ check_symbol_exists(backtrace "execinfo.h" HAVE_BACKTRACE) # - check_symbol_exists(getgrouplist "grp.h" HAVE_GETGROUPLIST) # dbus-sysdeps.c - check_symbol_exists(getpeerucred "ucred.h" HAVE_GETPEERUCRED) # dbus-sysdeps.c, dbus-sysdeps-win.c - check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP) # dbus-sysdeps.c --check_symbol_exists(getpwnam_r "errno.h pwd.h" HAVE_POSIX_GETPWNAM_R) # dbus-sysdeps-util-unix.c -+check_symbol_exists(getpwnam_r "errno.h;pwd.h" HAVE_POSIX_GETPWNAM_R) # dbus-sysdeps-util-unix.c - check_symbol_exists(setenv "stdlib.h" HAVE_SETENV) # dbus-sysdeps.c - check_symbol_exists(unsetenv "stdlib.h" HAVE_UNSETENV) # dbus-sysdeps.c - check_symbol_exists(clearenv "stdlib.h" HAVE_CLEARENV) # dbus-sysdeps.c -@@ -66,7 +66,7 @@ check_symbol_exists(getrlimit "sys/resource.h;sys/time.h" HAVE_GETRLIMIT) - check_symbol_exists(prlimit "sys/resource.h;sys/time.h" HAVE_PRLIMIT) - check_symbol_exists(setrlimit "sys/resource.h;sys/time.h" HAVE_SETRLIMIT) - --check_struct_member(cmsgcred cmcred_pid "sys/types.h sys/socket.h" HAVE_CMSGCRED) # dbus-sysdeps.c -+check_struct_member(cmsgcred cmcred_pid "sys/types.h;sys/socket.h" HAVE_CMSGCRED) # dbus-sysdeps.c - - # missing: - # DBUS_HAVE_GCC33_GCOV diff --git a/recipes/dbus/config.yml b/recipes/dbus/config.yml index b9caba7b443496..a6d5fb2e5d5f7f 100644 --- a/recipes/dbus/config.yml +++ b/recipes/dbus/config.yml @@ -1,11 +1,9 @@ versions: + "1.15.8": + folder: 1.x.x "1.15.6": folder: 1.x.x "1.15.2": folder: 1.x.x "1.15.0": folder: 1.x.x - "1.14.0": - folder: 1.x.x - "1.12.20": - folder: 1.x.x diff --git a/recipes/dcmtk/all/CMakeLists.txt b/recipes/dcmtk/all/CMakeLists.txt deleted file mode 100644 index 56b7606e716f95..00000000000000 --- a/recipes/dcmtk/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 KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/dcmtk/all/conandata.yml b/recipes/dcmtk/all/conandata.yml index 7e3e0a0cc6e011..7ae433b2e0c081 100644 --- a/recipes/dcmtk/all/conandata.yml +++ b/recipes/dcmtk/all/conandata.yml @@ -2,25 +2,11 @@ sources: "3.6.7": url: "https://dicom.offis.de/download/dcmtk/dcmtk367/dcmtk-3.6.7.tar.gz" sha256: "7c58298e3e8d60232ee6fc8408cfadd14463cc11a3c4ca4c59af5988c7e9710a" - "3.6.6": - url: "https://dicom.offis.de/download/dcmtk/dcmtk366/dcmtk-3.6.6.tar.gz" - sha256: "6859c62b290ee55677093cccfd6029c04186d91cf99c7642ae43627387f3458e" - "3.6.5": - url: "https://dicom.offis.de/download/dcmtk/dcmtk365/dcmtk-3.6.5.tar.gz" - sha256: "a05178665f21896dbb0974106dba1ad144975414abd760b4cf8f5cc979f9beb9" patches: "3.6.7": - - patch_file: "patches/cmake-patching-3-6-7.patch" - base_path: "source_subfolder" + - patch_file: "patches/3.6.7-0001-cmake-robust-deps-handling.patch" + patch_description: "CMake: robust discovery with find_package() and use imported targets" patch_type: conan - patch_description: "Don't ignore dependencies that can't be found; patch some variable names" - "3.6.6": - - patch_file: "patches/0002-cmake-use-conan-packages.patch" - base_path: "source_subfolder" + - patch_file: "patches/3.6.7-0002-cmake-check-openssl-symbol.patch" + patch_description: "CMake: fix OpenSSL compatibility checks" patch_type: conan - patch_description: "Don't ignore dependencies that can't be found; patch some variable names" - "3.6.5": - - patch_file: "patches/0001-cmake-use-conan-packages.patch" - base_path: "source_subfolder" - patch_type: conan - patch_description: "Don't ignore dependencies that can't be found; patch some variable names" diff --git a/recipes/dcmtk/all/conanfile.py b/recipes/dcmtk/all/conanfile.py index 286fb28a07048c..6980bbc99c18d5 100644 --- a/recipes/dcmtk/all/conanfile.py +++ b/recipes/dcmtk/all/conanfile.py @@ -1,15 +1,14 @@ -from conans import CMake +import os +import textwrap + from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save -from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conan.tools.scm import Version -import functools -import os -import textwrap +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.microsoft import is_msvc, is_msvc_static_runtime -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class DCMTKConan(ConanFile): @@ -19,7 +18,7 @@ class DCMTKConan(ConanFile): homepage = "https://dicom.offis.de/dcmtk" license = "BSD-3-Clause" topics = ("dicom", "image") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -33,9 +32,11 @@ class DCMTKConan(ConanFile): "with_libpng": [True, False], "with_libtiff": [True, False], "with_tcpwrappers": [True, False], - "builtin_dictionary": [None, True, False], + "default_dict": ["builtin", "external", "none"], + "builtin_dictionary": [None, True, False, "deprecated"], + "use_dcmdictpath": [True, False], "builtin_private_tags": [True, False], - "external_dictionary": [None, True, False], + "external_dictionary": [None, True, False, "deprecated"], "wide_io": [True, False], "enable_stl": [True, False], } @@ -51,58 +52,67 @@ class DCMTKConan(ConanFile): "with_libpng": True, "with_libtiff": True, "with_tcpwrappers": False, - "builtin_dictionary": None, + "default_dict": "external", + "builtin_dictionary": "deprecated", + "use_dcmdictpath": True, "builtin_private_tags": False, - "external_dictionary": None, + "external_dictionary": "deprecated", "wide_io": False, "enable_stl": True, } - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") self.options.rm_safe("with_tcpwrappers") + self.options.default_dict = "builtin" def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + # Deprecated options + if self.options.builtin_dictionary != "deprecated": + self.output.warning("builtin_dictionary option is deprecated. Use default_dict option instead.") + if self.options.builtin_dictionary: + self.options.default_dict = "builtin" + elif self.options.builtin_dictionary == False: + self.options.default_dict = "external" + if self.options.external_dictionary != "deprecated": + self.output.warning("external_dictionary option is deprecated. Use use_dcmdictpath option instead.") + if self.options.external_dictionary: + self.options.use_dcmdictpath = True + elif self.options.external_dictionary == False: + self.options.use_dcmdictpath = False + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.charset_conversion == "libiconv": self.requires("libiconv/1.17") elif self.options.charset_conversion == "icu": - self.requires("icu/72.1") + self.requires("icu/73.2") if self.options.with_libxml2: - self.requires("libxml2/2.10.3") + self.requires("libxml2/2.11.4") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_openssl: - if self.settings.os == "Windows": - # FIXME: CMake configuration fails to detect Openssl 1.1 on Windows. - self.requires("openssl/1.0.2u") - else: - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1 <4]") if self.options.with_libpng: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_libtiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.6.0") if self.options.get_safe("with_tcpwrappers"): self.requires("tcp-wrappers/7.6") + def package_id(self): + # Deprecated options don't contribute to package id + del self.info.options.builtin_dictionary + del self.info.options.external_dictionary + def validate(self): if hasattr(self, "settings_build") and cross_building(self) and \ self.settings.os == "Macos" and self.settings.arch == "armv8": @@ -110,90 +120,128 @@ def validate(self): raise ConanInvalidConfiguration("Cross building to Macos M1 is not supported (yet)") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + tc = CMakeToolchain(self) # DICOM Data Dictionaries are required - cmake.definitions["CMAKE_INSTALL_DATADIR"] = self._dcm_datadictionary_path - - cmake.definitions["BUILD_APPS"] = self.options.with_applications - cmake.definitions["DCMTK_WITH_ICONV"] = self.options.charset_conversion == "libiconv" - if self.options.charset_conversion == "libiconv": - cmake.definitions["WITH_LIBICONVINC"] = self.deps_cpp_info["libiconv"].rootpath - cmake.definitions["DCMTK_WITH_ICU"] = self.options.charset_conversion == "icu" - cmake.definitions["DCMTK_WITH_OPENJPEG"] = False - cmake.definitions["DCMTK_WITH_OPENSSL"] = self.options.with_openssl - if self.options.with_openssl: - cmake.definitions["WITH_OPENSSLINC"] = self.deps_cpp_info["openssl"].rootpath - cmake.definitions["DCMTK_WITH_PNG"] = self.options.with_libpng - if self.options.with_libpng: - cmake.definitions["WITH_LIBPNGINC"] = self.deps_cpp_info["libpng"].rootpath - cmake.definitions["DCMTK_WITH_SNDFILE"] = False - cmake.definitions["DCMTK_WITH_THREADS"] = self.options.with_multithreading - cmake.definitions["DCMTK_WITH_TIFF"] = self.options.with_libtiff - if self.options.with_libtiff: - cmake.definitions["WITH_LIBTIFFINC"] = self.deps_cpp_info["libtiff"].rootpath + tc.variables["CMAKE_INSTALL_DATADIR"] = self._dcm_datadictionary_path.replace("\\", "/") + tc.cache_variables["DCMTK_USE_FIND_PACKAGE"] = True + tc.variables["BUILD_APPS"] = self.options.with_applications + tc.variables["DCMTK_WITH_TIFF"] = self.options.with_libtiff + tc.variables["DCMTK_WITH_PNG"] = self.options.with_libpng + tc.variables["DCMTK_WITH_XML"] = self.options.with_libxml2 + tc.variables["DCMTK_WITH_ZLIB"] = self.options.with_zlib + tc.variables["DCMTK_WITH_OPENSSL"] = self.options.with_openssl + tc.variables["DCMTK_WITH_SNDFILE"] = False # not used at all, do not try to add an option for this one + tc.variables["DCMTK_WITH_ICONV"] = self.options.charset_conversion == "libiconv" + tc.variables["DCMTK_WITH_ICU"] = self.options.charset_conversion == "icu" if self.settings.os != "Windows": - cmake.definitions["DCMTK_WITH_WRAP"] = self.options.with_tcpwrappers - cmake.definitions["DCMTK_WITH_XML"] = self.options.with_libxml2 - if self.options.with_libxml2: - cmake.definitions["WITH_LIBXMLINC"] = self.deps_cpp_info["libxml2"].rootpath - cmake.definitions["WITH_LIBXML_SHARED"] = self.options["libxml2"].shared - cmake.definitions["DCMTK_WITH_ZLIB"] = self.options.with_zlib - if self.options.with_zlib: - cmake.definitions["WITH_ZLIBINC"] = self.deps_cpp_info["zlib"].rootpath - - if self.options.enable_stl: - cmake.definitions["DCMTK_ENABLE_STL"] = "ON" - else: - cmake.definitions["DCMTK_ENABLE_STL"] = "OFF" - cmake.definitions["DCMTK_ENABLE_CXX11"] = True - - cmake.definitions["DCMTK_ENABLE_MANPAGE"] = False - cmake.definitions["DCMTK_WITH_DOXYGEN"] = False - - cmake.definitions["DCMTK_ENABLE_PRIVATE_TAGS"] = self.options.builtin_private_tags - if self.options.external_dictionary is not None: - if Version(self.version) < "3.6.7": - cmake.definitions["DCMTK_ENABLE_EXTERNAL_DICTIONARY"] = self.options.external_dictionary - else: - cmake.definitions["DCMTK_DEFAULT_DICT"] = self.options.external_dictionary - if self.options.builtin_dictionary is not None: - cmake.definitions["DCMTK_ENABLE_BUILTIN_DICTIONARY"] = self.options.builtin_dictionary - cmake.definitions["DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS"] = self.options.wide_io - cmake.definitions["DCMTK_WIDE_CHAR_MAIN_FUNCTION"] = self.options.wide_io - + tc.variables["DCMTK_WITH_WRAP"] = self.options.with_tcpwrappers + tc.variables["DCMTK_WITH_OPENJPEG"] = False # not used at all, do not try to add an option for this one + tc.variables["DCMTK_ENABLE_PRIVATE_TAGS"] = self.options.builtin_private_tags + tc.variables["DCMTK_WITH_THREADS"] = self.options.with_multithreading + tc.variables["DCMTK_WITH_DOXYGEN"] = False + tc.variables["DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS"] = self.options.wide_io + tc.variables["DCMTK_WIDE_CHAR_MAIN_FUNCTION"] = self.options.wide_io + # Upstream CMakeLists really expects ON value and no other value (like TRUE) in its internal logic + # to enable STL features (see DCMTK_TEST_ENABLE_STL_FEATURE() function in CMake/GenerateDCMTKConfigure.cmake) + tc.variables["DCMTK_ENABLE_STL"] = "ON" if self.options.enable_stl else "OFF" + tc.variables["DCMTK_ENABLE_CXX11"] = True + tc.variables["DCMTK_ENABLE_MANPAGE"] = False + tc.cache_variables["DCMTK_DEFAULT_DICT"] = self.options.default_dict + tc.variables["DCMTK_USE_DCMDICTPATH"] = self.options.use_dcmdictpath if self.settings.os == "Windows": - cmake.definitions["DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS"] = False - + tc.variables["DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS"] = False if is_msvc(self): - cmake.definitions["DCMTK_ICONV_FLAGS_ANALYZED"] = True - cmake.definitions["DCMTK_COMPILE_WIN32_MULTITHREADED_DLL"] = "MD" in msvc_runtime_flag(self) + tc.variables["DCMTK_ICONV_FLAGS_ANALYZED"] = True + tc.variables["DCMTK_COMPILE_WIN32_MULTITHREADED_DLL"] = not is_msvc_static_runtime(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _collect_cmake_required(self, host_dependency): + """ + Collect all compile & link flags of a host dependency so that they can be used in: + - CMAKE_REQUIRED_FLAGS + - CMAKE_REQUIRED_INCLUDES + - CMAKE_REQUIRED_DEFINITIONS + - CMAKE_REQUIRED_LINK_OPTIONS + - CMAKE_REQUIRED_LIBRARIES + These variables are listened by CMake functions like check_symbol_exists() etc + """ + # Aggregate cpp_info of dependency and all its depencencies (direct and transitive) + dep = self.dependencies.host[host_dependency] + dep_cpp_info = dep.cpp_info.aggregated_components() + for _, trans_dep in dep.dependencies.items(): + if trans_dep.context == "host": + dep_cpp_info.merge(trans_dep.cpp_info.aggregated_components()) + + dep_includes = [p.replace("\\", "/") for p in dep_cpp_info.includedirs] + libdirs_flag = "/LIBPATH:" if is_msvc(self) else "-L" + dep_libdirs = ["{}{}".format(libdirs_flag, p.replace("\\", "/")) for p in dep_cpp_info.libdirs] + dep_frameworks = [f"-framework {f}" for f in dep_cpp_info.frameworks] - cmake.configure(build_folder=self._build_subfolder) - return cmake + return { + "flags": ";".join(dep_cpp_info.cflags + dep_cpp_info.cxxflags), + "includes": ";".join(dep_includes), + "definitions": ";".join(dep_cpp_info.defines), + "link_options": ";".join(dep_libdirs + dep_cpp_info.exelinkflags + dep_frameworks), + "libraries": ";".join(dep_cpp_info.libs + dep_cpp_info.system_libs), + } - def build(self): + def _patch_sources(self): apply_conandata_patches(self) - cmake = self._configure_cmake() + + # Workaround for CMakeDeps bug with check_* like functions. + # See https://github.com/conan-io/conan/issues/12012 & https://github.com/conan-io/conan/issues/12180 + if self.options.with_openssl: + cmake_required = self._collect_cmake_required("openssl") + replace_in_file( + self, + os.path.join(self.source_folder, "CMake", "dcmtkPrepare.cmake"), + "set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OPENSSL_LIBS} ${THREAD_LIBS})", + textwrap.dedent(f"""\ + list(APPEND CMAKE_REQUIRED_FLAGS "{cmake_required['flags']}") + list(APPEND CMAKE_REQUIRED_INCLUDES "{cmake_required['includes']}") + list(APPEND CMAKE_REQUIRED_DEFINITIONS "{cmake_required['definitions']}") + list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "{cmake_required['link_options']}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "{cmake_required['libraries']}") + """), + ) + + if self.options.charset_conversion == "libiconv": + cmake_required = self._collect_cmake_required("libiconv") + replace_in_file( + self, + os.path.join(self.source_folder, "CMake", "3rdparty.cmake"), + "set(CMAKE_REQUIRED_LIBRARIES ${LIBICONV_LIBS})", + textwrap.dedent(f"""\ + list(APPEND CMAKE_REQUIRED_FLAGS "{cmake_required['flags']}") + list(APPEND CMAKE_REQUIRED_DEFINITIONS "{cmake_required['definitions']}") + list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "{cmake_required['link_options']}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "{cmake_required['libraries']}") + """), + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="COPYRIGHT", dst="licenses", src=self._source_subfolder) - - cmake = self._configure_cmake() + 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, "cmake")) 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, "etc")) rmdir(self, os.path.join(self.package_folder, "share")) + # TODO: to remove once support of cmake_find_package* dropped self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), {target: f"DCMTK::{target}" for target in self._dcmtk_components} @@ -202,21 +250,17 @@ def package(self): 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 - def _module_subfolder(self): - return os.path.join("lib", "cmake") - @property def _module_file_rel_path(self): - return os.path.join(self._module_subfolder, "conan-official-{self.name}-targets.cmake") + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @property def _dcmtk_components(self): @@ -243,8 +287,6 @@ def tcpwrappers(): def xml2(): return ["libxml2::libxml2"] if self.options.with_libxml2 else [] - charls = "dcmtkcharls" if Version("3.6.6") <= self.version else "charls" - return { "ofstd" : charset_conversion(), "oflog" : ["ofstd"], @@ -256,8 +298,8 @@ def xml2(): "ijg8" : [], "ijg12" : [], "ijg16" : [], - "dcmjpls" : ["ofstd", "oflog", "dcmdata", "dcmimgle", "dcmimage", charls], - charls : ["ofstd", "oflog"], + "dcmjpls" : ["ofstd", "oflog", "dcmdata", "dcmimgle", "dcmimage", "dcmtkcharls"], + "dcmtkcharls": ["ofstd", "oflog"], "dcmtls" : ["ofstd", "dcmdata", "dcmnet"] + openssl(), "dcmnet" : ["ofstd", "oflog", "dcmdata"] + tcpwrappers(), "dcmsr" : ["ofstd", "oflog", "dcmdata", "dcmimgle", "dcmimage"] + xml2(), @@ -282,41 +324,38 @@ def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "DCMTK") - self.cpp_info.names["cmake_find_package"] = "DCMTK" - self.cpp_info.names["cmake_find_package_multi"] = "DCMTK" + for target_lib, requires in self._dcmtk_components.items(): + self.cpp_info.components[target_lib].set_property("cmake_target_name", f"DCMTK::{target_lib}") + # Before 3.6.7, targets were not namespaced, therefore they are also exposed for conveniency + self.cpp_info.components[target_lib].set_property("cmake_target_aliases", [target_lib]) + + self.cpp_info.components[target_lib].libs = [target_lib] + self.cpp_info.components[target_lib].includedirs.append(os.path.join("include", "dcmtk")) + self.cpp_info.components[target_lib].requires = requires - def register_components(components): - for target_lib, requires in components.items(): - self.cpp_info.components[target_lib].set_property("cmake_target_name", target_lib) - self.cpp_info.components[target_lib].libs = [target_lib] - self.cpp_info.components[target_lib].includedirs.append(os.path.join("include", "dcmtk")) - self.cpp_info.components[target_lib].requires = requires - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.components[target_lib].names["cmake_find_package"] = target_lib - self.cpp_info.components[target_lib].names["cmake_find_package_multi"] = target_lib - self.cpp_info.components[target_lib].builddirs.append(self._module_subfolder) - self.cpp_info.components[target_lib].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components[target_lib].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - - if self.settings.os == "Windows": - self.cpp_info.components["ofstd"].system_libs.extend([ - "iphlpapi", "ws2_32", "netapi32", "wsock32" - ]) - elif self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["ofstd"].system_libs.append("m") - if self.options.with_multithreading: - self.cpp_info.components["ofstd"].system_libs.append("pthread") - - register_components(self._dcmtk_components) - - dcmdictpath = os.path.join(self._dcm_datadictionary_path, "dcmtk", "dicom.dic") - self.output.info(f"Settings DCMDICTPATH environment variable: {dcmdictpath}") - self.runenv_info.define_path("DCMDICTPATH", dcmdictpath) - self.env_info.DCMDICTPATH = dcmdictpath # remove in conan v2? + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components[target_lib].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[target_lib].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.settings.os == "Windows": + self.cpp_info.components["ofstd"].system_libs.extend([ + "iphlpapi", "ws2_32", "netapi32", "wsock32" + ]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ofstd"].system_libs.append("m") + if self.options.with_multithreading: + self.cpp_info.components["ofstd"].system_libs.append("pthread") + + if self.options.default_dict == "external": + dcmdictpath = os.path.join(self._dcm_datadictionary_path, "dcmtk", "dicom.dic") + self.runenv_info.define_path("DCMDICTPATH", dcmdictpath) + if self.options.with_applications: + self.buildenv_info.define_path("DCMDICTPATH", dcmdictpath) + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "DCMTK" + self.cpp_info.names["cmake_find_package_multi"] = "DCMTK" + if self.options.default_dict == "external": + self.env_info.DCMDICTPATH = dcmdictpath if self.options.with_applications: - self.buildenv_info.define_path("DCMDICTPATH", dcmdictpath) - 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) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch b/recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch deleted file mode 100644 index 0e7d266d097c2d..00000000000000 --- a/recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch +++ /dev/null @@ -1,253 +0,0 @@ ---- a/CMake/3rdparty.cmake -+++ b/CMake/3rdparty.cmake -@@ -40,13 +40,15 @@ if(WIN32 AND NOT MINGW) - # libxml support: configure compiler - if(DCMTK_WITH_XML) - if(WITH_LIBXMLINC) -- set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include") -- set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib") -- set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib") -+ set(LIBXML_INCDIR ${CONAN_INCLUDE_DIRS_LIBXML2} ${CONAN_INCLUDE_DIRS_ICONV}) -+ link_directories(${WITH_LIBXMLINC}/lib) -+ set(LIBXML_LIBS ${CONAN_LIBS_LIBXML2}) - message(STATUS "Info: DCMTK XML support will be enabled") - set(WITH_LIBXML 1) -+ if(NOT WITH_LIBXML_SHARED) - # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly - add_definitions("-DLIBXML_STATIC") -+ endif() - else() # turn off library if library path not set - message(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.") - set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE) -@@ -58,8 +60,8 @@ if(WIN32 AND NOT MINGW) - if(DCMTK_WITH_PNG) - if(WITH_LIBPNGINC) - set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include") -- set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib") -- set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib") -+ link_directories(${WITH_LIBPNGINC}/lib) -+ set(LIBPNG_LIBS CONAN_PKG::libpng) - message(STATUS "Info: DCMTK PNG support will be enabled") - set(WITH_LIBPNG 1) - else() # turn off library if library path not set -@@ -73,8 +75,8 @@ if(WIN32 AND NOT MINGW) - if(DCMTK_WITH_TIFF) - if(WITH_LIBTIFFINC) - set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include") -- set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib") -- set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib") -+ link_directories(${WITH_LIBTIFFINC}/lib) -+ set(LIBTIFF_LIBS CONAN_PKG::libtiff) - message(STATUS "Info: DCMTK TIFF support will be enabled") - set(WITH_LIBTIFF 1) - else() # turn off library if library path not set -@@ -90,9 +92,9 @@ if(WIN32 AND NOT MINGW) - include(CheckCXXSourceCompiles) - set(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin") - set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include") -- set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib") -+ link_directories(${WITH_OPENSSLINC}/lib) - # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL. -- set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib") -+ set(OPENSSL_LIBS ${CONAN_LIBS_OPENSSL}) - set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") - list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") - CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) -@@ -116,8 +118,8 @@ if(WIN32 AND NOT MINGW) - if(DCMTK_WITH_ZLIB) - if(WITH_ZLIBINC) - set(ZLIB_INCDIR "${WITH_ZLIBINC}/include") -- set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib") -- set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib") -+ link_directories(${WITH_ZLIBINC}/lib) -+ set(ZLIB_LIBS CONAN_PKG::zlib) - message(STATUS "Info: DCMTK ZLIB support will be enabled") - set(WITH_ZLIB 1) - else() # turn off library if library path not set -@@ -131,8 +133,8 @@ if(WIN32 AND NOT MINGW) - if(DCMTK_WITH_SNDFILE) - if(WITH_SNDFILEINC) - set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include") -- set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib") -- set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib") -+ link_directories(${WITH_SNDFILEINC}/lib) -+ set(SNDFILE_LIBS CONAN_PKG::libsndfile) - message(STATUS "Info: DCMTK SNDFILE support will be enabled") - set(WITH_SNDFILE 1) - else() # turn off library if library path not set -@@ -146,8 +148,8 @@ if(WIN32 AND NOT MINGW) - if(DCMTK_WITH_ICONV) - if(WITH_LIBICONVINC) - set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include") -- set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib") -- set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib") -+ link_directories(${WITH_LIBICONVINC}/lib) -+ set(LIBICONV_LIBS CONAN_PKG::libiconv) - message(STATUS "Info: DCMTK ICONV support will be enabled") - set(WITH_LIBICONV 1) - else() # turn off library if library path not set -@@ -170,7 +172,7 @@ if(WIN32 AND NOT MINGW) - else() - set(OPENJPEG_INCDIR "${WITH_OPENJPEGINC1}") - set(OPENJPEG_LIBDIR "${WITH_OPENJPEGINC}/lib") -- set(OPENJPEG_LIBS debug "${OPENJPEG_LIBDIR}/openjp2_d.lib" optimized "${OPENJPEG_LIBDIR}/openjp2_o.lib") -+ set(OPENJPEG_LIBS CONAN_PKG::openjpeg) - message(STATUS "Info: DCMTK OpenJPEG support will be enabled") - set(WITH_OPENJPEG 1) - endif() -@@ -185,7 +187,7 @@ else(WIN32 AND NOT MINGW) - - # Find TIFF - if(DCMTK_WITH_TIFF) -- find_package(TIFF QUIET) -+ find_package(TIFF REQUIRED) - # turn off library if it could not be found - if(NOT TIFF_FOUND) - message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") -@@ -194,21 +196,21 @@ else(WIN32 AND NOT MINGW) - else() - set(WITH_LIBTIFF 1) - # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path -- find_package(JPEG QUIET) -+ find_package(JPEG REQUIRED) - if(NOT JPEG_FOUND) - message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") -- include_directories(${TIFF_INCLUDE_DIR}) -+ include_directories(${TIFF_INCLUDE_DIRS}) - else() - message(STATUS "Info: DCMTK TIFF support will be enabled") -- include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) -+ include_directories(${TIFF_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS}) - endif() -- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${JPEG_LIBRARY}) -+ set(LIBTIFF_LIBS ${TIFF_LIBRARIES} ${JPEG_LIBRARIES}) - endif() - endif() - - # Find PNG - if(DCMTK_WITH_PNG) -- find_package(PNG QUIET) -+ find_package(PNG REQUIRED) - if(NOT PNG_FOUND) - set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) - message(STATUS "Warning: PNG support will be disabled because libpng was not found.") -@@ -217,13 +219,13 @@ else(WIN32 AND NOT MINGW) - message(STATUS "Info: DCMTK PNG support will be enabled") - set(WITH_LIBPNG 1) - include_directories(${PNG_INCLUDE_DIR}) -- set(LIBPNG_LIBS ${PNG_LIBRARY}) -+ set(LIBPNG_LIBS ${PNG_LIBRARIES}) - endif() - endif() - - # Find OpenSSL - if(DCMTK_WITH_OPENSSL) -- find_package(OpenSSL QUIET) -+ find_package(OpenSSL REQUIRED) - if(NOT OPENSSL_FOUND) - message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") - set(WITH_OPENSSL "") -@@ -254,7 +256,7 @@ else(WIN32 AND NOT MINGW) - - # Find libXML2 - if(DCMTK_WITH_XML) -- find_package(LibXml2 QUIET) -+ find_package(LibXml2 REQUIRED) - if(NOT LIBXML2_FOUND) - message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") - set(WITH_LIBXML "") -@@ -269,7 +271,7 @@ else(WIN32 AND NOT MINGW) - - # Find zlib - if(DCMTK_WITH_ZLIB) -- find_package(ZLIB QUIET) -+ find_package(ZLIB REQUIRED) - if(NOT ZLIB_FOUND) - message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") - set(WITH_ZLIB "") -@@ -284,7 +286,7 @@ else(WIN32 AND NOT MINGW) - - # Find libsndfile - if(DCMTK_WITH_SNDFILE) -- find_package(Sndfile QUIET) -+ find_package(Sndfile REQUIRED) - if(NOT SNDFILE_LIBS) - message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.") - set(WITH_SNDFILE "") -@@ -292,16 +294,16 @@ else(WIN32 AND NOT MINGW) - else() - message(STATUS "Info: DCMTK SNDFILE support will be enabled") - set(WITH_SNDFILE 1) -- include_directories(${SNDFILE_INCLUDE_DIRS}) -- set(SNDFILE_LIBS ${SNDFILE_LIBRARIES}) -+ include_directories(${Sndfile_INCLUDE_DIRS}) -+ set(SNDFILE_LIBS ${Sndfile_LIBRARIES}) - endif() - endif() - - # Find libiconv - if(DCMTK_WITH_ICONV) -- find_package(Iconv QUIET) -- find_package(Charset QUIET) -- if(ICONV_FOUND) -+ find_package(Iconv REQUIRED) -+ #find_package(Charset REQUIRED) #FIXME?? -+ if(Iconv_FOUND) - if(NOT Iconv_IS_BUILT_IN) - set(LIBICONV_FOUND ${ICONV_FOUND}) - else() -@@ -322,14 +324,14 @@ else(WIN32 AND NOT MINGW) - set(WITH_LIBICONV 1) - set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) - set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) -- set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) -+ set(LIBICONV_LIBS Iconv::Iconv) - include_directories(${LIBICONV_INCDIR}) - endif() - endif() - - # Find libwrap - if(DCMTK_WITH_WRAP) -- find_package(Wrap QUIET) -+ find_package(Wrap REQUIRED) - if(NOT WRAP_FOUND) - message(STATUS "Warning: WRAP support will be disabled because libwrap was not found.") - set(WITH_TCPWRAPPER "") -@@ -344,7 +346,7 @@ else(WIN32 AND NOT MINGW) - - # Find OpenJPEG - if(DCMTK_WITH_OPENJPEG) -- find_package(OpenJPEG QUIET) -+ find_package(OpenJPEG REQUIRED) - if(NOT OPENJPEG_FOUND) - message(STATUS "Warning: OpenJPEG support will be disabled because the OpenJPEG library was not found.") - set(WITH_OPENJPEG "") -@@ -352,8 +354,8 @@ else(WIN32 AND NOT MINGW) - else() - message(STATUS "Info: DCMTK OpenJPEG support will be enabled") - set(WITH_OPENJPEG 1) -- include_directories(${OPENJPEG_INCLUDE_DIRS}) -- set(OPENJPEG_LIBS ${OPENJPEG_LIBRARIES}) -+ include_directories(${OpenJPEG_INCLUDE_DIRS}) -+ set(OPENJPEG_LIBS ${OpenJPEG_LIBRARIES}) - endif() - endif() - -@@ -371,7 +373,7 @@ if(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV) - endif() - - if(DCMTK_WITH_ICU) -- find_package(ICU COMPONENTS uc data QUIET) -+ find_package(ICU COMPONENTS uc data REQUIRED) - if(NOT ICU_FOUND) - message(STATUS "Warning: ICU support will be disabled because the ICU were not found.") - set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE) -@@ -387,7 +389,7 @@ endif() - - # Find doxygen - if(DCMTK_WITH_DOXYGEN) -- find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE -+ find_package(Doxygen REQUIRED) # will set variable DOXYGEN_EXECUTABLE - if(NOT DOXYGEN_FOUND) - message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.") - set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE) diff --git a/recipes/dcmtk/all/patches/0002-cmake-use-conan-packages.patch b/recipes/dcmtk/all/patches/0002-cmake-use-conan-packages.patch deleted file mode 100644 index d566a50607ec76..00000000000000 --- a/recipes/dcmtk/all/patches/0002-cmake-use-conan-packages.patch +++ /dev/null @@ -1,225 +0,0 @@ ---- CMake/3rdparty.cmake -+++ CMake/3rdparty.cmake -@@ -21,7 +21,7 @@ mark_as_advanced(DCMTK_USE_FIND_PACKAGE) - if(DCMTK_USE_FIND_PACKAGE) - # Find TIFF - if(DCMTK_WITH_TIFF) -- find_package(TIFF QUIET) -+ find_package(TIFF REQUIRED) - # turn off library if it could not be found - if(NOT TIFF_FOUND) - message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") -@@ -30,21 +30,21 @@ if(DCMTK_USE_FIND_PACKAGE) - else() - set(WITH_LIBTIFF 1) - # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path -- find_package(JPEG QUIET) -+ find_package(JPEG REQUIRED) - if(NOT JPEG_FOUND) - message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") -- include_directories(${TIFF_INCLUDE_DIR}) -+ include_directories(${TIFF_INCLUDE_DIRS}) - else() - message(STATUS "Info: DCMTK TIFF support will be enabled") -- include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) -+ include_directories(${TIFF_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS}) - endif() -- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${JPEG_LIBRARY}) -+ set(LIBTIFF_LIBS ${TIFF_LIBRARIES} ${JPEG_LIBRARIES}) - endif() - endif() - - # Find PNG - if(DCMTK_WITH_PNG) -- find_package(PNG QUIET) -+ find_package(PNG REQUIRED) - if(NOT PNG_FOUND) - set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) - message(STATUS "Warning: PNG support will be disabled because libpng was not found.") -@@ -53,13 +53,13 @@ if(DCMTK_USE_FIND_PACKAGE) - message(STATUS "Info: DCMTK PNG support will be enabled") - set(WITH_LIBPNG 1) - include_directories(${PNG_INCLUDE_DIR}) -- set(LIBPNG_LIBS ${PNG_LIBRARY}) -+ set(LIBPNG_LIBS ${PNG_LIBRARIES}) - endif() - endif() - - # Find OpenSSL - if(DCMTK_WITH_OPENSSL) -- find_package(OpenSSL QUIET) -+ find_package(OpenSSL REQUIRED) - if(NOT OPENSSL_FOUND) - message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") - set(WITH_OPENSSL "") -@@ -90,7 +90,7 @@ if(DCMTK_USE_FIND_PACKAGE) - - # Find libXML2 - if(DCMTK_WITH_XML) -- find_package(LibXml2 QUIET) -+ find_package(LibXml2 REQUIRED) - if(NOT LIBXML2_FOUND) - message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") - set(WITH_LIBXML "") -@@ -105,7 +105,7 @@ if(DCMTK_USE_FIND_PACKAGE) - - # Find zlib - if(DCMTK_WITH_ZLIB) -- find_package(ZLIB QUIET) -+ find_package(ZLIB REQUIRED) - if(NOT ZLIB_FOUND) - message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") - set(WITH_ZLIB "") -@@ -120,7 +120,7 @@ if(DCMTK_USE_FIND_PACKAGE) - - # Find libsndfile - if(DCMTK_WITH_SNDFILE) -- find_package(Sndfile QUIET) -+ find_package(Sndfile REQUIRED) - if(NOT SNDFILE_LIBS) - message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.") - set(WITH_SNDFILE "") -@@ -128,16 +128,16 @@ if(DCMTK_USE_FIND_PACKAGE) - else() - message(STATUS "Info: DCMTK SNDFILE support will be enabled") - set(WITH_SNDFILE 1) -- include_directories(${SNDFILE_INCLUDE_DIRS}) -- set(SNDFILE_LIBS ${SNDFILE_LIBRARIES}) -+ include_directories(${Sndfile_INCLUDE_DIRS}) -+ set(SNDFILE_LIBS ${Sndfile_LIBRARIES}) - endif() - endif() - - # Find libiconv - if(DCMTK_WITH_ICONV) -- find_package(Iconv QUIET) -- find_package(Charset QUIET) -- if(ICONV_FOUND) -+ find_package(Iconv REQUIRED) -+ #find_package(Charset QUIET) #FIXME?? -+ if(Iconv_FOUND) - if(NOT Iconv_IS_BUILT_IN) - set(LIBICONV_FOUND ${ICONV_FOUND}) - else() -@@ -158,7 +158,7 @@ if(DCMTK_USE_FIND_PACKAGE) - set(WITH_LIBICONV 1) - set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) - set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) -- set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) -+ set(LIBICONV_LIBS Iconv::Iconv) - include_directories(${LIBICONV_INCDIR}) - endif() - endif() -@@ -234,13 +234,15 @@ else() - # libxml support: configure compiler - if(DCMTK_WITH_XML) - if(WITH_LIBXMLINC) -- set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include") -- set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib") -- set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib") -+ set(LIBXML_INCDIR ${CONAN_INCLUDE_DIRS_LIBXML2} ${CONAN_INCLUDE_DIRS_ICONV}) -+ link_directories(${WITH_LIBXMLINC}/lib) -+ set(LIBXML_LIBS ${CONAN_LIBS_LIBXML2}) - message(STATUS "Info: DCMTK XML support will be enabled") - set(WITH_LIBXML 1) -+ if(NOT WITH_LIBXML_SHARED) - # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly - add_definitions("-DLIBXML_STATIC") -+ endif() - else() # turn off library if library path not set - message(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.") - set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE) -@@ -252,8 +254,8 @@ else() - if(DCMTK_WITH_PNG) - if(WITH_LIBPNGINC) - set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include") -- set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib") -- set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib") -+ link_directories(${WITH_LIBPNGINC}/lib) -+ set(LIBPNG_LIBS CONAN_PKG::libpng) - message(STATUS "Info: DCMTK PNG support will be enabled") - set(WITH_LIBPNG 1) - else() # turn off library if library path not set -@@ -267,8 +269,8 @@ else() - if(DCMTK_WITH_TIFF) - if(WITH_LIBTIFFINC) - set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include") -- set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib") -- set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib") -+ link_directories(${WITH_LIBTIFFINC}/lib) -+ set(LIBTIFF_LIBS CONAN_PKG::libtiff) - message(STATUS "Info: DCMTK TIFF support will be enabled") - set(WITH_LIBTIFF 1) - else() # turn off library if library path not set -@@ -284,9 +286,9 @@ else() - include(CheckCXXSourceCompiles) - set(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin") - set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include") -- set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib") -+ link_directories(${WITH_OPENSSLINC}/lib) - # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL. -- set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib") -+ set(OPENSSL_LIBS ${CONAN_LIBS_OPENSSL}) - set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") - list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") - CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) -@@ -310,8 +312,8 @@ else() - if(DCMTK_WITH_ZLIB) - if(WITH_ZLIBINC) - set(ZLIB_INCDIR "${WITH_ZLIBINC}/include") -- set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib") -- set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib") -+ link_directories(${WITH_ZLIBINC}/lib) -+ set(ZLIB_LIBS CONAN_PKG::zlib) - message(STATUS "Info: DCMTK ZLIB support will be enabled") - set(WITH_ZLIB 1) - else() # turn off library if library path not set -@@ -325,8 +327,8 @@ else() - if(DCMTK_WITH_SNDFILE) - if(WITH_SNDFILEINC) - set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include") -- set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib") -- set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib") -+ link_directories(${WITH_SNDFILEINC}/lib) -+ set(SNDFILE_LIBS CONAN_PKG::libsndfile) - message(STATUS "Info: DCMTK SNDFILE support will be enabled") - set(WITH_SNDFILE 1) - else() # turn off library if library path not set -@@ -340,8 +342,8 @@ else() - if(DCMTK_WITH_ICONV) - if(WITH_LIBICONVINC) - set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include") -- set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib") -- set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib") -+ link_directories(${WITH_LIBICONVINC}/lib) -+ set(LIBICONV_LIBS CONAN_PKG::libiconv) - message(STATUS "Info: DCMTK ICONV support will be enabled") - set(WITH_LIBICONV 1) - else() # turn off library if library path not set -@@ -364,7 +366,7 @@ else() - else() - set(OPENJPEG_INCDIR "${WITH_OPENJPEGINC1}") - set(OPENJPEG_LIBDIR "${WITH_OPENJPEGINC}/lib") -- set(OPENJPEG_LIBS debug "${OPENJPEG_LIBDIR}/openjp2_d.lib" optimized "${OPENJPEG_LIBDIR}/openjp2_o.lib") -+ set(OPENJPEG_LIBS CONAN_PKG::openjpeg) - message(STATUS "Info: DCMTK OpenJPEG support will be enabled") - set(WITH_OPENJPEG 1) - endif() -@@ -388,7 +390,7 @@ if(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV) - endif() - - if(DCMTK_WITH_ICU) -- find_package(ICU COMPONENTS uc data QUIET) -+ find_package(ICU COMPONENTS uc data REQUIRED) - if(NOT ICU_FOUND) - message(STATUS "Warning: ICU support will be disabled because the ICU were not found.") - set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE) -@@ -404,7 +406,7 @@ endif() - - # Find doxygen - if(DCMTK_WITH_DOXYGEN) -- find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE -+ find_package(Doxygen REQUIRED) # will set variable DOXYGEN_EXECUTABLE - if(NOT DOXYGEN_FOUND) - message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.") - set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE) diff --git a/recipes/dcmtk/all/patches/3.6.7-0001-cmake-robust-deps-handling.patch b/recipes/dcmtk/all/patches/3.6.7-0001-cmake-robust-deps-handling.patch new file mode 100644 index 00000000000000..264a486b31bc69 --- /dev/null +++ b/recipes/dcmtk/all/patches/3.6.7-0001-cmake-robust-deps-handling.patch @@ -0,0 +1,162 @@ +--- a/CMake/3rdparty.cmake ++++ b/CMake/3rdparty.cmake +@@ -21,7 +21,7 @@ mark_as_advanced(DCMTK_USE_FIND_PACKAGE) + if(DCMTK_USE_FIND_PACKAGE) + # Find TIFF + if(DCMTK_WITH_TIFF) +- find_package(TIFF QUIET) ++ find_package(TIFF REQUIRED) + # turn off library if it could not be found + if(NOT TIFF_FOUND) + message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") +@@ -30,21 +30,13 @@ if(DCMTK_USE_FIND_PACKAGE) + else() + set(WITH_LIBTIFF 1) + # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path +- find_package(JPEG QUIET) +- if(NOT JPEG_FOUND) +- message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") +- include_directories(${TIFF_INCLUDE_DIR}) +- else() +- message(STATUS "Info: DCMTK TIFF support will be enabled") +- include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) +- endif() +- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${TIFF_EXTRA_LIBS_STATIC} ${JPEG_LIBRARY}) ++ set(LIBTIFF_LIBS TIFF::TIFF) + endif() + endif() + + # Find PNG + if(DCMTK_WITH_PNG) +- find_package(PNG QUIET) ++ find_package(PNG REQUIRED) + if(NOT PNG_FOUND) + set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) + message(STATUS "Warning: PNG support will be disabled because libpng was not found.") +@@ -53,33 +45,23 @@ if(DCMTK_USE_FIND_PACKAGE) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + include_directories(${PNG_INCLUDE_DIR}) +- set(LIBPNG_LIBS ${PNG_LIBRARY}) ++ set(LIBPNG_LIBS PNG::PNG) + endif() + endif() + + # Find OpenSSL + if(DCMTK_WITH_OPENSSL) +- find_package(OpenSSL QUIET) ++ find_package(OpenSSL REQUIRED) + if(NOT OPENSSL_FOUND) + message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") + set(WITH_OPENSSL "") + set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE) + else() +- include(CheckLibraryExists) +- include(CheckCXXSourceCompiles) +- set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") +- list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}") +- CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) +- set(CMAKE_REQUIRED_INCLUDES "${TEMP_INCLUDES}") +- if(OPENSSL_VERSION_CHECK) ++ if(1) + message(STATUS "Info: DCMTK OPENSSL support will be enabled") + set(WITH_OPENSSL 1) + include_directories(${OPENSSL_INCLUDE_DIR}) +- set(OPENSSL_LIBS ${OPENSSL_LIBRARIES} ${OPENSSL_EXTRA_LIBS_STATIC}) +- CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL) +- if(HAVE_LIBDL) +- set(OPENSSL_LIBS ${OPENSSL_LIBS} dl) +- endif() ++ set(OPENSSL_LIBS OpenSSL::SSL OpenSSL::Crypto) + else() + message(STATUS "Info: DCMTK OPENSSL support will be disabled: DCMTK requires OpenSSL version 1.0.1 or newer") + set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE) +@@ -90,7 +72,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libXML2 + if(DCMTK_WITH_XML) +- find_package(LibXml2 QUIET) ++ find_package(LibXml2 REQUIRED MODULE) + if(NOT LIBXML2_FOUND) + message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") + set(WITH_LIBXML "") +@@ -99,13 +81,13 @@ if(DCMTK_USE_FIND_PACKAGE) + message(STATUS "Info: DCMTK XML support will be enabled") + set(WITH_LIBXML 1) + include_directories(${LIBXML2_INCLUDE_DIR}) +- set(LIBXML_LIBS ${LIBXML2_LIBRARIES} ${LIBXML2_EXTRA_LIBS_STATIC}) ++ set(LIBXML_LIBS LibXml2::LibXml2) + endif() + endif() + + # Find zlib + if(DCMTK_WITH_ZLIB) +- find_package(ZLIB QUIET) ++ find_package(ZLIB REQUIRED) + if(NOT ZLIB_FOUND) + message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") + set(WITH_ZLIB "") +@@ -114,7 +96,7 @@ if(DCMTK_USE_FIND_PACKAGE) + message(STATUS "Info: DCMTK ZLIB support will be enabled") + set(WITH_ZLIB 1) + include_directories(${ZLIB_INCLUDE_DIRS}) +- set(ZLIB_LIBS ${ZLIB_LIBRARIES}) ++ set(ZLIB_LIBS ZLIB::ZLIB) + endif() + endif() + +@@ -135,11 +117,10 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libiconv + if(DCMTK_WITH_ICONV) +- find_package(Iconv QUIET) +- find_package(LIBCHARSET QUIET) +- if(ICONV_FOUND) ++ find_package(Iconv REQUIRED) ++ if(Iconv_FOUND) + if(NOT Iconv_IS_BUILT_IN) +- set(LIBICONV_FOUND ${ICONV_FOUND}) ++ set(LIBICONV_FOUND ${Iconv_FOUND}) + else() + message(STATUS "Info: found builtin ICONV support inside the C standard library.") + set(DCMTK_WITH_STDLIBC_ICONV ON CACHE BOOL "" FORCE) +@@ -149,7 +130,7 @@ if(DCMTK_USE_FIND_PACKAGE) + set(LIBICONV_SECOND_ARGUMENT_CONST ${ICONV_SECOND_ARGUMENT_IS_CONST} CACHE INTERNAL "${HELPSTRING}") + endif() + endif() +- if(NOT LIBICONV_FOUND OR NOT LIBCHARSET_FOUND) ++ if(NOT LIBICONV_FOUND) + message(STATUS "Warning: ICONV support will be disabled because libiconv was not found. Correct LIBICONV_LIBDIR and LIBICONV_INCLUDE_DIR and re-enable DCMTK_WITH_ICONV.") + set(DCMTK_WITH_ICONV OFF CACHE BOOL "" FORCE) + set(WITH_LIBICONV "") +@@ -157,24 +138,24 @@ if(DCMTK_USE_FIND_PACKAGE) + message(STATUS "Info: DCMTK ICONV support will be enabled") + set(WITH_LIBICONV 1) + set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) +- set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) +- set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) ++ set(LIBICONV_LIBDIR ${Iconv_LIB_DIRS}) ++ set(LIBICONV_LIBS Iconv::Iconv) + include_directories(${LIBICONV_INCDIR}) + endif() + endif() + + # Find libwrap + if(DCMTK_WITH_WRAP) +- find_package(WRAP QUIET) +- if(NOT WRAP_FOUND) ++ find_package(tcp-wrappers REQUIRED CONFIG) ++ if(NOT tcp-wrappers_FOUND) + message(STATUS "Warning: WRAP support will be disabled because libwrap was not found.") + set(WITH_TCPWRAPPER "") + set(DCMTK_WITH_WRAP OFF CACHE BOOL "" FORCE) + else() + message(STATUS "Info: DCMTK WRAP support will be enabled") + set(WITH_TCPWRAPPER 1) +- include_directories(${WRAP_INCLUDE_DIRS}) +- set(WRAP_LIBS ${WRAP_LIBRARIES} ${WRAP_EXTRA_LIBS_STATIC}) ++ include_directories(${tcp-wrappers_INCLUDE_DIRS}) ++ set(WRAP_LIBS tcp-wrappers::tcp-wrappers) + endif() + endif() + diff --git a/recipes/dcmtk/all/patches/3.6.7-0002-cmake-check-openssl-symbol.patch b/recipes/dcmtk/all/patches/3.6.7-0002-cmake-check-openssl-symbol.patch new file mode 100644 index 00000000000000..a3f1d5ac2c44be --- /dev/null +++ b/recipes/dcmtk/all/patches/3.6.7-0002-cmake-check-openssl-symbol.patch @@ -0,0 +1,89 @@ +--- a/CMake/dcmtkPrepare.cmake ++++ b/CMake/dcmtkPrepare.cmake +@@ -668,48 +668,50 @@ if(DCMTK_WITH_OPENSSL) + CHECK_INCLUDE_FILE_CXX("openssl/provider.h" HAVE_OPENSSL_PROVIDER_H) + + # test presence of functions, constants and macros needed for the dcmtls module +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_get0_param" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET0_PARAM) +- CHECK_FUNCTIONWITHHEADER_EXISTS("RAND_egd" "openssl/rand.h" HAVE_OPENSSL_PROTOTYPE_RAND_EGD) +- CHECK_FUNCTIONWITHHEADER_EXISTS("DH_bits" "openssl/dh.h" HAVE_OPENSSL_PROTOTYPE_DH_BITS) +- CHECK_FUNCTIONWITHHEADER_EXISTS("EVP_PKEY_RSA_PSS" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_RSA_PSS) +- CHECK_FUNCTIONWITHHEADER_EXISTS("EVP_PKEY_base_id" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_BASE_ID) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_get_cert_store" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET_CERT_STORE) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_get_ciphers" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET_CIPHERS) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_set0_tmp_dh_pkey" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET0_TMP_DH_PKEY) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_set1_curves(0,0,0)" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET1_CURVES) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_set1_sigalgs" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET1_SIGALGS) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_set_ecdh_auto(0,0)" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET_ECDH_AUTO) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_set_max_proto_version(0,0)" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET_MAX_PROTO_VERSION) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_set_security_level" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET_SECURITY_LEVEL) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_ERROR_WANT_ASYNC" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_ERROR_WANT_ASYNC) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_ERROR_WANT_ASYNC_JOB" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_ERROR_WANT_ASYNC_JOB) +- CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_ERROR_WANT_CLIENT_HELLO_CB" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_ERROR_WANT_CLIENT_HELLO_CB) +- CHECK_FUNCTIONWITHHEADER_EXISTS("TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305) +- CHECK_FUNCTIONWITHHEADER_EXISTS("TLS_method" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS_METHOD) +- CHECK_FUNCTIONWITHHEADER_EXISTS("X509_STORE_get0_param" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_STORE_GET0_PARAM) +- CHECK_FUNCTIONWITHHEADER_EXISTS("X509_get_signature_nid" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_GET_SIGNATURE_NID) ++ include(CheckSymbolExists) ++ include(CheckCSourceCompiles) ++ check_symbol_exists("SSL_CTX_get0_param" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET0_PARAM) ++ check_symbol_exists("RAND_egd" "openssl/rand.h" HAVE_OPENSSL_PROTOTYPE_RAND_EGD) ++ check_symbol_exists("DH_bits" "openssl/dh.h" HAVE_OPENSSL_PROTOTYPE_DH_BITS) ++ check_symbol_exists("EVP_PKEY_RSA_PSS" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_RSA_PSS) ++ check_symbol_exists("EVP_PKEY_base_id" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_BASE_ID) ++ check_symbol_exists("SSL_CTX_get_cert_store" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET_CERT_STORE) ++ check_symbol_exists("SSL_CTX_get_ciphers" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET_CIPHERS) ++ check_symbol_exists("SSL_CTX_set0_tmp_dh_pkey" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET0_TMP_DH_PKEY) ++ check_c_source_compiles("#include \nint main() {SSL_CTX_set1_curves(0,0,0); return 0;}" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET1_CURVES) ++ check_symbol_exists("SSL_CTX_set1_sigalgs" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET1_SIGALGS) ++ check_c_source_compiles("#include \nint main() {SSL_CTX_set_ecdh_auto(0,0); return 0;}" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET_ECDH_AUTO) ++ check_c_source_compiles("#include \nint main() {SSL_CTX_set_max_proto_version(0,0); return 0;}" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET_MAX_PROTO_VERSION) ++ check_symbol_exists("SSL_CTX_set_security_level" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_SET_SECURITY_LEVEL) ++ check_symbol_exists("SSL_ERROR_WANT_ASYNC" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_ERROR_WANT_ASYNC) ++ check_symbol_exists("SSL_ERROR_WANT_ASYNC_JOB" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_ERROR_WANT_ASYNC_JOB) ++ check_symbol_exists("SSL_ERROR_WANT_CLIENT_HELLO_CB" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_ERROR_WANT_CLIENT_HELLO_CB) ++ check_symbol_exists("TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305) ++ check_symbol_exists("TLS_method" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS_METHOD) ++ check_symbol_exists("X509_STORE_get0_param" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_STORE_GET0_PARAM) ++ check_symbol_exists("X509_get_signature_nid" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_GET_SIGNATURE_NID) + + # test presence of functions, constants and macros needed for the dcmsign module +- CHECK_FUNCTIONWITHHEADER_EXISTS("ASN1_STRING_get0_data" "openssl/asn1.h" HAVE_OPENSSL_PROTOTYPE_ASN1_STRING_GET0_DATA) +- CHECK_FUNCTIONWITHHEADER_EXISTS("EVP_PKEY_get0_EC_KEY" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_GET0_EC_KEY) +- CHECK_FUNCTIONWITHHEADER_EXISTS("EVP_PKEY_get_group_name" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_GET_GROUP_NAME) +- CHECK_FUNCTIONWITHHEADER_EXISTS("EVP_PKEY_id" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_ID) +- CHECK_FUNCTIONWITHHEADER_EXISTS("OSSL_PROVIDER_load" "openssl/provider.h" HAVE_OPENSSL_PROTOTYPE_OSSL_PROVIDER_LOAD) +- CHECK_FUNCTIONWITHHEADER_EXISTS("TS_STATUS_INFO_get0_failure_info" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_STATUS_INFO_GET0_FAILURE_INFO) +- CHECK_FUNCTIONWITHHEADER_EXISTS("TS_STATUS_INFO_get0_status" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_STATUS_INFO_GET0_STATUS) +- CHECK_FUNCTIONWITHHEADER_EXISTS("TS_STATUS_INFO_get0_text" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_STATUS_INFO_GET0_TEXT) +- CHECK_FUNCTIONWITHHEADER_EXISTS("TS_VERIFY_CTS_set_certs(0,0)" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_VERIFY_CTS_SET_CERTS) +- CHECK_FUNCTIONWITHHEADER_EXISTS("TS_VERIFY_CTX_set_data" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_VERIFY_CTX_SET_DATA) +- CHECK_FUNCTIONWITHHEADER_EXISTS("TS_VERIFY_CTX_set_flags" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_VERIFY_CTX_SET_FLAGS) +- CHECK_FUNCTIONWITHHEADER_EXISTS("TS_VERIFY_CTX_set_store" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_VERIFY_CTX_SET_STORE) +- CHECK_FUNCTIONWITHHEADER_EXISTS("X509_get0_notAfter" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_GET0_NOTAFTER) +- CHECK_FUNCTIONWITHHEADER_EXISTS("X509_get0_notBefore" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_GET0_NOTBEFORE) ++ check_symbol_exists("ASN1_STRING_get0_data" "openssl/asn1.h" HAVE_OPENSSL_PROTOTYPE_ASN1_STRING_GET0_DATA) ++ check_symbol_exists("EVP_PKEY_get0_EC_KEY" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_GET0_EC_KEY) ++ check_symbol_exists("EVP_PKEY_get_group_name" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_GET_GROUP_NAME) ++ check_symbol_exists("EVP_PKEY_id" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_ID) ++ check_symbol_exists("OSSL_PROVIDER_load" "openssl/provider.h" HAVE_OPENSSL_PROTOTYPE_OSSL_PROVIDER_LOAD) ++ check_symbol_exists("TS_STATUS_INFO_get0_failure_info" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_STATUS_INFO_GET0_FAILURE_INFO) ++ check_symbol_exists("TS_STATUS_INFO_get0_status" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_STATUS_INFO_GET0_STATUS) ++ check_symbol_exists("TS_STATUS_INFO_get0_text" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_STATUS_INFO_GET0_TEXT) ++ check_c_source_compiles("#include \nint main() {TS_VERIFY_CTS_set_certs(0,0); return 0;}" HAVE_OPENSSL_PROTOTYPE_TS_VERIFY_CTS_SET_CERTS) ++ check_symbol_exists("TS_VERIFY_CTX_set_data" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_VERIFY_CTX_SET_DATA) ++ check_symbol_exists("TS_VERIFY_CTX_set_flags" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_VERIFY_CTX_SET_FLAGS) ++ check_symbol_exists("TS_VERIFY_CTX_set_store" "openssl/ts.h" HAVE_OPENSSL_PROTOTYPE_TS_VERIFY_CTX_SET_STORE) ++ check_symbol_exists("X509_get0_notAfter" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_GET0_NOTAFTER) ++ check_symbol_exists("X509_get0_notBefore" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_GET0_NOTBEFORE) + + # check if type EVP_MD_CTX is defined as typedef for "struct evp_md_ctx_st" (new) or "struct env_md_ctx_st" (old) +- CHECK_FUNCTIONWITHHEADER_EXISTS("struct evp_md_ctx_st *a; EVP_MD_CTX *b=a" "openssl/evp.h" HAVE_OPENSSL_DECLARATION_NEW_EVP_MD_CTX) ++ check_c_source_compiles("#include \nint main() {struct evp_md_ctx_st *a; EVP_MD_CTX *b=a; return 0;}" HAVE_OPENSSL_DECLARATION_NEW_EVP_MD_CTX) + + # check if the first parameter passed to X509_ALGOR_get0() should be "const ASN1_OBJECT **" (new) or "ASN1_OBJECT **" (old) +- CHECK_FUNCTIONWITHHEADER_EXISTS("const ASN1_OBJECT *a; X509_ALGOR_get0(&a,0,0,0)" "openssl/x509.h" HAVE_OPENSSL_X509_ALGOR_GET0_CONST_PARAM) ++ check_c_source_compiles("#include \nint main() {const ASN1_OBJECT *a; X509_ALGOR_get0(&a,0,0,0); return 0;}" HAVE_OPENSSL_X509_ALGOR_GET0_CONST_PARAM) + + # restore previous value of CMAKE_REQUIRED_LIBRARIES + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_TEMP}) diff --git a/recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch b/recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch deleted file mode 100644 index b10d0378042ba8..00000000000000 --- a/recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch +++ /dev/null @@ -1,216 +0,0 @@ ---- CMake/3rdparty.cmake -+++ CMake/3rdparty.cmake -@@ -21,7 +21,7 @@ mark_as_advanced(DCMTK_USE_FIND_PACKAGE) - if(DCMTK_USE_FIND_PACKAGE) - # Find TIFF - if(DCMTK_WITH_TIFF) -- find_package(TIFF QUIET) -+ find_package(TIFF REQUIRED) - # turn off library if it could not be found - if(NOT TIFF_FOUND) - message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") -@@ -30,21 +30,21 @@ if(DCMTK_USE_FIND_PACKAGE) - else() - set(WITH_LIBTIFF 1) - # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path -- find_package(JPEG QUIET) -+ find_package(JPEG REQUIRED) - if(NOT JPEG_FOUND) - message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") -- include_directories(${TIFF_INCLUDE_DIR}) -+ include_directories(${TIFF_INCLUDE_DIRS}) - else() - message(STATUS "Info: DCMTK TIFF support will be enabled") -- include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) -+ include_directories(${TIFF_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS}) - endif() -- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${TIFF_EXTRA_LIBS_STATIC} ${JPEG_LIBRARY}) -+ set(LIBTIFF_LIBS ${TIFF_LIBRARIES} ${JPEG_LIBRARIES}) - endif() - endif() - - # Find PNG - if(DCMTK_WITH_PNG) -- find_package(PNG QUIET) -+ find_package(PNG REQUIRED) - if(NOT PNG_FOUND) - set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) - message(STATUS "Warning: PNG support will be disabled because libpng was not found.") -@@ -53,13 +53,13 @@ if(DCMTK_USE_FIND_PACKAGE) - message(STATUS "Info: DCMTK PNG support will be enabled") - set(WITH_LIBPNG 1) - include_directories(${PNG_INCLUDE_DIR}) -- set(LIBPNG_LIBS ${PNG_LIBRARY}) -+ set(LIBPNG_LIBS ${PNG_LIBRARIES}) - endif() - endif() - - # Find OpenSSL - if(DCMTK_WITH_OPENSSL) -- find_package(OpenSSL QUIET) -+ find_package(OpenSSL REQUIRED) - if(NOT OPENSSL_FOUND) - message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") - set(WITH_OPENSSL "") -@@ -90,7 +90,7 @@ if(DCMTK_USE_FIND_PACKAGE) - - # Find libXML2 - if(DCMTK_WITH_XML) -- find_package(LibXml2 QUIET) -+ find_package(LibXml2 REQUIRED) - if(NOT LIBXML2_FOUND) - message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") - set(WITH_LIBXML "") -@@ -105,7 +105,7 @@ if(DCMTK_USE_FIND_PACKAGE) - - # Find zlib - if(DCMTK_WITH_ZLIB) -- find_package(ZLIB QUIET) -+ find_package(ZLIB REQUIRED) - if(NOT ZLIB_FOUND) - message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") - set(WITH_ZLIB "") -@@ -120,7 +120,7 @@ if(DCMTK_USE_FIND_PACKAGE) - - # Find libsndfile - if(DCMTK_WITH_SNDFILE) -- find_package(SNDFILE QUIET) -+ find_package(SNDFILE REQUIRED) - if(NOT SNDFILE_LIBS) - message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.") - set(WITH_SNDFILE "") -@@ -135,9 +135,9 @@ if(DCMTK_USE_FIND_PACKAGE) - - # Find libiconv - if(DCMTK_WITH_ICONV) -- find_package(Iconv QUIET) -- find_package(LIBCHARSET QUIET) -- if(ICONV_FOUND) -+ find_package(Iconv REQUIRED) -+ find_package(LIBCHARSET REQUIRED) -+ if(Iconv_FOUND) - if(NOT Iconv_IS_BUILT_IN) - set(LIBICONV_FOUND ${ICONV_FOUND}) - else() -@@ -158,7 +158,7 @@ if(DCMTK_USE_FIND_PACKAGE) - set(WITH_LIBICONV 1) - set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) - set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) -- set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) -+ set(LIBICONV_LIBS Iconv::Iconv) - include_directories(${LIBICONV_INCDIR}) - endif() - endif() -@@ -241,13 +241,15 @@ else() - # libxml support: configure compiler - if(DCMTK_WITH_XML) - if(WITH_LIBXMLINC) -- set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include") -- set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib") -- set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib") -+ set(LIBXML_INCDIR ${CONAN_INCLUDE_DIRS_LIBXML2} ${CONAN_INCLUDE_DIRS_ICONV}) -+ link_directories(${WITH_LIBXMLINC}/lib) -+ set(LIBXML_LIBS ${CONAN_LIBS_LIBXML2}) - message(STATUS "Info: DCMTK XML support will be enabled") - set(WITH_LIBXML 1) -+ if(NOT WITH_LIBXML_SHARED) - # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly - add_definitions("-DLIBXML_STATIC") -+ endif() - else() # turn off library if library path not set - message(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.") - set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE) -@@ -259,8 +261,8 @@ else() - if(DCMTK_WITH_PNG) - if(WITH_LIBPNGINC) - set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include") -- set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib") -- set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib") -+ link_directories(${WITH_LIBPNGINC}/lib) -+ set(LIBPNG_LIBS CONAN_PKG::libpng) - message(STATUS "Info: DCMTK PNG support will be enabled") - set(WITH_LIBPNG 1) - else() # turn off library if library path not set -@@ -274,8 +276,8 @@ else() - if(DCMTK_WITH_TIFF) - if(WITH_LIBTIFFINC) - set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include") -- set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib") -- set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib") -+ link_directories(${WITH_LIBTIFFINC}/lib) -+ set(LIBTIFF_LIBS CONAN_PKG::libtiff) - message(STATUS "Info: DCMTK TIFF support will be enabled") - set(WITH_LIBTIFF 1) - else() # turn off library if library path not set -@@ -291,9 +293,9 @@ else() - include(CheckCXXSourceCompiles) - set(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin") - set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include") -- set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib") -+ link_directories(${WITH_OPENSSLINC}/lib) - # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL. -- set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib") -+ set(OPENSSL_LIBS ${CONAN_LIBS_OPENSSL}) - set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") - list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") - CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) -@@ -317,8 +319,8 @@ else() - if(DCMTK_WITH_ZLIB) - if(WITH_ZLIBINC) - set(ZLIB_INCDIR "${WITH_ZLIBINC}/include") -- set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib") -- set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib") -+ link_directories(${WITH_ZLIBINC}/lib) -+ set(ZLIB_LIBS CONAN_PKG::zlib) - message(STATUS "Info: DCMTK ZLIB support will be enabled") - set(WITH_ZLIB 1) - else() # turn off library if library path not set -@@ -332,8 +334,8 @@ else() - if(DCMTK_WITH_SNDFILE) - if(WITH_SNDFILEINC) - set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include") -- set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib") -- set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib") -+ link_directories(${WITH_SNDFILEINC}/lib) -+ set(SNDFILE_LIBS CONAN_PKG::libsndfile) - message(STATUS "Info: DCMTK SNDFILE support will be enabled") - set(WITH_SNDFILE 1) - else() # turn off library if library path not set -@@ -347,8 +349,8 @@ else() - if(DCMTK_WITH_ICONV) - if(WITH_LIBICONVINC) - set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include") -- set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib") -- set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib") -+ link_directories(${WITH_LIBICONVINC}/lib) -+ set(LIBICONV_LIBS CONAN_PKG::libiconv) - message(STATUS "Info: DCMTK ICONV support will be enabled") - set(WITH_LIBICONV 1) - else() # turn off library if library path not set -@@ -371,7 +373,7 @@ else() - else() - set(OPENJPEG_INCDIR "${WITH_OPENJPEGINC1}") - set(OPENJPEG_LIBDIR "${WITH_OPENJPEGINC}/lib") -- set(OPENJPEG_LIBS debug "${OPENJPEG_LIBDIR}/openjp2_d.lib" optimized "${OPENJPEG_LIBDIR}/openjp2_o.lib") -+ set(OPENJPEG_LIBS CONAN_PKG::openjpeg) - message(STATUS "Info: DCMTK OpenJPEG support will be enabled") - set(WITH_OPENJPEG 1) - endif() -@@ -395,7 +397,7 @@ if(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV) - endif() - - if(DCMTK_WITH_ICU) -- find_package(ICU COMPONENTS uc data QUIET) -+ find_package(ICU COMPONENTS uc data REQUIRED) - if(NOT ICU_FOUND) - message(STATUS "Warning: ICU support will be disabled because the ICU were not found.") - set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE) -@@ -411,7 +413,7 @@ endif() - - # Find doxygen - if(DCMTK_WITH_DOXYGEN) -- find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE -+ find_package(Doxygen REQUIRED) # will set variable DOXYGEN_EXECUTABLE - if(NOT DOXYGEN_FOUND) - message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.") - set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE) diff --git a/recipes/dcmtk/all/test_package/CMakeLists.txt b/recipes/dcmtk/all/test_package/CMakeLists.txt index b3dafcdddcb7d1..4e506092ed288f 100644 --- a/recipes/dcmtk/all/test_package/CMakeLists.txt +++ b/recipes/dcmtk/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(DCMTK REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} dcmdata) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE DCMTK::dcmdata) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/dcmtk/all/test_package/conanfile.py b/recipes/dcmtk/all/test_package/conanfile.py index c5fa77486cfa53..0a6bc68712d901 100644 --- a/recipes/dcmtk/all/test_package/conanfile.py +++ b/recipes/dcmtk/all/test_package/conanfile.py @@ -1,12 +1,19 @@ -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 import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "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) @@ -14,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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dcmtk/all/test_v1_package/CMakeLists.txt b/recipes/dcmtk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..be00a8c7f57c71 --- /dev/null +++ b/recipes/dcmtk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +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/dcmtk/all/test_v1_package/conanfile.py b/recipes/dcmtk/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/dcmtk/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/dcmtk/config.yml b/recipes/dcmtk/config.yml index 81e7bce3c7d995..8e28175b233706 100644 --- a/recipes/dcmtk/config.yml +++ b/recipes/dcmtk/config.yml @@ -1,7 +1,3 @@ versions: "3.6.7": folder: "all" - "3.6.6": - folder: "all" - "3.6.5": - folder: "all" diff --git a/recipes/decimal_for_cpp/all/conanfile.py b/recipes/decimal_for_cpp/all/conanfile.py index 3e6a2b2a8d7a3c..52caed052e5587 100644 --- a/recipes/decimal_for_cpp/all/conanfile.py +++ b/recipes/decimal_for_cpp/all/conanfile.py @@ -10,21 +10,21 @@ class DecimalforcppConan(ConanFile): name = "decimal_for_cpp" description = "Decimal data type support, for COBOL-like fixed-point operations on currency values." license = "BSD-3-Clause" - topics = ("decimal_for_cpp", "currency", "money-library", "decimal-numbers") + topics = ("currency", "money-library", "decimal-numbers") homepage = "https://github.com/vpiotr/decimal_for_cpp" url = "https://github.com/conan-io/conan-center-index" + 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 @@ -35,6 +35,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/decimal_for_cpp/all/test_package/conanfile.py b/recipes/decimal_for_cpp/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/decimal_for_cpp/all/test_package/conanfile.py +++ b/recipes/decimal_for_cpp/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt b/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt index 99324bd86f533f..be00a8c7f57c71 100644 --- a/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt +++ b/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(decimal_for_cpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} decimal_for_cpp::decimal_for_cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/deco/all/conanfile.py b/recipes/deco/all/conanfile.py index 3760e5bb68e075..29a4d2480e3aaa 100644 --- a/recipes/deco/all/conanfile.py +++ b/recipes/deco/all/conanfile.py @@ -1,56 +1,82 @@ -from conans import ConanFile, tools -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.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + class DecoConan(ConanFile): name = "deco" - license = "Apache-2.0-WITH-LLVM-exception" description = "Delimiter Collision Free Format" - topics = ("serialization") - homepage = "https://github.com/Enhex/Deco" + license = "Apache-2.0-WITH-LLVM-exception" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Enhex/Deco" + topics = ("serialization", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = ("compiler", "build_type", "os", "arch") - requires = ( - "enhex-generic_serialization/1.0.0", - "enhex-strong_type/1.0.0", - "boost/1.79.0", - "rang/3.2", - ) @property - def _source_subfolder(self): - return "source_subfolder" - - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + def _min_cppstd(self): + return 17 - minimal_version = { + @property + def _compilers_minimum_version(self): + return { "Visual Studio": "15", + "msvc": "191", "gcc": "7", "clang": "5.0", - "apple-clang": "9.1" + "apple-clang": "9.1", } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("enhex-generic_serialization/1.0.0") + self.requires("enhex-strong_type/1.0.0") + self.requires("boost/1.82.0") + self.requires("rang/3.2") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + compiler = str(self.settings.compiler) - compiler_version = tools.Version(self.settings.compiler.version) + compiler_version = Version(self.settings.compiler.version) - if compiler not in minimal_version: - self.output.info("{} requires a compiler that supports at least C++17".format(self.name)) + if compiler not in self._compilers_minimum_version: + self.output.info(f"{self.name} requires a compiler that supports at least C++17") return # Exclude compilers not supported - if compiler_version < minimal_version[compiler]: - raise ConanInvalidConfiguration("{} requires a compiler that supports at least C++17. {} {} is not".format( - self.name, compiler, tools.Version(self.settings.compiler.version.value))) + if compiler_version < self._compilers_minimum_version[compiler]: + raise ConanInvalidConfiguration( + f"{self.name} requires a compiler that supports at least C++17. " + f"{compiler} {Version(self.settings.compiler.version.value)} is not" + ) 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(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/deco/all/test_package/CMakeLists.txt b/recipes/deco/all/test_package/CMakeLists.txt index 00c3587be1a635..c3b92714405e83 100644 --- a/recipes/deco/all/test_package/CMakeLists.txt +++ b/recipes/deco/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) find_package(deco CONFIG REQUIRED) -add_executable(example example.cpp) -target_link_libraries(example deco::deco) -set_target_properties(example PROPERTIES CXX_STANDARD 17) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package deco::deco) +set_target_properties(test_package PROPERTIES CXX_STANDARD 17) diff --git a/recipes/deco/all/test_package/conanfile.py b/recipes/deco/all/test_package/conanfile.py index f735734fbcfa9b..ef5d7042163ecc 100644 --- a/recipes/deco/all/test_package/conanfile.py +++ b/recipes/deco/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 DecoTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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", "example") - 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/deco/all/test_package/example.cpp b/recipes/deco/all/test_package/test_package.cpp similarity index 100% rename from recipes/deco/all/test_package/example.cpp rename to recipes/deco/all/test_package/test_package.cpp diff --git a/recipes/deco/all/test_v1_package/CMakeLists.txt b/recipes/deco/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/deco/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/deco/all/test_v1_package/conanfile.py b/recipes/deco/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..f64055b093b4d3 --- /dev/null +++ b/recipes/deco/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class DecoTestConan(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/dependencies/all/conandata.yml b/recipes/dependencies/all/conandata.yml new file mode 100644 index 00000000000000..b54b3a369232fa --- /dev/null +++ b/recipes/dependencies/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "1.11.1": + "x86_64": + url: "https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release.zip" + sha256: "7d22dc00f1c09fd4415d48ad74d1cf801893e83b9a39944b0fce6dea7ceaea99" + "x86": + url: "https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x86_Release.zip" + sha256: "3e6bc62b4163c4e8035e8a597515c116343fcb76fa4315317c3cafe0bdc9e257" + "license": + url: "https://raw.githubusercontent.com/lucasg/Dependencies/v1.11.1/LICENSE" + sha256: "5d7cbf9b08285c1f89e4f4f1341090c662f4078dbf7ce8a7d392d2482e550fb6" diff --git a/recipes/dependencies/all/conanfile.py b/recipes/dependencies/all/conanfile.py new file mode 100644 index 00000000000000..f0b08ddbf4d873 --- /dev/null +++ b/recipes/dependencies/all/conanfile.py @@ -0,0 +1,50 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, download +import os + +required_conan_version = ">=1.47.0" + + +class PackageConan(ConanFile): + name = "dependencies" + description = ("Dependencies can help Windows developers troubleshooting their DLL-loading dependency issues. " + "It is a rewrite of the legacy Dependency Walker software, which was shipped along Windows SDKs, " + "but whose development stopped around 2006.") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lucasg/Dependencies" + topics = ("windows", "dll", "debugging", "pre-built") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("Dependencies is only available on Windows") + if self.settings.arch not in ["x86_64", "x86"]: + raise ConanInvalidConfiguration("Dependencies is only available for x86_64 and x86 architectures") + + def build(self): + get(self, **self.conan_data["sources"][self.version][str(self.settings.arch)], strip_root=False) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + def package(self): + 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, "*.dll", self.source_folder, os.path.join(self.package_folder, "bin"), + excludes=["msvcp*.dll", "msvcr*.dll", "vcruntime*.dll"]) + copy(self, "*.config", self.source_folder, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + # TODO: Legacy, to be removed on Conan 2.0 + bin_folder = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_folder) diff --git a/recipes/dependencies/all/test_package/conanfile.py b/recipes/dependencies/all/test_package/conanfile.py new file mode 100644 index 00000000000000..9164a4171506fe --- /dev/null +++ b/recipes/dependencies/all/test_package/conanfile.py @@ -0,0 +1,22 @@ +import sys + +from conan import ConanFile +from conan.tools.cmake import cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run(f"dependencies -chain -depth 1 {sys.executable}") + + # FYI, you can get similar info with a VCVars generator and + # self.run(f"dumpbin /imports {sys.executable}") diff --git a/recipes/dependencies/config.yml b/recipes/dependencies/config.yml new file mode 100644 index 00000000000000..2e6b30b92c1334 --- /dev/null +++ b/recipes/dependencies/config.yml @@ -0,0 +1,3 @@ +versions: + "1.11.1": + folder: all diff --git a/recipes/detools/all/CMakeLists.txt b/recipes/detools/all/CMakeLists.txt index d0a389940b0bfd..1b6ae8a07224af 100644 --- a/recipes/detools/all/CMakeLists.txt +++ b/recipes/detools/all/CMakeLists.txt @@ -1,9 +1,22 @@ -cmake_minimum_required(VERSION 3.1) -project(detools C) +cmake_minimum_required(VERSION 3.15) +project(detools LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) +find_package(heatshrink REQUIRED CONFIG) +find_package(LibLZMA REQUIRED CONFIG) -add_library(detools source_subfolder/c/detools.c) -install(TARGETS detools DESTINATION lib) -install(FILES source_subfolder/c/detools.h DESTINATION include) +add_library(detools ${DETOOLS_SRC_DIR}/c/detools.c) +target_link_libraries(detools PRIVATE + heatshrink::heatshrink + LibLZMA::LibLZMA +) + +include(GNUInstallDirs) + +install( + TARGETS detools + DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install( + FILES ${DETOOLS_SRC_DIR}/c/detools.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/detools/all/conandata.yml b/recipes/detools/all/conandata.yml index 0c05a6fd77b19f..5ae9db2bb11c94 100644 --- a/recipes/detools/all/conandata.yml +++ b/recipes/detools/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.53.0": + url: "https://github.com/eerimoq/detools/archive/refs/tags/0.53.0.tar.gz" + sha256: "9ea3b547627f5d37756023d91c701ef18fb2748b801b985e55c74c7fe8247ac2" "0.51.0": - url: "https://github.com/eerimoq/detools/archive/refs/tags/0.51.0.zip" - sha256: 604175d493a9df5d19e78a55cd183e9c44789ee552f24d1a2b7466d58628c1ac + url: "https://github.com/eerimoq/detools/archive/refs/tags/0.51.0.tar.gz" + sha256: "18e5f08fbc3c09ec9d805fd859838940f57a3f064724bad4897461f9a3c8f87c" diff --git a/recipes/detools/all/conanfile.py b/recipes/detools/all/conanfile.py index 2b8703a181ae69..d6cf90deef7f64 100644 --- a/recipes/detools/all/conanfile.py +++ b/recipes/detools/all/conanfile.py @@ -1,17 +1,20 @@ -import functools - -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os +required_conan_version = ">=1.53.0" class DetoolsConan(ConanFile): name = "detools" description = "Binary delta encoding" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/eerimoq/detools" - license = "MIT" topics = ("delta-compression", "delta-update", "delta-encoding", "ota", "bsdiff", "hdiffpatch") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,43 +25,42 @@ class DetoolsConan(ConanFile): "fPIC": True, } exports_sources = "CMakeLists.txt" - generators = "cmake" - requires = ['heatshrink/0.4.1', 'lz4/1.9.3', 'xz_utils/5.2.5'] - @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") + + def layout(self): + cmake_layout(self, src_folder="src") - @property - def _build_subfolder(self): - return "build_subfolder" + def requirements(self): + self.requires('heatshrink/0.4.1', transitive_headers=True) + self.requires('xz_utils/5.4.4', transitive_headers=True) def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: - raise ConanInvalidConfiguration("This library is only compatible with Linux and FreeBSD") - - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + raise ConanInvalidConfiguration(f"{self.ref} is only compatible with Linux and FreeBSD") 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.configure(build_folder=self._build_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DETOOLS_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/detools/all/test_package/CMakeLists.txt b/recipes/detools/all/test_package/CMakeLists.txt index 4e6b7c3b6cba8a..0b2e88f45d6b31 100644 --- a/recipes/detools/all/test_package/CMakeLists.txt +++ b/recipes/detools/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(PackageTest LANGUAGES C) find_package(detools REQUIRED CONFIG) add_executable(test_package test_package.c) -target_link_libraries(test_package detools::detools) +target_link_libraries(test_package PRIVATE detools::detools) diff --git a/recipes/detools/all/test_package/conanfile.py b/recipes/detools/all/test_package/conanfile.py index add2424f129595..ef5d7042163ecc 100644 --- a/recipes/detools/all/test_package/conanfile.py +++ b/recipes/detools/all/test_package/conanfile.py @@ -1,18 +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 DetoolsTestConan(ConanFile): +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": - # 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. - self.build_requires("cmake/3.20.1") + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -20,13 +21,6 @@ def build(self): cmake.build() def test(self): - if tools.cross_building(self): - return - - bin_path = os.path.join("bin", "test_package") - old_path = os.path.join(self.source_folder, "old") - patch_path = os.path.join(self.source_folder, "patch") - patched_path = os.path.join(self.build_folder, "patched") - - self.run(f"{bin_path} {old_path} {patch_path} {patched_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/detools/all/test_package/test_package.c b/recipes/detools/all/test_package/test_package.c index e96fd3f5f3d9ac..7567264b2867ba 100644 --- a/recipes/detools/all/test_package/test_package.c +++ b/recipes/detools/all/test_package/test_package.c @@ -1,23 +1,60 @@ #include #include "detools.h" -#define EXPECTED_PATCHED_FILE_SIZE 2780 +/* Helper functions. */ +static int flash_read(void *arg_p, void *dst_p, uintptr_t src, size_t size) +{ + return (0); +} -int main(int argc, const char *argv[]) +static int flash_write(void *arg_p, uintptr_t dst, void *src_p, size_t size) { - int res; + return (0); +} - if (argc != 4) { - printf("Wrong number of arguments.\n"); +static int flash_erase(void *arg_p, uintptr_t addr, size_t size) +{ + return (0); +} - return EXIT_FAILURE; - } +static int step_set(void *arg_p, int step) +{ + return (0); +} + +static int step_get(void *arg_p, int *step_p) +{ + return (0); +} + +static int serial_read(uint8_t *buf_p, size_t size) +{ + return (0); +} + +static int verify_written_data(int to_size, uint32_t to_crc) +{ + return (0); +} + +int main() +{ + struct detools_apply_patch_in_place_t apply_patch; + uint8_t buf[256]; + int res; + size_t patch_size = 512; - res = detools_apply_patch_filenames(argv[1], argv[2], argv[3]); + /* Initialize the in-place apply patch object. */ + res = detools_apply_patch_in_place_init(&apply_patch, + flash_read, + flash_write, + flash_erase, + step_set, + step_get, + patch_size, + NULL); - if (res == EXPECTED_PATCHED_FILE_SIZE) { - return EXIT_SUCCESS; - } else { - return EXIT_FAILURE; + if (res != 0) { + return (res); } } diff --git a/recipes/detools/config.yml b/recipes/detools/config.yml index 0cb36a4c86d323..d1a25da138f0dc 100644 --- a/recipes/detools/config.yml +++ b/recipes/detools/config.yml @@ -1,3 +1,5 @@ versions: + "0.53.0": + folder: "all" "0.51.0": folder: "all" diff --git a/recipes/detours/all/CMakeLists.txt b/recipes/detours/all/CMakeLists.txt index 08643cd4c3e753..00fec6778e9bcd 100644 --- a/recipes/detours/all/CMakeLists.txt +++ b/recipes/detours/all/CMakeLists.txt @@ -1,19 +1,15 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.12) project(conan_detours CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) +set(SOURCES_DIR ${CMAKE_CURRENT_LIST_DIR}/src) -file(GLOB DETOURS_SOURCES source_subfolder/src/*.cpp) +file(GLOB DETOURS_SOURCES ${SOURCES_DIR}/src/*.cpp) list(REMOVE_ITEM DETOURS_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/src/uimports.cpp" + "${SOURCES_DIR}/src/uimports.cpp" ) -file(GLOB DETOURS_HEADERS source_subfolder/src/*.h) +file(GLOB DETOURS_HEADERS ${SOURCES_DIR}/src/*.h) add_library(detours STATIC ${DETOURS_SOURCES} ${DETOURS_HEADERS}) include(GNUInstallDirs) -install(TARGETS detours - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" -) +install(TARGETS detours) install(FILES ${DETOURS_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/detours/all/conanfile.py b/recipes/detours/all/conanfile.py index 6d720962305858..7bea0de65a209b 100644 --- a/recipes/detours/all/conanfile.py +++ b/recipes/detours/all/conanfile.py @@ -1,35 +1,44 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools import os -required_conan_version = ">=1.45.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import chdir, copy, get, replace_in_file +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag, VCVars + +required_conan_version = ">=1.53.0" class DetoursConan(ConanFile): name = "detours" - homepage = "https://github.com/antlr/antlr4/tree/master/runtime/Cpp" description = "Detours is a software package for monitoring and instrumenting API calls on Windows" - topics = ("monitoror", "instrumenting", "hook", "injection") - url = "https://github.com/conan-io/conan-center-index" license = "MIT" - generators = "cmake" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/Detours" + topics = ("monitoring", "instrumenting", "hook", "injection", "windows") + + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" @property - def _source_subfolder(self): - return "source_subfolder" + def _target_processor(self): + return { + "x86": "X86", + "x86_64": "X64", + "armv7": "ARM", + "armv8": "ARM64", + }[str(self.settings.arch)] - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): if self.settings.os != "Windows": raise ConanInvalidConfiguration("Only os=Windows is supported") - # if not is_msvc(self): - # raise ConanInvalidConfiguration("Only the MSVC compiler is supported") if is_msvc(self) and not is_msvc_static_runtime(self): # Debug and/or dynamic runtime is undesired for a hooking library raise ConanInvalidConfiguration("Only static runtime is supported (MT)") @@ -41,58 +50,53 @@ def validate(self): raise ConanInvalidConfiguration("Unsupported architecture") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def export_sources(self): - self.copy("CMakeLists.txt") - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - @property - def _target_processor(self): - return { - "x86": "X86", - "x86_64": "X64", - "armv7": "ARM", - "armv8": "ARM64", - }[str(self.settings.arch)] - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def generate(self): + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + else: + tc = CMakeToolchain(self) + tc.generate() def _patch_sources(self): if is_msvc(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "Makefile"), - "/MT ", f"/{self.settings.compiler.runtime} ") + replace_in_file( + self, + os.path.join(self.source_folder, "src", "Makefile"), + "/MT ", + f"/{msvc_runtime_flag(self)} ", + ) def build(self): self._patch_sources() if is_msvc(self): - with tools.vcvars(self): - with tools.chdir(os.path.join(self._source_subfolder, "src")): - self.run(f"nmake DETOURS_TARGET_PROCESSOR={self._target_processor}") + with chdir(self, os.path.join(self.source_folder, "src")): + self.run(f"nmake DETOURS_TARGET_PROCESSOR={self._target_processor}") else: - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): - self.copy("LICENSE.md", src=self._source_subfolder, dst="licenses") + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if is_msvc(self): - self.copy("detours.lib", src=os.path.join(self._source_subfolder, f"lib.{self._target_processor}"), dst="lib") - self.copy("*.h", src=os.path.join(self._source_subfolder, "include"), dst="include") + copy(self, "detours.lib", + src=os.path.join(self.source_folder, f"lib.{self._target_processor}"), + dst=os.path.join(self.package_folder, "lib")) + copy(self, "*.h", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include")) else: cmake = CMake(self) cmake.install() def package_info(self): self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = [] self.cpp_info.libs = ["detours"] if self.settings.compiler == "gcc": - self.cpp_info.system_libs = [tools.stdcpp_library(self)] + self.cpp_info.system_libs = [stdcpp_library(self)] self.cpp_info.link_flags = ["-static-libgcc", "-static-libstdc++"] diff --git a/recipes/detours/all/test_package/CMakeLists.txt b/recipes/detours/all/test_package/CMakeLists.txt index 6b89b27839454d..9dd543efc7ceb3 100644 --- a/recipes/detours/all/test_package/CMakeLists.txt +++ b/recipes/detours/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(detours REQUIRED CONFIG) add_executable(victim victim.c) diff --git a/recipes/detours/all/test_package/conanfile.py b/recipes/detours/all/test_package/conanfile.py index 43240d491944cb..beb314f8f339d5 100644 --- a/recipes/detours/all/test_package/conanfile.py +++ b/recipes/detours/all/test_package/conanfile.py @@ -1,11 +1,21 @@ -from conans import ConanFile, CMake, tools import io + +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) @@ -14,9 +24,9 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") buffer = io.StringIO() - self.run(f"{bin_path} \"{os.path.join(self.build_folder, 'bin')}\"", run_environment=True, output=buffer) + self.run(f'{bin_path} "{os.path.join(self.cpp.build.bindir)}"', buffer, env="conanrun") print(buffer.getvalue()) assert "I found your message! It was 'A secret text'! I am 1337! :^)" in buffer.getvalue() diff --git a/recipes/detours/all/test_v1_package/CMakeLists.txt b/recipes/detours/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/detours/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/detours/all/test_v1_package/conanfile.py b/recipes/detours/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..43240d491944cb --- /dev/null +++ b/recipes/detours/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, CMake, tools +import io +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.verbose = 1 + 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") + buffer = io.StringIO() + self.run(f"{bin_path} \"{os.path.join(self.build_folder, 'bin')}\"", run_environment=True, output=buffer) + print(buffer.getvalue()) + assert "I found your message! It was 'A secret text'! I am 1337! :^)" in buffer.getvalue() diff --git a/recipes/dfp/all/conandata.yml b/recipes/dfp/all/conandata.yml new file mode 100644 index 00000000000000..ef5dd3970cc875 --- /dev/null +++ b/recipes/dfp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.2": + url: "https://github.com/epam/DFP/releases/download/1.0.2-cxx/native-sources.tar.gz" + sha256: "f62acab311086c1207f7d58185232c7e86e11ed606596d9afcff49703c196058" diff --git a/recipes/dfp/all/conanfile.py b/recipes/dfp/all/conanfile.py new file mode 100644 index 00000000000000..93d025c258e68f --- /dev/null +++ b/recipes/dfp/all/conanfile.py @@ -0,0 +1,71 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import copy, get + +required_conan_version = ">=1.54.0" + + +class DfpConan(ConanFile): + name = "dfp" + package_type = "library" + + # Optional metadata + description = "Decimal Floating Point Arithmetic Library" + homepage = "https://github.com/epam/DFP/" + url = "https://github.com/conan-io/conan-center-index" + license = ("Apache-2.0", "Intel") + topics = ("decimal", "dfp", "ieee-754", "deltix") + + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def configure(self): + # it's a C library + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.22.0 <4]") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "intel-eula.txt", 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 = ["ddfp"] diff --git a/recipes/dfp/all/test_package/CMakeLists.txt b/recipes/dfp/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..0fc7fa3dfb5a01 --- /dev/null +++ b/recipes/dfp/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) +set(CMAKE_CXX_STANDARD 11) + +find_package(dfp CONFIG REQUIRED) + + +add_executable(${PROJECT_NAME} src/demo.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dfp::dfp) +set_property(TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") diff --git a/recipes/dfp/all/test_package/conanfile.py b/recipes/dfp/all/test_package/conanfile.py new file mode 100644 index 00000000000000..32f908420470dc --- /dev/null +++ b/recipes/dfp/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class TestExampleConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/dfp/all/test_package/src/demo.cpp b/recipes/dfp/all/test_package/src/demo.cpp new file mode 100644 index 00000000000000..69d2647abc971e --- /dev/null +++ b/recipes/dfp/all/test_package/src/demo.cpp @@ -0,0 +1,10 @@ +#include +#include + +using namespace epam::deltix::dfp; + +int main(void) { + const Decimal64 number("42"); + std::cout << number << " : " << number.toUnderlying() << std::endl; + return 0; +} diff --git a/recipes/dfp/config.yml b/recipes/dfp/config.yml new file mode 100644 index 00000000000000..8457ca9a4a8cd8 --- /dev/null +++ b/recipes/dfp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.2": + folder: all diff --git a/recipes/di/all/BSL-1.0.txt b/recipes/di/all/BSL-1.0.txt deleted file mode 100644 index 36b7cd93cdfbac..00000000000000 --- a/recipes/di/all/BSL-1.0.txt +++ /dev/null @@ -1,23 +0,0 @@ -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/recipes/di/all/conanfile.py b/recipes/di/all/conanfile.py index 5ccda35c324e5a..25630735095f55 100644 --- a/recipes/di/all/conanfile.py +++ b/recipes/di/all/conanfile.py @@ -1,61 +1,101 @@ -from conans import ConanFile, tools -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.files import copy, get, save, load +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class DiConan(ConanFile): name = "di" + description = "DI: C++14 Dependency Injection Library." license = "BSL-1.0" - homepage = "https://github.com/boost-ext/di" url = "https://github.com/conan-io/conan-center-index" - description = "DI: C++14 Dependency Injection Library." - topics = ("dependency-injection", "metaprogramming", "design-patterns") - exports_sources = ["BSL-1.0.txt"] - settings = "compiler" - options = {"with_extensions": [True, False], "diagnostics_level": [0, 1, 2]} - default_options = {"with_extensions": False, "diagnostics_level": 1} + homepage = "https://github.com/boost-ext/di" + topics = ("dependency-injection", "metaprogramming", "design-patterns", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_extensions": [True, False], + "diagnostics_level": [0, 1, 2] + } + default_options = { + "with_extensions": False, + "diagnostics_level": 1 + } no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 14 - def configure(self): - minimal_cpp_standard = "14" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) - minimal_version = { + @property + def _compilers_minimum_version(self): + return { "gcc": "5", "clang": "3.4", "apple-clang": "10", - "Visual Studio": "15" + "Visual Studio": "15", + "msvc": "191" } + + def configure(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) compiler = str(self.settings.compiler) - if compiler not in minimal_version: - self.output.warn( - "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) - self.output.warn( - "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + if compiler not in self._compilers_minimum_version: + self.output.warning( + f"{self.name} recipe lacks information about the {compiler} compiler standard version support") + self.output.warning( + f"{self.name} requires a compiler that supports at least C++{self._min_cppstd}") return - version = tools.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)) + version = Version(self.settings.compiler.version) + if version < self._compilers_minimum_version[compiler]: + raise ConanInvalidConfiguration( + f"{self.name} requires a compiler that supports at least C++{self._min_cppstd}") - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "di-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def package(self): - self.copy("BSL-1.0.txt", src="", dst="licenses") - if self.options.with_extensions: - self.copy("*.hpp", src=os.path.join(self._source_subfolder, "extension", "include", "boost", "di", "extension"), dst=os.path.join("include", "boost", "di", "extension"), keep_path=True) - self.copy("di.hpp", src=os.path.join(self._source_subfolder, "include", "boost"), dst=os.path.join("include", "boost")) + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): self.info.requires.clear() self.info.settings.clear() del self.info.options.diagnostics_level + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _extract_license(self): + file = os.path.join(self.source_folder, "CMakeLists.txt") + file_content = load(self, file) + + license_start = file_content.find("# Copyright") + sub_end = "LICENSE_1_0.txt)" + license_end = file_content.find(sub_end) + license_contents = file_content[license_start:(license_end + len(sub_end))] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + + + def package(self): + self._extract_license() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self.options.with_extensions: + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include", "boost", "di", "extension"), + src=os.path.join(self.source_folder, "extension", "include", "boost", "di", "extension"), + keep_path=True) + copy(self, "di.hpp", + dst=os.path.join(self.package_folder, "include", "boost"), + src=os.path.join(self.source_folder, "include", "boost")) + def package_info(self): - self.cpp_info.defines.append("BOOST_DI_CFG_DIAGNOSTICS_LEVEL={}".format(self.options.diagnostics_level)) + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.defines.append( + f"BOOST_DI_CFG_DIAGNOSTICS_LEVEL={self.options.diagnostics_level}") diff --git a/recipes/di/all/test_package/CMakeLists.txt b/recipes/di/all/test_package/CMakeLists.txt index 44d785353d02dd..4ead030531af2f 100644 --- a/recipes/di/all/test_package/CMakeLists.txt +++ b/recipes/di/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1.3) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(di REQUIRED CONFIG) add_executable(example example.cpp) +target_link_libraries(example di::di) set_target_properties(example PROPERTIES CXX_STANDARD 14) -target_link_libraries(example CONAN_PKG::di) diff --git a/recipes/di/all/test_package/conanfile.py b/recipes/di/all/test_package/conanfile.py index 8d63f059b4cdca..8d52b7021efe14 100644 --- a/recipes/di/all/test_package/conanfile.py +++ b/recipes/di/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 DiConan(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) @@ -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", "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/di/all/test_v1_package/CMakeLists.txt b/recipes/di/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/di/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/di/all/test_v1_package/conanfile.py b/recipes/di/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..da134b42a75e31 --- /dev/null +++ b/recipes/di/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class DiConan(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", "example"), run_environment=True) diff --git a/recipes/dice-template-library/all/conandata.yml b/recipes/dice-template-library/all/conandata.yml index def2d951ef94ea..3dcfa182d3a53a 100644 --- a/recipes/dice-template-library/all/conandata.yml +++ b/recipes/dice-template-library/all/conandata.yml @@ -1,7 +1,10 @@ sources: + "1.1.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.1.0.tar.gz" + sha256: "a00ee401379eaf6c8af013fb39d6732fa68c3852e14b50789edde6f054647ca2" "1.0.0": url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.0.0.tar.gz" - sha256: "485505ad3f9fb033083e2952bd8b4e68f6b4f123746b20f4ec3af46f4ce66cfe" + sha256: "d0c75ec4861e2480dc7d6533125f9c2dfb3574fc2cffd15c66665b1cdfa66561" "0.3.0": url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.3.0.tar.gz" sha256: "2c02278f86c7b5fe1c684f5126f30529952a03784fa7c883cc4fd44965b3c33e" diff --git a/recipes/dice-template-library/config.yml b/recipes/dice-template-library/config.yml index 930d790eeb4ba9..f1e3df07fed832 100644 --- a/recipes/dice-template-library/config.yml +++ b/recipes/dice-template-library/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "1.0.0": folder: all "0.3.0": 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/directshowbaseclasses/all/CMakeLists.txt b/recipes/directshowbaseclasses/all/CMakeLists.txt index bb980e8f92249e..f15c0b39a2b26a 100644 --- a/recipes/directshowbaseclasses/all/CMakeLists.txt +++ b/recipes/directshowbaseclasses/all/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.12) project(strmbas) -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(DSROOT "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/Samples/Win7Samples/multimedia/directshow/baseclasses") +set(DSROOT "${CMAKE_CURRENT_SOURCE_DIR}/src/Samples/Win7Samples/multimedia/directshow/baseclasses") file(GLOB SOURCES "${DSROOT}/*.cpp") file(GLOB HEADERS "${DSROOT}/*.h") diff --git a/recipes/directshowbaseclasses/all/conanfile.py b/recipes/directshowbaseclasses/all/conanfile.py index 4f42eddc66a52d..e71fc156ca323f 100644 --- a/recipes/directshowbaseclasses/all/conanfile.py +++ b/recipes/directshowbaseclasses/all/conanfile.py @@ -1,40 +1,60 @@ -from conans import ConanFile, CMake, tools 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, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.53.0" + class DirectShowBaseClassesConan(ConanFile): name = "directshowbaseclasses" - description = "Microsoft DirectShow Base Classes are a set of C++ classes and utility functions designed for " \ - "implementing DirectShow filters" + description = ( + "Microsoft DirectShow Base Classes are a set of C++ classes and " + "utility functions designed for implementing DirectShow filters" + ) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://docs.microsoft.com/en-us/windows/desktop/directshow/directshow-base-classes" - topics = ("conan", "directshow", "dshow") - license = "MIT" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - settings = {"os": ["Windows"], "arch": ["x86", "x86_64"], "compiler": None, "build_type": None} - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" + topics = ("directshow", "dshow") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" short_paths = True + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} can only be used on Windows.") + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename('Windows-classic-samples-%s' % self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure(build_folder=self._build_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) 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 = ['strmbasd' if self.settings.build_type == 'Debug' else 'strmbase'] - self.cpp_info.system_libs = ['strmiids', 'winmm'] + self.cpp_info.libs = ["strmbasd" if self.settings.build_type == "Debug" else "strmbase"] + self.cpp_info.system_libs = ["strmiids", "winmm"] diff --git a/recipes/directshowbaseclasses/all/test_package/CMakeLists.txt b/recipes/directshowbaseclasses/all/test_package/CMakeLists.txt index 196188113685c8..888739db919dbb 100644 --- a/recipes/directshowbaseclasses/all/test_package/CMakeLists.txt +++ b/recipes/directshowbaseclasses/all/test_package/CMakeLists.txt @@ -1,8 +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(directshowbaseclasses REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE directshowbaseclasses::directshowbaseclasses) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/directshowbaseclasses/all/test_package/conanfile.py b/recipes/directshowbaseclasses/all/test_package/conanfile.py index b88a6525524a61..ef5d7042163ecc 100644 --- a/recipes/directshowbaseclasses/all/test_package/conanfile.py +++ b/recipes/directshowbaseclasses/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake +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 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): - 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/directshowbaseclasses/all/test_v1_package/CMakeLists.txt b/recipes/directshowbaseclasses/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/directshowbaseclasses/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/directshowbaseclasses/all/test_v1_package/conanfile.py b/recipes/directshowbaseclasses/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a9a22676d134f9 --- /dev/null +++ b/recipes/directshowbaseclasses/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake +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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/directx-headers/all/conandata.yml b/recipes/directx-headers/all/conandata.yml new file mode 100644 index 00000000000000..6289c24e10856e --- /dev/null +++ b/recipes/directx-headers/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.610.2": + url: "https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v1.610.2.tar.gz" + sha256: "59492497e99bd3c23f8f8aa8a709f4d7b5bc5bd5057efa8c568bbad40015a8b2" diff --git a/recipes/directx-headers/all/conanfile.py b/recipes/directx-headers/all/conanfile.py new file mode 100644 index 00000000000000..773848c7bfa5bb --- /dev/null +++ b/recipes/directx-headers/all/conanfile.py @@ -0,0 +1,87 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class DirectXHeadersConan(ConanFile): + name = "directx-headers" + description = "Headers for using D3D12" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/DirectX-Headers" + topics = ("3d", "d3d", "d3d12", "direct", "direct3d", "directx", "graphics") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "5", + "gcc": "6", + "msvc": "191", + "Visual Studio": "15", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if not self.settings.os in ["Linux", "Windows"]: + raise ConanInvalidConfiguration(f"{self.name} is not supported on {self.settings.os}") + 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 build_requirements(self): + self.tool_requires("meson/1.2.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["build-test"] = False + tc.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.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")) + + def package_info(self): + if self.settings.os == "Linux" or self.settings.get_safe("os.subsystem") == "wsl": + self.cpp_info.includedirs.append(os.path.join("include", "wsl", "stubs")) + self.cpp_info.libs = ["d3dx12-format-properties", "DirectX-Guids"] + self.cpp_info.set_property("cmake_file_name", "DirectX-Headers") + self.cpp_info.set_property("cmake_target_name", "Microsoft::DirectX-Headers") + self.cpp_info.set_property("pkg_config_name", "DirectX-Headers") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("d3d12") + if self.settings.compiler == "msvc": + self.cpp_info.system_libs.append("dxcore") diff --git a/recipes/directx-headers/all/test_package/conanfile.py b/recipes/directx-headers/all/test_package/conanfile.py new file mode 100644 index 00000000000000..5aab0703e7a4ef --- /dev/null +++ b/recipes/directx-headers/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.2") + 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/directx-headers/all/test_package/meson.build b/recipes/directx-headers/all/test_package/meson.build new file mode 100644 index 00000000000000..76e32d2ca901b1 --- /dev/null +++ b/recipes/directx-headers/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'cpp') +package_dep = dependency('DirectX-Headers') +executable('test_package', + sources : ['test_package.cpp'], + dependencies : [package_dep]) diff --git a/recipes/directx-headers/all/test_package/test_package.cpp b/recipes/directx-headers/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..274bb2436bb724 --- /dev/null +++ b/recipes/directx-headers/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() +{ + return sizeof(IID_IUnknown) == 0; +} diff --git a/recipes/directx-headers/config.yml b/recipes/directx-headers/config.yml new file mode 100644 index 00000000000000..15678ab870488a --- /dev/null +++ b/recipes/directx-headers/config.yml @@ -0,0 +1,3 @@ +versions: + "1.610.2": + folder: all diff --git a/recipes/dirent/all/conandata.yml b/recipes/dirent/all/conandata.yml index 41d2c31a73c7ac..30637c5892d6d2 100644 --- a/recipes/dirent/all/conandata.yml +++ b/recipes/dirent/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.24": + url: "https://github.com/tronkko/dirent/archive/1.24.tar.gz" + sha256: "37009127a65bb1ddc47d06c097321f87f45ca2e998b2ec3bf2e0b2b19649d6f9" "1.23.2": url: "https://github.com/tronkko/dirent/archive/1.23.2.tar.gz" sha256: "f72d39e3c39610b6901e391b140aa69b51e0eb99216939ed5e547b5dad03afb1" diff --git a/recipes/dirent/config.yml b/recipes/dirent/config.yml index 6086eb1e0524d8..bb0674fda16d81 100644 --- a/recipes/dirent/config.yml +++ b/recipes/dirent/config.yml @@ -1,3 +1,5 @@ versions: + "1.24": + folder: all "1.23.2": folder: all diff --git a/recipes/djinni-generator/all/conandata.yml b/recipes/djinni-generator/all/conandata.yml index f0faa524fc5224..3079ff38081546 100644 --- a/recipes/djinni-generator/all/conandata.yml +++ b/recipes/djinni-generator/all/conandata.yml @@ -29,3 +29,6 @@ sources: "1.3.2": url: https://github.com/cross-language-cpp/djinni-generator/releases/download/v1.3.2/djinni sha256: "8e618aeb8e9138e7fefaca804263317846799fee59d9465a4eee6625b8266ea1" + "1.4.0": + url: "https://github.com/cross-language-cpp/djinni-generator/releases/download/v1.4.0/djinni" + sha256: "1838504f29e9bd8d7246710cbf31d17abb44b2dbd7df91e08cc7566167fee068" diff --git a/recipes/djinni-generator/all/conanfile.py b/recipes/djinni-generator/all/conanfile.py index ae2c62ed78bb57..f6319f3914356b 100644 --- a/recipes/djinni-generator/all/conanfile.py +++ b/recipes/djinni-generator/all/conanfile.py @@ -1,37 +1,60 @@ import os -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import copy, download +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.47.0" class Djinni(ConanFile): name = "djinni-generator" + description = "Djinni is a tool for generating cross-language type declarations and interface bindings." + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://djinni.xlcpp.dev" - description = "Djinni is a tool for generating cross-language type declarations and interface bindings." topics = ("java", "Objective-C", "ios", "Android") - license = "Apache-2.0" - settings = "os", "arch" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type def source(self): filename = os.path.basename(self.conan_data["sources"][self.version]["url"]) - tools.download(filename=filename, **self.conan_data["sources"][self.version]) - tools.download(filename="LICENSE", url="https://raw.githubusercontent.com/cross-language-cpp/djinni-generator/main/LICENSE") + download(self, filename=filename, **self.conan_data["sources"][self.version]) + download(self, filename="LICENSE", url="https://raw.githubusercontent.com/cross-language-cpp/djinni-generator/main/LICENSE") def build(self): pass # avoid warning for missing build steps def package(self): - if tools.detected_os() == "Windows": - os.rename('djinni','djinni.bat') - self.copy("djinni.bat", dst="bin", keep_path=False) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + keep_path=False) + copy(self, "djinni", + dst=os.path.join(self.package_folder, "bin"), + src=self.source_folder, + keep_path=False) + if self.settings.os == "Windows": + os.rename(os.path.join(self.package_folder, "bin", "djinni"), + os.path.join(self.package_folder, "bin", "djinni.bat")) else: - self.copy("djinni", dst="bin", keep_path=False) executable = os.path.join(self.package_folder, "bin", "djinni") os.chmod(executable, os.stat(executable).st_mode | 0o111) - self.copy("LICENSE", dst="licenses", keep_path=False) def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] self.cpp_info.includedirs = [] - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + # TODO: Legacy, to be removed on Conan 2.0 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/djinni-generator/all/test_package/conanfile.py b/recipes/djinni-generator/all/test_package/conanfile.py index 456428a9a86702..7d899a138c0dd2 100644 --- a/recipes/djinni-generator/all/test_package/conanfile.py +++ b/recipes/djinni-generator/all/test_package/conanfile.py @@ -1,21 +1,25 @@ - from io import StringIO -from conans import ConanFile, tools + +from conan import ConanFile +from conan.tools.build import can_run + class TestPackageConan(ConanFile): - settings = "os", "arch" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" - def build(self): - pass # please no warning that we build nothing + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - if not tools.cross_building(self.settings): + if can_run(self): output = StringIO() - self.run("djinni --help", output=output, run_environment=True) - output.seek(0, 0) + self.run("djinni --help", output) + output.seek(0) found_usage = False for line in output: if "Usage: djinni [options]" in line: found_usage = True break - assert(found_usage) + assert found_usage diff --git a/recipes/djinni-generator/all/test_v1_package/conanfile.py b/recipes/djinni-generator/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..456428a9a86702 --- /dev/null +++ b/recipes/djinni-generator/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ + +from io import StringIO +from conans import ConanFile, tools + +class TestPackageConan(ConanFile): + settings = "os", "arch" + + def build(self): + pass # please no warning that we build nothing + + def test(self): + if not tools.cross_building(self.settings): + output = StringIO() + self.run("djinni --help", output=output, run_environment=True) + output.seek(0, 0) + found_usage = False + for line in output: + if "Usage: djinni [options]" in line: + found_usage = True + break + assert(found_usage) diff --git a/recipes/djinni-generator/config.yml b/recipes/djinni-generator/config.yml index 47d0ee6875d8a4..c523a45caabe79 100644 --- a/recipes/djinni-generator/config.yml +++ b/recipes/djinni-generator/config.yml @@ -19,3 +19,5 @@ versions: folder: "all" "1.3.2": folder: "all" + "1.4.0": + folder: "all" diff --git a/recipes/djinni-support-lib/1.x.x/CMakeLists.txt b/recipes/djinni-support-lib/1.x.x/CMakeLists.txt deleted file mode 100644 index 0afabb3cbe2e0c..00000000000000 --- a/recipes/djinni-support-lib/1.x.x/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(conan_cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory("source_subfolder") diff --git a/recipes/djinni-support-lib/1.x.x/conandata.yml b/recipes/djinni-support-lib/1.x.x/conandata.yml index d35c553da9ba87..10c1b916311e10 100644 --- a/recipes/djinni-support-lib/1.x.x/conandata.yml +++ b/recipes/djinni-support-lib/1.x.x/conandata.yml @@ -1,13 +1,29 @@ sources: - "1.0.0": - url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.0.0.tar.gz - sha256: "25f8c648c3bec78a54d5387a792f1d7cd3c073c4477dc50ad2b9c5270a590779" + "1.2.1": + url: "https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.2.1.tar.gz" + sha256: "ed64d3466ad7f13971913b5bd70c608a558a6b8574d9dbd8779dcdce9b97521b" + "1.2.0": + url: "https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.2.0.tar.gz" + sha256: "3630870c2b3305dc6216f8ca8e37139f3f59f2ea7bd600a1154c5aa1c4d983a9" "1.1.0": - url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.1.0.tar.gz + url: "https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.1.0.tar.gz" sha256: "3a67d1c26959a9df5c158fdf0792e036149009b206ed89fcee8c7b1608187336" + "1.0.0": + url: "https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.0.0.tar.gz" + sha256: "25f8c648c3bec78a54d5387a792f1d7cd3c073c4477dc50ad2b9c5270a590779" +patches: "1.2.0": - url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.2.0.tar.gz - sha256: "3630870c2b3305dc6216f8ca8e37139f3f59f2ea7bd600a1154c5aa1c4d983a9" - "1.2.1": - url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v1.2.1.tar.gz - sha256: "ed64d3466ad7f13971913b5bd70c608a558a6b8574d9dbd8779dcdce9b97521b" + - patch_file: "patches/fix-missing-include.patch" + patch_source: "https://github.com/cross-language-cpp/djinni-support-lib/commit/ac0e9f4f633ad8bfc1378db8954af4f1f88c1f4f" + patch_description: "Fix missing #include " + patch_type: "backport" + "1.1.0": + - patch_file: "patches/fix-missing-include.patch" + patch_source: "https://github.com/cross-language-cpp/djinni-support-lib/commit/ac0e9f4f633ad8bfc1378db8954af4f1f88c1f4f" + patch_description: "Fix missing #include " + patch_type: "backport" + "1.0.0": + - patch_file: "patches/fix-missing-include.patch" + patch_source: "https://github.com/cross-language-cpp/djinni-support-lib/commit/ac0e9f4f633ad8bfc1378db8954af4f1f88c1f4f" + patch_description: "Fix missing #include " + patch_type: "backport" diff --git a/recipes/djinni-support-lib/1.x.x/conanfile.py b/recipes/djinni-support-lib/1.x.x/conanfile.py index 61920459f5086e..ef96684a7eec47 100644 --- a/recipes/djinni-support-lib/1.x.x/conanfile.py +++ b/recipes/djinni-support-lib/1.x.x/conanfile.py @@ -1,145 +1,175 @@ import os -from conans import ConanFile, CMake, 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.env import VirtualBuildEnv +from conan.tools.files import collect_libs, copy, get, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +required_conan_version = ">=1.53.0" -class DjinniSuppotLib(ConanFile): + +class DjinniSupportLib(ConanFile): name = "djinni-support-lib" - homepage = "https://djinni.xlcpp.dev" - url = "https://github.com/conan-io/conan-center-index" description = "Djinni is a tool for generating cross-language type declarations and interface bindings" - topics = ("java", "Objective-C", "Android", "iOS") license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://djinni.xlcpp.dev" + topics = ("java", "Objective-C", "Android", "iOS") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], - "fPIC": [True, False], - "target": ["jni", "objc", "python", "cppcli", "auto", "deprecated"], - "with_jni": [True, False, "auto"], - "with_objc": [True, False, "auto"], - "with_python": [True, False, "auto"], - "with_cppcli": [True, False, "auto"], - "system_java": [True, False] - } - default_options = {"shared": False, - "fPIC": True, - "target": "deprecated", - "with_jni": "auto", - "with_objc": "auto", - "with_python": "auto", - "with_cppcli": "auto", - "system_java": False, - } - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package" - - _cmake = None + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_jni": [True, False, "auto"], + "with_objc": [True, False, "auto"], + "with_python": [True, False, "auto"], + "with_cppcli": [True, False, "auto"], + "system_java": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_jni": "auto", + "with_objc": "auto", + "with_python": "auto", + "with_cppcli": "auto", + "system_java": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + elif self.settings.os == "Android": + self.options.system_java = True @property def _objc_support(self): - if self.options.with_objc == "auto" or self.options.target == "auto": - return tools.is_apple_os(self.settings.os) + if self.options.with_objc == "auto": + return is_apple_os(self) else: - return self.options.with_objc == True or self.options.target == "objc" + return self.options.with_objc @property def _jni_support(self): - if self.options.with_jni == "auto" or self.options.target == "auto": + if self.options.with_jni == "auto": return self.settings.os == "Android" else: - return self.options.with_jni == True or self.options.target == "jni" + return self.options.with_jni @property def _python_support(self): - return self.options.with_python == True or self.options.target == "python" + return self.options.with_python @property def _cppcli_support(self): - if self.options.with_cppcli == "auto" or self.options.target == "auto": + if self.options.with_cppcli == "auto": return self.settings.os == "Windows" else: - return self.options.with_cppcli == True or self.options.target == "cppcli" - - def configure(self): - if self.settings.compiler == "Visual Studio" or self.options.shared: - del self.options.fPIC - - @property - def _source_subfolder(self): - return "source_subfolder" - - def build_requirements(self): - if not self.options.system_java and self._jni_support: - self.build_requires("zulu-openjdk/11.0.12@") - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - elif self.settings.os == "Android": - self.options.system_java = True + return self.options.with_cppcli @property def _supported_compilers(self): return { "gcc": "8", "clang": "7", - "Visual Studio": "15", "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", } + def configure(self): + if is_msvc(self) or self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + def validate(self): - if self.options.target != "deprecated": - self.output.warn("The 'target' option is deprecated and will be removed soon. Use 'with_jni', 'with_objc', 'with_python' or 'with_cppcli' options instead.") if not (self._objc_support or self._jni_support or self._python_support or self._cppcli_support): - raise ConanInvalidConfiguration("Target language could not be determined automatically. Set at least one of 'with_jni', 'with_objc', 'with_python' or 'with_cppcli' options to `True`.") + raise ConanInvalidConfiguration( + "Target language could not be determined automatically. Set at least one of 'with_jni'," + " 'with_objc', 'with_python' or 'with_cppcli' options to `True`." + ) if self._cppcli_support: if self.settings.os != "Windows": - raise ConanInvalidConfiguration("C++/CLI has been enabled on a non-Windows operating system. This is not supported.") + raise ConanInvalidConfiguration( + "C++/CLI has been enabled on a non-Windows operating system. This is not supported." + ) + if self._objc_support or self._jni_support or self._python_support: + raise ConanInvalidConfiguration( + "C++/CLI is not yet supported with other languages enabled as well. " + "Disable 'with_jni', 'with_objc' and 'with_python' options for a valid configuration." + ) if self.options.shared: raise ConanInvalidConfiguration("C++/CLI does not support building as shared library") - if self.settings.compiler.runtime == "MT" or self.settings.compiler.runtime == "MTd": + if is_msvc_static_runtime(self): raise ConanInvalidConfiguration("'/clr' and '/MT' command-line options are incompatible") - if self._objc_support or self._jni_support or self._python_support: - raise ConanInvalidConfiguration( - "C++/CLI is not yet supported with other languages enabled as well. Disable 'with_jni', 'with_objc' and 'with_python' options for a valid configuration.") if self._python_support: if self.settings.os == "Windows": - raise ConanInvalidConfiguration("Python on Windows is not fully yet supported, please see https://github.com/cross-language-cpp/djinni-support-lib/issues.") + raise ConanInvalidConfiguration( + "Python on Windows is not fully yet supported, please see" + " https://github.com/cross-language-cpp/djinni-support-lib/issues." + ) if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "17") + check_min_cppstd(self, "17") try: minimum_required_compiler_version = self._supported_compilers[str(self.settings.compiler)] - if tools.Version(self.settings.compiler.version) < minimum_required_compiler_version: - raise ConanInvalidConfiguration("This package requires c++17 support. The current compiler does not support it.") + if Version(self.settings.compiler.version) < minimum_required_compiler_version: + raise ConanInvalidConfiguration( + "This package requires c++17 support. The current compiler does not support it." + ) except KeyError: - self.output.warn("This recipe has no support for the current compiler. Please consider adding it.") + self.output.warning( + "This recipe has no support for the current compiler. Please consider adding it." + ) + + def build_requirements(self): + if not self.options.system_java and self._jni_support: + self.build_requires("zulu-openjdk/11.0.19") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["DJINNI_WITH_OBJC"] = self._objc_support - self._cmake.definitions["DJINNI_WITH_JNI"] = self._jni_support - self._cmake.definitions["DJINNI_WITH_PYTHON"] = self._python_support - self._cmake.definitions["DJINNI_WITH_CPPCLI"] = self._cppcli_support - self._cmake.definitions["BUILD_TESTING"] = False + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.variables["DJINNI_WITH_OBJC"] = self._objc_support + tc.variables["DJINNI_WITH_JNI"] = self._jni_support + tc.variables["DJINNI_WITH_PYTHON"] = self._python_support + tc.variables["DJINNI_WITH_CPPCLI"] = self._cppcli_support + tc.variables["BUILD_TESTING"] = False if self._jni_support: - self._cmake.definitions["JAVA_AWT_LIBRARY"] = "NotNeeded" - self._cmake.definitions["JAVA_AWT_INCLUDE_PATH"] = "NotNeeded" - self._cmake.configure() - return self._cmake + tc.variables["JAVA_AWT_LIBRARY"] = "NotNeeded" + tc.variables["JAVA_AWT_INCLUDE_PATH"] = "NotNeeded" + tc.generate() + tc = CMakeDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/djinni-support-lib/1.x.x/patches/fix-missing-include.patch b/recipes/djinni-support-lib/1.x.x/patches/fix-missing-include.patch new file mode 100644 index 00000000000000..03996b5c265117 --- /dev/null +++ b/recipes/djinni-support-lib/1.x.x/patches/fix-missing-include.patch @@ -0,0 +1,22 @@ +From ac0e9f4f633ad8bfc1378db8954af4f1f88c1f4f Mon Sep 17 00:00:00 2001 +From: Denis Pershin +Date: Tue, 9 Nov 2021 19:36:50 +0700 +Subject: [PATCH] Fix compilation on gcc 11.2 (#67) + +Add include memory for standard smart pointer +--- + djinni/cwrapper/wrapper_marshal.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/djinni/cwrapper/wrapper_marshal.hpp b/djinni/cwrapper/wrapper_marshal.hpp +index 75a75d1..6d6a7cc 100644 +--- a/djinni/cwrapper/wrapper_marshal.hpp ++++ b/djinni/cwrapper/wrapper_marshal.hpp +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + + #ifdef __cplusplus + extern "C" { diff --git a/recipes/djinni-support-lib/1.x.x/test_package/CMakeLists.txt b/recipes/djinni-support-lib/1.x.x/test_package/CMakeLists.txt index 6c1d84c7e3d823..b118a50a53af83 100644 --- a/recipes/djinni-support-lib/1.x.x/test_package/CMakeLists.txt +++ b/recipes/djinni-support-lib/1.x.x/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(djinni-support-lib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE djinni-support-lib::djinni-support-lib) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/djinni-support-lib/1.x.x/test_package/conanfile.py b/recipes/djinni-support-lib/1.x.x/test_package/conanfile.py index ed8aa8b7e0ebb7..ef5d7042163ecc 100644 --- a/recipes/djinni-support-lib/1.x.x/test_package/conanfile.py +++ b/recipes/djinni-support-lib/1.x.x/test_package/conanfile.py @@ -1,19 +1,26 @@ -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 _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): - cmake = self._configure_cmake() + 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) + 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/djinni-support-lib/1.x.x/test_package/test_package.cpp b/recipes/djinni-support-lib/1.x.x/test_package/test_package.cpp index 9228c8f56407e5..acdc2e577622c7 100644 --- a/recipes/djinni-support-lib/1.x.x/test_package/test_package.cpp +++ b/recipes/djinni-support-lib/1.x.x/test_package/test_package.cpp @@ -1,11 +1,9 @@ #include + #include // since we would either need objective C++ or Java (jni) there is not a lot to test -// just that we have the hearders and can link +// just that we have the headers and can link int main() { - return EXIT_SUCCESS ; + return EXIT_SUCCESS; } - - - diff --git a/recipes/djinni-support-lib/1.x.x/test_v1_package/CMakeLists.txt b/recipes/djinni-support-lib/1.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/djinni-support-lib/1.x.x/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/djinni-support-lib/1.x.x/test_v1_package/conanfile.py b/recipes/djinni-support-lib/1.x.x/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c534d392ac09f9 --- /dev/null +++ b/recipes/djinni-support-lib/1.x.x/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + 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/djinni-support-lib/all/CMakeLists.txt b/recipes/djinni-support-lib/all/CMakeLists.txt deleted file mode 100644 index 0afabb3cbe2e0c..00000000000000 --- a/recipes/djinni-support-lib/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(conan_cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory("source_subfolder") diff --git a/recipes/djinni-support-lib/all/conandata.yml b/recipes/djinni-support-lib/all/conandata.yml index dea5fe156fcc11..fae655bf2e6d51 100644 --- a/recipes/djinni-support-lib/all/conandata.yml +++ b/recipes/djinni-support-lib/all/conandata.yml @@ -1,9 +1,7 @@ sources: "0.0.1": - url: https://github.com/cross-language-cpp/djinni-support-lib/archive/v0.0.1.tar.gz + url: "https://github.com/cross-language-cpp/djinni-support-lib/archive/v0.0.1.tar.gz" sha256: "ddef30a95a8bd325446d3a76ea9c11f198f3b33f66157217bd46fb13d75c43d2" patches: "0.0.1": - patch_file: "patches/cmake_install.patch" - base_path: "source_subfolder" - diff --git a/recipes/djinni-support-lib/all/conanfile.py b/recipes/djinni-support-lib/all/conanfile.py index 97c05458fb3605..0957b9e7315cfd 100644 --- a/recipes/djinni-support-lib/all/conanfile.py +++ b/recipes/djinni-support-lib/all/conanfile.py @@ -1,93 +1,104 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +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, collect_libs, copy, export_conandata_patches, get -class DjinniSuppotLib(ConanFile): +required_conan_version = ">=1.53.0" + + +class DjinniSupportLib(ConanFile): name = "djinni-support-lib" - homepage = "https://djinni.xlcpp.dev" - url = "https://github.com/conan-io/conan-center-index" description = "Djinni is a tool for generating cross-language type declarations and interface bindings" - topics = ("java", "Objective-C", "Android", "iOS") license = "Apache-2.0" - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], - "fPIC": [True, False], - "target": ["jni", "objc", "auto"], - "system_java": [True, False] - } - default_options = {"shared": False, - "fPIC": True , - "target": "auto", - "system_java": False - } - exports_sources = ["patches/**", "CMakeLists.txt"] - generators = "cmake", "cmake_find_package" - - _cmake = None + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://djinni.xlcpp.dev" + topics = ("java", "Objective-C", "Android", "iOS") - @property - def objc_support(self): - if self.options.target == "auto": - return tools.is_apple_os(self.settings.os) - else: - return self.options.target == "objc" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "target": ["jni", "objc", "auto"], + "system_java": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "target": "auto", + "system_java": False, + } @property - def jni_support(self): - if self.options.target == "auto": - return self.settings.os not in ["iOS", "watchOS", "tvOS"] - else: - return self.options.target == "jni" + def _objc_support(self): + return self.options.target == "objc" @property - def _source_subfolder(self): - return "source_subfolder" + def _jni_support(self): + return self.options.target == "jni" - def build_requirements(self): - if not self.options.system_java: - self.build_requires("zulu-openjdk/11.0.8@") + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + # Set default target based on OS + self.options.target = "objc" if is_apple_os(self) else "jni" 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 build_requirements(self): + if not self.options.system_java and self._jni_support: + self.tool_requires("zulu-openjdk/21.0.1") 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 _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True if not self.options.shared: - self._cmake.definitions["DJINNI_STATIC_LIB"] = True - self._cmake.definitions["DJINNI_WITH_OBJC"] = self.objc_support - self._cmake.definitions["DJINNI_WITH_JNI"] = self.jni_support - if self.jni_support: - self._cmake.definitions["JAVA_AWT_LIBRARY"] = "NotNeeded" - self._cmake.definitions["JAVA_AWT_INCLUDE_PATH"] = "NotNeeded" - self._cmake.configure() - return self._cmake + tc.variables["DJINNI_STATIC_LIB"] = True + tc.variables["DJINNI_WITH_OBJC"] = self._objc_support + tc.variables["DJINNI_WITH_JNI"] = self._jni_support + if self._jni_support: + tc.variables["JAVA_AWT_LIBRARY"] = "NotNeeded" + tc.variables["JAVA_AWT_INCLUDE_PATH"] = self.source_folder.replace("\\", "/") + tc.generate() + tc = CMakeDeps(self) + tc.generate() + tc = VirtualBuildEnv(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): - 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) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) # these should not be here, but to support old generated files .... - if self.objc_support: + if self._objc_support: self.cpp_info.includedirs.append(os.path.join("include", "djinni", "objc")) - if self.jni_support: + if self._jni_support: self.cpp_info.includedirs.append(os.path.join("include", "djinni", "jni")) + + if self._objc_support: + self.cpp_info.frameworks = ["Foundation", "CoreFoundation"] diff --git a/recipes/djinni-support-lib/all/test_package/CMakeLists.txt b/recipes/djinni-support-lib/all/test_package/CMakeLists.txt index 33ae887aa6aea3..67f60b7a2aed7c 100644 --- a/recipes/djinni-support-lib/all/test_package/CMakeLists.txt +++ b/recipes/djinni-support-lib/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(djinni-support-lib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE djinni-support-lib::djinni-support-lib) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/djinni-support-lib/all/test_package/conanfile.py b/recipes/djinni-support-lib/all/test_package/conanfile.py index ed8aa8b7e0ebb7..ef5d7042163ecc 100644 --- a/recipes/djinni-support-lib/all/test_package/conanfile.py +++ b/recipes/djinni-support-lib/all/test_package/conanfile.py @@ -1,19 +1,26 @@ -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 _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): - cmake = self._configure_cmake() + 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) + 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/djinni-support-lib/all/test_package/test_package.cpp b/recipes/djinni-support-lib/all/test_package/test_package.cpp index 9228c8f56407e5..acdc2e577622c7 100644 --- a/recipes/djinni-support-lib/all/test_package/test_package.cpp +++ b/recipes/djinni-support-lib/all/test_package/test_package.cpp @@ -1,11 +1,9 @@ #include + #include // since we would either need objective C++ or Java (jni) there is not a lot to test -// just that we have the hearders and can link +// just that we have the headers and can link int main() { - return EXIT_SUCCESS ; + return EXIT_SUCCESS; } - - - diff --git a/recipes/djinni-support-lib/all/test_v1_package/CMakeLists.txt b/recipes/djinni-support-lib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/djinni-support-lib/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/djinni-support-lib/all/test_v1_package/conanfile.py b/recipes/djinni-support-lib/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c534d392ac09f9 --- /dev/null +++ b/recipes/djinni-support-lib/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def _configure_cmake(self): + cmake = CMake(self) + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + 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/dlib/all/CMakeLists.txt b/recipes/dlib/all/CMakeLists.txt deleted file mode 100644 index 1c22f049379454..00000000000000 --- a/recipes/dlib/all/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -# Include the dlib subdirectory to skip a check -add_subdirectory(source_subfolder/dlib) 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 b6ccf5c0b9123d..bad5b166dc9bfe 100644 --- a/recipes/dlib/all/conanfile.py +++ b/recipes/dlib/all/conanfile.py @@ -1,13 +1,14 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, replace_in_file, copy, rmdir, collect_libs, rm +from conan.tools.build import check_min_cppstd from conan.tools.microsoft import is_msvc from conan.tools.scm import Version -from conans import CMake, tools -import functools +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.45.0" + +required_conan_version = ">=1.53.0" class DlibConan(ConanFile): @@ -17,7 +18,7 @@ class DlibConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "http://dlib.net" license = "BSL-1.0" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -46,16 +47,23 @@ class DlibConan(ConanFile): "with_openblas": True, } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + if Version(self.version) < "19.24.2": + return 11 + return 14 @property - def _build_subfolder(self): - return "build_subfolder" + 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): @@ -63,17 +71,20 @@ def _has_with_webp_option(self): def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") if self.settings.arch not in ["x86", "x86_64"]: - del self.options.with_sse2 - del self.options.with_sse4 - del self.options.with_avx + self.options.rm_safe("with_sse2") + self.options.rm_safe("with_sse4") + self.options.rm_safe("with_avx") if not self._has_with_webp_option: - del self.options.with_webp + self.options.rm_safe("with_webp") 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_gif: @@ -83,98 +94,103 @@ def requirements(self): if self.options.with_png: self.requires("libpng/1.6.40") if self.options.get_safe("with_webp"): - self.requires("libwebp/1.3.1") + self.requires("libwebp/1.3.2") if self.options.with_sqlite3: - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/3.44.2") if self.options.with_openblas: self.requires("openblas/0.3.20") 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 is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration("dlib can not be built as a shared library with Visual Studio") - if self.settings.os == "Macos" and self.settings.arch == "armv8": - raise ConanInvalidConfiguration("dlib doesn't support macOS M1") + raise ConanInvalidConfiguration(f"{self.ref} does not support shared on Windows. See https://github.com/davisking/dlib/issues/1483.") def source(self): - get(self, **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): - dlib_cmakelists = os.path.join(self._source_subfolder, "dlib", "CMakeLists.txt") + dlib_cmakelists = os.path.join(self.source_folder, "dlib", "CMakeLists.txt") # robust giflib injection - tools.replace_in_file(dlib_cmakelists, "${GIF_LIBRARY}", "GIF::GIF") + replace_in_file(self, dlib_cmakelists, "${GIF_LIBRARY}", "GIF::GIF") # robust libjpeg injection for cmake_file in [ dlib_cmakelists, - os.path.join(self._source_subfolder, "dlib", "cmake_utils", "find_libjpeg.cmake"), - os.path.join(self._source_subfolder, "dlib", "cmake_utils", "test_for_libjpeg", "CMakeLists.txt"), + os.path.join(self.source_folder, "dlib", "cmake_utils", "find_libjpeg.cmake"), + os.path.join(self.source_folder, "dlib", "cmake_utils", "test_for_libjpeg", "CMakeLists.txt"), ]: - tools.replace_in_file(cmake_file, "${JPEG_LIBRARY}", "JPEG::JPEG") + replace_in_file(self, cmake_file, "${JPEG_LIBRARY}", "JPEG::JPEG") # robust libpng injection for cmake_file in [ dlib_cmakelists, - os.path.join(self._source_subfolder, "dlib", "cmake_utils", "find_libpng.cmake"), - os.path.join(self._source_subfolder, "dlib", "cmake_utils", "test_for_libpng", "CMakeLists.txt"), + os.path.join(self.source_folder, "dlib", "cmake_utils", "find_libpng.cmake"), + os.path.join(self.source_folder, "dlib", "cmake_utils", "test_for_libpng", "CMakeLists.txt"), ]: - tools.replace_in_file(cmake_file, "${PNG_LIBRARIES}", "PNG::PNG") + replace_in_file(self, cmake_file, "${PNG_LIBRARIES}", "PNG::PNG") # robust sqlite3 injection - tools.replace_in_file(dlib_cmakelists, "find_library(sqlite sqlite3)", "find_package(SQLite3 REQUIRED)") - tools.replace_in_file(dlib_cmakelists, "find_path(sqlite_path sqlite3.h)", "") - tools.replace_in_file(dlib_cmakelists, "if (sqlite AND sqlite_path)", "if(1)") - tools.replace_in_file(dlib_cmakelists, "${sqlite}", "SQLite::SQLite3") + if self.options.with_sqlite3: + replace_in_file(self, dlib_cmakelists, "find_library(sqlite sqlite3)", "find_package(SQLite3 REQUIRED)") + replace_in_file(self, dlib_cmakelists, "find_path(sqlite_path sqlite3.h)", "") + replace_in_file(self, dlib_cmakelists, "if (sqlite AND sqlite_path)", "if(1)") + replace_in_file(self, dlib_cmakelists, "${sqlite}", "SQLite::SQLite3") # robust libwebp injection if self._has_with_webp_option: - tools.replace_in_file(dlib_cmakelists, "include(cmake_utils/find_libwebp.cmake)", "find_package(WebP REQUIRED)") - tools.replace_in_file(dlib_cmakelists, "if (WEBP_FOUND)", "if(1)") - tools.replace_in_file(dlib_cmakelists, "${WEBP_LIBRARY}", "WebP::webp") + replace_in_file(self, dlib_cmakelists, "include(cmake_utils/find_libwebp.cmake)", "find_package(WebP REQUIRED)") + replace_in_file(self, dlib_cmakelists, "if (WEBP_FOUND)", "if(1)") + replace_in_file(self, dlib_cmakelists, "${WEBP_LIBRARY}", "WebP::webp") + if self.options.with_png: + replace_in_file(self, dlib_cmakelists, "include(cmake_utils/find_libpng.cmake)", "find_package(PNG REQUIRED)") + if self.options.with_jpeg: + replace_in_file(self, dlib_cmakelists, "include(cmake_utils/find_libjpeg.cmake)", "find_package(JPEG REQUIRED)") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) + def generate(self): + tc = CMakeToolchain(self) # With in-project builds dlib is always built as a static library, # we want to be able to build it as a shared library too - cmake.definitions["DLIB_IN_PROJECT_BUILD"] = False - - cmake.definitions["DLIB_ISO_CPP_ONLY"] = False - cmake.definitions["DLIB_NO_GUI_SUPPORT"] = True + tc.variables["DLIB_IN_PROJECT_BUILD"] = False + tc.variables["DLIB_ISO_CPP_ONLY"] = False + tc.variables["DLIB_NO_GUI_SUPPORT"] = True # Configure external dependencies - cmake.definitions["DLIB_JPEG_SUPPORT"] = self.options.with_jpeg + tc.variables["DLIB_JPEG_SUPPORT"] = self.options.with_jpeg if self._has_with_webp_option: - cmake.definitions["DLIB_WEBP_SUPPORT"] = self.options.with_webp - cmake.definitions["DLIB_LINK_WITH_SQLITE3"] = self.options.with_sqlite3 - cmake.definitions["DLIB_USE_BLAS"] = True # FIXME: all the logic behind is not sufficiently under control - cmake.definitions["DLIB_USE_LAPACK"] = True # FIXME: all the logic behind is not sufficiently under control - cmake.definitions["DLIB_USE_CUDA"] = False # TODO: add with_cuda option? - cmake.definitions["DLIB_PNG_SUPPORT"] = self.options.with_png - cmake.definitions["DLIB_GIF_SUPPORT"] = self.options.with_gif - cmake.definitions["DLIB_USE_MKL_FFT"] = False + tc.variables["DLIB_WEBP_SUPPORT"] = self.options.with_webp + tc.variables["DLIB_LINK_WITH_SQLITE3"] = self.options.with_sqlite3 + tc.variables["DLIB_USE_BLAS"] = True # FIXME: all the logic behind is not sufficiently under control + tc.variables["DLIB_USE_LAPACK"] = True # FIXME: all the logic behind is not sufficiently under control + tc.variables["DLIB_USE_CUDA"] = False # TODO: add with_cuda option? + tc.variables["DLIB_PNG_SUPPORT"] = self.options.with_png + tc.variables["DLIB_GIF_SUPPORT"] = self.options.with_gif + tc.variables["DLIB_USE_MKL_FFT"] = False # Configure SIMD options if possible if self.settings.arch in ["x86", "x86_64"]: if self.options.with_sse2 != "auto": - cmake.definitions["USE_SSE2_INSTRUCTIONS"] = self.options.with_sse2 + tc.variables["USE_SSE2_INSTRUCTIONS"] = self.options.with_sse2 if self.options.with_sse4 != "auto": - cmake.definitions["USE_SSE4_INSTRUCTIONS"] = self.options.with_sse4 + tc.variables["USE_SSE4_INSTRUCTIONS"] = self.options.with_sse4 if self.options.with_avx != "auto": - cmake.definitions["USE_AVX_INSTRUCTIONS"] = self.options.with_avx - - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.variables["USE_AVX_INSTRUCTIONS"] = self.options.with_avx + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "dlib")) cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - - self.copy("LICENSE.txt", "licenses", os.path.join(self._source_subfolder, "dlib"), keep_path=False) - - # Remove configuration files + copy(self, "LICENSE.txt", src=os.path.join(self.source_folder, "dlib"), dst=os.path.join(self.package_folder, "licenses"), keep_path=False) for dir_to_remove in [ os.path.join("lib", "cmake"), os.path.join("lib", "pkgconfig"), @@ -182,15 +198,15 @@ def package(self): os.path.join("include", "dlib", "external", "pybind11", "tools") ]: rmdir(self, os.path.join(self.package_folder, dir_to_remove)) + rm(self, "*.txt", os.path.join(self.package_folder, "include", "dlib")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "dlib") self.cpp_info.set_property("cmake_target_name", "dlib::dlib") self.cpp_info.set_property("pkg_config_name", "dlib-1") - self.cpp_info.libs = tools.collect_libs(self) + # INFO: Unix systems use dlib as library name, but on Windows it includes settings, e.g dlib19.24.0_release_64bit_msvc1933.lib + self.cpp_info.libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["pthread"] + self.cpp_info.system_libs = ["pthread", "nsl"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32", "winmm", "comctl32", "gdi32", "imm32"] - - self.cpp_info.names["pkg_config"] = "dlib-1" diff --git a/recipes/dlib/all/test_package/CMakeLists.txt b/recipes/dlib/all/test_package/CMakeLists.txt index 50caaa372ec830..a2e5f6c5bb3a5a 100644 --- a/recipes/dlib/all/test_package/CMakeLists.txt +++ b/recipes/dlib/all/test_package/CMakeLists.txt @@ -1,11 +1,13 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) find_package(dlib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} dlib::dlib) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE dlib::dlib) + +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/all/test_package/conanfile.py b/recipes/dlib/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/dlib/all/test_package/conanfile.py +++ b/recipes/dlib/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/dlib/all/test_v1_package/CMakeLists.txt b/recipes/dlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..be00a8c7f57c71 --- /dev/null +++ b/recipes/dlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +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/dlib/all/test_v1_package/conanfile.py b/recipes/dlib/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..e0660e0801b965 --- /dev/null +++ b/recipes/dlib/all/test_v1_package/conanfile.py @@ -0,0 +1,15 @@ +import os +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.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/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/docopt.cpp/all/conanfile.py b/recipes/docopt.cpp/all/conanfile.py index 0745cc959331b1..f91d97fba08924 100644 --- a/recipes/docopt.cpp/all/conanfile.py +++ b/recipes/docopt.cpp/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): def requirements(self): if self.options.boost_regex: - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/doxygen/all/conandata.yml b/recipes/doxygen/all/conandata.yml index b6735dc89d5170..32fdd824d1e939 100644 --- a/recipes/doxygen/all/conandata.yml +++ b/recipes/doxygen/all/conandata.yml @@ -23,23 +23,41 @@ patches: patch_description: "Enable modern compilers" patch_type: "portability" patch_source: "https://github.com/doxygen/doxygen/commit/5198966c8d5fec89116d025c74934ac03ea511fa" + - patch_file: "patches/1.9.4-0002-fix-iconv-linkage.patch" + patch_description: "Replace IConv CMake variables by Conan CMake targets" + patch_type: "conan" "1.9.2": - patch_file: "patches/1.9.2-0001-imported-target.patch" patch_description: "Fix includes" patch_type: "portability" + - patch_file: "patches/1.9.2-0002-fix-iconv-linkage.patch" + patch_description: "Replace IConv CMake variables by Conan CMake targets" + patch_type: "conan" "1.9.1": - patch_file: "patches/1.9.1-0001-imported-target.patch" patch_description: "Fix includes" patch_type: "portability" + - patch_file: "patches/1.9.1-0002-fix-iconv-linkage.patch" + patch_description: "Replace IConv CMake variables by Conan CMake targets" + patch_type: "conan" "1.8.20": - patch_file: "patches/1.8-0001-xapian.patch" patch_description: "Fix xapian find_package command" patch_type: "portability" + - patch_file: "patches/1.8.20-0002-fix-iconv-linkage.patch" + patch_description: "Replace IConv CMake variables by Conan CMake targets" + patch_type: "conan" "1.8.18": - patch_file: "patches/1.8-0001-xapian.patch" patch_description: "Fix xapian find_package command" patch_type: "portability" + - patch_file: "patches/1.8.18-0002-fix-iconv-linkage.patch" + patch_description: "Replace IConv CMake variables by Conan CMake targets" + patch_type: "conan" "1.8.17": - patch_file: "patches/1.8-0001-xapian.patch" patch_description: "Fix xapian find_package command" patch_type: "portability" + - patch_file: "patches/1.8.17-0002-fix-iconv-linkage.patch" + patch_description: "Replace IConv CMake variables by Conan CMake targets" + patch_type: "conan" diff --git a/recipes/doxygen/all/conanfile.py b/recipes/doxygen/all/conanfile.py index 7b30ce53b00608..e3bd611aea91d2 100644 --- a/recipes/doxygen/all/conanfile.py +++ b/recipes/doxygen/all/conanfile.py @@ -21,10 +21,12 @@ class DoxygenConan(ConanFile): options = { "enable_parse": [True, False], "enable_search": [True, False], + "enable_app": [True, False], } default_options = { "enable_parse": True, "enable_search": True, + "enable_app": False, } @property @@ -52,10 +54,10 @@ def layout(self): def requirements(self): if self.options.enable_search: self.requires("xapian-core/1.4.19") - self.requires("zlib/1.2.13") - - def package_id(self): - del self.info.settings.compiler + self.requires("zlib/[>=1.2.11 <2]") + if self.options.enable_app or self.options.enable_parse: + # INFO: Doxygen uses upper case CMake variables to link/include IConv, so we are using patches for targets. + self.requires("libiconv/1.17") def compatibility(self): return [{"settings": [("build_type", "Release")]}] @@ -81,6 +83,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["build_parse"] = self.options.enable_parse tc.variables["build_search"] = self.options.enable_search + tc.variables["build_app"] = self.options.enable_app tc.variables["use_libc++"] = self.settings.compiler.get_safe("libcxx") == "libc++" tc.variables["win_static"] = is_msvc_static_runtime(self) tc.generate() @@ -103,6 +106,8 @@ def package_info(self): self.cpp_info.set_property("cmake_find_mode", "none") self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m"] # TODO: to remove in conan v2 self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/doxygen/all/patches/1.8.17-0002-fix-iconv-linkage.patch b/recipes/doxygen/all/patches/1.8.17-0002-fix-iconv-linkage.patch new file mode 100644 index 00000000000000..39ee7635002561 --- /dev/null +++ b/recipes/doxygen/all/patches/1.8.17-0002-fix-iconv-linkage.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cd0fcaaca..67e0808ae 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -109,6 +109,7 @@ if (sqlite3) + endif() + + find_package(Iconv REQUIRED) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${ICONV_INCLUDE_DIR}) + + +diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt +index ae52cabc3..73e1e3d29 100644 +--- a/addon/doxyapp/CMakeLists.txt ++++ b/addon/doxyapp/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${CMAKE_SOURCE_DIR}/src +@@ -26,7 +27,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt +index 2387f1b3c..cbf451037 100644 +--- a/addon/doxyparse/CMakeLists.txt ++++ b/addon/doxyparse/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${CMAKE_SOURCE_DIR}/src +@@ -26,7 +27,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 23460d004..8f2c51012 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -325,7 +325,7 @@ target_link_libraries(doxygen + doxygen_version + vhdlparser + ${SQLITE3_LIBRARIES} +- ${ICONV_LIBRARIES} ++ Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_LIBS} + ${CLANG_LIBS} +-- + diff --git a/recipes/doxygen/all/patches/1.8.18-0002-fix-iconv-linkage.patch b/recipes/doxygen/all/patches/1.8.18-0002-fix-iconv-linkage.patch new file mode 100644 index 00000000000000..9bd67ebc094cd5 --- /dev/null +++ b/recipes/doxygen/all/patches/1.8.18-0002-fix-iconv-linkage.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 20c87dc6f..cd8527618 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -110,6 +110,7 @@ if (sqlite3) + endif() + + find_package(Iconv REQUIRED) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${ICONV_INCLUDE_DIR}) + + +diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt +index ae52cabc3..73e1e3d29 100644 +--- a/addon/doxyapp/CMakeLists.txt ++++ b/addon/doxyapp/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${CMAKE_SOURCE_DIR}/src +@@ -26,7 +27,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt +index 2387f1b3c..cbf451037 100644 +--- a/addon/doxyparse/CMakeLists.txt ++++ b/addon/doxyparse/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${CMAKE_SOURCE_DIR}/src +@@ -26,7 +27,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b7d4af271..6f9a032c0 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -321,7 +321,7 @@ target_link_libraries(doxygen + doxygen_version + vhdlparser + ${SQLITE3_LIBRARIES} +- ${ICONV_LIBRARIES} ++ Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_LIBS} + ${CLANG_LIBS} +-- + diff --git a/recipes/doxygen/all/patches/1.8.20-0002-fix-iconv-linkage.patch b/recipes/doxygen/all/patches/1.8.20-0002-fix-iconv-linkage.patch new file mode 100644 index 00000000000000..c32eb989530391 --- /dev/null +++ b/recipes/doxygen/all/patches/1.8.20-0002-fix-iconv-linkage.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 35e6a0c2d..71f609898 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -117,6 +117,7 @@ if (sqlite3) + endif() + + find_package(Iconv REQUIRED) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${ICONV_INCLUDE_DIR}) + + +diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt +index a6a776a31..ba29331c0 100644 +--- a/addon/doxyapp/CMakeLists.txt ++++ b/addon/doxyapp/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${CMAKE_SOURCE_DIR}/src +@@ -31,7 +32,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt +index 8df99ab6b..034a93a4f 100644 +--- a/addon/doxyparse/CMakeLists.txt ++++ b/addon/doxyparse/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${CMAKE_SOURCE_DIR}/src +@@ -31,7 +32,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index cb289116e..2dab461e2 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -356,7 +356,7 @@ target_link_libraries(doxygen PRIVATE + doxygen_version + vhdlparser + ${SQLITE3_LIBRARIES} +- ${ICONV_LIBRARIES} ++ Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_LIBS} + ${CLANG_LIBS} +-- + diff --git a/recipes/doxygen/all/patches/1.9.1-0002-fix-iconv-linkage.patch b/recipes/doxygen/all/patches/1.9.1-0002-fix-iconv-linkage.patch new file mode 100644 index 00000000000000..6a3bb242473259 --- /dev/null +++ b/recipes/doxygen/all/patches/1.9.1-0002-fix-iconv-linkage.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 06b9696f2..a70245b54 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -118,6 +118,7 @@ if (sqlite3) + endif() + + find_package(Iconv REQUIRED) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${ICONV_INCLUDE_DIR}) + + +diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt +index 707fdedbf..8d51b76f7 100644 +--- a/addon/doxyapp/CMakeLists.txt ++++ b/addon/doxyapp/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${PROJECT_SOURCE_DIR}/src +@@ -43,7 +44,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt +index fe2f2c2ff..131354e95 100644 +--- a/addon/doxyparse/CMakeLists.txt ++++ b/addon/doxyparse/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${PROJECT_SOURCE_DIR}/src +@@ -31,7 +32,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5004a9578..c63399bc1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -351,7 +351,7 @@ target_link_libraries(doxygen PRIVATE + doxygen_version + vhdlparser + ${SQLITE3_LIBRARIES} +- ${ICONV_LIBRARIES} ++ Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_LIBS} + ${CLANG_LIBS} +-- + diff --git a/recipes/doxygen/all/patches/1.9.2-0002-fix-iconv-linkage.patch b/recipes/doxygen/all/patches/1.9.2-0002-fix-iconv-linkage.patch new file mode 100644 index 00000000000000..699ac1e93addc4 --- /dev/null +++ b/recipes/doxygen/all/patches/1.9.2-0002-fix-iconv-linkage.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 251e18b77..4df454b39 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -118,6 +118,7 @@ if (sqlite3) + endif() + + find_package(Iconv REQUIRED) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${ICONV_INCLUDE_DIR}) + + +diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt +index a6fde4285..e19fc3d22 100644 +--- a/addon/doxyapp/CMakeLists.txt ++++ b/addon/doxyapp/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${PROJECT_SOURCE_DIR}/src +@@ -42,7 +43,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt +index f439c29d9..e56b9a1de 100644 +--- a/addon/doxyparse/CMakeLists.txt ++++ b/addon/doxyparse/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${PROJECT_SOURCE_DIR}/src +@@ -30,7 +31,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 18406488d..5c7144582 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -360,7 +360,7 @@ target_link_libraries(doxygen PRIVATE + doxygen_version + vhdlparser + ${SQLITE3_LIBRARIES} +- ${ICONV_LIBRARIES} ++ Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_LIBS} + ${CLANG_LIBS} +-- + diff --git a/recipes/doxygen/all/patches/1.9.4-0002-fix-iconv-linkage.patch b/recipes/doxygen/all/patches/1.9.4-0002-fix-iconv-linkage.patch new file mode 100644 index 00000000000000..c8e1489aa5a64b --- /dev/null +++ b/recipes/doxygen/all/patches/1.9.4-0002-fix-iconv-linkage.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d9765964e..05784dd8f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -147,6 +147,7 @@ if (sqlite3) + endif() + + find_package(Iconv REQUIRED) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${ICONV_INCLUDE_DIR}) + + +diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt +index bcc4393d4..95d06cee2 100644 +--- a/addon/doxyapp/CMakeLists.txt ++++ b/addon/doxyapp/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${PROJECT_SOURCE_DIR}/src +@@ -44,7 +45,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt +index 774756640..eb64c8895 100644 +--- a/addon/doxyparse/CMakeLists.txt ++++ b/addon/doxyparse/CMakeLists.txt +@@ -1,4 +1,5 @@ + find_package(Iconv) ++get_target_property(ICONV_INCLUDE_DIR Iconv::Iconv INTERFACE_INCLUDE_DIRECTORIES) + + include_directories( + ${PROJECT_SOURCE_DIR}/src +@@ -33,7 +34,7 @@ mscgen + doxygen_version + doxycfg + vhdlparser +-${ICONV_LIBRARIES} ++Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${SQLITE3_LIBRARIES} + ${EXTRA_LIBS} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9f7e65364..8d332a30a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -359,7 +359,7 @@ target_link_libraries(doxygen PRIVATE + doxygen_version + vhdlparser + ${SQLITE3_LIBRARIES} +- ${ICONV_LIBRARIES} ++ Iconv::Iconv + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_LIBS} + ${CLANG_LIBS} +-- + diff --git a/recipes/doxygen/all/test_package/CMakeLists.txt b/recipes/doxygen/all/test_package/CMakeLists.txt deleted file mode 100644 index f0e28d12efb4d3..00000000000000 --- a/recipes/doxygen/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(test_package LANGUAGES CXX) - -find_package(Doxygen REQUIRED) - -add_executable(${PROJECT_NAME} test_package.cpp) - -doxygen_add_docs(docs test_package.cpp ALL COMMENT "generate HTML") diff --git a/recipes/doxygen/all/test_package/conanfile.py b/recipes/doxygen/all/test_package/conanfile.py index 0bcb6db477b624..17e0d51d2d0e20 100644 --- a/recipes/doxygen/all/test_package/conanfile.py +++ b/recipes/doxygen/all/test_package/conanfile.py @@ -1,28 +1,16 @@ from conan import ConanFile -from conan.tools.cmake import cmake_layout, CMake -from conan.errors import ConanException -import os +from conan.tools.build import can_run class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv" + generators = "VirtualBuildEnv" test_type = "explicit" - def layout(self): - cmake_layout(self) - def build_requirements(self): self.tool_requires(self.tested_reference_str) - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - def test(self): - if not os.path.isdir(os.path.join(self.build_folder, "html")): - raise ConanException("doxygen did not create html documentation directory") - - self.output.info("Version:") - self.run("doxygen --version") + if can_run(self): + self.output.info("Doxygen Version:") + self.run("doxygen --version") diff --git a/recipes/doxygen/all/test_package/test_package.cpp b/recipes/doxygen/all/test_package/test_package.cpp deleted file mode 100644 index 4caefdf4a378f3..00000000000000 --- a/recipes/doxygen/all/test_package/test_package.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -/// \brief just a simple main function for the hello world -int main() -{ - std::cout << "bincrafters" << std::endl; - return 0; -} diff --git a/recipes/doxygen/all/test_v1_package/conanfile.py b/recipes/doxygen/all/test_v1_package/conanfile.py deleted file mode 100644 index d659dafd309f30..00000000000000 --- a/recipes/doxygen/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +0,0 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - - def build(self): - if not tools.cross_building(self, skip_x64_x86=True): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - if not os.path.isdir(os.path.join(self.build_folder, "test_package", "html")): - raise ConanException("doxygen did not create html documentation directory") - - self.output.info("Version:") - self.run("doxygen --version", run_environment=True) diff --git a/recipes/drogon/all/conandata.yml b/recipes/drogon/all/conandata.yml index 3ee3725bb502de..32fb63a308bd7d 100644 --- a/recipes/drogon/all/conandata.yml +++ b/recipes/drogon/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.9.0": + url: "https://github.com/drogonframework/drogon/archive/v1.9.0.tar.gz" + sha256: "35793c1b64c32ebbea5a6cb3b1c22bcd0820e948674ecba92022ec05b41c848b" + "1.8.7": + url: "https://github.com/drogonframework/drogon/archive/v1.8.7.tar.gz" + sha256: "d2d80d35becd69bf80d74bf09b69425193f1b7be3926bd44f3ac7b951e54465d" + "1.8.6": + url: "https://github.com/drogonframework/drogon/archive/v1.8.6.tar.gz" + sha256: "ff02979f28047e97e19e36d1f363b3052b8122975fa8a379305d746dfe5fb004" + "1.8.5": + url: "https://github.com/drogonframework/drogon/archive/v1.8.5.tar.gz" + sha256: "9469f99408c114bc1e89945a3a8dab4640ea6d8cb06e7d42f06c1dfda3f71d2a" "1.8.4": url: "https://github.com/drogonframework/drogon/archive/v1.8.4.tar.gz" sha256: "6f2f59ead0f0c37b0aac4bc889cbaedf3c2540f3020e892596c72f0a4d887a18" @@ -15,6 +27,34 @@ sources: url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.7.5.tar.gz" sha256: "e2af7c55dcabafef16f26f5b3242692f5a2b54c19b7b626840bf9132d24766f6" patches: + "1.9.0": + - patch_file: "patches/1.8.5-0001-remove-shared-libs.patch" + patch_description: "remove shared libs option" + patch_type: "conan" + - patch_file: "patches/1.9.0-0002-find-cci-packages.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" + "1.8.7": + - patch_file: "patches/1.8.5-0001-remove-shared-libs.patch" + patch_description: "remove shared libs option" + patch_type: "conan" + - patch_file: "patches/1.8.6-0002-find-cci-packages.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" + "1.8.6": + - patch_file: "patches/1.8.5-0001-remove-shared-libs.patch" + patch_description: "remove shared libs option" + patch_type: "conan" + - patch_file: "patches/1.8.6-0002-find-cci-packages.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" + "1.8.5": + - patch_file: "patches/1.8.5-0001-remove-shared-libs.patch" + patch_description: "remove shared libs option" + patch_type: "conan" + - patch_file: "patches/1.8.5-0002-find-cci-packages.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" "1.8.4": - patch_file: "patches/1.8.4-0001-remove-shared-libs.patch" patch_description: "remove shared libs option" @@ -28,6 +68,10 @@ patches: - patch_file: "patches/1.8.4-0004-find-package-yaml-cpp.patch" patch_description: "Fix yaml-cpp cmake target name" patch_type: "conan" + - patch_file: "patches/1.8.2-0004-support-gcc13.patch" + patch_description: "Fix compilation error on gcc13 with C++17" + patch_type: "portability" + patch_source: "https://github.com/drogonframework/drogon/pull/1563/" "1.8.3": - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" patch_description: "Consume Trantor package from Conan instead of using the\ @@ -39,6 +83,10 @@ patches: - patch_file: "patches/1.8.3-0003-find-package-sqlite.patch" patch_description: "Fix sqlite cmake target name" patch_type: "conan" + - patch_file: "patches/1.8.2-0004-support-gcc13.patch" + patch_description: "Fix compilation error on gcc13 with C++17" + patch_type: "portability" + patch_source: "https://github.com/drogonframework/drogon/pull/1563/" "1.8.2": - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" patch_description: "Consume Trantor package from Conan instead of using the\ @@ -50,6 +98,10 @@ patches: - patch_file: "patches/1.8.2-0003-find-package-sqlite.patch" patch_description: "Fix sqlite cmake target name" patch_type: "conan" + - patch_file: "patches/1.8.2-0004-support-gcc13.patch" + patch_description: "Fix compilation error on gcc13 with C++17" + patch_type: "portability" + patch_source: "https://github.com/drogonframework/drogon/pull/1563/" "1.8.0": - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" patch_description: "Consume Trantor package from Conan instead of using the subproject" diff --git a/recipes/drogon/all/conanfile.py b/recipes/drogon/all/conanfile.py index 80dc0d02645002..44120c268dd5cb 100644 --- a/recipes/drogon/all/conanfile.py +++ b/recipes/drogon/all/conanfile.py @@ -14,10 +14,11 @@ class DrogonConan(ConanFile): name = "drogon" description = "A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows" - topics = ("http-server", "non-blocking-io", "http-framework", "asynchronous-programming") license = "MIT" - homepage = "https://github.com/drogonframework/drogon" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/drogonframework/drogon" + topics = ("http-server", "non-blocking-io", "http-framework", "asynchronous-programming") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [False, True], @@ -49,7 +50,6 @@ class DrogonConan(ConanFile): "with_sqlite": False, "with_redis": False, } - package_type = "library" def export_sources(self): export_conandata_patches(self) @@ -57,6 +57,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "1.8.4": + del self.options.with_yaml_cpp def configure(self): if self.options.shared: @@ -108,28 +110,28 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires boost on C++14") def requirements(self): - self.requires("trantor/1.5.11", transitive_headers=True, transitive_libs=True) + self.requires("trantor/1.5.14", transitive_headers=True, transitive_libs=True) self.requires("jsoncpp/1.9.5", transitive_headers=True, transitive_libs=True) self.requires("openssl/[>=1.1 <4]") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.settings.os == "Linux": - self.requires("libuuid/1.0.3") + self.requires("util-linux-libuuid/2.39.2") if self.options.with_profile: self.requires("coz/cci.20210322") if self.options.with_boost: - self.requires("boost/1.82.0", transitive_headers=True) + self.requires("boost/1.83.0", transitive_headers=True) if self.options.with_brotli: - self.requires("brotli/1.0.9") + self.requires("brotli/1.1.0") if self.options.get_safe("with_postgres"): - self.requires("libpq/14.7") + self.requires("libpq/15.4") if self.options.get_safe("with_mysql"): - self.requires("libmysqlclient/8.0.31") + self.requires("libmysqlclient/8.1.0") if self.options.get_safe("with_sqlite"): - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/3.44.2") if self.options.get_safe("with_redis"): - self.requires("hiredis/1.1.0") - if self.options.with_yaml_cpp: - self.requires("yaml-cpp/0.7.0") + self.requires("hiredis/1.2.0") + if self.options.get_safe("with_yaml_cpp", False): + self.requires("yaml-cpp/0.8.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -146,7 +148,7 @@ def generate(self): tc.variables["BUILD_DROGON_SHARED"] = self.options.shared tc.variables["BUILD_DOC"] = False tc.variables["BUILD_BROTLI"] = self.options.with_brotli - tc.variables["BUILD_YAML_CONFIG"] = self.options.with_yaml_cpp + tc.variables["BUILD_YAML_CONFIG"] = self.options.get_safe("with_yaml_cpp", False) tc.variables["BUILD_POSTGRESQL"] = self.options.get_safe("with_postgres", False) tc.variables["BUILD_POSTGRESQL_BATCH"] = self.options.get_safe("with_postgres_batch", False) tc.variables["BUILD_MYSQL"] = self.options.get_safe("with_mysql", False) diff --git a/recipes/drogon/all/patches/1.8.2-0004-support-gcc13.patch b/recipes/drogon/all/patches/1.8.2-0004-support-gcc13.patch new file mode 100644 index 00000000000000..477d23fb1fd63f --- /dev/null +++ b/recipes/drogon/all/patches/1.8.2-0004-support-gcc13.patch @@ -0,0 +1,12 @@ +diff --git a/lib/inc/drogon/RateLimiter.h b/lib/inc/drogon/RateLimiter.h +index 3b8706b..dece795 100644 +--- a/lib/inc/drogon/RateLimiter.h ++++ b/lib/inc/drogon/RateLimiter.h +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + namespace drogon + { diff --git a/recipes/drogon/all/patches/1.8.5-0001-remove-shared-libs.patch b/recipes/drogon/all/patches/1.8.5-0001-remove-shared-libs.patch new file mode 100644 index 00000000000000..9920eee5341394 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.5-0001-remove-shared-libs.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index db95642..e3e7fcf 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,7 +8,6 @@ option(BUILD_CTL "Build drogon_ctl" ON) + option(BUILD_EXAMPLES "Build examples" ON) + option(BUILD_ORM "Build orm" ON) + option(COZ_PROFILING "Use coz for profiling" OFF) +-option(BUILD_SHARED_LIBS "Build drogon as a shared lib" OFF) + option(BUILD_DOC "Build Doxygen documentation" OFF) + option(BUILD_BROTLI "Build Brotli" ON) + option(BUILD_YAML_CONFIG "Build yaml config" ON) diff --git a/recipes/drogon/all/patches/1.8.5-0002-find-cci-packages.patch b/recipes/drogon/all/patches/1.8.5-0002-find-cci-packages.patch new file mode 100644 index 00000000000000..8bf9e60842f932 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.5-0002-find-cci-packages.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e3e7fcf..d1032da 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -198,9 +198,9 @@ else() + endif() + + # jsoncpp +-find_package(Jsoncpp REQUIRED) +-target_link_libraries(${PROJECT_NAME} PUBLIC Jsoncpp_lib) +-list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${JSONCPP_INCLUDE_DIRS}) ++find_package(jsoncpp REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC jsoncpp_lib) ++list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${jsoncpp_INCLUDE_DIRS}) + + # yamlcpp + if(BUILD_YAML_CONFIG) +@@ -212,7 +212,7 @@ if(BUILD_YAML_CONFIG) + message(STATUS "yaml-cpp not used") + else() + message(STATUS "yaml-cpp found ") +- target_link_libraries(${PROJECT_NAME} PUBLIC ${YAML_CPP_LINK_LIBRARY}) ++ target_link_libraries(${PROJECT_NAME} PUBLIC yaml-cpp) + target_compile_definitions(${PROJECT_NAME} PUBLIC HAS_YAML_CPP) + endif() + else() +@@ -442,7 +442,7 @@ if (BUILD_SQLITE) + find_package(SQLite3 QUIET) + find_package(unofficial-sqlite3 QUIET) + if (SQLite3_FOUND) +- target_link_libraries(${PROJECT_NAME} PRIVATE SQLite3_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) + set(DROGON_FOUND_SQLite3 TRUE) + elseif (unofficial-sqlite3_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::sqlite3::sqlite3) +@@ -465,10 +465,10 @@ if (BUILD_SQLITE) + endif (BUILD_SQLITE) + + if (BUILD_REDIS) +- find_package(Hiredis) +- if (Hiredis_FOUND) ++ find_package(hiredis) ++ if (hiredis_FOUND) + add_definitions(-DUSE_REDIS) +- target_link_libraries(${PROJECT_NAME} PRIVATE Hiredis_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE hiredis::hiredis) + set(DROGON_SOURCES + ${DROGON_SOURCES} + nosql_lib/redis/src/RedisClientImpl.cc +@@ -488,10 +488,10 @@ if (BUILD_REDIS) + nosql_lib/redis/src/SubscribeContext.h + nosql_lib/redis/src/RedisSubscriberImpl.h) + +- endif (Hiredis_FOUND) ++ endif () + endif (BUILD_REDIS) + +-if (NOT Hiredis_FOUND) ++if (NOT hiredis_FOUND) + set(DROGON_SOURCES + ${DROGON_SOURCES} + lib/src/RedisClientSkipped.cc +@@ -500,7 +500,7 @@ if (NOT Hiredis_FOUND) + set(private_headers + ${private_headers} + lib/src/RedisClientManager.h) +-endif (NOT Hiredis_FOUND) ++endif () + + if (BUILD_TESTING) + add_subdirectory(nosql_lib/redis/tests) diff --git a/recipes/drogon/all/patches/1.8.6-0002-find-cci-packages.patch b/recipes/drogon/all/patches/1.8.6-0002-find-cci-packages.patch new file mode 100644 index 00000000000000..3da404b88ccc2b --- /dev/null +++ b/recipes/drogon/all/patches/1.8.6-0002-find-cci-packages.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a3ba35a..26fed2a 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -198,9 +198,9 @@ else() + endif() + + # jsoncpp +-find_package(Jsoncpp REQUIRED) +-target_link_libraries(${PROJECT_NAME} PUBLIC Jsoncpp_lib) +-list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${JSONCPP_INCLUDE_DIRS}) ++find_package(jsoncpp REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC jsoncpp_lib) ++list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${jsoncpp_INCLUDE_DIRS}) + + # yamlcpp + if(BUILD_YAML_CONFIG) +@@ -212,7 +212,7 @@ if(BUILD_YAML_CONFIG) + message(STATUS "yaml-cpp not used") + else() + message(STATUS "yaml-cpp found ") +- target_link_libraries(${PROJECT_NAME} PUBLIC ${YAML_CPP_LINK_LIBRARY}) ++ target_link_libraries(${PROJECT_NAME} PUBLIC yaml-cpp) + target_compile_definitions(${PROJECT_NAME} PUBLIC HAS_YAML_CPP) + endif() + else() +@@ -444,7 +444,7 @@ if (BUILD_SQLITE) + find_package(SQLite3 QUIET) + find_package(unofficial-sqlite3 QUIET) + if (SQLite3_FOUND) +- target_link_libraries(${PROJECT_NAME} PRIVATE SQLite3_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) + set(DROGON_FOUND_SQLite3 TRUE) + elseif (unofficial-sqlite3_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::sqlite3::sqlite3) +@@ -467,10 +467,10 @@ if (BUILD_SQLITE) + endif (BUILD_SQLITE) + + if (BUILD_REDIS) +- find_package(Hiredis) +- if (Hiredis_FOUND) ++ find_package(hiredis) ++ if (hiredis_FOUND) + add_definitions(-DUSE_REDIS) +- target_link_libraries(${PROJECT_NAME} PRIVATE Hiredis_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE hiredis::hiredis) + set(DROGON_SOURCES + ${DROGON_SOURCES} + nosql_lib/redis/src/RedisClientImpl.cc +@@ -490,10 +490,10 @@ if (BUILD_REDIS) + nosql_lib/redis/src/SubscribeContext.h + nosql_lib/redis/src/RedisSubscriberImpl.h) + +- endif (Hiredis_FOUND) ++ endif () + endif (BUILD_REDIS) + +-if (NOT Hiredis_FOUND) ++if (NOT hiredis_FOUND) + set(DROGON_SOURCES + ${DROGON_SOURCES} + lib/src/RedisClientSkipped.cc +@@ -502,7 +502,7 @@ if (NOT Hiredis_FOUND) + set(private_headers + ${private_headers} + lib/src/RedisClientManager.h) +-endif (NOT Hiredis_FOUND) ++endif () + + if (BUILD_TESTING) + add_subdirectory(nosql_lib/redis/tests) diff --git a/recipes/drogon/all/patches/1.9.0-0002-find-cci-packages.patch b/recipes/drogon/all/patches/1.9.0-0002-find-cci-packages.patch new file mode 100644 index 00000000000000..cf206b982069b9 --- /dev/null +++ b/recipes/drogon/all/patches/1.9.0-0002-find-cci-packages.patch @@ -0,0 +1,72 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5799759..1db8ed3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -164,9 +164,10 @@ endif() + + + # jsoncpp +-find_package(Jsoncpp REQUIRED) +-target_link_libraries(${PROJECT_NAME} PUBLIC Jsoncpp_lib) +-list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${JSONCPP_INCLUDE_DIRS}) ++find_package(jsoncpp REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC jsoncpp_lib) ++list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${jsoncpp_INCLUDE_DIRS}) ++ + + # yamlcpp + if(BUILD_YAML_CONFIG) +@@ -178,7 +179,7 @@ if(BUILD_YAML_CONFIG) + message(STATUS "yaml-cpp not used") + else() + message(STATUS "yaml-cpp found ") +- target_link_libraries(${PROJECT_NAME} PUBLIC ${YAML_CPP_LINK_LIBRARY}) ++ target_link_libraries(${PROJECT_NAME} PUBLIC yaml-cpp) + target_compile_definitions(${PROJECT_NAME} PUBLIC HAS_YAML_CPP) + endif() + else() +@@ -412,7 +413,7 @@ if (BUILD_SQLITE) + find_package(SQLite3 QUIET) + find_package(unofficial-sqlite3 QUIET) + if (SQLite3_FOUND) +- target_link_libraries(${PROJECT_NAME} PRIVATE SQLite3_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) + set(DROGON_FOUND_SQLite3 TRUE) + elseif (unofficial-sqlite3_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::sqlite3::sqlite3) +@@ -435,10 +436,10 @@ if (BUILD_SQLITE) + endif (BUILD_SQLITE) + + if (BUILD_REDIS) +- find_package(Hiredis) +- if (Hiredis_FOUND) ++ find_package(hiredis) ++ if (hiredis_FOUND) + add_definitions(-DUSE_REDIS) +- target_link_libraries(${PROJECT_NAME} PRIVATE Hiredis_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE hiredis::hiredis) + set(DROGON_SOURCES + ${DROGON_SOURCES} + nosql_lib/redis/src/RedisClientImpl.cc +@@ -458,10 +459,10 @@ if (BUILD_REDIS) + nosql_lib/redis/src/SubscribeContext.h + nosql_lib/redis/src/RedisSubscriberImpl.h) + +- endif (Hiredis_FOUND) ++ endif () + endif (BUILD_REDIS) + +-if (NOT Hiredis_FOUND) ++if (NOT hiredis_FOUND) + set(DROGON_SOURCES + ${DROGON_SOURCES} + lib/src/RedisClientSkipped.cc +@@ -470,7 +471,7 @@ if (NOT Hiredis_FOUND) + set(private_headers + ${private_headers} + lib/src/RedisClientManager.h) +-endif (NOT Hiredis_FOUND) ++endif () + + if (BUILD_TESTING) + add_subdirectory(nosql_lib/redis/tests) diff --git a/recipes/drogon/config.yml b/recipes/drogon/config.yml index 7b7f0bad90e217..fb2e690403f068 100644 --- a/recipes/drogon/config.yml +++ b/recipes/drogon/config.yml @@ -1,4 +1,12 @@ versions: + "1.9.0": + folder: "all" + "1.8.7": + folder: "all" + "1.8.6": + folder: "all" + "1.8.5": + folder: "all" "1.8.4": folder: "all" "1.8.3": diff --git a/recipes/drwav/all/conandata.yml b/recipes/drwav/all/conandata.yml index 449e35d180bee0..cfc31466349bcf 100644 --- a/recipes/drwav/all/conandata.yml +++ b/recipes/drwav/all/conandata.yml @@ -1,4 +1,8 @@ sources: + # NOTE: https://github.com/mackron/dr_libs/blob/d35a3bc5efd02455d98cbe12b94647136f09b42d/dr_wav.h#L3 + "0.13.12": + url: https://github.com/mackron/dr_libs/archive/d35a3bc5efd02455d98cbe12b94647136f09b42d.zip + sha256: "4886462b8ed26f12b8bceccb80f1447075ed5e73240089f2a78e0c32b444b370" # NOTE: https://github.com/mackron/dr_libs/blob/4f6da71ed357ade92dc91f00e6be7301ec9a82a3/dr_wav.h#L3 "0.13.7": url: https://github.com/mackron/dr_libs/archive/4f6da71ed357ade92dc91f00e6be7301ec9a82a3.zip diff --git a/recipes/drwav/config.yml b/recipes/drwav/config.yml index 6c8f065f79d492..b1c16872231f4b 100644 --- a/recipes/drwav/config.yml +++ b/recipes/drwav/config.yml @@ -1,4 +1,6 @@ versions: + "0.13.12": + folder: all "0.13.7": folder: all "0.13.6": diff --git a/recipes/dsp-filters/all/conandata.yml b/recipes/dsp-filters/all/conandata.yml new file mode 100644 index 00000000000000..17f324a8e1446b --- /dev/null +++ b/recipes/dsp-filters/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "cci.20170309": + url: "https://github.com/vinniefalco/DSPFilters/archive/acc49170e79a94fcb9c04b8a2116e9f8dffd1c7d.tar.gz" + sha256: "330c3960e55b8cdbf041d8ec4790a21a326dc331e43bf14c144ae5d88a47d53d" +patches: + "cci.20170309": + - patch_file: "patches/0001-remove-explicit-cmake-options.patch" + patch_description: "Remove explicit STATIC and FPIC options in CMakeLists.txt" + patch_type: "conan" + - patch_file: "patches/0002-remove-msvc-cmake-flags.patch" + patch_description: "Remove MY_FLAGS options in CMakeLists.txt" + patch_type: "conan" diff --git a/recipes/dsp-filters/all/conanfile.py b/recipes/dsp-filters/all/conanfile.py new file mode 100644 index 00000000000000..d4ef17870d0514 --- /dev/null +++ b/recipes/dsp-filters/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, rename +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + +class DSPFiltersConan(ConanFile): + name = "dsp-filters" + description = "Set of DSP filters" + topics = ("dsp", "filters") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/vinniefalco/DSPFilters" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def validate(self): + # 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.") + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "shared")) + cmake.build() + + def package(self): + copy(self, "lib*", src=os.path.join(self.build_folder, "DSPFilters"), dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "DSPFilters.lib", src=os.path.join(self.build_folder, "DSPFilters", f"{self.settings.build_type}"), dst=os.path.join(self.package_folder, "lib"), keep_path=False) + + copy(self, "*.h", src=os.path.join(self.source_folder, "shared", "DSPFilters", "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "README.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rename(self, src=os.path.join(self.package_folder, "licenses", "README.md"), dst=os.path.join(self.package_folder, "licenses", "license")) + + def package_info(self): + self.cpp_info.libs = ["DSPFilters"] + + if self.settings.os in ["Linux", "FreeBSD", "Neutrino"]: + self.cpp_info.system_libs.extend(["m"]) diff --git a/recipes/dsp-filters/all/patches/0001-remove-explicit-cmake-options.patch b/recipes/dsp-filters/all/patches/0001-remove-explicit-cmake-options.patch new file mode 100644 index 00000000000000..cece818ce0db26 --- /dev/null +++ b/recipes/dsp-filters/all/patches/0001-remove-explicit-cmake-options.patch @@ -0,0 +1,14 @@ +--- shared/DSPFilters/CMakeLists.txt 2017-03-09 13:40:27.000000000 +0100 ++++ shared/DSPFilters/CMakeLists.txt 2023-08-03 09:10:56.248123716 +0200 +@@ -4,10 +4,8 @@ + + aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/source SOURCE_LIB) + +-add_library(${PROJECT_NAME} STATIC ${SOURCE_LIB}) ++add_library(${PROJECT_NAME} ${SOURCE_LIB}) + + target_include_directories(${PROJECT_NAME} + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) + +-set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) +- diff --git a/recipes/dsp-filters/all/patches/0002-remove-msvc-cmake-flags.patch b/recipes/dsp-filters/all/patches/0002-remove-msvc-cmake-flags.patch new file mode 100644 index 00000000000000..e16d647a99e9c3 --- /dev/null +++ b/recipes/dsp-filters/all/patches/0002-remove-msvc-cmake-flags.patch @@ -0,0 +1,14 @@ +--- shared/CMakeLists.txt 2023-08-28 13:14:13.868202500 +0200 ++++ shared/CMakeLists.txt 2023-08-28 13:14:42.827596800 +0200 +@@ -8,11 +8,6 @@ + set(CMAKE_BUILD_TYPE Release) + + if((${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)) +- set(MYFLAGS "/O2 /WX- /MT") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MYFLAGS}") +- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MYFLAGS}") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MYFLAGS}") +- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${MYFLAGS}") + include(CheckSymbolExists) + check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF) + if(NOT HAVE_SNPRINTF) diff --git a/recipes/dsp-filters/all/test_package/CMakeLists.txt b/recipes/dsp-filters/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..f823007a47a745 --- /dev/null +++ b/recipes/dsp-filters/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.14.0) +project(test_package LANGUAGES CXX) + +find_package(dsp-filters REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dsp-filters::dsp-filters) diff --git a/recipes/dsp-filters/all/test_package/conanfile.py b/recipes/dsp-filters/all/test_package/conanfile.py new file mode 100644 index 00000000000000..922d35b61f37a5 --- /dev/null +++ b/recipes/dsp-filters/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +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 not can_run(self): + return + + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dsp-filters/all/test_package/test_package.cpp b/recipes/dsp-filters/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..10690f2821e166 --- /dev/null +++ b/recipes/dsp-filters/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include + +int main() { + Dsp::SimpleFilter, 1> f; + f.setup(1, 100, 1000); + f.reset(); + + return 0; +} diff --git a/recipes/dsp-filters/config.yml b/recipes/dsp-filters/config.yml new file mode 100644 index 00000000000000..d7e185cf9c9647 --- /dev/null +++ b/recipes/dsp-filters/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20170309": + folder: all diff --git a/recipes/dtl/all/conanfile.py b/recipes/dtl/all/conanfile.py index 6d45ac4104004b..c53d228db89218 100644 --- a/recipes/dtl/all/conanfile.py +++ b/recipes/dtl/all/conanfile.py @@ -1,28 +1,40 @@ -from conans import ConanFile, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class DtlConan(ConanFile): name = "dtl" description = "diff template library written by C++" - topics = ("diff", "library", "algorithm") license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/cubicdaiya/dtl" + topics = ("diff", "library", "algorithm", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() 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(os.path.join("dtl", "*.hpp"), dst="include", src=self._source_subfolder) - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, os.path.join("dtl", "*.hpp"), + dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/dtl/all/test_package/CMakeLists.txt b/recipes/dtl/all/test_package/CMakeLists.txt index 9710bb88ce36ce..f8aa0df23cba23 100644 --- a/recipes/dtl/all/test_package/CMakeLists.txt +++ b/recipes/dtl/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(dtl CONFIG REQUIRED) diff --git a/recipes/dtl/all/test_package/conanfile.py b/recipes/dtl/all/test_package/conanfile.py index 49a3a66ea5bad4..ef5d7042163ecc 100644 --- a/recipes/dtl/all/test_package/conanfile.py +++ b/recipes/dtl/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,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/dtl/all/test_v1_package/CMakeLists.txt b/recipes/dtl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/dtl/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/dtl/all/test_v1_package/conanfile.py b/recipes/dtl/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/dtl/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/duckdb/all/conandata.yml b/recipes/duckdb/all/conandata.yml index 841b055baa39af..82ad639285d872 100644 --- a/recipes/duckdb/all/conandata.yml +++ b/recipes/duckdb/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.9.2": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.9.2.tar.gz" + sha256: "afff7bd925a98dc2af4039b8ab2159b0705cbf5e0ee05d97f7bb8dce5f880dc2" + "0.9.0": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.9.0.tar.gz" + sha256: "3dbf3326a831bf0797591572440e81a3d6d668f8e33a25ce04efae19afc3a23d" "0.8.1": url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.8.1.tar.gz" sha256: "a0674f7e320dc7ebcf51990d7fc1c0e7f7b2c335c08f5953702b5285e6c30694" @@ -18,27 +24,26 @@ sources: url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.5.1.tar.gz" sha256: "3dab7ba0d0f8d024d3c73fd3d4fb8834203c31d7b0ddb1e8539ee266e11b0e9b" patches: + "0.9.2": + - patch_file: "patches/0.9.2-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + "0.9.0": + - 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" "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" @@ -46,6 +51,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" @@ -53,6 +59,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 34aad40c19a169..2010b8b18210e8 100644 --- a/recipes/duckdb/all/conanfile.py +++ b/recipes/duckdb/all/conanfile.py @@ -1,10 +1,12 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration 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.microsoft import is_msvc from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import glob import os required_conan_version = ">=1.53.0" @@ -68,6 +70,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) >= "0.9.0": + del self.options.with_parquet def configure(self): if self.options.shared: @@ -86,6 +90,10 @@ def requirements(self): def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) + # FIXME: drop support MSVC debug shared build + if Version(self.version) >= "0.9.2" and \ + is_msvc(self) and self.options.shared and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC debug shared build") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -97,7 +105,8 @@ def generate(self): tc.variables["DUCKDB_PATCH_VERSION"] = Version(self.version).patch tc.variables["DUCKDB_DEV_ITERATION"] = 0 tc.variables["BUILD_ICU_EXTENSION"] = self.options.with_icu - tc.variables["BUILD_PARQUET_EXTENSION"] = self.options.with_parquet + if "with_parquet" in self.options: + tc.variables["BUILD_PARQUET_EXTENSION"] = self.options.with_parquet tc.variables["BUILD_TPCH_EXTENSION"] = self.options.with_tpch tc.variables["BUILD_TPCDS_EXTENSION"] = self.options.with_tpcds tc.variables["BUILD_FTS_EXTENSION"] = self.options.with_fts @@ -144,8 +153,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")) @@ -170,7 +181,7 @@ def package_info(self): if self.options.with_icu: self.cpp_info.libs.append("icu_extension") - if self.options.with_parquet: + if self.options.get_safe("with_parquet", True): self.cpp_info.libs.append("parquet_extension") if self.options.with_tpch: self.cpp_info.libs.append("tpch_extension") diff --git a/recipes/duckdb/all/patches/0.9.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.9.0-0001-fix-cmake.patch new file mode 100644 index 00000000000000..40ae0d24ebe512 --- /dev/null +++ b/recipes/duckdb/all/patches/0.9.0-0001-fix-cmake.patch @@ -0,0 +1,122 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2b49e11..1a347ac 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -724,7 +724,7 @@ function(build_static_extension NAME PARAMETERS) + set(FILES ${ARGV}) + list(REMOVE_AT FILES 0) + add_library(${NAME}_extension STATIC ${FILES}) +- target_link_libraries(${NAME}_extension duckdb_static) ++ #target_link_libraries(${NAME}_extension INTERFACE duckdb_static) + endfunction() + + # Internal extension register function +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index cda2d86..4fb3bd3 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -77,24 +77,24 @@ else() + duckdb_fastpforlib + duckdb_mbedtls) + ++ if(BUILD_SHARED_LIBS) + add_library(duckdb SHARED ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb ${DUCKDB_LINK_LIBS}) + link_threads(duckdb) + link_extension_libraries(duckdb) +- ++ endif() + add_library(duckdb_static STATIC ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb_static ${DUCKDB_LINK_LIBS}) + link_threads(duckdb_static) + link_extension_libraries(duckdb_static) +- ++ if(BUILD_SHARED_LIBS) + target_include_directories( + duckdb PUBLIC $ + $) +- ++ endif() + target_include_directories( + duckdb_static PUBLIC $ + $) +- + install( + DIRECTORY "${PROJECT_SOURCE_DIR}/src/include/duckdb" + DESTINATION "${INSTALL_INCLUDE_DIR}" +@@ -105,10 +105,18 @@ else() + DESTINATION "${INSTALL_INCLUDE_DIR}") + + endif() +- ++if(BUILD_SHARED_LIBS) + install( +- TARGETS duckdb duckdb_static ++ TARGETS duckdb + EXPORT "${DUCKDB_EXPORT_SET}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt +index ffd0140..1901aa8 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -53,7 +53,15 @@ add_library( + + set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API") + target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static) ++install( ++ TARGETS duckdb_odbc ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) + + if(NOT WIN32 AND NOT CLANG_TIDY) + add_subdirectory(test) + endif() ++ +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index 3fa4166..cd5870d 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -25,20 +25,20 @@ if(NOT AMALGAMATION_BUILD) + endif() + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32 AND NOT ZOS) ++if(BUILD_SHARED_LIBS AND NOT WIN32 AND NOT ZOS) + add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) + link_threads(sqlite3_api_wrapper) + endif() + +-include_directories(../../third_party/catch) ++# include_directories(../../third_party/catch) + +-include_directories(test/include) +-add_subdirectory(test) ++# include_directories(test/include) ++# add_subdirectory(test) + +-add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) +-if(WIN32 OR ZOS) +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) +-else() +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) +-endif() ++# add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) ++# if(WIN32 OR ZOS) ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) ++# else() ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) ++# endif() diff --git a/recipes/duckdb/all/patches/0.9.2-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.9.2-0001-fix-cmake.patch new file mode 100644 index 00000000000000..c7d4c07c092db8 --- /dev/null +++ b/recipes/duckdb/all/patches/0.9.2-0001-fix-cmake.patch @@ -0,0 +1,117 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 67444db..c34c3ce 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -721,7 +721,7 @@ function(build_static_extension NAME PARAMETERS) + set(FILES ${ARGV}) + list(REMOVE_AT FILES 0) + add_library(${NAME}_extension STATIC ${FILES}) +- target_link_libraries(${NAME}_extension duckdb_static) ++# target_link_libraries(${NAME}_extension duckdb_static) + endfunction() + + # Internal extension register function +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index cda2d86..011ecb5 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -76,21 +76,21 @@ else() + duckdb_hyperloglog + duckdb_fastpforlib + duckdb_mbedtls) +- ++ if(BUILD_SHARED_LIBS) + add_library(duckdb SHARED ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb ${DUCKDB_LINK_LIBS}) + link_threads(duckdb) + link_extension_libraries(duckdb) +- ++ endif() + add_library(duckdb_static STATIC ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb_static ${DUCKDB_LINK_LIBS}) + link_threads(duckdb_static) + link_extension_libraries(duckdb_static) +- ++ if(BUILD_SHARED_LIBS) + target_include_directories( + duckdb PUBLIC $ + $) +- ++ endif() + target_include_directories( + duckdb_static PUBLIC $ + $) +@@ -105,10 +105,18 @@ else() + DESTINATION "${INSTALL_INCLUDE_DIR}") + + endif() +- ++if(BUILD_SHARED_LIBS) + install( +- TARGETS duckdb duckdb_static ++ TARGETS duckdb + EXPORT "${DUCKDB_EXPORT_SET}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt +index 4a8e7e1..8ae9681 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -53,6 +53,13 @@ add_library( + + set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API") + target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static) ++install( ++ TARGETS duckdb_odbc ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) + + if(NOT CLANG_TIDY) + add_subdirectory(test) +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index 3fa4166..42af485 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -25,20 +25,20 @@ if(NOT AMALGAMATION_BUILD) + endif() + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32 AND NOT ZOS) ++if(BUILD_SHARED_LIBS AND NOT WIN32 AND NOT ZOS) + add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) + link_threads(sqlite3_api_wrapper) + endif() + +-include_directories(../../third_party/catch) ++# include_directories(../../third_party/catch) + +-include_directories(test/include) +-add_subdirectory(test) ++# include_directories(test/include) ++# add_subdirectory(test) + +-add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) +-if(WIN32 OR ZOS) +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) +-else() +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) +-endif() ++#add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) ++#if(WIN32 OR ZOS) ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) ++#else() ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) ++#endif() diff --git a/recipes/duckdb/config.yml b/recipes/duckdb/config.yml index 0c9fddd5a68045..77e20cf10a7979 100644 --- a/recipes/duckdb/config.yml +++ b/recipes/duckdb/config.yml @@ -1,4 +1,8 @@ versions: + "0.9.2": + folder: "all" + "0.9.0": + folder: "all" "0.8.1": folder: "all" "0.8.0": diff --git a/recipes/duktape/all/CMakeLists.txt b/recipes/duktape/all/CMakeLists.txt index 76bab4dba57c05..cc4f8cfa2df773 100644 --- a/recipes/duktape/all/CMakeLists.txt +++ b/recipes/duktape/all/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 2.8.12) - +cmake_minimum_required(VERSION 3.12) project(duktape C) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/src/*.c) -file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/src/*.h) +file(GLOB SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/src/*.c) +file(GLOB HEADERS ${CMAKE_CURRENT_LIST_DIR}/src/src/*.h) add_library(duktape ${SOURCES} ${HEADERS}) set_target_properties(duktape PROPERTIES PUBLIC_HEADER "${HEADERS}") @@ -14,10 +10,8 @@ if (UNIX AND NOT APPLE AND NOT ANDROID) target_link_libraries(duktape m) endif() +include(GNUInstallDirs) install( TARGETS duktape - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include ) diff --git a/recipes/duktape/all/conanfile.py b/recipes/duktape/all/conanfile.py index 3e582932bd5957..588a96a8c0f571 100644 --- a/recipes/duktape/all/conanfile.py +++ b/recipes/duktape/all/conanfile.py @@ -1,29 +1,33 @@ import os -from conans import CMake, ConanFile, tools -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.53.0" + class DuktapeConan(ConanFile): name = "duktape" - license = "MIT" description = "Duktape is an embeddable Javascript engine, with a focus on portability and compact footprint." - topics = ("javascript", "engine", "embeddable", "compact") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://duktape.org" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" + topics = ("javascript", "engine", "embeddable", "compact") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} + options = { + "shared": [True, False], + "fPIC": [True, False], + } default_options = { "shared": False, "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -31,44 +35,41 @@ 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], strip_root=True, destination=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.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + if self.settings.os == "Windows" and self.options.shared: + # Duktape has a configure script with a number of options. + # However, it requires python 2 and PyYAML package + # which is quite an unusual combination to have. + # The most crucial option is --dll which enables + # DUK_F_DLL_BUILD and the following defines. + tc.preprocessor_definitions["DUK_EXTERNAL_DECL"] = "extern __declspec(dllexport)" + tc.preprocessor_definitions["DUK_EXTERNAL"] = "__declspec(dllexport)" + tc.generate() def build(self): - # Duktape has configure script with a number of options. - # However it requires python 2 and PyYAML package - # which is quite an unusual combination to have. - # The most crucial option is --dll which just flips this define. - if self.settings.os == "Windows" and self.options.shared: - tools.replace_in_file( - os.path.join(self._source_subfolder, "src", "duk_config.h"), - "#undef DUK_F_DLL_BUILD", - "#define DUK_F_DLL_BUILD", - ) - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) cmake.build() def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", + 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 = ["duktape"] - if not self.options.shared and str(self.settings.os) in ( - "Linux", - "FreeBSD", - "SunOS", - ): + if not self.options.shared and self.settings.os in ("Linux", "FreeBSD", "SunOS"): self.cpp_info.system_libs = ["m"] diff --git a/recipes/duktape/all/test_package/CMakeLists.txt b/recipes/duktape/all/test_package/CMakeLists.txt index 526e8d40c66a27..e6adea9e794dde 100644 --- a/recipes/duktape/all/test_package/CMakeLists.txt +++ b/recipes/duktape/all/test_package/CMakeLists.txt @@ -1,9 +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(TARGETS) +find_package(duktape REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.c) -target_link_libraries(${CMAKE_PROJECT_NAME} CONAN_PKG::duktape) +target_link_libraries(${CMAKE_PROJECT_NAME} duktape::duktape) diff --git a/recipes/duktape/all/test_package/conanfile.py b/recipes/duktape/all/test_package/conanfile.py index ca9da956709115..ef5d7042163ecc 100644 --- a/recipes/duktape/all/test_package/conanfile.py +++ b/recipes/duktape/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 CMake, ConanFile, 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) @@ -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/duktape/all/test_v1_package/CMakeLists.txt b/recipes/duktape/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/duktape/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/duktape/all/test_v1_package/conanfile.py b/recipes/duktape/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..d47b5097e761e7 --- /dev/null +++ b/recipes/duktape/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import CMake, ConanFile, 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): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/dylib/all/conandata.yml b/recipes/dylib/all/conandata.yml new file mode 100644 index 00000000000000..c085d1577b105b --- /dev/null +++ b/recipes/dylib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.2.1": + url: "https://github.com/martin-olivier/dylib/archive/refs/tags/v2.2.1.tar.gz" + sha256: "6af0d2a91860743dc9f564ba0ab7f036a9b37c904395610288791571d4dbea5b" diff --git a/recipes/dylib/all/conanfile.py b/recipes/dylib/all/conanfile.py new file mode 100644 index 00000000000000..d607d4cbb05205 --- /dev/null +++ b/recipes/dylib/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + +class DylibConan(ConanFile): + name = "dylib" + homepage = "https://github.com/martin-olivier/dylib" + url = "https://github.com/conan-io/conan-center-index" + description = "C++ cross-platform wrapper around dynamic loading of shared libraries (dll, so, dylib)" + license = "MIT" + topics = ("shared-library", "cross-platform", "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 requirements(self): + pass + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "dylib.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "dylib") + self.cpp_info.set_property("cmake_target_name", "dylib::dylib") + self.cpp_info.set_property("pkg_config_name", "dylib") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl"]) diff --git a/recipes/dylib/all/test_package/CMakeLists.txt b/recipes/dylib/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..b3c80ba7c695bf --- /dev/null +++ b/recipes/dylib/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +enable_testing() + +find_package(dylib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dylib::dylib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) diff --git a/recipes/dylib/all/test_package/conanfile.py b/recipes/dylib/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ad30644323b26d --- /dev/null +++ b/recipes/dylib/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.build import can_run +from conan.tools.files import chdir + +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.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + with chdir(self, self.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun") diff --git a/recipes/dylib/all/test_package/test_package.cpp b/recipes/dylib/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..01f9e4b14bcb12 --- /dev/null +++ b/recipes/dylib/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + +int main() +{ + try { + dylib lib("foo"); + std::cerr << "Expected dylib::load_error exception" << std::endl; + return 1; + } catch (const dylib::load_error &) { + return 0; + } +} diff --git a/recipes/dylib/config.yml b/recipes/dylib/config.yml new file mode 100644 index 00000000000000..a816d92f78ee36 --- /dev/null +++ b/recipes/dylib/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.1": + folder: all diff --git a/recipes/earcut/all/conanfile.py b/recipes/earcut/all/conanfile.py index 23791142acadb5..c1034e73dab2e3 100644 --- a/recipes/earcut/all/conanfile.py +++ b/recipes/earcut/all/conanfile.py @@ -1,9 +1,12 @@ import os + 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.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.50.0" class EarcutPackage(ConanFile): @@ -13,8 +16,9 @@ class EarcutPackage(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "ISC" topics = ("algorithm", "cpp", "geometry", "rendering", "triangulation", - "polygon", "header-only", "tessellation", "earcut") - settings = "compiler" + "polygon", "header-only", "tessellation") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property @@ -29,35 +33,35 @@ def _minimum_compilers_version(self): "gcc": "4.9", "intel": "15", "sun-cc": "5.14", - "Visual Studio": "12" + "Visual Studio": "12", + "msvc": "180", } @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 11 + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._min_cppstd) - def lazy_lt_semver(v1, v2): + 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] - min_version = self._minimum_compilers_version.get( - str(self.settings.compiler)) - if not min_version: - self.output.warning( - f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") - else: - if lazy_lt_semver(str(self.settings.compiler.version), min_version): - raise ConanInvalidConfiguration( - f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") - - def layout(self): - basic_layout(self, src_folder="src") + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if min_version and loose_lt_semver(str(self.settings.compiler.version), min_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) @@ -68,5 +72,12 @@ def package(self): copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) - def package_id(self): - self.info.clear() + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "earcut_hpp") + self.cpp_info.set_property("cmake_target_name", "earcut_hpp::earcut_hpp") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "earcut_hpp" + self.cpp_info.names["cmake_find_package_multi"] = "earcut_hpp" diff --git a/recipes/earcut/all/test_package/CMakeLists.txt b/recipes/earcut/all/test_package/CMakeLists.txt index 4a460cc9a3c999..c341471bb32dee 100644 --- a/recipes/earcut/all/test_package/CMakeLists.txt +++ b/recipes/earcut/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -find_package(earcut REQUIRED CONFIG) +find_package(earcut_hpp REQUIRED CONFIG) -add_executable(${PROJECT_NAME} example.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE earcut::earcut) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE earcut_hpp::earcut_hpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/earcut/all/test_package/conanfile.py b/recipes/earcut/all/test_package/conanfile.py index 0246d899d7bc9c..12503ced11f451 100644 --- a/recipes/earcut/all/test_package/conanfile.py +++ b/recipes/earcut/all/test_package/conanfile.py @@ -4,22 +4,22 @@ from conan.tools.cmake import CMake, cmake_layout -class EarcutTestPackage(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - 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.bindirs[0], "test_package") diff --git a/recipes/earcut/all/test_package/example.cpp b/recipes/earcut/all/test_package/test_package.cpp similarity index 100% rename from recipes/earcut/all/test_package/example.cpp rename to recipes/earcut/all/test_package/test_package.cpp diff --git a/recipes/earcut/all/test_v1_package/conanfile.py b/recipes/earcut/all/test_v1_package/conanfile.py index 0357a45cbaadfb..a8c92dea633357 100644 --- a/recipes/earcut/all/test_v1_package/conanfile.py +++ b/recipes/earcut/all/test_v1_package/conanfile.py @@ -3,7 +3,7 @@ from conans import ConanFile, CMake, tools -class EarcutTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" diff --git a/recipes/easyloggingpp/all/CMakeLists.txt b/recipes/easyloggingpp/all/CMakeLists.txt deleted file mode 100644 index f6fc5c33e69b07..00000000000000 --- a/recipes/easyloggingpp/all/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -cmake_minimum_required(VERSION 3.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() -option(enable_crash_log "Enable crash log handler" OFF) -option(enable_thread_safe "Enable thread safety for use in multithreaded env" OFF) -option(enable_debug_errors "Enable debug errors in case of configuration issues" OFF) -option(enable_default_logfile "Enable creation of default logfile" ON) -option(disable_logs "Disables all logs" OFF) -option(disable_debug_logs "Disables debug logs" OFF) -option(disable_info_logs "Disables info logs" OFF) -option(disable_warning_logs "Disables warning logs" OFF) -option(disable_error_logs "Disables error logs" OFF) -option(disable_fatal_logs "Disables fatal logs" OFF) -option(disable_verbose_logs "Disables verbose logs" OFF) -option(disable_trace_logs "Disables trace logs" OFF) - -if (enable_crash_log) - add_definitions(-DELPP_FEATURE_CRASH_LOG) -endif() - -if (enable_thread_safe) - add_definitions(-DELPP_THREAD_SAFE) -endif() - -if (enable_debug_errors) - add_definitions(-DELPP_DEBUG_ERRORS) -endif() - -if (NOT enable_default_logfile) - add_definitions(-DELPP_NO_DEFAULT_LOG_FILE) -endif() - -if (disable_logs) - add_definitions(-DELPP_DISABLE_LOGS) -endif() - -if (disable_debug_logs) - add_definitions(-DELPP_DISABLE_DEBUG_LOGS) -endif() - -if (disable_info_logs) - add_definitions(-DELPP_DISABLE_INFO_LOGS) -endif() - -if (disable_warning_logs) - add_definitions(-DELPP_DISABLE_WARNING_LOGS) -endif() - -if (disable_error_logs) - add_definitions(-DELPP_DISABLE_ERROR_LOGS) -endif() - -if (disable_fatal_logs) - add_definitions(-DELPP_DISABLE_FATAL_LOGS) -endif() - -if (disable_verbose_logs) - add_definitions(-DELPP_DISABLE_VERBOSE_LOGS) -endif() - -if (disable_trace_logs) - add_definitions(-DELPP_DISABLE_TRACE_LOGS) -endif() - -add_subdirectory("source_subfolder") diff --git a/recipes/easyloggingpp/all/conandata.yml b/recipes/easyloggingpp/all/conandata.yml index 5649e78f158ccf..83345fd6f0b12a 100644 --- a/recipes/easyloggingpp/all/conandata.yml +++ b/recipes/easyloggingpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9.97.1": + url: "https://github.com/amrayn/easyloggingpp/archive/v9.97.1.tar.gz" + sha256: "ebe473e17b13f1d1f16d0009689576625796947a711e14aec29530f39560c7c2" "9.97.0": url: "https://github.com/amrayn/easyloggingpp/archive/v9.97.0.tar.gz" sha256: "9110638e21ef02428254af8688bf9e766483db8cc2624144aa3c59006907ce22" diff --git a/recipes/easyloggingpp/all/conanfile.py b/recipes/easyloggingpp/all/conanfile.py index b5d1f9b44e060d..7cacb1c38e312c 100644 --- a/recipes/easyloggingpp/all/conanfile.py +++ b/recipes/easyloggingpp/all/conanfile.py @@ -1,22 +1,24 @@ import os -from conans import CMake -from conan.tools import files + from conan import ConanFile +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" -required_conan_version = ">=1.33.0" class EasyloggingppConan(ConanFile): name = "easyloggingpp" - license = "The MIT License (MIT)" - homepage = "https://github.com/amrayn/easyloggingpp" + description = "Single-header C++ logging library." + license = "MIT" url = "https://github.com/conan-io/conan-center-index" - description = "Single header C++ logging library." + homepage = "https://github.com/amrayn/easyloggingpp" topics = ("logging", "stacktrace", "efficient-logging") - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - exports_sources = "CMakeLists.txt", + + 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], @@ -28,9 +30,11 @@ class EasyloggingppConan(ConanFile): "disable_error_logs": [True, False], "disable_fatal_logs": [True, False], "disable_verbose_logs": [True, False], - "disable_trace_logs": [True, False] + "disable_trace_logs": [True, False], + "lib_utc_datetime": [True, False], } default_options = { + "fPIC": True, "enable_crash_log": False, "enable_thread_safe": False, "enable_debug_errors": False, @@ -42,80 +46,74 @@ class EasyloggingppConan(ConanFile): "disable_error_logs": False, "disable_fatal_logs": False, "disable_verbose_logs": False, - "disable_trace_logs": False + "disable_trace_logs": False, + "lib_utc_datetime": False, } - _cmake = None - @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_cmake(self): - if self._cmake is not None: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["build_static_lib"] = True - self._cmake.definitions["enable_crash_log"] = self.options.enable_crash_log - self._cmake.definitions["enable_thread_safe"] = self.options.enable_thread_safe - self._cmake.definitions["enable_debug_errors"] = self.options.enable_debug_errors - self._cmake.definitions["enable_default_logfile"] = self.options.enable_default_logfile - self._cmake.definitions["disable_logs"] = self.options.disable_logs - self._cmake.definitions["disable_debug_logs"] = self.options.disable_debug_logs - self._cmake.definitions["disable_info_logs"] = self.options.disable_info_logs - self._cmake.definitions["disable_warning_logs"] = self.options.disable_warning_logs - self._cmake.definitions["disable_error_logs"] = self.options.disable_error_logs - self._cmake.definitions["disable_fatal_logs"] = self.options.disable_fatal_logs - self._cmake.definitions["disable_verbose_logs"] = self.options.disable_verbose_logs - self._cmake.definitions["disable_trace_logs"] = self.options.disable_trace_logs - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - files.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def build(self): - cmake = self._configure_cmake() - cmake.build() - - def package(self): - cmake = self._configure_cmake() - cmake.install() - files.rmdir(self, os.path.join(self.package_folder, "share")) - self.copy(pattern="LICENSE", - dst="licenses", - src=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def package_info(self): - self.cpp_info.names["cmake_find_package"] = "easyloggingpp" - self.cpp_info.names["cmake_find_package_multi"] = "easyloggingpp" - self.cpp_info.libs = ["easyloggingpp"] + @property + def _public_defines(self): + defines = [] if self.options.enable_crash_log: - self.cpp_info.defines.append("ELPP_FEATURE_CRASH_LOG") + defines.append("ELPP_FEATURE_CRASH_LOG") if self.options.enable_thread_safe: - self.cpp_info.defines.append("ELPP_THREAD_SAFE") + defines.append("ELPP_THREAD_SAFE") if self.options.enable_debug_errors: - self.cpp_info.defines.append("ELPP_DEBUG_ERRORS") + defines.append("ELPP_DEBUG_ERRORS") if self.options.enable_default_logfile: - self.cpp_info.defines.append("ELPP_NO_DEFAULT_LOG_FILE") + defines.append("ELPP_NO_DEFAULT_LOG_FILE") if self.options.disable_logs: - self.cpp_info.defines.append("ELPP_DISABLE_LOGS") + defines.append("ELPP_DISABLE_LOGS") if self.options.disable_debug_logs: - self.cpp_info.defines.append("ELPP_DISABLE_DEBUG_LOGS") + defines.append("ELPP_DISABLE_DEBUG_LOGS") if self.options.disable_info_logs: - self.cpp_info.defines.append("ELPP_DISABLE_INFO_LOGS") + defines.append("ELPP_DISABLE_INFO_LOGS") if self.options.disable_warning_logs: - self.cpp_info.defines.append("ELPP_DISABLE_WARNING_LOGS") + defines.append("ELPP_DISABLE_WARNING_LOGS") if self.options.disable_error_logs: - self.cpp_info.defines.append("ELPP_DISABLE_ERROR_LOGS") + defines.append("ELPP_DISABLE_ERROR_LOGS") if self.options.disable_fatal_logs: - self.cpp_info.defines.append("ELPP_DISABLE_FATAL_LOGS") + defines.append("ELPP_DISABLE_FATAL_LOGS") if self.options.disable_verbose_logs: - self.cpp_info.defines.append("ELPP_DISABLE_VERBOSE_LOGS") + defines.append("ELPP_DISABLE_VERBOSE_LOGS") if self.options.disable_trace_logs: - self.cpp_info.defines.append("ELPP_DISABLE_TRACE_LOGS") + defines.append("lib_utc_datetime") + if self.options.lib_utc_datetime: + defines.append("ELPP_UTC_DATETIME") + return defines + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["build_static_lib"] = True + for d in self._public_defines: + tc.preprocessor_definitions[d] = "1" + tc.generate() + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set_property(TARGET easyloggingpp PROPERTY POSITION_INDEPENDENT_CODE ON)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.libs = ["easyloggingpp"] + self.cpp_info.defines = self._public_defines diff --git a/recipes/easyloggingpp/all/test_package/CMakeLists.txt b/recipes/easyloggingpp/all/test_package/CMakeLists.txt index e515e14d7e6ada..a353807cafd1f8 100644 --- a/recipes/easyloggingpp/all/test_package/CMakeLists.txt +++ b/recipes/easyloggingpp/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(easyloggingpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/easyloggingpp/all/test_package/conanfile.py b/recipes/easyloggingpp/all/test_package/conanfile.py index 49a3a66ea5bad4..ef5d7042163ecc 100644 --- a/recipes/easyloggingpp/all/test_package/conanfile.py +++ b/recipes/easyloggingpp/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,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/easyloggingpp/all/test_package/test_package.cpp b/recipes/easyloggingpp/all/test_package/test_package.cpp index 9f1fc4b8dad349..da48715e9c0a26 100644 --- a/recipes/easyloggingpp/all/test_package/test_package.cpp +++ b/recipes/easyloggingpp/all/test_package/test_package.cpp @@ -10,11 +10,12 @@ void myCrashHandler(int sig) { } #endif -int main() { +int main(int argc, char* argv[]) { + START_EASYLOGGINGPP(argc, argv); LOG(INFO) << "My first info log using default logger"; - #ifdef ELPP_FEATURE_CRASH_LOG +#ifdef ELPP_FEATURE_CRASH_LOG LOG(INFO) << "Installed crash handler"; el::Helpers::setCrashHandler(myCrashHandler); - #endif +#endif return 0; } diff --git a/recipes/easyloggingpp/all/test_v1_package/CMakeLists.txt b/recipes/easyloggingpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/easyloggingpp/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/easyloggingpp/all/test_v1_package/conanfile.py b/recipes/easyloggingpp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/easyloggingpp/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/easyloggingpp/config.yml b/recipes/easyloggingpp/config.yml index 8f835ce7bab04d..b4a91abbf71818 100644 --- a/recipes/easyloggingpp/config.yml +++ b/recipes/easyloggingpp/config.yml @@ -1,3 +1,5 @@ versions: + "9.97.1": + folder: all "9.97.0": folder: all diff --git a/recipes/easylzma/all/CMakeLists.txt b/recipes/easylzma/all/CMakeLists.txt deleted file mode 100644 index 8b2a23892d7dec..00000000000000 --- a/recipes/easylzma/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/easylzma/all/conandata.yml b/recipes/easylzma/all/conandata.yml index ce63d9a78cbcc2..80c52f3ee8642b 100644 --- a/recipes/easylzma/all/conandata.yml +++ b/recipes/easylzma/all/conandata.yml @@ -5,7 +5,4 @@ sources: patches: "0.0.7": - patch_file: "patches/memleaksfix.patch" - base_path: "source_subfolder" - patch_file: "patches/cmake-no-cflags.patch" - base_path: "source_subfolder" - diff --git a/recipes/easylzma/all/conanfile.py b/recipes/easylzma/all/conanfile.py index 5e527b60909114..46a81f3f9abbca 100644 --- a/recipes/easylzma/all/conanfile.py +++ b/recipes/easylzma/all/conanfile.py @@ -1,72 +1,97 @@ import os -from conans import ConanFile, tools, CMake + +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, load, save +from conan.tools.microsoft import is_msvc, msvc_runtime_flag + +required_conan_version = ">=1.53.0" class EazylzmaConan(ConanFile): name = "easylzma" - license = "Unlicense" + description = ( + "An easy to use, tiny, public domain, C wrapper library around " + "Igor Pavlov's work that can be used to compress and extract lzma files" + ) + license = "DocumentRef-README:LicenseRef-PublicDomain-WITH-Attribution" # Public Domain with attribution request url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lloyd/easylzma" - description = ("An easy to use, tiny, public domain, C wrapper library around \ - Igor Pavlov's work that can be used to compress and extract lzma files") - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - topics = ("conan", "eazylzma", "lzma") - exports_sources = ["CMakeLists.txt", "patches/*"] - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + topics = ("lzma",) - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _license_text(self): - # Extract the License/s from the README to a file - tmp = tools.load(os.path.join("source_subfolder", "README")) - return tmp[tmp.find("License",1):tmp.find("work.", 1)+5] + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - @property - def _libname(self): - return "easylzma" if self.options.shared else "easylzma_s" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + del self.options.fPIC 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]) - 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) + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Silence CMake warning about LOCATION property + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0026"] = "OLD" + tc.generate() def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build(target=self._libname) - def package(self): - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) + @property + def _license_text(self): + # Extract the License/s from the README to a file + tmp = load(self, os.path.join(self.source_folder, "README")) + return tmp[tmp.find("License", 1) : tmp.find("work.", 1) + 5] - self.copy(pattern="*.dylib*", dst="lib", src="lib", keep_path=False, symlinks=True) - self.copy(pattern="*.so*", dst="lib", src="lib", keep_path=False, symlinks=True) - self.copy(pattern="*.dll", dst="bin", src="bin", keep_path=False) - self.copy(pattern="*.a", dst="lib", src="lib", keep_path=False) - self.copy(pattern="*.lib", dst="lib", src="lib", keep_path=False) + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) + for pattern in ["*.lib", "*.a", "*.so*", "*.dylib"]: + copy(self, pattern, + dst=os.path.join(self.package_folder, "lib"), + src=self.build_folder, + keep_path=False) + copy(self, "*.dll", + dst=os.path.join(self.package_folder, "bin"), + src=self.build_folder, + keep_path=False) + copy(self, "easylzma/*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "src")) - self.copy("easylzma/*", dst="include", src=os.path.join(self._source_subfolder, "src")) + @property + def _libname(self): + return "easylzma" if self.options.shared else "easylzma_s" def package_info(self): self.cpp_info.libs = [self._libname] if self.options.shared: self.cpp_info.defines = ["EASYLZMA_SHARED"] - if self.settings.compiler == "Visual Studio": - if "d" in str(self.settings.compiler.runtime): + if is_msvc(self): + if "d" in msvc_runtime_flag(self): self.cpp_info.defines.append("DEBUG") diff --git a/recipes/easylzma/all/test_package/CMakeLists.txt b/recipes/easylzma/all/test_package/CMakeLists.txt index 34af13462f44f8..6e6b478dec699f 100644 --- a/recipes/easylzma/all/test_package/CMakeLists.txt +++ b/recipes/easylzma/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(easylzma REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE easylzma::easylzma) diff --git a/recipes/easylzma/all/test_package/conanfile.py b/recipes/easylzma/all/test_package/conanfile.py index 4903f1a7e8fa0f..ef5d7042163ecc 100644 --- a/recipes/easylzma/all/test_package/conanfile.py +++ b/recipes/easylzma/all/test_package/conanfile.py @@ -1,9 +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" + 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.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/easylzma/all/test_v1_package/CMakeLists.txt b/recipes/easylzma/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/easylzma/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/easylzma/all/test_v1_package/conanfile.py b/recipes/easylzma/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6c9d5dba712c72 --- /dev/null +++ b/recipes/easylzma/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/egl-headers/all/conanfile.py b/recipes/egl-headers/all/conanfile.py index 5f6e1786a60cb1..d9fb3976353e3c 100644 --- a/recipes/egl-headers/all/conanfile.py +++ b/recipes/egl-headers/all/conanfile.py @@ -13,6 +13,7 @@ class EglHeadersConan(ConanFile): topics = ("egl-headers", "egl") homepage = "https://github.com/KhronosGroup/EGL-Registry" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -26,8 +27,7 @@ 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 @@ -43,4 +43,5 @@ def package(self): copy(self, "*", src=os.path.join(self.source_folder, "api", "EGL"), dst=os.path.join(self.package_folder, "include", "EGL")) def package_info(self): - pass + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/egl-headers/all/test_package/CMakeLists.txt b/recipes/egl-headers/all/test_package/CMakeLists.txt index 8c6a625d847ecd..26e09ca1aa867c 100644 --- a/recipes/egl-headers/all/test_package/CMakeLists.txt +++ b/recipes/egl-headers/all/test_package/CMakeLists.txt @@ -4,4 +4,4 @@ project(test_package LANGUAGES C) find_package(egl-headers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} egl-headers::egl-headers) +target_link_libraries(${PROJECT_NAME} PRIVATE egl-headers::egl-headers) diff --git a/recipes/elfio/all/conandata.yml b/recipes/elfio/all/conandata.yml index f57351ff19434e..fec8473460a71e 100644 --- a/recipes/elfio/all/conandata.yml +++ b/recipes/elfio/all/conandata.yml @@ -1,13 +1,16 @@ sources: + "3.12": + url: "https://github.com/serge1/ELFIO/releases/download/Release_3.12/elfio-3.12.tar.gz" + sha256: "caf49f3bf55a9c99c98ebea4b05c79281875783802e892729eea0415505f68c4" "3.11": - sha256: 3307b104c205399786edbba203906de9517e36297709fe747faf9478d55fbb91 - url: https://github.com/serge1/ELFIO/releases/download/Release_3.11/elfio-3.11.tar.gz + url: "https://github.com/serge1/ELFIO/releases/download/Release_3.11/elfio-3.11.tar.gz" + sha256: "3307b104c205399786edbba203906de9517e36297709fe747faf9478d55fbb91" "3.10": - sha256: cdc6362ede2e0c8d1d6db15d7da4b526f461d9cfae6f6337369e416a8bc60234 - url: https://github.com/serge1/ELFIO/releases/download/Release_3.10/elfio-3.10.tar.gz + url: "https://github.com/serge1/ELFIO/releases/download/Release_3.10/elfio-3.10.tar.gz" + sha256: "cdc6362ede2e0c8d1d6db15d7da4b526f461d9cfae6f6337369e416a8bc60234" "3.9": - sha256: 767b269063fc35aba6d361139f830aa91c45dc6b77942f082666876c1aa0be0f - url: https://github.com/serge1/ELFIO/releases/download/Release_3.9/elfio-3.9.tar.gz + url: "https://github.com/serge1/ELFIO/releases/download/Release_3.9/elfio-3.9.tar.gz" + sha256: "767b269063fc35aba6d361139f830aa91c45dc6b77942f082666876c1aa0be0f" "3.8": - sha256: 9553ce2b8d8aa2fb43f0e9be9bcbd10cd52f40b385110ea54173889c982f9ac4 - url: https://github.com/serge1/ELFIO/releases/download/Release_3.8/elfio-3.8.tar.gz + url: "https://github.com/serge1/ELFIO/releases/download/Release_3.8/elfio-3.8.tar.gz" + sha256: "9553ce2b8d8aa2fb43f0e9be9bcbd10cd52f40b385110ea54173889c982f9ac4" diff --git a/recipes/elfio/all/conanfile.py b/recipes/elfio/all/conanfile.py index eef05956d72825..db0b0c7ba0af5e 100644 --- a/recipes/elfio/all/conanfile.py +++ b/recipes/elfio/all/conanfile.py @@ -1,4 +1,5 @@ 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 @@ -10,15 +11,37 @@ class ElfioConan(ConanFile): name = "elfio" - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://elfio.sourceforge.net" description = "A header-only C++ library that provides a simple interface for reading and generating files in ELF binary format." - topics = ("elfio", "elf") license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://elfio.sourceforge.net" + topics = ("elf", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + if Version(self.version) < "3.11": + return "11" + elif Version(self.version) < "3.12": + return "14" + else: + return "17" + + @property + def _compilers_minimum_version(self): + return { + # while elfio<3.12 requires C++14, elfio still supports GCC 5 + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) + def layout(self): basic_layout(self, src_folder="src") @@ -27,10 +50,12 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - if Version(self.version) < "3.11": - check_min_cppstd(self, 11) - else: - check_min_cppstd(self, 14) + 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) diff --git a/recipes/elfio/all/test_package/CMakeLists.txt b/recipes/elfio/all/test_package/CMakeLists.txt index 6fa586f7cb9435..50113becf9a2c0 100755 --- a/recipes/elfio/all/test_package/CMakeLists.txt +++ b/recipes/elfio/all/test_package/CMakeLists.txt @@ -5,4 +5,10 @@ find_package(elfio REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE elfio::elfio) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +if (elfio_VERSION VERSION_LESS "3.11") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +elseif (elfio_VERSION VERSION_LESS "3.12") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/elfio/config.yml b/recipes/elfio/config.yml index 387fbf23f814ba..2d1b3203b5c132 100644 --- a/recipes/elfio/config.yml +++ b/recipes/elfio/config.yml @@ -1,4 +1,6 @@ versions: + "3.12": + folder: all "3.11": folder: all "3.10": diff --git a/recipes/elfutils/all/conandata.yml b/recipes/elfutils/all/conandata.yml index 85717c37cac04e..69b00d0652d9dd 100644 --- a/recipes/elfutils/all/conandata.yml +++ b/recipes/elfutils/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.190": + url: "https://sourceware.org/elfutils/ftp/0.190/elfutils-0.190.tar.bz2" + sha256: "8e00a3a9b5f04bc1dc273ae86281d2d26ed412020b391ffcc23198f10231d692" + "0.189": + url: "https://sourceware.org/elfutils/ftp/0.189/elfutils-0.189.tar.bz2" + sha256: "39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8" "0.186": url: "https://sourceware.org/elfutils/ftp/0.186/elfutils-0.186.tar.bz2" sha256: "7f6fb9149b1673d38d9178a0d3e0fb8a1ec4f53a9f4c2ff89469609879641177" @@ -6,13 +12,25 @@ sources: url: "https://sourceware.org/elfutils/ftp/0.180/elfutils-0.180.tar.bz2" sha256: "b827b6e35c59d188ba97d7cf148fa8dc6f5c68eb6c5981888dfdbb758c0b569d" patches: + "0.190": + - patch_file: "patches/0.189-0002-add-enable-static-option-to-configure.patch" + patch_description: "Enable static library building." + patch_type: "conan" + "0.189": + - patch_file: "patches/0.189-0002-add-enable-static-option-to-configure.patch" + patch_description: "Enable static library building." + patch_type: "conan" "0.186": - - base_path: "source_subfolder" - patch_file: "patches/0.186-0001-Add-enable-werror-configure-option.patch" - - base_path: "source_subfolder" - patch_file: "patches/0.186-0002-add-enable-static-option-to-configure.patch" + - patch_file: "patches/0.186-0001-remove-werror-configure-option.patch" + patch_description: "Disable -Werror flag." + patch_type: "conan" + - patch_file: "patches/0.186-0002-add-enable-static-option-to-configure.patch" + patch_description: "Enable static library building." + patch_type: "conan" "0.180": - - base_path: "source_subfolder" - patch_file: "patches/0.180-0001-Add-enable-werror-configure-option.patch" - - base_path: "source_subfolder" - patch_file: "patches/0.180-0002-add-enable-static-option-to-configure.patch" + - patch_file: "patches/0.180-0001-remove-werror-configure-option.patch" + patch_description: "Disable -Werror flag." + patch_type: "conan" + - patch_file: "patches/0.180-0002-add-enable-static-option-to-configure.patch" + patch_description: "Enable static library building." + patch_type: "conan" diff --git a/recipes/elfutils/all/conanfile.py b/recipes/elfutils/all/conanfile.py index caefeb2a118b9c..7d15bdd2937ed9 100644 --- a/recipes/elfutils/all/conanfile.py +++ b/recipes/elfutils/all/conanfile.py @@ -1,18 +1,26 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration import os -import glob -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, rm, rmdir, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.54.0" + class ElfutilsConan(ConanFile): name = "elfutils" description = "A dwarf, dwfl and dwelf functions to read DWARF, find separate debuginfo, symbols and inspect process state." homepage = "https://sourceware.org/elfutils" url = "https://github.com/conan-io/conan-center-index" - topics = ("elfutils", "libelf", "libdw", "libasm") + topics = ("libelf", "libdw", "libasm") license = ["GPL-1.0-or-later", "LGPL-3.0-or-later", "GPL-2.0-or-later"] - + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,6 +29,7 @@ class ElfutilsConan(ConanFile): "libdebuginfod": [True, False], "with_bzlib": [True, False], "with_lzma": [True, False], + "with_zstd": [True, False], "with_sqlite3": [True, False], } default_options = { @@ -30,125 +39,151 @@ class ElfutilsConan(ConanFile): "libdebuginfod": False, "with_bzlib": True, "with_lzma": True, + "with_zstd": True, "with_sqlite3": False, } - generators = "pkg_config" - - _autotools = None - _source_subfolder = "source_subfolder" + @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"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == 'Windows': del self.options.fPIC - if tools.Version(self.version) < "0.186": + if Version(self.version) < "0.186": del self.options.libdebuginfod + del self.options.with_zstd 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.cppstd") + self.settings.rm_safe("compiler.libcxx") - def validate(self): - if tools.Version(self.version) >= "0.186": - if self.settings.compiler in ["Visual Studio", "apple-clang", "msvc"]: - raise ConanInvalidConfiguration("Compiler %s not supported. " - "elfutils only supports gcc and clang" % self.settings.compiler) - else: - if self.settings.compiler in ["Visual Studio", "clang", "apple-clang", "msvc"]: - raise ConanInvalidConfiguration("Compiler %s not supported. " - "elfutils only supports gcc" % self.settings.compiler) - if self.settings.compiler != "gcc": - self.output.warn("Compiler %s is not gcc." % self.settings.compiler) + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.12") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_sqlite3: - self.requires("sqlite3/3.38.5") + self.requires("sqlite3/3.44.2") if self.options.with_bzlib: self.requires("bzip2/1.0.8") if self.options.with_lzma: - self.requires("xz_utils/5.2.5") + self.requires("xz_utils/5.4.5") + if self.options.get_safe("with_zstd"): + self.requires("zstd/1.5.5") if self.options.get_safe("libdebuginfod"): - self.requires("libcurl/7.83.0") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.debuginfod: - # FIXME: missing recipe for libmicrohttpd - raise ConanInvalidConfiguration("libmicrohttpd is not available (yet) on CCI") - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + self.requires("libmicrohttpd/0.9.75") def build_requirements(self): - self.build_requires("automake/1.16.4") + self.tool_requires("gettext/0.21") + self.tool_requires("automake/1.16.5") self.build_requires("m4/1.4.19") self.build_requires("flex/2.6.4") - self.build_requires("bison/3.7.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("bison/3.8.2") + 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 validate(self): + # Note that elfutils cannot be built on macOS + # Example Error: "configure: error: __thread support required" + # Reference: https://stackoverflow.com/questions/72372589/elfutils-build-error-on-mac-configure-error-thread-support-required + if self.settings.os == "Macos": + raise ConanInvalidConfiguration("elfutils does not support macOS.") + + if Version(self.version) >= "0.186": + if self.settings.compiler == "apple-clang" or is_msvc(self): + raise ConanInvalidConfiguration(f"Your compiler {self.settings.compiler} is not supported. " + "elfutils only supports GCC and Clang.") + else: + if self.settings.compiler in ("clang", "apple-clang") or is_msvc(self): + raise ConanInvalidConfiguration(f"Your compiler {self.settings.compiler} is not supported. " + "elfutils only supports GCC.") + if self.settings.compiler != "gcc": + self.output.warning(f"Your compiler {self.settings.compiler} is not GCC.") + def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def _configure_autotools(self): - if not self._autotools: - args = [ - "--disable-werror", - "--enable-static={}".format("no" if self.options.shared else "yes"), - "--enable-deterministic-archives", - "--enable-silent-rules", - "--with-zlib", - "--with-bzlib" if self.options.with_bzlib else "--without-bzlib", - "--with-lzma" if self.options.with_lzma else "--without-lzma", - "--enable-debuginfod" if self.options.debuginfod else "--disable-debuginfod", - ] - if tools.Version(self.version) >= "0.186": - args.append("--enable-libdebuginfod" if self.options.libdebuginfod else "--disable-libdebuginfod") - args.append('BUILD_STATIC={}'.format("0" if self.options.shared else "1")) - - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.configure(configure_dir=self._source_subfolder, args=args) - return self._autotools + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-werror", + "--enable-static={}".format("no" if self.options.shared else "yes"), + "--enable-deterministic-archives", + "--enable-silent-rules", + "--with-zlib", + "--with-bzlib" if self.options.with_bzlib else "--without-bzlib", + "--with-lzma" if self.options.with_lzma else "--without-lzma", + "--with-zstd" if self.options.get_safe("with_zstd") else "--without-zstd", + "--enable-debuginfod" if self.options.debuginfod else "--disable-debuginfod", + ]) + if Version(self.version) >= "0.186": + tc.configure_args.append("--enable-libdebuginfod" if self.options.libdebuginfod else "--disable-libdebuginfod") + tc.configure_args.append(f"BUILD_STATIC={'0' if self.options.shared else '1'}") + if self.options.get_safe("with_zstd"): + # ./configure ignores system_libs + tc.extra_ldflags.append("-pthread") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "config", "eu.am"), + "-Werror", "", strict=False) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with tools.chdir(self._source_subfolder): - self.run("autoreconf -fiv") - autotools = self._configure_autotools() + self._patch_sources() + autotools = Autotools(self) + autotools.autoreconf(args=["-fiv"]) + autotools.configure() autotools.make() - + def package(self): - self.copy(pattern="COPYING*", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() + copy(self, pattern="COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self.options.shared: - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.a") + rm(self, "*.a", os.path.join(self.package_folder, "lib")) else: - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.so") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.so.1") - + rm(self, "*.so", os.path.join(self.package_folder, "lib")) + rm(self, "*.so.1", os.path.join(self.package_folder, "lib")) + def package_info(self): # library components self.cpp_info.components["libelf"].libs = ["elf"] self.cpp_info.components["libelf"].requires = ["zlib::zlib"] - - self.cpp_info.components["libdw"].libs = ["dw"] - self.cpp_info.components["libdw"].requires = ["libelf", "zlib::zlib"] if self.options.with_bzlib: - self.cpp_info.components["libdw"].requires.append("bzip2::bzip2") + self.cpp_info.components["libelf"].requires.append("bzip2::bzip2") if self.options.with_lzma: - self.cpp_info.components["libdw"].requires.append("xz_utils::xz_utils") + self.cpp_info.components["libelf"].requires.append("xz_utils::xz_utils") + if self.options.get_safe("with_zstd"): + self.cpp_info.components["libelf"].requires.append("zstd::zstd") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libelf"].system_libs.append("pthread") + + self.cpp_info.components["libdw"].libs = ["dw"] + self.cpp_info.components["libdw"].requires = ["libelf"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libdw"].system_libs.extend(["dl"]) self.cpp_info.components["libasm"].includedirs = ["include/elfutils"] self.cpp_info.components["libasm"].libs = ["asm"] @@ -160,76 +195,79 @@ def package_info(self): # utilities bin_path = os.path.join(self.package_folder, "bin") + lib_path = os.path.join(self.package_folder, "lib") self.output.info("Appending PATH env var with : {}".format(bin_path)) - self.env_info.PATH.append(bin_path) + self.env_info.PATH.append(bin_path) # Conan V1 + self.env_info.LD_LIBRARY_PATH.append(lib_path) # Conan V1 + self.buildenv_info.append_path("PATH", bin_path) # Conan V2 + self.buildenv_info.append_path("LD_LIBRARY_PATH", lib_path) bin_ext = ".exe" if self.settings.os == "Windows" else "" - - addr2line = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-addr2line" + bin_ext)) + + addr2line = unix_path(self, os.path.join(self.package_folder, "bin", "eu-addr2line" + bin_ext)) self.output.info("Setting ADDR2LINE to {}".format(addr2line)) self.env_info.ADDR2LINE = addr2line - ar = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-ar" + bin_ext)) + ar = unix_path(self, os.path.join(self.package_folder, "bin", "eu-ar" + bin_ext)) self.output.info("Setting AR to {}".format(ar)) self.env_info.AR = ar - elfclassify = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-elfclassify" + bin_ext)) + elfclassify = unix_path(self, os.path.join(self.package_folder, "bin", "eu-elfclassify" + bin_ext)) self.output.info("Setting ELFCLASSIFY to {}".format(elfclassify)) self.env_info.ELFCLASSIFY = elfclassify - elfcmp = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-elfcmp" + bin_ext)) + elfcmp = unix_path(self, os.path.join(self.package_folder, "bin", "eu-elfcmp" + bin_ext)) self.output.info("Setting ELFCMP to {}".format(elfcmp)) self.env_info.ELFCMP = elfcmp - elfcompress = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-elfcompress" + bin_ext)) + elfcompress = unix_path(self, os.path.join(self.package_folder, "bin", "eu-elfcompress" + bin_ext)) self.output.info("Setting ELFCOMPRESS to {}".format(elfcompress)) self.env_info.ELFCOMPRESS = elfcompress - elflint = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-elflint" + bin_ext)) + elflint = unix_path(self, os.path.join(self.package_folder, "bin", "eu-elflint" + bin_ext)) self.output.info("Setting ELFLINT to {}".format(elflint)) self.env_info.ELFLINT = elflint - findtextrel = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-findtextrel" + bin_ext)) + findtextrel = unix_path(self, os.path.join(self.package_folder, "bin", "eu-findtextrel" + bin_ext)) self.output.info("Setting FINDTEXTREL to {}".format(findtextrel)) self.env_info.FINDTEXTREL = findtextrel - make_debug_archive = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-make-debug-archive" + bin_ext)) + make_debug_archive = unix_path(self, os.path.join(self.package_folder, "bin", "eu-make-debug-archive" + bin_ext)) self.output.info("Setting MAKE_DEBUG_ARCHIVE to {}".format(make_debug_archive)) self.env_info.MAKE_DEBUG_ARCHIVE = make_debug_archive - nm = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-nm" + bin_ext)) + nm = unix_path(self, os.path.join(self.package_folder, "bin", "eu-nm" + bin_ext)) self.output.info("Setting NM to {}".format(nm)) self.env_info.NM = nm - objdump = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-objdump" + bin_ext)) + objdump = unix_path(self, os.path.join(self.package_folder, "bin", "eu-objdump" + bin_ext)) self.output.info("Setting OBJDUMP to {}".format(objdump)) self.env_info.OBJDUMP = objdump - ranlib = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-ranlib" + bin_ext)) + ranlib = unix_path(self, os.path.join(self.package_folder, "bin", "eu-ranlib" + bin_ext)) self.output.info("Setting RANLIB to {}".format(ranlib)) self.env_info.RANLIB = ranlib - readelf = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-readelf" + bin_ext)) + readelf = unix_path(self, os.path.join(self.package_folder, "bin", "eu-readelf" + bin_ext)) self.output.info("Setting READELF to {}".format(readelf)) self.env_info.READELF = readelf - size = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-size" + bin_ext)) + size = unix_path(self, os.path.join(self.package_folder, "bin", "eu-size" + bin_ext)) self.output.info("Setting SIZE to {}".format(size)) self.env_info.SIZE = size - stack = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-stack" + bin_ext)) + stack = unix_path(self, os.path.join(self.package_folder, "bin", "eu-stack" + bin_ext)) self.output.info("Setting STACK to {}".format(stack)) self.env_info.STACK = stack - strings = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-strings" + bin_ext)) + strings = unix_path(self, os.path.join(self.package_folder, "bin", "eu-strings" + bin_ext)) self.output.info("Setting STRINGS to {}".format(strings)) self.env_info.STRINGS = strings - strip = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-strip" + bin_ext)) + strip = unix_path(self, os.path.join(self.package_folder, "bin", "eu-strip" + bin_ext)) self.output.info("Setting STRIP to {}".format(strip)) self.env_info.STRIP = strip - unstrip = tools.unix_path(os.path.join(self.package_folder, "bin", "eu-unstrip" + bin_ext)) + unstrip = unix_path(self, os.path.join(self.package_folder, "bin", "eu-unstrip" + bin_ext)) self.output.info("Setting UNSTRIP to {}".format(unstrip)) self.env_info.UNSTRIP = unstrip - diff --git a/recipes/elfutils/all/patches/0.180-0001-Add-enable-werror-configure-option.patch b/recipes/elfutils/all/patches/0.180-0001-Add-enable-werror-configure-option.patch deleted file mode 100644 index 332c215103f1fc..00000000000000 --- a/recipes/elfutils/all/patches/0.180-0001-Add-enable-werror-configure-option.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- config/eu.am -+++ config/eu.am -@@ -73,7 +73,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ - -Wold-style-definition -Wstrict-prototypes -Wtrampolines \ - $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ - $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ -- $(if $($(*F)_no_Werror),,-Werror) \ - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ - $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ - $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \ -@@ -83,7 +82,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \ - -Wtrampolines \ - $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ - $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ -- $(if $($(*F)_no_Werror),,-Werror) \ - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ - $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ - $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \ -diff --git a/source/source_subfolder/configure.ac b/source/source_subfolder/configure.ac -index 74cc749..634858d 100644 ---- configure.ac -+++ configure.ac -@@ -294,6 +294,18 @@ - esac - AC_SUBST([DEBUGPRED], $use_debugpred_val) - -+dnl Enable -Werror -+AC_MSG_CHECKING([whether to treat warnings as errors]) -+AC_ARG_ENABLE([werror], -+AS_HELP_STRING([--enable-werror],[treat warnings as errors]), -+[werror=$enableval], [werror=yes]) -+if test "x$werror" = xyes; then -+ AC_MSG_RESULT([yes]) -+ CFLAGS="$CFLAGS -Werror" -+else -+ AC_MSG_RESULT([no]) -+fi -+ - dnl Enable gprof suport. - AC_ARG_ENABLE([gprof], - AS_HELP_STRING([--enable-gprof],[build binaries with gprof support]), [use_gprof=$enableval], [use_gprof=no]) diff --git a/recipes/elfutils/all/patches/0.180-0001-remove-werror-configure-option.patch b/recipes/elfutils/all/patches/0.180-0001-remove-werror-configure-option.patch new file mode 100644 index 00000000000000..a5b39f30d22c8d --- /dev/null +++ b/recipes/elfutils/all/patches/0.180-0001-remove-werror-configure-option.patch @@ -0,0 +1,23 @@ +diff --git a/source/source_subfolder/configure.ac b/source/source_subfolder/configure.ac +index 74cc749..634858d 100644 +--- configure.ac ++++ configure.ac +@@ -294,6 +294,18 @@ + esac + AC_SUBST([DEBUGPRED], $use_debugpred_val) + ++dnl Enable -Werror ++AC_MSG_CHECKING([whether to treat warnings as errors]) ++AC_ARG_ENABLE([werror], ++AS_HELP_STRING([--enable-werror],[treat warnings as errors]), ++[werror=$enableval], [werror=yes]) ++if test "x$werror" = xyes; then ++ AC_MSG_RESULT([yes]) ++ CFLAGS="$CFLAGS -Werror" ++else ++ AC_MSG_RESULT([no]) ++fi ++ + dnl Enable gprof suport. + AC_ARG_ENABLE([gprof], + AS_HELP_STRING([--enable-gprof],[build binaries with gprof support]), [use_gprof=$enableval], [use_gprof=no]) diff --git a/recipes/elfutils/all/patches/0.186-0001-Add-enable-werror-configure-option.patch b/recipes/elfutils/all/patches/0.186-0001-Add-enable-werror-configure-option.patch deleted file mode 100644 index 789694c1fe951d..00000000000000 --- a/recipes/elfutils/all/patches/0.186-0001-Add-enable-werror-configure-option.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- config/eu.am -+++ config/eu.am -@@ -91,7 +91,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ - -Wold-style-definition -Wstrict-prototypes $(TRAMPOLINES_WARNING) \ - $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ - $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ -- $(if $($(*F)_no_Werror),,-Werror) \ - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ - $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ - $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \ -@@ -101,7 +101,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \ - $(TRAMPOLINES_WARNING) \ - $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ - $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ -- $(if $($(*F)_no_Werror),,-Werror) \ - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ - $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ - $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \ -diff --git a/source/source_subfolder/configure.ac b/source/source_subfolder/configure.ac -index 74cc749..634858d 100644 ---- configure.ac -+++ configure.ac -@@ -262,6 +262,18 @@ - esac - AC_SUBST([DEBUGPRED], $use_debugpred_val) - -+dnl Enable -Werror -+AC_MSG_CHECKING([whether to treat warnings as errors]) -+AC_ARG_ENABLE([werror], -+AS_HELP_STRING([--enable-werror],[treat warnings as errors]), -+[werror=$enableval], [werror=yes]) -+if test "x$werror" = xyes; then -+ AC_MSG_RESULT([yes]) -+ CFLAGS="$CFLAGS -Werror" -+else -+ AC_MSG_RESULT([no]) -+fi -+ - dnl Enable gprof support. - AC_ARG_ENABLE([gprof], - AS_HELP_STRING([--enable-gprof],[build binaries with gprof support]), [use_gprof=$enableval], [use_gprof=no]) diff --git a/recipes/elfutils/all/patches/0.186-0001-remove-werror-configure-option.patch b/recipes/elfutils/all/patches/0.186-0001-remove-werror-configure-option.patch new file mode 100644 index 00000000000000..0cf39dab8bc5b4 --- /dev/null +++ b/recipes/elfutils/all/patches/0.186-0001-remove-werror-configure-option.patch @@ -0,0 +1,23 @@ +diff --git a/source/source_subfolder/configure.ac b/source/source_subfolder/configure.ac +index 74cc749..634858d 100644 +--- configure.ac ++++ configure.ac +@@ -262,6 +262,18 @@ + esac + AC_SUBST([DEBUGPRED], $use_debugpred_val) + ++dnl Enable -Werror ++AC_MSG_CHECKING([whether to treat warnings as errors]) ++AC_ARG_ENABLE([werror], ++AS_HELP_STRING([--enable-werror],[treat warnings as errors]), ++[werror=$enableval], [werror=yes]) ++if test "x$werror" = xyes; then ++ AC_MSG_RESULT([yes]) ++ CFLAGS="$CFLAGS -Werror" ++else ++ AC_MSG_RESULT([no]) ++fi ++ + dnl Enable gprof support. + AC_ARG_ENABLE([gprof], + AS_HELP_STRING([--enable-gprof],[build binaries with gprof support]), [use_gprof=$enableval], [use_gprof=no]) diff --git a/recipes/elfutils/all/patches/0.189-0002-add-enable-static-option-to-configure.patch b/recipes/elfutils/all/patches/0.189-0002-add-enable-static-option-to-configure.patch new file mode 100644 index 00000000000000..ae598f96a07134 --- /dev/null +++ b/recipes/elfutils/all/patches/0.189-0002-add-enable-static-option-to-configure.patch @@ -0,0 +1,32 @@ +diff --git a/configure.ac b/configure.ac +index 6e881fa..3b56d3a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -414,8 +414,26 @@ AS_HELP_STRING([--enable-install-elfh],[install elf.h in include dir]), + [install_elfh=$enableval], [install_elfh=no]) + AM_CONDITIONAL(INSTALL_ELFH, test "$install_elfh" = yes) + ++AC_MSG_CHECKING([whether to build elfutils as a static library]) ++AC_ARG_ENABLE([static], ++AS_HELP_STRING([--enable-static],[build elfutils as static libraries]), ++[static_elfutils=$enableval], [static_elfutils=no]) ++ ++static_elfutils=$static_elfutils ++ ++if test "$static_elfutils" = yes ; then ++ AC_MSG_RESULT([yes]) ++else ++ if test "$use_gprof" = yes -o "$use_gcov" = yes ; then ++ AC_MSG_ERROR([cannot build a shared elfutils with gprof or gcov enabled]) ++ fi ++ AC_MSG_RESULT([no]) ++fi ++ ++ ++ + AM_CONDITIONAL(BUILD_STATIC, [dnl +-test "$use_gprof" = yes -o "$use_gcov" = yes]) ++test "$static_elfutils" = yes]) + + AC_ARG_ENABLE([tests-rpath], + AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]), diff --git a/recipes/elfutils/all/test_package/CMakeLists.txt b/recipes/elfutils/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..5caca1b8ef2e8d 100644 --- a/recipes/elfutils/all/test_package/CMakeLists.txt +++ b/recipes/elfutils/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(elfutils REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE elfutils::elfutils) diff --git a/recipes/elfutils/all/test_package/conanfile.py b/recipes/elfutils/all/test_package/conanfile.py index 3a92de2cf59357..ffc4801c9d705a 100644 --- a/recipes/elfutils/all/test_package/conanfile.py +++ b/recipes/elfutils/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "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) @@ -12,14 +21,11 @@ def build(self): cmake.build() def test(self): - self.run("eu-ar --version", run_environment=True) - - bin_path = os.path.join("bin", "test_package") + self.run("eu-ar --version", env="conanbuild") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") archive_path = "archive.a" - - self.run("eu-ar r {0} {1}".format(archive_path, bin_path), run_environment=True) - self.run("eu-objdump -d {0}".format(bin_path), run_environment=True) - if not tools.cross_building(self.settings): - self.run("{} {}".format(bin_path, bin_path), run_environment=True) - - self.run("{} {}".format(bin_path, archive_path), run_environment=True) + self.run(f"eu-ar r {archive_path} {bin_path}", env="conanbuild") + self.run(f"eu-objdump -d {bin_path}", env="conanbuild") + if can_run(self): + self.run(f"{bin_path} {bin_path}", env="conanrun") + self.run(f"{bin_path} {archive_path}", env="conanrun") diff --git a/recipes/gtsam/all/test_v1_package/CMakeLists.txt b/recipes/elfutils/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/gtsam/all/test_v1_package/CMakeLists.txt rename to recipes/elfutils/all/test_v1_package/CMakeLists.txt diff --git a/recipes/elfutils/all/test_v1_package/conanfile.py b/recipes/elfutils/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a4c0641d885f0f --- /dev/null +++ b/recipes/elfutils/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +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): + self.run("eu-ar --version", run_environment=True) + bin_path = os.path.join("bin", "test_package") + archive_path = "archive.a" + self.run(f"eu-ar r {archive_path} {bin_path}", run_environment=True) + self.run(f"eu-objdump -d {bin_path}", run_environment=True) + if not tools.cross_building(self): + self.run(f"{bin_path} {bin_path}", run_environment=True) + self.run(f"{bin_path} {archive_path}", run_environment=True) diff --git a/recipes/elfutils/config.yml b/recipes/elfutils/config.yml index 837391aa2d05df..2b63e87901919f 100644 --- a/recipes/elfutils/config.yml +++ b/recipes/elfutils/config.yml @@ -1,4 +1,8 @@ versions: + "0.190": + folder: all + "0.189": + folder: all "0.186": folder: all "0.180": diff --git a/recipes/embag/all/CMakeLists.txt b/recipes/embag/all/CMakeLists.txt new file mode 100644 index 00000000000000..6638694bdd2b66 --- /dev/null +++ b/recipes/embag/all/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.15) +project(embag LANGUAGES CXX) + +find_package(Boost REQUIRED COMPONENTS iostreams headers) +find_package(lz4 REQUIRED CONFIG) +find_package(BZip2 REQUIRED CONFIG) + +file(GLOB_RECURSE embag_SOURCES "lib/*.cc") +add_library(embag ${embag_SOURCES}) +set_target_properties(embag PROPERTIES + # embag does not export any symbols otherwise + WINDOWS_EXPORT_ALL_SYMBOLS ON +) +target_compile_features(embag PUBLIC cxx_std_14) +target_link_libraries(embag PUBLIC + Boost::iostreams + Boost::headers + lz4::lz4 + BZip2::BZip2 +) + +if (MSVC) + # For a #if __cplusplus < 201402L check in lib/util.h + target_compile_options(embag PRIVATE /Zc:__cplusplus) +endif() + +install(TARGETS embag) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/embag + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp" +) diff --git a/recipes/embag/all/conandata.yml b/recipes/embag/all/conandata.yml new file mode 100644 index 00000000000000..6df20cbf9a5ef0 --- /dev/null +++ b/recipes/embag/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.42": + url: "https://github.com/embarktrucks/embag/archive/refs/tags/0.0.42.tar.gz" + sha256: "60b22ba9355528040046b7e2c3ee968798ad5773a9eb7a1d13cf33dc47e2adec" diff --git a/recipes/embag/all/conanfile.py b/recipes/embag/all/conanfile.py new file mode 100644 index 00000000000000..3d3e19b6eb19bb --- /dev/null +++ b/recipes/embag/all/conanfile.py @@ -0,0 +1,91 @@ +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 get, copy, rm +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" + + +class EmbagConan(ConanFile): + name = "embag" + description = "Schema and dependency free ROS bag reader" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/embarktrucks/embag" + topics = ("rosbag", "ros", "robotics") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 14 + + def export_sources(self): + copy(self, "CMakeLists.txt", + src=self.recipe_folder, + dst=os.path.join(self.export_sources_folder, "src")) + + 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): + # INFO: embag.h includes boost/variant.hpp + self.requires("boost/1.82.0", transitive_headers=True) + # INFO: decompression.h includes lz4frame.h + self.requires("lz4/1.9.4", transitive_headers=True) + # INFO: ros_bag_types.h includes bzlib.h + self.requires("bzip2/1.0.8", transitive_headers=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) + cmake.install() + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.libs = ["embag"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + if is_msvc(self): + # For a #if __cplusplus < 201402L check in lib/util.h, which is a public header + self.cpp_info.cxxflags.append("/Zc:__cplusplus") diff --git a/recipes/embag/all/test_package/CMakeLists.txt b/recipes/embag/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..27b09cd59a9016 --- /dev/null +++ b/recipes/embag/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(embag REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE embag::embag) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/embag/all/test_package/conanfile.py b/recipes/embag/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/embag/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/embag/all/test_package/test_package.cpp b/recipes/embag/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..c8563d402b2b7b --- /dev/null +++ b/recipes/embag/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include + +#include + +int main() { + Embag::View view{}; + // Do not load any bag file for testing + // view.addBag("xyz.bag"); + const auto start_time = view.getStartTime(); + const auto end_time = view.getEndTime(); + std::cout << "Start time is " << start_time.secs + start_time.nsecs * 1e-9 << std::endl; + std::cout << "End time is " << end_time.secs + end_time.nsecs * 1e-9 << std::endl; + for (const auto &message : view.getMessages()) { + message->print(); + } + return EXIT_SUCCESS; +} diff --git a/recipes/embag/config.yml b/recipes/embag/config.yml new file mode 100644 index 00000000000000..97f7bce9d3b04c --- /dev/null +++ b/recipes/embag/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.42": + folder: all diff --git a/recipes/embedded_ringbuf_cpp/all/conandata.yml b/recipes/embedded_ringbuf_cpp/all/conandata.yml new file mode 100644 index 00000000000000..123dfa02585908 --- /dev/null +++ b/recipes/embedded_ringbuf_cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3": + url: "https://github.com/wizard97/Embedded_RingBuf_CPP/archive/refs/tags/1.3.tar.gz" + sha256: "52340d9762e48b507810458507105c79c57c4d9bff2a9faec6c48bbf65ed2290" diff --git a/recipes/embedded_ringbuf_cpp/all/conanfile.py b/recipes/embedded_ringbuf_cpp/all/conanfile.py new file mode 100644 index 00000000000000..177f5ad4ff7854 --- /dev/null +++ b/recipes/embedded_ringbuf_cpp/all/conanfile.py @@ -0,0 +1,47 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + +class EmbeddedRingbufcppConan(ConanFile): + name = "embedded_ringbuf_cpp" + description = "A simple C++ Ring (Circular) Buffer Queuing Library for Programming with Arduino's and other Embedded platforms" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/wizard97/Embedded_RingBuf_CPP/" + topics = ("ring buffer", "circular buffer", "queue", "data-structures", "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 validate(self): + # embedded_ringbuf_cpp uses #warning preprocessor directive + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio and msvc.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="RingBuf*.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/embedded_ringbuf_cpp/all/test_package/CMakeLists.txt b/recipes/embedded_ringbuf_cpp/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..ac26e4c63d05b1 --- /dev/null +++ b/recipes/embedded_ringbuf_cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(embedded_ringbuf_cpp CONFIG REQUIRED) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE embedded_ringbuf_cpp::embedded_ringbuf_cpp) diff --git a/recipes/embedded_ringbuf_cpp/all/test_package/conanfile.py b/recipes/embedded_ringbuf_cpp/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/embedded_ringbuf_cpp/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/embedded_ringbuf_cpp/all/test_package/test_package.cpp b/recipes/embedded_ringbuf_cpp/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..c12de1cdf78c11 --- /dev/null +++ b/recipes/embedded_ringbuf_cpp/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +// size_t is needed for RingBufCPP +#include + +#include + +int main() { + RingBufCPP q; + + q.add(12); + + int tmp; + q.pull(&tmp); + + return 0; +} diff --git a/recipes/embedded_ringbuf_cpp/config.yml b/recipes/embedded_ringbuf_cpp/config.yml new file mode 100644 index 00000000000000..d2eb4ed4a511f9 --- /dev/null +++ b/recipes/embedded_ringbuf_cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3": + folder: all diff --git a/recipes/emio/all/conandata.yml b/recipes/emio/all/conandata.yml index 7951ebbf46b659..9c813361173484 100644 --- a/recipes/emio/all/conandata.yml +++ b/recipes/emio/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "0.5.0": + url: "https://github.com/viatorus/emio/archive/0.5.0.tar.gz" + sha256: "14cfa81d96db6ef74b8da7b5d2ffbd26535f2930d0d423e4fde7b526ddb3b308" + "0.4.0": + url: "https://github.com/viatorus/emio/archive/0.4.0.tar.gz" + sha256: "847198a37fbf9dcc00ac85fbc64b283e41a018f53c39363129a4bdb9939338a6" "0.3.0": url: "https://github.com/viatorus/emio/archive/0.3.0.tar.gz" sha256: "d891d0a435a8b71eee78bba46b9abc3848b1c20d61eb747b6059adaf23acce1d" diff --git a/recipes/emio/config.yml b/recipes/emio/config.yml index d126790212e0c4..01ed4761ab0189 100644 --- a/recipes/emio/config.yml +++ b/recipes/emio/config.yml @@ -1,3 +1,11 @@ versions: + "0.6.1": + folder: all + "0.6.0": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all "0.3.0": folder: all diff --git a/recipes/emsdk/all/conandata.yml b/recipes/emsdk/all/conandata.yml index 8a32427b651c26..09c67e41502dfe 100644 --- a/recipes/emsdk/all/conandata.yml +++ b/recipes/emsdk/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "3.1.50": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.50.tar.gz" + sha256: "7491a881eb5ee15fe81bbabcfff1fd571e45ccdb24a81890af429f9970cbd1f3" + "3.1.49": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.49.tar.gz" + sha256: "c99d98da9241c7e72784bc764a3e60a65d8f27202d45f3cd422b2ac7245380d9" + "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" "3.1.31": url: "https://github.com/emscripten-core/emsdk/archive/3.1.31.tar.gz" sha256: "1d38b7375e12e85197165a4c51d76d90e1d9db8c2c593b64cfaec4338af54750" diff --git a/recipes/emsdk/config.yml b/recipes/emsdk/config.yml index 82752e0f1209d8..3fd73e6da55302 100644 --- a/recipes/emsdk/config.yml +++ b/recipes/emsdk/config.yml @@ -1,4 +1,18 @@ versions: + "3.1.50": + folder: all + "3.1.49": + folder: all + "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": folder: all "3.1.30": 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/enchant/all/test_v1_package/conanfile.py b/recipes/enchant/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a8c92dea633357 --- /dev/null +++ b/recipes/enchant/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +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.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/enhex-strong_type/all/conanfile.py b/recipes/enhex-strong_type/all/conanfile.py index 40601c5f9d3e88..8b4ea08eec845b 100644 --- a/recipes/enhex-strong_type/all/conanfile.py +++ b/recipes/enhex-strong_type/all/conanfile.py @@ -1,50 +1,72 @@ -from conans import ConanFile, tools -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.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + class EnhexStrongTypeConan(ConanFile): name = "enhex-strong_type" - license = "MIT" description = "Create new type from existing type without changing the interface." - topics = ("strong_type", "safety") - homepage = "https://github.com/Enhex/strong_type" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Enhex/strong_type" + topics = ("strong_type", "safety", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = ("compiler") @property - def _source_subfolder(self): - return "source_subfolder" - - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + def _min_cppstd(self): + return 17 - minimal_version = { + @property + def _compilers_minimum_version(self): + return { "Visual Studio": "15", + "msvc": "191", "gcc": "7", "clang": "5.0", - "apple-clang": "9.1" + "apple-clang": "9.1", } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + compiler = str(self.settings.compiler) - compiler_version = tools.Version(self.settings.compiler.version) + compiler_version = Version(self.settings.compiler.version) - if compiler not in minimal_version: - self.output.info("{} requires a compiler that supports at least C++17".format(self.name)) + if compiler not in self._compilers_minimum_version: + self.output.info(f"{self.name} requires a compiler that supports at least C++17") return # Exclude compilers not supported - if compiler_version < minimal_version[compiler]: - raise ConanInvalidConfiguration("{} requires a compiler that supports at least C++17. {} {} is not".format( - self.name, compiler, tools.Version(self.settings.compiler.version.value))) + if compiler_version < self._compilers_minimum_version[compiler]: + raise ConanInvalidConfiguration( + f"{self.name} requires a compiler that supports at least C++17. " + f"{compiler} {Version(self.settings.compiler.version.value)} is not" + ) 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(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/enhex-strong_type/all/test_package/CMakeLists.txt b/recipes/enhex-strong_type/all/test_package/CMakeLists.txt index ee8f5992e5656a..51d45c127f7222 100644 --- a/recipes/enhex-strong_type/all/test_package/CMakeLists.txt +++ b/recipes/enhex-strong_type/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(enhex-strong_type CONFIG REQUIRED) +find_package(enhex-strong_type REQUIRED CONFIG) add_executable(example example.cpp) target_link_libraries(example enhex-strong_type::enhex-strong_type) diff --git a/recipes/enhex-strong_type/all/test_package/conanfile.py b/recipes/enhex-strong_type/all/test_package/conanfile.py index c48d1d23bfccde..8d52b7021efe14 100644 --- a/recipes/enhex-strong_type/all/test_package/conanfile.py +++ b/recipes/enhex-strong_type/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 EnhexStrongTypeTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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", "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/enhex-strong_type/all/test_v1_package/CMakeLists.txt b/recipes/enhex-strong_type/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/enhex-strong_type/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/enhex-strong_type/all/test_v1_package/conanfile.py b/recipes/enhex-strong_type/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c48d1d23bfccde --- /dev/null +++ b/recipes/enhex-strong_type/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class EnhexStrongTypeTestConan(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", "example") + self.run(bin_path, run_environment=True) 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/enkits/all/CMakeLists.txt b/recipes/enkits/all/CMakeLists.txt deleted file mode 100644 index c986d294c75479..00000000000000 --- a/recipes/enkits/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/enkits/all/conandata.yml b/recipes/enkits/all/conandata.yml index 9604c7fcf2b728..197355c129edc9 100644 --- a/recipes/enkits/all/conandata.yml +++ b/recipes/enkits/all/conandata.yml @@ -8,13 +8,3 @@ sources: "1.8": url: "https://github.com/dougbinks/enkiTS/archive/v1.8.zip" sha256: "b96d8d439502d52f9dc419539b12b588df10750f4631ad5518586f7048cdfaef" -patches: - "1.11": - - patch_file: "patches/cmake-install-lib-location.patch" - base_path: "source_subfolder" - "1.10": - - patch_file: "patches/cmake-install-lib-location.patch" - base_path: "source_subfolder" - "1.8": - - patch_file: "patches/cmake-install-lib-location.patch" - base_path: "source_subfolder" diff --git a/recipes/enkits/all/conanfile.py b/recipes/enkits/all/conanfile.py index 3a8bf5c9e920b0..6149fad91345f3 100644 --- a/recipes/enkits/all/conanfile.py +++ b/recipes/enkits/all/conanfile.py @@ -1,18 +1,22 @@ import os -from conans import ConanFile, CMake, tools + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, export_conandata_patches, get, replace_in_file + +required_conan_version = ">=1.53.0" + class EnkiTSConan(ConanFile): name = "enkits" description = "A permissively licensed C and C++ Task Scheduler for creating parallel programs." - topics = ("conan", "c", "thread", "multithreading", "scheduling", "enkits", "gamedev") + license = "Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/dougbinks/enkiTS" - license = "Zlib" - settings = "os", "arch", "compiler", "build_type" - - exports_sources = "CMakeLists.txt", "patches/*" - generators = "cmake" + topics = ("c", "thread", "multithreading", "scheduling", "gamedev") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,11 +26,8 @@ class EnkiTSConan(ConanFile): "fPIC": True, } - _cmake = None - - @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": @@ -34,37 +35,44 @@ 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 source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "enkiTS-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["ENKITS_INSTALL"] = True - self._cmake.definitions["ENKITS_BUILD_EXAMPLES"] = False - self._cmake.definitions["ENKITS_BUILD_SHARED"] = self.options.shared - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENKITS_INSTALL"] = True + tc.variables["ENKITS_BUILD_EXAMPLES"] = False + tc.variables["ENKITS_BUILD_SHARED"] = self.options.shared + tc.generate() + + def _patch_sources(self): + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + 'install(TARGETS enkiTS DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/enkiTS")', + "install(TARGETS enkiTS ARCHIVE LIBRARY RUNTIME)", + ) def build(self): - for patch in self.conan_data["patches"][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.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "License.txt", 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 = ["enkiTS"] - + if self.options.shared: self.cpp_info.defines.append("ENKITS_DLL=1") - if self.settings.os == "Linux": - self.cpp_info.system_libs = ["pthread"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] diff --git a/recipes/enkits/all/patches/cmake-install-lib-location.patch b/recipes/enkits/all/patches/cmake-install-lib-location.patch deleted file mode 100644 index 0a43979813c180..00000000000000 --- a/recipes/enkits/all/patches/cmake-install-lib-location.patch +++ /dev/null @@ -1,5 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -63,1 +63,1 @@ -- install(TARGETS enkiTS DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/enkiTS") -+ install(TARGETS enkiTS ARCHIVE LIBRARY RUNTIME) diff --git a/recipes/enkits/all/test_package/CMakeLists.txt b/recipes/enkits/all/test_package/CMakeLists.txt index 33ae887aa6aea3..2c29974d552845 100644 --- a/recipes/enkits/all/test_package/CMakeLists.txt +++ b/recipes/enkits/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(enkits REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE enkits::enkits) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/enkits/all/test_package/conanfile.py b/recipes/enkits/all/test_package/conanfile.py index 32e9e0cb58ab64..ef5d7042163ecc 100644 --- a/recipes/enkits/all/test_package/conanfile.py +++ b/recipes/enkits/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" + 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.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/enkits/all/test_v1_package/CMakeLists.txt b/recipes/enkits/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/enkits/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/enkits/all/test_v1_package/conanfile.py b/recipes/enkits/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..910ae60d104386 --- /dev/null +++ b/recipes/enkits/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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ensmallen/all/conandata.yml b/recipes/ensmallen/all/conandata.yml new file mode 100644 index 00000000000000..a566be23b48935 --- /dev/null +++ b/recipes/ensmallen/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.19.1": + url: "https://ensmallen.org/files/ensmallen-2.19.1.tar.gz" + sha256: "f36ad7f08b0688d2a8152e1c73dd437c56ed7a5af5facf65db6ffd977b275b2e" diff --git a/recipes/ensmallen/all/conanfile.py b/recipes/ensmallen/all/conanfile.py new file mode 100644 index 00000000000000..7b6250290ad813 --- /dev/null +++ b/recipes/ensmallen/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile, conan_version +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import get, replace_in_file, rmdir, copy +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.55.0" + +class ensmallenRecipe(ConanFile): + name = "ensmallen" + description = "ensmallen is a high quality C++ library for non-linear numerical optimization." + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mlpack/ensmallen" + topics = ("optimization", "numerical", "header-only") + + package_type = "header-library" + settings = "os", "compiler", "build_type", "arch" + + def package_id(self): + self.info.clear() + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("armadillo/12.2.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + deps = CMakeDeps(self) + deps.set_property("armadillo", "cmake_file_name", "Armadillo") + deps.set_property("armadillo", "cmake_target_name", "Armadillo::Armadillo") + deps.set_property("armadillo", "cmake_config_version_compat", "AnyNewerVersion") + deps.generate() + tc = CMakeToolchain(self) + tc.variables["USE_OPENMP"] = False + tc.generate() + + + def build(self): + # TODO: Remove when conan 1.x support is dropped. This is largely resolved by the above + # specification of AnyNewerVersion for the compatibility policy, but this feature isn't + # available below version 2.0.12. + if conan_version < Version("2.0.12"): + # Remove hard requirement on armadillo 9.800.0 + # This is a minimum requirement, use latest + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(Armadillo 9.800.0 REQUIRED)", + "find_package(Armadillo REQUIRED)", + ) + cmake = CMake(self) + cmake.configure() + + def package(self): + cmake = CMake(self) + cmake.install() + + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + 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/ensmallen/all/test_package/CMakeLists.txt b/recipes/ensmallen/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..be7bc25d1dfa34 --- /dev/null +++ b/recipes/ensmallen/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +set(CMAKE_CXX_STANDARD 11) +find_package(ensmallen CONFIG REQUIRED) + +add_executable(example src/example.cpp) +target_link_libraries(example ensmallen::ensmallen) diff --git a/recipes/ensmallen/all/test_package/conanfile.py b/recipes/ensmallen/all/test_package/conanfile.py new file mode 100644 index 00000000000000..9cfc468cba5a76 --- /dev/null +++ b/recipes/ensmallen/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + +class ensmallenTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + def requirements(self): + self.requires(self.tested_reference_str) + # Required for consumers of armadillo>=12.2.0 due to upstream changes + # and armadillo/*:use_hdf5=True by default. + # See https://github.com/conan-io/conan-center-index/pull/17320 for more + # information. + self.requires("hdf5/1.14.1") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + cmd = [os.path.join(self.cpp.build.bindir, "example"), "10", "20"] + self.run(" ".join(cmd), env="conanrun") diff --git a/recipes/ensmallen/all/test_package/src/example.cpp b/recipes/ensmallen/all/test_package/src/example.cpp new file mode 100644 index 00000000000000..264f137bd06572 --- /dev/null +++ b/recipes/ensmallen/all/test_package/src/example.cpp @@ -0,0 +1,70 @@ +// Example implementation of an objective function class for linear regression +// and usage of the L-BFGS optimizer. +// +// Compilation: +// g++ example.cpp -o example -O3 -larmadillo + + +#include +#include +#include + + +class LinearRegressionFunction +{ + public: + + LinearRegressionFunction(arma::mat& X, arma::vec& y) : X(X), y(y) { } + + double EvaluateWithGradient(const arma::mat& theta, arma::mat& gradient) + { + const arma::vec tmp = X.t() * theta - y; + gradient = 2 * X * tmp; + return arma::dot(tmp,tmp); + } + + private: + + const arma::mat& X; + const arma::vec& y; +}; + + +int main(int argc, char** argv) +{ + if (argc < 3) + { + std::cout << "usage: " << argv[0] << " n_dims n_points" << std::endl; + return -1; + } + + int n_dims = atoi(argv[1]); + int n_points = atoi(argv[2]); + + // generate noisy dataset with a slight linear pattern + arma::mat X(n_dims, n_points, arma::fill::randu); + arma::vec y( n_points, arma::fill::randu); + + for (size_t i = 0; i < n_points; ++i) + { + double a = arma::randu(); + X(1, i) += a; + y(i) += a; + } + + LinearRegressionFunction lrf(X, y); + + // create a Limited-memory BFGS optimizer object with default parameters + ens::L_BFGS opt; + opt.MaxIterations() = 10; + + // initial point (uniform random) + arma::vec theta(n_dims, arma::fill::randu); + + opt.Optimize(lrf, theta); + + // theta now contains the optimized parameters + theta.print("theta:"); + + return 0; +} diff --git a/recipes/ensmallen/config.yml b/recipes/ensmallen/config.yml new file mode 100644 index 00000000000000..3af39348507628 --- /dev/null +++ b/recipes/ensmallen/config.yml @@ -0,0 +1,3 @@ +versions: + "2.19.1": + folder: all diff --git a/recipes/entt/3.x.x/conanfile.py b/recipes/entt/3.x.x/conanfile.py index bcce48c1ce46cc..3247530d794dce 100644 --- a/recipes/entt/3.x.x/conanfile.py +++ b/recipes/entt/3.x.x/conanfile.py @@ -15,6 +15,7 @@ class EnttConan(ConanFile): homepage = "https://github.com/skypjack/entt" url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @property @@ -41,7 +42,6 @@ def package_id(self): self.info.clear() def validate(self): - # TODO: use self.info.settings in validate() instead of self.settings if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) @@ -58,8 +58,7 @@ def loose_lt_semver(v1, v2): ) 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/enum-flags/all/conanfile.py b/recipes/enum-flags/all/conanfile.py index 81ac78601093a3..5d86c60a02e474 100644 --- a/recipes/enum-flags/all/conanfile.py +++ b/recipes/enum-flags/all/conanfile.py @@ -14,7 +14,7 @@ class EnumFlagsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" topics = ("bitmask", "enum") license = "MIT" - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "forbid_implicit_conversions": [True, False], @@ -36,8 +36,7 @@ def validate(self): check_min_cppstd(self, 11) 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 diff --git a/recipes/etc2comp/all/CMakeLists.txt b/recipes/etc2comp/all/CMakeLists.txt deleted file mode 100644 index c986d294c75479..00000000000000 --- a/recipes/etc2comp/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/etc2comp/all/conandata.yml b/recipes/etc2comp/all/conandata.yml index c09fa8bdc3d9b0..a0bae7c1226dd7 100644 --- a/recipes/etc2comp/all/conandata.yml +++ b/recipes/etc2comp/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "cci.20170424": - patch_file: "patches/fix-cmake.patch" - base_path: "source_subfolder" diff --git a/recipes/etc2comp/all/conanfile.py b/recipes/etc2comp/all/conanfile.py index 4a9a0df7d22660..0293dc8b7a9962 100644 --- a/recipes/etc2comp/all/conanfile.py +++ b/recipes/etc2comp/all/conanfile.py @@ -1,16 +1,22 @@ import os -import glob -from conans import ConanFile, CMake, tools + +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 apply_conandata_patches, collect_libs, copy, export_conandata_patches, get + +required_conan_version = ">=1.53.0" + class Etc2compConan(ConanFile): name = "etc2comp" description = "Open source c++ skeletal animation library and toolset." - license = "Apache-2.0", - topics = ("conan", "texture", "etc2", "compressor") - homepage = "https://github.com/google/etc2comp" + license = ("Apache-2.0",) url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" + homepage = "https://github.com/google/etc2comp" + topics = ("texture", "etc2", "compressor") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,54 +27,51 @@ class Etc2compConan(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @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': + 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.cppstd: - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob('etc2comp-*/')[0] - os.rename(extracted_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.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(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(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.lib", dst="lib", keep_path=False) - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.so*", dst="lib", keep_path=False, symlinks=True) - self.copy("*.dylib", dst="lib", keep_path=False) - self.copy("*.a", dst="lib", keep_path=False) - self.copy("*.h", dst=os.path.join("include"), src=os.path.join(self._source_subfolder, "EtcLib"), keep_path=False) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + for pattern in ["*.lib", "*.a", "*.so*", "*.dylib"]: + copy(self, pattern, dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) + copy( + self, + "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "EtcLib"), + keep_path=False, + ) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) - if self.settings.os == "Linux": - self.cpp_info.system_libs.append("pthread") + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/etc2comp/all/test_package/CMakeLists.txt b/recipes/etc2comp/all/test_package/CMakeLists.txt index aede60e3b1e4a0..174341b077e2c4 100644 --- a/recipes/etc2comp/all/test_package/CMakeLists.txt +++ b/recipes/etc2comp/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(etc2comp REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE etc2comp::etc2comp) set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/etc2comp/all/test_package/conanfile.py b/recipes/etc2comp/all/test_package/conanfile.py index 4903f1a7e8fa0f..ef5d7042163ecc 100644 --- a/recipes/etc2comp/all/test_package/conanfile.py +++ b/recipes/etc2comp/all/test_package/conanfile.py @@ -1,9 +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" + 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.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/etc2comp/all/test_v1_package/CMakeLists.txt b/recipes/etc2comp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/etc2comp/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/etc2comp/all/test_v1_package/conanfile.py b/recipes/etc2comp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6c9d5dba712c72 --- /dev/null +++ b/recipes/etc2comp/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/eternal/all/conanfile.py b/recipes/eternal/all/conanfile.py index fd3a53c2138bb0..e5e54e89f5ce3c 100644 --- a/recipes/eternal/all/conanfile.py +++ b/recipes/eternal/all/conanfile.py @@ -7,7 +7,7 @@ import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.50.0" class EternalConan(ConanFile): @@ -17,6 +17,7 @@ class EternalConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mapbox/eternal" topics = ("hashing", "map", "constexpr", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -34,10 +35,6 @@ def _compilers_minimum_version(self): "apple-clang": "10", } - 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) - def layout(self): basic_layout(self, src_folder="src") @@ -52,8 +49,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") 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 @@ -64,6 +60,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/eternal/all/test_package/CMakeLists.txt b/recipes/eternal/all/test_package/CMakeLists.txt index 8d5920de9d2e0b..332722f9d1b681 100644 --- a/recipes/eternal/all/test_package/CMakeLists.txt +++ b/recipes/eternal/all/test_package/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(eternal REQUIRED CONFIG) diff --git a/recipes/eternal/all/test_v1_package/CMakeLists.txt b/recipes/eternal/all/test_v1_package/CMakeLists.txt index e900db203f73f6..be00a8c7f57c71 100644 --- a/recipes/eternal/all/test_v1_package/CMakeLists.txt +++ b/recipes/eternal/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,8 @@ cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(eternal REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE eternal::eternal) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/ethash/all/conandata.yml b/recipes/ethash/all/conandata.yml new file mode 100644 index 00000000000000..90bf836e839d3c --- /dev/null +++ b/recipes/ethash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.1": + url: "https://github.com/chfast/ethash/archive/v1.0.1.tar.gz" + sha256: "17e0786ba8437c1b0c61f2065da71ce1b9cc871f8723a747a8aae8b71334d95f" diff --git a/recipes/ethash/all/conanfile.py b/recipes/ethash/all/conanfile.py new file mode 100644 index 00000000000000..b8c0665ba02130 --- /dev/null +++ b/recipes/ethash/all/conanfile.py @@ -0,0 +1,110 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.51.1" + + +class EthashConan(ConanFile): + name = "ethash" + description = "C/C++ implementation of Ethash and ProgPoW – the Ethereum Proof of Work algorithms" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/chfast/ethash" + topics = ("ethereum", "mining", "proof-of-work") + package_type = "library" + + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], + "fPIC": [True, False], + "build_ethash": [True, False], + "build_global_context": [True, False]} + default_options = {"shared": False, + "fPIC": True, + "build_ethash": True, + "build_global_context": True} + + @property + def _min_cppstd(self): + return 14 + + 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.options.build_ethash: + self.options.rm_safe("build_global_context") + + def layout(self): + cmake_layout(self, src_folder="src") + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "190", + "gcc": "5", + "clang": "5", + "apple-clang": "10", + } + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16.2 <4]") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # INFO: Options are declared before project() call + tc.cache_variables["ETHASH_INSTALL_CMAKE_CONFIG"] = False + tc.cache_variables["ETHASH_TESTING"] = False + tc.cache_variables["ETHASH_BUILD_ETHASH"] = self.options.build_ethash + tc.cache_variables["ETHASH_BUILD_GLOBAL_CONTEXT"] = self.options.get_safe("build_global_context", False) + tc.generate() + + def validate(self): + if self.settings.get_safe("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 build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + pattern="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.components["keccak"].set_property("cmake_target_name", "ethash::keccak") + self.cpp_info.components["keccak"].libs = ["keccak"] + + if self.options.build_ethash: + self.cpp_info.components["ethash"].set_property("cmake_target_name", "ethash::ethash") + self.cpp_info.components["ethash"].requires = ["keccak"] + self.cpp_info.components["ethash"].libs = ["ethash"] + + if self.options.get_safe("build_global_context"): + # INFO: ethash-global-context is static library always + self.cpp_info.components["global_context"].set_property("cmake_target_name", "ethash::global-context") + self.cpp_info.components["global_context"].requires = ["ethash"] + self.cpp_info.components["global_context"].libs = ["ethash-global-context"] diff --git a/recipes/ethash/all/test_package/CMakeLists.txt b/recipes/ethash/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..5a5d08dd645f7e --- /dev/null +++ b/recipes/ethash/all/test_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ethash REQUIRED CONFIG) + +set(ETHASH_TARGETS ethash::keccak) +if (TARGET ethash::ethash) + list(APPEND ETHASH_TARGETS ethash::ethash) +endif() +if (TARGET ethash::global-context) + list(APPEND ETHASH_TARGETS ethash::global-context) +endif() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ${ETHASH_TARGETS}) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14) diff --git a/recipes/ethash/all/test_package/conanfile.py b/recipes/ethash/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/ethash/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ethash/all/test_package/test_package.cpp b/recipes/ethash/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..da1378296d29d1 --- /dev/null +++ b/recipes/ethash/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **) { + auto epoch_num = ethash::get_epoch_number(0); + return 0; +} diff --git a/recipes/ethash/config.yml b/recipes/ethash/config.yml new file mode 100644 index 00000000000000..715e55357a17be --- /dev/null +++ b/recipes/ethash/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/etl/all/conandata.yml b/recipes/etl/all/conandata.yml index d02bdeabb7ddbe..279507cf9ffbea 100644 --- a/recipes/etl/all/conandata.yml +++ b/recipes/etl/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "20.38.7": + url: "https://github.com/ETLCPP/etl/archive/20.38.7.tar.gz" + sha256: "65cfc033bacab452af05a36bd53b8cdc2bdfd1492b2adc5bb51d2f00e451491f" + "20.38.6": + url: "https://github.com/ETLCPP/etl/archive/20.38.6.tar.gz" + sha256: "95515f2229fe75393d18ee95548998a06e65a02acd5eedae5808dd34f8201462" + "20.38.4": + url: "https://github.com/ETLCPP/etl/archive/20.38.4.tar.gz" + sha256: "4074583bacac17e7944030f099d18a4ea3591d5d58b8d8b85c1b7f080a3e9610" + "20.38.3": + url: "https://github.com/ETLCPP/etl/archive/20.38.3.tar.gz" + sha256: "7d2f384dfa9a50c8e066b716524016d2b62e753b0b75fed09a2b7e2c260759d2" + "20.38.0": + url: "https://github.com/ETLCPP/etl/archive/20.38.0.tar.gz" + sha256: "7e29ce81a2a2d5826286502a2ad5bde1f4b591d2c9e0ef7ccc335e75445223cd" + "20.37.3": + url: "https://github.com/ETLCPP/etl/archive/20.37.3.tar.gz" + sha256: "fbdf60c770772cd96d1eb25bdf56e4f45f23bf4029e18ef1f2af1f2056b9ea41" + "20.37.2": + url: "https://github.com/ETLCPP/etl/archive/20.37.2.tar.gz" + sha256: "13bd5d9d1bfbc887e3182895ca0291df0008a1c5770ddd12ef6cd2215c2bc6af" "20.37.1": url: "https://github.com/ETLCPP/etl/archive/20.37.1.tar.gz" sha256: "73c29678e478eca9243c1d0c98e727a2249a7973d1429a847c669bccc65dca88" @@ -23,9 +44,3 @@ sources: "20.34.0": url: "https://github.com/ETLCPP/etl/archive/20.34.0.tar.gz" sha256: "56e25968f20167a161ee50c3eecda3daa91f696660ba59654c1afd22e502c465" - "20.33.0": - url: "https://github.com/ETLCPP/etl/archive/20.33.0.tar.gz" - sha256: "46068e44cc3cbd626fc8adc5344101b4654c675b9a5faec0c80989176419cd7d" - "20.32.1": - url: "https://github.com/ETLCPP/etl/archive/20.32.1.tar.gz" - sha256: "f39c8ccf33190303946dbcb2b251c86b4516234f57e0e87b83c0a28a1bdb059d" diff --git a/recipes/etl/all/conanfile.py b/recipes/etl/all/conanfile.py index b0f40f7104e269..a1737588ee9650 100644 --- a/recipes/etl/all/conanfile.py +++ b/recipes/etl/all/conanfile.py @@ -60,7 +60,8 @@ def _module_file_rel_path(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "etl") - self.cpp_info.set_property("cmake_target_name", "etl") + self.cpp_info.set_property("cmake_target_name", "etl::etl") + self.cpp_info.set_property("cmake_target_aliases", ["etl"]) # legacy target before 20.27.2 self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/etl/all/test_package/CMakeLists.txt b/recipes/etl/all/test_package/CMakeLists.txt index b8e7aee7d94588..abf67a0fae7eec 100644 --- a/recipes/etl/all/test_package/CMakeLists.txt +++ b/recipes/etl/all/test_package/CMakeLists.txt @@ -5,4 +5,4 @@ find_package(etl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -target_link_libraries(${PROJECT_NAME} PRIVATE etl) +target_link_libraries(${PROJECT_NAME} PRIVATE etl::etl) diff --git a/recipes/etl/all/test_v1_package/CMakeLists.txt b/recipes/etl/all/test_v1_package/CMakeLists.txt index b8e7ad788b8211..19dd51b438baa7 100644 --- a/recipes/etl/all/test_v1_package/CMakeLists.txt +++ b/recipes/etl/all/test_v1_package/CMakeLists.txt @@ -8,4 +8,4 @@ find_package(etl REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -target_link_libraries(${PROJECT_NAME} etl) +target_link_libraries(${PROJECT_NAME} etl::etl) diff --git a/recipes/etl/config.yml b/recipes/etl/config.yml index 587b12dc52899e..6e14699582a88a 100644 --- a/recipes/etl/config.yml +++ b/recipes/etl/config.yml @@ -1,4 +1,18 @@ versions: + "20.38.7": + folder: all + "20.38.6": + folder: all + "20.38.4": + folder: all + "20.38.3": + folder: all + "20.38.0": + folder: all + "20.37.3": + folder: all + "20.37.2": + folder: all "20.37.1": folder: all "20.37.0": @@ -15,7 +29,3 @@ versions: folder: all "20.34.0": folder: all - "20.33.0": - folder: all - "20.32.1": - folder: all diff --git a/recipes/evmc/all/conandata.yml b/recipes/evmc/all/conandata.yml new file mode 100644 index 00000000000000..89f67a9cea5497 --- /dev/null +++ b/recipes/evmc/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "11.0.0": + url: "https://github.com/ethereum/evmc/archive/v11.0.0.tar.gz" + sha256: "a628ba9062b80540c553e92a44288c696532461ea9c08ef00b2c2a677095727e" + "10.1.1": + url: "https://github.com/ethereum/evmc/archive/v10.1.1.tar.gz" + sha256: "314a18635b2727a5129a7da3e4e15bd2fd76ee0c5ae19f21391b7a94e79cf459" diff --git a/recipes/evmc/all/conanfile.py b/recipes/evmc/all/conanfile.py new file mode 100644 index 00000000000000..13c6e5da4cc780 --- /dev/null +++ b/recipes/evmc/all/conanfile.py @@ -0,0 +1,81 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.54.0" + + +class EVMCConan(ConanFile): + name = "evmc" + description = "EVMC – Ethereum Client-VM Connector API" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ethereum/evmc" + topics = ("ethereum", "wasm", "evm") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + tool_requires = "cmake/[>=3.16.2 <4]" + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "9", + "apple-clang": "10", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EVMC_INSTALL"] = True + tc.variables["EVMC_TESTING"] = False + tc.variables["EVMC_JAVA"] = False + tc.variables["EVMC_TESTING"] = False + tc.variables["EVMC_EXAMPLES"] = False + tc.variables["EVMC_TOOLS"] = False + tc.variables["HUNTER_ENABLED"] = False + tc.generate() + + def validate(self): + if self.settings.get_safe("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 build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["evmc-instructions", "evmc-loader", "tooling"] diff --git a/recipes/evmc/all/test_package/CMakeLists.txt b/recipes/evmc/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d3cab735f84a22 --- /dev/null +++ b/recipes/evmc/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(evmc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE evmc::evmc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/evmc/all/test_package/conanfile.py b/recipes/evmc/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/evmc/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/evmc/all/test_package/test_package.cpp b/recipes/evmc/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..2810a6cfce9456 --- /dev/null +++ b/recipes/evmc/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main() { + const auto table = evmc_get_instruction_names_table(EVMC_BYZANTIUM); + std::cout << "HEX 0x80: " << evmc::hex(0x80) << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/evmc/config.yml b/recipes/evmc/config.yml new file mode 100644 index 00000000000000..78558509f0505d --- /dev/null +++ b/recipes/evmc/config.yml @@ -0,0 +1,5 @@ +versions: + "11.0.0": + folder: all + "10.1.1": + folder: all diff --git a/recipes/exiv2/all/conandata.yml b/recipes/exiv2/all/conandata.yml index 63e5ef9836649b..981b0a2937754c 100644 --- a/recipes/exiv2/all/conandata.yml +++ b/recipes/exiv2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.28.0": + url: "https://github.com/Exiv2/exiv2/releases/download/v0.28.0/exiv2-0.28.0-Source.tar.gz" + sha256: "89af3b5ef7277753ef7a7b5374ae017c6b9e304db3b688f1948e73e103491f3d" "0.27.5": url: "https://github.com/Exiv2/exiv2/releases/download/v0.27.5/exiv2-0.27.5-Source.tar.gz" sha256: "35a58618ab236a901ca4928b0ad8b31007ebdc0386d904409d825024e45ea6e2" @@ -6,6 +9,11 @@ sources: url: "https://github.com/Exiv2/exiv2/releases/download/v0.27.4/exiv2-0.27.4-Source.tar.gz" sha256: "84366dba7c162af9a7603bcd6c16f40fe0e9af294ba2fd2f66ffffb9fbec904e" patches: + "0.28.0": + - patch_file: "patches/0001-link-0.28.0.patch" + - patch_file: "patches/0004-find-expat-0.28.0.patch" + patch_description: "enforce usage of FindEXPAT.cmake" + patch_type: "conan" "0.27.5": - patch_file: "patches/0001-link-0.27.5.patch" - patch_file: "patches/0003-fix-ios.patch" diff --git a/recipes/exiv2/all/conanfile.py b/recipes/exiv2/all/conanfile.py index 34ee99761cacc6..0df5814a8917ed 100644 --- a/recipes/exiv2/all/conanfile.py +++ b/recipes/exiv2/all/conanfile.py @@ -1,9 +1,12 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps from conan.tools.files import get, copy, rmdir, save, export_conandata_patches, apply_conandata_patches -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, check_min_vs +from conan.tools.scm import Version import os +import sys import textwrap required_conan_version = ">=1.53.0" @@ -26,6 +29,9 @@ class Exiv2Conan(ConanFile): "with_png": [True, False], "with_xmp": [False, "bundled", "external"], "with_curl": [True, False], + "with_brotli": [True, False], + "with_inih": [True, False], + "win_unicode": [True, False], } default_options = { "shared": False, @@ -33,16 +39,25 @@ class Exiv2Conan(ConanFile): "with_png": True, "with_xmp": "bundled", "with_curl": False, + "with_brotli": True, + "with_inih": True, + "win_unicode": False, } - provides = [] - 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) >= "0.28.0": + del self.options.win_unicode + else: + del self.options.with_brotli + del self.options.with_inih + + if self.settings.os == "Windows": + self.options.win_unicode = True def configure(self): if self.options.shared: @@ -50,7 +65,7 @@ def configure(self): if self.options.with_xmp == "bundled": # recipe has bundled xmp-toolkit-sdk of old version # avoid conflict with a future xmp recipe - self.provides.append("xmp-toolkit-sdk") + self.provides = ["xmp-toolkit-sdk"] def layout(self): cmake_layout(self, src_folder="src") @@ -58,14 +73,43 @@ def layout(self): def requirements(self): self.requires("libiconv/1.17") if self.options.with_png: - self.requires("libpng/1.6.39") - self.requires("zlib/1.2.13") + self.requires("libpng/1.6.40") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_xmp == "bundled": self.requires("expat/2.5.0") if self.options.with_curl: - self.requires("libcurl/7.87.0") + self.requires("libcurl/[>=7.78.0 <9]") + if self.options.get_safe("with_brotli"): + self.requires("brotli/1.1.0") + if self.options.get_safe("with_inih"): + self.requires("inih/57") def validate(self): + if Version(self.version) >= "0.28.0": + min_cppstd = 17 + + if self.settings.compiler.cppstd: + check_min_cppstd(self, min_cppstd) + check_min_vs(self, 191) + + compilers_minimum_version = { + "gcc": "8", + "clang": "5", + "apple-clang": "10", + } + if not is_msvc(self): + minimum_version = compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{min_cppstd}, which your compiler does not fully support." + ) + elif conan_version.major == 2: + # FIXME: linter complains, but function is there + # https://docs.conan.io/2.0/reference/tools/build.html?highlight=check_min_cppstd#conan-tools-build-check-max-cppstd + check_max_cppstd = getattr(sys.modules['conan.tools.build'], 'check_max_cppstd') + # https://github.com/Exiv2/exiv2/tree/v0.27.7#217-building-with-c11-and-other-compilers + check_max_cppstd(self, 14) + if self.options.with_xmp == "external": raise ConanInvalidConfiguration("adobe-xmp-toolkit is not available on cci (yet)") @@ -84,6 +128,12 @@ def generate(self): tc.variables["EXIV2_ENABLE_WEBREADY"] = self.options.with_curl tc.variables["EXIV2_ENABLE_CURL"] = self.options.with_curl tc.variables["EXIV2_ENABLE_SSH"] = False + if Version(self.version) >= "0.28.0": + tc.variables["EXIV2_ENABLE_BMFF"] = self.options.with_brotli + tc.variables["EXIV2_ENABLE_BROTLI"] = self.options.with_brotli + tc.variables["EXIV2_ENABLE_INIH"] = self.options.with_inih + else: + tc.variables["EXIV2_ENABLE_WIN_UNICODE"] = self.options.win_unicode tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" if is_msvc(self): @@ -145,6 +195,10 @@ def package_info(self): self.cpp_info.components["exiv2lib"].requires.extend(["libpng::libpng", "zlib::zlib"]) if self.options.with_curl: self.cpp_info.components["exiv2lib"].requires.append("libcurl::libcurl") + if self.options.get_safe("with_brotli"): + self.cpp_info.components["exiv2lib"].requires.extend(["brotli::brotlidec", "brotli::brotlienc"]) + if self.options.get_safe("with_inih"): + self.cpp_info.components["exiv2lib"].requires.append("inih::inireader") if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.components["exiv2lib"].system_libs.extend(["pthread"]) @@ -154,14 +208,17 @@ def package_info(self): # component exiv2-xmp if self.options.with_xmp == "bundled": - self.cpp_info.components["exiv2-xmp"].set_property("cmake_target_name", "exiv2-xmp") - self.cpp_info.components["exiv2-xmp"].libs = ["exiv2-xmp"] - self.cpp_info.components["exiv2-xmp"].requires = [ "expat::expat" ] - self.cpp_info.components["exiv2lib"].requires.append("exiv2-xmp") + if Version(self.version) < "0.28.0": + self.cpp_info.components["exiv2-xmp"].set_property("cmake_target_name", "exiv2-xmp") + self.cpp_info.components["exiv2-xmp"].libs = ["exiv2-xmp"] + self.cpp_info.components["exiv2-xmp"].requires = [ "expat::expat" ] + self.cpp_info.components["exiv2lib"].requires.append("exiv2-xmp") + else: + self.cpp_info.components["exiv2lib"].requires.append("expat::expat") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.components["exiv2lib"].build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.components["exiv2lib"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - if self.options.with_xmp == "bundled": + if self.options.with_xmp == "bundled" and Version(self.version) < "0.28.0": self.cpp_info.components["exiv2-xmp"].build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.components["exiv2-xmp"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/exiv2/all/patches/0001-link-0.28.0.patch b/recipes/exiv2/all/patches/0001-link-0.28.0.patch new file mode 100644 index 00000000000000..0c0e5fa28d40cc --- /dev/null +++ b/recipes/exiv2/all/patches/0001-link-0.28.0.patch @@ -0,0 +1,22 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 41a672e8..93370b5e 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -170,10 +170,10 @@ if (MSVC) + set_target_properties(exiv2lib PROPERTIES LINK_FLAGS "/ignore:4099") + endif() + +-set_target_properties( exiv2lib_int PROPERTIES +- POSITION_INDEPENDENT_CODE ON +- COMPILE_DEFINITIONS exiv2lib_EXPORTS +-) ++ ++ ++ ++ + + # NOTE: Cannot use target_link_libraries on OBJECT libraries with old versions of CMake + target_include_directories(exiv2lib_int PRIVATE ${ZLIB_INCLUDE_DIR}) +-- +2.33.0.windows.1 + diff --git a/recipes/exiv2/all/patches/0004-find-expat-0.28.0.patch b/recipes/exiv2/all/patches/0004-find-expat-0.28.0.patch new file mode 100644 index 00000000000000..07fb4804513c7f --- /dev/null +++ b/recipes/exiv2/all/patches/0004-find-expat-0.28.0.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake +index 1075c303..d8b580d4 100644 +--- a/cmake/findDependencies.cmake ++++ b/cmake/findDependencies.cmake +@@ -60,7 +60,7 @@ if (EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP) + message(FATAL_ERROR "EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP are mutually exclusive. You can only choose one of them") + else() + if (EXIV2_ENABLE_XMP) +- find_package(EXPAT REQUIRED) ++ find_package(EXPAT REQUIRED MODULE) + elseif (EXIV2_ENABLE_EXTERNAL_XMP) + find_package(XmpSdk REQUIRED) + endif () +-- +2.33.0.windows.1 + diff --git a/recipes/exiv2/all/test_package/CMakeLists.txt b/recipes/exiv2/all/test_package/CMakeLists.txt index 3bd4318c428bac..69bbd22508c9b5 100644 --- a/recipes/exiv2/all/test_package/CMakeLists.txt +++ b/recipes/exiv2/all/test_package/CMakeLists.txt @@ -5,3 +5,7 @@ find_package(exiv2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} exiv2lib) + +if(${exiv2_VERSION} VERSION_GREATER_EQUAL "0.28.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/exiv2/config.yml b/recipes/exiv2/config.yml index 470d3a327a30b2..01a5aa663306e8 100644 --- a/recipes/exiv2/config.yml +++ b/recipes/exiv2/config.yml @@ -1,4 +1,6 @@ versions: + "0.28.0": + folder: all "0.27.5": folder: all "0.27.4": diff --git a/recipes/expected-lite/all/conanfile.py b/recipes/expected-lite/all/conanfile.py index d5786a1bd1873f..591dbe00d1ead5 100644 --- a/recipes/expected-lite/all/conanfile.py +++ b/recipes/expected-lite/all/conanfile.py @@ -52,3 +52,4 @@ def package_info(self): self.cpp_info.components["expectedlite"].names["cmake_find_package"] = "expected-lite" self.cpp_info.components["expectedlite"].names["cmake_find_package_multi"] = "expected-lite" self.cpp_info.components["expectedlite"].set_property("cmake_target_name", "nonstd::expected-lite") + self.cpp_info.components["expectedlite"].libdirs = [] 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 7c22e7d8569923..4d18399acd0faf 100644 --- a/recipes/ezc3d/all/conandata.yml +++ b/recipes/ezc3d/all/conandata.yml @@ -1,4 +1,10 @@ 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" "1.5.0": url: "https://github.com/pyomeca/ezc3d/archive/refs/tags/Release_1.5.0.tar.gz" sha256: "8387857d989f5bbb62869ec930b417e6d0a303eef9b39e8b0e6b35437d5809ce" diff --git a/recipes/ezc3d/config.yml b/recipes/ezc3d/config.yml index 3d5d9b1cd1d496..9f04ee1babe866 100644 --- a/recipes/ezc3d/config.yml +++ b/recipes/ezc3d/config.yml @@ -1,4 +1,8 @@ versions: + "1.5.5": + folder: all + "1.5.4": + folder: all "1.5.0": folder: all "1.4.8": 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 821c0ce34e3878..93fa295330a4d9 100644 --- a/recipes/fakeit/all/conanfile.py +++ b/recipes/fakeit/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 get, copy from conan.tools.layout import basic_layout import os @@ -11,37 +11,36 @@ class FakeItConan(ConanFile): name = "fakeit" description = "C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking." - topics = ("mock", "fake", "spy") license = "MIT" - homepage = "https://github.com/eranpeer/FakeIt" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eranpeer/FakeIt" + topics = ("mock", "fake", "spy", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { - "integration": ["boost", "catch", "cute", "gtest", "mettle", "nunit", "mstest", "qtest", "standalone", "tpunit"] + "integration": ["boost", "catch", "cute", "gtest", "mettle", "nunit", "mstest", "qtest", "standalone", "tpunit"], + } + default_options = { + "integration": "standalone", } - default_options = {"integration": "standalone"} no_copy_source = True @property def _min_cppstd(self): return 11 - def export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") def requirements(self): if self.options.integration == "boost": - self.requires("boost/1.79.0") + self.requires("boost/1.83.0") elif self.options.integration == "catch": - self.requires("catch2/2.13.9") + self.requires("catch2/3.4.0") elif self.options.integration == "gtest": - self.requires("gtest/1.11.0") + 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: @@ -60,9 +59,6 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - apply_conandata_patches(self) - def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy( @@ -71,3 +67,7 @@ def package(self): dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "single_header", str(self.options.integration)), ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fakeit/all/test_package/CMakeLists.txt b/recipes/fakeit/all/test_package/CMakeLists.txt index bc2658ff1b34ed..6beebe71b3c838 100644 --- a/recipes/fakeit/all/test_package/CMakeLists.txt +++ b/recipes/fakeit/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(fakeit REQUIRED CONFIG) diff --git a/recipes/fast-cdr/all/conandata.yml b/recipes/fast-cdr/all/conandata.yml index 6a9ba778684496..021355947389fe 100644 --- a/recipes/fast-cdr/all/conandata.yml +++ b/recipes/fast-cdr/all/conandata.yml @@ -1,4 +1,13 @@ 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" "1.0.27": url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.27.tar.gz" sha256: "a9bc8fd31a2c2b95e6d2fb46e6ce1ad733e86dc4442f733479e33ed9cdc54bf6" @@ -17,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 c39c56b44ddc4a..be8d79ee8f187b 100644 --- a/recipes/fast-cdr/all/conanfile.py +++ b/recipes/fast-cdr/all/conanfile.py @@ -2,8 +2,9 @@ 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 import textwrap @@ -29,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 @@ -40,6 +44,10 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def build_requirements(self): + if Version(self.version) >= "1.1.0": + self.tool_requires("cmake/[>=3.16.3 <4]") + def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) @@ -59,6 +67,7 @@ def generate(self): tc.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -100,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 3527dfb5e8511d..9cc6db5bd03151 100644 --- a/recipes/fast-cdr/config.yml +++ b/recipes/fast-cdr/config.yml @@ -1,4 +1,10 @@ versions: + "2.1.0": + folder: all + "2.0.0": + folder: all + "1.1.0": + folder: all "1.0.27": folder: all "1.0.26": diff --git a/recipes/fast-cpp-csv-parser/all/conanfile.py b/recipes/fast-cpp-csv-parser/all/conanfile.py index f20fc50349a4e8..8073da0d1b137e 100644 --- a/recipes/fast-cpp-csv-parser/all/conanfile.py +++ b/recipes/fast-cpp-csv-parser/all/conanfile.py @@ -14,7 +14,7 @@ class FastcppcsvparserConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ben-strasser/fast-cpp-csv-parser" topics = ("csv", "parser", "header-only") - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_thread": [True, False], @@ -25,6 +25,9 @@ class FastcppcsvparserConan(ConanFile): no_copy_source = True + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -32,12 +35,8 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -48,9 +47,7 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] self.cpp_info.includedirs.append(os.path.join("include", "fast-cpp-csv-parser")) if not self.options.with_thread: self.cpp_info.defines.append("CSV_IO_NO_THREAD") diff --git a/recipes/fast-cpp-csv-parser/all/test_package/conanfile.py b/recipes/fast-cpp-csv-parser/all/test_package/conanfile.py index ca068b831644cc..ef08a7439d5d1a 100644 --- a/recipes/fast-cpp-csv-parser/all/test_package/conanfile.py +++ b/recipes/fast-cpp-csv-parser/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/fast-cpp-csv-parser/all/test_v1_package/CMakeLists.txt b/recipes/fast-cpp-csv-parser/all/test_v1_package/CMakeLists.txt index c53b3fb2453854..be00a8c7f57c71 100644 --- a/recipes/fast-cpp-csv-parser/all/test_v1_package/CMakeLists.txt +++ b/recipes/fast-cpp-csv-parser/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(fast-cpp-csv-parser REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE fast-cpp-csv-parser::fast-cpp-csv-parser) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/fast-dds/all/conandata.yml b/recipes/fast-dds/all/conandata.yml index 89a0fa550b4d41..ab4d2d857dbe47 100644 --- a/recipes/fast-dds/all/conandata.yml +++ b/recipes/fast-dds/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.11.2": + url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.11.2.tar.gz" + sha256: "711f5d7afc6a31a908ab204f8b67045d5e7cab7b4052614b595b37c774f357fd" + "2.11.1": + url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.11.1.tar.gz" + sha256: "3fe8b9f67a13a5d2aa40c0bd10581bd90f0a192b39c71f92ee233ffe584d3374" "2.10.1": url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.10.1.tar.gz" sha256: "2cc2682db5dc7e87684b7f23166e2f32faf8d5c4b4a8c94c6c21211a8a38f553" @@ -12,6 +18,14 @@ sources: url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.3.2.tar.gz" sha256: "4d8183cf4d37c3de9e6fd28d2850dd08023a9079001c4880b23c95f0d8c0b5ce" patches: + "2.11.2": + - patch_file: "patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch" + patch_type: "conan" + patch_description: "Fixup find asio and tinyxml2" + "2.11.1": + - patch_file: "patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch" + patch_type: "conan" + patch_description: "Fixup find asio and tinyxml2" "2.10.1": - patch_file: "patches/2.10.1-0001-fix-find-asio-and-tinyxml2.patch" patch_type: "conan" diff --git a/recipes/fast-dds/all/conanfile.py b/recipes/fast-dds/all/conanfile.py index d47f222eebac4d..e8ad7b42a13f0e 100644 --- a/recipes/fast-dds/all/conanfile.py +++ b/recipes/fast-dds/all/conanfile.py @@ -1,3 +1,6 @@ +import os +import textwrap + from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd @@ -15,8 +18,7 @@ ) from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc, msvc_runtime_flag from conan.tools.scm import Version -import os -import textwrap + required_conan_version = ">=1.53.0" @@ -69,7 +71,7 @@ def layout(self): def requirements(self): self.requires("tinyxml2/9.0.0") - self.requires("asio/1.28.0") + self.requires("asio/1.28.0") # This is now a package_type = header self.requires("fast-cdr/1.0.27", transitive_headers=True, transitive_libs=True) self.requires("foonathan-memory/0.7.3") if self.options.with_ssl: diff --git a/recipes/fast-dds/all/patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch b/recipes/fast-dds/all/patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch new file mode 100644 index 00000000000000..bada751126e810 --- /dev/null +++ b/recipes/fast-dds/all/patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch @@ -0,0 +1,31 @@ +From b8c533b0fb2b92e9bd2aada5e195d7a0b3c0c6a9 Mon Sep 17 00:00:00 2001 +From: Joakim Haugen +Date: Wed, 10 May 2023 13:17:11 +0200 +Subject: [PATCH] fix find asio and tinyxml2 + +--- + CMakeLists.txt | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b01b2c470..7867feff3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -232,9 +232,11 @@ if(NOT BUILD_SHARED_LIBS) + set(FASTDDS_STATIC ON) + endif() + +-eprosima_find_package(fastcdr REQUIRED) +-eprosima_find_thirdparty(Asio asio VERSION 1.10.8) +-eprosima_find_thirdparty(TinyXML2 tinyxml2) ++eprosima_find_thirdparty(fastcdr REQUIRED) ++eprosima_find_thirdparty(asio REQUIRED) ++eprosima_find_thirdparty(tinyxml2 REQUIRED) ++set(TINYXML2_LIBRARY tinyxml2::tinyxml2) ++set(Asio_INCLUDE_DIR ${asio_INCLUDE_DIR}) + + find_package(foonathan_memory REQUIRED) + message(STATUS "Found foonathan_memory: ${foonathan_memory_DIR}") +-- +2.30.2 + diff --git a/recipes/fast-dds/config.yml b/recipes/fast-dds/config.yml index 9d0fe488028aa8..1a933c21ca9cad 100644 --- a/recipes/fast-dds/config.yml +++ b/recipes/fast-dds/config.yml @@ -1,4 +1,8 @@ versions: + "2.11.2": + folder: all + "2.11.1": + folder: all "2.10.1": folder: all "2.3.4": diff --git a/recipes/fast_double_parser/all/conanfile.py b/recipes/fast_double_parser/all/conanfile.py index a704c8e783d7f8..872d82f5787071 100644 --- a/recipes/fast_double_parser/all/conanfile.py +++ b/recipes/fast_double_parser/all/conanfile.py @@ -14,12 +14,12 @@ class FastDoubleParserConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lemire/fast_double_parser" license = ("Apache-2.0", "BSL-1.0") - + package_type = "header-library" settings = "os", "compiler", "build_type", "arch" no_copy_source = True def layout(self): - basic_layout(self) + basic_layout(self, src_folder="src") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -29,10 +29,13 @@ 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 package(self): include_folder = os.path.join(self.source_folder, "include") copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=include_folder) copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] 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/fastnoise2/all/conandata.yml b/recipes/fastnoise2/all/conandata.yml new file mode 100644 index 00000000000000..63afd14b046743 --- /dev/null +++ b/recipes/fastnoise2/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.10.0-alpha": + url: "https://github.com/Auburn/FastNoise2/archive/v0.10.0-alpha.tar.gz" + sha256: "8e1331425d6372e65e73775e13fedd367ae5999ec5616036b99df33434e3b527" diff --git a/recipes/fastnoise2/all/conanfile.py b/recipes/fastnoise2/all/conanfile.py new file mode 100644 index 00000000000000..15602b9b084997 --- /dev/null +++ b/recipes/fastnoise2/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir, rm +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class Fastnoise2Conan(ConanFile): + name = "fastnoise2" + description = "Modular node graph based noise generation library using SIMD, C++17 and templates" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Auburn/FastNoise2" + topics = ("procedural-generation", "terrain-generation", "noise") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + 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.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["FASTNOISE2_NOISETOOL"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + + def package_info(self): + lib_suffix = "D" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"FastNoise{lib_suffix}"] + + self.cpp_info.set_property("cmake_file_name", "FastNoise2") + self.cpp_info.set_property("cmake_target_name", "FastNoise2::FastNoise") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/fastnoise2/all/test_package/CMakeLists.txt b/recipes/fastnoise2/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..4c5f6ffc5d5fee --- /dev/null +++ b/recipes/fastnoise2/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(FastNoise2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE FastNoise2::FastNoise) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + diff --git a/recipes/fastnoise2/all/test_package/conanfile.py b/recipes/fastnoise2/all/test_package/conanfile.py new file mode 100644 index 00000000000000..f5cf204295e195 --- /dev/null +++ b/recipes/fastnoise2/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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/fastnoise2/all/test_package/test_package.cpp b/recipes/fastnoise2/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..0dd8b950d971d8 --- /dev/null +++ b/recipes/fastnoise2/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include "FastNoise/FastNoise.h" + +int main() { + auto fnSimplex = FastNoise::New(); + auto fnFractal = FastNoise::New(); + + fnFractal->SetSource( fnSimplex ); + fnFractal->SetOctaveCount( 5 ); + + return 0; +} diff --git a/recipes/fastnoise2/config.yml b/recipes/fastnoise2/config.yml new file mode 100644 index 00000000000000..a75277535cb78a --- /dev/null +++ b/recipes/fastnoise2/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.0-alpha": + folder: all diff --git a/recipes/fastprng/all/conanfile.py b/recipes/fastprng/all/conanfile.py index c83ba01f89440c..5c6a15b03e066b 100644 --- a/recipes/fastprng/all/conanfile.py +++ b/recipes/fastprng/all/conanfile.py @@ -9,16 +9,20 @@ class FastPRNGConan(ConanFile): name = "fastprng" - description = "FAST 32/64 bit PRNG (pseudo-random generator), highly optimized, based on xoshiro* / xoroshiro*, xorshift and other Marsaglia algorithms." + description = ( + "FAST 32/64 bit PRNG (pseudo-random generator), highly optimized, based " + "on xoshiro* / xoroshiro*, xorshift and other Marsaglia algorithms." + ) topics = ("random", "prng", "xorshift", "xoshiro", ) license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/BrutPitt/fastPRNG" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True def layout(self): - basic_layout(self) + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() @@ -28,13 +32,12 @@ def validate(self): check_min_cppstd(self, "11") 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 package(self): copy(self, "*.h", self.source_folder, os.path.join(self.package_folder, "include")) copy(self, "license.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fastprng/all/test_package/conanfile.py b/recipes/fastprng/all/test_package/conanfile.py index 48499fa0989d9c..e845ae751a3017 100644 --- a/recipes/fastprng/all/test_package/conanfile.py +++ b/recipes/fastprng/all/test_package/conanfile.py @@ -4,7 +4,6 @@ import os -# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" diff --git a/recipes/ffmpeg/all/conandata.yml b/recipes/ffmpeg/all/conandata.yml index d7a1adb10f829d..83ed14628cf42b 100644 --- a/recipes/ffmpeg/all/conandata.yml +++ b/recipes/ffmpeg/all/conandata.yml @@ -1,13 +1,28 @@ 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" + "5.1.3": + url: "https://ffmpeg.org/releases/ffmpeg-5.1.3.tar.bz2" + sha256: "5d5bef6a11f0c500588f9870ec965a30acc0d54d8b1e535da6554a32902d236d" "5.1": url: "https://ffmpeg.org/releases/ffmpeg-5.1.tar.bz2" sha256: "32b56fb01ce90d452958ae25e91c9564abf49ed5453c127bec23c63e530aa8fa" + "5.0.3": + url: "https://ffmpeg.org/releases/ffmpeg-5.0.3.tar.bz2" + sha256: "664e8fa8ac4cc5dce03277f022798461998d9bb8d96b9e1859b24e74511229fd" "5.0": url: "https://ffmpeg.org/releases/ffmpeg-5.0.tar.bz2" sha256: "c0130b8db2c763430fd1c6905288d61bc44ee0548ad5fcd2dfd650b88432bed9" + "4.4.4": + url: "https://ffmpeg.org/releases/ffmpeg-4.4.4.tar.bz2" + sha256: "47b1fbf70a2c090d9c0fae5910da11c6406ca92408bb69d8c935cd46c622c7ce" "4.4.3": url: "https://ffmpeg.org/releases/ffmpeg-4.4.3.tar.bz2" sha256: "33b8c2dbcd530fe1db5710415345609b4ca227bd0da1e3a9332dbb0f11fd273a" diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index 0ebfa544b38e23..b62169338c0de0 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, @@ -257,11 +257,11 @@ def layout(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_lzma: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.5") if self.options.with_libiconv: self.requires("libiconv/1.17") if self.options.with_freetype: @@ -273,11 +273,11 @@ def requirements(self): if self.options.with_vorbis: self.requires("vorbis/1.3.7") if self.options.with_opus: - self.requires("opus/1.3.1") + 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.26.5") + self.requires("sdl/2.28.5") if self.options.with_libx264: self.requires("libx264/cci.20220602") if self.options.with_libx265: @@ -289,11 +289,11 @@ def requirements(self): if self.options.with_libfdk_aac: self.requires("libfdk_aac/2.0.2") if self.options.with_libwebp: - self.requires("libwebp/1.3.1") + self.requires("libwebp/1.3.2") if self.options.with_ssl == "openssl": self.requires("openssl/[>=1.1 <4]") if self.options.get_safe("with_libalsa"): - self.requires("libalsa/1.2.7.2") + self.requires("libalsa/1.2.10") if self.options.get_safe("with_xcb") or self.options.get_safe("with_vaapi"): self.requires("xorg/system") if self.options.get_safe("with_pulse"): @@ -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): @@ -324,7 +324,7 @@ def build_requirements(self): if self.settings.arch in ("x86", "x86_64"): self.tool_requires("yasm/1.3.0") 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): @@ -606,6 +606,9 @@ def opt_append_disable_if_set(args, what, v): if not check_min_vs(self, "190", raise_invalid=False): # Visual Studio 2013 (and earlier) doesn't support "inline" keyword for C (only for C++) tc.extra_defines.append("inline=__inline") + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) >= "15": + # Workaround for link error "ld: building exports trie: duplicate symbol '_av_ac3_parse_header'" + tc.extra_ldflags.append("-Wl,-ld_classic") if cross_building(self): args.append(f"--target-os={self._target_os}") if is_apple_os(self) and self.options.with_audiotoolbox: diff --git a/recipes/ffmpeg/config.yml b/recipes/ffmpeg/config.yml index 5596a0ba4cf844..0ea4ae6cca8888 100644 --- a/recipes/ffmpeg/config.yml +++ b/recipes/ffmpeg/config.yml @@ -1,10 +1,20 @@ versions: + "6.1": + folder: "all" + "6.0.1": + folder: "all" "6.0": folder: "all" + "5.1.3": + folder: "all" "5.1": folder: "all" + "5.0.3": + folder: "all" "5.0": folder: "all" + "4.4.4": + folder: "all" "4.4.3": folder: "all" "4.4": diff --git a/recipes/fftw/all/conanfile.py b/recipes/fftw/all/conanfile.py index 633f3bfb2dc714..ef1e6d55efb6ea 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), + "ENABLE_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/fltk/all/CMakeLists.txt b/recipes/fltk/all/CMakeLists.txt deleted file mode 100644 index 60dd71d7363c30..00000000000000 --- a/recipes/fltk/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/fltk/all/conandata.yml b/recipes/fltk/all/conandata.yml index 1b3f085545004d..0f349ed1289218 100644 --- a/recipes/fltk/all/conandata.yml +++ b/recipes/fltk/all/conandata.yml @@ -5,9 +5,6 @@ sources: patches: "1.3.8": - - base_path: "source_subfolder" - patch_file: "patches/1.3.8-0001-remove-fluid.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.3.8-0002-fix-resources.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.3.8-0003-build-static-only-on-static.patch" + - patch_file: "patches/1.3.8-0001-remove-fluid.patch" + - patch_file: "patches/1.3.8-0002-fix-resources.patch" + - patch_file: "patches/1.3.8-0003-build-static-only-on-static.patch" diff --git a/recipes/fltk/all/conanfile.py b/recipes/fltk/all/conanfile.py index 0533063aab5851..4b4a216b2a0e29 100644 --- a/recipes/fltk/all/conanfile.py +++ b/recipes/fltk/all/conanfile.py @@ -1,19 +1,22 @@ import os -import conan.tools.files as tools from conan import ConanFile -from conans import CMake +from conan.tools.apple import is_apple_os +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 -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class FltkConan(ConanFile): name = "fltk" description = "Fast Light Toolkit is a cross-platform C++ GUI toolkit" - topics = ("fltk", "gui") - homepage = "https://www.fltk.org" + license = "LGPL-2.1-or-later WITH FLTK-exception" url = "https://github.com/conan-io/conan-center-index" - license = "LGPL-2.0-custom" + homepage = "https://www.fltk.org" + topics = ("gui",) + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,31 +24,27 @@ class FltkConan(ConanFile): "with_gl": [True, False], "with_threads": [True, False], "with_gdiplus": [True, False], - "abi_version": "ANY" + "abi_version": ["ANY"], + "with_xft": [True, False], } default_options = { "shared": False, "fPIC": True, "with_gl": True, "with_threads": True, - "with_gdiplus": True + "with_gdiplus": True, + "with_xft": False, } - generators = "cmake", "cmake_find_package_multi" - - @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) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC else: - del self.options.with_gdiplus + self.options.rm_safe("with_gdiplus") + if self.options.abi_version == None: _version_token = self.version.split(".") _version_major = int(_version_token[0]) @@ -56,84 +55,89 @@ def config_options(self): _version_minor = int(_version_token[1]) _version_patch = 0 self.options.abi_version = str( - int(_version_major) * 10000 + - int(_version_minor) * 100 + - int(_version_patch) + int(_version_major) * 10000 + int(_version_minor) * 100 + int(_version_patch) ) 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("zlib/1.2.12") - self.requires("libjpeg/9d") - self.requires("libpng/1.6.37") - if self.settings.os == "Linux": - self.requires("opengl/system") - self.requires("glu/system") - self.requires("fontconfig/2.13.93") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("libjpeg/9e") + self.requires("libpng/1.6.40") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.with_gl: + self.requires("opengl/system") + self.requires("glu/system") + self.requires("fontconfig/2.14.2") self.requires("xorg/system") + if self.options.with_xft: + self.requires("libxft/2.3.6") def source(self): - tools.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions['OPTION_BUILD_SHARED_LIBS'] = self.options.shared - cmake.definitions['FLTK_BUILD_TEST'] = False - cmake.definitions['FLTK_BUILD_EXAMPLES'] = False - cmake.definitions['OPTION_USE_GL'] = self.options.with_gl - cmake.definitions['OPTION_USE_THREADS'] = self.options.with_threads - cmake.definitions['OPTION_BUILD_HTML_DOCUMENTATION'] = False - cmake.definitions['OPTION_BUILD_PDF_DOCUMENTATION'] = False + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OPTION_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["FLTK_BUILD_TEST"] = False + tc.variables["FLTK_BUILD_EXAMPLES"] = False + tc.variables["OPTION_USE_GL"] = self.options.with_gl + tc.variables["OPTION_USE_THREADS"] = self.options.with_threads + tc.variables["OPTION_BUILD_HTML_DOCUMENTATION"] = False + tc.variables["OPTION_BUILD_PDF_DOCUMENTATION"] = False + tc.variables["OPTION_USE_XFT"] = self.options.with_xft if self.options.abi_version: - cmake.definitions['OPTION_ABI_VERSION'] = self.options.abi_version - cmake.configure() - return cmake + tc.variables["OPTION_ABI_VERSION"] = self.options.abi_version + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(self, **patch) - - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() 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(self, os.path.join(self.package_folder, "share")) - tools.rmdir(self, os.path.join(self.package_folder, "FLTK.framework")) - tools.rmdir(self, os.path.join(self.package_folder, "CMake")) - tools.rm(self, "fltk-config*", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "FLTK.framework")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + rm(self, "fltk-config*", os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "fltk") self.cpp_info.set_property("cmake_target_name", "fltk::fltk") + self.cpp_info.libs = collect_libs(self) - self.cpp_info.names["cmake_find_package"] = "fltk" - self.cpp_info.names["cmake_find_package_multi"] = "fltk" - - if self.options.shared and self.settings.os == "Windows": - self.cpp_info.defines.append("FL_DLL") - self.cpp_info.libs = tools.collect_libs(self) if self.settings.os in ("Linux", "FreeBSD"): if self.options.with_threads: - self.cpp_info.system_libs.extend(['pthread', 'dl']) + self.cpp_info.system_libs.extend(["pthread", "dl"]) if self.options.with_gl: - self.cpp_info.system_libs.extend(['GL', 'GLU']) - if self.settings.os == "Macos": - self.cpp_info.frameworks = ['Cocoa', 'OpenGL', 'IOKit', 'Carbon', 'CoreFoundation', 'CoreVideo'] - if self.settings.os == "Windows": - self.cpp_info.system_libs = [ - "gdi32", - "imm32", - "msimg32", - "ole32", - "oleaut32", - "uuid", + self.cpp_info.system_libs.extend(["GL", "GLU"]) + elif is_apple_os(self): + self.cpp_info.frameworks = [ + "AppKit", "ApplicationServices", "Carbon", "Cocoa", "CoreFoundation", "CoreGraphics", + "CoreText", "CoreVideo", "Foundation", "IOKit", ] + if self.options.with_gl: + self.cpp_info.frameworks.append("OpenGL") + elif self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.defines.append("FL_DLL") + self.cpp_info.system_libs = ["gdi32", "imm32", "msimg32", "ole32", "oleaut32", "uuid", "comctl32"] if self.options.get_safe("with_gdiplus"): self.cpp_info.system_libs.append("gdiplus") + if self.options.with_gl: + self.cpp_info.system_libs.append("opengl32") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "fltk" + self.cpp_info.names["cmake_find_package_multi"] = "fltk" diff --git a/recipes/fltk/all/test_package/CMakeLists.txt b/recipes/fltk/all/test_package/CMakeLists.txt index a163bc26a443bb..cf30c297c55310 100644 --- a/recipes/fltk/all/test_package/CMakeLists.txt +++ b/recipes/fltk/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(fltk REQUIRED CONFIG) diff --git a/recipes/fltk/all/test_package/conanfile.py b/recipes/fltk/all/test_package/conanfile.py index a500b98343c743..ef5d7042163ecc 100644 --- a/recipes/fltk/all/test_package/conanfile.py +++ b/recipes/fltk/all/test_package/conanfile.py @@ -1,9 +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) @@ -11,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/fltk/all/test_v1_package/CMakeLists.txt b/recipes/fltk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/fltk/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/fltk/all/test_v1_package/conanfile.py b/recipes/fltk/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a500b98343c743 --- /dev/null +++ b/recipes/fltk/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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) diff --git a/recipes/fmi1/all/conandata.yml b/recipes/fmi1/all/conandata.yml new file mode 100644 index 00000000000000..3605e7f8bb5d7c --- /dev/null +++ b/recipes/fmi1/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.1": + co-simulation: + url: + - https://fmi-standard.org/assets/releases/FMI_for_CoSimulation_v1.0.1.zip + sha256: "81c87527febece29b5bb00bac89f9a58c5aed976aeb0afbfd357cf5aeebabd21" + model-exchange: + url: + - https://fmi-standard.org/assets/releases/FMI_for_ModelExchange_v1.0.1.zip + sha256: "966c948707531c5a764b70fa7bbe23030da962d8a939e01dc8bc9af9d8264cd1" diff --git a/recipes/fmi1/all/conanfile.py b/recipes/fmi1/all/conanfile.py new file mode 100644 index 00000000000000..e0cf988f8107d7 --- /dev/null +++ b/recipes/fmi1/all/conanfile.py @@ -0,0 +1,72 @@ +from os import path +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.files import copy, get, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "fmi1" + description = "Functional Mock-up Interface (FMI) for Co-Simulation" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://fmi-standard.org" + topics = ("fmi-standard", "co-simulation", "model-exchange", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True # True OK because patch only adds new file + + def _extract_copyright(self): + fmiFunctions_h = load(self, path.join(self.source_folder, "cosim", "fmiFunctions.h")) + copyright_start = "Copyright(c)" + copyright_end = "DAMAGE." + start_index = fmiFunctions_h.find(copyright_start) + stop_index = fmiFunctions_h.find(copyright_end) + if start_index == -1 or stop_index == -1: + raise ConanException("Could not extract license from fmiFunctions.h file.") + return fmiFunctions_h[start_index:stop_index+len(copyright_end)] + + 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]["co-simulation"], + destination="cosim", strip_root=True) + get(self, **self.conan_data["sources"][self.version]["model-exchange"], + destination="modex", strip_root=True) + + def build(self): + pass + + def package(self): + save(self, path.join(self.package_folder, "licenses", "LICENSE"), self._extract_copyright()) + for comp in ["modex", "cosim"]: + copy( + self, + pattern="*.h", + src=path.join(self.source_folder, comp), + dst=path.join(self.package_folder, "include", comp) + ) + copy( + self, + pattern="*.xsd", + src=path.join(self.source_folder, comp), + dst=path.join(self.package_folder, "res", comp) + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] + + self.cpp_info.components["cosim"].set_property("cmake_target_name", "fmi1::cosim") + self.cpp_info.components["cosim"].includedirs = ["include/cosim"] + self.cpp_info.components["cosim"].resdirs = ["res/cosim"] + self.cpp_info.components["modex"].set_property("cmake_target_name", "fmi1::modex") + self.cpp_info.components["modex"].includedirs = ["include/modex"] + self.cpp_info.components["modex"].resdirs = ["res/modex"] diff --git a/recipes/fmi1/all/test_package/CMakeLists.txt b/recipes/fmi1/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..7e700e5046782a --- /dev/null +++ b/recipes/fmi1/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C CXX) + +find_package(fmi1 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fmi1::cosim) diff --git a/recipes/fmi1/all/test_package/conanfile.py b/recipes/fmi1/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e730ad6dc0dfc1 --- /dev/null +++ b/recipes/fmi1/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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/fmi1/all/test_package/test_package.cpp b/recipes/fmi1/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..96872e2ca1ec71 --- /dev/null +++ b/recipes/fmi1/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include +#include "fmiFunctions.h" + + +int main(void) { + std::cout << fmiVersion << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/fmi1/config.yml b/recipes/fmi1/config.yml new file mode 100644 index 00000000000000..715e55357a17be --- /dev/null +++ b/recipes/fmi1/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/fmi2/all/conandata.yml b/recipes/fmi2/all/conandata.yml new file mode 100644 index 00000000000000..ca22c244cd704b --- /dev/null +++ b/recipes/fmi2/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "2.0.4": + url: + - https://github.com/modelica/fmi-standard/releases/download/v2.0.4/FMI-Standard-2.0.4.zip + sha256: "79abb211052d28354a0efff0c6b1998b60a973dd75fdcb338db99ae1b970c9b2" diff --git a/recipes/fmi2/all/conanfile.py b/recipes/fmi2/all/conanfile.py new file mode 100644 index 00000000000000..816be50f782afd --- /dev/null +++ b/recipes/fmi2/all/conanfile.py @@ -0,0 +1,50 @@ +from os import path +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "fmi2" + description = "Functional Mock-up Interface (FMI)" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://fmi-standard.org" + topics = ("fmi-standard", "co-simulation", "model-exchange", "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=False) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE.txt", dst=path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + src=path.join(self.source_folder, "headers"), + dst=path.join(self.package_folder, "include"), + ) + copy( + self, + pattern="*.xsd", + src=path.join(self.source_folder, "schema"), + dst=path.join(self.package_folder, "res"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] diff --git a/recipes/fmi2/all/test_package/CMakeLists.txt b/recipes/fmi2/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..7332dbc8b51974 --- /dev/null +++ b/recipes/fmi2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C CXX) + +find_package(fmi2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fmi2::fmi2) diff --git a/recipes/fmi2/all/test_package/conanfile.py b/recipes/fmi2/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e730ad6dc0dfc1 --- /dev/null +++ b/recipes/fmi2/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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/fmi2/all/test_package/test_package.cpp b/recipes/fmi2/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..ec96970349ed1d --- /dev/null +++ b/recipes/fmi2/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include +#include "fmi2Functions.h" + + +int main(void) { + std::cout << fmi2Version << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/fmi2/config.yml b/recipes/fmi2/config.yml new file mode 100644 index 00000000000000..1f2301f1f0282d --- /dev/null +++ b/recipes/fmi2/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.4": + folder: all diff --git a/recipes/fmi3/all/conandata.yml b/recipes/fmi3/all/conandata.yml new file mode 100644 index 00000000000000..b12c4c988ee8b5 --- /dev/null +++ b/recipes/fmi3/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "3.0.1": + url: + - https://github.com/modelica/fmi-standard/releases/download/v3.0.1/FMI-Standard-3.0.1.zip + sha256: "181a8a377ccfafa92167019bd3099227f8bf44192444bcb1a2d42aba65fbffe2" diff --git a/recipes/fmi3/all/conanfile.py b/recipes/fmi3/all/conanfile.py new file mode 100644 index 00000000000000..3d5c1d773f7ef2 --- /dev/null +++ b/recipes/fmi3/all/conanfile.py @@ -0,0 +1,50 @@ +from os import path +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "fmi3" + description = "Functional Mock-up Interface (FMI)" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://fmi-standard.org" + topics = ("fmi-standard", "co-simulation", "model-exchange", "scheduled execution", "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=False) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE.txt", dst=path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + src=path.join(self.source_folder, "headers"), + dst=path.join(self.package_folder, "include"), + ) + copy( + self, + pattern="*.xsd", + src=path.join(self.source_folder, "schema"), + dst=path.join(self.package_folder, "res"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] diff --git a/recipes/fmi3/all/test_package/CMakeLists.txt b/recipes/fmi3/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..24b88e3db471de --- /dev/null +++ b/recipes/fmi3/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C CXX) + +find_package(fmi3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fmi3::fmi3) diff --git a/recipes/fmi3/all/test_package/conanfile.py b/recipes/fmi3/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e730ad6dc0dfc1 --- /dev/null +++ b/recipes/fmi3/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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/fmi3/all/test_package/test_package.cpp b/recipes/fmi3/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..ea4bf3fd0194a4 --- /dev/null +++ b/recipes/fmi3/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include +#include "fmi3Functions.h" + + +int main(void) { + std::cout << fmi3Version << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/fmi3/config.yml b/recipes/fmi3/config.yml new file mode 100644 index 00000000000000..f1eca9cdf76de8 --- /dev/null +++ b/recipes/fmi3/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.1": + folder: all diff --git a/recipes/fmt/all/conandata.yml b/recipes/fmt/all/conandata.yml index 2125f36949279c..1ddc76ef1e6675 100644 --- a/recipes/fmt/all/conandata.yml +++ b/recipes/fmt/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "10.1.1": + url: "https://github.com/fmtlib/fmt/releases/download/10.1.1/fmt-10.1.1.zip" + sha256: "b84e58a310c9b50196cda48d5678d5fa0849bca19e5fdba6b684f0ee93ed9d1b" + "10.1.0": + url: "https://github.com/fmtlib/fmt/releases/download/10.1.0/fmt-10.1.0.zip" + sha256: "d725fa83a8b57a3cedf238828fa6b167f963041e8f9f7327649bddc68ae316f4" "10.0.0": url: "https://github.com/fmtlib/fmt/releases/download/10.0.0/fmt-10.0.0.zip" sha256: "4943cb165f3f587f26da834d3056ee8733c397e024145ca7d2a8a96bb71ac281" diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index 862834c3580478..ab898ea9914110 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -118,9 +118,9 @@ def package_info(self): if self.options.header_only: self.cpp_info.components["_fmt"].defines.append("FMT_HEADER_ONLY=1") + self.cpp_info.components["_fmt"].libdirs = [] + self.cpp_info.components["_fmt"].bindirs = [] - self.cpp_info.libdirs = [] - self.cpp_info.bindirs = [] else: postfix = "d" if self.settings.build_type == "Debug" else "" libname = "fmt" + postfix diff --git a/recipes/fmt/config.yml b/recipes/fmt/config.yml index 44e12e4e3ddc72..74db66d3ff4032 100644 --- a/recipes/fmt/config.yml +++ b/recipes/fmt/config.yml @@ -1,4 +1,8 @@ versions: + "10.1.1": + folder: all + "10.1.0": + folder: all "10.0.0": folder: all "9.1.0": diff --git a/recipes/fmtlog/all/conanfile.py b/recipes/fmtlog/all/conanfile.py index 17e20eaf9c51b4..759d3b12c68610 100644 --- a/recipes/fmtlog/all/conanfile.py +++ b/recipes/fmtlog/all/conanfile.py @@ -67,7 +67,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/10.0.0", transitive_headers=True, transitive_libs=True) + self.requires("fmt/10.1.0", transitive_headers=True, transitive_libs=True) def package_id(self): if self.info.options.header_only: diff --git a/recipes/fontconfig/all/conanfile.py b/recipes/fontconfig/all/conanfile.py index c44276116659f5..ddc997bea245ad 100644 --- a/recipes/fontconfig/all/conanfile.py +++ b/recipes/fontconfig/all/conanfile.py @@ -47,10 +47,10 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") self.requires("expat/2.5.0") if self.settings.os == "Linux": - self.requires("libuuid/1.0.3") + self.requires("util-linux-libuuid/2.39.2") def validate(self): if is_msvc(self): @@ -59,7 +59,7 @@ def validate(self): def build_requirements(self): self.tool_requires("gperf/3.1") 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/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py index dc1462585f4ec2..550cc9984a1bb0 100644 --- a/recipes/fontconfig/meson/conanfile.py +++ b/recipes/fontconfig/meson/conanfile.py @@ -49,16 +49,16 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") self.requires("expat/2.5.0") if self.settings.os == "Linux": - self.requires("libuuid/1.0.3") + self.requires("util-linux-libuuid/2.39.2") def build_requirements(self): self.tool_requires("gperf/3.1") - self.tool_requires("meson/1.1.1") + 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/1.9.3") + self.tool_requires("pkgconf/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -95,7 +95,7 @@ def package(self): copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) meson = Meson(self) meson.install() - rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", self.package_folder, recursive=True) rm(self, "*.conf", os.path.join(self.package_folder, "bin", "etc", "fonts", "conf.d")) rm(self, "*.def", os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) diff --git a/recipes/foxglove-websocket/all/conandata.yml b/recipes/foxglove-websocket/all/conandata.yml index 30a26f91bb4d64..697b11f6c928c1 100644 --- a/recipes/foxglove-websocket/all/conandata.yml +++ b/recipes/foxglove-websocket/all/conandata.yml @@ -1,4 +1,10 @@ sources: + 1.2.0: + url: https://github.com/foxglove/ws-protocol/archive/refs/tags/releases/cpp/v1.2.0.tar.gz + sha256: 0471d3932500ed6acd87a99cd76e048366c82f2527c1631afcee4f8ab71c4ab7 + 1.1.0: + url: https://github.com/foxglove/ws-protocol/archive/refs/tags/releases/cpp/v1.1.0.tar.gz + sha256: 3ad1f639e340e878dd638d542e57185b8c7c08fdfcb03d8c43d054957078a81f 1.0.0: url: https://github.com/foxglove/ws-protocol/archive/refs/tags/releases/cpp/v1.0.0.tar.gz sha256: c6106934a47d9d5b53ee3f6a0a6c8ec778ffdb52e9b462136bfc1bc5391ed227 diff --git a/recipes/foxglove-websocket/all/conanfile.py b/recipes/foxglove-websocket/all/conanfile.py index 60557d9c03f137..666816b0d58206 100644 --- a/recipes/foxglove-websocket/all/conanfile.py +++ b/recipes/foxglove-websocket/all/conanfile.py @@ -20,10 +20,12 @@ class FoxgloveWebSocketConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "asio": ["boost", "standalone"], } default_options = { "shared": False, "fPIC": True, + "asio": "standalone" } settings = "os", "arch", "compiler", "build_type" @@ -65,13 +67,15 @@ def validate(self): def requirements(self): self.requires("nlohmann_json/3.10.5", transitive_headers=True) - self.requires("websocketpp/0.8.2") + self.requires("websocketpp/0.8.2", transitive_headers=True, transitive_libs=True) def layout(self): cmake_layout(self, src_folder="src") def generate(self): tc = CMakeToolchain(self) + if self.settings.os == "Windows" and self.options.shared: + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() def config_options(self): @@ -79,7 +83,7 @@ def config_options(self): del self.options.fPIC def configure(self): - self.options["websocketpp"].asio = "standalone" + self.options["websocketpp"].asio = self.options.asio if self.options.shared: self.options.rm_safe("fPIC") diff --git a/recipes/foxglove-websocket/config.yml b/recipes/foxglove-websocket/config.yml index 3e794e52e592a4..6f923ecb4a132c 100644 --- a/recipes/foxglove-websocket/config.yml +++ b/recipes/foxglove-websocket/config.yml @@ -1,3 +1,7 @@ versions: + 1.2.0: + folder: all + 1.1.0: + folder: all 1.0.0: folder: all diff --git a/recipes/fp16/all/conanfile.py b/recipes/fp16/all/conanfile.py index 75666c9f3bd71c..92f6f21bd74b0f 100644 --- a/recipes/fp16/all/conanfile.py +++ b/recipes/fp16/all/conanfile.py @@ -13,6 +13,7 @@ class Fp16Conan(ConanFile): topics = ("half-precision-floating-point") homepage = "https://github.com/Maratyszcza/FP16" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -20,14 +21,13 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("psimd/cci.20200517", transitive_headers=True) + self.requires("psimd/cci.20200517") 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 diff --git a/recipes/fpgen/all/conandata.yml b/recipes/fpgen/all/conandata.yml index 89315a6f71ce41..0ed9b7cc136ee0 100644 --- a/recipes/fpgen/all/conandata.yml +++ b/recipes/fpgen/all/conandata.yml @@ -1,7 +1,4 @@ sources: - "1.1.0": - url: "https://github.com/jay-tux/fpgen/archive/refs/tags/v1.1.0.tar.gz" - sha256: "5e5faf1fbdcb3d93306bd8a838f805afdccdbb9076d78356ad5443943555be7d" "1.1.0-clang": url: "https://github.com/jay-tux/fpgen/archive/refs/tags/v1.1.0-clang.tar.gz" sha256: "02936c1e790bcdba1479cf8164596b05cfc5b7401b3c71e0a1fd77e51fe8b93f" diff --git a/recipes/fpgen/all/conanfile.py b/recipes/fpgen/all/conanfile.py index b9e1ea43fa34a9..5d2f0cf538ac50 100644 --- a/recipes/fpgen/all/conanfile.py +++ b/recipes/fpgen/all/conanfile.py @@ -1,94 +1,77 @@ 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 + +required_conan_version = ">=1.52.0" class FpgenConan(ConanFile): name = "fpgen" - description = " Functional programming in C++ using C++20 coroutines." + description = "Functional programming in C++ using C++20 coroutines." license = ["MPL2"] - topics = ( - "generators", - "coroutines", - "c++20", - "header-only", - "functional-programming", - "functional", - ) - homepage = "https://github.com/jay-tux/fpgen/" url = "https://github.com/conan-io/conan-center-index" - settings = "arch", "os", "compiler", "build_type" - no_copy_source = True + homepage = "https://github.com/jay-tux/fpgen/" + topics = ("generators", "coroutines", "c++20", "header-only", "functional-programming", "functional") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): - return "20" + return 20 @property def _compilers_minimum_version(self): return { "gcc": "11", "clang": "13", + "apple-clang": "13.1", + "Visual Studio": "16", + "msvc": "192", } - def package_id(self): - self.info.header_only() + def layout(self): + basic_layout(self, src_folder="src") - def source(self): - tools.get( - **self.conan_data["sources"][self.version], - destination=self._source_subfolder, - strip_root=True, - ) + def package_id(self): + self.info.clear() def validate(self): - if self.settings.compiler == "clang" and "clang" not in str(self.version): - raise ConanInvalidConfiguration( - f"Use '{self.version}-clang' for Clang support." - ) - - if ( - self.settings.compiler == "clang" - and not self.settings.compiler.libcxx == "libc++" - ): - raise ConanInvalidConfiguration( - f"Use 'compiler.libcxx=libc++' for {self.name} on Clang." - ) + if self.settings.compiler == "clang" and not self.settings.compiler.libcxx == "libc++": + raise ConanInvalidConfiguration(f"Use 'compiler.libcxx=libc++' with Clang for {self.name}.") if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._min_cppstd) + check_min_cppstd(self, self._min_cppstd) def lazy_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 not minimum_version: - raise ConanInvalidConfiguration( - f"{self.name} is currently not available for your compiler." - ) - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + # Needed to allow version "13" >= "13.1" for apple-clang + return all(int(p1) < int(p2) for p1, p2 in zip(v1.split("."), v2.split("."))) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and lazy_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration( - f"{self.name} {self.version} requires C++20, which your compiler does not support." + 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 package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy( - pattern="*.hpp", - dst=os.path.join("include", "fpgen"), - src=self._source_subfolder, - keep_path=False, - ) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include", "fpgen"), + src=self.source_folder, + keep_path=False) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "fpgen")) diff --git a/recipes/fpgen/all/test_package/CMakeLists.txt b/recipes/fpgen/all/test_package/CMakeLists.txt index 2d7e6737381f9b..7013b94735f0f1 100644 --- a/recipes/fpgen/all/test_package/CMakeLists.txt +++ b/recipes/fpgen/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - find_package(fpgen REQUIRED CONFIG) add_executable(${PROJECT_NAME} main.cpp) diff --git a/recipes/fpgen/all/test_package/conanfile.py b/recipes/fpgen/all/test_package/conanfile.py index 3f4a9f50f389e4..ef5d7042163ecc 100644 --- a/recipes/fpgen/all/test_package/conanfile.py +++ b/recipes/fpgen/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", "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) @@ -13,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/fpgen/all/test_package/main.cpp b/recipes/fpgen/all/test_package/main.cpp index 43bf51fe320f0d..d9d39d7a4b608c 100644 --- a/recipes/fpgen/all/test_package/main.cpp +++ b/recipes/fpgen/all/test_package/main.cpp @@ -1,13 +1,14 @@ +#include "fpgen/fpgen.hpp" + #include #include -#include "fpgen/fpgen.hpp" int main() { - std::vector vals = {0,1,2,3}; + std::vector vals = {0, 1, 2, 3}; auto gen = fpgen::from(vals); - for(auto &&val : gen) { - std::cout << val << std::endl; + for (auto &&val : gen) { + std::cout << val << std::endl; } return 0; } diff --git a/recipes/fpgen/all/test_v1_package/CMakeLists.txt b/recipes/fpgen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/fpgen/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/fpgen/all/test_v1_package/conanfile.py b/recipes/fpgen/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..3f4a9f50f389e4 --- /dev/null +++ b/recipes/fpgen/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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/fpgen/config.yml b/recipes/fpgen/config.yml index ec935d5cf64ffc..2786096f9ff863 100644 --- a/recipes/fpgen/config.yml +++ b/recipes/fpgen/config.yml @@ -1,5 +1,3 @@ versions: - "1.1.0": - folder: all "1.1.0-clang": folder: all diff --git a/recipes/fpzip/all/conandata.yml b/recipes/fpzip/all/conandata.yml new file mode 100644 index 00000000000000..ef306da4b06498 --- /dev/null +++ b/recipes/fpzip/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.0": + url: "https://github.com/LLNL/fpzip/releases/download/1.3.0/fpzip-1.3.0.tar.gz" + sha256: "248df7d84259e3feaa4c4797956b2a77c3fcd734e8f8fdc51ce171dcf4f0136c" diff --git a/recipes/fpzip/all/conanfile.py b/recipes/fpzip/all/conanfile.py new file mode 100644 index 00000000000000..2369b2e58e6b6a --- /dev/null +++ b/recipes/fpzip/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class FpzipConan(ConanFile): + name = "fpzip" + description = "Lossless compressor of multidimensional floating-point arrays" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://fpzip.llnl.gov/" + topics = ("compression", "lossless", "floating-point") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_fp": ["fast", "safe", "emul", "int"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_fp": "fast", + } + + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _fp_name_table(self): + return { + "fast": "FPZIP_FP_FAST", + "safe": "FPZIP_FP_SAFE", + "emul": "FPZIP_FP_EMUL", + "int": "FPZIP_FP_INT", + } + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FPZIP_FP"] = self._fp_name_table.get(str(self.options.with_fp), "FP_ZIP_FAST") + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["fpzip"] + self.cpp_info.defines.append("FPZIP_FP={}".format(self._fp_name_table.get(str(self.options.with_fp), "FP_ZIP_FAST"))) + if self.options.shared: + self.cpp_info.defines.append("FPZIP_SHARED_LIBS") + if self.settings.compiler in ["gcc", "clang", "apple-clang"]: + self.cpp_info.system_libs += ["stdc++"] diff --git a/recipes/fpzip/all/test_package/CMakeLists.txt b/recipes/fpzip/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..1476da8811ce63 --- /dev/null +++ b/recipes/fpzip/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(fpzip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE fpzip::fpzip) diff --git a/recipes/fpzip/all/test_package/conanfile.py b/recipes/fpzip/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/fpzip/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/fpzip/all/test_package/test_package.c b/recipes/fpzip/all/test_package/test_package.c new file mode 100644 index 00000000000000..8e359fe8da3194 --- /dev/null +++ b/recipes/fpzip/all/test_package/test_package.c @@ -0,0 +1,142 @@ +#include +#include +#include +#include +#include + +#include "fpzip.h" + +static size_t +compress(FPZ* fpz, const void* data) +{ + size_t size; + /* write header */ + if (!fpzip_write_header(fpz)) { + fprintf(stderr, "cannot write header: %s\n", fpzip_errstr[fpzip_errno]); + return 0; + } + /* perform actual compression */ + size = fpzip_write(fpz, data); + if (!size) { + fprintf(stderr, "compression failed: %s\n", fpzip_errstr[fpzip_errno]); + return 0; + } + return size; +} + +static int +decompress(FPZ* fpz, void* data, size_t inbytes) +{ + /* read header */ + if (!fpzip_read_header(fpz)) { + fprintf(stderr, "cannot read header: %s\n", fpzip_errstr[fpzip_errno]); + return 0; + } + /* make sure array size stored in header matches expectations */ + if ((fpz->type == FPZIP_TYPE_FLOAT ? sizeof(float) : sizeof(double)) * fpz->nx * fpz->ny * fpz->nz * fpz->nf != inbytes) { + fprintf(stderr, "array size does not match dimensions from header\n"); + return 0; + } + /* perform actual decompression */ + if (!fpzip_read(fpz, data)) { + fprintf(stderr, "decompression failed: %s\n", fpzip_errstr[fpzip_errno]); + return 0; + } + return 1; +} + +static float +float_rand() +{ + static unsigned int seed = 1; + double val; + seed = 1103515245 * seed + 12345; + seed &= 0x7fffffffu; + val = ldexp((double)seed, -31); + val = 2 * val - 1; + val *= val * val; + val *= val * val; + return val; +} + +/* generate a trilinear field perturbed by random noise */ +float* +float_field(int nx, int ny, int nz, float offset) +{ + int n = nx * ny * nz; + float* field = malloc(n * sizeof(float)); + int i, x, y, z; + /* generate random field */ + *field = offset; + for (i = 1; i < n; i++) + field[i] = float_rand(); + /* integrate along x */ + for (z = 0; z < nz; z++) + for (y = 0; y < ny; y++) + for (x = 1; x < nx; x++) + field[x + nx * (y + ny * z)] += field[(x - 1) + nx * (y + ny * z)]; + /* integrate along y */ + for (z = 0; z < nz; z++) + for (y = 1; y < ny; y++) + for (x = 0; x < nx; x++) + field[x + nx * (y + ny * z)] += field[x + nx * ((y - 1) + ny * z)]; + /* integrate along z */ + for (z = 1; z < nz; z++) + for (y = 0; y < ny; y++) + for (x = 0; x < nx; x++) + field[x + nx * (y + ny * z)] += field[x + nx * (y + ny * (z - 1))]; + return field; +} + +static void +test_float_array(const float* field, int nx, int ny, int nz, int prec) +{ + int status; + unsigned int actual_checksum; + int dims = (nz == 1 ? ny == 1 ? 1 : 2 : 3); + size_t inbytes = nx * ny * nz * sizeof(float); + size_t bufbytes = 1024 + inbytes; + size_t outbytes = 0; + void* buffer = malloc(bufbytes); + float* copy = malloc(inbytes); + char name[0x100]; + + /* compress to memory */ + FPZ* fpz = fpzip_write_to_buffer(buffer, bufbytes); + fpz->type = FPZIP_TYPE_FLOAT; + fpz->prec = prec; + fpz->nx = nx; + fpz->ny = ny; + fpz->nz = nz; + fpz->nf = 1; + outbytes = compress(fpz, field); + status = (0 < outbytes && outbytes <= bufbytes); + fpzip_write_close(fpz); + sprintf(name, "test.float.%dd.prec%d.compress", dims, prec); + + /* decompress */ + fpz = fpzip_read_from_buffer(buffer); + status = decompress(fpz, copy, inbytes); + fpzip_read_close(fpz); + sprintf(name, "test.float.%dd.prec%d.decompress", dims, prec); + + free(copy); + free(buffer); +} + +static int +test_float(int nx, int ny, int nz) +{ + float* field = float_field(nx, ny, nz, 0); + int prec = 8; + test_float_array(field, nx * ny * nz, 1, 1, prec); + test_float_array(field, nx, ny * nz, 1, prec); + test_float_array(field, nx, ny, nz, prec); + free(field); +} + +int main(void) { + test_float(65, 64, 63); + + return 0; +} diff --git a/recipes/fpzip/config.yml b/recipes/fpzip/config.yml new file mode 100644 index 00000000000000..426a0e4c79e9b1 --- /dev/null +++ b/recipes/fpzip/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/freeimage/all/conanfile.py b/recipes/freeimage/all/conanfile.py index 5f0684be02c517..7b598ff9ef76dc 100644 --- a/recipes/freeimage/all/conanfile.py +++ b/recipes/freeimage/all/conanfile.py @@ -67,11 +67,11 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") 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.1") if self.options.with_jpeg2000: @@ -79,7 +79,7 @@ def requirements(self): if self.options.with_png: self.requires("libpng/1.6.40") if self.options.with_webp: - self.requires("libwebp/1.3.1") + self.requires("libwebp/1.3.2") if self.options.with_tiff or self.options.with_openexr: # can't upgrade to openexr/3.x.x because plugin tiff requires openexr/2.x.x header files self.requires("openexr/2.5.7") @@ -89,7 +89,7 @@ def requirements(self): if self.options.with_jxr: self.requires("jxrlib/cci.20170615") if self.options.with_tiff: - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): 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/all/conanfile.py b/recipes/freetype/all/conanfile.py index 2d1c5c126ce107..1415f8ffb04464 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -66,11 +66,11 @@ def requirements(self): if self.options.with_png: self.requires("libpng/1.6.40") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.10 <2]") if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.get_safe("with_brotli"): - self.requires("brotli/1.0.9") + self.requires("brotli/1.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) 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/freexl/all/conandata.yml b/recipes/freexl/all/conandata.yml index 1ded763735f94d..9d309ba6c3c0d0 100644 --- a/recipes/freexl/all/conandata.yml +++ b/recipes/freexl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.0": + url: "http://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-2.0.0.tar.gz" + sha256: "176705f1de58ab7c1eebbf5c6de46ab76fcd8b856508dbd28f5648f7c6e1a7f0" "1.0.6": url: "http://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-1.0.6.tar.gz" sha256: "3de8b57a3d130cb2881ea52d3aa9ce1feedb1b57b7daa4eb37f751404f90fc22" @@ -6,6 +9,8 @@ sources: url: "http://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-1.0.5.tar.gz" sha256: "3dc9b150d218b0e280a3d6a41d93c1e45f4d7155829d75f1e5bf3e0b0de6750d" patches: + "2.0.0": + - patch_file: "patches/fix-nmake-2.0.0.patch" "1.0.6": - patch_file: "patches/fix-nmake-1.0.6.patch" "1.0.5": diff --git a/recipes/freexl/all/conanfile.py b/recipes/freexl/all/conanfile.py index 794b52fdc98a55..6f97355b38f7c3 100644 --- a/recipes/freexl/all/conanfile.py +++ b/recipes/freexl/all/conanfile.py @@ -6,6 +6,7 @@ from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, NMakeDeps, NMakeToolchain +from conan.tools.scm import Version import os required_conan_version = ">=1.55.0" @@ -16,10 +17,10 @@ class FreexlConan(ConanFile): description = "FreeXL is an open source library to extract valid data " \ "from within an Excel (.xls) spreadsheet." license = ["MPL-1.0", "GPL-2.0-only", "LGPL-2.1-only"] - topics = ("excel", "xls") - homepage = "https://www.gaia-gis.it/fossil/freexl/index" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://www.gaia-gis.it/fossil/freexl/index" + topics = ("excel", "xls") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -52,6 +53,9 @@ def layout(self): def requirements(self): self.requires("libiconv/1.17") + if Version(self.version) >= "2.0.0": + self.requires("expat/2.5.0") + self.requires("minizip/1.2.13") def build_requirements(self): if not is_msvc(self): diff --git a/recipes/freexl/all/patches/fix-nmake-2.0.0.patch b/recipes/freexl/all/patches/fix-nmake-2.0.0.patch new file mode 100644 index 00000000000000..80cf36670487d4 --- /dev/null +++ b/recipes/freexl/all/patches/fix-nmake-2.0.0.patch @@ -0,0 +1,42 @@ +diff --git a/a/makefile.vc b/b/makefile.vc +index 5cd5d05..f7505ea 100644 +--- a/a/makefile.vc ++++ b/b/makefile.vc +@@ -11,7 +11,7 @@ ODS = freexl_ods.obj + LIBOBJ = $(CORE) $(XLSX) $(ODS) + FREEXL_DLL = freexl$(VERSION).dll + +-CFLAGS = /nologo -I. -Iheaders -IC:\OSGeo4W\include $(OPTFLAGS) ++CFLAGS = /nologo -I. -Iheaders $(OPTFLAGS) + + default: all + +@@ -33,12 +33,8 @@ freexl.lib: $(LIBOBJ) + $(FREEXL_DLL): freexl_i.lib + + freexl_i.lib: $(LIBOBJ) +- link /debug /dll /out:$(FREEXL_DLL) \ +- /implib:freexl_i.lib $(LIBOBJ) \ +- C:\OSGeo4W\lib\iconv.lib \ +- C:\OSGeo4W\lib\libexpat.lib \ +- C:\OSGeo4W\lib\libminizip.lib \ +- C:\OSGeo4w\lib\zlib.lib ++ link /dll /out:$(FREEXL_DLL) \ ++ /implib:freexl_i.lib $(LIBOBJ) + if exist $(FREEXL_DLL).manifest mt -manifest \ + $(FREEXL_DLL).manifest -outputresource:$(FREEXL_DLL);2 + +diff --git a/a/nmake.opt b/b/nmake.opt +index 35f9242..15abafe 100644 +--- a/a/nmake.opt ++++ b/b/nmake.opt +@@ -2,8 +2,7 @@ + INSTDIR=C:\OSGeo4W + + # Uncomment the first for an optimized build, or the second for debug. +-OPTFLAGS= /nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS \ +- /DDLL_EXPORT ++OPTFLAGS= /nologo /fp:precise /W3 /D_CRT_SECURE_NO_WARNINGS $(FREEXL_EXPORT) + #OPTFLAGS= /nologo /Zi /MD /Fdfreexl.pdb /DDLL_EXPORT + + # Set the version number for the DLL. Normally we leave this blank since diff --git a/recipes/freexl/config.yml b/recipes/freexl/config.yml index 06269eb399e913..e78a14da43e749 100644 --- a/recipes/freexl/config.yml +++ b/recipes/freexl/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.0": + folder: all "1.0.6": folder: all "1.0.5": diff --git a/recipes/fribidi/all/conandata.yml b/recipes/fribidi/all/conandata.yml index 08937af14f7283..281ca46617df09 100644 --- a/recipes/fribidi/all/conandata.yml +++ b/recipes/fribidi/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.13": + url: "https://github.com/fribidi/fribidi/archive/v1.0.13.tar.gz" + sha256: "f24e8e381bcf76533ae56bd776196f3a0369ec28e9c0fdb6edd163277e008314" "1.0.12": url: "https://github.com/fribidi/fribidi/releases/download/v1.0.12/fribidi-1.0.12.tar.xz" sha256: "0cd233f97fc8c67bb3ac27ce8440def5d3ffacf516765b91c2cc654498293495" diff --git a/recipes/fribidi/all/conanfile.py b/recipes/fribidi/all/conanfile.py index 0867aa984f255b..4c363828a67c84 100644 --- a/recipes/fribidi/all/conanfile.py +++ b/recipes/fribidi/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.2.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/fribidi/config.yml b/recipes/fribidi/config.yml index 1a912a9e71c6ea..88a69bbd500167 100644 --- a/recipes/fribidi/config.yml +++ b/recipes/fribidi/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.13": + folder: all "1.0.12": folder: all "1.0.10": diff --git a/recipes/frugally-deep/all/conandata.yml b/recipes/frugally-deep/all/conandata.yml index 5db89f0f8f389c..04211f2fa9dd0b 100644 --- a/recipes/frugally-deep/all/conandata.yml +++ b/recipes/frugally-deep/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.15.25-p0": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.25-p0.tar.gz" + sha256: "d1204bc13ace603e97696aa7a1331d6af819c3a9b4952b4fd1e3d72dd8f524c3" + "0.15.24-p0": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.24-p0.tar.gz" + sha256: "118b0219a3f17c6d5a3535874acb145ee2079fd309e1fb83884facc684810baf" "0.15.19-p0": url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.19-p0.tar.gz" sha256: "acaba428ae19ef8d57a53b3767373cd96770c190dd57909e52d2759be89ac942" diff --git a/recipes/frugally-deep/all/conanfile.py b/recipes/frugally-deep/all/conanfile.py index 2588afa778f5bf..45f4704b4ab53f 100644 --- a/recipes/frugally-deep/all/conanfile.py +++ b/recipes/frugally-deep/all/conanfile.py @@ -1,23 +1,30 @@ -from conans import 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.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 FrugallyDeepConan(ConanFile): name = "frugally-deep" description = "Use Keras models in C++ with ease." license = "MIT" - topics = ("keras", "tensorflow") - homepage = "https://github.com/Dobiasd/frugally-deep" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/Dobiasd/frugally-deep" + topics = ("keras", "tensorflow", "header-only") + + 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 14 @property def _compilers_minimum_version(self): @@ -27,45 +34,44 @@ def _compilers_minimum_version(self): "clang": "3.7", "apple-clang": "9", } + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): self.requires("eigen/3.4.0") - self.requires("functionalplus/0.2.18-p0") - self.requires("nlohmann_json/3.10.5") + self.requires("functionalplus/0.2.20-p0") + self.requires("nlohmann_json/3.11.2") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) - - def lazy_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] - + 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("frugally-deep requires C++14. Your compiler is unknown. Assuming it supports C++14.") - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("frugally-deep requires C++14, which your compiler does not support.") - - def package_id(self): - self.info.header_only() + 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*", 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, "*", 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.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "frugally-deep") self.cpp_info.set_property("cmake_target_name", "frugally-deep::fdeep") # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["fdeep"].requires = ["eigen::eigen", - "functionalplus::functionalplus", - "nlohmann_json::nlohmann_json"] + self.cpp_info.components["fdeep"].requires = [ + "eigen::eigen", + "functionalplus::functionalplus", + "nlohmann_json::nlohmann_json", + ] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["fdeep"].system_libs = ["pthread"] diff --git a/recipes/frugally-deep/all/test_package/CMakeLists.txt b/recipes/frugally-deep/all/test_package/CMakeLists.txt index a8c615c1776b89..b64a8f93f961fd 100644 --- a/recipes/frugally-deep/all/test_package/CMakeLists.txt +++ b/recipes/frugally-deep/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(frugally-deep REQUIRED CONFIG) diff --git a/recipes/frugally-deep/all/test_package/conanfile.py b/recipes/frugally-deep/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/frugally-deep/all/test_package/conanfile.py +++ b/recipes/frugally-deep/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/frugally-deep/all/test_v1_package/CMakeLists.txt b/recipes/frugally-deep/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/frugally-deep/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/frugally-deep/all/test_v1_package/conanfile.py b/recipes/frugally-deep/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/frugally-deep/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/frugally-deep/config.yml b/recipes/frugally-deep/config.yml index 5b45f706132677..f442d1c9504202 100644 --- a/recipes/frugally-deep/config.yml +++ b/recipes/frugally-deep/config.yml @@ -1,4 +1,8 @@ versions: + "0.15.25-p0": + folder: all + "0.15.24-p0": + folder: all "0.15.19-p0": folder: all "0.15.18-p0": diff --git a/recipes/fruit/all/conanfile.py b/recipes/fruit/all/conanfile.py index 39e570bb06b3ac..9ad222d0dcc889 100644 --- a/recipes/fruit/all/conanfile.py +++ b/recipes/fruit/all/conanfile.py @@ -3,11 +3,12 @@ import tarfile from fnmatch import fnmatch -from conan import ConanFile, Version +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, download, export_conandata_patches, get +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -19,16 +20,18 @@ class FruitConan(ConanFile): homepage = "https://github.com/google/fruit" license = "Apache-2.0" topics = ("injection", "framework") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], - "use_boost": [True, False, "deprecated"], - "with_boost": [True, False], - "fPIC": [True, False]} + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_boost": [True, False], + } default_options = { "shared": False, - "use_boost": "deprecated", + "fPIC": True, "with_boost": True, - "fPIC": True} + } def export_sources(self): export_conandata_patches(self) @@ -37,22 +40,16 @@ def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") - def package_id(self): - del self.info.options.use_boost - def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - if self.options.use_boost != "deprecated": - self.output.warn("use_boost option is deprecated, use the option with_boost instead.") - self.options.with_boost = self.options.use_boost def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_boost: - self.requires("boost/1.80.0") + self.requires("boost/1.83.0") def validate(self): if self.settings.compiler.cppstd: diff --git a/recipes/fruit/config.yml b/recipes/fruit/config.yml index 684a4c74b25420..63afa5b5e5a827 100644 --- a/recipes/fruit/config.yml +++ b/recipes/fruit/config.yml @@ -1,11 +1,11 @@ versions: - "3.4.0": + "3.7.1": folder: all - "3.5.0": + "3.7.0": folder: all "3.6.0": folder: all - "3.7.0": + "3.5.0": folder: all - "3.7.1": + "3.4.0": folder: all 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/ftxui/all/conandata.yml b/recipes/ftxui/all/conandata.yml index 9093a5522f932e..56009c498942c4 100644 --- a/recipes/ftxui/all/conandata.yml +++ b/recipes/ftxui/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.0.0": + url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v5.0.0.tar.gz" + sha256: "a2991cb222c944aee14397965d9f6b050245da849d8c5da7c72d112de2786b5b" "4.1.1": url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v4.1.1.tar.gz" sha256: "9009d093e48b3189487d67fc3e375a57c7b354c0e43fc554ad31bec74a4bc2dd" diff --git a/recipes/ftxui/config.yml b/recipes/ftxui/config.yml index 727707c7ea7212..7747269b92a0d1 100644 --- a/recipes/ftxui/config.yml +++ b/recipes/ftxui/config.yml @@ -1,4 +1,6 @@ versions: + "5.0.0": + folder: all "4.1.1": folder: all "4.1.0": diff --git a/recipes/function2/all/conandata.yml b/recipes/function2/all/conandata.yml index 4a8c1d45eb5f55..ae317e99a1e7ed 100644 --- a/recipes/function2/all/conandata.yml +++ b/recipes/function2/all/conandata.yml @@ -1,4 +1,10 @@ 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" "4.2.2": url: "https://github.com/Naios/function2/archive/refs/tags/4.2.2.tar.gz" sha256: "f755cb79712dfb9ceefcf7f7ff3225f7c99d22a164dae109044dbfad55d7111e" diff --git a/recipes/function2/config.yml b/recipes/function2/config.yml index 955cd0773fc58e..a3a96ea0ace3a1 100644 --- a/recipes/function2/config.yml +++ b/recipes/function2/config.yml @@ -1,4 +1,8 @@ versions: + "4.2.4": + folder: all + "4.2.3": + folder: all "4.2.2": folder: all "4.2.1": diff --git a/recipes/functionalplus/all/conandata.yml b/recipes/functionalplus/all/conandata.yml index ca33489d4d5de3..0abf05e2527934 100644 --- a/recipes/functionalplus/all/conandata.yml +++ b/recipes/functionalplus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.20-p0": + url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.20-p0.tar.gz" + sha256: "6a8e56bd7976b7d5a6a31001f36bc199c2997f1144994fa0b48a1a5b8497abbc" "0.2.18-p0": url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.18-p0.tar.gz" sha256: "ffc63fc86f89a205accafa85c35790eda307adf5f1d6d51bb7ceb5c5e21e013b" diff --git a/recipes/functionalplus/all/conanfile.py b/recipes/functionalplus/all/conanfile.py index e87d42e53ba377..53628cdcaf1526 100644 --- a/recipes/functionalplus/all/conanfile.py +++ b/recipes/functionalplus/all/conanfile.py @@ -3,6 +3,7 @@ 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 import os required_conan_version = ">=1.50.0" @@ -12,12 +13,18 @@ class FunctionalPlusConan(ConanFile): name = "functionalplus" description = "Functional Programming Library for C++." license = "BSL-1.0" - topics = ("functionalplus", "fplus", "functional programming") + topics = ("fplus", "functional programming", "header-only") homepage = "https://github.com/Dobiasd/FunctionalPlus" url = "https://github.com/conan-io/conan-center-index" + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 14 + @property def _compilers_minimum_version(self): return { @@ -28,36 +35,35 @@ def _compilers_minimum_version(self): "apple-clang": "9", } + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 14) - - 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] + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("functionalplus requires C++14, which your compiler does not support.") - - def layout(self): - basic_layout(self, src_folder="src") + 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], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "FunctionalPlus") diff --git a/recipes/functionalplus/config.yml b/recipes/functionalplus/config.yml index 42d00dd1c341a5..bc5d04d53c4bdd 100644 --- a/recipes/functionalplus/config.yml +++ b/recipes/functionalplus/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.20-p0": + folder: all "0.2.18-p0": folder: all "0.2.17-p0": diff --git a/recipes/functions-framework-cpp/all/CMakeLists.txt b/recipes/functions-framework-cpp/all/CMakeLists.txt deleted file mode 100644 index c921d02a0d877e..00000000000000 --- a/recipes/functions-framework-cpp/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/functions-framework-cpp/all/conandata.yml b/recipes/functions-framework-cpp/all/conandata.yml index c01327cda0d09f..0f463b674b8cca 100644 --- a/recipes/functions-framework-cpp/all/conandata.yml +++ b/recipes/functions-framework-cpp/all/conandata.yml @@ -1,8 +1,22 @@ sources: + "1.2.0": + url: "https://github.com/GoogleCloudPlatform/functions-framework-cpp/archive/refs/tags/v1.2.0.tar.gz" + sha256: "729e24ef58a03b563e48d8006d63972b16a22bcf93bf2b49f40c3b219032b64b" "1.0.0": url: "https://github.com/GoogleCloudPlatform/functions-framework-cpp/archive/refs/tags/v1.0.0.tar.gz" sha256: "005f2fbe3b8be9f6f0bf7a4a5d218a23b0f62d854a5e84c56872dd3a4d2820f7" patches: + "1.2.0": + - patch_file: "patches/1.2.0-0001-dont-skip-namelink.patch" + patch_description: "disable NAMELINK_SKIP" + patch_type: "portability" + - patch_file: "patches/1.2.0-0002-find-nlohmann_json.patch" + patch_description: "use cci's nlohmann_json" + patch_type: "conan" "1.0.0": - - patch_file: "patches/0001-dont-skip-namelink.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.0.0-0001-dont-skip-namelink.patch" + patch_description: "disable NAMELINK_SKIP" + patch_type: "portability" + - patch_file: "patches/1.0.0-0002-find-nlohmann_json.patch" + patch_description: "use cci's nlohmann_json" + patch_type: "conan" diff --git a/recipes/functions-framework-cpp/all/conanfile.py b/recipes/functions-framework-cpp/all/conanfile.py index 96389274771c44..859f3f1596a4e6 100644 --- a/recipes/functions-framework-cpp/all/conanfile.py +++ b/recipes/functions-framework-cpp/all/conanfile.py @@ -1,19 +1,22 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +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, rmdir +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.43.0" - +required_conan_version = ">=1.53.0" class FunctionsFrameworkCppConan(ConanFile): name = "functions-framework-cpp" description = "An open source FaaS (Functions as a Service) framework" license = "Apache-2.0" - topics = ("google", "cloud", "functions-as-a-service", "faas-framework") - homepage = "https://github.com/GoogleCloudPlatform/functions-framework-cpp" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/GoogleCloudPlatform/functions-framework-cpp" + topics = ("google", "cloud", "functions-as-a-service", "faas-framework") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,23 +25,24 @@ class FunctionsFrameworkCppConan(ConanFile): "shared": False, "fPIC": True, } - - generators = "cmake", "cmake_find_package_multi", "cmake_find_package" short_paths = True - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "15.7", + "msvc": "190", + "clang": "7", + "apple-clang": "11", + } 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": @@ -46,21 +50,15 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - def requirements(self): - self.requires("abseil/20211102.0") - self.requires("boost/1.78.0") - self.requires("nlohmann_json/3.10.5") + def layout(self): + cmake_layout(self, src_folder="src") - @property - def _compilers_minimum_version(self): - return { - "gcc": "9", - "Visual Studio": "15.7", - "clang": "7", - "apple-clang": "11", - } + def requirements(self): + self.requires("abseil/20230125.3") + self.requires("boost/1.83.0") + self.requires("nlohmann_json/3.11.2", transitive_headers=True) @property def _required_boost_components(self): @@ -68,10 +66,10 @@ def _required_boost_components(self): def validate(self): miss_boost_required_comp = \ - any(getattr(self.options["boost"], + any(getattr(self.dependencies["boost"].options, "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components) - if self.options["boost"].header_only or miss_boost_required_comp: + if self.dependencies["boost"].options.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) @@ -79,7 +77,7 @@ def validate(self): ) if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, self._min_cppstd) def loose_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -90,46 +88,40 @@ def loose_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration( - "{} requires C++17, which your compiler does not support.".format(self.name) + "{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if self._is_msvc and self.options.shared: + if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration("Fails to build for Visual Studio as a DLL") - if hasattr(self, "settings_build") and tools.cross_building(self): + if hasattr(self, "settings_build") and cross_building(self): raise ConanInvalidConfiguration( "Recipe not prepared for cross-building (yet)" ) 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["BUILD_TESTING"] = False - self._cmake.definitions["FUNCTIONS_FRAMEWORK_CPP_TEST_EXAMPLES"] = False - - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + tc.variables["FUNCTIONS_FRAMEWORK_CPP_TEST_EXAMPLES"] = False + tc.generate() + deps = CMakeDeps(self) + deps.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, pattern="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", "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", "functions_framework_cpp") diff --git a/recipes/functions-framework-cpp/all/patches/0001-dont-skip-namelink.patch b/recipes/functions-framework-cpp/all/patches/1.0.0-0001-dont-skip-namelink.patch similarity index 100% rename from recipes/functions-framework-cpp/all/patches/0001-dont-skip-namelink.patch rename to recipes/functions-framework-cpp/all/patches/1.0.0-0001-dont-skip-namelink.patch diff --git a/recipes/functions-framework-cpp/all/patches/1.0.0-0002-find-nlohmann_json.patch b/recipes/functions-framework-cpp/all/patches/1.0.0-0002-find-nlohmann_json.patch new file mode 100644 index 00000000000000..869e28e5358111 --- /dev/null +++ b/recipes/functions-framework-cpp/all/patches/1.0.0-0002-find-nlohmann_json.patch @@ -0,0 +1,22 @@ +diff --git a/google/cloud/functions/CMakeLists.txt b/google/cloud/functions/CMakeLists.txt +index f7cac3a..38f7449 100644 +--- a/google/cloud/functions/CMakeLists.txt ++++ b/google/cloud/functions/CMakeLists.txt +@@ -23,6 +23,7 @@ configure_file(internal/version_info.h.in + find_package(absl REQUIRED) + find_package(Boost REQUIRED COMPONENTS program_options) + find_package(Threads REQUIRED) ++find_package(nlohmann_json REQUIRED) + + add_library( + functions_framework_cpp # cmake-format: sort +@@ -76,7 +77,8 @@ target_include_directories(functions_framework_cpp SYSTEM + PUBLIC $) + target_link_libraries( + functions_framework_cpp PUBLIC absl::time Boost::headers +- Boost::program_options Threads::Threads) ++ Boost::program_options Threads::Threads ++ nlohmann_json::nlohmann_json) + target_compile_definitions(functions_framework_cpp + PUBLIC BOOST_BEAST_USE_STD_STRING_VIEW) + set_target_properties( diff --git a/recipes/functions-framework-cpp/all/patches/1.2.0-0001-dont-skip-namelink.patch b/recipes/functions-framework-cpp/all/patches/1.2.0-0001-dont-skip-namelink.patch new file mode 100644 index 00000000000000..661786756beb57 --- /dev/null +++ b/recipes/functions-framework-cpp/all/patches/1.2.0-0001-dont-skip-namelink.patch @@ -0,0 +1,12 @@ +diff --git a/google/cloud/functions/CMakeLists.txt b/google/cloud/functions/CMakeLists.txt +index 2b9506b..609c238 100644 +--- a/google/cloud/functions/CMakeLists.txt ++++ b/google/cloud/functions/CMakeLists.txt +@@ -137,7 +137,6 @@ install( + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT runtime +- NAMELINK_SKIP + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT development + NAMELINK_COMPONENT development diff --git a/recipes/functions-framework-cpp/all/patches/1.2.0-0002-find-nlohmann_json.patch b/recipes/functions-framework-cpp/all/patches/1.2.0-0002-find-nlohmann_json.patch new file mode 100644 index 00000000000000..974fed8146e709 --- /dev/null +++ b/recipes/functions-framework-cpp/all/patches/1.2.0-0002-find-nlohmann_json.patch @@ -0,0 +1,22 @@ +diff --git a/google/cloud/functions/CMakeLists.txt b/google/cloud/functions/CMakeLists.txt +index 2b9506b..ab3aaaa 100644 +--- a/google/cloud/functions/CMakeLists.txt ++++ b/google/cloud/functions/CMakeLists.txt +@@ -23,6 +23,7 @@ configure_file(internal/version_info.h.in + find_package(absl REQUIRED) + find_package(Boost REQUIRED COMPONENTS program_options) + find_package(Threads REQUIRED) ++find_package(nlohmann_json REQUIRED) + + add_library( + functions_framework_cpp # cmake-format: sort +@@ -80,7 +81,8 @@ target_include_directories(functions_framework_cpp SYSTEM + PUBLIC $) + target_link_libraries( + functions_framework_cpp PUBLIC absl::time Boost::headers +- Boost::program_options Threads::Threads) ++ Boost::program_options Threads::Threads ++ nlohmann_json::nlohmann_json) + target_compile_definitions(functions_framework_cpp + PUBLIC BOOST_BEAST_USE_STD_STRING_VIEW) + set_target_properties( diff --git a/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt b/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt index d4b4a2212f334e..5126c69942f535 100644 --- a/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt +++ b/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(functions_framework_cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} functions-framework-cpp::framework) +target_link_libraries(${PROJECT_NAME} PRIVATE functions-framework-cpp::framework) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/functions-framework-cpp/all/test_package/conanfile.py b/recipes/functions-framework-cpp/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/functions-framework-cpp/all/test_package/conanfile.py +++ b/recipes/functions-framework-cpp/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/functions-framework-cpp/config.yml b/recipes/functions-framework-cpp/config.yml index c7f13630776fb5..45091dac1186fa 100644 --- a/recipes/functions-framework-cpp/config.yml +++ b/recipes/functions-framework-cpp/config.yml @@ -1,3 +1,5 @@ versions: + "1.2.0": + folder: "all" "1.0.0": folder: "all" diff --git a/recipes/fusepp/all/CMakeLists.txt b/recipes/fusepp/all/CMakeLists.txt index 661f0d421c5455..95ef7fe5638955 100644 --- a/recipes/fusepp/all/CMakeLists.txt +++ b/recipes/fusepp/all/CMakeLists.txt @@ -1,18 +1,16 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) +cmake_minimum_required(VERSION 3.12) +project(cmake_wrapper LANGUAGES CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(KEEP_RPATHS) +find_package(libfuse REQUIRED CONFIG) -set(SOURCE_SUBFOLDER ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) +set(SOURCE_SUBFOLDER ${CMAKE_CURRENT_LIST_DIR}/src) file(GLOB_RECURSE INCLUDE_FILES "${SOURCE_SUBFOLDER}/Fuse*.h" "${SOURCE_SUBFOLDER}/Fuse.cpp") add_library(fusepp ${SOURCE_SUBFOLDER}/Fuse.cpp) - +target_link_libraries(fusepp PUBLIC libfuse::libfuse) set_target_properties(fusepp PROPERTIES PUBLIC_HEADER "${INCLUDE_FILES}") + +include(GNUInstallDirs) install(TARGETS fusepp - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/fusepp/all/conanfile.py b/recipes/fusepp/all/conanfile.py index f23b9daa7e8748..36394b1187d48c 100644 --- a/recipes/fusepp/all/conanfile.py +++ b/recipes/fusepp/all/conanfile.py @@ -1,15 +1,24 @@ -from conans import ConanFile, CMake, tools -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, get +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class FuseppConan(ConanFile): name = "fusepp" description = "A simple C++ wrapper for the FUSE filesystem." license = "MIT" - topics = ("fuse", "fusepp", "wrapper", "filesystem") - homepage = "https://github.com/jachappell/Fusepp" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jachappell/Fusepp" + topics = ("fuse", "wrapper", "filesystem") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -17,23 +26,11 @@ class FuseppConan(ConanFile): } default_options = { "shared": False, - "fPIC": True + "fPIC": True, } - exports_sources = "CMakeLists.txt" - - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") - if self.settings.compiler == "gcc": - if tools.Version(self.settings.compiler.version) < "6": - raise ConanInvalidConfiguration("gcc < 6 is unsupported") + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -41,38 +38,50 @@ 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 source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libfuse/3.10.5") + self.requires("libfuse/3.10.5", transitive_headers=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.settings.compiler == "gcc": + if Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration("gcc < 6 is unsupported") + + def source(self): + 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): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) 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() def package_info(self): self.cpp_info.libs = ["fusepp"] + self.cpp_info.set_property("cmake_file_name", "fusepp") + self.cpp_info.set_property("cmake_target_name", "fusepp::fusepp") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + # TODO: Remove after Conan 2.0 self.cpp_info.names["cmake_find_package"] = "fusepp" self.cpp_info.names["cmake_find_package_multi"] = "fusepp" - - self.cpp_info.set_property("cmake_file_name", "fusepp") - self.cpp_info.set_property("cmake_target_name", "fusepp") diff --git a/recipes/fusepp/all/test_package/CMakeLists.txt b/recipes/fusepp/all/test_package/CMakeLists.txt index 00168e2e070002..03f33e510f02d6 100644 --- a/recipes/fusepp/all/test_package/CMakeLists.txt +++ b/recipes/fusepp/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -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(TARGETS) - -find_package(fusepp CONFIG REQUIRED) +find_package(fusepp REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) target_link_libraries(${PROJECT_NAME} fusepp::fusepp) diff --git a/recipes/fusepp/all/test_package/conanfile.py b/recipes/fusepp/all/test_package/conanfile.py index 46d9d6bbaf311f..23d14d1e4b9f6f 100644 --- a/recipes/fusepp/all/test_package/conanfile.py +++ b/recipes/fusepp/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", "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,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("%s --version" % bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} --version", env="conanrun") diff --git a/recipes/fusepp/all/test_v1_package/CMakeLists.txt b/recipes/fusepp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/fusepp/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/fusepp/all/test_v1_package/conanfile.py b/recipes/fusepp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..46d9d6bbaf311f --- /dev/null +++ b/recipes/fusepp/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") + self.run("%s --version" % bin_path, run_environment=True) diff --git a/recipes/g3log/all/conandata.yml b/recipes/g3log/all/conandata.yml index 1ad5a5433b5fbc..d0c122e1d915cb 100644 --- a/recipes/g3log/all/conandata.yml +++ b/recipes/g3log/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4": + url: "https://github.com/KjellKod/g3log/archive/2.4.tar.gz" + sha256: "a240673f6dda17a8d4d5768b6741534e6863e6c4d786c3678e4fe687eb115902" "2.3": url: "https://github.com/KjellKod/g3log/archive/2.3.tar.gz" sha256: "a27dc3ff0d962cc6e0b4e60890b4904e664b0df16393d27e14c878d7de09b505" @@ -14,9 +17,6 @@ sources: "1.3.3": url: "https://github.com/KjellKod/g3log/archive/1.3.3.tar.gz" sha256: "d8cae14e1508490145d710f10178b2da9b86ce03fb2428a684fff35576fe5d5c" - "1.3.2-86": - url: "https://github.com/KjellKod/g3log/archive/4000c5c899c0ae58b8b851f9b66e1a2ac0fe2bff.tar.gz" - sha256: "4572b723458fbe2b3bf620e2bd47ecfab2975c16369dc6390ffa27e177b33c88" "1.3.2": url: "https://github.com/KjellKod/g3log/archive/1.3.2.tar.gz" sha256: "0ed1983654fdd8268e051274904128709c3d9df8234acf7916e9015199b0b247" diff --git a/recipes/g3log/config.yml b/recipes/g3log/config.yml index 0452fc2e8e027d..08a72fff292b3c 100644 --- a/recipes/g3log/config.yml +++ b/recipes/g3log/config.yml @@ -1,4 +1,6 @@ versions: + "2.4": + folder: all "2.3": folder: all "2.2": @@ -9,7 +11,5 @@ versions: folder: all "1.3.3": folder: all - "1.3.2-86": - folder: all "1.3.2": folder: all diff --git a/recipes/gcem/all/conandata.yml b/recipes/gcem/all/conandata.yml index 58f1cc5b754a9c..5aa429fe457fd4 100644 --- a/recipes/gcem/all/conandata.yml +++ b/recipes/gcem/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.17.0": + url: "https://github.com/kthohr/gcem/archive/v1.17.0.tar.gz" + sha256: "74cc499e2db247c32f1ce82fc22022d22e0f0a110ecd19281269289a9e78a6f8" "1.16.0": url: "https://github.com/kthohr/gcem/archive/v1.16.0.tar.gz" sha256: "119c742b9371c0adc7d9cd710c3cbc575459a98fb63f6be4c636215dcf8404ce" diff --git a/recipes/gcem/all/conanfile.py b/recipes/gcem/all/conanfile.py index 90bc15dd9edc50..a5ff425216138e 100644 --- a/recipes/gcem/all/conanfile.py +++ b/recipes/gcem/all/conanfile.py @@ -13,11 +13,12 @@ class GcemConan(ConanFile): description = "A C++ compile-time math library using generalized " \ "constant expressions." license = "Apache-2.0" - topics = ("gcem", "math", "header-only") + topics = ("math", "header-only") homepage = "https://github.com/kthohr/gcem" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = "os", "arch", "compiler", "build_type", def layout(self): basic_layout(self, src_folder="src") @@ -30,8 +31,7 @@ def validate(self): check_min_cppstd(self, 11) 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 diff --git a/recipes/gcem/config.yml b/recipes/gcem/config.yml index cc18649bfe195f..f63fe5ab6f0146 100644 --- a/recipes/gcem/config.yml +++ b/recipes/gcem/config.yml @@ -1,4 +1,6 @@ versions: + "1.17.0": + folder: all "1.16.0": folder: all "1.14.1": diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index 3a324b7465d342..a2ce278d929656 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -1,4 +1,6 @@ versions: + "3.7.0": + folder: "post_3.5.0" "3.5.2": folder: "post_3.5.0" "3.5.1": @@ -9,7 +11,3 @@ versions: folder: "pre_3.5.0" "3.3.3": folder: "pre_3.5.0" - "3.2.3": - folder: "pre_3.5.0" - "3.1.4": - folder: "pre_3.5.0" diff --git a/recipes/gdal/post_3.5.0/CMakeLists.txt b/recipes/gdal/post_3.5.0/CMakeLists.txt index c0e666f41f1de8..7c7f67a48db89a 100644 --- a/recipes/gdal/post_3.5.0/CMakeLists.txt +++ b/recipes/gdal/post_3.5.0/CMakeLists.txt @@ -26,12 +26,12 @@ endif() if (${GDAL_USE_CRYPTOPP}) find_package(cryptopp REQUIRED) - add_library(CRYPTOPP::CRYPTOPP ALIAS cryptopp::cryptopp-static) + add_library(CRYPTOPP::CRYPTOPP ALIAS ${TARGET_FOR_CRYPTOPP}) endif() if (${GDAL_USE_DEFLATE}) find_package(libdeflate REQUIRED) - add_library(Deflate::Deflate ALIAS libdeflate::libdeflate) + add_library(Deflate::Deflate ALIAS ${TARGET_FOR_DEFLATE}) endif() if (${GDAL_USE_LZ4}) diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 2dbc2d17b374fa..6ac086393ccfdc 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.7.0": + url: "https://github.com/OSGeo/gdal/releases/download/v3.7.0/gdal-3.7.0.tar.gz" + sha256: "5a806d759f403a15bbbf8a14ecc6947071afc5ab91e5abaef0d11d1d2d16bf94" "3.5.2": url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" @@ -6,6 +9,9 @@ sources: url: "https://github.com/OSGeo/gdal/releases/download/v3.5.1/gdal-3.5.1.tar.gz" sha256: "7c4406ca010dc8632703a0a326f39e9db25d9f1f6ebaaeca64a963e3fac123d1" patches: + "3.7.0": + - patch_file: "patches/3.7.0/0-replace-find-package.patch" + base_path: "source_subfolder" "3.5.2": - patch_file: "patches/3.5.2/0-replace-find-package.patch" base_path: "source_subfolder" diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index d03de4e5125cc1..3e0847981c026c 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.files import apply_conandata_patches, get, files from conan.errors import ConanInvalidConfiguration from conans import CMake @@ -172,23 +173,23 @@ def requirements(self): self.requires("cryptopp/8.7.0") if self.options.with_curl: - self.requires("libcurl/7.85.0") + self.requires("libcurl/8.2.0") if self.options.with_dds: self.requires("crunch/cci.20190615") if self.options.with_expat: - self.requires("expat/2.4.9") + self.requires("expat/2.5.0") if self.options.with_exr: - self.requires("openexr/3.1.5") - self.requires("imath/3.1.5") + self.requires("openexr/3.1.9") + self.requires("imath/3.1.9") if self.options.with_freexl: self.requires("freexl/1.0.6") if self.options.with_geos: - self.requires("geos/3.11.0") + self.requires("geos/3.11.1") if self.options.with_gif: self.requires("giflib/5.2.1") @@ -208,13 +209,13 @@ 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.4") + self.requires("libjpeg-turbo/2.1.5") if self.options.with_kea: self.requires("kealib/1.4.14") if self.options.with_libdeflate: - self.requires("libdeflate/1.12") + self.requires("libdeflate/1.18") if self.options.with_libiconv: self.requires("libiconv/1.17") @@ -223,7 +224,7 @@ def requirements(self): self.requires("libkml/1.3.0") if self.options.with_libtiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") if self.options.with_lz4: self.requires("lz4/1.9.4") @@ -246,19 +247,19 @@ def requirements(self): self.requires("openjpeg/2.5.0") if self.options.with_openssl: - self.requires("openssl/1.1.1q") + self.requires("openssl/1.1.1u") if self.options.with_pcre: self.requires("pcre/8.45") if self.options.with_pcre2: - self.requires("pcre2/10.40") + self.requires("pcre2/10.42") if self.options.with_pg: self.requires("libpq/14.5") if self.options.with_png: - self.requires("libpng/1.6.38") + self.requires("libpng/1.6.40") if self.options.with_podofo: self.requires("podofo/0.9.7") @@ -267,28 +268,32 @@ def requirements(self): self.requires("poppler/21.07.0") if self.options.with_proj: - self.requires("proj/9.0.1") + self.requires("proj/9.1.1") if self.options.with_qhull: self.requires("qhull/8.0.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.39.3") + self.requires("sqlite3/3.42.0") if self.options.with_webp: - self.requires("libwebp/1.2.4") + self.requires("libwebp/1.3.1") if self.options.with_xerces: self.requires("xerces-c/3.2.3") if self.options.with_xml2: - self.requires("libxml2/2.9.14") + self.requires("libxml2/2.10.3") if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") if self.options.with_zstd: - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.5") + + def build_requirements(self): + # https://github.com/conan-io/conan/issues/3482#issuecomment-662284561 + self.tool_requires("cmake/[>=3.18 <4]") def package_id(self): del self.info.options.with_crypto @@ -724,10 +729,10 @@ def package(self): self.copy("LICENSE.TXT", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() - files.rmdir(self, os.path.join(self.package_folder, "share")) files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + fix_apple_shared_install_name(self) def package_info(self): diff --git a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch new file mode 100644 index 00000000000000..34401a53eae6d4 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch @@ -0,0 +1,282 @@ +diff -urN ./a/alg/CMakeLists.txt ./b/alg/CMakeLists.txt +--- ./a/alg/CMakeLists.txt 2023-05-02 08:47:11.000000000 -0500 ++++ ./b/alg/CMakeLists.txt 2023-06-06 16:47:02.784509800 -0500 +@@ -73,7 +73,7 @@ + target_sources(alg PRIVATE gdalwarpkernel_opencl.h gdalwarpkernel_opencl.cpp) + endif () + +-gdal_target_link_libraries(alg PRIVATE PROJ::proj) ++target_link_libraries(alg PUBLIC PROJ::proj) + + if (GDAL_USE_QHULL_INTERNAL) + target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL) +diff -urN ./a/apps/CMakeLists.txt ./b/apps/CMakeLists.txt +--- ./a/apps/CMakeLists.txt 2023-05-02 08:47:11.000000000 -0500 ++++ ./b/apps/CMakeLists.txt 2023-06-06 16:46:55.380690700 -0500 +@@ -26,7 +26,7 @@ + appslib PRIVATE $ $ + $ $) + +-gdal_target_link_libraries(appslib PRIVATE PROJ::proj) ++target_link_libraries(appslib PUBLIC PROJ::proj) + + set_property(TARGET appslib PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) +diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/CheckDependentLibraries.cmake +--- ./a/cmake/helpers/CheckDependentLibraries.cmake 2023-06-07 09:33:06.599777700 -0500 ++++ ./b/cmake/helpers/CheckDependentLibraries.cmake 2023-06-07 13:38:51.722872200 -0500 +@@ -11,7 +11,8 @@ + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++#include(DefineFindPackage2) ++include(ConanFindPackage) + include(CheckSymbolExists) + + option( +@@ -109,51 +110,8 @@ + string(TOUPPER ${name} key) + set(_find_dependency "") + set(_find_dependency_args "") +- if(FIND_PACKAGE2_${name}_ENABLED) +- find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) +- else() +- set(_find_package_args) +- if (_GCP_VERSION) +- list(APPEND _find_package_args ${_GCP_VERSION}) +- endif () +- if (_GCP_CONFIG) +- list(APPEND _find_package_args CONFIG) +- endif () +- if (_GCP_COMPONENTS) +- list(APPEND _find_package_args COMPONENTS ${_GCP_COMPONENTS}) +- endif () +- if (_GCP_PATHS) +- list(APPEND _find_package_args PATHS ${_GCP_PATHS}) +- endif () +- if (_GCP_NAMES) +- set(GDAL_CHECK_PACKAGE_${name}_NAMES "${_GCP_NAMES}" CACHE STRING "Config file name for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_NAMES) +- endif () +- if (_GCP_TARGETS) +- set(GDAL_CHECK_PACKAGE_${name}_TARGETS "${_GCP_TARGETS}" CACHE STRING "Target name candidates for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_TARGETS) +- endif () +- if (GDAL_CHECK_PACKAGE_${name}_NAMES) +- find_package(${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} ${_find_package_args}) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS} REQUIRED) +- if (${name}_FOUND) +- get_filename_component(_find_dependency_args "${${name}_CONFIG}" NAME) +- string(REPLACE ";" " " _find_dependency_args "${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} CONFIGS ${_find_dependency_args} ${_find_package_args}") +- endif () +- endif () +- if (NOT ${name}_FOUND) +- find_package(${name} ${_find_package_args}) +- if (${name}_FOUND) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- elseif (${key}_FOUND) # Some find modules do not set _FOUND +- gdal_check_package_target(${key} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- set(${name}_FOUND "${key}_FOUND") +- endif () +- if (${name}_FOUND) +- string(REPLACE ";" " " _find_dependency_args "${name} ${_find_package_args}") +- endif() +- endif () +- endif () ++ ++ find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) + if (${key}_FOUND OR ${name}_FOUND) + if(_GCP_MINIMUM_VERSION) + +@@ -368,14 +326,12 @@ + endif () + + # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. +-find_package(PROJ 9 CONFIG QUIET) +-if (NOT PROJ_FOUND) +- find_package(PROJ 8 CONFIG QUIET) +-endif() ++find_package2(PROJ) ++target_include_directories(PROJ::proj INTERFACE ${PROJ_INCLUDE_DIRS}) + if (PROJ_FOUND) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") + else() +- find_package(PROJ 6.0 REQUIRED) ++ find_package(proj 6.0 REQUIRED) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ 6.0)\n") + endif () + +@@ -458,15 +414,10 @@ + TARGETS json-c::json-c JSONC::JSONC + ) + gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) +- get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) +- find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) +- list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") +- list(REMOVE_DUPLICATES include_dirs) +- set_target_properties(json-c::json-c PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" +- ) +-endif() ++get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) ++list(APPEND include_dirs "${JSONC_INCLUDE_DIRS}/json-c") ++set_target_properties(json-c::json-c PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include_dirs}") ++message("Setting include for json-c: ${include_dirs}") + + gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) + gdal_internal_library(OPENCAD) +@@ -527,6 +478,24 @@ + gdal_check_package(SQLite3 "Enable SQLite3 support (used by SQLite/Spatialite, GPKG, Rasterlite, MBTiles, etc.)" + CAN_DISABLE RECOMMENDED) + if (SQLite3_FOUND) ++ set(CMAKE_REQUIRED_INCLUDES ${SQLite3_INCLUDE_DIRS}) ++ check_symbol_exists(sqlite3_mutex_alloc sqlite3ext.h SQLite3_HAS_MUTEX_ALLOC) ++ check_symbol_exists(sqlite3_column_table_name sqlite3ext.h SQLite3_HAS_COLUMN_METADATA) ++ check_symbol_exists(sqlite3_rtree_query_callback sqlite3.h SQLite3_HAS_RTREE) ++ check_symbol_exists(sqlite3_load_extension sqlite3ext.h SQLite3_HAS_LOAD_EXTENSION) ++ # https://www.sqlite.org/compile.html recommends to build with -DSQLITE_OMIT_PROGRESS_CALLBACK ++ # "for applications that are able to use them"... This is sometimes wrongly ++ # understood as recommended in all situations. ++ check_symbol_exists(sqlite3_progress_handler sqlite3.h SQLite3_HAS_PROGRESS_HANDLER) ++ ++ #if(NOT TARGET SQLite::SQLite3) ++ # add_library(SQLite::SQLite3 UNKNOWN IMPORTED) ++ # set_target_properties(SQLite::SQLite3 PROPERTIES ++ # INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIRS}" ++ # IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ # IMPORTED_LOCATION "${SQLite3_LIBRARY}") ++ #endif() ++ + if (NOT DEFINED SQLite3_HAS_COLUMN_METADATA) + message(FATAL_ERROR "missing SQLite3_HAS_COLUMN_METADATA") + endif () +@@ -566,7 +535,7 @@ + gdal_check_package(SPATIALITE "Enable spatialite support for sqlite3" VERSION 4.1.2 CAN_DISABLE) + gdal_check_package(RASTERLITE2 "Enable RasterLite2 support for sqlite3" VERSION 1.1.0 CAN_DISABLE) + +-find_package(LibKML COMPONENTS DOM ENGINE) ++find_package(LibKML COMPONENTS kmlengine kmldom kmlbase) + if (GDAL_USE_LIBKML) + if (NOT LibKML_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") +diff -urN ./a/cmake/helpers/ConanFindPackage.cmake ./b/cmake/helpers/ConanFindPackage.cmake +--- ./a/cmake/helpers/ConanFindPackage.cmake 1969-12-31 18:00:00.000000000 -0600 ++++ ./b/cmake/helpers/ConanFindPackage.cmake 2023-06-06 16:26:55.800008000 -0500 +@@ -0,0 +1,43 @@ ++ ++function(define_find_package2 pkgname include_file library_name) ++endfunction() ++ ++function(find_package2 pkgname) ++ set(_options QUIET REQUIRED) ++ set(_oneValueArgs OUT_DEPENDENCY) ++ set(_multiValueArgs) ++ cmake_parse_arguments(arg "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) ++ if(arg_QUIET) ++ set(${pkgname}_FIND_QUIETLY TRUE) ++ endif() ++ if(arg_REQUIRED) ++ set(${pkgname}_FIND_REQUIRED TRUE) ++ endif() ++ ++ string(TOUPPER ${pkgname} key) ++ ++ set(docstring "Configured for conan package ${GDAL_CONAN_PACKAGE_FOR_${key}}") ++ if (DEFINED GDAL_CONAN_PACKAGE_FOR_${key}) ++ message("Using conan package ${GDAL_CONAN_PACKAGE_FOR_${key}} for dependency ${pkgname}") ++ set(conan_package ${GDAL_CONAN_PACKAGE_FOR_${key}}) ++ string(TOUPPER ${conan_package} conan_package_upper) ++ ++ set(${key}_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_${conan_package_upper}}" CACHE STRING ${docstring}) ++ if (NOT TARGET_FOR_${key}) ++ set(TARGET_FOR_${key} "${conan_package}::${conan_package}") ++ endif() ++ set(${key}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_INCLUDE_DIRS "CONAN_INCLUDE_DIRS_${conan_package_upper}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_FOUND TRUE CACHE BOOL ${docstring}) ++ ++ else () ++ message("dependency ${pkgname} has no conan package") ++ set(${key}_FOUND FALSE CACHE BOOL ${docstring}) ++ endif() ++ ++endfunction() +diff -urN ./a/frmts/hfa/CMakeLists.txt ./b/frmts/hfa/CMakeLists.txt +--- ./a/frmts/hfa/CMakeLists.txt 2023-05-02 08:47:11.000000000 -0500 ++++ ./b/frmts/hfa/CMakeLists.txt 2023-06-06 16:54:31.162043900 -0500 +@@ -15,7 +15,8 @@ + hfa_overviews.cpp + BUILTIN) + gdal_standard_includes(gdal_HFA) +-target_include_directories(gdal_HFA PRIVATE $) ++target_link_libraries(gdal_HFA INTERFACE PROJ::proj) ++target_include_directories(gdal_HFA PRIVATE ${PROJ_INCLUDE_DIRS}) + target_compile_definitions(gdal_HFA PRIVATE $) + + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) +diff -urN ./a/gdal.cmake ./b/gdal.cmake +--- ./a/gdal.cmake 2023-05-02 08:47:12.000000000 -0500 ++++ ./b/gdal.cmake 2023-06-06 16:55:34.252830900 -0500 +@@ -859,25 +859,6 @@ + ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gdal/) + +- # Generate gdal-config utility command and pkg-config module gdal.pc +- include(GdalGenerateConfig) +- gdal_generate_config( +- TARGET +- "${GDAL_LIB_TARGET_NAME}" +- GLOBAL_PROPERTY +- "gdal_private_link_libraries" +- GDAL_CONFIG +- "${PROJECT_BINARY_DIR}/apps/gdal-config" +- PKG_CONFIG +- "${CMAKE_CURRENT_BINARY_DIR}/gdal.pc") +- install( +- PROGRAMS ${PROJECT_BINARY_DIR}/apps/gdal-config +- DESTINATION ${CMAKE_INSTALL_BINDIR} +- COMPONENT applications) +- install( +- FILES ${CMAKE_CURRENT_BINARY_DIR}/gdal.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +- COMPONENT libraries) + endif () + + configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) +diff -urN ./a/ogr/CMakeLists.txt ./b/ogr/CMakeLists.txt +--- ./a/ogr/CMakeLists.txt 2023-05-02 08:47:12.000000000 -0500 ++++ ./b/ogr/CMakeLists.txt 2023-06-06 16:56:18.682151700 -0500 +@@ -89,12 +89,12 @@ + + target_compile_definitions(ogr PRIVATE HAVE_MITAB) + +-gdal_target_link_libraries(ogr PRIVATE PROJ::proj) ++target_link_libraries(ogr PUBLIC PROJ::proj) + + # External libs then + if (GDAL_USE_GEOS) + target_compile_definitions(ogr PRIVATE -DHAVE_GEOS=1) +- gdal_target_link_libraries(ogr PRIVATE ${GEOS_TARGET}) ++ target_link_libraries(ogr PUBLIC ${GEOS_TARGET}) + endif () + + if (GDAL_USE_SFCGAL) +diff -urN ./a/ogr/ogr_proj_p.h ./b/ogr/ogr_proj_p.h +--- ./a/ogr/ogr_proj_p.h 2023-05-02 08:47:12.000000000 -0500 ++++ ./b/ogr/ogr_proj_p.h 2023-06-06 16:56:30.772908800 -0500 +@@ -29,7 +29,7 @@ + #ifndef OGR_PROJ_P_H_INCLUDED + #define OGR_PROJ_P_H_INCLUDED + +-#include "proj.h" ++#include + + #include "cpl_mem_cache.h" + diff --git a/recipes/gdal/pre_3.5.0/conandata.yml b/recipes/gdal/pre_3.5.0/conandata.yml index 4ca595dd102568..49983edc62730c 100644 --- a/recipes/gdal/pre_3.5.0/conandata.yml +++ b/recipes/gdal/pre_3.5.0/conandata.yml @@ -8,12 +8,6 @@ sources: "3.3.3": url: "https://github.com/OSGeo/gdal/releases/download/v3.3.3/gdal-3.3.3.tar.gz" sha256: "28925ea4717b02185ee208bfc121a94fa0bc1dfe9cb862fd3868c2a0394d605a" - "3.2.3": - url: "https://github.com/OSGeo/gdal/releases/download/v3.2.3/gdal-3.2.3.tar.gz" - sha256: "86a35aad60a1eb87c2c0c145f9bccd83a47c4781254544ed5246f64d55ee1f18" - "3.1.4": - url: "https://github.com/OSGeo/gdal/releases/download/v3.1.4/gdal-3.1.4.tar.gz" - sha256: "5f09ea6ca797e296b608d261e08e18ffa43a12fa28d460ae139d2a026ee2b0c0" patches: "3.4.3": - patch_file: "patches/3.4.x/fix-autotools-3.4.3.patch" @@ -33,17 +27,3 @@ patches: - patch_file: "patches/3.3.x/fix-include-jsonc.patch" - patch_file: "patches/3.3.x/fix-include-xerces.patch" - patch_file: "patches/3.3.x/fix-include-podofo.patch" - "3.2.3": - - patch_file: "patches/3.2.x/fix-autotools.patch" - - patch_file: "patches/3.2.x/fix-nmake.patch" - - patch_file: "patches/3.2.x/fix-include-jsonc.patch" - - patch_file: "patches/3.2.x/fix-include-xerces.patch" - - patch_file: "patches/3.2.x/fix-include-podofo.patch" - "3.1.4": - - patch_file: "patches/3.1.x/fix-autotools-3.1.4.patch" - - patch_file: "patches/3.1.x/fix-nmake-common.patch" - - patch_file: "patches/3.1.x/fix-nmake-opt-3.1.2.patch" - - patch_file: "patches/3.1.x/fix-import-dll-msvc.patch" - - patch_file: "patches/3.1.x/fix-include-jsonc.patch" - - patch_file: "patches/3.1.x/fix-include-xerces-3.1.2.patch" - - patch_file: "patches/3.1.x/fix-include-podofo.patch" diff --git a/recipes/gdal/pre_3.5.0/conanfile.py b/recipes/gdal/pre_3.5.0/conanfile.py index 7ecdfb6713c6ab..65bbd7d92d812a 100644 --- a/recipes/gdal/pre_3.5.0/conanfile.py +++ b/recipes/gdal/pre_3.5.0/conanfile.py @@ -246,21 +246,21 @@ def layout(self): self.folders.build = self.folders.source def requirements(self): - self.requires("json-c/0.16") + self.requires("json-c/0.17") self.requires("libgeotiff/1.7.1") # self.requires("libopencad/0.0.2") # TODO: use conan recipe when available instead of internal one - self.requires("libtiff/4.4.0") - self.requires("proj/9.1.1") + self.requires("libtiff/4.5.1") + self.requires("proj/9.2.1") if Version(self.version) >= "3.1.0": self.requires("flatbuffers/2.0.5") if self.options.get_safe("with_zlib", True): self.requires("zlib/1.2.13") if self.options.get_safe("with_libdeflate"): - self.requires("libdeflate/1.17") + self.requires("libdeflate/1.18") if self.options.with_libiconv: self.requires("libiconv/1.17") if self.options.get_safe("with_zstd"): - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.5") if self.options.get_safe("with_blosc"): self.requires("c-blosc/1.21.3") if self.options.get_safe("with_lz4"): @@ -274,7 +274,7 @@ def requirements(self): # if self.options.with_pcraster: # self.requires("pcraster-rasterformat/1.3.2") if self.options.get_safe("with_png", True): - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_dds: self.requires("crunch/cci.20190615") if self.options.with_gta: @@ -284,7 +284,7 @@ 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.4") + self.requires("libjpeg-turbo/3.0.0") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") if self.options.with_charls: @@ -326,13 +326,13 @@ def requirements(self): # if self.options.with_dods_root: # self.requires("libdap/3.20.6") if self.options.with_curl: - self.requires("libcurl/7.87.0") + self.requires("libcurl/8.2.1") if self.options.with_xml2: self.requires("libxml2/2.10.3") # if self.options.with_spatialite: # self.requires("libspatialite/4.3.0a") if self.options.get_safe("with_sqlite3"): - self.requires("sqlite3/3.40.1") + self.requires("sqlite3/3.42.0") # if self.options.with_rasterlite2: # self.requires("rasterlite2/x.x.x") if self.options.get_safe("with_pcre"): @@ -340,7 +340,7 @@ def requirements(self): if self.options.get_safe("with_pcre2"): self.requires("pcre2/10.42") if self.options.with_webp: - self.requires("libwebp/1.3.0") + self.requires("libwebp/1.3.1") if self.options.with_geos: self.requires("geos/3.11.1") # if self.options.with_sfcgal: @@ -367,11 +367,11 @@ def requirements(self): if self.options.with_cryptopp: self.requires("cryptopp/8.7.0") if self.options.with_crypto: - self.requires("openssl/1.1.1s") + self.requires("openssl/1.1.1u") # if not self.options.without_lerc: # self.requires("lerc/2.1") # TODO: use conan recipe (not possible yet because lerc API is broken for GDAL) if self.options.get_safe("with_exr"): - self.requires("openexr/3.1.5") + self.requires("openexr/3.1.9") if self.options.get_safe("with_heif"): self.requires("libheif/1.13.0") diff --git a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-autotools-3.1.4.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-autotools-3.1.4.patch deleted file mode 100644 index 974146f6a3f7ad..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-autotools-3.1.4.patch +++ /dev/null @@ -1,283 +0,0 @@ ---- a/GDALmake.opt.in -+++ b/GDALmake.opt.in -@@ -601,7 +601,7 @@ endif - - ifeq ($(HAVE_LIBTOOL), yes) - --CONFIG_LIBS = $(GDAL_ROOT)/$(LIBGDAL) -+CONFIG_LIBS = $(GDAL_ROOT)/$(LIBGDAL) $(LIBS) - ifeq ($(MACOSX_FRAMEWORK),yes) - CONFIG_LIBS_INS = -L$(INST_LIB)/unix/lib -lgdal - else ---- a/configure.ac -+++ b/configure.ac -@@ -1214,6 +1214,7 @@ dnl --------------------------------------------------------------------------- - dnl PROJ.6 related stuff - dnl --------------------------------------------------------------------------- - -+PKG_PROG_PKG_CONFIG([0.21]) - AC_MSG_CHECKING([for PROJ >= 6 library]) - - AC_ARG_WITH(proj,[ --with-proj=ARG Compile with PROJ.x (ARG=yes or path)],,) -@@ -1229,11 +1230,7 @@ if test "x$with_proj" = "xno" ; then - else - - if test "x$with_proj" = "xyes" -o "x$with_proj" = "x"; then -- ORIG_LIBS="$LIBS" -- LIBS="-lproj $ORIG_LIBS" -- AC_LANG_PUSH([C++]) -- AC_CHECK_LIB(proj,proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,) -- AC_LANG_POP([C++]) -+ PROJ_FOUND=yes - if test "$PROJ_FOUND" = "no"; then - AC_LANG_PUSH([C++]) - AC_CHECK_LIB(proj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,) -@@ -1876,7 +1873,6 @@ else - - DDS_SETTING=yes - CRUNCHDIR="$with_dds" -- LIBS="-L$with_dds/lib/ -lcrunch $LIBS" - echo "using libcrunch from $with_dds." - - fi -@@ -2012,7 +2008,7 @@ else - AC_MSG_RESULT([using libtiff from ${with_libtiff}.]) - - dnl Check for the BigTIFF enabled library (libtiff >= 4.0) -- AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,) -+ AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,$LIBS) - - fi - -@@ -2082,7 +2078,6 @@ else - - dnl We now require libgeotiff 1.5.0 - dnl first check if $with_geotiff/lib has the library: -- AC_CHECK_LIB(geotiff,GTIFAttachPROJContext,GEOTIFF_SETTING=external,GEOTIFF_SETTING=not_found,-L$with_geotiff/lib) - - if test $GEOTIFF_SETTING = "external" ; then - LIBS="-L$with_geotiff/lib -lgeotiff $LIBS" -@@ -2650,6 +2645,10 @@ if test x"$with_hdf4" = x"no" ; then - - echo "hdf4 support disabled." - -+elif test x"$with_hdf4" = x"yes" ; then -+ PKG_CHECK_MODULES([HDF4], [hdf], [HAVE_HDF4=yes], [AC_MSG_ERROR([hdf4 not found...])]) -+ PKG_CHECK_MODULES([HDF4], [hdf >= 4.2.5], [HDF4_HAS_MAXOPENFILES=yes], [HDF4_HAS_MAXOPENFILES=no]) -+ HDF4_INCLUDE="$HDF4_CFLAGS" - else - - if test x"$with_hdf4" = x"yes" -o x"$with_hdf4" = x"" ; then -@@ -2780,7 +2779,6 @@ elif test "$with_hdf5" = "yes" -o "$with_hdf5" = "" ; then - # Test that the package found is for the right architecture - saved_LIBS="$LIBS" - LIBS="$HDF5_LIBS" -- AC_CHECK_LIB(hdf5,H5Fopen, [HAVE_HDF5=yes], [HAVE_HDF5=no]) - LIBS="$saved_LIBS" - - if test "$HAVE_HDF5" = "yes"; then -@@ -2849,21 +2847,21 @@ KEA_CONFIG=no - - AC_ARG_WITH(kea,[ --with-kea[=ARG] Include kealib (ARG=path to kea-config) [[default=yes]]],,) - -+AC_MSG_CHECKING([for kea]) - if test "$with_kea" = "yes" -o "x$with_kea" = "x" ; then -- AC_PATH_PROG(KEA_CONFIG, kea-config, no) -+ HAVE_KEA=yes -+ AC_MSG_RESULT([yes]) - else -- KEA_CONFIG=$with_kea -+ HAVE_KEA=no -+ AC_MSG_RESULT([no]) - fi - --AC_MSG_CHECKING([for kea]) - - if test "$KEA_CONFIG" = "no" ; then - -- HAVE_KEA=no - KEA_LIB= - KEA_INC= - -- AC_MSG_RESULT([no]) - - else - if test -d $KEA_CONFIG ; then -@@ -3715,18 +3713,15 @@ MYSQL_CONFIG=no - AC_ARG_WITH(mysql,[ --with-mysql[=ARG] Include MySQL (ARG=path to mysql_config) [[default=no]]],,) - - if test "$with_mysql" = "yes" ; then -- AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no) -+ HAVE_MYSQL=yes - else -- if test "x$with_mysql" != "x" ; then -- MYSQL_CONFIG=$with_mysql -- fi -+ HAVE_MYSQL=no - fi - - AC_MSG_CHECKING([for MySQL]) - - if test "$MYSQL_CONFIG" = "no" ; then - -- HAVE_MYSQL=no - MYSQL_LIB= - MYSQL_INC= - -@@ -3820,8 +3815,11 @@ dnl Check for Expat configuration. - dnl --------------------------------------------------------------------------- - - dnl Expat 1.95.0 released in 2000-09-28 --EXPAT_REQ_VERSION="1.95.0" --AX_LIB_EXPAT($EXPAT_REQ_VERSION) -+# AX_LIB_EXPAT is too fragile, it doesn't properly handle debug expat on Windows -+HAVE_EXPAT=no -+AC_ARG_WITH([expat], AS_HELP_STRING([--with-expat[=ARG]], [use Expat library (ARG=yes or no)]),,) -+if test x"$with_expat" = x"yes" ; then -+PKG_CHECK_MODULES([EXPAT], [expat >= 1.95.0], [HAVE_EXPAT=yes], [AC_MSG_ERROR([expat not found...])]) - - if test "$HAVE_EXPAT" = "yes"; then - LIBS="$EXPAT_LDFLAGS $LIBS" -@@ -3834,6 +3832,7 @@ m4_foreach_w([frmt],EXPAT_DRIVERS,[ - fi - ]) - -+fi - fi - - AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT) -@@ -4059,29 +4058,17 @@ AC_ARG_WITH(curl, - dnl Clear some cache variables - unset ac_cv_path_LIBCURL - --if test "`basename xx/$with_curl`" = "curl-config" ; then -- LIBCURL_CONFIG="$with_curl" --elif test "$with_curl" = "no" ; then -- LIBCURL_CONFIG=no --else -- AC_PATH_PROG(LIBCURL_CONFIG, curl-config, no) --fi -- --if test "$LIBCURL_CONFIG" != "no" ; then -- -- CURL_VERNUM=`$LIBCURL_CONFIG --vernum` -- CURL_VER=`$LIBCURL_CONFIG --version | awk '{print $2}'` -- -- AC_MSG_RESULT([ found libcurl version $CURL_VER]) -- -- AC_CHECK_LIB(curl,curl_global_init,CURL_SETTING=yes,CURL_SETTING=no,`$LIBCURL_CONFIG --libs`) - -+if test "$with_curl" = "yes" ; then -+ PKG_CHECK_MODULES([CURL], [libcurl], [CURL_SETTING=yes], [AC_MSG_ERROR([libcurl not found...])]) -+else -+ CURL_SETTING=no - fi - - if test "$CURL_SETTING" = "yes" ; then - -- CURL_INC=`$LIBCURL_CONFIG --cflags` -- CURL_LIB=`$LIBCURL_CONFIG --libs` -+ CURL_INC="$CURL_CFLAGS" -+ CURL_LIB="$CURL_LIBS" - m4_foreach_w([frmt],CURL_FORMATS,[ - driver_enabled=m4_join([_],[$INTERNAL_FORMAT],frmt,[ENABLED]) - if test "x$driver_enabled" = "xyes"; then -@@ -4121,7 +4108,6 @@ if test "x$with_xml2" = "xyes" -o "x$with_xml2" = "x" ; then - if test "${HAVE_LIBXML2}" = "yes"; then - SAVED_LIBS="${LIBS}" - LIBS="${LIBXML2_LIBS}" -- AC_CHECK_LIB(xml2,xmlParseDoc,HAVE_LIBXML2=yes,HAVE_LIBXML2=no) - LIBS="${SAVED_LIBS}" - fi - -@@ -4242,9 +4228,12 @@ dnl --------------------------------------------------------------------------- - dnl Check for SQLite (only if SpatiaLite is not detected) - dnl --------------------------------------------------------------------------- - -+HAVE_SQLITE3=no -+AC_ARG_WITH(sqlite3, AS_HELP_STRING([--with-sqlite3[=ARG]], [use SQLite 3 library (ARG=yes or no)]),,) - if test "${HAVE_SPATIALITE}" = "no" -o "${HAVE_SPATIALITE}" = "dlopen" ; then -- SQLITE3_REQ_VERSION="3.0.0" -- AX_LIB_SQLITE3($SQLITE3_REQ_VERSION) -+ if test x"$with_sqlite3" = x"yes" ; then -+ PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.0.0], [HAVE_SQLITE3=yes], [AC_MSG_ERROR([sqlite3 not found...])]) -+ fi - - if test "$HAVE_SQLITE3" = "yes"; then - LIBS="$SQLITE3_LDFLAGS $LIBS" -@@ -4597,8 +4586,13 @@ dnl --------------------------------------------------------------------------- - dnl Check if geos library is available. - dnl --------------------------------------------------------------------------- - --GEOS_INIT(3.1.0) -+AC_ARG_WITH(geos, AS_HELP_STRING([--with-geos[=ARG]], [Include GEOS support (ARG=yes or no)]),,) - HAVE_GEOS_RESULT="no" -+HAVE_GEOS=no -+if test x"$with_geos" = x"no" ; then -+ AC_MSG_RESULT([GEOS support disabled]) -+else -+ PKG_CHECK_MODULES([GEOS], [geos >= 3.1.0], [HAVE_GEOS=yes], [AC_MSG_ERROR([geos not found...])]) - if test "${HAVE_GEOS}" = "yes" ; then - - AC_MSG_NOTICE([Using C API from GEOS $GEOS_VERSION]) -@@ -4607,6 +4601,8 @@ if test "${HAVE_GEOS}" = "yes" ; then - LIBS="${GEOS_LIBS} ${LIBS}" - HAVE_GEOS_RESULT="yes" - fi -+fi -+AC_SUBST(HAVE_GEOS, $HAVE_GEOS) - - dnl --------------------------------------------------------------------------- - dnl Check if SFCGAL library is available. -@@ -4641,20 +4637,18 @@ elif test "$with_qhull" = "yes" -o "$with_qhull" = "" ; then - # qhull/qhull.h - AC_CHECK_HEADERS([qhull/libqhull.h]) - if test "$ac_cv_header_qhull_libqhull_h" = "yes"; then -- AC_CHECK_LIB(qhull,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,) -+ QHULL_SETTING=yes - if test "$QHULL_SETTING" = "yes"; then - QHULL_SETTING=external - QHULL_INCLUDE_SUBDIR_IS_LIBQHULL=0 -- LIBS="-lqhull $LIBS" - fi - fi - AC_CHECK_HEADERS([libqhull/libqhull.h]) - if test "$ac_cv_header_libqhull_libqhull_h" = "yes"; then -- AC_CHECK_LIB(qhull,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,) -+ QHULL_SETTING=yes - if test "$QHULL_SETTING" = "yes"; then - QHULL_SETTING=external - QHULL_INCLUDE_SUBDIR_IS_LIBQHULL=1 -- LIBS="-lqhull $LIBS" - fi - fi - -@@ -4741,7 +4735,9 @@ AC_MSG_CHECKING([for FreeXL support]) - HAVE_FREEXL=no - FREEXL_INCLUDE= - --if test "$with_freexl" = "" -o "$with_freexl" = "yes" ; then -+if test "$with_freexl" = "yes"; then -+ PKG_CHECK_MODULES([FREEXL], [freexl >= 1.0.0], [HAVE_FREEXL=yes], [AC_MSG_ERROR([freexl not found...])]) -+elif test "$with_freexl" = ""; then - AC_CHECK_HEADERS(freexl.h) - AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-lfreexl",FREEXL_LIBS=missing) - -@@ -4847,8 +4843,7 @@ if test "$with_libjson_c" = "external" -o "$with_libjson_c" = "" -o "$with_libjs - elif test "$with_libjson_c" = "internal" ; then - LIBJSONC_SETTING=internal - elif test "$with_libjson_c" != "no"; then -- LIBS="-L$with_libjson_c/lib $LIBS" -- AC_CHECK_LIB(json-c,json_object_set_serializer,LIBJSONC_SETTING=external,LIBJSONC_SETTING=internal,-L$with_libjson_c/lib) -+ LIBJSONC_SETTING=external - else - AC_MSG_ERROR([libjson-c (internal or external) is required]) - fi -@@ -5952,7 +5947,6 @@ else - # Test that the package found is for the right architecture - saved_LIBS="$LIBS" - LIBS="$EXR_LIBS" -- AC_CHECK_LIB(IlmImf,ImfTiledInputReadTile, [HAVE_EXR=yes], [HAVE_EXR=no]) - LIBS="$saved_LIBS" - - if test "$HAVE_EXR" = "yes"; then diff --git a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-import-dll-msvc.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-import-dll-msvc.patch deleted file mode 100644 index 308c1bca0a4c0f..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-import-dll-msvc.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/port/cpl_port.h -+++ b/port/cpl_port.h -@@ -344,7 +344,11 @@ typedef unsigned int GUIntptr_t; - - #ifndef CPL_DLL - #if defined(_MSC_VER) && !defined(CPL_DISABLE_DLL) --# define CPL_DLL __declspec(dllexport) -+# ifdef GDAL_COMPILATION -+# define CPL_DLL __declspec(dllexport) -+# else -+# define CPL_DLL -+# endif - # define CPL_INTERNAL - #else - # if defined(USE_GCC_VISIBILITY_FLAG) diff --git a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-jsonc.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-jsonc.patch deleted file mode 100644 index c52f9dff533821..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-jsonc.patch +++ /dev/null @@ -1,104 +0,0 @@ ---- a/gcore/gdal_rat.cpp -+++ b/gcore/gdal_rat.cpp -@@ -50,7 +50,7 @@ - #pragma clang diagnostic ignored "-Wunknown-pragmas" - #pragma clang diagnostic ignored "-Wdocumentation" - #endif --#include "json.h" -+#include - #ifdef __clang__ - #pragma clang diagnostic pop - #endif ---- a/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp -@@ -37,7 +37,7 @@ - - #include "cpl_conv.h" - #include "cpl_error.h" --#include "json.h" -+#include - // #include "json_object.h" - // #include "json_tokener.h" - #include "ogr_api.h" ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsondatasource.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsondatasource.cpp -@@ -41,7 +41,7 @@ - #include "cpl_string.h" - #include "cpl_vsi.h" - #include "cpl_vsi_error.h" --#include "json.h" -+#include - // #include "json_object.h" - #include "gdal_utils.h" - #include "gdal.h" ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonlayer.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonlayer.cpp -@@ -37,7 +37,7 @@ - # endif - #endif // !DEBUG_VERBOSE - --#include -+#include - - #if !DEBUG_JSON - # ifdef __clang ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp -@@ -32,7 +32,7 @@ - #include "ogrgeojsonreader.h" - #include "ogrgeojsonutils.h" - #include "ogr_geojson.h" --#include // JSON-C -+#include // JSON-C - - #if (!defined(JSON_C_VERSION_NUM)) || (JSON_C_VERSION_NUM < JSON_C_VER_013) - #include // just for sizeof(struct json_object) ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonutils.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonutils.cpp -@@ -31,7 +31,7 @@ - #include - #include - #include --#include // JSON-C -+#include // JSON-C - - #include - #include ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp -@@ -33,13 +33,13 @@ - #include "ogrgeojsonutils.h" - #include "ogr_geojson.h" - #include "ogrgeojsonreader.h" --#include // JSON-C -+#include // JSON-C - - #if (!defined(JSON_C_VERSION_NUM)) || (JSON_C_VERSION_NUM < JSON_C_VER_013) - #include - #endif - --#include -+#include - #include - #include - ---- a/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp -@@ -30,5 +30,5 @@ - #include "ogrgeojsonutils.h" - #include "ogr_geojson.h" --#include // JSON-C -+#include // JSON-C - #include - ---- a/port/cpl_json_header.h -+++ b/port/cpl_json_header.h -@@ -33,7 +33,7 @@ - #pragma GCC system_header - #endif - --#include -+#include - - #undef json_object_object_foreachC - #define json_object_object_foreachC(obj,iter) \ diff --git a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-podofo.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-podofo.patch deleted file mode 100644 index aa86489f0296ba..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-podofo.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/frmts/pdf/pdfsdk_headers.h -+++ b/frmts/pdf/pdfsdk_headers.h -@@ -103,7 +103,7 @@ typedef unsigned char Guchar; - #undef GetObject - #endif - --#include "podofo.h" -+#include - #endif // HAVE_PODOFO - - #ifdef HAVE_PDFIUM diff --git a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-xerces-3.1.2.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-xerces-3.1.2.patch deleted file mode 100644 index 8b08760381794f..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-include-xerces-3.1.2.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/ogr/ogr_xerces_headers.h -+++ b/ogr/ogr_xerces_headers.h -@@ -33,9 +33,9 @@ - #pragma GCC system_header - #endif - --#include --#include --#include -+#include -+#include -+#include - - #ifdef XERCES_CPP_NAMESPACE_USE - XERCES_CPP_NAMESPACE_USE ---- a/ogr/ogrsf_frmts/gml/xercesc_headers.h -+++ b/ogr/ogrsf_frmts/gml/xercesc_headers.h -@@ -33,13 +33,13 @@ - #pragma GCC system_header - #endif - --#include --#include --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #ifdef XERCES_CPP_NAMESPACE_USE - XERCES_CPP_NAMESPACE_USE ---- a/ogr/ogrsf_frmts/ili/xercesc_headers.h -+++ b/ogr/ogrsf_frmts/ili/xercesc_headers.h -@@ -33,14 +33,14 @@ - #pragma GCC system_header - #endif - --#include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #ifdef XERCES_CPP_NAMESPACE_USE - XERCES_CPP_NAMESPACE_USE diff --git a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-nmake-common.patch b/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-nmake-common.patch deleted file mode 100644 index c0201f8dc9cd8c..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.1.x/fix-nmake-common.patch +++ /dev/null @@ -1,165 +0,0 @@ ---- a/alg/makefile.vc -+++ b/alg/makefile.vc -@@ -14,7 +14,7 @@ EXTRAFLAGS = -I../frmts/vrt -I../ogr/ogrsf_frmts $(GEOS_CFLAGS) $(PROJ_FLAGS) $( - EXTRAFLAGS = $(EXTRAFLAGS) -DINTERNAL_QHULL - !ELSE - !IF "$(QHULL_SETTING)" == "EXTERNAL" --EXTRAFLAGS = $(EXTRAFLAGS) -DEXTERNAL_QHULL $(QHULL_INC) -+EXTRAFLAGS = $(EXTRAFLAGS) -DEXTERNAL_QHULL -DQHULL_INCLUDE_SUBDIR_IS_LIBQHULL=1 $(QHULL_INC) - !ENDIF - !ENDIF - !ENDIF ---- a/apps/makefile.vc -+++ b/apps/makefile.vc -@@ -8,6 +8,9 @@ EXTRAFLAGS = -I..\frmts\vrt -I..\ogr\ogrsf_frmts\geojson\libjson -I..\ogr\ogrsf_ - !INCLUDE ..\nmake.opt - - LIBS = $(GDALLIB) -+!IF "$(DLLBUILD)" != "1" -+LIBS = $(LIBS) $(EXTERNAL_LIBS) -+!ENDIF - - !IFDEF INCLUDE_OGR_FRMTS - OGR_PROGRAMS = gdal_contour.exe gdaltindex.exe gdal_rasterize.exe \ ---- a/frmts/gif/makefile.vc -+++ b/frmts/gif/makefile.vc -@@ -10,14 +10,8 @@ EXTRAFLAGS = -Igiflib - - default: $(OBJ) - xcopy /D /Y *.obj ..\o -- cd giflib -- $(MAKE) /f makefile.vc -- cd .. - - clean: - -del *.obj -- cd giflib -- $(MAKE) /f makefile.vc clean -- cd .. - - ---- a/frmts/jpeg/makefile.vc -+++ b/frmts/jpeg/makefile.vc -@@ -29,12 +29,16 @@ default: $(EXTRA_DEP) $(OBJ) - - clean: - -del *.obj -+!IFNDEF JPEG_EXTERNAL_LIB - cd libjpeg - $(MAKE) /f makefile.vc clean - cd .. -+!ENDIF -+!IFDEF JPEG12_SUPPORTED - cd libjpeg12 - $(MAKE) /f makefile.vc clean - cd .. -+!ENDIF - - libjpeg12src: - cd libjpeg12 ---- a/frmts/kea/makefile.vc -+++ b/frmts/kea/makefile.vc -@@ -1,7 +1,7 @@ - - OBJ = keaband.obj keacopy.obj keadataset.obj keadriver.obj keamaskband.obj keaoverview.obj kearat.obj - --EXTRAFLAGS = $(KEA_CFLAGS) -DH5_BUILT_AS_DYNAMIC_LIB -+EXTRAFLAGS = $(KEA_CFLAGS) - - GDAL_ROOT = ..\.. - ---- a/frmts/makefile.vc -+++ b/frmts/makefile.vc -@@ -3,11 +3,11 @@ GDAL_ROOT = .. - - EXTRAFLAGS = -DFRMT_ceos -DFRMT_aigrid -DFRMT_elas -DFRMT_hfa -DFRMT_gtiff\ - -DFRMT_sdts -DFRMT_raw -DFRMT_gxf -DFRMT_ceos2 -DFRMT_png \ -- -DFRMT_dted -DFRMT_mem -DFRMT_jdem -DFRMT_gif \ -+ -DFRMT_dted -DFRMT_mem -DFRMT_jdem \ - -DFRMT_envisat -DFRMT_aaigrid -DFRMT_usgsdem -DFRMT_l1b \ - -DFRMT_fit -DFRMT_vrt -DFRMT_xpm -DFRMT_bmp -DFRMT_rmf \ -- -DFRMT_nitf -DFRMT_pcidsk -DFRMT_airsar -DFRMT_rs2 \ -- -DFRMT_ilwis -DFRMT_msgn -DFRMT_rik -DFRMT_pcraster \ -+ -DFRMT_nitf -DFRMT_airsar -DFRMT_rs2 \ -+ -DFRMT_ilwis -DFRMT_msgn -DFRMT_rik \ - -DFRMT_leveller -DFRMT_sgi -DFRMT_srtmhgt -DFRMT_idrisi \ - -DFRMT_jaxapalsar -DFRMT_ers -DFRMT_ingr -DFRMT_dimap \ - -DFRMT_gff -DFRMT_terragen -DFRMT_gsg -DFRMT_cosar -DFRMT_pds \ -@@ -32,6 +32,22 @@ PLUGINDIRLIST = $(PLUGINFLAGS:-DFRMT_=) - EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_postgisraster - !ENDIF - -+!IFDEF GIF_SETTING -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_gif -+!ENDIF -+ -+!IFDEF PCIDSK_SETTING -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_pcidsk -+!ENDIF -+ -+!IFDEF PCRASTER_SETTING -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_pcraster -+!ENDIF -+ -+!IFDEF EXR_INC -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_exr -+!ENDIF -+ - !IFDEF JPEG_SUPPORTED - EXTRAFLAGS = -DFRMT_jpeg $(EXTRAFLAGS) - !ENDIF ---- a/frmts/pcidsk/makefile.vc -+++ b/frmts/pcidsk/makefile.vc -@@ -14,7 +14,11 @@ OBJ = pcidskdataset2.obj ogrpcidsklayer.obj vsi_pcidsk_io.obj gdal_edb.obj - !ENDIF - - !IF "$(PCIDSK_SETTING)" == "INTERNAL" -+!IFDEF JPEG_SUPPORTED - PCIDSKFLAGS = -Isdk -DPCIDSK_INTERNAL -DHAVE_LIBJPEG -+!ELSE -+PCIDSKFLAGS = -Isdk -DPCIDSK_INTERNAL -+!ENDIF - - OBJ = pcidskdataset2.obj ogrpcidsklayer.obj vsi_pcidsk_io.obj gdal_edb.obj \ - sdk\channel\cbandinterleavedchannel.obj \ -@@ -57,11 +61,13 @@ OBJ = pcidskdataset2.obj ogrpcidsklayer.obj vsi_pcidsk_io.obj gdal_edb.obj \ - - !ENDIF - -+!IFDEF JPEG_SUPPORTED - !IFDEF JPEG_EXTERNAL_LIB - JPEGFLAGS = -I$(JPEGDIR) - !ELSE - JPEGFLAGS = -I..\jpeg\libjpeg - !ENDIF -+!ENDIF - - .cpp.obj: - $(CC) $(CFLAGS) $(PCIDSKFLAGS) $(JPEGFLAGS) /c $*.cpp /Fo$*.obj ---- a/makefile.vc -+++ b/makefile.vc -@@ -84,7 +84,7 @@ staticlib: $(LIB_DEPENDS) - call <= 4.0) -- AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,) -+ AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,$LIBS) - - fi - -@@ -1333,23 +1337,11 @@ AC_ARG_WITH(curl, - dnl Clear some cache variables - unset ac_cv_path_LIBCURL - --if test "`basename xx/$with_curl`" = "curl-config" ; then -- LIBCURL_CONFIG="$with_curl" --elif test "$with_curl" = "no" ; then -- LIBCURL_CONFIG=no -+PKG_PROG_PKG_CONFIG([0.21]) -+if test "$with_curl" = "yes" ; then -+ PKG_CHECK_MODULES([CURL], [libcurl], [CURL_SETTING=yes], [AC_MSG_ERROR([libcurl not found...])]) - else -- AC_PATH_PROG(LIBCURL_CONFIG, curl-config, no) --fi -- --if test "$LIBCURL_CONFIG" != "no" ; then -- -- CURL_VERNUM=`$LIBCURL_CONFIG --vernum` -- CURL_VER=`$LIBCURL_CONFIG --version | awk '{print $2}'` -- -- AC_MSG_RESULT([ found libcurl version $CURL_VER]) -- -- AC_CHECK_LIB(curl,curl_global_init,CURL_SETTING=yes,CURL_SETTING=no,`$LIBCURL_CONFIG --libs`) -- -+ CURL_SETTING=no - fi - - AC_SUBST(CURL_SETTING,$CURL_SETTING) -@@ -1361,8 +1353,11 @@ dnl Check for SQLite - dnl Proj depends on it so it must appear before. - dnl --------------------------------------------------------------------------- - --SQLITE3_REQ_VERSION="3.0.0" --AX_LIB_SQLITE3($SQLITE3_REQ_VERSION) -+HAVE_SQLITE3=no -+AC_ARG_WITH(sqlite3, AS_HELP_STRING([--with-sqlite3[=ARG]], [use SQLite 3 library (ARG=yes or no)]),,) -+if test x"$with_sqlite3" = x"yes" ; then -+ PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.0.0], [HAVE_SQLITE3=yes], [AC_MSG_ERROR([sqlite3 not found...])]) -+fi - - if test "$HAVE_SQLITE3" = "yes"; then - LIBS="$SQLITE3_LDFLAGS $LIBS" -@@ -1393,11 +1388,7 @@ if test "x$with_proj" = "xno" ; then - else - - if test "x$with_proj" = "xyes" -o "x$with_proj" = "x"; then -- ORIG_LIBS="$LIBS" -- LIBS="-lproj $with_proj_extra_lib_for_test $ORIG_LIBS" -- AC_LANG_PUSH([C++]) -- AC_CHECK_LIB(proj,proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,) -- AC_LANG_POP([C++]) -+ PROJ_FOUND=yes - if test "$PROJ_FOUND" = "no"; then - AC_LANG_PUSH([C++]) - AC_CHECK_LIB(proj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,) -@@ -1820,8 +1811,8 @@ fi - - if test "$CURL_SETTING" = "yes" ; then - -- CURL_INC=`$LIBCURL_CONFIG --cflags` -- CURL_LIB=`$LIBCURL_CONFIG --libs` -+ CURL_INC="$CURL_CFLAGS" -+ CURL_LIB="$CURL_LIBS" - m4_foreach_w([frmt],CURL_FORMATS,[ - driver_enabled=m4_join([_],[$INTERNAL_FORMAT],frmt,[ENABLED]) - if test "x$driver_enabled" = "xyes"; then -@@ -2153,7 +2144,6 @@ else - - DDS_SETTING=yes - CRUNCHDIR="$with_dds" -- LIBS="-L$with_dds/lib/ -lcrunch $LIBS" - echo "using libcrunch from $with_dds." - - fi -@@ -2304,7 +2294,6 @@ else - - dnl We now require libgeotiff 1.5.0 - dnl first check if $with_geotiff/lib has the library: -- AC_CHECK_LIB(geotiff,GTIFAttachPROJContext,GEOTIFF_SETTING=external,GEOTIFF_SETTING=not_found,-L$with_geotiff/lib) - - if test $GEOTIFF_SETTING = "external" ; then - LIBS="-L$with_geotiff/lib -lgeotiff $LIBS" -@@ -2872,6 +2861,10 @@ if test x"$with_hdf4" = x"no" ; then - - echo "hdf4 support disabled." - -+elif test x"$with_hdf4" = x"yes" ; then -+ PKG_CHECK_MODULES([HDF4], [hdf], [HAVE_HDF4=yes], [AC_MSG_ERROR([hdf4 not found...])]) -+ PKG_CHECK_MODULES([HDF4], [hdf >= 4.2.5], [HDF4_HAS_MAXOPENFILES=yes], [HDF4_HAS_MAXOPENFILES=no]) -+ HDF4_INCLUDE="$HDF4_CFLAGS" - else - - if test x"$with_hdf4" = x"yes" -o x"$with_hdf4" = x"" ; then -@@ -3002,7 +2995,6 @@ elif test "$with_hdf5" = "yes" -o "$with_hdf5" = "" ; then - # Test that the package found is for the right architecture - saved_LIBS="$LIBS" - LIBS="$HDF5_LIBS" -- AC_CHECK_LIB(hdf5,H5Fopen, [HAVE_HDF5=yes], [HAVE_HDF5=no]) - LIBS="$saved_LIBS" - - if test "$HAVE_HDF5" = "yes"; then -@@ -3071,21 +3063,21 @@ KEA_CONFIG=no - - AC_ARG_WITH(kea,[ --with-kea[=ARG] Include kealib (ARG=path to kea-config) [[default=yes]]],,) - -+AC_MSG_CHECKING([for kea]) - if test "$with_kea" = "yes" -o "x$with_kea" = "x" ; then -- AC_PATH_PROG(KEA_CONFIG, kea-config, no) -+ HAVE_KEA=yes -+ AC_MSG_RESULT([yes]) - else -- KEA_CONFIG=$with_kea -+ HAVE_KEA=no -+ AC_MSG_RESULT([no]) - fi - --AC_MSG_CHECKING([for kea]) - - if test "$KEA_CONFIG" = "no" ; then - -- HAVE_KEA=no - KEA_LIB= - KEA_INC= - -- AC_MSG_RESULT([no]) - - else - if test -d $KEA_CONFIG ; then -@@ -3937,18 +3929,15 @@ MYSQL_CONFIG=no - AC_ARG_WITH(mysql,[ --with-mysql[=ARG] Include MySQL (ARG=path to mysql_config) [[default=no]]],,) - - if test "$with_mysql" = "yes" ; then -- AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no) -+ HAVE_MYSQL=yes - else -- if test "x$with_mysql" != "x" ; then -- MYSQL_CONFIG=$with_mysql -- fi -+ HAVE_MYSQL=no - fi - - AC_MSG_CHECKING([for MySQL]) - - if test "$MYSQL_CONFIG" = "no" ; then - -- HAVE_MYSQL=no - MYSQL_LIB= - MYSQL_INC= - -@@ -4042,8 +4031,11 @@ dnl Check for Expat configuration. - dnl --------------------------------------------------------------------------- - - dnl Expat 1.95.0 released in 2000-09-28 --EXPAT_REQ_VERSION="1.95.0" --AX_LIB_EXPAT($EXPAT_REQ_VERSION) -+# AX_LIB_EXPAT is too fragile, it doesn't properly handle debug expat on Windows -+HAVE_EXPAT=no -+AC_ARG_WITH([expat], AS_HELP_STRING([--with-expat[=ARG]], [use Expat library (ARG=yes or no)]),,) -+if test x"$with_expat" = x"yes" ; then -+PKG_CHECK_MODULES([EXPAT], [expat >= 1.95.0], [HAVE_EXPAT=yes], [AC_MSG_ERROR([expat not found...])]) - - if test "$HAVE_EXPAT" = "yes"; then - LIBS="$EXPAT_LDFLAGS $LIBS" -@@ -4056,6 +4048,7 @@ m4_foreach_w([frmt],EXPAT_DRIVERS,[ - fi - ]) - -+fi - fi - - AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT) -@@ -4287,7 +4280,6 @@ if test "x$with_xml2" = "xyes" -o "x$with_xml2" = "x" ; then - if test "${HAVE_LIBXML2}" = "yes"; then - SAVED_LIBS="${LIBS}" - LIBS="${LIBXML2_LIBS}" -- AC_CHECK_LIB(xml2,xmlParseDoc,HAVE_LIBXML2=yes,HAVE_LIBXML2=no) - LIBS="${SAVED_LIBS}" - fi - -@@ -4567,8 +4559,13 @@ dnl --------------------------------------------------------------------------- - dnl Check if geos library is available. - dnl --------------------------------------------------------------------------- - --GEOS_INIT(3.1.0) -+AC_ARG_WITH(geos, AS_HELP_STRING([--with-geos[=ARG]], [Include GEOS support (ARG=yes or no)]),,) - HAVE_GEOS_RESULT="no" -+HAVE_GEOS=no -+if test x"$with_geos" = x"no" ; then -+ AC_MSG_RESULT([GEOS support disabled]) -+else -+ PKG_CHECK_MODULES([GEOS], [geos >= 3.1.0], [HAVE_GEOS=yes], [AC_MSG_ERROR([geos not found...])]) - if test "${HAVE_GEOS}" = "yes" ; then - - AC_MSG_NOTICE([Using C API from GEOS $GEOS_VERSION]) -@@ -4577,6 +4574,8 @@ if test "${HAVE_GEOS}" = "yes" ; then - LIBS="${GEOS_LIBS} ${LIBS}" - HAVE_GEOS_RESULT="yes" - fi -+fi -+AC_SUBST(HAVE_GEOS, $HAVE_GEOS) - - dnl --------------------------------------------------------------------------- - dnl Check if SFCGAL library is available. -@@ -4611,20 +4610,18 @@ elif test "$with_qhull" = "yes" -o "$with_qhull" = "" ; then - # qhull/qhull.h - AC_CHECK_HEADERS([qhull/libqhull.h]) - if test "$ac_cv_header_qhull_libqhull_h" = "yes"; then -- AC_CHECK_LIB(qhull,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,) -+ QHULL_SETTING=yes - if test "$QHULL_SETTING" = "yes"; then - QHULL_SETTING=external - QHULL_INCLUDE_SUBDIR_IS_LIBQHULL=0 -- LIBS="-lqhull $LIBS" - fi - fi - AC_CHECK_HEADERS([libqhull/libqhull.h]) - if test "$ac_cv_header_libqhull_libqhull_h" = "yes"; then -- AC_CHECK_LIB(qhull,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,) -+ QHULL_SETTING=yes - if test "$QHULL_SETTING" = "yes"; then - QHULL_SETTING=external - QHULL_INCLUDE_SUBDIR_IS_LIBQHULL=1 -- LIBS="-lqhull $LIBS" - fi - fi - -@@ -4711,7 +4708,9 @@ AC_MSG_CHECKING([for FreeXL support]) - HAVE_FREEXL=no - FREEXL_INCLUDE= - --if test "$with_freexl" = "" -o "$with_freexl" = "yes" ; then -+if test "$with_freexl" = "yes"; then -+ PKG_CHECK_MODULES([FREEXL], [freexl >= 1.0.0], [HAVE_FREEXL=yes], [AC_MSG_ERROR([freexl not found...])]) -+elif test "$with_freexl" = ""; then - AC_CHECK_HEADERS(freexl.h) - AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-lfreexl",FREEXL_LIBS=missing) - -@@ -4817,8 +4816,7 @@ if test "$with_libjson_c" = "external" -o "$with_libjson_c" = "" -o "$with_libjs - elif test "$with_libjson_c" = "internal" ; then - LIBJSONC_SETTING=internal - elif test "$with_libjson_c" != "no"; then -- LIBS="-L$with_libjson_c/lib $LIBS" -- AC_CHECK_LIB(json-c,json_object_set_serializer,LIBJSONC_SETTING=external,LIBJSONC_SETTING=internal,-L$with_libjson_c/lib) -+ LIBJSONC_SETTING=external - else - AC_MSG_ERROR([libjson-c (internal or external) is required]) - fi -@@ -5928,7 +5926,6 @@ else - # Test that the package found is for the right architecture - saved_LIBS="$LIBS" - LIBS="$EXR_LIBS" -- AC_CHECK_LIB(IlmImf,ImfTiledInputReadTile, [HAVE_EXR=yes], [HAVE_EXR=no]) - LIBS="$saved_LIBS" - - if test "$HAVE_EXR" = "yes"; then diff --git a/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-jsonc.patch b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-jsonc.patch deleted file mode 100644 index e88043df4189f5..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-jsonc.patch +++ /dev/null @@ -1,104 +0,0 @@ ---- a/gcore/gdal_rat.cpp -+++ b/gcore/gdal_rat.cpp -@@ -50,7 +50,7 @@ - #pragma clang diagnostic ignored "-Wunknown-pragmas" - #pragma clang diagnostic ignored "-Wdocumentation" - #endif --#include "json.h" -+#include - #ifdef __clang__ - #pragma clang diagnostic pop - #endif ---- a/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp -@@ -37,7 +37,7 @@ - - #include "cpl_conv.h" - #include "cpl_error.h" --#include "json.h" -+#include - // #include "json_object.h" - // #include "json_tokener.h" - #include "ogr_api.h" ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsondatasource.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsondatasource.cpp -@@ -41,7 +41,7 @@ - #include "cpl_string.h" - #include "cpl_vsi.h" - #include "cpl_vsi_error.h" --#include "json.h" -+#include - // #include "json_object.h" - #include "gdal_utils.h" - #include "gdal.h" ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonlayer.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonlayer.cpp -@@ -37,7 +37,7 @@ - # endif - #endif // !DEBUG_VERBOSE - --#include -+#include - - #if !DEBUG_JSON - # ifdef __clang ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp -@@ -32,7 +32,7 @@ - #include "ogrgeojsonreader.h" - #include "ogrgeojsonutils.h" - #include "ogr_geojson.h" --#include // JSON-C -+#include - - #if (!defined(JSON_C_VERSION_NUM)) || (JSON_C_VERSION_NUM < JSON_C_VER_013) - #include // just for sizeof(struct json_object) ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonutils.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonutils.cpp -@@ -32,7 +32,7 @@ - #include - #include - #include --#include // JSON-C -+#include - - #include - #include ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp -@@ -33,13 +33,13 @@ - #include "ogrgeojsonutils.h" - #include "ogr_geojson.h" - #include "ogrgeojsonreader.h" --#include // JSON-C -+#include - - #if (!defined(JSON_C_VERSION_NUM)) || (JSON_C_VERSION_NUM < JSON_C_VER_013) - #include - #endif - --#include -+#include - #include - #include - ---- a/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp -@@ -30,5 +30,5 @@ - #include "ogrgeojsonutils.h" - #include "ogr_geojson.h" --#include // JSON-C -+#include - #include - ---- a/port/cpl_json_header.h -+++ b/port/cpl_json_header.h -@@ -33,7 +33,7 @@ - #pragma GCC system_header - #endif - --#include -+#include - - #undef json_object_object_foreachC - #define json_object_object_foreachC(obj,iter) \ diff --git a/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-podofo.patch b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-podofo.patch deleted file mode 100644 index aa86489f0296ba..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-podofo.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/frmts/pdf/pdfsdk_headers.h -+++ b/frmts/pdf/pdfsdk_headers.h -@@ -103,7 +103,7 @@ typedef unsigned char Guchar; - #undef GetObject - #endif - --#include "podofo.h" -+#include - #endif // HAVE_PODOFO - - #ifdef HAVE_PDFIUM diff --git a/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-xerces.patch b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-xerces.patch deleted file mode 100644 index 8b08760381794f..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-include-xerces.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/ogr/ogr_xerces_headers.h -+++ b/ogr/ogr_xerces_headers.h -@@ -33,9 +33,9 @@ - #pragma GCC system_header - #endif - --#include --#include --#include -+#include -+#include -+#include - - #ifdef XERCES_CPP_NAMESPACE_USE - XERCES_CPP_NAMESPACE_USE ---- a/ogr/ogrsf_frmts/gml/xercesc_headers.h -+++ b/ogr/ogrsf_frmts/gml/xercesc_headers.h -@@ -33,13 +33,13 @@ - #pragma GCC system_header - #endif - --#include --#include --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #ifdef XERCES_CPP_NAMESPACE_USE - XERCES_CPP_NAMESPACE_USE ---- a/ogr/ogrsf_frmts/ili/xercesc_headers.h -+++ b/ogr/ogrsf_frmts/ili/xercesc_headers.h -@@ -33,14 +33,14 @@ - #pragma GCC system_header - #endif - --#include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #ifdef XERCES_CPP_NAMESPACE_USE - XERCES_CPP_NAMESPACE_USE diff --git a/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-nmake.patch b/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-nmake.patch deleted file mode 100644 index e23b85d35a16a1..00000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.2.x/fix-nmake.patch +++ /dev/null @@ -1,179 +0,0 @@ ---- a/alg/makefile.vc -+++ b/alg/makefile.vc -@@ -14,7 +14,7 @@ EXTRAFLAGS = -I../frmts/vrt -I../ogr/ogrsf_frmts $(GEOS_CFLAGS) $(PROJ_FLAGS) $( - EXTRAFLAGS = $(EXTRAFLAGS) -DINTERNAL_QHULL - !ELSE - !IF "$(QHULL_SETTING)" == "EXTERNAL" --EXTRAFLAGS = $(EXTRAFLAGS) -DEXTERNAL_QHULL $(QHULL_INC) -+EXTRAFLAGS = $(EXTRAFLAGS) -DEXTERNAL_QHULL -DQHULL_INCLUDE_SUBDIR_IS_LIBQHULL=1 $(QHULL_INC) - !ENDIF - !ENDIF - !ENDIF ---- a/apps/makefile.vc -+++ b/apps/makefile.vc -@@ -8,6 +8,9 @@ EXTRAFLAGS = -I..\frmts\vrt -I..\ogr\ogrsf_frmts\geojson\libjson -I..\ogr\ogrsf_ - !INCLUDE ..\nmake.opt - - LIBS = $(GDALLIB) -+!IF "$(DLLBUILD)" != "1" -+LIBS = $(LIBS) $(EXTERNAL_LIBS) -+!ENDIF - - !IFDEF INCLUDE_OGR_FRMTS - OGR_PROGRAMS = gdal_contour.exe gdaltindex.exe gdal_rasterize.exe \ ---- a/frmts/gif/makefile.vc -+++ b/frmts/gif/makefile.vc -@@ -10,14 +10,8 @@ EXTRAFLAGS = -Igiflib - - default: $(OBJ) - xcopy /D /Y *.obj ..\o -- cd giflib -- $(MAKE) /f makefile.vc -- cd .. - - clean: - -del *.obj -- cd giflib -- $(MAKE) /f makefile.vc clean -- cd .. - - ---- a/frmts/jpeg/makefile.vc -+++ b/frmts/jpeg/makefile.vc -@@ -29,12 +29,16 @@ default: $(EXTRA_DEP) $(OBJ) - - clean: - -del *.obj -+!IFNDEF JPEG_EXTERNAL_LIB - cd libjpeg - $(MAKE) /f makefile.vc clean - cd .. -+!ENDIF -+!IFDEF JPEG12_SUPPORTED - cd libjpeg12 - $(MAKE) /f makefile.vc clean - cd .. -+!ENDIF - - libjpeg12src: - cd libjpeg12 ---- a/frmts/kea/makefile.vc -+++ b/frmts/kea/makefile.vc -@@ -1,7 +1,7 @@ - - OBJ = keaband.obj keacopy.obj keadataset.obj keadriver.obj keamaskband.obj keaoverview.obj kearat.obj - --EXTRAFLAGS = $(KEA_CFLAGS) -DH5_BUILT_AS_DYNAMIC_LIB -+EXTRAFLAGS = $(KEA_CFLAGS) - - GDAL_ROOT = ..\.. - ---- a/frmts/makefile.vc -+++ b/frmts/makefile.vc -@@ -3,11 +3,11 @@ GDAL_ROOT = .. - - EXTRAFLAGS = -DFRMT_ceos -DFRMT_aigrid -DFRMT_elas -DFRMT_hfa -DFRMT_gtiff\ - -DFRMT_sdts -DFRMT_raw -DFRMT_gxf -DFRMT_ceos2 -DFRMT_png \ -- -DFRMT_dted -DFRMT_mem -DFRMT_jdem -DFRMT_gif -DFRMT_esric \ -+ -DFRMT_dted -DFRMT_mem -DFRMT_jdem -DFRMT_esric \ - -DFRMT_envisat -DFRMT_aaigrid -DFRMT_usgsdem -DFRMT_l1b \ - -DFRMT_fit -DFRMT_vrt -DFRMT_xpm -DFRMT_bmp -DFRMT_rmf \ -- -DFRMT_nitf -DFRMT_pcidsk -DFRMT_airsar -DFRMT_rs2 \ -- -DFRMT_ilwis -DFRMT_msgn -DFRMT_rik -DFRMT_pcraster \ -+ -DFRMT_nitf -DFRMT_airsar -DFRMT_rs2 \ -+ -DFRMT_ilwis -DFRMT_msgn -DFRMT_rik \ - -DFRMT_leveller -DFRMT_sgi -DFRMT_srtmhgt -DFRMT_idrisi \ - -DFRMT_jaxapalsar -DFRMT_ers -DFRMT_ingr -DFRMT_dimap \ - -DFRMT_gff -DFRMT_terragen -DFRMT_gsg -DFRMT_cosar -DFRMT_pds \ -@@ -32,6 +32,22 @@ PLUGINDIRLIST = $(PLUGINFLAGS:-DFRMT_=) - EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_postgisraster - !ENDIF - -+!IFDEF GIF_SETTING -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_gif -+!ENDIF -+ -+!IFDEF PCIDSK_SETTING -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_pcidsk -+!ENDIF -+ -+!IFDEF PCRASTER_SETTING -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_pcraster -+!ENDIF -+ -+!IFDEF EXR_INC -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_exr -+!ENDIF -+ - !IFDEF JPEG_SUPPORTED - EXTRAFLAGS = -DFRMT_jpeg $(EXTRAFLAGS) - !ENDIF ---- a/frmts/pcidsk/makefile.vc -+++ b/frmts/pcidsk/makefile.vc -@@ -14,7 +14,11 @@ OBJ = pcidskdataset2.obj ogrpcidsklayer.obj vsi_pcidsk_io.obj gdal_edb.obj - !ENDIF - - !IF "$(PCIDSK_SETTING)" == "INTERNAL" -+!IFDEF JPEG_SUPPORTED - PCIDSKFLAGS = -Isdk -DPCIDSK_INTERNAL -DHAVE_LIBJPEG -+!ELSE -+PCIDSKFLAGS = -Isdk -DPCIDSK_INTERNAL -+!ENDIF - - OBJ = pcidskdataset2.obj ogrpcidsklayer.obj vsi_pcidsk_io.obj gdal_edb.obj \ - sdk\channel\cbandinterleavedchannel.obj \ -@@ -57,11 +61,13 @@ OBJ = pcidskdataset2.obj ogrpcidsklayer.obj vsi_pcidsk_io.obj gdal_edb.obj \ - - !ENDIF - -+!IFDEF JPEG_SUPPORTED - !IFDEF JPEG_EXTERNAL_LIB - JPEGFLAGS = -I$(JPEGDIR) - !ELSE - JPEGFLAGS = -I..\jpeg\libjpeg - !ENDIF -+!ENDIF - - .cpp.obj: - $(CC) $(CFLAGS) $(PCIDSKFLAGS) $(JPEGFLAGS) /c $*.cpp /Fo$*.obj ---- a/makefile.vc -+++ b/makefile.vc -@@ -84,7 +84,7 @@ staticlib: $(LIB_DEPENDS) - call <= 2.2.0" patch_type: "portability" + patch_source: "https://github.com/malaterre/GDCM/pull/157" - patch_file: "patches/0002-3.0.20-openjpeg.patch" patch_description: "fix variable names for openjpeg" patch_type: "conan" @@ -32,9 +33,10 @@ patches: patch_description: "fix find_package for libuuid" patch_type: "conan" "3.0.20": - - patch_file: "patches/0001-charls-linking.patch" - patch_description: "fix symbol export for gdcmcharls" + - patch_file: "patches/0001-3.0.20-find-charls.patch" + patch_description: "allow using charls >= 2.2.0" patch_type: "portability" + patch_source: "https://github.com/malaterre/GDCM/pull/157" - patch_file: "patches/0002-3.0.20-openjpeg.patch" patch_description: "fix variable names for openjpeg" patch_type: "conan" @@ -54,9 +56,10 @@ patches: patch_description: "fix find_package for libuuid" patch_type: "conan" "3.0.9": - - patch_file: "patches/0001-charls-linking.patch" - patch_description: "fix symbol export for gdcmcharls" + - patch_file: "patches/0001-3.0.9-find-charls.patch" + patch_description: "allow using charls >= 2.2.0" patch_type: "portability" + patch_source: "https://github.com/malaterre/GDCM/pull/157" - patch_file: "patches/0002-3.0.9-openjpeg.patch" patch_description: "fix variable names for openjpeg" patch_type: "conan" diff --git a/recipes/gdcm/all/conanfile.py b/recipes/gdcm/all/conanfile.py index d7959e0134184e..d65646a1f95502 100644 --- a/recipes/gdcm/all/conanfile.py +++ b/recipes/gdcm/all/conanfile.py @@ -39,7 +39,7 @@ class GDCMConan(ConanFile): @property def _min_cppstd(self): - return 11 + return 14 def export_sources(self): export_conandata_patches(self) @@ -56,18 +56,19 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): + self.requires("charls/2.4.2") self.requires("expat/2.5.0") self.requires("openjpeg/2.5.0") if self.options.with_zlibng: - self.requires("zlib-ng/2.0.7") + self.requires("zlib-ng/2.1.3") else: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.settings.os != "Windows": - self.requires("libuuid/1.0.3") + self.requires("util-linux-libuuid/2.39") if Version(self.version) >= Version("3.0.20"): self.requires("libiconv/1.17") if self.options.with_json: - self.requires("json-c/0.16") + self.requires("json-c/0.17") if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") @@ -89,6 +90,7 @@ def generate(self): tc.variables["GDCM_BUILD_DOCBOOK_MANPAGES"] = False tc.variables["GDCM_BUILD_SHARED_LIBS"] = bool(self.options.shared) # FIXME: unvendor deps https://github.com/conan-io/conan-center-index/pull/5705#discussion_r647224146 + tc.variables["GDCM_USE_SYSTEM_CHARLS"] = True tc.variables["GDCM_USE_SYSTEM_EXPAT"] = True tc.variables["GDCM_USE_SYSTEM_JSON"] = self.options.with_json tc.variables["GDCM_USE_SYSTEM_OPENJPEG"] = True @@ -98,6 +100,13 @@ def generate(self): if not valid_min_cppstd(self, self._min_cppstd): tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + + # https://sourceforge.net/p/gdcm/bugs/548/ + tc.preprocessor_definitions["CHARLS_NO_DEPRECATED_WARNING"] = "1" + + #gdcm currently uses functionality that is deprecated since OpenSSL 1.1.0 + tc.preprocessor_definitions["OPENSSL_API_COMPAT"] = "0x10000000L" + tc.generate() deps = CMakeDeps(self) deps.generate() @@ -194,8 +203,7 @@ def _gdcm_build_modules(self): @property def _gdcm_libraries(self): - gdcm_libs = ["gdcmcharls", - "gdcmCommon", + gdcm_libs = ["gdcmCommon", "gdcmDICT", "gdcmDSED", "gdcmIOD", @@ -237,17 +245,17 @@ def zlib(): self.cpp_info.components["gdcmDSED"].requires.extend(["gdcmCommon", zlib()]) self.cpp_info.components["gdcmIOD"].requires.extend(["gdcmDSED", "gdcmCommon", "expat::expat"]) - self.cpp_info.components["gdcmMSFF"].requires.extend(["gdcmIOD", "gdcmDSED", "gdcmDICT", "openjpeg::openjpeg"]) + self.cpp_info.components["gdcmMSFF"].requires.extend(["gdcmIOD", "gdcmDSED", "gdcmDICT", "charls::charls", "openjpeg::openjpeg"]) if self.options.with_json: self.cpp_info.components["gdcmMSFF"].requires.append("json-c::json-c") if self.settings.os != "Windows": - self.cpp_info.components["gdcmMSFF"].requires.append("libuuid::libuuid") + self.cpp_info.components["gdcmMSFF"].requires.append("util-linux-libuuid::util-linux-libuuid") if Version(self.version) >= Version("3.0.20"): self.cpp_info.components["gdcmMSFF"].requires.append("libiconv::libiconv") if not self.options.shared: self.cpp_info.components["gdcmDICT"].requires.extend(["gdcmDSED", "gdcmIOD"]) self.cpp_info.components["gdcmMEXD"].requires.extend(["gdcmMSFF", "gdcmDICT", "gdcmDSED", "gdcmIOD", "socketxx"]) - self.cpp_info.components["gdcmMSFF"].requires.extend(["gdcmjpeg8", "gdcmjpeg12", "gdcmjpeg16", "gdcmcharls"]) + self.cpp_info.components["gdcmMSFF"].requires.extend(["gdcmjpeg8", "gdcmjpeg12", "gdcmjpeg16"]) if self.settings.os == "Windows": self.cpp_info.components["gdcmCommon"].system_libs = ["ws2_32", "crypt32"] diff --git a/recipes/gdcm/all/patches/0001-3.0.20-find-charls.patch b/recipes/gdcm/all/patches/0001-3.0.20-find-charls.patch new file mode 100644 index 00000000000000..c30995e540d0b3 --- /dev/null +++ b/recipes/gdcm/all/patches/0001-3.0.20-find-charls.patch @@ -0,0 +1,28 @@ +Allow using charls >= 2.2.0 +https://github.com/malaterre/GDCM/pull/157 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -352,8 +352,8 @@ else() + endif() + + if(GDCM_USE_SYSTEM_CHARLS) +- find_package(CharLS 2.0.0 REQUIRED) +- set(GDCM_CHARLS_LIBRARIES ${CHARLS_LIBRARIES}) ++ find_package(charls 2.2.0 REQUIRED) ++ set(GDCM_CHARLS_LIBRARIES charls) + else() + set(GDCM_CHARLS_LIBRARIES gdcmcharls) + endif() +--- a/Utilities/gdcm_charls.h ++++ b/Utilities/gdcm_charls.h +@@ -17,8 +17,8 @@ + /* Use the charls library configured for gdcm. */ + #include "gdcmTypes.h" + #ifdef GDCM_USE_SYSTEM_CHARLS +-// It is expected that version 2.0.0 is used +-# include ++// It is expected that version >= 2.2.0 is used ++# include + #else + #include "gdcmcharls/charls.h" + #endif diff --git a/recipes/gdcm/all/patches/0001-3.0.9-find-charls.patch b/recipes/gdcm/all/patches/0001-3.0.9-find-charls.patch new file mode 100644 index 00000000000000..c4dfe79c815248 --- /dev/null +++ b/recipes/gdcm/all/patches/0001-3.0.9-find-charls.patch @@ -0,0 +1,28 @@ +Allow using charls >= 2.2.0 +https://github.com/malaterre/GDCM/pull/157 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -356,8 +356,8 @@ else() + endif() + + if(GDCM_USE_SYSTEM_CHARLS) +- find_package(CharLS 2.0.0 REQUIRED) +- set(GDCM_CHARLS_LIBRARIES ${CHARLS_LIBRARIES}) ++ find_package(charls 2.2.0 REQUIRED) ++ set(GDCM_CHARLS_LIBRARIES charls) + else() + set(GDCM_CHARLS_LIBRARIES gdcmcharls) + endif() +--- a/Utilities/gdcm_charls.h ++++ b/Utilities/gdcm_charls.h +@@ -17,8 +17,8 @@ + /* Use the charls library configured for gdcm. */ + #include "gdcmTypes.h" + #ifdef GDCM_USE_SYSTEM_CHARLS +-// It is expected that version 2.0.0 is used +-# include ++// It is expected that version >= 2.2.0 is used ++# include + #else + #include "gdcmcharls/charls.h" + #endif diff --git a/recipes/gdcm/all/patches/0001-charls-linking.patch b/recipes/gdcm/all/patches/0001-charls-linking.patch deleted file mode 100644 index 57df8966f04baa..00000000000000 --- a/recipes/gdcm/all/patches/0001-charls-linking.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/Utilities/gdcmcharls/CMakeLists.txt -+++ b/Utilities/gdcmcharls/CMakeLists.txt -@@ -61,12 +61,10 @@ endif() - #option(charls_BUILD_SHARED_LIBS "Build CharLS with shared libraries." OFF) - #set(BUILD_SHARED_LIBS ${charls_BUILD_SHARED_LIBS}) - --if(WIN32) -- if(BUILD_SHARED_LIBS) -- add_definitions(-DCHARLS_DLL_BUILD) -- else() -- add_definitions(-DCHARLS_STATIC) -- endif() -+if(BUILD_SHARED_LIBS) -+ add_definitions(-DCHARLS_DLL_BUILD) -+else() -+ add_definitions(-DCHARLS_STATIC) - endif() - - add_library(${CHARLS_LIBRARY_NAME} ---- a/Utilities/gdcmcharls/charls.h -+++ b/Utilities/gdcmcharls/charls.h -@@ -13,12 +13,12 @@ - #define CHARLS_IMEXPORT(returntype) __declspec(dllexport) returntype __stdcall - #endif - --// Non-windows (static linking) --#if !defined(CHARLS_IMEXPORT) && !defined(_WIN32) --# define CHARLS_IMEXPORT(returntype) returntype -+// Non-windows (dynamic linking) -+#if !defined(WIN32) && (defined(CHARLS_DLL) || defined(CHARLS_DLL_BUILD)) -+#define CHARLS_IMEXPORT(returntype) __attribute__((visibility("default"))) returntype - #endif - --// Windows static linking -+// Static linking - #if !defined(CHARLS_IMEXPORT) && defined(CHARLS_STATIC) - # define CHARLS_IMEXPORT(returntype) returntype - #endif diff --git a/recipes/gdcm/all/test_package/CMakeLists.txt b/recipes/gdcm/all/test_package/CMakeLists.txt index 5465ea8e54b6d9..b8df0da5056db7 100644 --- a/recipes/gdcm/all/test_package/CMakeLists.txt +++ b/recipes/gdcm/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(GDCM REQUIRED CONFIG) diff --git a/recipes/gdcm/all/test_package/conanfile.py b/recipes/gdcm/all/test_package/conanfile.py index 1f94130dd62ec8..68791e0d3201c0 100644 --- a/recipes/gdcm/all/test_package/conanfile.py +++ b/recipes/gdcm/all/test_package/conanfile.py @@ -22,7 +22,7 @@ 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") input_file = os.path.join(self.source_folder, "DCMTK_JPEGExt_12Bits.dcm") test_dir = "test_dir" mkdir(self, test_dir) diff --git a/recipes/gdcm/all/test_v1_package/CMakeLists.txt b/recipes/gdcm/all/test_v1_package/CMakeLists.txt index 0d20897301b68b..b21cc49efde95c 100644 --- a/recipes/gdcm/all/test_v1_package/CMakeLists.txt +++ b/recipes/gdcm/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) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/gdk-pixbuf/all/conanfile.py b/recipes/gdk-pixbuf/all/conanfile.py index fe76b0dd2bad42..4f44d797427e77 100644 --- a/recipes/gdk-pixbuf/all/conanfile.py +++ b/recipes/gdk-pixbuf/all/conanfile.py @@ -12,13 +12,13 @@ import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.56.0 <2 || >=2.0.6" class GdkPixbufConan(ConanFile): name = "gdk-pixbuf" description = "toolkit for image loading and pixel buffer manipulation" - topics = ("gdk-pixbuf", "image") + topics = ("image") url = "https://github.com/conan-io/conan-center-index" homepage = "https://developer.gnome.org/gdk-pixbuf/" license = "LGPL-2.1-or-later" @@ -63,9 +63,9 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.76.0", transitive_headers=True, transitive_libs=True, run=can_run(self)) + self.requires("glib/2.77.0", transitive_headers=True, transitive_libs=True) if self.options.with_libpng: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_libtiff: self.requires("libtiff/4.4.0") if self.options.with_libjpeg == "libjpeg-turbo": @@ -93,8 +93,7 @@ def build_requirements(self): self.tool_requires("meson/1.0.0") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/1.9.3") - if not can_run(self): - self.tool_requires("glib/2.76.0") + self.tool_requires("glib/") if self.options.with_introspection: self.tool_requires("gobject-introspection/1.72.0") diff --git a/recipes/gegles-spdlog_setup/all/conanfile.py b/recipes/gegles-spdlog_setup/all/conanfile.py index 7d53c34d32dd28..fd9faf40ac95a5 100644 --- a/recipes/gegles-spdlog_setup/all/conanfile.py +++ b/recipes/gegles-spdlog_setup/all/conanfile.py @@ -40,7 +40,7 @@ def layout(self): def requirements(self): self.requires("cpptoml/0.1.1") self.requires("spdlog/1.12.0") - self.requires("fmt/10.0.0") + self.requires("fmt/10.1.1") def package_id(self): self.info.clear() diff --git a/recipes/geographiclib/all/conandata.yml b/recipes/geographiclib/all/conandata.yml index d77a331b2e16ab..1f35984a982498 100644 --- a/recipes/geographiclib/all/conandata.yml +++ b/recipes/geographiclib/all/conandata.yml @@ -1,16 +1,19 @@ sources: + "2.3": + url: "https://github.com/geographiclib/geographiclib/archive/refs/tags/v2.3.tar.gz" + sha256: "18131077061ef8be14064f073f6dba2897a138519733803af807f861a01976c1" "1.52": - url: "https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.52.tar.gz" - sha256: "5d4145cd16ebf51a2ff97c9244330a340787d131165cfd150e4b2840c0e8ac2b" + url: "https://github.com/geographiclib/geographiclib/archive/refs/tags/v1.52.tar.gz" + sha256: "f327ec3d16cc64d954c388b342893377dc56909fab267dbae8ea8bc170b32b2d" "1.51": - url: "https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.51.tar.gz" - sha256: "34370949617df5105bd6961e0b91581aef758dc455fe8629eb5858516022d310" - "1.50.1": - url: "https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.50.1.tar.gz" - sha256: "d1765009e068b8cc5e76957e5d6be45ce6cff08c4aad8e5995e84a28354385f1" + url: "https://github.com/geographiclib/geographiclib/archive/refs/tags/v1.51.tar.gz" + sha256: "9a2fe4fb69887ab7c625a40e5f1c20261bc80871670d729bea3119a2492e112c" + "1.50.2": + url: "https://github.com/geographiclib/geographiclib/archive/refs/tags/v1.50.2.tar.gz" + sha256: "6bdb960292b3197dc18bc3005ee76e4cdefbf025154d71fb42c986cb5ed1e4e7" patches: "1.52": - - patch_file: "patches/0002-cmake-minimum-required-1.52.patch" + - patch_file: "patches/0002-cmake-minimum-required-1.51.patch" patch_description: "Add cmake_minimum_required() to top CMakeLists" patch_type: "conan" patch_source: "https://github.com/geographiclib/geographiclib/commit/d9ca6c6ec0b721326b9a690eee259eac643b927f" @@ -19,8 +22,11 @@ patches: patch_description: "Add cmake_minimum_required() to top CMakeLists" patch_type: "conan" patch_source: "https://github.com/geographiclib/geographiclib/commit/d9ca6c6ec0b721326b9a690eee259eac643b927f" - "1.50.1": - - patch_file: "patches/0001-streamoff.patch" + - patch_file: "patches/0003-fix-rhumb.patch" + patch_description: "Fix Rhumb.hpp Clang compatibility" + patch_type: "portability" + patch_source: "https://github.com/geographiclib/geographiclib/commit/6c5767ba13a12710eab8b5ab7a3db331a1ed7161" + "1.50.2": - patch_file: "patches/0002-cmake-minimum-required-1.50.1.patch" patch_description: "Add cmake_minimum_required() to top CMakeLists" patch_type: "conan" diff --git a/recipes/geographiclib/all/conanfile.py b/recipes/geographiclib/all/conanfile.py index d3a9097b7417e7..0fb1787e608594 100644 --- a/recipes/geographiclib/all/conanfile.py +++ b/recipes/geographiclib/all/conanfile.py @@ -65,10 +65,7 @@ def validate(self): check_min_cppstd(self, 11) 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] + 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 loose_lt_semver(str(self.settings.compiler.version), minimum_version): @@ -103,8 +100,9 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - # it does not work on Windows but is not needed - replace_in_file(self, cmakelists, "add_subdirectory (js)", "") + if Version(self.version) < "2": + # it does not work on Windows but is not needed + replace_in_file(self, cmakelists, "add_subdirectory (js)", "") # Don't install system libs replace_in_file(self, cmakelists, "include (InstallRequiredSystemLibraries)", "") # Don't build tools if asked @@ -112,6 +110,9 @@ def _patch_sources(self): replace_in_file(self, cmakelists, "add_subdirectory (tools)", "") replace_in_file(self, os.path.join(self.source_folder, "cmake", "CMakeLists.txt"), "${TOOLS}", "") + # Disable -Werror + replace_in_file(self, cmakelists, "-Werror", "") + replace_in_file(self, cmakelists, "/WX", "") def build(self): self._patch_sources() diff --git a/recipes/geographiclib/all/patches/0001-streamoff.patch b/recipes/geographiclib/all/patches/0001-streamoff.patch deleted file mode 100644 index 203a1711939ec0..00000000000000 --- a/recipes/geographiclib/all/patches/0001-streamoff.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/src/SphericalEngine.cpp -+++ b/src/SphericalEngine.cpp -@@ -134,6 +134,8 @@ - #include - #include - -+#include -+ - #if defined(_MSC_VER) - // Squelch warnings about constant conditional expressions and potentially - // uninitialized local variables -@@ -409,22 +411,22 @@ namespace GeographicLib { - SphericalEngine::coeff::Csize(N0, M )) * sizeof(double); - if (N == N0) { - Utility::readarray(stream, C); -- if (skip) stream.seekg(std::ios::streamoff(skip), ios::cur); -+ if (skip) stream.seekg(streamoff(skip), ios::cur); - Utility::readarray(stream, S); -- if (skip) stream.seekg(std::ios::streamoff(skip), ios::cur); -+ if (skip) stream.seekg(streamoff(skip), ios::cur); - } else { - for (int m = 0, k = 0; m <= M; ++m) { - Utility::readarray(stream, &C[k], N + 1 - m); - stream.seekg((N0 - N) * sizeof(double), ios::cur); - k += N + 1 - m; - } -- if (skip) stream.seekg(std::ios::streamoff(skip), ios::cur); -+ if (skip) stream.seekg(streamoff(skip), ios::cur); - for (int m = 1, k = 0; m <= M; ++m) { - Utility::readarray(stream, &S[k], N + 1 - m); - stream.seekg((N0 - N) * sizeof(double), ios::cur); - k += N + 1 - m; - } -- if (skip) stream.seekg(std::ios::streamoff(skip), ios::cur); -+ if (skip) stream.seekg(streamoff(skip), ios::cur); - } - return; - } diff --git a/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.52.patch b/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.52.patch deleted file mode 100644 index 7f25113816c11a..00000000000000 --- a/recipes/geographiclib/all/patches/0002-cmake-minimum-required-1.52.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,3 +1,4 @@ -+cmake_minimum_required (VERSION 3.13.0) - project (GeographicLib) - - # Version information -@@ -47,7 +48,6 @@ set (LIBVERSION_BUILD 19.2.0) - string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) - string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER) - --cmake_minimum_required (VERSION 3.7.0) # This version was released 2016-11-11 - - # User-settable variables - diff --git a/recipes/geographiclib/all/patches/0003-fix-rhumb.patch b/recipes/geographiclib/all/patches/0003-fix-rhumb.patch new file mode 100644 index 00000000000000..5edf6ebaedf2a1 --- /dev/null +++ b/recipes/geographiclib/all/patches/0003-fix-rhumb.patch @@ -0,0 +1,27 @@ +From 6c5767ba13a12710eab8b5ab7a3db331a1ed7161 Mon Sep 17 00:00:00 2001 +From: Charles Karney +Date: Sun, 24 Jan 2021 09:28:41 -0500 +Subject: [PATCH] Clean up some lists with default methods in Rhumb. Document + issues with AlbersEqualArea. doc: Update gdal_translate example to include + offset + scale. + +--- include/GeographicLib/Rhumb.hpp ++++ include/GeographicLib/Rhumb.hpp +@@ -468,11 +468,15 @@ namespace GeographicLib { + const Rhumb& _rh; + bool _exact; + real _lat1, _lon1, _azi12, _salp, _calp, _mu1, _psi1, _r1; +- RhumbLine& operator=(const RhumbLine&); // copy assignment not allowed ++ // copy assignment not allowed ++ RhumbLine& operator=(const RhumbLine&) = delete; + RhumbLine(const Rhumb& rh, real lat1, real lon1, real azi12, + bool exact); + public: +- ++ /** ++ * Construction is via default copy constructor. ++ **********************************************************************/ ++ RhumbLine(const RhumbLine&) = default; + /** + * This is a duplication of Rhumb::mask. + **********************************************************************/ diff --git a/recipes/geographiclib/all/test_package/conanfile.py b/recipes/geographiclib/all/test_package/conanfile.py index 0a6bc68712d901..fafba71d30d561 100644 --- a/recipes/geographiclib/all/test_package/conanfile.py +++ b/recipes/geographiclib/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/geographiclib/config.yml b/recipes/geographiclib/config.yml index 6c3b63fe79e7ea..23b0bc998f804d 100644 --- a/recipes/geographiclib/config.yml +++ b/recipes/geographiclib/config.yml @@ -1,7 +1,9 @@ versions: + "2.3": + folder: all "1.52": folder: all "1.51": folder: all - "1.50.1": + "1.50.2": folder: all diff --git a/recipes/geos/all/conandata.yml b/recipes/geos/all/conandata.yml index dce86864c12ad3..cce81a5d0af84f 100644 --- a/recipes/geos/all/conandata.yml +++ b/recipes/geos/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.12.0": + url: "https://github.com/libgeos/geos/releases/download/3.12.0/geos-3.12.0.tar.bz2" + sha256: "d96db96011259178a35555a0f6d6e75a739e52a495a6b2aa5efb3d75390fbc39" "3.11.2": url: "https://github.com/libgeos/geos/releases/download/3.11.2/geos-3.11.2.tar.bz2" sha256: "b1f077669481c5a3e62affc49e96eb06f281987a5d36fdab225217e5b825e4cc" @@ -14,3 +17,9 @@ sources: "3.10.2": url: "https://download.osgeo.org/geos/geos-3.10.2.tar.bz2" sha256: "50bbc599ac386b4c2b3962dcc411f0040a61f204aaef4eba7225ecdd0cf45715" +patches: + "3.12.0": + - patch_file: "patches/3.12.0-0001-fix-cmake.patch" + patch_description: "Fix CMake on Windows with Visual Studio" + patch_type: "official" + patch_source: "https://github.com/libgeos/geos/pull/945" diff --git a/recipes/geos/all/conanfile.py b/recipes/geos/all/conanfile.py index 7238296e0a1c15..5bfc63783c7e53 100644 --- a/recipes/geos/all/conanfile.py +++ b/recipes/geos/all/conanfile.py @@ -1,7 +1,8 @@ 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, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get, rmdir +from conan.tools.files import copy, get, rmdir, export_conandata_patches, apply_conandata_patches from conan.tools.scm import Version import os @@ -30,10 +31,29 @@ class GeosConan(ConanFile): "utils": True, } + @property + def _min_cppstd(self): + return "14" if Version(self.version) >= "3.12.0" else "11" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + @property def _has_inline_option(self): return Version(self.version) < "3.11.0" + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -48,8 +68,13 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler.get_safe("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." + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -62,6 +87,7 @@ def generate(self): tc.cache_variables["BUILD_BENCHMARKS"] = False else: tc.variables["BUILD_BENCHMARKS"] = False + tc.cache_variables["CMAKE_BUILD_TYPE"] = str(self.settings.build_type) if self._has_inline_option: tc.variables["DISABLE_GEOS_INLINE"] = not self.options.inline tc.variables["BUILD_TESTING"] = False @@ -71,6 +97,7 @@ def generate(self): tc.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/geos/all/patches/3.12.0-0001-fix-cmake.patch b/recipes/geos/all/patches/3.12.0-0001-fix-cmake.patch new file mode 100644 index 00000000000000..d0abdd50a8211c --- /dev/null +++ b/recipes/geos/all/patches/3.12.0-0001-fix-cmake.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7a2906c..cdab138 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -114,8 +114,12 @@ endif() + + # Make sure we know our build type + if(NOT CMAKE_BUILD_TYPE) +- set(CMAKE_BUILD_TYPE ${DEFAULT_BUILD_TYPE}) +- message(STATUS "GEOS: Using default build type: ${CMAKE_BUILD_TYPE}") ++ get_property(_is_multi_config_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) ++ if (NOT _is_multi_config_generator) ++ set(CMAKE_BUILD_TYPE ${DEFAULT_BUILD_TYPE}) ++ message(STATUS "GEOS: Using default build type: ${CMAKE_BUILD_TYPE}") ++ endif() ++ unset(_is_multi_config_generator) + else() + message(STATUS "GEOS: Build type: ${CMAKE_BUILD_TYPE}") + endif() +@@ -186,6 +190,11 @@ set(CMAKE_CXX_FLAGS_ASAN "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -fno-omit- + set(CMAKE_EXE_LINKER_FLAGS_ASAN "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fsanitize=address") + set(CMAKE_SHARED_LINKER_FLAGS_ASAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=address") + ++get_property(_cmake_build_type_is_cache CACHE CMAKE_BUILD_TYPE PROPERTY TYPE) ++if (_cmake_build_type_is_cache) ++ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "ASAN") ++endif() ++unset(_cmake_build_type_is_cache) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "ASAN") + + #----------------------------------------------------------------------------- diff --git a/recipes/geos/config.yml b/recipes/geos/config.yml index aad029ca82e113..bbc8ab7daf85ca 100644 --- a/recipes/geos/config.yml +++ b/recipes/geos/config.yml @@ -1,4 +1,6 @@ versions: + "3.12.0": + folder: all "3.11.2": folder: all "3.11.1": diff --git a/recipes/gettext/all/conanfile.py b/recipes/gettext/all/conanfile.py index 72a7afc2b30cc1..433bf975c10870 100644 --- a/recipes/gettext/all/conanfile.py +++ b/recipes/gettext/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.env import Environment, VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.layout import basic_layout from conan.tools.microsoft import check_min_vs, is_msvc, unix_path, unix_path_package_info_legacy from conan.tools.scm import Version @@ -31,26 +32,29 @@ 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): self.requires("libiconv/1.17") - def build_requirements(self): - if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): - self.win_bash = True - self.tool_requires("msys2/cci.latest") - if is_msvc(self): - self.build_requires("automake/1.16.5") + def package_id(self): + del self.info.settings.compiler def validate(self): if Version(self.version) < "0.21" and is_msvc(self): raise ConanInvalidConfiguration("MSVC builds of gettext for versions < 0.21 are not supported.") # FIXME: it used to be possible. What changed? - def package_id(self): - del self.info.settings.compiler + def build_requirements(self): + 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") + if is_msvc(self): + self.build_requires("automake/1.16.5") 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): env = VirtualBuildEnv(self) @@ -118,9 +122,9 @@ def build(self): def package(self): autotools = Autotools(self) autotools.install() - + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - + rmdir(self, os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "include")) rmdir(self, os.path.join(self.package_folder, "share", "doc")) @@ -135,14 +139,8 @@ def package_info(self): autopoint = os.path.join(self.package_folder, "bin", "autopoint") self.buildenv_info.append_path("ACLOCAL_PATH", aclocal) self.buildenv_info.define_path("AUTOPOINT", autopoint) - - # TODO: the following can be removed when the recipe supports Conan >= 2.0 only - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) - self.output.info("Appending AUTOMAKE_CONAN_INCLUDES environment variable: {}".format(aclocal)) + # TODO: the following can be removed when the recipe supports Conan >= 2.0 only + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) self.env_info.AUTOMAKE_CONAN_INCLUDES.append(unix_path_package_info_legacy(self, aclocal)) - - self.output.info("Setting AUTOPOINT environment variable: {}".format(autopoint)) self.env_info.AUTOPOINT = unix_path_package_info_legacy(self, autopoint) diff --git a/recipes/ghc-filesystem/all/conanfile.py b/recipes/ghc-filesystem/all/conanfile.py index e7b402102ac33b..0f9f45315ad03e 100644 --- a/recipes/ghc-filesystem/all/conanfile.py +++ b/recipes/ghc-filesystem/all/conanfile.py @@ -9,47 +9,46 @@ class GhcFilesystemRecipe(ConanFile): name = "ghc-filesystem" description = "A header-only single-file std::filesystem compatible helper library" - topics = ("ghc-filesystem", "header-only", "filesystem") + topics = ("header-only", "filesystem") homepage = "https://github.com/gulrak/filesystem" url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True def layout(self): - cmake_layout(self) + cmake_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 generate(self): tc = CMakeToolchain(self) - tc.variables["GHC_FILESYSTEM_BUILD_TESTING"] = False tc.variables["GHC_FILESYSTEM_BUILD_EXAMPLES"] = False tc.variables["GHC_FILESYSTEM_WITH_INSTALL"] = True - tc.generate() + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder,"licenses"), src=self.source_folder) cmake = CMake(self) - cmake.configure() cmake.install() rmdir(self, os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "ghc_filesystem") self.cpp_info.set_property("cmake_target_name", "ghcFilesystem::ghc_filesystem") - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["ghc_filesystem"].bindirs = [] - self.cpp_info.components["ghc_filesystem"].frameworkdirs = [] - self.cpp_info.components["ghc_filesystem"].libdirs = [] - self.cpp_info.components["ghc_filesystem"].resdirs = [] + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "ghc_filesystem" @@ -59,3 +58,5 @@ def package_info(self): self.cpp_info.components["ghc_filesystem"].names["cmake_find_package"] = "ghc_filesystem" self.cpp_info.components["ghc_filesystem"].names["cmake_find_package_multi"] = "ghc_filesystem" self.cpp_info.components["ghc_filesystem"].set_property("cmake_target_name", "ghcFilesystem::ghc_filesystem") + self.cpp_info.components["ghc_filesystem"].bindirs = [] + self.cpp_info.components["ghc_filesystem"].libdirs = [] diff --git a/recipes/ginkgo/all/conandata.yml b/recipes/ginkgo/all/conandata.yml index 1b82b82c2ec357..8927c006e472b3 100644 --- a/recipes/ginkgo/all/conandata.yml +++ b/recipes/ginkgo/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.0": + url: "https://github.com/ginkgo-project/ginkgo/archive/v1.7.0.tar.gz" + sha256: "f4b362bcb046bc53fbe2e578662b939222d0c44b96449101829e73ecce02bcb3" "1.4.0": url: "https://github.com/ginkgo-project/ginkgo/archive/v1.4.0.tar.gz" sha256: "6dcadbd3e93f6ec58ef6cda5b980fbf51ea3c7c13e27952ef38804058ac93f08" @@ -6,8 +9,22 @@ sources: url: "https://github.com/ginkgo-project/ginkgo/archive/v1.3.0.tar.gz" sha256: "1b0e907b4046cdf7cef16d1730c12ba812b38f2764f49f74f454239a27f63596" patches: + "1.7.0": + - patch_file: "patches/libc++-chrono.patch" + patch_type: "official" + patch_description: "Fix for std::chrono incompatibility with libc++" + patch_source: "https://github.com/ginkgo-project/ginkgo/pull/1463" "1.4.0": - patch_file: "patches/windows-symbols.patch" + patch_type: "official" + patch_description: "Fix for excessive link symbol count with MSVC" + patch_source: "https://github.com/ginkgo-project/ginkgo/pull/868" "1.3.0": - patch_file: "patches/cmake-fixes.patch" + patch_type: "official" + patch_description: "Fixes for CMake issues" + patch_source: "https://github.com/ginkgo-project/ginkgo/pull/713, https://github.com/ginkgo-project/ginkgo/pull/720" - patch_file: "patches/windows-iterator.patch" + patch_type: "official" + patch_description: "Fixes for MSVC compatibility" + patch_source: "https://github.com/ginkgo-project/ginkgo/pull/665" diff --git a/recipes/ginkgo/all/conanfile.py b/recipes/ginkgo/all/conanfile.py index 89838bc8bd072f..89bbd2a608d1e1 100644 --- a/recipes/ginkgo/all/conanfile.py +++ b/recipes/ginkgo/all/conanfile.py @@ -74,16 +74,29 @@ def loose_lt_semver(v1, v2): min_length = min(len(lv1), len(lv2)) return lv1[:min_length] < lv2[:min_length] - minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + minimum_version = self._minimum_compilers_version.get( + str(self.settings.compiler) + ) + 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." ) - if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): - raise ConanInvalidConfiguration( - "Ginkgo does not support mixing static CRT and shared library" - ) + if is_msvc(self) and self.options.shared: + if self.settings.build_type == "Debug" and Version(self.version) >= "1.7.0": + raise ConanInvalidConfiguration( + "Ginkgo >= 1.7.0 cannot be built in shared debug mode on Windows" + ) + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Ginkgo does not support mixing static CRT and shared library" + ) + + def build_requirements(self): + if Version(self.version) >= "1.7.0": + self.tool_requires("cmake/[>=3.16 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -98,8 +111,12 @@ def generate(self): tc.variables["GINKGO_BUILD_OMP"] = self.options.openmp tc.variables["GINKGO_BUILD_CUDA"] = self.options.cuda tc.variables["GINKGO_BUILD_HIP"] = False - tc.variables["GINKGO_BUILD_DPCPP"] = False + if Version(self.version) >= "1.7.0": + tc.variables["GINKGO_BUILD_SYCL"] = False + else: + tc.variables["GINKGO_BUILD_DPCPP"] = False tc.variables["GINKGO_BUILD_HWLOC"] = False + tc.variables["GINKGO_BUILD_MPI"] = False tc.generate() def build(self): diff --git a/recipes/ginkgo/all/patches/libc++-chrono.patch b/recipes/ginkgo/all/patches/libc++-chrono.patch new file mode 100644 index 00000000000000..81e20b2bc3b951 --- /dev/null +++ b/recipes/ginkgo/all/patches/libc++-chrono.patch @@ -0,0 +1,17 @@ +--- + core/base/timer.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/core/base/timer.cpp b/core/base/timer.cpp +index 786c31cae39..2c587ff0d8c 100644 +--- a/core/base/timer.cpp ++++ b/core/base/timer.cpp +@@ -124,7 +124,7 @@ void CpuTimer::wait(time_point& time) {} + std::chrono::nanoseconds CpuTimer::difference_async(const time_point& start, + const time_point& stop) + { +- return std::chrono::duration_cast( ++ return std::chrono::duration_cast( + stop.data_.chrono - start.data_.chrono); + } + diff --git a/recipes/ginkgo/config.yml b/recipes/ginkgo/config.yml index 25c9b4921636ce..4283c517286f9a 100644 --- a/recipes/ginkgo/config.yml +++ b/recipes/ginkgo/config.yml @@ -1,4 +1,6 @@ versions: + "1.7.0": + folder: all "1.4.0": folder: all "1.3.0": diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml index 9a250bd76e55c0..049a93b0fe1306 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,39 +1,25 @@ sources: - "1.3.2": - url: "https://github.com/stephenberry/glaze/archive/v1.3.2.tar.gz" - sha256: "c7dd5fd8da63708328e02efbaa91f58df5573114a11c91ae025b711cb0d7f7ab" - "1.3.1": - url: "https://github.com/stephenberry/glaze/archive/v1.3.1.tar.gz" - sha256: "898f86a1dd72ca4e227aad2a76dea8d1e72bf28bad1e6467a6ab1b97848664f0" - "1.3.0": - url: "https://github.com/stephenberry/glaze/archive/v1.3.0.tar.gz" - sha256: "2787efdba0f33adbf73a3b574efedefcda6e8ae2da0a0c8e01be3194898ecd99" - "1.2.6": - url: "https://github.com/stephenberry/glaze/archive/v1.2.6.tar.gz" - sha256: "ef602f1efc7f84669de517181cb091c136e2b9372c176947d0940ebd6c2f2d98" - "1.2.5": - url: "https://github.com/stephenberry/glaze/archive/v1.2.5.tar.gz" - sha256: "bc3ff0b24c8c71557e7aabc5a2bfedd51acea92548c208c3a51815848d2b2c5a" - "1.2.3": - url: "https://github.com/stephenberry/glaze/archive/v1.2.3.tar.gz" - sha256: "003cd3922795319253f080b328dd5c957bc8f446cc2a8145324c2748f4acf10f" - "1.2.2": - url: "https://github.com/stephenberry/glaze/archive/v1.2.2.tar.gz" - sha256: "9bacbe5b07819de9799c8b9aa4861224768d2f87b0cb2f16bd1a4639c6e54755" - "1.2.0": - url: "https://github.com/stephenberry/glaze/archive/v1.2.0.tar.gz" - sha256: "f324a88885da5ed832ddb3ab4e3b0c8994815167b2608615fabfe0373c48a0a4" - "1.1.2": - url: "https://github.com/stephenberry/glaze/archive/v1.1.2.tar.gz" - sha256: "ee22d55b7f40d63f510a41f22765cb24e9e70d312978bad4eb9c94c7ba2fe58c" - "0.3.6": - url: "https://github.com/stephenberry/glaze/archive/v0.3.6.tar.gz" - sha256: "bc87d4fd458f0634a146d6f4c902a952b66c3f718c3e20f680b99066224b51a1" - "0.2.2": - url: "https://github.com/stephenberry/glaze/archive/v0.2.2.tar.gz" - sha256: "d0d2edcc546b0ebb4bedaeedfb4a54aa678a6fdffa6b20dd6b252ef6325a9e75" -patches: - "0.2.2": - - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" - patch_description: "use cci's frozen" - patch_type: "conan" + "1.9.5": + url: "https://github.com/stephenberry/glaze/archive/v1.9.5.tar.gz" + sha256: "3800fa7283a1d4e5bd2c746fe9e268d2f8af76d3a75be7318b2084f38f529c7f" + "1.8.5": + url: "https://github.com/stephenberry/glaze/archive/v1.8.5.tar.gz" + sha256: "5d876eed5689f1947ea4eafd9f13a4e0b527611a6b1857c79a5d598a856287b4" + "1.8.4": + url: "https://github.com/stephenberry/glaze/archive/v1.8.4.tar.gz" + sha256: "794f68d74264ebd4d26c9e1b2a9098134622751a089a45ed5a97d90e58b7d9e6" + "1.8.3": + url: "https://github.com/stephenberry/glaze/archive/v1.8.3.tar.gz" + sha256: "3f0f6f9393daf29cef2772fadf46d9f22669899ee8f025f17889a22c84d2c6e8" + "1.8.2": + url: "https://github.com/stephenberry/glaze/archive/v1.8.2.tar.gz" + sha256: "dddc7b9c87739e0266a6a868316e692975651e9e77684cfb7d3a6a4be32c95fc" + "1.8.1": + url: "https://github.com/stephenberry/glaze/archive/v1.8.1.tar.gz" + sha256: "ea804976d55a27e6df49390c3ec8600daea0c72780ea7094d79d1edcbe525fcd" + "1.7.0": + url: "https://github.com/stephenberry/glaze/archive/v1.7.0.tar.gz" + sha256: "e8ccb925cf45f8974ba8d9af56c29eed12dd5fd9253c02015a6780b7c861e4df" + "1.6.1": + url: "https://github.com/stephenberry/glaze/archive/v1.6.1.tar.gz" + sha256: "c52c0f66d98d829ae1f2b859abddc84132ad49aea4c76f3286970fbab1489c10" diff --git a/recipes/glaze/all/conanfile.py b/recipes/glaze/all/conanfile.py index 253e1e45cba721..f991920259f6a8 100644 --- a/recipes/glaze/all/conanfile.py +++ b/recipes/glaze/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.files import get, copy from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.layout import basic_layout @@ -17,6 +17,7 @@ class GlazeConan(ConanFile): topics = ("json", "memory", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): @@ -25,36 +26,22 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "Visual Studio": "16", - "msvc": "192", - "gcc": "12", - "clang": "12" if Version(self.version) > "1.0.0" else "13", + "Visual Studio": "17", + "msvc": "193", + "gcc": "10" if Version(self.version) < "1.9.0" else "11", + "clang": "12", "apple-clang": "13.1", } - def export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") - def requirements(self): - if Version(self.version) < "0.2.4": - self.requires("fmt/10.0.0") - self.requires("frozen/1.1.1") - self.requires("nanorange/cci.20200706") - if Version(self.version) < "0.2.3": - self.requires("fast_float/5.2.0") - if "0.1.5" <= Version(self.version) < "0.2.3": - self.requires("dragonbox/1.1.3") - def package_id(self): self.info.clear() def validate(self): if self.settings.get_safe("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( @@ -64,15 +51,11 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - apply_conandata_patches(self) - def package(self): - copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy( self, pattern="*.hpp", - excludes="glaze/frozen/*.hpp" if Version(self.version) < "0.2.4" else "", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"), ) diff --git a/recipes/glaze/all/patches/0.2.0-0001-use-cci-frozen.patch b/recipes/glaze/all/patches/0.2.0-0001-use-cci-frozen.patch deleted file mode 100644 index 01b0c786fa02b1..00000000000000 --- a/recipes/glaze/all/patches/0.2.0-0001-use-cci-frozen.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/include/glaze/core/common.hpp b/include/glaze/core/common.hpp -index aed6ce6..6cf4ace 100644 ---- a/include/glaze/core/common.hpp -+++ b/include/glaze/core/common.hpp -@@ -12,8 +12,8 @@ - #include - #include - --#include "glaze/frozen/string.hpp" --#include "glaze/frozen/unordered_map.hpp" -+#include "frozen/string.h" -+#include "frozen/unordered_map.h" - - #include "glaze/core/context.hpp" - #include "glaze/core/meta.hpp" -diff --git a/include/glaze/util/hash_map.hpp b/include/glaze/util/hash_map.hpp -index eaaec57..ae75ee2 100644 ---- a/include/glaze/util/hash_map.hpp -+++ b/include/glaze/util/hash_map.hpp -@@ -4,7 +4,7 @@ - #include - #include - --#include "glaze/frozen/random.hpp" -+#include "frozen/random.h" - #include "glaze/util/string_cmp.hpp" - - namespace glz diff --git a/recipes/glaze/all/test_package/CMakeLists.txt b/recipes/glaze/all/test_package/CMakeLists.txt index 11ef3b807bd40a..4811c5114c3c22 100644 --- a/recipes/glaze/all/test_package/CMakeLists.txt +++ b/recipes/glaze/all/test_package/CMakeLists.txt @@ -6,6 +6,3 @@ find_package(glaze REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE glaze::glaze) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) -if(glaze_VERSION VERSION_LESS "1.0.0") - target_compile_definitions(${PROJECT_NAME} PRIVATE GLAZE_USE_EXCEPTION) -endif() diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml index c9458b20872bed..2c2e8c3fdb89ee 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,23 +1,17 @@ versions: - "1.3.2": + "1.9.5": folder: all - "1.3.1": + "1.8.5": folder: all - "1.3.0": + "1.8.4": folder: all - "1.2.6": + "1.8.3": folder: all - "1.2.5": + "1.8.2": folder: all - "1.2.3": + "1.8.1": folder: all - "1.2.2": + "1.7.0": folder: all - "1.2.0": - folder: all - "1.1.2": - folder: all - "0.3.6": - folder: all - "0.2.2": + "1.6.1": folder: all 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..c27f9801a9ee62 100644 --- a/recipes/glfw/all/conanfile.py +++ b/recipes/glfw/all/conanfile.py @@ -1,11 +1,15 @@ 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, VirtualRunEnv 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 -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.5" class GlfwConan(ConanFile): @@ -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 self.settings.os not in ["Linux", "FreeBSD"] or Version(self.version) <= "3.3.8": + self.options.rm_safe("with_x11") def configure(self): if self.options.shared: @@ -43,29 +59,84 @@ 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") + self.requires("vulkan-loader/1.3.243.0") if self.settings.os in ["Linux", "FreeBSD"]: - self.requires("xorg/system") + if self.options.get_safe("with_x11", True): + self.requires("xorg/system") + if self.options.get_safe("with_wayland"): + self.requires("wayland/1.22.0") + 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-protocols/1.32") + if self._has_build_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], strip_root=True) def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if self.options.get_safe("with_wayland") and not self._has_build_profile: + env = VirtualRunEnv(self) + env.generate(scope="build") + 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_INSTALL"] = True + if Version(self.version) > "3.3.8": + tc.cache_variables["GLFW_BUILD_X11"] = self.options.get_safe("with_x11", False) + tc.cache_variables["GLFW_BUILD_WAYLAND"] = self.options.get_safe("with_wayland", False) + else: + tc.cache_variables["GLFW_USE_WAYLAND"] = self.options.get_safe("with_wayland", False) 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) + if self.options.get_safe("with_wayland"): + cmake_deps.set_property("xkbcommon", "cmake_file_name", "XKBCommon") + cmake_deps.generate() + if self.options.get_safe("with_wayland"): + pkg_config_deps = PkgConfigDeps(self) + if self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland-protocols"] + else: + # Manually generate pkgconfig file of wayland-protocols since + # PkgConfigDeps.build_context_activated can't work with legacy 1 profile + # We must use legacy conan v1 deps_cpp_info because self.dependencies doesn't + # contain build requirements when using 1 profile. + wp_prefix = self.deps_cpp_info["wayland-protocols"].rootpath + wp_version = self.deps_cpp_info["wayland-protocols"].version + wp_pkg_content = textwrap.dedent(f"""\ + prefix={wp_prefix} + datarootdir=${{prefix}}/res + pkgdatadir=${{datarootdir}}/wayland-protocols + Name: Wayland Protocols + Description: Wayland protocol files + Version: {wp_version} + """) + save(self, os.path.join(self.generators_folder, "wayland-protocols.pc"), wp_pkg_content) + pkg_config_deps.generate() def _patch_sources(self): apply_conandata_patches(self) @@ -100,7 +171,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/gli/all/conanfile.py b/recipes/gli/all/conanfile.py index 7eb260e9e72020..0cb3644185589d 100644 --- a/recipes/gli/all/conanfile.py +++ b/recipes/gli/all/conanfile.py @@ -1,13 +1,12 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.files import copy, get, load, save from conan.tools.layout import basic_layout from conan.tools.build import check_min_cppstd from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.52.0" class GliConan(ConanFile): @@ -17,6 +16,7 @@ class GliConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/g-truc/gli" license = "LicenseRef-copying.txt" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -30,13 +30,15 @@ def _compilers_minimum_version(self): "gcc": "4.7", "clang": "3.4", "apple-clang": "6", + "Visual Studio": "12", + "msvc": "180", } def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glm/cci.20230113", transitive_headers=True) + self.requires("glm/cci.20230113") def package_id(self): self.info.clear() @@ -44,13 +46,12 @@ def package_id(self): def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) - check_min_vs(self, 180) - 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." + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -72,6 +73,6 @@ def _get_license(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "gli") - self.cpp_info.set_property("cmake_target_name", "gli::gli") + self.cpp_info.set_property("cmake_target_name", "gli") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/gli/all/test_package/CMakeLists.txt b/recipes/gli/all/test_package/CMakeLists.txt index f7789e29322d3f..928ba41028f6bc 100644 --- a/recipes/gli/all/test_package/CMakeLists.txt +++ b/recipes/gli/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package LANGUAGES CXX) find_package(gli REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE gli::gli) +target_link_libraries(${PROJECT_NAME} PRIVATE gli) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml index a457da4866ed6c..826e4f114106f2 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -1,43 +1,39 @@ sources: + "2.78.3": + url: "https://download.gnome.org/sources/glib/2.78/glib-2.78.3.tar.xz" + sha256: "609801dd373796e515972bf95fc0b2daa44545481ee2f465c4f204d224b2bc21" + "2.78.1": + url: "https://download.gnome.org/sources/glib/2.78/glib-2.78.1.tar.xz" + sha256: "915bc3d0f8507d650ead3832e2f8fb670fce59aac4d7754a7dab6f1e6fed78b2" + "2.78.0": + url: "https://download.gnome.org/sources/glib/2.78/glib-2.78.0.tar.xz" + sha256: "44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30" + "2.77.3": + url: "https://download.gnome.org/sources/glib/2.77/glib-2.77.3.tar.xz" + sha256: "1753f963bb680b28a83d6e2095f63d0d4b94244675bcd2603850b2ebc1ac6a61" + "2.77.2": + url: "https://download.gnome.org/sources/glib/2.77/glib-2.77.2.tar.xz" + sha256: "16279739e4d30ec47be3e82909f5aeaaa41a8206bae3bead10a23fb2deff02a6" + "2.77.1": + url: "https://download.gnome.org/sources/glib/2.77/glib-2.77.1.tar.xz" + sha256: "dce8d0c9e916d8c81a64436bd4ee4d6515a52dd3d157c994e1cdb9b3d6300a03" "2.77.0": url: "https://download.gnome.org/sources/glib/2.77/glib-2.77.0.tar.xz" sha256: "1897fd8ad4ebb523c32fabe7508c3b0b039c089661ae1e7917df0956a320ac4d" "2.76.3": url: "https://download.gnome.org/sources/glib/2.76/glib-2.76.3.tar.xz" sha256: "c0be444e403d7c3184d1f394f89f0b644710b5e9331b54fa4e8b5037813ad32a" - "2.76.2": - url: "https://download.gnome.org/sources/glib/2.76/glib-2.76.2.tar.xz" - sha256: "24f3847857b1d8674cdb0389a36edec0f13c666cd3ce727ecd340eb9da8aca9e" - "2.76.1": - url: "https://download.gnome.org/sources/glib/2.76/glib-2.76.1.tar.xz" - sha256: "43dc0f6a126958f5b454136c4398eab420249c16171a769784486e25f2fda19f" - "2.76.0": - url: "https://download.gnome.org/sources/glib/2.76/glib-2.76.0.tar.xz" - sha256: "525bb703b807142e1aee5ccf222c344e8064b21c0c45677ef594e587874c6797" "2.75.3": url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.3.tar.xz" sha256: "7c517d0aff456c35a039bce8a8df7a08ce95a8285b09d1849f8865f633f7f871" - "2.75.2": - url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.2.tar.xz" - sha256: "360d6fb75202c0eb0d07f0ab812b19b526f1c05ccc0a8ed7e5d2c988616d343a" - "2.75.1": - url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.1.tar.xz" - sha256: "96fd22355a542cca96c31082f2d09b72cb5a3454b6ea60c1be17c987a18a6b93" - "2.75.0": - url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.0.tar.xz" - sha256: "6dde8e55cc4a2c83d96797120b08bcffb5f645b2e212164ae22d63c40e0e6360" - "2.74.1": - url: "https://download.gnome.org/sources/glib/2.74/glib-2.74.1.tar.xz" - sha256: "0ab981618d1db47845e56417b0d7c123f81a3427b2b9c93f5a46ff5bbb964964" - "2.73.3": - url: "https://download.gnome.org/sources/glib/2.73/glib-2.73.3.tar.xz" - sha256: "df1a2b841667d6b48b2ef6969ebda4328243829f6e45866726f806f90f64eead" - "2.72.4": - url: "https://download.gnome.org/sources/glib/2.72/glib-2.72.4.tar.xz" - sha256: "8848aba518ba2f4217d144307a1d6cb9afcc92b54e5c13ac1f8c4d4608e96f0e" patches: - "2.73.3": - - patch_file: "patches/0001-2.73.3-clang-static-assert.patch" + "2.76.3": + - patch_file: "patches/libintl-discovery.patch" + patch_type: bugfix + patch_description: fix libintl discovery + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3352 + "2.75.3": + - patch_file: "patches/libintl-discovery-2.75.3.patch" patch_type: bugfix - patch_description: fix for clang compilation - patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2898 + patch_description: fix libintl discovery + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3352 diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index 95fb7a1a6aec3d..6ccdcc81fb42ae 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -6,7 +6,6 @@ from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version import os import shutil @@ -65,29 +64,26 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") self.requires("libffi/3.4.4") - if Version(self.version) >= "2.73.2": - self.requires("pcre2/10.42") - else: - self.requires("pcre/8.45") + self.requires("pcre2/10.42") if self.options.get_safe("with_elf"): self.requires("libelf/0.8.13") if self.options.get_safe("with_mount"): - self.requires("libmount/2.36.2") + self.requires("libmount/2.39") if self.options.get_safe("with_selinux"): - self.requires("libselinux/3.3") + self.requires("libselinux/3.5") if self.settings.os != "Linux": # for Linux, gettext is provided by libc - self.requires("libgettext/0.21", transitive_headers=True, transitive_libs=True) + self.requires("libgettext/0.22", transitive_headers=True, transitive_libs=True) if is_apple_os(self): self.requires("libiconv/1.17") def build_requirements(self): - self.tool_requires("meson/1.1.0") + self.tool_requires("meson/1.2.2") 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) @@ -99,8 +95,6 @@ def generate(self): tc.generate() tc = MesonToolchain(self) - if is_apple_os(self) and Version(self.version) < "2.75.1": - tc.project_options["iconv"] = "external" # https://gitlab.gnome.org/GNOME/glib/issues/1557 tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux") else "disabled" tc.project_options["libmount"] = "enabled" if self.options.get_safe("with_mount") else "disabled" if self.settings.os == "FreeBSD": @@ -116,20 +110,11 @@ def _patch_sources(self): "subdir('fuzzing')", "#subdir('fuzzing')", ) # https://gitlab.gnome.org/GNOME/glib/-/issues/2152 - if Version(self.version) < "2.73.2": - for filename in [ - os.path.join(self.source_folder, "meson.build"), - os.path.join(self.source_folder, "glib", "meson.build"), - os.path.join(self.source_folder, "gobject", "meson.build"), - os.path.join(self.source_folder, "gio", "meson.build"), - ]: - replace_in_file(self, filename, "subdir('tests')", "#subdir('tests')") if self.settings.os != "Linux": # allow to find gettext replace_in_file(self, os.path.join(self.source_folder, "meson.build"), - "libintl = cc.find_library('intl', required : false" if Version(self.version) < "2.73.1" \ - else "libintl = dependency('intl', required: false", + "libintl = dependency('intl', required: false", "libintl = dependency('libgettext', method : 'pkg-config', required : false", ) @@ -152,10 +137,7 @@ def build(self): meson.build() def package(self): - if Version(self.version) < "2.73.0": - copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - else: - copy(self, pattern="LGPL-2.1-or-later.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "LICENSES")) + copy(self, pattern="LGPL-2.1-or-later.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "LICENSES")) meson = Meson(self) meson.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) @@ -234,10 +216,7 @@ def package_info(self): if is_apple_os(self): self.cpp_info.components["glib-2.0"].requires.append("libiconv::libiconv") - if Version(self.version) >= "2.73.2": - self.cpp_info.components["glib-2.0"].requires.append("pcre2::pcre2") - else: - self.cpp_info.components["glib-2.0"].requires.append("pcre::pcre") + self.cpp_info.components["glib-2.0"].requires.append("pcre2::pcre2") if self.settings.os == "Linux": self.cpp_info.components["gio-2.0"].system_libs.append("resolv") diff --git a/recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch b/recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch deleted file mode 100644 index c46f5e071d71cd..00000000000000 --- a/recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/gio/gio-launch-desktop.c b/gio/gio-launch-desktop.c -index 29bf9d5d4..47717b987 100644 ---- a/gio/gio-launch-desktop.c -+++ b/gio/gio-launch-desktop.c -@@ -39,7 +39,6 @@ - - #if defined(__linux__) && !defined(__BIONIC__) - #include --#include - #include - #include - #include -@@ -48,6 +47,9 @@ - #include - - #include "gjournal-private.h" -+#define GLIB_COMPILATION -+#include "gmacros.h" /* For G_STATIC_ASSERT define */ -+#undef GLIB_COMPILATION - - /* - * write_all: -@@ -119,8 +121,8 @@ journal_stream_fd (const char *identifier, - /* Arbitrary large size for the sending buffer, from systemd */ - int large_buffer_size = 8 * 1024 * 1024; - -- static_assert (LOG_EMERG == 0, "Linux ABI defines LOG_EMERG"); -- static_assert (LOG_DEBUG == 7, "Linux ABI defines LOG_DEBUG"); -+ G_STATIC_ASSERT (LOG_EMERG == 0 && sizeof "Linux ABI defines LOG_EMERG"); -+ G_STATIC_ASSERT (LOG_DEBUG == 7 && sizeof "Linux ABI defines LOG_DEBUG"); - - fd = socket (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); - diff --git a/recipes/glib/all/patches/libintl-discovery-2.75.3.patch b/recipes/glib/all/patches/libintl-discovery-2.75.3.patch new file mode 100644 index 00000000000000..0df94096d06153 --- /dev/null +++ b/recipes/glib/all/patches/libintl-discovery-2.75.3.patch @@ -0,0 +1,49 @@ +From 32249a22fc39319651e7c23442d37ec837f05764 Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan +Date: Thu, 8 Sep 2022 02:36:33 +0530 +Subject: [PATCH] meson: Fix detection of a system-provided proxy-libintl + +proxy-libintl defines ngettext() as a define in the header that points +to the actual symbol in the library which is g_libintl_ngettext(). +Same with bind_textdomain_codeset(). +--- + meson.build | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/meson.build b/meson.build +index 0cbc9689f5..de0bee5a39 100644 +--- a/meson.build ++++ b/meson.build +@@ -2088,6 +2088,7 @@ libz_dep = dependency('zlib') + # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible + # implementations. This could be extended if issues are found in some platforms. + libintl_deps = [] ++libintl_prefix = '#include ' + libintl = dependency('intl', required: false, allow_fallback: false) + if libintl.found() + # libintl supports different threading APIs, which may not +@@ -2099,11 +2100,11 @@ if libintl.found() + # + # Meson's builtin dependency lookup as of 0.60.0 doesn't check for + # pthread, so we do this manually here. +- if cc.has_function('ngettext', dependencies : libintl) ++ if cc.has_function('ngettext', dependencies : libintl, prefix: libintl_prefix) + libintl_deps += [libintl] + else + libintl_pthread = cc.find_library('pthread', required : false) +- if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread]) ++ if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread], prefix: libintl_prefix) + libintl_deps += [libintl, libintl_pthread] + else + libintl = disabler() +@@ -2112,7 +2113,7 @@ if libintl.found() + endif + + if libintl.found() +- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps) ++ have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps, prefix: libintl_prefix) + else + libintl = dependency('intl', allow_fallback: true) + assert(libintl.type_name() == 'internal') +-- +GitLab diff --git a/recipes/glib/all/patches/libintl-discovery.patch b/recipes/glib/all/patches/libintl-discovery.patch new file mode 100644 index 00000000000000..17083da96cd176 --- /dev/null +++ b/recipes/glib/all/patches/libintl-discovery.patch @@ -0,0 +1,49 @@ +From 32249a22fc39319651e7c23442d37ec837f05764 Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan +Date: Thu, 8 Sep 2022 02:36:33 +0530 +Subject: [PATCH] meson: Fix detection of a system-provided proxy-libintl + +proxy-libintl defines ngettext() as a define in the header that points +to the actual symbol in the library which is g_libintl_ngettext(). +Same with bind_textdomain_codeset(). +--- + meson.build | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/meson.build b/meson.build +index 0cbc9689f5..de0bee5a39 100644 +--- a/meson.build ++++ b/meson.build +@@ -2089,6 +2089,7 @@ libz_dep = dependency('zlib') + # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible + # implementations. This could be extended if issues are found in some platforms. + libintl_deps = [] ++libintl_prefix = '#include ' + libintl = dependency('intl', required: false, allow_fallback: false) + if libintl.found() + # libintl supports different threading APIs, which may not +@@ -2100,11 +2101,11 @@ if libintl.found() + # + # Meson's builtin dependency lookup as of 0.60.0 doesn't check for + # pthread, so we do this manually here. +- if cc.has_function('ngettext', dependencies : libintl) ++ if cc.has_function('ngettext', dependencies : libintl, prefix: libintl_prefix) + libintl_deps += [libintl] + else + libintl_pthread = cc.find_library('pthread', required : false) +- if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread]) ++ if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread], prefix: libintl_prefix) + libintl_deps += [libintl, libintl_pthread] + else + libintl = disabler() +@@ -2113,7 +2114,7 @@ if libintl.found() + endif + + if libintl.found() +- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps) ++ have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps, prefix: libintl_prefix) + else + libintl = dependency('intl', allow_fallback: true) + assert(libintl.type_name() == 'internal') +-- +GitLab diff --git a/recipes/glib/all/test_package/conanfile.py b/recipes/glib/all/test_package/conanfile.py index 2f5458641d6f7d..168cdc2e86991b 100644 --- a/recipes/glib/all/test_package/conanfile.py +++ b/recipes/glib/all/test_package/conanfile.py @@ -18,7 +18,7 @@ def requirements(self): def build_requirements(self): if self.settings.os != "Windows" and 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") def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/glib/all/test_v1_package/conanfile.py b/recipes/glib/all/test_v1_package/conanfile.py index ed236807fcf7e8..32471187016745 100644 --- a/recipes/glib/all/test_v1_package/conanfile.py +++ b/recipes/glib/all/test_v1_package/conanfile.py @@ -8,7 +8,7 @@ class TestPackageConan(ConanFile): def build_requirements(self): if self.settings.os != "Windows": - self.build_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def build(self): if self.settings.os != "Windows": diff --git a/recipes/glib/config.yml b/recipes/glib/config.yml index 709e827338b68f..f0bd1289c0ca6f 100644 --- a/recipes/glib/config.yml +++ b/recipes/glib/config.yml @@ -1,25 +1,19 @@ versions: - "2.77.0": - folder: all - "2.76.3": + "2.78.3": folder: all - "2.76.2": + "2.78.1": folder: all - "2.76.1": + "2.78.0": folder: all - "2.76.0": - folder: all - "2.75.3": + "2.77.3": folder: all - "2.75.2": + "2.77.2": folder: all - "2.75.1": + "2.77.1": folder: all - "2.75.0": - folder: all - "2.74.1": + "2.77.0": folder: all - "2.73.3": + "2.76.3": folder: all - "2.72.4": + "2.75.3": folder: all diff --git a/recipes/glibmm/all/conanfile.py b/recipes/glibmm/all/conanfile.py index df88638f61d356..a6d3f4c904bd46 100644 --- a/recipes/glibmm/all/conanfile.py +++ b/recipes/glibmm/all/conanfile.py @@ -75,11 +75,11 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.76.0") + self.requires("glib/2.78.0", transitive_headers=True) if self._abi_version == "2.68": - self.requires("libsigcpp/3.0.7") + self.requires("libsigcpp/3.0.7", transitive_headers=True) else: - self.requires("libsigcpp/2.10.8") + self.requires("libsigcpp/2.10.8", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -97,9 +97,9 @@ def validate(self): raise ConanInvalidConfiguration("Linking shared glib with the MSVC static runtime is not supported") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.2.2") 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/glm/all/conanfile.py b/recipes/glm/all/conanfile.py index b86499dcc4c3d2..468e10f82d8df5 100644 --- a/recipes/glm/all/conanfile.py +++ b/recipes/glm/all/conanfile.py @@ -14,6 +14,7 @@ class GlmConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/g-truc/glm" license = "MIT" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/glog/all/conanfile.py b/recipes/glog/all/conanfile.py index f0db480178e58c..7e06e74b5074e8 100644 --- a/recipes/glog/all/conanfile.py +++ b/recipes/glog/all/conanfile.py @@ -56,7 +56,7 @@ def requirements(self): self.requires("gflags/2.2.2", transitive_headers=True, transitive_libs=True) # 0.4.0 requires libunwind unconditionally if self.options.get_safe("with_unwind") or (Version(self.version) < "0.5.0" and self.settings.os in ["Linux", "FreeBSD"]): - self.requires("libunwind/1.6.2") + self.requires("libunwind/1.7.2") def build_requirements(self): if Version(self.version) >= "0.6.0": diff --git a/recipes/glshaderpp/all/conanfile.py b/recipes/glshaderpp/all/conanfile.py index 5f5d7e6cc487c9..047572c5d5dc70 100644 --- a/recipes/glshaderpp/all/conanfile.py +++ b/recipes/glshaderpp/all/conanfile.py @@ -1,25 +1,26 @@ -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 GLShaderPPConan(ConanFile): name = "glshaderpp" - homepage = "https://gitlab-lepuy.iut.uca.fr/opengl/glshaderpp" description = "A lightweight header-only library to compile and link OpenGL GLSL shaders." - topics = ("opengl", "glsl", "shader", "header-only") - url = "https://github.com/conan-io/conan-center-index" - no_copy_source = True license = "LGPL-3.0-or-later" - settings = "compiler", "os", "arch", "build_type" - - @property - def _source_subfolder(self): - return "source_subfolder" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab-lepuy.iut.uca.fr/opengl/glshaderpp" + topics = ("opengl", "glsl", "shader", "header-only") - def package_id(self): - self.info.header_only() + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _minimum_cpp_standard(self): @@ -28,28 +29,45 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): return { - "Visual Studio": "17", "gcc": "7", "clang": "6", "apple-clang": "10", + "msvc": "193", + "Visual Studio": "17", } + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._minimum_cpp_standard) min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) if not min_version: - self.output.warn(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") + self.output.warning(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") else: - if tools.Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration(f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler" + f" {self.settings.compiler} {self.settings.compiler.version} does not support it." + ) 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("*", src=os.path.join(self._source_subfolder, "include"), dst="include") + copy(self, "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", + 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 = [] + self.cpp_info.includedirs.append(os.path.join("include", "GLShaderPP")) diff --git a/recipes/glshaderpp/all/test_package/CMakeLists.txt b/recipes/glshaderpp/all/test_package/CMakeLists.txt index 7f0e01ff5256f0..36af631b4dd6a6 100644 --- a/recipes/glshaderpp/all/test_package/CMakeLists.txt +++ b/recipes/glshaderpp/all/test_package/CMakeLists.txt @@ -1,12 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) find_package(glew CONFIG REQUIRED) find_package(glshaderpp CONFIG REQUIRED) -add_executable(${PROJECT_NAME} example.cpp) +add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} glshaderpp::glshaderpp GLEW::GLEW) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) diff --git a/recipes/glshaderpp/all/test_package/conanfile.py b/recipes/glshaderpp/all/test_package/conanfile.py index b5aad28ecae40b..8141b9ee65dbbb 100644 --- a/recipes/glshaderpp/all/test_package/conanfile.py +++ b/recipes/glshaderpp/all/test_package/conanfile.py @@ -1,19 +1,27 @@ +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" + test_type = "explicit" def requirements(self): + self.requires(self.tested_reference_str) self.requires("glew/2.2.0") + def layout(self): + cmake_layout(self) + 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", "PackageTest") - 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/glshaderpp/all/test_package/example.cpp b/recipes/glshaderpp/all/test_package/example.cpp deleted file mode 100644 index eb8a668f50e890..00000000000000 --- a/recipes/glshaderpp/all/test_package/example.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include -#include -#include -#include - -int main() { - GLShaderPP::CShaderException e("If you read this, GLShaderPP is happy :)", GLShaderPP::CShaderException::ExceptionType::LinkError); - std::cout << e.what() << '\n'; - return EXIT_SUCCESS; -} diff --git a/recipes/glshaderpp/all/test_package/test_package.cpp b/recipes/glshaderpp/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..e8dce6ff7068bd --- /dev/null +++ b/recipes/glshaderpp/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include +#include + +#include + +int main() { + GLShaderPP::CShaderException e("If you read this, GLShaderPP is happy :)", + GLShaderPP::CShaderException::ExceptionType::LinkError); + std::cout << e.what() << '\n'; + return EXIT_SUCCESS; +} diff --git a/recipes/glshaderpp/all/test_v1_package/CMakeLists.txt b/recipes/glshaderpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/glshaderpp/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/glshaderpp/all/test_v1_package/conanfile.py b/recipes/glshaderpp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6e16e1852823fd --- /dev/null +++ b/recipes/glshaderpp/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def requirements(self): + self.requires("glew/2.2.0") + + 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/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/gmp/all/conandata.yml b/recipes/gmp/all/conandata.yml index 3c3f2645e9c313..2590ca2c5c73a3 100644 --- a/recipes/gmp/all/conandata.yml +++ b/recipes/gmp/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "6.3.0": + url: + - "https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.bz2" + - "https://gmplib.org/download/gmp/gmp-6.3.0.tar.bz2" + sha256: "ac28211a7cfb609bae2e2c8d6058d66c8fe96434f740cf6fe2e47b000d1c20cb" "6.2.1": url: - "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.bz2" @@ -11,13 +16,48 @@ sources: url: "https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2" sha256: "5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2" patches: + "6.3.0": + - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" + - patch_file: "patches/6.x.x-0001-fix-MSVC-next-prime-error.patch" + - patch_file: "patches/emscripten/0001-configure.patch" + patch_os: "Emscripten" + patch_source: "https://github.com/fpelliccioni" + patch_type: "portability" + - patch_file: "patches/emscripten/0002-gmp-mparam.h.patch" + patch_os: "Emscripten" + patch_source: "https://github.com/fpelliccioni" + patch_type: "portability" "6.2.1": - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" - - patch_file: "patches/6.2.x-0001-fix-MSVC-next-prime-error.patch" + - patch_file: "patches/6.x.x-0001-fix-MSVC-next-prime-error.patch" + - patch_file: "patches/emscripten/0001-configure.patch" + patch_os: "Emscripten" + patch_source: "https://github.com/fpelliccioni" + patch_type: "portability" + - patch_file: "patches/emscripten/0002-gmp-mparam.h.patch" + patch_os: "Emscripten" + patch_source: "https://github.com/fpelliccioni" + patch_type: "portability" "6.2.0": - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" - - patch_file: "patches/6.2.x-0001-fix-MSVC-next-prime-error.patch" + - patch_file: "patches/6.x.x-0001-fix-MSVC-next-prime-error.patch" + - patch_file: "patches/emscripten/0001-configure.patch" + patch_os: "Emscripten" + patch_source: "https://github.com/fpelliccioni" + patch_type: "portability" + - patch_file: "patches/emscripten/0002-gmp-mparam.h.patch" + patch_os: "Emscripten" + patch_source: "https://github.com/fpelliccioni" + patch_type: "portability" "6.1.2": - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" - patch_file: "patches/6.1.x-0001-fix-MSVC-next-prime-error.patch" - patch_file: "patches/6.1.x-0002-fix-MSVC-debug.patch" + - patch_file: "patches/emscripten/0001-configure.patch" + patch_os: "Emscripten" + patch_source: "https://github.com/fpelliccioni" + patch_type: "portability" + - patch_file: "patches/emscripten/0002-gmp-mparam.h.patch" + patch_os: "Emscripten" + patch_source: "https://github.com/fpelliccioni" + patch_type: "portability" diff --git a/recipes/gmp/all/conanfile.py b/recipes/gmp/all/conanfile.py index eae86d9dc35058..13d9a9a41b8c1d 100644 --- a/recipes/gmp/all/conanfile.py +++ b/recipes/gmp/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.files import copy, export_conandata_patches, get, patch, rm, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import check_min_vs, is_msvc, unix_path @@ -19,7 +19,7 @@ class GmpConan(ConanFile): "on signed integers, rational numbers, and floating-point numbers." ) url = "https://github.com/conan-io/conan-center-index" - topics = ("gmp", "math", "arbitrary", "precision", "integer") + topics = ("math", "arbitrary", "precision", "integer") license = ("LGPL-3.0", "GPL-2.0") homepage = "https://gmplib.org" @@ -83,8 +83,8 @@ def build_requirements(self): if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") if is_msvc(self): - self.tool_requires("yasm/1.3.0") # Needed for determining 32-bit word size - self.tool_requires("automake/1.16.5") # Needed for lib-wrapper + self.tool_requires("yasm/1.3.0") # Needed for determining 32-bit word size + self.tool_requires("automake/1.16.5") # Needed for lib-wrapper def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -130,7 +130,16 @@ def generate(self): tc.generate(env) def _patch_sources(self): - apply_conandata_patches(self) + # Usage allowed after consideration with CCI maintainers + for it in self.conan_data.get("patches", {}).get(self.version, []): + if "patch_os" not in it or self.settings.os == it["patch_os"]: + entry = it.copy() + patch_file = entry.pop("patch_file") + patch_file_path = os.path.join(self.export_sources_folder, patch_file) + if "patch_description" not in entry: + entry["patch_description"] = patch_file + patch(self, patch_file=patch_file_path, **entry) + # Fix permission issue if is_apple_os(self): configure_file = os.path.join(self.source_folder, "configure") diff --git a/recipes/gmp/all/patches/6.2.x-0001-fix-MSVC-next-prime-error.patch b/recipes/gmp/all/patches/6.x.x-0001-fix-MSVC-next-prime-error.patch similarity index 100% rename from recipes/gmp/all/patches/6.2.x-0001-fix-MSVC-next-prime-error.patch rename to recipes/gmp/all/patches/6.x.x-0001-fix-MSVC-next-prime-error.patch diff --git a/recipes/gmp/all/patches/emscripten/0001-configure.patch b/recipes/gmp/all/patches/emscripten/0001-configure.patch new file mode 100644 index 00000000000000..290382628e9ed6 --- /dev/null +++ b/recipes/gmp/all/patches/emscripten/0001-configure.patch @@ -0,0 +1,14 @@ +--- configure-orig 2023-08-23 10:38:02 ++++ configure 2023-08-23 10:38:02 +@@ -4078,8 +4078,10 @@ + + + # abilist needs to be non-empty, "standard" is just a generic name here +-abilist="standard" ++abilist="standard longlong" ++limb_longlong=longlong + ++ + # FIXME: We'd like to prefer an ANSI compiler, perhaps by preferring + # c89 over cc here. But note that on HP-UX c89 provides a castrated + # environment, and would want to be excluded somehow. Maybe diff --git a/recipes/gmp/all/patches/emscripten/0002-gmp-mparam.h.patch b/recipes/gmp/all/patches/emscripten/0002-gmp-mparam.h.patch new file mode 100644 index 00000000000000..a73a98ce168cee --- /dev/null +++ b/recipes/gmp/all/patches/emscripten/0002-gmp-mparam.h.patch @@ -0,0 +1,147 @@ +--- mpn/generic/gmp-mparam.h-orig 2023-08-22 16:57:58 ++++ mpn/generic/gmp-mparam.h 2023-08-22 16:58:43 +@@ -1,33 +1,122 @@ +-/* Generic C gmp-mparam.h -- Compiler/machine parameter header file. ++/* Generated by tuneup.c, 2022-04-30, gcc 4.2 */ + +-Copyright 1991, 1993, 1994, 2000 Free Software Foundation, Inc. ++#define DIVREM_1_NORM_THRESHOLD 0 /* always */ ++#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */ ++#define MOD_1_1P_METHOD 2 /* 14.77% faster than 1 */ ++#define MOD_1_NORM_THRESHOLD 0 /* always */ ++#define MOD_1_UNNORM_THRESHOLD 0 /* always */ ++#define MOD_1N_TO_MOD_1_1_THRESHOLD 8 ++#define MOD_1U_TO_MOD_1_1_THRESHOLD 4 ++#define MOD_1_1_TO_MOD_1_2_THRESHOLD 22 ++#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */ ++#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 29 ++#define USE_PREINV_DIVREM_1 1 ++#define DIV_QR_1N_PI1_METHOD 1 /* 33.79% faster than 2 */ ++#define DIV_QR_1_NORM_THRESHOLD 3 ++#define DIV_QR_1_UNNORM_THRESHOLD 1 ++#define DIV_QR_2_PI2_THRESHOLD 13 ++#define DIVEXACT_1_THRESHOLD 0 /* always */ ++#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */ + +-This file is part of the GNU MP Library. ++#define DIV_1_VS_MUL_1_PERCENT 116 + +-The GNU MP Library is free software; you can redistribute it and/or modify +-it under the terms of either: ++#define MUL_TOOM22_THRESHOLD 12 ++#define MUL_TOOM33_THRESHOLD 77 ++#define MUL_TOOM44_THRESHOLD 118 ++#define MUL_TOOM6H_THRESHOLD 156 ++#define MUL_TOOM8H_THRESHOLD 212 + +- * the GNU Lesser General Public License as published by the Free +- Software Foundation; either version 3 of the License, or (at your +- option) any later version. ++#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73 ++#define MUL_TOOM32_TO_TOOM53_THRESHOLD 91 ++#define MUL_TOOM42_TO_TOOM53_THRESHOLD 73 ++#define MUL_TOOM42_TO_TOOM63_THRESHOLD 78 ++#define MUL_TOOM43_TO_TOOM54_THRESHOLD 88 + +-or ++#define SQR_BASECASE_THRESHOLD 4 ++#define SQR_TOOM2_THRESHOLD 26 ++#define SQR_TOOM3_THRESHOLD 85 ++#define SQR_TOOM4_THRESHOLD 142 ++#define SQR_TOOM6_THRESHOLD 180 ++#define SQR_TOOM8_THRESHOLD 260 + +- * the GNU General Public License as published by the Free Software +- Foundation; either version 2 of the License, or (at your option) any +- later version. ++#define MULMID_TOOM42_THRESHOLD 18 + +-or both in parallel, as here. ++#define MULMOD_BNM1_THRESHOLD 9 ++#define SQRMOD_BNM1_THRESHOLD 11 + +-The GNU MP Library is distributed in the hope that it will be useful, but +-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +-for more details. ++#define MUL_FFT_MODF_THRESHOLD 244 /* k = 5 */ ++#define MUL_FFT_TABLE3 \ ++ { { 244, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \ ++ { 7, 5}, { 15, 6}, { 15, 7}, { 8, 6}, \ ++ { 17, 7}, { 9, 6}, { 19, 7}, { 13, 8}, \ ++ { 7, 7}, { 17, 8}, { 9, 7}, { 20, 8}, \ ++ { 11, 7}, { 23, 8}, { 13, 9}, { 7, 8}, \ ++ { 19, 9}, { 11, 8}, { 25,10}, { 7, 9}, \ ++ { 15, 8}, { 33, 9}, { 19, 8}, { 39, 9}, \ ++ { 23,10}, { 15, 9}, { 39,10}, { 23,11}, \ ++ { 15,10}, { 31, 9}, { 67,10}, { 39, 9}, \ ++ { 79,10}, { 47,11}, { 2048,12}, { 4096,13}, \ ++ { 8192,14}, { 16384,15}, { 32768,16} } ++#define MUL_FFT_TABLE3_SIZE 43 ++#define MUL_FFT_THRESHOLD 2240 + +-You should have received copies of the GNU General Public License and the +-GNU Lesser General Public License along with the GNU MP Library. If not, +-see https://www.gnu.org/licenses/. */ ++#define SQR_FFT_MODF_THRESHOLD 208 /* k = 5 */ ++#define SQR_FFT_TABLE3 \ ++ { { 208, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \ ++ { 15, 7}, { 8, 6}, { 17, 7}, { 13, 8}, \ ++ { 7, 7}, { 17, 8}, { 9, 7}, { 20, 8}, \ ++ { 13, 9}, { 7, 8}, { 19, 9}, { 11, 8}, \ ++ { 25,10}, { 7, 9}, { 15, 8}, { 33, 9}, \ ++ { 19, 8}, { 39, 9}, { 27,10}, { 15, 9}, \ ++ { 39,10}, { 23,11}, { 15,10}, { 31, 9}, \ ++ { 63,10}, { 39, 8}, { 159, 7}, { 319, 9}, \ ++ { 83,10}, { 47,11}, { 2048,12}, { 4096,13}, \ ++ { 8192,14}, { 16384,15}, { 32768,16} } ++#define SQR_FFT_TABLE3_SIZE 39 ++#define SQR_FFT_THRESHOLD 1984 + ++#define MULLO_BASECASE_THRESHOLD 0 /* always */ ++#define MULLO_DC_THRESHOLD 43 ++#define MULLO_MUL_N_THRESHOLD 4392 ++#define SQRLO_BASECASE_THRESHOLD 0 /* always */ ++#define SQRLO_DC_THRESHOLD 90 ++#define SQRLO_SQR_THRESHOLD 590 + +-/* Values for GMP_LIMB_BITS etc will be determined by ./configure and put +- in config.h. */ ++#define DC_DIV_QR_THRESHOLD 35 ++#define DC_DIVAPPR_Q_THRESHOLD 151 ++#define DC_BDIV_QR_THRESHOLD 40 ++#define DC_BDIV_Q_THRESHOLD 86 ++ ++#define INV_MULMOD_BNM1_THRESHOLD 22 ++#define INV_NEWTON_THRESHOLD 228 ++#define INV_APPR_THRESHOLD 165 ++ ++#define BINV_NEWTON_THRESHOLD 236 ++#define REDC_1_TO_REDC_N_THRESHOLD 46 ++ ++#define MU_DIV_QR_THRESHOLD 979 ++#define MU_DIVAPPR_Q_THRESHOLD 1078 ++#define MUPI_DIV_QR_THRESHOLD 98 ++#define MU_BDIV_QR_THRESHOLD 807 ++#define MU_BDIV_Q_THRESHOLD 979 ++ ++#define POWM_SEC_TABLE 7,34,135,579,1378 ++ ++#define GET_STR_DC_THRESHOLD 19 ++#define GET_STR_PRECOMPUTE_THRESHOLD 27 ++#define SET_STR_DC_THRESHOLD 228 ++#define SET_STR_PRECOMPUTE_THRESHOLD 1356 ++ ++#define FAC_DSC_THRESHOLD 270 ++#define FAC_ODD_THRESHOLD 0 /* always */ ++ ++#define MATRIX22_STRASSEN_THRESHOLD 15 ++#define HGCD2_DIV1_METHOD 3 /* 5.64% faster than 1 */ ++#define HGCD_THRESHOLD 84 ++#define HGCD_APPR_THRESHOLD 101 ++#define HGCD_REDUCE_THRESHOLD 1437 ++#define GCD_DC_THRESHOLD 327 ++#define GCDEXT_DC_THRESHOLD 253 ++#define JACOBI_BASE_METHOD 4 /* 2.47% faster than 3 */ ++ ++/* Tuneup completed successfully, took 74 seconds */ diff --git a/recipes/gmp/config.yml b/recipes/gmp/config.yml index 7beafba5ffe630..4be5637d7da8f0 100644 --- a/recipes/gmp/config.yml +++ b/recipes/gmp/config.yml @@ -1,4 +1,6 @@ versions: + "6.3.0": + folder: all "6.2.1": folder: all "6.2.0": diff --git a/recipes/gnu-config/all/conanfile.py b/recipes/gnu-config/all/conanfile.py index 21b5d5bd149701..ad0c56aabe7bd0 100644 --- a/recipes/gnu-config/all/conanfile.py +++ b/recipes/gnu-config/all/conanfile.py @@ -14,8 +14,8 @@ class GnuConfigConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" topics = ("gnu", "config", "autotools", "canonical", "host", "build", "target", "triplet") license = "GPL-3.0-or-later", "autoconf-special-exception" + package_type = "build-scripts" os = "arch", "compiler", "build_type", "arch" - no_copy_source = True def export_sources(self): export_conandata_patches(self) @@ -27,8 +27,7 @@ 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): apply_conandata_patches(self) diff --git a/recipes/gnutls/all/conanfile.py b/recipes/gnutls/all/conanfile.py index 9f3b2e2521c516..193f97471c98ac 100644 --- a/recipes/gnutls/all/conanfile.py +++ b/recipes/gnutls/all/conanfile.py @@ -66,14 +66,14 @@ def layout(self): def requirements(self): self.requires("nettle/3.8.1") - self.requires("gmp/6.2.1") + self.requires("gmp/6.3.0") self.requires("libiconv/1.17") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: - self.requires("zstd/1.5.4") + self.requires("zstd/1.5.5") if self.options.with_brotli: - self.requires("brotli/1.0.9") + self.requires("brotli/1.1.0") def validate(self): if is_msvc(self): @@ -81,7 +81,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.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/godot_headers/all/conandata.yml b/recipes/godot_headers/all/conandata.yml index 8764611b2ac9a5..de60664696e4bf 100644 --- a/recipes/godot_headers/all/conandata.yml +++ b/recipes/godot_headers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.5.2": + url: "https://github.com/godotengine/godot-headers/archive/godot-3.5.2-stable.tar.gz" + sha256: "42e97953d3f193db01cccd856dff0430a6737d47b8496a70e7df34387d870a6e" "3.5.1": url: "https://github.com/godotengine/godot-headers/archive/godot-3.5.1-stable.tar.gz" sha256: "1c38268031425a4881c0d6d41926a0f1bf5847f05dc24c29332609e318276b6b" diff --git a/recipes/godot_headers/all/conanfile.py b/recipes/godot_headers/all/conanfile.py index 0a0d46219f9db5..ed0b3120bd04c5 100644 --- a/recipes/godot_headers/all/conanfile.py +++ b/recipes/godot_headers/all/conanfile.py @@ -13,6 +13,7 @@ class GodotHeadersConan(ConanFile): homepage = "https://github.com/godotengine/godot_headers" description = "Godot Native interface headers" topics = ("game-engine", "game-development") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -23,8 +24,7 @@ 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 diff --git a/recipes/godot_headers/all/test_v1_package/CMakeLists.txt b/recipes/godot_headers/all/test_v1_package/CMakeLists.txt index 643dedc50d02ad..de3b75d9538de0 100644 --- a/recipes/godot_headers/all/test_v1_package/CMakeLists.txt +++ b/recipes/godot_headers/all/test_v1_package/CMakeLists.txt @@ -4,7 +4,5 @@ project(test_package LANGUAGES C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(godot_headers REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE godot_headers::godot_headers) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/godot_headers/config.yml b/recipes/godot_headers/config.yml index 3ded438e58f33b..07764b9a8e270f 100644 --- a/recipes/godot_headers/config.yml +++ b/recipes/godot_headers/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.2": + folder: all "3.5.1": folder: all "3.4.4": diff --git a/recipes/google-cloud-cpp/2.x/components_2_15_1.py b/recipes/google-cloud-cpp/2.x/components_2_15_1.py new file mode 100644 index 00000000000000..6de02bc36704bb --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/components_2_15_1.py @@ -0,0 +1,441 @@ +# Automatically generated by /usr/local/google/home/coryan/cci-develop/recipes/google-cloud-cpp/2.x/extract_dependencies.py DO NOT EDIT +DEPENDENCIES = { + "accessapproval_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "accesscontextmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "advisorynotifications_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "aiplatform_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_interval_protos', 'type_money_protos'], + "alloydb_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "apigateway_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apigeeconnect_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apikeys_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "appengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "artifactregistry_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "asset_protos": ['accesscontextmanager_protos', 'api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'osconfig_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_expr_protos', 'type_timeofday_protos'], + "assuredworkloads_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "automl_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "baremetalsolution_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "batch_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "beyondcorp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "bigquery_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos', 'type_expr_protos'], + "bigtable_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "billing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos', 'type_money_protos'], + "binaryauthorization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "certificatemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "channel_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_decimal_protos', 'type_money_protos', 'type_postal_address_protos'], + "cloudbuild_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "commerce_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_common_common_protos": ['api_field_behavior_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "composer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "confidentialcomputing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "connectors_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "contactcenterinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "container_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "containeranalysis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "contentwarehouse_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'documentai_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_expr_protos', 'type_interval_protos', 'type_money_protos', 'type_postal_address_protos'], + "datacatalog_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "datafusion_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "datamigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataplex_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataproc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "datastore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "datastream_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "deploy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "dialogflow_cx_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dialogflow_es_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "discoveryengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "dlp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "documentai_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_money_protos', 'type_postal_address_protos'], + "domains_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_money_protos', 'type_postal_address_protos'], + "edgecontainer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "essentialcontacts_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "eventarc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "filestore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'cloud_common_common_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "functions_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "gkebackup_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkehub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkemulticloud_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "grafeas_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iam_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "iam_v2_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "iap_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "ids_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "kms_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "language_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "logging_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "logging_type_protos": ['grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "managedidentities_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "memcache_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "metastore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos'], + "migrationcenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_money_protos'], + "monitoring_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_calendar_period_protos'], + "networkconnectivity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkmanagement_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networksecurity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "notebooks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "optimization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "orgpolicy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_expr_protos'], + "osconfig_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "oslogin_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "policysimulator_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_expr_protos'], + "policytroubleshooter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'iam_v2_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "privateca_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "profiler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "pubsub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "rapidmigrationassessment_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "recaptchaenterprise_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "recommender_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_money_protos'], + "redis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "resourcemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "resourcesettings_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "retail_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "run_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "scheduler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "secretmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "securitycenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "servicecontrol_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'protobuf::libprotobuf', 'rpc_context_attribute_context_protos', 'rpc_status_protos'], + "servicedirectory_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "servicemanagement_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_config_change_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_policy_protos', 'api_quota_protos', 'api_resource_protos', 'api_service_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "serviceusage_protos": ['api_annotations_protos', 'api_auth_protos', 'api_client_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "shell_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "spanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "speech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "storage_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos'], + "storageinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos'], + "storagetransfer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_timeofday_protos'], + "support_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "talent_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos', 'type_money_protos', 'type_postal_address_protos', 'type_timeofday_protos'], + "tasks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "texttospeech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "timeseriesinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "tpu_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "trace_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "translate_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "video_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_datetime_protos'], + "videointelligence_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vision_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_latlng_protos'], + "vmmigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos'], + "vmwareengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vpcaccess_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "webrisk_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "websecurityscanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "workflows_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "workstations_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "api_annotations_protos": ['api_http_protos'], + "api_auth_protos": ['api_annotations_protos'], + "api_billing_protos": ['api_annotations_protos', 'api_metric_protos'], + "api_client_protos": ['api_launch_stage_protos'], + "api_distribution_protos": ['api_annotations_protos'], + "api_endpoint_protos": ['api_annotations_protos'], + "api_log_protos": ['api_label_protos'], + "api_logging_protos": ['api_annotations_protos', 'api_label_protos'], + "api_metric_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitored_resource_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitoring_protos": ['api_annotations_protos'], + "api_quota_protos": ['api_annotations_protos'], + "api_service_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos'], + "api_usage_protos": ['api_annotations_protos', 'api_visibility_protos'], + "iam_credentials_v1_common_protos": ['api_field_behavior_protos', 'api_resource_protos'], + "iam_credentials_v1_iamcredentials_protos": ['api_annotations_protos', 'api_client_protos', 'iam_credentials_v1_common_protos'], + "iam_v1_iam_policy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_resource_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos'], + "iam_v1_options_protos": ['api_annotations_protos'], + "iam_v1_policy_protos": ['api_annotations_protos', 'type_expr_protos'], +} + +PROTO_COMPONENTS = { + "accessapproval_protos", + "accesscontextmanager_protos", + "advisorynotifications_protos", + "aiplatform_protos", + "alloydb_protos", + "api_annotations_protos", + "api_auth_protos", + "api_backend_protos", + "api_billing_protos", + "api_client_protos", + "api_config_change_protos", + "api_context_protos", + "api_control_protos", + "api_distribution_protos", + "api_documentation_protos", + "api_endpoint_protos", + "api_field_behavior_protos", + "api_http_protos", + "api_httpbody_protos", + "api_label_protos", + "api_launch_stage_protos", + "api_log_protos", + "api_logging_protos", + "api_metric_protos", + "api_monitored_resource_protos", + "api_monitoring_protos", + "api_policy_protos", + "api_quota_protos", + "api_resource_protos", + "api_routing_protos", + "api_service_protos", + "api_source_info_protos", + "api_system_parameter_protos", + "api_usage_protos", + "api_visibility_protos", + "apigateway_protos", + "apigeeconnect_protos", + "apikeys_protos", + "appengine_protos", + "artifactregistry_protos", + "asset_protos", + "assuredworkloads_protos", + "automl_protos", + "baremetalsolution_protos", + "batch_protos", + "beyondcorp_protos", + "bigquery_protos", + "bigtable_protos", + "billing_protos", + "binaryauthorization_protos", + "certificatemanager_protos", + "channel_protos", + "cloud_common_common_protos", + "cloudbuild_protos", + "commerce_protos", + "composer_protos", + "confidentialcomputing_protos", + "connectors_protos", + "contactcenterinsights_protos", + "container_protos", + "containeranalysis_protos", + "contentwarehouse_protos", + "datacatalog_protos", + "datafusion_protos", + "datamigration_protos", + "dataplex_protos", + "dataproc_protos", + "datastore_protos", + "datastream_protos", + "deploy_protos", + "devtools_source_v1_source_context_protos", + "dialogflow_cx_protos", + "dialogflow_es_protos", + "discoveryengine_protos", + "dlp_protos", + "documentai_protos", + "domains_protos", + "edgecontainer_protos", + "essentialcontacts_protos", + "eventarc_protos", + "filestore_protos", + "functions_protos", + "gkebackup_protos", + "gkehub_protos", + "gkemulticloud_protos", + "grafeas_protos", + "iam_credentials_v1_common_protos", + "iam_credentials_v1_iamcredentials_protos", + "iam_protos", + "iam_v1_iam_policy_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + "iam_v2_protos", + "iap_protos", + "ids_protos", + "kms_protos", + "language_protos", + "logging_protos", + "logging_type_protos", + "logging_type_type_protos", + "longrunning_operations_protos", + "managedidentities_protos", + "memcache_protos", + "metastore_protos", + "migrationcenter_protos", + "monitoring_protos", + "networkconnectivity_protos", + "networkmanagement_protos", + "networksecurity_protos", + "networkservices_protos", + "notebooks_protos", + "optimization_protos", + "orgpolicy_protos", + "osconfig_protos", + "oslogin_protos", + "policysimulator_protos", + "policytroubleshooter_protos", + "privateca_protos", + "profiler_protos", + "pubsub_protos", + "rapidmigrationassessment_protos", + "recaptchaenterprise_protos", + "recommender_protos", + "redis_protos", + "resourcemanager_protos", + "resourcesettings_protos", + "retail_protos", + "rpc_code_protos", + "rpc_context_attribute_context_protos", + "rpc_error_details_protos", + "rpc_status_protos", + "run_protos", + "scheduler_protos", + "secretmanager_protos", + "securitycenter_protos", + "servicecontrol_protos", + "servicedirectory_protos", + "servicemanagement_protos", + "serviceusage_protos", + "shell_protos", + "spanner_protos", + "speech_protos", + "storage_protos", + "storageinsights_protos", + "storagetransfer_protos", + "support_protos", + "talent_protos", + "tasks_protos", + "texttospeech_protos", + "timeseriesinsights_protos", + "tpu_protos", + "trace_protos", + "translate_protos", + "type_calendar_period_protos", + "type_color_protos", + "type_date_protos", + "type_datetime_protos", + "type_dayofweek_protos", + "type_decimal_protos", + "type_expr_protos", + "type_interval_protos", + "type_latlng_protos", + "type_money_protos", + "type_postal_address_protos", + "type_timeofday_protos", + "video_protos", + "videointelligence_protos", + "vision_protos", + "vmmigration_protos", + "vmwareengine_protos", + "vpcaccess_protos", + "webrisk_protos", + "websecurityscanner_protos", + "workflows_protos", + "workstations_protos" +} + +COMPONENTS = { + "accessapproval", + "accesscontextmanager", + "advisorynotifications", + "aiplatform", + "alloydb", + "apigateway", + "apigeeconnect", + "apikeys", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "commerce", + "composer", + "confidentialcomputing", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "contentwarehouse", + "datacatalog", + "datafusion", + "datamigration", + "dataplex", + "dataproc", + "datastore", + "datastream", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "discoveryengine", + "dlp", + "documentai", + "domains", + "edgecontainer", + "essentialcontacts", + "eventarc", + "filestore", + "functions", + "gkebackup", + "gkehub", + "gkemulticloud", + "iam", + "iap", + "ids", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "metastore", + "migrationcenter", + "monitoring", + "networkconnectivity", + "networkmanagement", + "networksecurity", + "networkservices", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policysimulator", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "rapidmigrationassessment", + "recaptchaenterprise", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "storage", + "storageinsights", + "storagetransfer", + "support", + "talent", + "tasks", + "texttospeech", + "timeseriesinsights", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows", + "workstations" +} diff --git a/recipes/google-cloud-cpp/2.x/conandata.yml b/recipes/google-cloud-cpp/2.x/conandata.yml index d9339e05c5ec41..dfb3c94da034e6 100644 --- a/recipes/google-cloud-cpp/2.x/conandata.yml +++ b/recipes/google-cloud-cpp/2.x/conandata.yml @@ -5,6 +5,9 @@ sources: "2.12.0": url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.12.0.tar.gz" sha256: "8cda870803925c62de8716a765e03eb9d34249977e5cdb7d0d20367e997a55e2" + "2.15.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.15.1.tar.gz" + sha256: "47a5c6beff48625fa1b65b1ddc575247def80c88d29062c66d463172280d3959" patches: "2.5.0": - patch_file: "patches/2.5.0/002-interface-library-properties.patch" @@ -22,7 +25,15 @@ patches: patch_source: https://github.com/googleapis/google-cloud-cpp/pull/10636 patch_description: "Fix problems with INTERFACE proto libraries" patch_type: backport + - patch_file: "patches/2.5.0/006-cannot-use-or-with-windows.patch" + patch_source: https://github.com/googleapis/google-cloud-cpp/pull/10612 + patch_description: "MSVC does not like `or` spelling for `||`" + patch_type: backport "2.12.0": - patch_file: "patches/2.12.0/001-use-conan-msvc-runtime.patch" patch_description: "Let Conan select the MSVC runtime" patch_type: conan + "2.15.1": + - patch_file: "patches/2.15.1/001-use-conan-msvc-runtime.patch" + patch_description: "Let Conan select the MSVC runtime" + patch_type: conan diff --git a/recipes/google-cloud-cpp/2.x/conanfile.py b/recipes/google-cloud-cpp/2.x/conanfile.py index 810fc35bc2f60a..e3b497dfc81dbe 100644 --- a/recipes/google-cloud-cpp/2.x/conanfile.py +++ b/recipes/google-cloud-cpp/2.x/conanfile.py @@ -3,7 +3,7 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd, cross_building from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.env import VirtualRunEnv, VirtualBuildEnv +from conan.tools.env import VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.scm import Version @@ -21,6 +21,7 @@ # than writing long lists of dependencies by hand. import components_2_5_0 import components_2_12_0 +import components_2_15_1 required_conan_version = ">=1.56.0" @@ -46,6 +47,7 @@ class GoogleCloudCppConan(ConanFile): default_options = {"shared": False, "fPIC": True} exports = ["components_2_5_0.py", "components_2_12_0.py", + "components_2_15_1.py", ] short_paths = True @@ -53,14 +55,17 @@ class GoogleCloudCppConan(ConanFile): _GA_COMPONENTS = { '2.5.0': components_2_5_0.COMPONENTS, '2.12.0': components_2_12_0.COMPONENTS, + '2.15.1': components_2_15_1.COMPONENTS, } _PROTO_COMPONENTS = { '2.5.0': components_2_5_0.PROTO_COMPONENTS, '2.12.0': components_2_12_0.PROTO_COMPONENTS, + '2.15.1': components_2_15_1.PROTO_COMPONENTS, } _PROTO_COMPONENT_DEPENDENCIES = { "2.5.0": components_2_5_0.DEPENDENCIES, "2.12.0": components_2_12_0.DEPENDENCIES, + "2.15.1": components_2_15_1.DEPENDENCIES, } # Some components require custom dependency definitions. _REQUIRES_CUSTOM_DEPENDENCIES = { @@ -138,23 +143,26 @@ def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def requirements(self): - self.requires("protobuf/3.21.9", transitive_headers=True) - self.requires("grpc/1.50.1", transitive_headers=True) - self.requires("nlohmann_json/3.10.0") - self.requires("crc32c/1.1.1") - self.requires("abseil/20220623.0", transitive_headers=True) - self.requires("libcurl/7.88.1") + # These must remain pinned in conan index. + self.requires("protobuf/3.21.12", transitive_headers=True) + self.requires("abseil/20230125.3", transitive_headers=True) + self.requires("grpc/1.54.3", transitive_headers=True) + self.requires("nlohmann_json/3.11.2") + self.requires("crc32c/1.1.2") + # The rest require less pinning. + self.requires("libcurl/[>=7.78 <9]") self.requires("openssl/[>=1.1 <4]") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def build_requirements(self): - # For the grpc-cpp-plugin executable - self.tool_requires("grpc/1.50.1") + # For the `grpc-cpp-plugin` executable, and indirectly `protoc` + self.tool_requires("grpc/") def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False tc.variables["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False + tc.variables["GOOGLE_CLOUD_CPP_ENABLE_WERROR"] = False tc.variables["GOOGLE_CLOUD_CPP_ENABLE"] = ",".join(self._components()) tc.generate() VirtualRunEnv(self).generate(scope="build") @@ -170,9 +178,14 @@ def _patch_sources(self): # https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html settings_build = getattr(self, "settings_build", self.settings) if settings_build.os == "Macos": - replace_in_file(self, os.path.join(self.source_folder, "cmake/CompileProtos.cmake"), - "$", - '${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" $') + if Version(self.version) < '2.12.0': + replace_in_file(self, os.path.join(self.source_folder, "cmake/CompileProtos.cmake"), + "$", + '${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" $') + else: + replace_in_file(self, os.path.join(self.source_folder, "cmake/CompileProtos.cmake"), + "${Protobuf_PROTOC_EXECUTABLE} ARGS", + '${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" ${Protobuf_PROTOC_EXECUTABLE} ARGS') def build(self): self._patch_sources() @@ -218,6 +231,11 @@ def _proto_components(self): if self.settings.os == "Android": result.remove('accesscontextmanager_protos') result.remove('talent_protos') + if Version(self.version) >= '2.15.1': + # This was converted to an interface library starting on 2.15.1 + result.remove('logging_type_type_protos') + # These were removed (as they are not used) starting on 2.15.1 + result.remove('devtools_source_v1_source_context_protos') return result def package(self): @@ -249,7 +267,21 @@ def package_info(self): # A small number of gRPC-generated stubs are used directly in the common components # shared by all gRPC-based libraries. These must be defined without reference to `grpc_utils`. - GRPC_UTILS_REQUIRED_PROTOS={"iam_protos", "longrunning_operations_protos", "rpc_error_details_protos", "rpc_status_protos"} + if Version(self.version) >= '2.15.1': + GRPC_UTILS_REQUIRED_PROTOS = { + "iam_credentials_v1_iamcredentials_protos", + "iam_v1_policy_protos", + "longrunning_operations_protos", + "rpc_error_details_protos", + "rpc_status_protos", + } + else: + GRPC_UTILS_REQUIRED_PROTOS = { + "iam_protos", + "longrunning_operations_protos", + "rpc_error_details_protos", + "rpc_status_protos", + } for component in GRPC_UTILS_REQUIRED_PROTOS: self._add_proto_component(component) @@ -258,36 +290,51 @@ def package_info(self): self.cpp_info.components["grpc_utils"].names["pkg_config"] = "google_cloud_cpp_grpc_utils" for component in self._proto_components(): + if Version(self.version) >= '2.15.1' and component == 'storage_protos': + # Starting with v2.15.1 the `storage_protos` are compiled only + # when needed. They are not used in Conan because they are only + # needed for an experimental library, supporting an allow-listed + # service. + continue if component not in GRPC_UTILS_REQUIRED_PROTOS: self._add_proto_component(component) # Interface libraries for backwards compatibility - self.cpp_info.components["dialogflow_es_protos"].requires = ["cloud_dialogflow_v2_protos"] - self.cpp_info.components["logging_type_protos"].requires = ["logging_type_type_protos"] - self.cpp_info.components["speech_protos"].requires = ["cloud_speech_protos"] - self.cpp_info.components["texttospeech_protos"].requires = ["cloud_texttospeech_protos"] - self.cpp_info.components["trace_protos"].requires = [ - "devtools_cloudtrace_v2_trace_protos", - "devtools_cloudtrace_v2_tracing_protos", - ] + if Version(self.version) < '2.15.1': + self.cpp_info.components["dialogflow_es_protos"].requires = ["cloud_dialogflow_v2_protos"] + self.cpp_info.components["logging_type_protos"].requires = ["logging_type_type_protos"] + self.cpp_info.components["speech_protos"].requires = ["cloud_speech_protos"] + self.cpp_info.components["texttospeech_protos"].requires = ["cloud_texttospeech_protos"] + self.cpp_info.components["trace_protos"].requires = [ + "devtools_cloudtrace_v2_trace_protos", + "devtools_cloudtrace_v2_tracing_protos", + ] + self._add_grpc_component("bigquery", "cloud_bigquery_protos") + else: + self.cpp_info.components["cloud_bigquery_protos"].requires = ["bigquery_protos"] + self.cpp_info.components["cloud_dialogflow_v2_protos"].requires = ["dialogflow_es_protos"] + self.cpp_info.components["cloud_speech_protos"].requires = ["speech_protos"] + self.cpp_info.components["cloud_texttospeech_protos"].requires = ["texttospeech_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].requires = ["trace_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].requires = ["trace_protos"] + self.cpp_info.components["logging_type_type_protos"].requires = ["logging_type_protos"] for component in self._components(): + protos=f"{component}_protos" # bigquery proto library predates the adoption of more consistent naming - if component == 'bigquery': + if component == 'bigquery' and Version(self.version) < '2.15.1': self._add_proto_component("cloud_bigquery_protos") self._add_grpc_component(component, "cloud_bigquery_protos") continue - if component == 'dialogflow_es': + if component == 'dialogflow_es' and Version(self.version) < '2.15.1': self._add_proto_component("cloud_dialogflow_v2_protos") self._add_grpc_component(component, "cloud_dialogflow_v2_protos") continue # `storage` is the only component that does not depend on a matching `*_protos` library - protos=f"{component}_protos" if component in self._REQUIRES_CUSTOM_DEPENDENCIES: continue self._add_grpc_component(component, protos) - self._add_grpc_component("bigquery", "cloud_bigquery_protos") self._add_grpc_component("bigtable", "bigtable_protos") self._add_grpc_component("iam", "iam_protos") self._add_grpc_component("pubsub", "pubsub_protos", ["abseil::absl_flat_hash_map"]) diff --git a/recipes/google-cloud-cpp/2.x/extract_dependencies.py b/recipes/google-cloud-cpp/2.x/extract_dependencies.py index 1a7607684544aa..a957a6eca412b8 100755 --- a/recipes/google-cloud-cpp/2.x/extract_dependencies.py +++ b/recipes/google-cloud-cpp/2.x/extract_dependencies.py @@ -41,17 +41,12 @@ "cloud_osconfig_v1_osconfig_protos": "osconfig_protos", "devtools_source_v1_source_protos": "devtools_source_v1_source_context_protos", "cloud_documentai_v1_documentai_protos": "documentai_protos", + "iam_v2_policy_protos": "iam_v2_protos", } # A few *.deps files use ad-hoc naming. _PROTO_DEPS_REPLACED_NAMES = { "common": "cloud_common_common", - "bigquery": "cloud_bigquery", - "dialogflow": "cloud_dialogflow_v2", - "logging_type": "logging_type_type", - "texttospeech": "cloud_texttospeech", - "speech": "cloud_speech", - "trace": "devtools_cloudtrace_v2_trace", } # A few *.deps files are not used. @@ -90,7 +85,6 @@ "type_expr_protos", "api_routing_protos", "api_usage_protos", - "logging_type_type_protos", "type_calendar_period_protos", "rpc_code_protos", "api_system_parameter_protos", @@ -109,6 +103,9 @@ "api_field_behavior_protos", "api_context_protos", "api_logging_protos", + + "iam_credentials_v1_common_protos", + "iam_credentials_v1_iamcredentials_protos", } # A list of experimental components used when `google-cloud-cpp` does not @@ -256,12 +253,24 @@ "api_system_parameter_protos", "api_usage_protos", ], - "devtools_cloudtrace_v2_tracing_protos": [ - "devtools_cloudtrace_v2_trace_protos", - "devtools_cloudtrace_v2_trace_protos", + "iam_v1_options_protos": ["api_annotations_protos"], + "iam_v1_policy_protos": ["api_annotations_protos", "type_expr_protos"], + "iam_v1_iam_policy_protos": [ + "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", - "rpc_status_protos", + "api_resource_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + ], + "iam_credentials_v1_common_protos": [ + "api_field_behavior_protos", + "api_resource_protos", + ], + "iam_credentials_v1_iamcredentials_protos": [ + "api_annotations_protos", + "api_client_protos", + "iam_credentials_v1_common_protos", ], } diff --git a/recipes/google-cloud-cpp/2.x/patches/2.15.1/001-use-conan-msvc-runtime.patch b/recipes/google-cloud-cpp/2.x/patches/2.15.1/001-use-conan-msvc-runtime.patch new file mode 100644 index 00000000000000..f1d07df8262020 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.15.1/001-use-conan-msvc-runtime.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 66e3e7c3..32e64b5d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,7 +53,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + endif () + + list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) +-include(SelectMSVCRuntime) + + option(GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK + "If enabled, check that the user has defined OPENSSL_ROOT_DIR on macOS" +diff --git a/cmake/GoogleCloudCppCommon.cmake b/cmake/GoogleCloudCppCommon.cmake +index b487a1bc..880c98fe 100644 +--- a/cmake/GoogleCloudCppCommon.cmake ++++ b/cmake/GoogleCloudCppCommon.cmake +@@ -17,9 +17,6 @@ + # Get the destination directories based on the GNU recommendations. + include(GNUInstallDirs) + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + # Enable Werror + include(EnableWerror) + +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index ec8b7395..91a7b32d 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -20,9 +20,6 @@ if (NOT GOOGLE_CLOUD_CPP_ENABLE_EXAMPLES) + return() + endif () + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + if (bigtable IN_LIST GOOGLE_CLOUD_CPP_ENABLE AND storage IN_LIST + GOOGLE_CLOUD_CPP_ENABLE) + add_executable(gcs2cbt gcs2cbt.cc) +diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt +index 15dcc92f..b6146bfe 100644 +--- a/external/googleapis/CMakeLists.txt ++++ b/external/googleapis/CMakeLists.txt +@@ -163,8 +163,6 @@ externalproject_add( + + google_cloud_cpp_find_proto_include_dir(PROTO_INCLUDE_DIR) + +-include(SelectMSVCRuntime) +- + google_cloud_cpp_add_protos_property() + + function (external_googleapis_short_name var proto) diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/006-cannot-use-or-with-windows.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/006-cannot-use-or-with-windows.patch new file mode 100644 index 00000000000000..ef18553443bdaf --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/006-cannot-use-or-with-windows.patch @@ -0,0 +1,45 @@ +diff --git a/google/cloud/internal/oauth2_compute_engine_credentials.cc b/google/cloud/internal/oauth2_compute_engine_credentials.cc +index 9cb45a6..5c6b45d 100644 +--- a/google/cloud/internal/oauth2_compute_engine_credentials.cc ++++ b/google/cloud/internal/oauth2_compute_engine_credentials.cc +@@ -68,8 +68,8 @@ StatusOr ParseComputeEngineRefreshResponse( + auto payload = rest_internal::ReadAll(std::move(response).ExtractPayload()); + if (!payload.ok()) return payload.status(); + auto access_token = nlohmann::json::parse(*payload, nullptr, false); +- if (access_token.is_discarded() || access_token.count("access_token") == 0 or +- access_token.count("expires_in") == 0 or ++ if (access_token.is_discarded() || access_token.count("access_token") == 0 || ++ access_token.count("expires_in") == 0 || + access_token.count("token_type") == 0) { + auto error_payload = + *payload + +diff --git a/google/cloud/storage/oauth2/compute_engine_credentials.cc b/google/cloud/storage/oauth2/compute_engine_credentials.cc +index 365273a..92e631c 100644 +--- a/google/cloud/storage/oauth2/compute_engine_credentials.cc ++++ b/google/cloud/storage/oauth2/compute_engine_credentials.cc +@@ -36,8 +36,8 @@ ParseComputeEngineRefreshResponse( + // Response should have the attributes "access_token", "expires_in", and + // "token_type". + auto access_token = nlohmann::json::parse(response.payload, nullptr, false); +- if (!access_token.is_object() || access_token.count("access_token") == 0 or +- access_token.count("expires_in") == 0 or ++ if (!access_token.is_object() || access_token.count("access_token") == 0 || ++ access_token.count("expires_in") == 0 || + access_token.count("token_type") == 0) { + auto payload = + response.payload + +diff --git a/google/cloud/storage/oauth2/service_account_credentials.cc b/google/cloud/storage/oauth2/service_account_credentials.cc +index 4c600db..34c4e72 100644 +--- a/google/cloud/storage/oauth2/service_account_credentials.cc ++++ b/google/cloud/storage/oauth2/service_account_credentials.cc +@@ -85,8 +85,8 @@ ParseServiceAccountRefreshResponse( + storage::internal::HttpResponse const& response, + std::chrono::system_clock::time_point now) { + auto access_token = nlohmann::json::parse(response.payload, nullptr, false); +- if (access_token.is_discarded() || access_token.count("access_token") == 0 or +- access_token.count("expires_in") == 0 or ++ if (access_token.is_discarded() || access_token.count("access_token") == 0 || ++ access_token.count("expires_in") == 0 || + access_token.count("token_type") == 0) { + auto payload = + response.payload + diff --git a/recipes/google-cloud-cpp/config.yml b/recipes/google-cloud-cpp/config.yml index d5603efb5114af..ad2df7e79e43a7 100644 --- a/recipes/google-cloud-cpp/config.yml +++ b/recipes/google-cloud-cpp/config.yml @@ -13,3 +13,5 @@ versions: folder: "2.x" "2.12.0": folder: "2.x" + "2.15.1": + folder: "2.x" diff --git a/recipes/googleapis/all/conanfile.py b/recipes/googleapis/all/conanfile.py index c1eae06780f755..7d10eb1883d33e 100644 --- a/recipes/googleapis/all/conanfile.py +++ b/recipes/googleapis/all/conanfile.py @@ -1,20 +1,19 @@ -import os import functools import glob +import os from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import can_run, check_min_cppstd +from conan.tools.build import check_min_cppstd 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, copy, export_conandata_patches, get from conan.tools.microsoft import is_msvc from conan.tools.scm import Version - from helpers import parse_proto_libraries -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.5" class GoogleAPIS(ConanFile): @@ -29,17 +28,17 @@ class GoogleAPIS(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - } + } default_options = { "shared": False, "fPIC": True, - } + } exports = "helpers.py" short_paths = True @property - def _protobuf_version(self): - return "3.21.9" + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") def export_sources(self): copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=os.path.join(self.export_sources_folder, "src")) @@ -59,7 +58,7 @@ def layout(self): def requirements(self): # https://github.com/conan-io/conan-center-index/pull/15601#issuecomment-1493086506 - self.requires(f"protobuf/{self._protobuf_version}", transitive_headers=True, transitive_libs=True, run=can_run(self)) + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -69,12 +68,12 @@ def validate(self): if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration("Source code generated from protos is missing some export macro") - if self.options.shared and not self.dependencies["protobuf"].options.shared: + if self.options.shared and not self.dependencies.host["protobuf"].options.shared: raise ConanInvalidConfiguration("If built as shared, protobuf must be shared as well. Please, use `protobuf:shared=True`") def build_requirements(self): - if not can_run(self): - self.tool_requires(f"protobuf/{self._protobuf_version}") + if not self._is_legacy_one_profile: + self.tool_requires("protobuf/") # CMake >= 3.20 is required. There is a proto with dots in the name 'k8s.min.proto' and CMake fails to generate project files self.tool_requires("cmake/[>=3.20 <4]") @@ -84,7 +83,7 @@ def source(self): def generate(self): VirtualBuildEnv(self).generate() - if can_run(self): + if self._is_legacy_one_profile: VirtualRunEnv(self).generate(scope="build") tc = CMakeToolchain(self) tc.generate() diff --git a/recipes/googleapis/all/test_package/conanfile.py b/recipes/googleapis/all/test_package/conanfile.py index 58019cb35dee58..bb39603872037a 100644 --- a/recipes/googleapis/all/test_package/conanfile.py +++ b/recipes/googleapis/all/test_package/conanfile.py @@ -1,23 +1,21 @@ import os + from conan import ConanFile -from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() + 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() diff --git a/recipes/gperftools/all/conandata.yml b/recipes/gperftools/all/conandata.yml index 8b70af34880378..b141978957b857 100644 --- a/recipes/gperftools/all/conandata.yml +++ b/recipes/gperftools/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.13.0": + url: "https://github.com/gperftools/gperftools/releases/download/gperftools-2.13/gperftools-2.13.tar.gz" + sha256: "4882c5ece69f8691e51ffd6486df7d79dbf43b0c909d84d3c0883e30d27323e7" + "2.12.0": + url: "https://github.com/gperftools/gperftools/releases/download/gperftools-2.12/gperftools-2.12.tar.gz" + sha256: "fb611b56871a3d9c92ab0cc41f9c807e8dfa81a54a4a9de7f30e838756b5c7c6" + "2.11.0": + url: "https://github.com/gperftools/gperftools/releases/download/gperftools-2.11/gperftools-2.11.tar.gz" + sha256: "8ffda10e7c500fea23df182d7adddbf378a203c681515ad913c28a64b87e24dc" "2.10.0": url: "https://github.com/gperftools/gperftools/releases/download/gperftools-2.10/gperftools-2.10.tar.gz" sha256: "83e3bfdd28b8bcf53222c3798d4d395d52dadbbae59e8730c4a6d31a9c3732d8" diff --git a/recipes/gperftools/all/conanfile.py b/recipes/gperftools/all/conanfile.py index 60812b411ba177..d1bcecf43d3948 100644 --- a/recipes/gperftools/all/conanfile.py +++ b/recipes/gperftools/all/conanfile.py @@ -1,17 +1,16 @@ -import os - from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name, is_apple_os, XCRun -from conan.tools.build import cross_building +from conan.tools.build import cross_building, check_min_cppstd from conan.tools.cmake import cmake_layout from conan.tools.env import VirtualRunEnv from conan.tools.files import get, copy, rm, rmdir, replace_in_file from conan.tools.gnu import AutotoolsToolchain, AutotoolsDeps, Autotools +from conan.tools.scm import Version +import os required_conan_version = ">=1.53.0" - class GperftoolsConan(ConanFile): name = "gperftools" description = "High-performance multi-threaded malloc()" @@ -58,6 +57,10 @@ class GperftoolsConan(ConanFile): "tcmalloc_pagesize": None, } + @property + def _min_cppstd(self): + return 11 + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -88,9 +91,15 @@ 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) + + if Version(self.version) >= "2.11.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration(f"{self.ref} does not support gcc < 7.") + if self.settings.os == "Windows": raise ConanInvalidConfiguration( - "gperftools recipe does not currently support Windows. Contributions are welcome." + f"{self.ref} does not currently support Windows. Contributions are welcome." ) def requirements(self): diff --git a/recipes/gperftools/all/test_package/CMakeLists.txt b/recipes/gperftools/all/test_package/CMakeLists.txt index c9f3e082d85e90..0f311015a73f50 100644 --- a/recipes/gperftools/all/test_package/CMakeLists.txt +++ b/recipes/gperftools/all/test_package/CMakeLists.txt @@ -5,6 +5,8 @@ find_package(gperftools REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE gperftools::gperftools) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) add_executable(${PROJECT_NAME}_minimal test_package.cpp) target_link_libraries(${PROJECT_NAME}_minimal PRIVATE gperftools::tcmalloc_minimal) +target_compile_features(${PROJECT_NAME}_minimal PRIVATE cxx_std_11) diff --git a/recipes/gperftools/config.yml b/recipes/gperftools/config.yml index 22d65dcfdfac61..65392d0c25ec5d 100644 --- a/recipes/gperftools/config.yml +++ b/recipes/gperftools/config.yml @@ -1,3 +1,9 @@ versions: + "2.13.0": + folder: all + "2.12.0": + folder: all + "2.11.0": + folder: all "2.10.0": folder: all diff --git a/recipes/graphene/all/conanfile.py b/recipes/graphene/all/conanfile.py index 39254a6f16cdfb..8f5581630fd908 100644 --- a/recipes/graphene/all/conanfile.py +++ b/recipes/graphene/all/conanfile.py @@ -4,7 +4,7 @@ from conan.errors import ConanInvalidConfiguration 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.files import copy, get, rm, rmdir, replace_in_file from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain @@ -51,7 +51,7 @@ def layout(self): def requirements(self): if self.options.with_glib: - self.requires("glib/2.76.2") + self.requires("glib/2.78.0") def validate(self): if self.settings.compiler == "gcc": @@ -70,9 +70,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.1.0") + self.tool_requires("meson/1.2.2") if not self.conf.get("tools.gnu:pkg_config", default=False): - 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) @@ -97,7 +97,15 @@ def generate(self): meson.project_options["introspection"] = "disabled" meson.generate() + def _patch_sources(self): + # 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, "meson.build"), + "'-ffast-math'", + "'-ffast-math', '-fno-finite-math-only'") + def build(self): + self._patch_sources() meson = Meson(self) meson.configure() meson.build() diff --git a/recipes/grpc-proto/all/conanfile.py b/recipes/grpc-proto/all/conanfile.py index 5ab0a942ba98e6..e0de5ab7f7c55d 100644 --- a/recipes/grpc-proto/all/conanfile.py +++ b/recipes/grpc-proto/all/conanfile.py @@ -3,7 +3,7 @@ from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration -from conan.tools.build import can_run, check_min_cppstd +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import get, collect_libs, copy @@ -11,7 +11,7 @@ from helpers import parse_proto_libraries -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" class GRPCProto(ConanFile): @@ -33,6 +33,10 @@ class GRPCProto(ConanFile): } exports = "helpers.py" + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def export_sources(self): copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) @@ -56,7 +60,7 @@ def layout(self): def requirements(self): # protobuf symbols are exposed from generated structures # https://github.com/conan-io/conan-center-index/pull/16185#issuecomment-1501174215 - self.requires("protobuf/3.21.9", transitive_headers=True, transitive_libs=True, run=can_run(self)) + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) self.requires("googleapis/cci.20230501") def validate(self): @@ -71,8 +75,8 @@ def validate(self): ) def build_requirements(self): - if not can_run(self): - self.tool_requires("protobuf/3.21.9") + if not self._is_legacy_one_profile: + self.tool_requires("protobuf/") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -80,7 +84,7 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if can_run(self): + if self._is_legacy_one_profile: env = VirtualRunEnv(self) env.generate(scope="build") tc = CMakeToolchain(self) diff --git a/recipes/grpc/all/conandata.yml b/recipes/grpc/all/conandata.yml index afbe96ebd2a5ea..02c1ca609ebd21 100644 --- a/recipes/grpc/all/conandata.yml +++ b/recipes/grpc/all/conandata.yml @@ -1,24 +1,22 @@ sources: + "1.54.3": + url: "https://github.com/grpc/grpc/archive/v1.54.3.tar.gz" + sha256: "17e4e1b100657b88027721220cbfb694d86c4b807e9257eaf2fb2d273b41b1b1" "1.50.1": url: "https://github.com/grpc/grpc/archive/v1.50.1.tar.gz" sha256: "fb1ed98eb3555877d55eb2b948caca44bc8601c6704896594de81558639709ef" "1.50.0": url: "https://github.com/grpc/grpc/archive/v1.50.0.tar.gz" sha256: "76900ab068da86378395a8e125b5cc43dfae671e09ff6462ddfef18676e2165a" - "1.47.1": - url: "https://github.com/grpc/grpc/archive/v1.47.1.tar.gz" - sha256: "ba7c36989ad8a52c813adeebb0c65869283448f496dbb2868c75f69941dec6a9" - "1.46.3": - url: "https://github.com/grpc/grpc/archive/refs/tags/v1.46.3.tar.gz" - sha256: "d6cbf22cb5007af71b61c6be316a79397469c58c82a942552a62e708bce60964" + "1.48.4": + url: "https://github.com/grpc/grpc/archive/v1.48.4.tar.gz" + sha256: "0c3faa83e39d4f1ab55fe1476362b9ac3b81632a46dce7fd4d50271bce816b53" patches: "1.50.1": - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" "1.50.0": - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" - "1.48.0": + "1.48.4": - patch_file: "patches/v1.48.x/001-disable-cppstd-override.patch" - "1.47.1": - - patch_file: "patches/v1.47.x/001-disable-cppstd-override.patch" - "1.46.3": - - patch_file: "patches/v1.46.x/001-disable-cppstd-override.patch" + patch_description: "disable cpp std override" + patch_type: "portability" diff --git a/recipes/grpc/all/conanfile.py b/recipes/grpc/all/conanfile.py index 3187b094b35594..998e680f1000a3 100644 --- a/recipes/grpc/all/conanfile.py +++ b/recipes/grpc/all/conanfile.py @@ -1,5 +1,4 @@ import os -import shutil from conan import ConanFile from conan.errors import ConanInvalidConfiguration @@ -86,15 +85,18 @@ def layout(self): def requirements(self): # abseil is public. See https://github.com/conan-io/conan-center-index/pull/17284#issuecomment-1526082638 - if is_msvc(self) and Version(self.version) < "1.47": - self.requires("abseil/20211102.0", transitive_headers=True, transitive_libs=True) + if Version(self.version) < "1.47": + if is_msvc(self): + self.requires("abseil/20211102.0", transitive_headers=True, transitive_libs=True) + else: + self.requires("abseil/20220623.1", transitive_headers=True, transitive_libs=True) else: - self.requires("abseil/20220623.0", transitive_headers=True, transitive_libs=True) - self.requires("c-ares/1.19.0") + self.requires("abseil/20230125.3", transitive_headers=True, transitive_libs=True) + self.requires("c-ares/1.19.1") self.requires("openssl/[>=1.1 <4]") self.requires("re2/20230301") - self.requires("zlib/1.2.13") - self.requires("protobuf/3.21.9", transitive_headers=True, transitive_libs=True, run=can_run(self)) + self.requires("zlib/[>=1.2.11 <2]") + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True, run=can_run(self)) def package_id(self): del self.info.options.secure @@ -119,7 +121,7 @@ def validate(self): def build_requirements(self): if not can_run(self): - self.tool_requires("protobuf/3.21.9") + self.tool_requires("protobuf/3.21.12") if cross_building(self): # when cross compiling we need pre compiled grpc plugins for protoc self.tool_requires(f"grpc/{self.version}") @@ -309,6 +311,7 @@ def corefoundation(): "abseil::absl_status", "abseil::absl_str_format", "abseil::absl_strings", "abseil::absl_synchronization", "abseil::absl_time", "abseil::absl_optional", + "abseil::absl_flags", ], "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), }, diff --git a/recipes/grpc/all/patches/v1.46.x/001-disable-cppstd-override.patch b/recipes/grpc/all/patches/v1.46.x/001-disable-cppstd-override.patch deleted file mode 100644 index a2601246759471..00000000000000 --- a/recipes/grpc/all/patches/v1.46.x/001-disable-cppstd-override.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7a97604b75..7ae815042f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -222,21 +222,6 @@ if (NOT DEFINED CMAKE_C_STANDARD) - set(CMAKE_C_STANDARD 99) - endif() - --# Add c++11 flags --if (NOT DEFINED CMAKE_CXX_STANDARD) -- set(CMAKE_CXX_STANDARD 11) --else() -- if (CMAKE_CXX_STANDARD LESS 11) -- message(FATAL_ERROR "CMAKE_CXX_STANDARD is less than 11, please specify at least SET(CMAKE_CXX_STANDARD 11)") -- endif() --endif() --if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) -- set(CMAKE_CXX_STANDARD_REQUIRED ON) --endif() --if (NOT DEFINED CMAKE_CXX_EXTENSIONS) -- set(CMAKE_CXX_EXTENSIONS OFF) --endif() -- - if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) - set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) - endif() diff --git a/recipes/grpc/all/patches/v1.47.x/001-disable-cppstd-override.patch b/recipes/grpc/all/patches/v1.47.x/001-disable-cppstd-override.patch deleted file mode 100644 index 0ba329e6480bcc..00000000000000 --- a/recipes/grpc/all/patches/v1.47.x/001-disable-cppstd-override.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index db075cbe4a..289cc52215 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -220,26 +220,6 @@ if(WIN32) - set(_gRPC_PLATFORM_WINDOWS ON) - endif() - -- # Use C11 standard --if (NOT DEFINED CMAKE_C_STANDARD) -- set(CMAKE_C_STANDARD 11) --endif() -- --# Add c++14 flags --if (NOT DEFINED CMAKE_CXX_STANDARD) -- set(CMAKE_CXX_STANDARD 14) --else() -- if (CMAKE_CXX_STANDARD LESS 14) -- message(FATAL_ERROR "CMAKE_CXX_STANDARD is less than 14, please specify at least SET(CMAKE_CXX_STANDARD 14)") -- endif() --endif() --if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) -- set(CMAKE_CXX_STANDARD_REQUIRED ON) --endif() --if (NOT DEFINED CMAKE_CXX_EXTENSIONS) -- set(CMAKE_CXX_EXTENSIONS OFF) --endif() -- - if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) - set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) - endif() diff --git a/recipes/grpc/all/patches/v1.48.x/001-disable-cppstd-override.patch b/recipes/grpc/all/patches/v1.48.x/001-disable-cppstd-override.patch index 65b655ba1f8b59..dee7836ac518bd 100644 --- a/recipes/grpc/all/patches/v1.48.x/001-disable-cppstd-override.patch +++ b/recipes/grpc/all/patches/v1.48.x/001-disable-cppstd-override.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 25990a5..f37849c 100644 +index 1ecaea8eb7..0788b88177 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,21 +226,6 @@ if (NOT DEFINED CMAKE_C_STANDARD) @@ -24,3 +24,16 @@ index 25990a5..f37849c 100644 if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) endif() +diff --git a/src/core/ext/xds/xds_http_fault_filter.cc b/src/core/ext/xds/xds_http_fault_filter.cc +index 2a10d2fd27..0900fedf61 100644 +--- a/src/core/ext/xds/xds_http_fault_filter.cc ++++ b/src/core/ext/xds/xds_http_fault_filter.cc +@@ -109,7 +109,7 @@ absl::StatusOr ParseHttpFaultIntoJson( + int abort_http_status_code = + envoy_extensions_filters_http_fault_v3_FaultAbort_http_status( + fault_abort); +- if (abort_http_status_code != 0 and abort_http_status_code != 200) { ++ if (abort_http_status_code != 0 && abort_http_status_code != 200) { + abort_grpc_status_code = + grpc_http2_status_to_grpc_status(abort_http_status_code); + } diff --git a/recipes/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch b/recipes/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch index a9339dbcc896b4..fb952330fde1cb 100644 --- a/recipes/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch +++ b/recipes/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch @@ -5,7 +5,7 @@ index 7052846..259fa93 100644 @@ -227,21 +227,6 @@ if (NOT DEFINED CMAKE_C_STANDARD) set(CMAKE_C_STANDARD 11) endif() - + -# Add c++14 flags -if (NOT DEFINED CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 14) diff --git a/recipes/grpc/config.yml b/recipes/grpc/config.yml index d36f53e1f178cb..0e75e172635d25 100644 --- a/recipes/grpc/config.yml +++ b/recipes/grpc/config.yml @@ -1,9 +1,9 @@ versions: + "1.54.3": + folder: "all" "1.50.1": folder: "all" "1.50.0": folder: "all" - "1.47.1": - folder: "all" - "1.46.3": + "1.48.4": folder: "all" diff --git a/recipes/gsl-lite/all/conandata.yml b/recipes/gsl-lite/all/conandata.yml index 010ad6b469c3c4..48441a1526519c 100644 --- a/recipes/gsl-lite/all/conandata.yml +++ b/recipes/gsl-lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.41.0": + url: "https://github.com/gsl-lite/gsl-lite/archive/v0.41.0.tar.gz" + sha256: "4682d8a60260321b92555760be3b9caab60e2a71f95eddbdfb91e557ee93302a" "0.40.0": url: "https://github.com/gsl-lite/gsl-lite/archive/v0.40.0.tar.gz" sha256: "65af4ec8a1050dac4f1ca4622881bb02a9c3978a9baec289fb56e25412d6cac7" @@ -14,9 +17,3 @@ sources: "0.37.0": url: "https://github.com/gsl-lite/gsl-lite/archive/0.37.0.zip" sha256: "980c8e91dd25bfaac7bfbd7151f04027fa68ff0bf652baa11de137242641e399" - "0.36.0": - url: "https://github.com/martinmoene/gsl-lite/archive/v0.36.0.zip" - sha256: "ab1bb560611dcf9cef2265b8e40e59689bb4af1fd64914aa4a8eff945dd75057" - "0.34.0": - url: "https://github.com/martinmoene/gsl-lite/archive/v0.34.0.zip" - sha256: "44255fd8aab1780773a5a2a16703c9c5a95f8c944d95caa7c468b229c0fcd1ff" diff --git a/recipes/gsl-lite/all/conanfile.py b/recipes/gsl-lite/all/conanfile.py index d59ea8610e6a35..498e3972927b91 100644 --- a/recipes/gsl-lite/all/conanfile.py +++ b/recipes/gsl-lite/all/conanfile.py @@ -1,8 +1,9 @@ from conan import ConanFile from conan.tools.files import get, copy +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.50.0" class GslLiteConan(ConanFile): @@ -10,10 +11,10 @@ class GslLiteConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinmoene/gsl-lite" - topics = ("GSL") + topics = ("GSL",) description = "A single-file header-only version of ISO C++ " \ "Guideline Support Library (GSL) for C++98, C++11 and later" - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" # There are three configuration options for this GSL implementation's behavior # when pre/post conditions on the GSL types are violated: @@ -31,10 +32,6 @@ class GslLiteConan(ConanFile): no_copy_source = True - @property - def _source_subfolder(self): - return os.path.join(self.source_folder, "source_subfolder") - @property def _contract_map(self): return { @@ -43,20 +40,24 @@ def _contract_map(self): "unenforced": "GSL_UNENFORCED_ON_CONTRACT_VIOLATION" } + 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_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - copy(self, "*gsl-lite.hpp", src=self._source_subfolder, dst=self.package_folder) - copy(self, "LICENSE", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "gsl-lite") self.cpp_info.set_property("cmake_target_name", "gsl::gsl-lite") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] # TODO: back to global scope in conan v2 once cmake_find_package* generators removed self.cpp_info.components["gsllite"].defines = [self._contract_map[str(self.options.on_contract_violation)]] @@ -68,3 +69,5 @@ def package_info(self): self.cpp_info.components["gsllite"].names["cmake_find_package"] = "gsl-lite" self.cpp_info.components["gsllite"].names["cmake_find_package_multi"] = "gsl-lite" self.cpp_info.components["gsllite"].set_property("cmake_target_name", "gsl::gsl-lite") + self.cpp_info.components["gsllite"].bindirs = [] + self.cpp_info.components["gsllite"].libdirs = [] diff --git a/recipes/gsl-lite/all/test_package/CMakeLists.txt b/recipes/gsl-lite/all/test_package/CMakeLists.txt index 0063a1958556f2..b4d8ae0dd1ce89 100644 --- a/recipes/gsl-lite/all/test_package/CMakeLists.txt +++ b/recipes/gsl-lite/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(gsl-lite REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} gsl::gsl-lite) +target_link_libraries(${PROJECT_NAME} PRIVATE gsl::gsl-lite) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gsl-lite/all/test_v1_package/CMakeLists.txt b/recipes/gsl-lite/all/test_v1_package/CMakeLists.txt index 6042a2363b626a..b21cc49efde95c 100644 --- a/recipes/gsl-lite/all/test_v1_package/CMakeLists.txt +++ b/recipes/gsl-lite/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(gsl-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE gsl::gsl-lite) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gsl-lite/all/test_v1_package/conanfile.py b/recipes/gsl-lite/all/test_v1_package/conanfile.py index db36d97f3c4652..7895db93c24a6e 100644 --- a/recipes/gsl-lite/all/test_v1_package/conanfile.py +++ b/recipes/gsl-lite/all/test_v1_package/conanfile.py @@ -7,10 +7,6 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) diff --git a/recipes/gsl-lite/config.yml b/recipes/gsl-lite/config.yml index d21a23d317e336..587567b5e7b67f 100644 --- a/recipes/gsl-lite/config.yml +++ b/recipes/gsl-lite/config.yml @@ -1,4 +1,6 @@ versions: + "0.41.0": + folder: all "0.40.0": folder: all "0.39.0": @@ -9,7 +11,3 @@ versions: folder: all "0.37.0": folder: all - "0.36.0": - folder: all - "0.34.0": - folder: all diff --git a/recipes/gsoap/all/conandata.yml b/recipes/gsoap/all/conandata.yml index 4a616af7b7a292..c340912f083485 100644 --- a/recipes/gsoap/all/conandata.yml +++ b/recipes/gsoap/all/conandata.yml @@ -1,21 +1,18 @@ sources: - "2.8.117": + "2.8.129": url: - - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.117.zip/download" - - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.117.zip" + - "https://downloads.sourceforge.net/project/gsoap2/gsoap_2.8.129.zip" + - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.129.zip" + sha256: "16cb8852ea791a6aec8f0213d619c15eecc8171e0c888f3b0e0c66d3ef78e20a" + "2.8.117": + url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.117.zip" sha256: "7cadf8808cfd982629948fe09e4fa6cd18e23cafd40df0aaaff1b1f5b695c442" "2.8.116": - url: - - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.116.zip/download" - - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.116.zip" + url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.116.zip" sha256: "2a41e42aaddbcd603b99004af95bb83559dbd4fd2d842920f003d24867599192" "2.8.115": - url: - - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.115.zip/download" - - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.115.zip" + url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.115.zip" sha256: "6f6813b189d201022254a2879cc8ee005bdb1bcf126bc03238710f19ec4e7268" "2.8.114": - url: - - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.114.zip/download" - - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.114.zip" + url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.114.zip" sha256: "aa70a999258100c170a3f8750c1f91318a477d440f6a28117f68bc1ded32327f" diff --git a/recipes/gsoap/all/conanfile.py b/recipes/gsoap/all/conanfile.py index 38b4629ae4211b..6f49eae5e182d0 100644 --- a/recipes/gsoap/all/conanfile.py +++ b/recipes/gsoap/all/conanfile.py @@ -32,14 +32,16 @@ class GsoapConan(ConanFile): "with_cookies": True, "with_c_locale": True, } - - exports_sources = "CMakeLists.txt", "cmake/*.cmake" short_paths = True @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + copy(self, "cmake/*.cmake", self.recipe_folder, self.export_sources_folder) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -50,7 +52,7 @@ def layout(self): def requirements(self): if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]", transitive_headers=True) - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def build_requirements(self): if cross_building(self, skip_x64_x86=True) and hasattr(self, "settings_build"): @@ -95,11 +97,11 @@ def package(self): def package_info(self): defines = [] if self.options.with_openssl: - libs = ["gsoapssl++", ] + libs = ["gsoapssl++"] defines.append("WITH_OPENSSL") defines.append("WITH_GZIP") else: - libs = ["gsoap++", ] + libs = ["gsoap++"] self.cpp_info.libs = libs if self.options.with_ipv6: diff --git a/recipes/gsoap/all/test_package/CMakeLists.txt b/recipes/gsoap/all/test_package/CMakeLists.txt index 1464ab750d83b5..9d9cb52d4bac7b 100644 --- a/recipes/gsoap/all/test_package/CMakeLists.txt +++ b/recipes/gsoap/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 CXX) find_package(gsoap REQUIRED CONFIG) diff --git a/recipes/gsoap/all/test_package/conanfile.py b/recipes/gsoap/all/test_package/conanfile.py index 1ea623e022729d..60209e04ba8a60 100644 --- a/recipes/gsoap/all/test_package/conanfile.py +++ b/recipes/gsoap/all/test_package/conanfile.py @@ -2,7 +2,6 @@ from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout from conan.tools.env import VirtualBuildEnv, VirtualRunEnv -from conan.tools.scm import Version import os @@ -32,7 +31,7 @@ def build(self): calc_wsdl = os.path.join(self.source_folder, "calc.wsdl") self.output.info(f"Generating code from WSDL '{calc_wsdl}'") self.run(f"wsdl2h -o calc.h {calc_wsdl}") - if Version(conan_version).major < "2": + if conan_version.major < "2": # conan v1 limitation: self.dependencies is not defined in build() method of test package import_dir = os.path.join(self.deps_cpp_info["gsoap"].rootpath, "bin", "import") else: @@ -45,5 +44,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/gsoap/all/test_v1_package/CMakeLists.txt b/recipes/gsoap/all/test_v1_package/CMakeLists.txt index 0d20897301b68b..b21cc49efde95c 100644 --- a/recipes/gsoap/all/test_v1_package/CMakeLists.txt +++ b/recipes/gsoap/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) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/gsoap/config.yml b/recipes/gsoap/config.yml index 01534d05392ba9..22f6a1710f7353 100644 --- a/recipes/gsoap/config.yml +++ b/recipes/gsoap/config.yml @@ -1,4 +1,6 @@ versions: + "2.8.129": + folder: all "2.8.117": folder: all "2.8.116": diff --git a/recipes/gtest/all/conandata.yml b/recipes/gtest/all/conandata.yml index 1634a1e79e6fdf..b22247dc8573db 100644 --- a/recipes/gtest/all/conandata.yml +++ b/recipes/gtest/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.14.0": + url: "https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz" + sha256: "8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7" "1.13.0": url: "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz" sha256: "ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363" diff --git a/recipes/gtest/config.yml b/recipes/gtest/config.yml index ee070419b09c37..fa66f2eb7d4d78 100644 --- a/recipes/gtest/config.yml +++ b/recipes/gtest/config.yml @@ -1,4 +1,6 @@ versions: + "1.14.0": + folder: all "1.13.0": folder: all "1.12.1": diff --git a/recipes/gtsam/all/conandata.yml b/recipes/gtsam/all/conandata.yml index a7ab46e7ea6fbd..243d25034c49ec 100644 --- a/recipes/gtsam/all/conandata.yml +++ b/recipes/gtsam/all/conandata.yml @@ -1,14 +1,24 @@ sources: + "4.2": + url: "https://github.com/borglab/gtsam/archive/refs/tags/4.2.tar.gz" + sha256: "9ff8846d0a83a245c284cb5760ec2d74535ef9b5885183ccfefd7ff122eba60e" "4.1.1": url: "https://github.com/borglab/gtsam/archive/4.1.1.tar.gz" sha256: "c7b5e6cdad52b141c272778f47baf628975457be3e26ed96a7bc2ae685a00af0" "4.0.3": url: "https://github.com/borglab/gtsam/archive/4.0.3.tar.gz" sha256: "eaa561749edf7a2d402981828253e28aed6c717dae35738301c5ab23e2595f25" - "4.0.2": - url: "https://github.com/borglab/gtsam/archive/4.0.2.tar.gz" - sha256: "8770a440f1af98c3f0d9d4dffd568de2d4c21b245e7231e987e26bc236aeb5aa" patches: + "4.2": + - patch_file: "patches/4.1.1-0001-cmake-boost.patch" + patch_description: "Use boost targets" + patch_type: "conan" + - patch_file: "patches/4.2.0-0001-macos-rpath.patch" + patch_description: "Relocatable shared libs on Apple OS" + patch_type: "conan" + - patch_file: "patches/4.2.0-0002-eigen3-version.patch" + patch_description: "Get Eigen3 version info from Conan" + patch_type: "conan" "4.1.1": - patch_file: "patches/4.1.1-0001-cmake-boost.patch" patch_description: "Use boost targets" @@ -19,9 +29,12 @@ patches: - patch_file: "patches/4.1.1-0003-macos-rpath.patch" patch_description: "Relocatable shared libs on Apple OS" patch_type: "conan" - - patch_file: "patches/4.0.2-0003-cmake-project.patch" + - patch_file: "patches/4.0.3-0004-cmake-project.patch" patch_description: "CMake: move project() after cmake_minimum_required()" patch_type: "conan" + - patch_file: "patches/4.1.1-0005-eigen3-version.patch" + patch_description: "Get Eigen3 version info from Conan" + patch_type: "conan" "4.0.3": - patch_file: "patches/4.0.3-0001-cmake-boost.patch" patch_description: "Use boost targets" @@ -32,19 +45,6 @@ patches: - patch_file: "patches/4.0.3-0003-macos-rpath.patch" patch_description: "Relocatable shared libs on Apple OS" patch_type: "conan" - - patch_file: "patches/4.0.2-0003-cmake-project.patch" - patch_description: "CMake: move project() after cmake_minimum_required()" - patch_type: "conan" - "4.0.2": - - patch_file: "patches/4.0.2-0001-cmake-boost.patch" - patch_description: "Use boost targets" - patch_type: "conan" - - patch_file: "patches/4.0.2-0002-cmake-eigen.patch" - patch_description: "Use Eigen include variable from CMakeDeps" - patch_type: "conan" - - patch_file: "patches/4.0.2-0003-macos-rpath.patch" - patch_description: "Relocatable shared libs on Apple OS" - patch_type: "conan" - - patch_file: "patches/4.0.2-0003-cmake-project.patch" + - patch_file: "patches/4.0.3-0004-cmake-project.patch" patch_description: "CMake: move project() after cmake_minimum_required()" patch_type: "conan" diff --git a/recipes/gtsam/all/conanfile.py b/recipes/gtsam/all/conanfile.py index 6ed583d1786ac9..bca7930e912c29 100644 --- a/recipes/gtsam/all/conanfile.py +++ b/recipes/gtsam/all/conanfile.py @@ -15,58 +15,100 @@ class GtsamConan(ConanFile): license = "BSD-3-Clause" homepage = "https://github.com/borglab/gtsam" url = "https://github.com/conan-io/conan-center-index" - description = ("GTSAM is a library of C++ classes that implement\ - smoothing and mapping (SAM) in robotics and vision") - topics = ("mapping", "smoothing") + description = ("GTSAM is a library of C++ classes that implement " + "smoothing and mapping (SAM) in robotics and vision") + topics = ("mapping", "smoothing", "optimization", "factor-graphs") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "use_quaternions": [True, False], + "allow_deprecated": [True, False], + "allow_deprecated_since_V4": [True, False, "deprecated"], + "build_type_postfixes": [True, False], + "build_unstable": [True, False], + "build_with_march_native": [True, False], + "default_allocator": [None, "STL", "BoostPool", "TBB", "tcmalloc"], + "disable_new_timers": [True, False], + "enable_consistency_checks": [True, False], + "install_cppunitlite": [True, False], + "install_matlab_toolbox": [True, False], "pose3_expmap": [True, False], "rot3_expmap": [True, False], - "enable_consistency_checks": [True, False], + "slow_but_correct_betweenfactor": [True, False], + "support_nested_dissection": [True, False], + "tangent_preintegration": [True, False], + "throw_cheirality_exception": [True, False], + "use_quaternions": [True, False], "with_TBB": [True, False], "with_eigen_MKL": [True, False], "with_eigen_MKL_OPENMP": [True, False], - "throw_cheirality_exception": [True, False], - "allow_deprecated_since_V4": [True, False], - "typedef_points_to_vectors": [True, False], - "support_nested_dissection": [True, False], - "tangent_preintegration": [True, False], + + # Removed since v4.1 "build_wrap": [True, False], - "wrap_serialization": [True, False], - "build_unstable": [True, False], - "disable_new_timers": [True, False], - "build_type_postfixes": [True, False], - "install_matlab_toolbox": [True, False], "install_cython_toolbox": [True, False], - "install_cppunitlite": [True, False], + "typedef_points_to_vectors": [True, False], + "wrap_serialization": [True, False], } default_options = { "shared": False, "fPIC": True, - "use_quaternions": False, + "allow_deprecated": True, + "allow_deprecated_since_V4": "deprecated", + "build_type_postfixes": True, + "build_unstable": True, + "build_with_march_native": False, + "default_allocator": None, + "disable_new_timers": False, + "enable_consistency_checks": False, + "install_cppunitlite": True, + "install_matlab_toolbox": False, "pose3_expmap": False, "rot3_expmap": False, - "enable_consistency_checks": False, + "slow_but_correct_betweenfactor": False, + "support_nested_dissection": False, + "tangent_preintegration": False, + "throw_cheirality_exception": True, + "use_quaternions": False, "with_TBB": False, "with_eigen_MKL": False, "with_eigen_MKL_OPENMP": False, - "throw_cheirality_exception": True, - "allow_deprecated_since_V4": True, - "typedef_points_to_vectors": False, - "support_nested_dissection": False, - "tangent_preintegration": False, + + # < v4.1 only "build_wrap": False, - "wrap_serialization": True, - "build_unstable": True, - "disable_new_timers": False, - "build_type_postfixes": True, - "install_matlab_toolbox": False, "install_cython_toolbox": False, - "install_cppunitlite": True, + "typedef_points_to_vectors": False, + "wrap_serialization": True, + } + options_description = { + "allow_deprecated": "Allow use of deprecated methods/functions", + "build_type_postfixes": "Append the build type to the name of compiled libraries", + "build_unstable": "Enable building of gtsam_unstable", + "build_with_march_native": "Build with all instructions supported by native architecture (binary may not be portable!)", + "default_allocator": "Set preferred memory allocator. If unset, defaults to STL or to TBB, if with_TBB is enabled", + "disable_new_timers": "Disables using Boost.chrono for timing", + "enable_consistency_checks": "Enable expensive consistency checks", + "install_cppunitlite": "Install CppUnitLite library as a component", + "install_matlab_toolbox": "Install MATLAB toolbox", + "pose3_expmap": "Use Pose3::EXPMAP as the default mode. If disabled, Pose3::FIRST_ORDER will be used.", + "rot3_expmap": ("Ignore if GTSAM_USE_QUATERNIONS is OFF (Rot3::EXPMAP by default). " + "Otherwise, enable Rot3::EXPMAP, or if disabled, use Rot3::CAYLEY."), + "slow_but_correct_betweenfactor": "Use the slower but correct version of BetweenFactor", + "support_nested_dissection": "Support Metis-based nested dissection", + "tangent_preintegration": "Use the new ImuFactor with integration on tangent space", + "throw_cheirality_exception": "Throw exception when a triangulated point is behind a camera", + "use_quaternions": ("Enable an internal Quaternion representation for rotations instead of rotation matrices. " + "If enabled, Rot3::EXPMAP is enforced by default."), + "with_TBB": "Use Intel Threaded Building Blocks (TBB)", + "with_eigen_MKL": "Eigen will use Intel MKL if available", + "with_eigen_MKL_OPENMP": "Eigen, when using Intel MKL, will also use OpenMP for multithreading if available", + + # < v4.1 only + "build_wrap": "Build Matlab/Cython wrap utility (necessary for Matlab/Cython interface)", + "install_cython_toolbox": "Install Cython toolbox", + "typedef_points_to_vectors": "Typedef Point2 and Point3 to Eigen::Vector equivalents", + "wrap_serialization": "Allow wrapped objects to be saved via boost.serialization", } def export_sources(self): @@ -75,43 +117,90 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) >= "4.1": + del self.options.build_wrap + del self.options.install_cython_toolbox + del self.options.typedef_points_to_vectors + del self.options.wrap_serialization + else: + del self.options.slow_but_correct_betweenfactor def configure(self): if self.options.shared: self.options.rm_safe("fPIC") if self.options.with_TBB: self.options["onetbb"].tbbmalloc = True + if self.options.allow_deprecated_since_V4 != "deprecated": + self.output.warn("'allow_deprecated_since_V4' option is deprecated. Use 'allow_deprecated' instead.") + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0") - self.requires("eigen/3.4.0") + self.requires("boost/1.83.0", transitive_headers=True) + self.requires("eigen/3.4.0", transitive_headers=True) if self.options.with_TBB: - self.requires("onetbb/2020.3") + self.requires("onetbb/2021.10.0", transitive_headers=True) + if self.options.default_allocator == "tcmalloc": + self.requires("gperftools/2.11.0") + # TODO: add use_vendored_metis=False option + # if self.options.support_nested_dissection and not self.options.use_vendored_metis: + # # Used in a public header here: + # # https://github.com/borglab/gtsam/blob/4.2a9/gtsam_unstable/partition/FindSeparator-inl.h#L23-L27 + # self.requires("metis/5.1.1", transitive_headers=True) @property def _required_boost_components(self): - return ["serialization", "system", "filesystem", "thread", "date_time", "regex", "timer", "chrono"] + # Based on https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleBoost.cmake#L26 + return [ + "chrono", + "date_time", + "filesystem", + "program_options", + "regex", + "serialization", + "system", + "thread", + "timer", + ] def validate(self): - miss_boost_required_comp = any(self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) - for boost_comp in self._required_boost_components) + 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.ref} requires non header-only boost with these components: " f"{', '.join(self._required_boost_components)}" ) - if self.options.with_TBB and not self.dependencies["onetbb"].options.tbbmalloc: - raise ConanInvalidConfiguration("gtsam with tbb requires onetbb:tbbmalloc=True") + if self.options.with_TBB: + if self.options.default_allocator in [None, "TBB"]: + if not self.dependencies["onetbb"].options.tbbmalloc: + raise ConanInvalidConfiguration("GTSAM with TBB requires onetbb/*:tbbmalloc=True") + elif self.options.default_allocator != "tcmalloc": + raise ConanInvalidConfiguration( + "with_TBB option cannot be used with" + f" default_allocator={self.options.default_allocator}" + ) + elif self.options.default_allocator == "TBB": + raise ConanInvalidConfiguration("default_allocator=TBB requires with_TBB=True") check_min_vs(self, "191") - if Version(self.version) >= "4.1.0" and is_msvc(self) and self.options.shared: + if Version(self.version) >= "4.1" and is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration( - f"{self.ref} does not support shared builds with MSVC. See https://github.com/borglab/gtsam/issues/1087" + f"{self.ref} does not support shared builds with MSVC. See" + "https://github.com/borglab/gtsam/issues/1087" + if Version(self.version) < "4.2" + else "https://github.com/borglab/gtsam/issues/1541" + ) + + if self.options.allow_deprecated_since_V4 != "deprecated": + self.output.warn( + "'allow_deprecated_since_V4' option is deprecated. Use 'allow_deprecated' instead." ) def source(self): @@ -120,6 +209,10 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleGeneralOptions.cmake + tc.variables["GTSAM_BUILD_UNSTABLE"] = self.options.build_unstable + tc.variables["GTSAM_UNSTABLE_BUILD_PYTHON"] = False + tc.variables["GTSAM_UNSTABLE_INSTALL_MATLAB_TOOLBOX"] = self.options.install_matlab_toolbox tc.variables["GTSAM_USE_QUATERNIONS"] = self.options.use_quaternions tc.variables["GTSAM_POSE3_EXPMAP"] = self.options.pose3_expmap tc.variables["GTSAM_ROT3_EXPMAP"] = self.options.rot3_expmap @@ -128,41 +221,89 @@ def generate(self): tc.variables["GTSAM_WITH_EIGEN_MKL"] = self.options.with_eigen_MKL tc.variables["GTSAM_WITH_EIGEN_MKL_OPENMP"] = self.options.with_eigen_MKL_OPENMP tc.variables["GTSAM_THROW_CHEIRALITY_EXCEPTION"] = self.options.throw_cheirality_exception - tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V4"] = self.options.allow_deprecated_since_V4 - tc.variables["GTSAM_TYPEDEF_POINTS_TO_VECTORS"] = self.options.typedef_points_to_vectors + tc.variables["GTSAM_BUILD_PYTHON"] = False + tc.variables["GTSAM_INSTALL_MATLAB_TOOLBOX"] = self.options.install_matlab_toolbox + tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V4"] = self.options.allow_deprecated + if self.options.allow_deprecated_since_V4 != "deprecated": + tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V4"] = self.options.allow_deprecated_since_V4 + tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V41"] = self.options.allow_deprecated + tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V42"] = self.options.allow_deprecated tc.variables["GTSAM_SUPPORT_NESTED_DISSECTION"] = self.options.support_nested_dissection tc.variables["GTSAM_TANGENT_PREINTEGRATION"] = self.options.tangent_preintegration + # Added in 4.1+ + if Version(self.version) >= "4.1": + tc.variables["GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR"] = self.options.slow_but_correct_betweenfactor tc.variables["GTSAM_BUILD_WITH_CCACHE"] = False - tc.variables["GTSAM_BUILD_UNSTABLE"] = self.options.build_unstable - tc.variables["GTSAM_DISABLE_NEW_TIMERS"] = self.options.disable_new_timers + # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleAllocators.cmake + if self.options.default_allocator is not None: + tc.variables["GTSAM_DEFAULT_ALLOCATOR"] = self.options.default_allocator + # https://github.com/borglab/gtsam/blob/4.2a9/cmake/GtsamBuildTypes.cmake#L59 tc.variables["GTSAM_BUILD_TYPE_POSTFIXES"] = self.options.build_type_postfixes + # https://github.com/borglab/gtsam/blob/4.2a9/cmake/GtsamBuildTypes.cmake#L193 + tc.variables["GTSAM_BUILD_WITH_MARCH_NATIVE"] = self.options.build_with_march_native + # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleBoost.cmake#L36 + tc.variables["GTSAM_DISABLE_NEW_TIMERS"] = self.options.disable_new_timers + # https://github.com/borglab/gtsam/blob/4.2a9/CppUnitLite/CMakeLists.txt#L13 + tc.variables["GTSAM_INSTALL_CPPUNITLITE"] = self.options.install_cppunitlite + # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleEigen.cmake#L3 + tc.variables["GTSAM_USE_SYSTEM_EIGEN"] = True + # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleMetis.cmake#L11 + tc.variables["GTSAM_USE_SYSTEM_METIS"] = False + # https://github.com/borglab/gtsam/blob/4.2a9/gtsam/3rdparty/CMakeLists.txt#L76 + tc.variables["GTSAM_INSTALL_GEOGRAPHICLIB"] = False + # https://github.com/borglab/gtsam/blob/4.2a9/matlab/CMakeLists.txt#L14-L15 + tc.variables["GTSAM_MEX_BUILD_STATIC_MODULE"] = False + # https://github.com/borglab/gtsam/blob/4.2a9/cmake/GtsamTesting.cmake#L89-L91 tc.variables["GTSAM_BUILD_TESTS"] = False - tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared - tc.variables["Boost_NO_SYSTEM_PATHS"] = True + tc.variables["GTSAM_BUILD_EXAMPLES_ALWAYS"] = False + tc.variables["GTSAM_BUILD_TIMING_ALWAYS"] = False + # https://github.com/borglab/gtsam/blob/4.2a9/doc/CMakeLists.txt tc.variables["GTSAM_BUILD_DOCS"] = False tc.variables["GTSAM_BUILD_DOC_HTML"] = False - tc.variables["GTSAM_BUILD_EXAMPLES_ALWAYS"] = False - tc.variables["GTSAM_BUILD_WRAP"] = self.options.build_wrap - tc.variables["GTSAM_BUILD_WITH_MARCH_NATIVE"] = False - tc.variables["GTSAM_WRAP_SERIALIZATION"] = self.options.wrap_serialization - tc.variables["GTSAM_INSTALL_MATLAB_TOOLBOX"] = self.options.install_matlab_toolbox - tc.variables["GTSAM_INSTALL_CYTHON_TOOLBOX"] = self.options.install_cython_toolbox - tc.variables["GTSAM_INSTALL_CPPUNITLITE"] = self.options.install_cppunitlite - tc.variables["GTSAM_INSTALL_GEOGRAPHICLIB"] = False - tc.variables["GTSAM_USE_SYSTEM_EIGEN"] = True - tc.variables["GTSAM_BUILD_TYPE_POSTFIXES"] = False + tc.variables["GTSAM_BUILD_DOC_LATEX"] = False + + # Removed in 4.1+ + if Version(self.version) < "4.1": + # https://github.com/borglab/gtsam/blob/4.0.3/CMakeLists.txt + tc.variables["GTSAM_BUILD_WRAP"] = self.options.build_wrap + tc.variables["GTSAM_INSTALL_CYTHON_TOOLBOX"] = self.options.install_cython_toolbox + tc.variables["GTSAM_TYPEDEF_POINTS_TO_VECTORS"] = self.options.typedef_points_to_vectors + # https://github.com/borglab/gtsam/blob/4.0.3/wrap/CMakeLists.txt#L15 + tc.variables["GTSAM_WRAP_SERIALIZATION"] = self.options.wrap_serialization + + tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared + tc.variables["Boost_NO_SYSTEM_PATHS"] = True tc.generate() + deps = CMakeDeps(self) deps.generate() def _patch_sources(self): apply_conandata_patches(self) + # Honor vc runtime if is_msvc(self): gtsam_build_types_cmake = os.path.join(self.source_folder, "cmake", "GtsamBuildTypes.cmake") replace_in_file(self, gtsam_build_types_cmake, "/MD ", f"/{msvc_runtime_flag(self)} ") replace_in_file(self, gtsam_build_types_cmake, "/MDd ", f"/{msvc_runtime_flag(self)} ") + if self.options.default_allocator == "tcmalloc": + handle_allocators_path = os.path.join(self.source_folder, "cmake", "HandleAllocators.cmake") + if Version(self.version) < "4.1": + handle_allocators_path = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file( + self, + handle_allocators_path, + "if(GOOGLE", + "find_package(gperftools REQUIRED)\nset(GOOGLE_PERFTOOLS_FOUND TRUE)\nif(GOOGLE", + ) + replace_in_file( + self, + handle_allocators_path, + 'GTSAM_ADDITIONAL_LIBRARIES "tcmalloc"', + 'GTSAM_ADDITIONAL_LIBRARIES "gperftools::gperftools"', + ) + def build(self): self._patch_sources() cmake = CMake(self) @@ -206,53 +347,60 @@ def _module_file_rel_path(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "GTSAM") - prefix = "lib" if is_msvc(self) and not self.options.shared else "" - - self.cpp_info.components["libgtsam"].set_property("cmake_target_name", "gtsam") - self.cpp_info.components["libgtsam"].libs = [f"{prefix}gtsam"] - self.cpp_info.components["libgtsam"].requires = [f"boost::{component}" for component in self._required_boost_components] - self.cpp_info.components["libgtsam"].requires.append("eigen::eigen") + gtsam = self.cpp_info.components["libgtsam"] + gtsam.set_property("cmake_target_name", "gtsam") + gtsam.libs = ["gtsam"] + gtsam.requires = [f"boost::{component}" for component in self._required_boost_components] + gtsam.requires.append("eigen::eigen") if self.options.with_TBB: - self.cpp_info.components["libgtsam"].requires.append("onetbb::onetbb") + gtsam.requires.append("onetbb::onetbb") + if self.options.default_allocator == "tcmalloc": + gtsam.requires.append("gperftools::gperftools") if self.options.support_nested_dissection: - self.cpp_info.components["libgtsam"].requires.append("libmetis-gtsam") - if self.settings.os == "Windows" and Version(self.version) >= "4.0.3": - self.cpp_info.components["libgtsam"].system_libs = ["dbghelp"] + gtsam.requires.append("libmetis-gtsam") + if self.settings.os == "Windows": + gtsam.system_libs = ["dbghelp"] if self.options.build_unstable: - self.cpp_info.components["libgtsam_unstable"].set_property("cmake_target_name", "gtsam_unstable") - self.cpp_info.components["libgtsam_unstable"].libs = [f"{prefix}gtsam_unstable"] - self.cpp_info.components["libgtsam_unstable"].requires = ["libgtsam"] + gtsam_unstable = self.cpp_info.components["libgtsam_unstable"] + gtsam_unstable.set_property("cmake_target_name", "gtsam_unstable") + gtsam_unstable.libs = ["gtsam_unstable"] + gtsam_unstable.requires = ["libgtsam"] if self.options.support_nested_dissection: - self.cpp_info.components["libmetis-gtsam"].set_property("cmake_target_name", "metis-gtsam") - self.cpp_info.components["libmetis-gtsam"].libs = ["metis-gtsam"] - self.cpp_info.components["libmetis-gtsam"].names["pkg_config"] = "metis-gtsam" + metis = self.cpp_info.components["libmetis-gtsam"] + metis.set_property("cmake_target_name", "metis-gtsam") + if Version(self.version) >= "4.1": + metis.libs = ["metis-gtsam"] + else: + metis.libs = ["metis"] + metis.names["pkg_config"] = "metis-gtsam" if self.options.install_cppunitlite: - self.cpp_info.components["gtsam_CppUnitLite"].set_property("cmake_target_name", "CppUnitLite") - self.cpp_info.components["gtsam_CppUnitLite"].libs = ["CppUnitLite"] - self.cpp_info.components["gtsam_CppUnitLite"].requires = ["boost::boost"] + cppunitlite = self.cpp_info.components["gtsam_CppUnitLite"] + cppunitlite.set_property("cmake_target_name", "CppUnitLite") + cppunitlite.libs = ["CppUnitLite"] + cppunitlite.requires = ["boost::boost"] + + if is_msvc(self) and not self.options.shared: + for component in self.cpp_info.components.values(): + component.libs = [f"lib{lib}" for lib in component.libs if lib.startswith("gtsam")] + if self.options.build_type_postfixes and self.settings.build_type != "Release": + for component in self.cpp_info.components.values(): + component.libs = [f"{lib}{self.settings.build_type}" for lib in component.libs] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "GTSAM" self.cpp_info.names["cmake_find_package_multi"] = "GTSAM" - self.cpp_info.components["libgtsam"].names["cmake_find_package"] = "gtsam" - self.cpp_info.components["libgtsam"].names["cmake_find_package_multi"] = "gtsam" - self.cpp_info.components["libgtsam"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["libgtsam"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - if self.options.build_unstable: - self.cpp_info.components["libgtsam_unstable"].names["cmake_find_package"] = "gtsam_unstable" - self.cpp_info.components["libgtsam_unstable"].names["cmake_find_package_multi"] = "gtsam_unstable" - self.cpp_info.components["libgtsam_unstable"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["libgtsam_unstable"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - if self.options.support_nested_dissection: - self.cpp_info.components["libmetis-gtsam"].names["cmake_find_package"] = "metis-gtsam" - self.cpp_info.components["libmetis-gtsam"].names["cmake_find_package_multi"] = "metis-gtsam" - self.cpp_info.components["libmetis-gtsam"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["libmetis-gtsam"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - if self.options.install_cppunitlite: - self.cpp_info.components["gtsam_CppUnitLite"].names["cmake_find_package"] = "CppUnitLite" - self.cpp_info.components["gtsam_CppUnitLite"].names["cmake_find_package_multi"] = "CppUnitLite" - self.cpp_info.components["gtsam_CppUnitLite"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["gtsam_CppUnitLite"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + for component_name, lib_name in [ + ("libgtsam", "gtsam"), + ("libgtsam_unstable", "gtsam_unstable"), + ("libmetis-gtsam", "metis-gtsam"), + ("gtsam_CppUnitLite", "CppUnitLite"), + ]: + if component_name in self.cpp_info.components: + component = self.cpp_info.components[component_name] + component.names["cmake_find_package"] = lib_name + component.names["cmake_find_package_multi"] = lib_name + component.build_modules["cmake_find_package"] = [self._module_file_rel_path] + component.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/gtsam/all/patches/4.0.2-0001-cmake-boost.patch b/recipes/gtsam/all/patches/4.0.2-0001-cmake-boost.patch deleted file mode 100644 index d19f34cd533272..00000000000000 --- a/recipes/gtsam/all/patches/4.0.2-0001-cmake-boost.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -163,13 +163,13 @@ - set(BOOST_FIND_MINIMUM_VERSION 1.43) - set(BOOST_FIND_MINIMUM_COMPONENTS serialization system filesystem thread program_options date_time timer chrono regex) - --find_package(Boost ${BOOST_FIND_MINIMUM_VERSION} COMPONENTS ${BOOST_FIND_MINIMUM_COMPONENTS}) -+find_package(Boost ${BOOST_FIND_MINIMUM_VERSION} COMPONENTS ${BOOST_FIND_MINIMUM_COMPONENTS} REQUIRED) - - # Required components --if(NOT Boost_SERIALIZATION_LIBRARY OR NOT Boost_SYSTEM_LIBRARY OR NOT Boost_FILESYSTEM_LIBRARY OR -- NOT Boost_THREAD_LIBRARY OR NOT Boost_DATE_TIME_LIBRARY) -- message(FATAL_ERROR "Missing required Boost components >= v1.43, please install/upgrade Boost or configure your search paths.") --endif() -+#if(NOT Boost_SERIALIZATION_LIBRARY OR NOT Boost_SYSTEM_LIBRARY OR NOT Boost_FILESYSTEM_LIBRARY OR -+# NOT Boost_THREAD_LIBRARY OR NOT Boost_DATE_TIME_LIBRARY) -+# message(FATAL_ERROR "Missing required Boost components >= v1.43, please install/upgrade Boost or configure your search paths.") -+#endif() - - # Allow for not using the timer libraries on boost < 1.48 (GTSAM timing code falls back to old timer library) - option(GTSAM_DISABLE_NEW_TIMERS "Disables using Boost.chrono for timing" OFF) -@@ -179,30 +179,22 @@ - # so we downgraded this to classic filenames-based variables, and manually adding - # the target_include_directories(xxx ${Boost_INCLUDE_DIR}) - set(GTSAM_BOOST_LIBRARIES -- optimized ${Boost_SERIALIZATION_LIBRARY_RELEASE} -- optimized ${Boost_SYSTEM_LIBRARY_RELEASE} -- optimized ${Boost_FILESYSTEM_LIBRARY_RELEASE} -- optimized ${Boost_THREAD_LIBRARY_RELEASE} -- optimized ${Boost_DATE_TIME_LIBRARY_RELEASE} -- optimized ${Boost_REGEX_LIBRARY_RELEASE} -- debug ${Boost_SERIALIZATION_LIBRARY_DEBUG} -- debug ${Boost_SYSTEM_LIBRARY_DEBUG} -- debug ${Boost_FILESYSTEM_LIBRARY_DEBUG} -- debug ${Boost_THREAD_LIBRARY_DEBUG} -- debug ${Boost_DATE_TIME_LIBRARY_DEBUG} -- debug ${Boost_REGEX_LIBRARY_DEBUG} -+ Boost::serialization -+ Boost::system -+ Boost::filesystem -+ Boost::thread -+ Boost::date_time -+ Boost::regex - ) - message(STATUS "GTSAM_BOOST_LIBRARIES: ${GTSAM_BOOST_LIBRARIES}") - if (GTSAM_DISABLE_NEW_TIMERS) - message("WARNING: GTSAM timing instrumentation manually disabled") - list_append_cache(GTSAM_COMPILE_DEFINITIONS_PUBLIC DGTSAM_DISABLE_NEW_TIMERS) - else() -- if(Boost_TIMER_LIBRARY) -+ if(TARGET Boost::timer) - list(APPEND GTSAM_BOOST_LIBRARIES -- optimized ${Boost_TIMER_LIBRARY_RELEASE} -- optimized ${Boost_CHRONO_LIBRARY_RELEASE} -- debug ${Boost_TIMER_LIBRARY_DEBUG} -- debug ${Boost_CHRONO_LIBRARY_DEBUG} -+ Boost::timer -+ Boost::chrono - ) - else() - list(APPEND GTSAM_BOOST_LIBRARIES rt) # When using the header-only boost timer library, need -lrt diff --git a/recipes/gtsam/all/patches/4.0.2-0002-cmake-eigen.patch b/recipes/gtsam/all/patches/4.0.2-0002-cmake-eigen.patch deleted file mode 100644 index 21c808ace60fd9..00000000000000 --- a/recipes/gtsam/all/patches/4.0.2-0002-cmake-eigen.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -292,7 +292,7 @@ if(GTSAM_USE_SYSTEM_EIGEN) - find_package(Eigen3 REQUIRED) - - # Use generic Eigen include paths e.g. -- set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${EIGEN3_INCLUDE_DIR}") -+ set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${Eigen3_INCLUDE_DIRS}") - - # check if MKL is also enabled - can have one or the other, but not both! - # Note: Eigen >= v3.2.5 includes our patches -@@ -307,7 +307,7 @@ if(GTSAM_USE_SYSTEM_EIGEN) - endif() - - # The actual include directory (for BUILD cmake target interface): -- set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${EIGEN3_INCLUDE_DIR}") -+ set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${Eigen3_INCLUDE_DIRS}") - else() - # Use bundled Eigen include path. - # Clear any variables set by FindEigen3 diff --git a/recipes/gtsam/all/patches/4.0.2-0003-macos-rpath.patch b/recipes/gtsam/all/patches/4.0.2-0003-macos-rpath.patch deleted file mode 100644 index 6bc74d30d7ff1a..00000000000000 --- a/recipes/gtsam/all/patches/4.0.2-0003-macos-rpath.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) - # new feature to Cmake Version > 2.8.12 - # Mac ONLY. Define Relative Path on Mac OS - if(NOT DEFINED CMAKE_MACOSX_RPATH) -- set(CMAKE_MACOSX_RPATH 0) - endif() - - # Set the version number for the library ---- a/gtsam/CMakeLists.txt -+++ b/gtsam/CMakeLists.txt -@@ -177,9 +177,6 @@ if(WIN32) # Add 'lib' prefix to static library to avoid filename collision with - endif() - - if (APPLE AND BUILD_SHARED_LIBS) -- set_target_properties(gtsam PROPERTIES -- INSTALL_NAME_DIR -- "${CMAKE_INSTALL_PREFIX}/lib") - endif() - - install( ---- a/gtsam/3rdparty/metis/libmetis/CMakeLists.txt -+++ b/gtsam/3rdparty/metis/libmetis/CMakeLists.txt -@@ -16,9 +16,6 @@ if(WIN32) - endif() - - if (APPLE) -- set_target_properties(metis PROPERTIES -- INSTALL_NAME_DIR -- "${CMAKE_INSTALL_PREFIX}/lib") - endif() - - install(TARGETS metis EXPORT GTSAM-exports LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) diff --git a/recipes/gtsam/all/patches/4.0.2-0003-cmake-project.patch b/recipes/gtsam/all/patches/4.0.3-0004-cmake-project.patch similarity index 100% rename from recipes/gtsam/all/patches/4.0.2-0003-cmake-project.patch rename to recipes/gtsam/all/patches/4.0.3-0004-cmake-project.patch diff --git a/recipes/gtsam/all/patches/4.1.1-0005-eigen3-version.patch b/recipes/gtsam/all/patches/4.1.1-0005-eigen3-version.patch new file mode 100644 index 00000000000000..8bd45c6d8f747b --- /dev/null +++ b/recipes/gtsam/all/patches/4.1.1-0005-eigen3-version.patch @@ -0,0 +1,21 @@ +Otherwise the Eigen version detection will fail due to the Eigen path variable containing a generator expression. +diff --git a/cmake/HandleEigen.cmake b/cmake/HandleEigen.cmake +--- a/cmake/HandleEigen.cmake ++++ b/cmake/HandleEigen.cmake +@@ -46,6 +46,8 @@ + endif() + + # Detect Eigen version: ++set(GTSAM_EIGEN_VERSION "${Eigen3_VERSION_STRING}") ++if (FALSE) + set(EIGEN_VER_H "${GTSAM_EIGEN_INCLUDE_FOR_BUILD}/Eigen/src/Core/util/Macros.h") + if (EXISTS ${EIGEN_VER_H}) + file(READ "${EIGEN_VER_H}" STR_EIGEN_VERSION) +@@ -67,6 +69,7 @@ + else() + message(WARNING "Cannot determine Eigen version, missing file: `${EIGEN_VER_H}`") + endif () ++endif() + + if (MSVC) + if (BUILD_SHARED_LIBS) diff --git a/recipes/gtsam/all/patches/4.2.0-0001-macos-rpath.patch b/recipes/gtsam/all/patches/4.2.0-0001-macos-rpath.patch new file mode 100644 index 00000000000000..2f60f9adaef8a6 --- /dev/null +++ b/recipes/gtsam/all/patches/4.2.0-0001-macos-rpath.patch @@ -0,0 +1,30 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,5 +5,4 @@ cmake_minimum_required(VERSION 3.0) + if(NOT DEFINED CMAKE_MACOSX_RPATH) +- set(CMAKE_MACOSX_RPATH 0) + endif() + + # Set the version number for the library +--- a/cmake/HandleGlobalBuildFlags.cmake ++++ b/cmake/HandleGlobalBuildFlags.cmake +@@ -20,7 +20,6 @@ endif() + + if (APPLE AND BUILD_SHARED_LIBS) + # Set the default install directory on macOS +- set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + ############################################################################### +--- a/gtsam/3rdparty/metis/libmetis/CMakeLists.txt ++++ b/gtsam/3rdparty/metis/libmetis/CMakeLists.txt +@@ -17,9 +17,6 @@ if(WIN32) + endif() + + if (APPLE) +- set_target_properties(metis-gtsam PROPERTIES +- INSTALL_NAME_DIR +- "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + install(TARGETS metis-gtsam EXPORT GTSAM-exports diff --git a/recipes/gtsam/all/patches/4.2.0-0002-eigen3-version.patch b/recipes/gtsam/all/patches/4.2.0-0002-eigen3-version.patch new file mode 100644 index 00000000000000..19bc6febd2db05 --- /dev/null +++ b/recipes/gtsam/all/patches/4.2.0-0002-eigen3-version.patch @@ -0,0 +1,20 @@ +diff --git a/cmake/HandleEigen.cmake b/cmake/HandleEigen.cmake +--- a/cmake/HandleEigen.cmake ++++ b/cmake/HandleEigen.cmake +@@ -59,6 +59,8 @@ + endif() + + # Detect Eigen version: ++set(GTSAM_EIGEN_VERSION "${Eigen3_VERSION_STRING}") ++if (FALSE) + set(EIGEN_VER_H "${GTSAM_EIGEN_INCLUDE_FOR_BUILD}/Eigen/src/Core/util/Macros.h") + if (EXISTS ${EIGEN_VER_H}) + file(READ "${EIGEN_VER_H}" STR_EIGEN_VERSION) +@@ -80,6 +82,7 @@ + else() + message(WARNING "Cannot determine Eigen version, missing file: `${EIGEN_VER_H}`") + endif () ++endif() + + if (MSVC) + if (BUILD_SHARED_LIBS) diff --git a/recipes/gtsam/config.yml b/recipes/gtsam/config.yml index 6f380a83ebb140..92f20f30ab3474 100644 --- a/recipes/gtsam/config.yml +++ b/recipes/gtsam/config.yml @@ -1,7 +1,7 @@ versions: + "4.2": + folder: all "4.1.1": folder: all "4.0.3": folder: all - "4.0.2": - 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/gurkenlaeufer/all/conanfile.py b/recipes/gurkenlaeufer/all/conanfile.py index 07fa4de3d08f1f..50934895c439f6 100644 --- a/recipes/gurkenlaeufer/all/conanfile.py +++ b/recipes/gurkenlaeufer/all/conanfile.py @@ -1,9 +1,7 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.files import get, copy, rmdir +from conan.tools.files import copy, get, rmdir from conan.tools.layout import basic_layout -from conan.tools.scm import Version import os @@ -25,16 +23,6 @@ class GurkenlaeuferConan(ConanFile): def _min_cppstd(self): return 11 - @property - def _compilers_minimum_version(self): - return { - "Visual Studio": "15", - "msvc": "14.1", - "gcc": "5", - "clang": "5", - "apple-clang": "5.1", - } - def layout(self): basic_layout(self, src_folder="src") @@ -47,11 +35,6 @@ def package_id(self): 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 does not support." - ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/gzip-hpp/all/conanfile.py b/recipes/gzip-hpp/all/conanfile.py index 9401872c82770b..8e576978736f75 100644 --- a/recipes/gzip-hpp/all/conanfile.py +++ b/recipes/gzip-hpp/all/conanfile.py @@ -16,6 +16,7 @@ class GzipHppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mapbox/gzip-hpp" topics = ("gzip", "zlib", "compression", "decompression", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -27,7 +28,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13", transitive_headers=True) + self.requires("zlib/[>=1.2.11 <2]") def package_id(self): self.info.clear() @@ -37,7 +38,7 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) 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 diff --git a/recipes/h5pp/all/conandata.yml b/recipes/h5pp/all/conandata.yml index cd78418f650103..264046f12084e6 100644 --- a/recipes/h5pp/all/conandata.yml +++ b/recipes/h5pp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.11.0.1": + url: "https://github.com/DavidAce/h5pp/archive/v1.11.0.1.tar.gz" + sha256: "73b08273c36220fad2836897138f4e0adbe347ea7d1cc7c22f9783a29b24f967" "1.11.0": url: "https://github.com/DavidAce/h5pp/archive/v1.11.0.tar.gz" sha256: "1c4171275eb50a26ed9da8055397f03a726896c4c49ad0380b16dcb13574ecff" diff --git a/recipes/h5pp/all/conanfile.py b/recipes/h5pp/all/conanfile.py index 572f56191b2524..9c9caa28d810ef 100644 --- a/recipes/h5pp/all/conanfile.py +++ b/recipes/h5pp/all/conanfile.py @@ -70,7 +70,7 @@ def requirements(self): if Version(self.version) < "1.10.0" or self.options.get_safe('with_spdlog'): self.requires("spdlog/1.11.0", transitive_headers=True, transitive_libs=True) if Version(self.version) >= "1.10.0" and self.options.with_zlib: - self.requires("zlib/1.2.13", transitive_headers=True, transitive_libs=True) + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) def layout(self): basic_layout(self,src_folder="src") diff --git a/recipes/h5pp/config.yml b/recipes/h5pp/config.yml index 2a1bf3aae74878..6a5c9d77316016 100644 --- a/recipes/h5pp/config.yml +++ b/recipes/h5pp/config.yml @@ -13,3 +13,5 @@ versions: folder: "all" "1.11.0": folder: "all" + "1.11.0.1": + folder: "all" diff --git a/recipes/half/all/conanfile.py b/recipes/half/all/conanfile.py index 64b104957470dc..07e6b8fcf90e0b 100644 --- a/recipes/half/all/conanfile.py +++ b/recipes/half/all/conanfile.py @@ -15,20 +15,21 @@ class HalfConan(ConanFile): "functions." ) license = "MIT" - topics = ("half", "half-precision", "float", "arithmetic") + topics = ("half-precision", "float", "arithmetic") homepage = "https://sourceforge.net/projects/half" url = "https://github.com/conan-io/conan-center-index" + 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) + get(self, **self.conan_data["sources"][self.version]) def build(self): pass @@ -39,6 +40,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/half/all/test_package/conanfile.py b/recipes/half/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/half/all/test_package/conanfile.py +++ b/recipes/half/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/half/all/test_v1_package/CMakeLists.txt b/recipes/half/all/test_v1_package/CMakeLists.txt index c8aa9412f7287e..b21cc49efde95c 100644 --- a/recipes/half/all/test_v1_package/CMakeLists.txt +++ b/recipes/half/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(half REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE half::half) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml index 807ef3305d9859..0621f68bfe102b 100644 --- a/recipes/harfbuzz/all/conandata.yml +++ b/recipes/harfbuzz/all/conandata.yml @@ -1,45 +1,31 @@ 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" + "8.2.1": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.2.1/harfbuzz-8.2.1.tar.xz" + sha256: "0fec78f98c9c8faf228957a201c8846f809452c20f8445eb092a1ba6f22dbea5" + "8.1.1": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.1.1/harfbuzz-8.1.1.tar.xz" + sha256: "0305ad702e11906a5fc0c1ba11c270b7f64a8f5390d676aacfd71db129d6565f" "8.0.1": url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.0.1/harfbuzz-8.0.1.tar.xz" sha256: "c1ce780acd385569f25b9a29603d1d5bc71e6940e55bfdd4f7266fad50e42620" - "8.0.0": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.0.0/harfbuzz-8.0.0.tar.xz" - sha256: "1f98b5e3d06a344fe667d7e8210094ced458791499839bddde98c167ce6a7c79" "7.3.0": url: "https://github.com/harfbuzz/harfbuzz/releases/download/7.3.0/harfbuzz-7.3.0.tar.xz" sha256: "20770789749ac9ba846df33983dbda22db836c70d9f5d050cb9aa5347094a8fb" - "7.1.0": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/7.1.0/harfbuzz-7.1.0.tar.xz" - sha256: "f135a61cd464c9ed6bc9823764c188f276c3850a8dc904628de2a87966b7077b" "6.0.0": url: "https://github.com/harfbuzz/harfbuzz/releases/download/6.0.0/harfbuzz-6.0.0.tar.xz" sha256: "1d1010a1751d076d5291e433c138502a794d679a7498d1268ee21e2d4a140eb4" - "5.3.1": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.3.1/harfbuzz-5.3.1.tar.xz" - sha256: "4a6ce097b75a8121facc4ba83b5b083bfec657f45b003cd5a3424f2ae6b4434d" - "5.3.0": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.3.0/harfbuzz-5.3.0.tar.xz" - sha256: "a05e19e3f52da24ed071522f0fddf872157d7d25e869cfd156cd6f1e81c42152" - "5.2.0": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.2.0/harfbuzz-5.2.0.tar.xz" - sha256: "735a94917b47936575acb4d4fa7e7986522f8a89527e4635721474dee2bc942c" "5.1.0": url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.1.0/harfbuzz-5.1.0.tar.xz" sha256: "2edb95db668781aaa8d60959d21be2ff80085f31b12053cdd660d9a50ce84f05" - "4.4.1": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/4.4.1/harfbuzz-4.4.1.tar.xz" - sha256: "c5bc33ac099b2e52f01d27cde21cee4281b9d5bfec7684135e268512478bc9ee" - "3.2.0": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/3.2.0/harfbuzz-3.2.0.tar.xz" - sha256: "0ada50a1c199bb6f70843ab893c55867743a443b84d087d54df08ad883ebc2cd" patches: "5.1.0": - patch_file: "patches/0000-fix-freetype-lookup-5.1.0.patch" patch_type: "portability" patch_description: "fix fretype and icu dependency lookup" patch_source: "https://github.com/harfbuzz/harfbuzz/pull/3811" - "4.4.1": - - patch_file: "patches/0000-fix-freetype-lookup-4.4.1.patch" - patch_type: "portability" - patch_description: "fix fretype and icu dependency lookup" - patch_source: "https://github.com/harfbuzz/harfbuzz/pull/3811" diff --git a/recipes/harfbuzz/all/conanfile.py b/recipes/harfbuzz/all/conanfile.py index c31c4772cdf26a..7904abea985f62 100644 --- a/recipes/harfbuzz/all/conanfile.py +++ b/recipes/harfbuzz/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os, fix_apple_shared_install_name from conan.tools.build import can_run, stdcpp_library -from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.env import Environment, VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, replace_in_file from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout @@ -12,7 +12,7 @@ import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" class HarfbuzzConan(ConanFile): @@ -20,7 +20,7 @@ class HarfbuzzConan(ConanFile): description = "HarfBuzz is an OpenType text shaping engine." topics = ("opentype", "text", "engine") url = "https://github.com/conan-io/conan-center-index" - homepage = "http://harfbuzz.org" + homepage = "https://harfbuzz.github.io/" license = "MIT" package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -34,6 +34,7 @@ class HarfbuzzConan(ConanFile): "with_uniscribe": [True, False], "with_directwrite": [True, False], "with_subset": [True, False], + "with_coretext": [True, False], } default_options = { "shared": False, @@ -45,6 +46,7 @@ class HarfbuzzConan(ConanFile): "with_uniscribe": True, "with_directwrite": False, "with_subset": False, + "with_coretext": True, } short_paths = True @@ -63,6 +65,8 @@ def config_options(self): del self.options.with_gdi del self.options.with_uniscribe del self.options.with_directwrite + if not is_apple_os(self): + del self.options.with_coretext def configure(self): if self.options.shared: @@ -76,20 +80,19 @@ def layout(self): def requirements(self): if self.options.with_freetype: - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") if self.options.with_icu: - self.requires("icu/73.1") + self.requires("icu/74.1") if self.options.with_glib: - self.requires("glib/2.76.3", run=can_run(self)) + self.requires("glib/2.78.1") def validate(self): if self.options.shared and self.options.with_glib and not self.dependencies["glib"].options.shared: raise ConanInvalidConfiguration( "Linking a shared library against static glib can cause unexpected behaviour." ) - if Version(self.version) >= "4.4.0": - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": - raise ConanInvalidConfiguration("New versions of harfbuzz require at least gcc 7") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration("New versions of harfbuzz require at least gcc 7") if self.options.with_glib and self.dependencies["glib"].options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration( @@ -97,11 +100,11 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.1.0") + 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.3") - if self.options.with_glib and not can_run(self): - self.tool_requires("glib/2.76.3") + self.tool_requires("pkgconf/2.0.3") + if self.options.with_glib: + self.tool_requires("glib/") if self.settings.os == "Macos": # Ensure that the gettext we use at build time is compatible # with the libiconv that is transitively exposed by glib @@ -125,8 +128,6 @@ def is_vs_2017(): return "ninja", [] VirtualBuildEnv(self).generate() - if self.options.with_glib and can_run(self): - VirtualRunEnv(self).generate(scope="build") # Avoid conflicts with libiconv # see: https://github.com/conan-io/conan-center-index/pull/17046#issuecomment-1554629094 @@ -145,6 +146,7 @@ def is_vs_2017(): "icu": is_enabled(self.options.with_icu), "freetype": is_enabled(self.options.with_freetype), "gdi": is_enabled(self.options.get_safe("with_gdi")), + "coretext": is_enabled(self.options.get_safe("with_coretext")), "directwrite": is_enabled(self.options.get_safe("with_directwrite")), "gobject": is_enabled(can_run(self) and self.options.with_glib), "introspection": is_enabled(False), @@ -195,8 +197,11 @@ def package_info(self): self.cpp_info.system_libs.append("usp10") if self.options.with_directwrite: self.cpp_info.system_libs.append("dwrite") - if is_apple_os(self): - self.cpp_info.frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText", "ApplicationServices"]) + if is_apple_os(self) and self.options.get_safe("with_coretext", False): + if self.settings.os == "Macos": + self.cpp_info.frameworks.append("ApplicationServices") + else: + self.cpp_info.frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText"]) if not self.options.shared: libcxx = stdcpp_library(self) if libcxx: diff --git a/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-4.4.1.patch b/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-4.4.1.patch deleted file mode 100644 index 708b5d9734b00b..00000000000000 --- a/recipes/harfbuzz/all/patches/0000-fix-freetype-lookup-4.4.1.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff --git a/meson.build b/meson.build -index 4a69d6d9e..a82ff598c 100644 ---- a/meson.build -+++ b/meson.build -@@ -21,7 +21,7 @@ pkgmod = import('pkgconfig') - cpp = meson.get_compiler('cpp') - null_dep = dependency('', required: false) - --if cpp.get_id() == 'msvc' -+if cpp.get_argument_syntax() == 'msvc' - # Ignore several spurious warnings for things HarfBuzz does very commonly. - # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it - # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once -@@ -83,25 +83,39 @@ check_funcs = [ - - m_dep = cpp.find_library('m', required: false) - --# https://github.com/harfbuzz/harfbuzz/pull/2498 --freetype_dep = dependency(cpp.get_argument_syntax() == 'msvc' ? 'freetype' : 'freetype2', -- required: get_option('freetype'), -- default_options: ['harfbuzz=disabled']) -+ -+# Try pkgconfig name -+freetype_dep = dependency('freetype2', required: false) -+if not freetype_dep.found() -+ # Try cmake name -+ freetype_dep = dependency('freetype', required: false) -+endif -+if not freetype_dep.found() -+ # Subproject fallback, `allow_fallback: true` means the fallback will be -+ # tried even if the freetype option is set to `auto`. -+ freetype_dep = dependency('freetype2', -+ required: get_option('freetype'), -+ default_options: ['harfbuzz=disabled'], -+ allow_fallback: true) -+endif - - glib_dep = dependency('glib-2.0', required: get_option('glib')) - gobject_dep = dependency('gobject-2.0', required: get_option('gobject')) - graphite2_dep = dependency('graphite2', required: get_option('graphite2')) - graphite_dep = dependency('graphite2', required: get_option('graphite')) - --if cpp.get_argument_syntax() == 'msvc' -+# Try pkgconfig name -+icu_dep = dependency('icu-uc', required: false) -+if not icu_dep.found() -+ # Try cmake name - icu_dep = dependency('ICU', -- required: get_option('icu'), -+ required: false, - components: 'uc', - method: 'cmake') --else -- icu_dep = dependency('icu-uc', -- required: get_option('icu'), -- method: 'pkg-config') -+endif -+if not icu_dep.found() -+ # Subproject fallback if icu option is enabled -+ icu_dep = dependency('icu-uc', required: get_option('icu')) - endif - - if icu_dep.found() and icu_dep.type_name() == 'pkgconfig' -@@ -118,7 +132,7 @@ if not get_option('cairo').disabled() - cairo_ft_dep = dependency('cairo-ft', required: false) - - if (not cairo_dep.found() and -- cpp.get_id() == 'msvc' and -+ cpp.get_argument_syntax() == 'msvc' and - cpp.has_header('cairo.h')) - cairo_dep = cpp.find_library('cairo', required: false) - if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face', -@@ -198,6 +212,7 @@ if freetype_dep.found() - ['FT_Get_Var_Blend_Coordinates', {'deps': freetype_dep}], - ['FT_Set_Var_Blend_Coordinates', {'deps': freetype_dep}], - ['FT_Done_MM_Var', {'deps': freetype_dep}], -+ ['FT_Get_Transform', {'deps': freetype_dep}], - ] - - if freetype_dep.type_name() == 'internal' -@@ -232,17 +247,12 @@ if host_machine.system() == 'windows' and not get_option('gdi').disabled() - endif - - # DirectWrite (Windows) --directwrite_dep = null_dep - if host_machine.system() == 'windows' and not get_option('directwrite').disabled() - if get_option('directwrite').enabled() and not cpp.has_header('dwrite_1.h') - error('DirectWrite was enabled explicitly, but required header is missing.') - endif - -- directwrite_dep = cpp.find_library('dwrite', required: get_option('directwrite')) -- -- if directwrite_dep.found() -- conf.set('HAVE_DIRECTWRITE', 1) -- endif -+ conf.set('HAVE_DIRECTWRITE', 1) - endif - - # CoreText (macOS) diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml index b575f01311eb48..d5a1a8bf9dfc43 100644 --- a/recipes/harfbuzz/config.yml +++ b/recipes/harfbuzz/config.yml @@ -1,23 +1,17 @@ versions: - "8.0.1": + "8.3.0": folder: all - "8.0.0": + "8.2.2": folder: all - "7.3.0": + "8.2.1": folder: all - "7.1.0": + "8.1.1": folder: all - "6.0.0": - folder: all - "5.3.1": + "8.0.1": folder: all - "5.3.0": + "7.3.0": folder: all - "5.2.0": + "6.0.0": folder: all "5.1.0": folder: all - "4.4.1": - folder: all - "3.2.0": - folder: all diff --git a/recipes/hayai/all/conandata.yml b/recipes/hayai/all/conandata.yml new file mode 100644 index 00000000000000..490eb3204ef39a --- /dev/null +++ b/recipes/hayai/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "cci.20190823": + url: "https://github.com/nickbruun/hayai/archive/9bdca1c693e950ab2cb17c4ef885792c3c530234.tar.gz" + sha256: "3e4b703b675a30338c73d9b207824cebd6275de9757eb8eefeef892e863c242f" +patches: + "cci.20190823": + - patch_file: "patches/fix-cmake-project.patch" + patch_description: "Move cmake_minimum_required() before project() in CMakeLists.txt" + patch_type: "conan" diff --git a/recipes/hayai/all/conanfile.py b/recipes/hayai/all/conanfile.py new file mode 100644 index 00000000000000..f9c7ed8eb904b0 --- /dev/null +++ b/recipes/hayai/all/conanfile.py @@ -0,0 +1,69 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rm, rmdir, export_conandata_patches, apply_conandata_patches + +required_conan_version = ">=1.53.0" + + +class HayaiConan(ConanFile): + name = "hayai" + description = "C++ benchmarking framework" + license = "Apache" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nickbruun/hayai" + topics = ("benchmarking",) + + 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): + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_HAYAI_TESTS"] = False + tc.cache_variables["BUILD_HAYAI_SAMPLES"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "CMake")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.libs = ["hayai_main"] + self.cpp_info.set_property("cmake_target_name", "hayai_main") diff --git a/recipes/hayai/all/patches/fix-cmake-project.patch b/recipes/hayai/all/patches/fix-cmake-project.patch new file mode 100644 index 00000000000000..f2e12a251e0b89 --- /dev/null +++ b/recipes/hayai/all/patches/fix-cmake-project.patch @@ -0,0 +1,8 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -3,3 +3,2 @@ +-project(hayai) +-cmake_minimum_required(VERSION 2.4) +-cmake_policy(SET CMP0012 NEW) ++cmake_minimum_required(VERSION 3.15) ++project(hayai CXX) diff --git a/recipes/hayai/all/test_package/CMakeLists.txt b/recipes/hayai/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..500852dd444f21 --- /dev/null +++ b/recipes/hayai/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(hayai REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hayai_main) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/hayai/all/test_package/conanfile.py b/recipes/hayai/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/hayai/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/hayai/all/test_package/test_package.cpp b/recipes/hayai/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..32f9269a28efce --- /dev/null +++ b/recipes/hayai/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include +#include + +BENCHMARK(SomeSleep, Sleep1ms, 5, 10) { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); +} diff --git a/recipes/hayai/config.yml b/recipes/hayai/config.yml new file mode 100644 index 00000000000000..524a9c8112de10 --- /dev/null +++ b/recipes/hayai/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20190823": + folder: all diff --git a/recipes/hazelcast-cpp-client/all/conandata.yml b/recipes/hazelcast-cpp-client/all/conandata.yml index b475516774d720..132cdd0f76ad63 100644 --- a/recipes/hazelcast-cpp-client/all/conandata.yml +++ b/recipes/hazelcast-cpp-client/all/conandata.yml @@ -8,27 +8,11 @@ sources: "5.1.0": url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v5.1.0.tar.gz" sha256: "de22ddf2c99079ed2385baa554a997b15ae17b039d6d108f68e25e1b3bbf76b6" - "5.0.0": - url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v5.0.0.tar.gz" - sha256: "0df7948bc6f4d219c60f51179355599938cab5b713335c2ea48d1d38be1b69dc" "4.2.0": url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.2.0.zip" sha256: "18aeb755a875015a2e182d4c575cc46a041bdfb699937c5174d94534517e4708" - "4.1.1": - url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.1.1.zip" - sha256: "ca425c97eb871400de4bd2307ddaf3c557c9c1bae50d6a0db6507d72f435830c" - "4.1.0": - url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.1.0.zip" - sha256: "8356bc76077fea354e83ffcd506096797137af10b292809c6b7843a8fbd084e3" - "4.0.1": - url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.0.1.zip" - sha256: "4b3c6a876ebca2a4dcf23a556d3c3d4da2284e4ce1d2bbdf335df7f86b03fd28" patches: "5.1.0": - patch_file: "patches/gcc_11_1_0.patch" patch_description: "Fix for GCC-111" patch_type: "portability" - "4.1.0": - - patch_file: "patches/gcc_4.9_5_fix.patch" - patch_description: "Fix for GCC-495" - patch_type: "portability" diff --git a/recipes/hazelcast-cpp-client/all/conanfile.py b/recipes/hazelcast-cpp-client/all/conanfile.py index ccfd70e209aa39..a46e46f6fda67f 100644 --- a/recipes/hazelcast-cpp-client/all/conanfile.py +++ b/recipes/hazelcast-cpp-client/all/conanfile.py @@ -46,7 +46,7 @@ def layout(self): def requirements(self): self.requires("boost/1.79.0", transitive_headers=True, transitive_libs=True) if self.options.with_openssl: - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -84,6 +84,6 @@ def package_info(self): self.cpp_info.libs = ["hazelcast-cpp-client"] self.cpp_info.defines = ["BOOST_THREAD_VERSION=5"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["pthread", "m"]) if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/hazelcast-cpp-client/all/patches/gcc_4.9_5_fix.patch b/recipes/hazelcast-cpp-client/all/patches/gcc_4.9_5_fix.patch deleted file mode 100644 index f5655c00c6f251..00000000000000 --- a/recipes/hazelcast-cpp-client/all/patches/gcc_4.9_5_fix.patch +++ /dev/null @@ -1,79 +0,0 @@ -diff --git a/hazelcast/include/hazelcast/client/spi/impl/ClientPartitionServiceImpl.h b/hazelcast/include/hazelcast/client/spi/impl/ClientPartitionServiceImpl.h -index 41b437a80..6bef9e28b 100644 ---- a/hazelcast/include/hazelcast/client/spi/impl/ClientPartitionServiceImpl.h -+++ b/hazelcast/include/hazelcast/client/spi/impl/ClientPartitionServiceImpl.h -@@ -64,10 +64,7 @@ namespace hazelcast { - void reset(); - private: - struct partition_table { -- partition_table(int32_t connectionId = 0, int32_t version = -1, -- const std::unordered_map &partitions = {}); -- -- int32_t connection_id{0}; -+ int32_t connection_id; - int32_t version; - std::unordered_map partitions; - }; -diff --git a/hazelcast/src/hazelcast/client/config.cpp b/hazelcast/src/hazelcast/client/config.cpp -index 88cad1ec5..5da63b36a 100644 ---- a/hazelcast/src/hazelcast/client/config.cpp -+++ b/hazelcast/src/hazelcast/client/config.cpp -@@ -856,7 +856,7 @@ namespace hazelcast { - return it->second; - } - -- return reliable_topic_config_map_.emplace(name, name).first->second; -+ return reliable_topic_config_map_.emplace(name, config::reliable_topic_config{name}).first->second; - } - - const config::reliable_topic_config *client_config::lookup_reliable_topic_config(const std::string &name) const { -diff --git a/hazelcast/src/hazelcast/client/discovery.cpp b/hazelcast/src/hazelcast/client/discovery.cpp -index cdc10a906..51279b446 100644 ---- a/hazelcast/src/hazelcast/client/discovery.cpp -+++ b/hazelcast/src/hazelcast/client/discovery.cpp -@@ -588,7 +588,7 @@ namespace hazelcast { - - std::unordered_map aws_client::get_addresses() { - util::Preconditions::check_ssl("aws_client::get_addresses"); -- return {}; -+ return std::unordered_map(); - } - } - } -diff --git a/hazelcast/src/hazelcast/client/spi.cpp b/hazelcast/src/hazelcast/client/spi.cpp -index ada4e665c..206aecb9e 100644 ---- a/hazelcast/src/hazelcast/client/spi.cpp -+++ b/hazelcast/src/hazelcast/client/spi.cpp -@@ -788,9 +788,10 @@ namespace hazelcast { - auto previous_list = member_list_snapshot_.load()->members; - - member_list_snapshot_.store( -- boost::shared_ptr(new member_list_snapshot{0, {}})); -+ boost::shared_ptr(new member_list_snapshot{0})); - -- return detect_membership_events(previous_list, {}); -+ return detect_membership_events(previous_list, -+ std::unordered_map>()); - } - - void ClientClusterServiceImpl::clear_member_list() { -@@ -2357,7 +2358,7 @@ namespace hazelcast { - } - #else - util::Preconditions::check_ssl("cloud_discovery::get_addresses"); -- return {}; -+ return std::unordered_map(); - #endif - } - -@@ -2388,10 +2389,6 @@ namespace hazelcast { - return address(std::move(scoped_hostname), address_holder.get_port()); - } - } -- -- ClientPartitionServiceImpl::partition_table::partition_table(int32_t connectionId, int32_t version, -- const std::unordered_map &partitions) -- : connection_id(connectionId), version(version), partitions(partitions) {} - } - } - } diff --git a/recipes/hazelcast-cpp-client/config.yml b/recipes/hazelcast-cpp-client/config.yml index 7e4b5ade252501..5dd47e8b5a4e08 100644 --- a/recipes/hazelcast-cpp-client/config.yml +++ b/recipes/hazelcast-cpp-client/config.yml @@ -5,13 +5,5 @@ versions: folder: all "5.1.0": folder: all - "5.0.0": - folder: all "4.2.0": folder: all - "4.1.1": - folder: all - "4.1.0": - folder: all - "4.0.1": - folder: all diff --git a/recipes/hdf4/all/CMakeLists.txt b/recipes/hdf4/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d4..00000000000000 --- a/recipes/hdf4/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/hdf4/all/conandata.yml b/recipes/hdf4/all/conandata.yml index c28edc581baba6..b74cc986517d24 100644 --- a/recipes/hdf4/all/conandata.yml +++ b/recipes/hdf4/all/conandata.yml @@ -5,6 +5,4 @@ sources: patches: "4.2.15": - patch_file: "patches/fix-export-macro.patch" - base_path: "source_subfolder" - patch_file: "patches/fix-missing-unistd-include.patch" - base_path: "source_subfolder" diff --git a/recipes/hdf4/all/conanfile.py b/recipes/hdf4/all/conanfile.py index 6e61dd7455655d..161143820d8621 100644 --- a/recipes/hdf4/all/conanfile.py +++ b/recipes/hdf4/all/conanfile.py @@ -1,20 +1,22 @@ +import os + from conan import ConanFile from conan.tools.build import cross_building -from conan.tools.files import get, rmdir -from conans import CMake, tools -import os +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 -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class Hdf4Conan(ConanFile): name = "hdf4" description = "HDF4 is a data model, library, and file format for storing and managing data." license = "BSD-3-Clause" - topics = ("conan", "hdf4", "hdf", "data") - homepage = "https://portal.hdfgroup.org/display/HDF4/HDF4" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://portal.hdfgroup.org/display/HDF4/HDF4" + topics = ("hdf", "data") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -31,17 +33,8 @@ class Hdf4Conan(ConanFile): "szip_encoding": False, } - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @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": @@ -49,16 +42,19 @@ 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") if not bool(self.options.szip_support): del self.options.szip_encoding + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.jpegturbo: - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.0") else: self.requires("libjpeg/9e") if self.options.szip_support == "with_libaec": @@ -67,78 +63,108 @@ def requirements(self): self.requires("szip/2.1.1") def source(self): - get(self, **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.cache_variables["HDF4_EXTERNALLY_CONFIGURED"] = True + tc.cache_variables["HDF4_EXTERNAL_LIB_PREFIX"] = "" + tc.cache_variables["HDF4_NO_PACKAGES"] = True + tc.cache_variables["ONLY_SHARED_LIBS"] = self.options.shared + tc.cache_variables["HDF4_ENABLE_COVERAGE"] = False + tc.cache_variables["HDF4_ENABLE_DEPRECATED_SYMBOLS"] = True + tc.cache_variables["HDF4_ENABLE_JPEG_LIB_SUPPORT"] = True # HDF can't compile without libjpeg or libjpeg-turbo + tc.cache_variables["HDF4_ENABLE_Z_LIB_SUPPORT"] = True # HDF can't compile without zlib + tc.cache_variables["HDF4_ENABLE_SZIP_SUPPORT"] = bool(self.options.szip_support) + tc.cache_variables["HDF4_ENABLE_SZIP_ENCODING"] = self.options.get_safe("szip_encoding") or False + tc.cache_variables["HDF4_PACKAGE_EXTLIBS"] = False + tc.cache_variables["HDF4_BUILD_XDR_LIB"] = True + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["HDF4_INSTALL_INCLUDE_DIR"] = os.path.join(self.package_folder, "include", "hdf4").replace("\\", "/") + tc.cache_variables["HDF4_BUILD_FORTRAN"] = False + tc.cache_variables["HDF4_BUILD_UTILS"] = False + tc.cache_variables["HDF4_BUILD_TOOLS"] = False + tc.cache_variables["HDF4_BUILD_EXAMPLES"] = False + tc.cache_variables["HDF4_BUILD_JAVA"] = False + if cross_building(self): + tc.cache_variables["H4_PRINTF_LL_TEST_RUN"] = "0" + tc.cache_variables["H4_PRINTF_LL_TEST_RUN__TRYRUN_OUTPUT"] = "" + tc.generate() + + deps = CMakeDeps(self) + if self.options.szip_support == "with_szip": + deps.set_property("szip", "cmake_file_name", "SZIP") + deps.set_property("szip", "cmake_target_name", "SZIP::SZIP") + elif self.options.szip_support == "with_libaec": + deps.set_property("libaec", "cmake_file_name", "SZIP") + deps.set_property("libaec", "cmake_target_name", "SZIP::SZIP") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + libs = ["JPEG::JPEG", "ZLIB::ZLIB"] + if self.options.szip_support: + libs.append("SZIP::SZIP") + save(self, os.path.join(self.source_folder, "CMakeFilters.cmake"), + "\nlink_libraries({})".format(" ".join(libs)), 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 _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["HDF4_EXTERNALLY_CONFIGURED"] = True - self._cmake.definitions["HDF4_EXTERNAL_LIB_PREFIX"] = "" - self._cmake.definitions["HDF4_NO_PACKAGES"] = True - self._cmake.definitions["ONLY_SHARED_LIBS"] = self.options.shared - self._cmake.definitions["HDF4_ENABLE_COVERAGE"] = False - self._cmake.definitions["HDF4_ENABLE_DEPRECATED_SYMBOLS"] = True - self._cmake.definitions["HDF4_ENABLE_JPEG_LIB_SUPPORT"] = True # HDF can't compile without libjpeg or libjpeg-turbo - self._cmake.definitions["HDF4_ENABLE_Z_LIB_SUPPORT"] = True # HDF can't compile without zlib - self._cmake.definitions["HDF4_ENABLE_SZIP_SUPPORT"] = bool(self.options.szip_support) - self._cmake.definitions["HDF4_ENABLE_SZIP_ENCODING"] = self.options.get_safe("szip_encoding") or False - self._cmake.definitions["HDF4_PACKAGE_EXTLIBS"] = False - self._cmake.definitions["HDF4_BUILD_XDR_LIB"] = True - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["HDF4_INSTALL_INCLUDE_DIR"] = os.path.join(self.package_folder, "include", "hdf4") - self._cmake.definitions["HDF4_BUILD_FORTRAN"] = False - self._cmake.definitions["HDF4_BUILD_UTILS"] = False - self._cmake.definitions["HDF4_BUILD_TOOLS"] = False - self._cmake.definitions["HDF4_BUILD_EXAMPLES"] = False - self._cmake.definitions["HDF4_BUILD_JAVA"] = False - if cross_building(self): - self._cmake.definitions["H4_PRINTF_LL_TEST_RUN"] = "0" - self._cmake.definitions["H4_PRINTF_LL_TEST_RUN__TRYRUN_OUTPUT"] = "" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - 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() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) os.remove(os.path.join(self.package_folder, "lib", "libhdf4.settings")) + def _get_decorated_lib(self, name): + libname = name + if self.settings.os == "Windows" and self.settings.compiler != "gcc" and not self.options.shared: + libname = "lib" + libname + if self.settings.build_type == "Debug": + libname += "_D" if self.settings.os == "Windows" else "_debug" + return libname + def package_info(self): - self.cpp_info.names["pkg_config"] = "hdf" + self.cpp_info.set_property("pkg_config_name", "hdf") unofficial_includedir = os.path.join(self.package_folder, "include", "hdf4") + target_suffix = "shared" if self.options.shared else "static" + # xdr - xdr_cmake = "xdr-shared" if self.options.shared else "xdr-static" + xdr_cmake = f"xdr-{target_suffix}" + self.cpp_info.components["xdr"].set_property("cmake_target_name", f"hdf4::{xdr_cmake}") self.cpp_info.components["xdr"].names["cmake_find_package"] = xdr_cmake self.cpp_info.components["xdr"].names["cmake_find_package_multi"] = xdr_cmake self.cpp_info.components["xdr"].includedirs.append(unofficial_includedir) self.cpp_info.components["xdr"].libs = [self._get_decorated_lib("xdr")] if self.settings.os == "Windows": self.cpp_info.components["xdr"].system_libs.append("ws2_32") + # hdf - hdf_cmake = "hdf-shared" if self.options.shared else "hdf-static" + hdf_cmake = f"hdf-{target_suffix}" + self.cpp_info.components["hdf"].set_property("cmake_target_name", f"hdf4::{hdf_cmake}") self.cpp_info.components["hdf"].names["cmake_find_package"] = hdf_cmake self.cpp_info.components["hdf"].names["cmake_find_package_multi"] = hdf_cmake self.cpp_info.components["hdf"].includedirs.append(unofficial_includedir) self.cpp_info.components["hdf"].libs = [self._get_decorated_lib("hdf")] self.cpp_info.components["hdf"].requires = [ "zlib::zlib", - "libjpeg-turbo::libjpeg-turbo" if self.options.jpegturbo else "libjpeg::libjpeg" + "libjpeg-turbo::libjpeg-turbo" if self.options.jpegturbo else "libjpeg::libjpeg", ] if self.options.szip_support == "with_libaec": self.cpp_info.components["hdf"].requires.append("libaec::libaec") elif self.options.szip_support == "with_szip": self.cpp_info.components["hdf"].requires.append("szip::szip") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["hdf"].system_libs = ["m", "dl"] + # mfhdf - mfhdf_cmake = "mfhdf-shared" if self.options.shared else "mfhdf-static" + mfhdf_cmake = f"mfhdf-{target_suffix}" + self.cpp_info.components["mfhdf"].set_property("cmake_target_name", f"hdf4::{mfhdf_cmake}") self.cpp_info.components["mfhdf"].names["cmake_find_package"] = mfhdf_cmake self.cpp_info.components["mfhdf"].names["cmake_find_package_multi"] = mfhdf_cmake self.cpp_info.components["mfhdf"].includedirs.append(unofficial_includedir) @@ -149,11 +175,3 @@ def package_info(self): self.cpp_info.components["xdr"].defines.append("H4_BUILT_AS_DYNAMIC_LIB=1") self.cpp_info.components["hdf"].defines.append("H4_BUILT_AS_DYNAMIC_LIB=1") self.cpp_info.components["mfhdf"].defines.append("H4_BUILT_AS_DYNAMIC_LIB=1") - - def _get_decorated_lib(self, name): - libname = name - if self.settings.os == "Windows" and self.settings.compiler != "gcc" and not self.options.shared: - libname = "lib" + libname - if self.settings.build_type == "Debug": - libname += "_D" if self.settings.os == "Windows" else "_debug" - return libname diff --git a/recipes/hdf4/all/test_package/CMakeLists.txt b/recipes/hdf4/all/test_package/CMakeLists.txt index a6de4b12710219..546a9e09d090d3 100644 --- a/recipes/hdf4/all/test_package/CMakeLists.txt +++ b/recipes/hdf4/all/test_package/CMakeLists.txt @@ -1,14 +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(TARGETS) - -find_package(hdf4 REQUIRED) +find_package(hdf4 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -if(TARGET hdf4::hdf-shared) - target_link_libraries(${PROJECT_NAME} hdf4::hdf-shared) -else() - target_link_libraries(${PROJECT_NAME} hdf4::hdf-static) -endif() +target_link_libraries(${PROJECT_NAME} hdf4::hdf4) diff --git a/recipes/hdf4/all/test_package/conanfile.py b/recipes/hdf4/all/test_package/conanfile.py index 612db2552bfca3..7d51739a368b21 100644 --- a/recipes/hdf4/all/test_package/conanfile.py +++ b/recipes/hdf4/all/test_package/conanfile.py @@ -1,17 +1,27 @@ -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", "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 build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": + if is_apple_os(self) and self.settings.arch == "armv8": # 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. - self.build_requires("cmake/3.20.1") + self.tool_requires("cmake/[>=3.20]") + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -19,6 +29,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/hdf4/all/test_package/test_package.c b/recipes/hdf4/all/test_package/test_package.c index 4efcf0be4d7a7a..2e268465bf9bd6 100644 --- a/recipes/hdf4/all/test_package/test_package.c +++ b/recipes/hdf4/all/test_package/test_package.c @@ -49,12 +49,12 @@ int main() { file_desc_id = ANcreatef(an_id, AN_FILE_DESC); /* - * Write the annotation to the file description. + * Write the annotation to the file description. */ status_32 = ANwriteann(file_desc_id, FILE_DESC_TXT, (int32) strlen(FILE_DESC_TXT)); /* - * Create a vgroup in the V interface. Note that the vgroup's ref number + * Create a vgroup in the V interface. Note that the vgroup's ref number * is set to -1 for creating and the access mode is "w" for writing. */ status_n = Vstart(file_id); @@ -63,13 +63,13 @@ int main() { /* * Obtain the tag and ref number of the vgroup for subsequent - * references. + * references. */ vgroup_tag = (uint16) VQuerytag(vgroup_id); vgroup_ref = (uint16) VQueryref(vgroup_id); /* - * Create the data label for the vgroup identified by its tag + * Create the data label for the vgroup identified by its tag * and ref number. */ data_label_id = ANcreate(an_id, vgroup_tag, vgroup_ref, AN_DATA_LABEL); @@ -80,7 +80,7 @@ int main() { status_32 = ANwriteann(data_label_id, DATA_LABEL_TXT, (int32) strlen(DATA_LABEL_TXT)); /* - * Create the data description for the vgroup identified by its tag + * Create the data description for the vgroup identified by its tag * and ref number. */ data_desc_id = ANcreate(an_id, vgroup_tag, vgroup_ref, AN_DATA_DESC); diff --git a/recipes/hdf4/all/test_v1_package/CMakeLists.txt b/recipes/hdf4/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/hdf4/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/hdf4/all/test_v1_package/conanfile.py b/recipes/hdf4/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..2d700055b1faf6 --- /dev/null +++ b/recipes/hdf4/all/test_v1_package/conanfile.py @@ -0,0 +1,24 @@ +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_requirements(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # 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. + self.build_requires("cmake/[>=3.20]") + + 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/hdf5/all/conandata.yml b/recipes/hdf5/all/conandata.yml index 5eba8570f098ce..c5d710eb6a95b9 100644 --- a/recipes/hdf5/all/conandata.yml +++ b/recipes/hdf5/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.14.3": + url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_14_3/hdf5-1_14_3.tar.gz" + sha256: "df5ee33c74d5efb59738075ef96f4201588e1f1eeb233f047ac7fd1072dee1f6" + "1.14.2": + url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_14_2.tar.gz" + sha256: "83eaee3f9d1790bb4b29368bf1a648ece763097a4122c80a81076e8fb1e890e6" "1.14.1": url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_14_1.tar.gz" sha256: "1f710f3846d9c3ef9a4c57ef252ee0570f0af4e028fd6ccc360a48b7b16c347d" diff --git a/recipes/hdf5/all/conanfile.py b/recipes/hdf5/all/conanfile.py index e4e17863639bf7..2f176fad53d618 100644 --- a/recipes/hdf5/all/conanfile.py +++ b/recipes/hdf5/all/conanfile.py @@ -1,3 +1,4 @@ +import glob import os import textwrap @@ -75,7 +76,7 @@ def layout(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.szip_support == "with_libaec": self.requires("libaec/1.0.6") elif self.options.szip_support == "with_szip": @@ -107,7 +108,7 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def _inject_stdlib_flag(self, tc): - if self.settings.os == "Linux" and self.settings.compiler == "clang": + if self.settings.os in ["Linux", "FreeBSD"] and self.settings.compiler == "clang": cpp_stdlib = f" -stdlib={self.settings.compiler.libcxx}".rstrip("1") # strip 11 from stdlibc++11 tc.variables["CMAKE_CXX_FLAGS"] = tc.variables.get("CMAKE_CXX_FLAGS", "") + cpp_stdlib return tc @@ -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 @@ -281,10 +284,12 @@ def _config_libname(lib): components = self._components() add_component("hdf5_c", **components["hdf5_c"]) self.cpp_info.components["hdf5_c"].includedirs.append(os.path.join("include", "hdf5")) - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["hdf5_c"].system_libs.extend(["dl", "m"]) if self.options.get_safe("threadsafe"): self.cpp_info.components["hdf5_c"].system_libs.append("pthread") + elif self.settings.os == "Windows": + self.cpp_info.components["hdf5_c"].system_libs.append("Shlwapi") if self.options.shared: self.cpp_info.components["hdf5_c"].defines.append("H5_BUILT_AS_DYNAMIC_LIB") diff --git a/recipes/hdf5/config.yml b/recipes/hdf5/config.yml index 7ae39b3f5a3262..78000beb7c2269 100644 --- a/recipes/hdf5/config.yml +++ b/recipes/hdf5/config.yml @@ -1,4 +1,8 @@ versions: + "1.14.3": + folder: all + "1.14.2": + folder: all "1.14.1": folder: all "1.14.0": diff --git a/recipes/hdrhistogram-c/all/conanfile.py b/recipes/hdrhistogram-c/all/conanfile.py index dafe5ff3618bc9..f9f345becdeab3 100644 --- a/recipes/hdrhistogram-c/all/conanfile.py +++ b/recipes/hdrhistogram-c/all/conanfile.py @@ -42,7 +42,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/hedley/all/conanfile.py b/recipes/hedley/all/conanfile.py index 835a13a80a59b6..b59e08a89ffbb6 100644 --- a/recipes/hedley/all/conanfile.py +++ b/recipes/hedley/all/conanfile.py @@ -13,6 +13,7 @@ class HedleyConan(ConanFile): homepage = "https://nemequ.github.io/hedley/" description = "A C/C++ header to help move #ifdefs out of your code" topics = ("header", "header-only", "preprocessor", "#ifdef", "cross-platform") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -23,8 +24,7 @@ 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 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/hffix/all/conandata.yml b/recipes/hffix/all/conandata.yml index 63e048eedc7871..a5fdd1b12f317b 100644 --- a/recipes/hffix/all/conandata.yml +++ b/recipes/hffix/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.0": + url: "https://github.com/jamesdbrock/hffix/archive/v1.3.0.tar.gz" + sha256: "db3584c9daa5cfb76a096e02d945355294558a78d0128b5c2e82b8849fa26d77" "1.1.1": url: "https://github.com/jamesdbrock/hffix/archive/refs/tags/v1.1.1.tar.gz" sha256: "25dcaee8ded3590dd04225bd98909c9d78c8e39c26fb3c9880ec001a35464c07" diff --git a/recipes/hffix/all/conanfile.py b/recipes/hffix/all/conanfile.py index b8be09b23ee814..daed63ba031a69 100644 --- a/recipes/hffix/all/conanfile.py +++ b/recipes/hffix/all/conanfile.py @@ -13,20 +13,18 @@ class HffixConan(ConanFile): topics = ("fixprotocol", "financial") homepage = "https://github.com/jamesdbrock/hffix" url = "https://github.com/conan-io/conan-center-index" - + 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 @@ -38,5 +36,3 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.frameworkdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/hffix/all/test_package/CMakeLists.txt b/recipes/hffix/all/test_package/CMakeLists.txt index bea843560a088a..c27ed0c7d9302d 100644 --- a/recipes/hffix/all/test_package/CMakeLists.txt +++ b/recipes/hffix/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 CXX) find_package(hffix REQUIRED CONFIG) diff --git a/recipes/hffix/all/test_package/conanfile.py b/recipes/hffix/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/hffix/all/test_package/conanfile.py +++ b/recipes/hffix/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/hffix/all/test_v1_package/CMakeLists.txt b/recipes/hffix/all/test_v1_package/CMakeLists.txt index 31a17e5e32684e..b21cc49efde95c 100644 --- a/recipes/hffix/all/test_v1_package/CMakeLists.txt +++ b/recipes/hffix/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(hffix REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE hffix::hffix) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hffix/config.yml b/recipes/hffix/config.yml index 60d31991f5141a..4d32e3eeef7e4e 100644 --- a/recipes/hffix/config.yml +++ b/recipes/hffix/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.0": + folder: all "1.1.1": folder: all diff --git a/recipes/hictk/all/conandata.yml b/recipes/hictk/all/conandata.yml new file mode 100644 index 00000000000000..0a77d0b0f3599a --- /dev/null +++ b/recipes/hictk/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.0.3": + url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v0.0.3.tar.gz" + sha256: "f49657b9ef80ef9fa07f125a0b6f056923235c9ea77e19cee312b004384ea39e" + "0.0.2": + url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v0.0.2.tar.gz" + sha256: "7716711ecb33247d8f79f6768ebbdcf55e51e9b6f962245747b33d0967431427" + "0.0.1": + url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v0.0.1.tar.gz" + sha256: "460985413c3b2e80121f7697c6c824a91955a38051de770d7eb946ddafa88460" diff --git a/recipes/hictk/all/conanfile.py b/recipes/hictk/all/conanfile.py new file mode 100644 index 00000000000000..1951fe8bdc793f --- /dev/null +++ b/recipes/hictk/all/conanfile.py @@ -0,0 +1,116 @@ +import os.path + +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 + +required_conan_version = ">=1.50.0" + + +class HictkConan(ConanFile): + name = "hictk" + description = "Blazing fast toolkit to work with .hic and .cool files" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/paulsengroup/hictk" + topics = "hictk", "bioinformatics", "hic" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = {"with_eigen": [True, False]} + default_options = {"with_eigen": True} + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "11", + "clang": "7", + "gcc": "8", + "Visual Studio": "16", + "msvc": "192", + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("bshoshany-thread-pool/3.5.0", transitive_headers=True) + self.requires("fast_float/5.3.0", transitive_headers=True) + if self.options.with_eigen: + self.requires("eigen/3.4.0", transitive_headers=True) + self.requires("fmt/10.1.1", transitive_headers=True) + self.requires("hdf5/1.14.1", transitive_headers=True) + self.requires("highfive/2.7.1", transitive_headers=True) + self.requires("libdeflate/1.19", transitive_headers=True) + self.requires("parallel-hashmap/1.37", transitive_headers=True) + self.requires("span-lite/0.10.3", transitive_headers=True) + self.requires("spdlog/1.12.0", transitive_headers=True) + self.requires("xxhash/0.8.2", transitive_headers=True) + self.requires("zstd/1.5.5", 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) + + 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)) + 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." + ) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.25 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["HICTK_BUILD_BENCHMARKS"] = "OFF" + tc.variables["HICTK_BUILD_EXAMPLES"] = "OFF" + tc.variables["HICTK_BUILD_TOOLS"] = "OFF" + tc.variables["HICTK_ENABLE_GIT_VERSION_TRACKING"] = "OFF" + tc.variables["HICTK_ENABLE_TESTING"] = "OFF" + tc.variables["HICTK_WITH_EIGEN"] = self.options.with_eigen + tc.generate() + + cmakedeps = CMakeDeps(self) + cmakedeps.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")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "hictk") + self.cpp_info.set_property("cmake_target_name", "hictk::libhictk") diff --git a/recipes/hictk/all/test_package/CMakeLists.txt b/recipes/hictk/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..969fb76fe7be13 --- /dev/null +++ b/recipes/hictk/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(hictk REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE hictk::libhictk) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/hictk/all/test_package/conanfile.py b/recipes/hictk/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3bfefffc36b5c4 --- /dev/null +++ b/recipes/hictk/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class HictkTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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/hictk/all/test_package/test_package.cpp b/recipes/hictk/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..bbe13ab6a32190 --- /dev/null +++ b/recipes/hictk/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include "hictk/fmt.hpp" +#include "hictk/cooler/utils.hpp" + + +int main(int argc, char** argv) { + fmt::print("{}\n", hictk::cooler::utils::is_cooler(argv[0])); +} diff --git a/recipes/hictk/config.yml b/recipes/hictk/config.yml new file mode 100644 index 00000000000000..ff35624c14df59 --- /dev/null +++ b/recipes/hictk/config.yml @@ -0,0 +1,7 @@ +versions: + "0.0.3": + folder: all + "0.0.2": + folder: all + "0.0.1": + folder: all diff --git a/recipes/highfive/all/conandata.yml b/recipes/highfive/all/conandata.yml index b9befb53e74d38..edcf1ebb04b99d 100644 --- a/recipes/highfive/all/conandata.yml +++ b/recipes/highfive/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.8.0": + url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.8.0.tar.gz" + sha256: "cd2502cae61bfb00e32dd18c9dc75289e09ad1db5c2a46d3b0eefd32e0df983b" "2.7.1": url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.7.1.tar.gz" sha256: "25b4c51a94d1e670dc93b9b73f51e79b65d8ff49bcd6e5d5582d5ecd2789a249" diff --git a/recipes/highfive/all/conanfile.py b/recipes/highfive/all/conanfile.py index ebce29b0f3b163..d86d1301d6ab80 100644 --- a/recipes/highfive/all/conanfile.py +++ b/recipes/highfive/all/conanfile.py @@ -2,6 +2,7 @@ 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, rmdir, save +from conan.tools.scm import Version import os import textwrap @@ -15,34 +16,39 @@ class HighFiveConan(ConanFile): topics = ("hdf5", "hdf", "data") homepage = "https://github.com/BlueBrain/HighFive" url = "https://github.com/conan-io/conan-center-index" - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_boost": [True, False], "with_eigen": [True, False], "with_xtensor": [True, False], "with_opencv": [True, False], + "with_static_hdf5": [True, False], } default_options = { "with_boost": True, "with_eigen": True, "with_xtensor": True, "with_opencv": False, + "with_static_hdf5": False, } def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("hdf5/1.14.0") + if Version(self.version) < "2.5.1": + self.requires("hdf5/1.14.1") + else: + self.requires("hdf5/1.14.2") if self.options.with_boost: - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") if self.options.with_eigen: self.requires("eigen/3.4.0") if self.options.with_xtensor: - self.requires("xtensor/0.24.3") + self.requires("xtensor/0.24.7") if self.options.with_opencv: - self.requires("opencv/4.5.5") + self.requires("opencv/4.8.1") def package_id(self): self.info.clear() @@ -52,8 +58,7 @@ def validate(self): check_min_cppstd(self, 11) 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) @@ -65,6 +70,7 @@ def generate(self): tc.variables["HIGHFIVE_EXAMPLES"] = False tc.variables["HIGHFIVE_BUILD_DOCS"] = False tc.variables["HIGHFIVE_USE_INSTALL_DEPS"] = False + tc.variables["HIGHFIVE_STATIC_HDF5"] = self.options.with_static_hdf5 tc.generate() deps = CMakeDeps(self) deps.generate() @@ -121,7 +127,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "HighFive") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] self.cpp_info.requires = ["hdf5::hdf5"] if self.options.with_boost: self.cpp_info.requires.append("boost::headers") diff --git a/recipes/highfive/all/test_v1_package/CMakeLists.txt b/recipes/highfive/all/test_v1_package/CMakeLists.txt index 671f071b8ed9f7..b21cc49efde95c 100644 --- a/recipes/highfive/all/test_v1_package/CMakeLists.txt +++ b/recipes/highfive/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(HighFive REQUIRED CONFIG) - -add_executable(test_package ../test_package/test_package.cpp) -target_link_libraries(test_package PRIVATE HighFive) -target_compile_features(test_package PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/highfive/config.yml b/recipes/highfive/config.yml index 546cbf2ce6f7b4..28a0e4f7fb1d00 100644 --- a/recipes/highfive/config.yml +++ b/recipes/highfive/config.yml @@ -1,4 +1,6 @@ versions: + "2.8.0": + folder: all "2.7.1": folder: all "2.7.0": diff --git a/recipes/highs/all/conandata.yml b/recipes/highs/all/conandata.yml index 373553d2ba8bb5..c88418f873ba76 100644 --- a/recipes/highs/all/conandata.yml +++ b/recipes/highs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.0": + url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.6.0.tar.gz" + sha256: "71962981566477c72c51b8b722c5df053d857b05b4f0e6869f455f657b3aa193" "1.5.3": url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.5.3.tar.gz" sha256: "ce1a7d2f008e60cc69ab06f8b16831bd0fcd5f6002d3bbebae9d7a3513a1d01d" diff --git a/recipes/highs/all/conanfile.py b/recipes/highs/all/conanfile.py index a45cfe7de91d83..bba181cddafd79 100644 --- a/recipes/highs/all/conanfile.py +++ b/recipes/highs/all/conanfile.py @@ -1,7 +1,6 @@ from conan import ConanFile from conan.tools.apple import fix_apple_shared_install_name from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get from conan.tools.microsoft import is_msvc from conan.tools.scm import Version @@ -27,10 +26,6 @@ class HiGHSConan(ConanFile): "fPIC": True, } - def validate(self): - if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -46,7 +41,7 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def layout(self): cmake_layout(self, src_folder="src") @@ -75,6 +70,8 @@ def package(self): if self.options.shared: copy(self, pattern="*.so*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) copy(self, pattern="*.dylib*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + copy(self, pattern="*.lib", src=self.build_folder, dst=join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.dll", src=self.build_folder, dst=join(self.package_folder, "bin"), keep_path=False) else: copy(self, pattern="*.a", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) if Version(self.version) >= Version("1.5.3"): diff --git a/recipes/highs/all/test_v1_package/CMakeLists.txt b/recipes/highs/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 36b48f96d10783..00000000000000 --- a/recipes/highs/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) -set(CMAKE_CXX_STANDARD 11) - -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/highs/config.yml b/recipes/highs/config.yml index 03874f3b487549..ba8bd2230d031d 100644 --- a/recipes/highs/config.yml +++ b/recipes/highs/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.0": + folder: all "1.5.3": folder: all "1.4.2": diff --git a/recipes/highway/all/conandata.yml b/recipes/highway/all/conandata.yml index b0736b5e173506..710781f517c657 100644 --- a/recipes/highway/all/conandata.yml +++ b/recipes/highway/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.0.7": + url: "https://github.com/google/highway/archive/1.0.7.tar.gz" + sha256: "5434488108186c170a5e2fca5e3c9b6ef59a1caa4d520b008a9b8be6b8abe6c5" + "1.0.6": + url: "https://github.com/google/highway/archive/1.0.6.tar.gz" + sha256: "d89664a045a41d822146e787bceeefbf648cc228ce354f347b18f2b419e57207" "1.0.5": url: "https://github.com/google/highway/archive/1.0.5.tar.gz" sha256: "99b7dad98b8fa088673b720151458fae698ae5df9154016e39de4afdc23bb927" @@ -20,21 +26,6 @@ sources: "0.17.0": url: "https://github.com/google/highway/archive/0.17.0.tar.gz" sha256: "25158fd5c090b70ecea47fc246c860d150f07f801d2434e1e51ec14a6c15822c" - "0.16.0": - url: "https://github.com/google/highway/archive/0.16.0.tar.gz" - sha256: "746c9578446be6c5286e8846c5f0d4118c0c1f04219c401abadcb8a5f2051893" "0.12.2": url: "https://github.com/google/highway/archive/0.12.2.tar.gz" sha256: "e1d47ce510429fdcf31f41697ca74fb0dcd59d933196e531a86d51751a56f4cc" - "0.11.1": - url: "https://github.com/google/highway/archive/0.11.1.tar.gz" - sha256: "4c4bb9501c02b27a0944afde8923aaab554384690d37e5b2a7f97553426ea641" -patches: - "0.16.0": - - patch_file: "patches/0.16.0-0001-fix-sys-random-h.patch" - patch_description: "fix including sys/random.h on several environments" - patch_type: "portability" - "0.11.1": - - patch_file: "patches/0.11.1-0001-remove-contrib.patch" - patch_description: "remove contrib sources" - patch_type: "portability" diff --git a/recipes/highway/all/conanfile.py b/recipes/highway/all/conanfile.py index 0da9b64e6b9f47..70b41b9d07eb43 100644 --- a/recipes/highway/all/conanfile.py +++ b/recipes/highway/all/conanfile.py @@ -21,10 +21,12 @@ class HighwayConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_test": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_test": False, } @property @@ -53,6 +55,8 @@ def configure(self): self.package_type = "static-library" elif self.options.shared: self.options.rm_safe("fPIC") + if Version(self.version) < "1.0.6": + del self.options.with_test def layout(self): cmake_layout(self, src_folder="src") @@ -73,7 +77,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False tc.variables["HWY_ENABLE_EXAMPLES"] = False - tc.variables["HWY_ENABLE_TESTS"] = False + tc.variables["HWY_ENABLE_TESTS"] = self.options.get_safe("with_test", False) tc.generate() def _patch_sources(self): @@ -109,7 +113,7 @@ def package_info(self): self.cpp_info.components["hwy_contrib"].set_property("pkg_config_name", "libhwy-contrib") self.cpp_info.components["hwy_contrib"].libs = ["hwy_contrib"] self.cpp_info.components["hwy_contrib"].requires = ["hwy"] - if Version(self.version) >= "0.15.0": + if "0.15.0" <= Version(self.version) < "1.0.6" or (Version(self.version) >= "1.0.6" and self.options.with_test): self.cpp_info.components["hwy_test"].set_property("pkg_config_name", "libhwy-test") self.cpp_info.components["hwy_test"].libs = ["hwy_test"] self.cpp_info.components["hwy_test"].requires = ["hwy"] diff --git a/recipes/highway/all/patches/0.11.1-0001-remove-contrib.patch b/recipes/highway/all/patches/0.11.1-0001-remove-contrib.patch deleted file mode 100644 index e409cd92d3227f..00000000000000 --- a/recipes/highway/all/patches/0.11.1-0001-remove-contrib.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -52,9 +52,6 @@ check_cxx_source_compiles( - ) - - set(HWY_SOURCES -- contrib/image/image.cc -- contrib/image/image.h -- contrib/math/math-inl.h - hwy/aligned_allocator.cc - hwy/aligned_allocator.h - hwy/base.h diff --git a/recipes/highway/all/patches/0.16.0-0001-fix-sys-random-h.patch b/recipes/highway/all/patches/0.16.0-0001-fix-sys-random-h.patch deleted file mode 100644 index aee3b37dc1e43f..00000000000000 --- a/recipes/highway/all/patches/0.16.0-0001-fix-sys-random-h.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git a/hwy/contrib/sort/vqsort.cc b/hwy/contrib/sort/vqsort.cc -index 951a0bd..2009da8 100644 ---- a/hwy/contrib/sort/vqsort.cc -+++ b/hwy/contrib/sort/vqsort.cc -@@ -25,12 +25,43 @@ - // After foreach_target - #include "hwy/contrib/sort/shared-inl.h" - -+// Check if we have sys/random.h. First skip some systems on which the check -+// itself (features.h) might be problematic. -+#if defined(ANDROID) || defined(__ANDROID__) || HWY_ARCH_RVV -+#define VQSORT_GETRANDOM 0 -+#endif -+ -+#if !defined(VQSORT_GETRANDOM) && (defined(linux) || defined(__linux__)) -+#include -+ -+// ---- which libc -+#if defined(__UCLIBC__) -+#define VQSORT_GETRANDOM 1 // added Mar 2015, before uclibc-ng 1.0 -+ -+#elif defined(__GLIBC__) && defined(__GLIBC_PREREQ) -+#if __GLIBC_PREREQ(2, 25) -+#define VQSORT_GETRANDOM 1 -+#else -+#define VQSORT_GETRANDOM 0 -+#endif -+ -+#else -+// Assume MUSL, which has getrandom since 2018. There is no macro to test, see -+// https://www.openwall.com/lists/musl/2013/03/29/13. -+#define VQSORT_GETRANDOM 1 -+ -+#endif // ---- which libc -+#endif // linux -+ -+#if !defined(VQSORT_GETRANDOM) -+#define VQSORT_GETRANDOM 0 -+#endif -+ - // Seed source for SFC generator: 1=getrandom, 2=CryptGenRandom - // (not all Android support the getrandom wrapper) - #ifndef VQSORT_SECURE_SEED - --#if (defined(linux) || defined(__linux__)) && \ -- !(defined(ANDROID) || defined(__ANDROID__) || HWY_ARCH_RVV) -+#if VQSORT_GETRANDOM - #define VQSORT_SECURE_SEED 1 - #elif defined(_WIN32) || defined(_WIN64) - #define VQSORT_SECURE_SEED 2 diff --git a/recipes/highway/config.yml b/recipes/highway/config.yml index 48d515416587a4..51114d87501db4 100644 --- a/recipes/highway/config.yml +++ b/recipes/highway/config.yml @@ -1,4 +1,8 @@ versions: + "1.0.7": + folder: all + "1.0.6": + folder: all "1.0.5": folder: all "1.0.4": @@ -13,9 +17,5 @@ versions: folder: all "0.17.0": folder: all - "0.16.0": - folder: all "0.12.2": folder: all - "0.11.1": - folder: all diff --git a/recipes/hlslpp/all/conandata.yml b/recipes/hlslpp/all/conandata.yml index 41a6668e87c713..213b230fcc1d68 100644 --- a/recipes/hlslpp/all/conandata.yml +++ b/recipes/hlslpp/all/conandata.yml @@ -1,10 +1,10 @@ sources: - "3.2.2": - url: "https://github.com/redorav/hlslpp/archive/refs/tags/3.2.2.tar.gz" - sha256: "f8fae38e6f02920f24344a86397f03b2a7a1fe18bbcb77f4c39bc33978c4a058" - "3.2": - url: "https://github.com/redorav/hlslpp/archive/3.2.tar.gz" - sha256: "23ab0b7f392c518185157e9b1e099eac0a560f4932cebbdf8ccb4a533a0d0336" + "3.3.1": + url: "https://github.com/redorav/hlslpp/archive/3.3.1.tar.gz" + sha256: "0756161beb8dd9eae377dc11e933d045618fea7ac93674f60eb8cffc04080499" + "3.2.3": + url: "https://github.com/redorav/hlslpp/archive/refs/tags/3.2.3.tar.gz" + sha256: "132149d25306cdc56a87c1d6a4a93d3200de4864b5d27d758d235ce4ace64498" "3.1": url: "https://github.com/redorav/hlslpp/archive/refs/tags/3.1.tar.gz" sha256: "6f933e43bf8150a41d76a188377e59007897dc87e96be30608e7f2007605d5c4" diff --git a/recipes/hlslpp/all/conanfile.py b/recipes/hlslpp/all/conanfile.py index d8ccb3fef6db2b..89394902b29397 100644 --- a/recipes/hlslpp/all/conanfile.py +++ b/recipes/hlslpp/all/conanfile.py @@ -1,7 +1,9 @@ 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 import os required_conan_version = ">=1.50.0" @@ -14,9 +16,18 @@ class HlslppConan(ConanFile): license = "MIT" homepage = "https://github.com/redorav/hlslpp" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return {"gcc": "6"} if Version(self.version) >= "3.3" else {} + def layout(self): basic_layout(self, src_folder="src") @@ -25,11 +36,15 @@ def package_id(self): def validate(self): 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." + ) 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 diff --git a/recipes/hlslpp/config.yml b/recipes/hlslpp/config.yml index 199b902f235398..6f4aad719df58d 100644 --- a/recipes/hlslpp/config.yml +++ b/recipes/hlslpp/config.yml @@ -1,7 +1,7 @@ versions: - "3.2.2": + "3.3.1": folder: all - "3.2": + "3.2.3": folder: all "3.1": folder: all diff --git a/recipes/homog2d/all/conanfile.py b/recipes/homog2d/all/conanfile.py index 126a1b155e8d7b..ba7c79a56f0f05 100644 --- a/recipes/homog2d/all/conanfile.py +++ b/recipes/homog2d/all/conanfile.py @@ -15,6 +15,7 @@ class Homog2dConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/skramm/homog2d" topics = ("computational-geometry", "homography", "2d-geometric", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @property diff --git a/recipes/hunspell/all/CMakeLists.txt b/recipes/hunspell/all/CMakeLists.txt index b2bc98f40adabc..8fb4e22ab52aa5 100644 --- a/recipes/hunspell/all/CMakeLists.txt +++ b/recipes/hunspell/all/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(hunspell VERSION "${CONAN_hunspell_VERSION}" LANGUAGES CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS KEEP_RPATHS) -set(src src/hunspell) +set(src "${CMAKE_CURRENT_SOURCE_DIR}/src/src/hunspell") # ---- Configure hunvisapi.h ---- @@ -28,6 +26,8 @@ add_library( "${src}/suggestmgr.cxx" ) +target_compile_features(hunspell PRIVATE cxx_std_11) + if(MSVC) target_compile_options(hunspell PRIVATE /wd4267 /wd4996) endif() diff --git a/recipes/hunspell/all/conandata.yml b/recipes/hunspell/all/conandata.yml index 6c8c08bc2e4b03..69ac32949f949c 100644 --- a/recipes/hunspell/all/conandata.yml +++ b/recipes/hunspell/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.7.2": + sha256: "69fa312d3586c988789266eaf7ffc9861d9f6396c31fc930a014d551b59bbd6e" + url: https://github.com/hunspell/hunspell/archive/refs/tags/v1.7.2.tar.gz "1.7.0": sha256: "57be4e03ae9dd62c3471f667a0d81a14513e314d4d92081292b90435944ff951" url: https://github.com/hunspell/hunspell/files/2573619/hunspell-1.7.0.tar.gz +patches: + "1.7.2": + - patch_file: "patches/0001-fix-basic-string.patch" + patch_description: "Fix build problem with basic_string::append()" + patch_type: "official" + patch_source: "https://github.com/hunspell/hunspell/commit/a6cb9f609b0292df12e2e855c97303de306bae44" diff --git a/recipes/hunspell/all/conanfile.py b/recipes/hunspell/all/conanfile.py index 6c74ea78eaba74..914e9604ac575f 100644 --- a/recipes/hunspell/all/conanfile.py +++ b/recipes/hunspell/all/conanfile.py @@ -1,21 +1,21 @@ -import functools +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, export_conandata_patches, apply_conandata_patches import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class HunspellConan(ConanFile): name = "hunspell" - description = ( - "Hunspell is a free spell checker and morphological analyzer library" - ) + description = "Hunspell is a free spell checker and morphological analyzer library" url = "https://github.com/conan-io/conan-center-index" homepage = "https://hunspell.github.io/" topics = "spell", "spell-check" license = "MPL-1.1", "GPL-2.0-or-later", "LGPL-2.1-or-later" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,10 +25,11 @@ class HunspellConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake" - # FIXME: Remove once the pending upstream PR for CMake support is merged - exports_sources = "CMakeLists.txt" - no_copy_source = True + + def export_sources(self): + export_conandata_patches(self) + # TODO: Remove once PR is merged: https://github.com/hunspell/hunspell/pull/704/ + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -36,30 +37,44 @@ 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 source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) # NOTE: The source contains a pre-configured hunvisapi.h and it would # prevent no_copy_source and building without patches. h = os.path.join(self.source_folder, "src", "hunspell", "hunvisapi.h") os.remove(h) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["CONAN_hunspell_VERSION"] = self.version - cmake.configure() - return cmake + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CONAN_hunspell_VERSION"] = self.version + tc.generate() def build(self): - self._configure_cmake().build() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() def package(self): - self._configure_cmake().install() - self.copy("COPYING", "licenses") - self.copy("COPYING.LESSER", "licenses") - self.copy("license.hunspell", "licenses") + cmake = CMake(self) + cmake.install() + copy(self, "COPYING*", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + keep_path=False) + copy(self, "license.hunspell", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + keep_path=False) def package_info(self): self.cpp_info.libs = ["hunspell"] diff --git a/recipes/hunspell/all/patches/0001-fix-basic-string.patch b/recipes/hunspell/all/patches/0001-fix-basic-string.patch new file mode 100644 index 00000000000000..71aa1cdafa6c8e --- /dev/null +++ b/recipes/hunspell/all/patches/0001-fix-basic-string.patch @@ -0,0 +1,71 @@ +diff --git a/src/hunspell/affentry.cxx b/src/hunspell/affentry.cxx +index 46e8b5826..6ee23bec9 100644 +--- a/src/hunspell/affentry.cxx ++++ b/src/hunspell/affentry.cxx +@@ -290,7 +290,7 @@ struct hentry* PfxEntry::check_twosfx(const std::string& word, + // back any characters that would have been stripped + + std::string tmpword(strip); +- tmpword.append(word, start + appnd.size()); ++ tmpword.append(word, start + appnd.size(), tmpl); + + // now make sure all of the conditions on characters + // are met. Please see the appendix at the end of +@@ -338,7 +338,7 @@ std::string PfxEntry::check_twosfx_morph(const std::string& word, + // back any characters that would have been stripped + + std::string tmpword(strip); +- tmpword.append(word, start + appnd.size()); ++ tmpword.append(word, start + appnd.size(), tmpl); + + // now make sure all of the conditions on characters + // are met. Please see the appendix at the end of +@@ -386,7 +386,7 @@ std::string PfxEntry::check_morph(const std::string& word, + // back any characters that would have been stripped + + std::string tmpword(strip); +- tmpword.append(word, start + appnd.size()); ++ tmpword.append(word, start + appnd.size(), tmpl); + + // now make sure all of the conditions on characters + // are met. Please see the appendix at the end of +diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx +index 4d1ad2f12..a8931c14a 100644 +--- a/src/hunspell/affixmgr.cxx ++++ b/src/hunspell/affixmgr.cxx +@@ -2465,7 +2465,7 @@ int AffixMgr::compound_check_morph(const std::string& word, + result.append(presult); + result.push_back(MSEP_FLD); + result.append(MORPH_PART); +- result.append(word, i); ++ result.append(word, i, word.size()); + if (complexprefixes && HENTRY_DATA(rv)) + result.append(HENTRY_DATA2(rv)); + if (!HENTRY_FIND(rv, MORPH_STEM)) { +@@ -2522,7 +2522,7 @@ int AffixMgr::compound_check_morph(const std::string& word, + result.append(presult); + result.push_back(MSEP_FLD); + result.append(MORPH_PART); +- result.append(word, i); ++ result.append(word, i, word.size()); + + if (HENTRY_DATA(rv)) { + if (complexprefixes) +@@ -2573,7 +2573,7 @@ int AffixMgr::compound_check_morph(const std::string& word, + if (!m.empty()) { + result.push_back(MSEP_FLD); + result.append(MORPH_PART); +- result.append(word, i); ++ result.append(word, i, word.size()); + line_uniq_app(m, MSEP_REC); + result.append(m); + } +@@ -2665,7 +2665,7 @@ int AffixMgr::compound_check_morph(const std::string& word, + if (!m.empty()) { + result.push_back(MSEP_FLD); + result.append(MORPH_PART); +- result.append(word, i); ++ result.append(word, i, word.size()); + line_uniq_app(m, MSEP_REC); + result.push_back(MSEP_FLD); + result.append(m); diff --git a/recipes/hunspell/all/test_package/CMakeLists.txt b/recipes/hunspell/all/test_package/CMakeLists.txt index 73177e055de6d8..45217182fc8cf5 100644 --- a/recipes/hunspell/all/test_package/CMakeLists.txt +++ b/recipes/hunspell/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(hunspell REQUIRED CONFIG) -add_executable(test_package test_package.cxx) -target_link_libraries(test_package PRIVATE hunspell::hunspell) +add_executable(${PROJECT_NAME} test_package.cxx) +target_link_libraries(${PROJECT_NAME} PRIVATE hunspell::hunspell) diff --git a/recipes/hunspell/all/test_package/conanfile.py b/recipes/hunspell/all/test_package/conanfile.py index a8c92dea633357..0a6bc68712d901 100644 --- a/recipes/hunspell/all/test_package/conanfile.py +++ b/recipes/hunspell/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, cmake_layout import os -from conans import ConanFile, CMake, tools - class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "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) @@ -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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/hunspell/all/test_v1_package/CMakeLists.txt b/recipes/hunspell/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..5d38c542b67a46 --- /dev/null +++ b/recipes/hunspell/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +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/hunspell/all/test_v1_package/conanfile.py b/recipes/hunspell/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a500b98343c743 --- /dev/null +++ b/recipes/hunspell/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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) diff --git a/recipes/hunspell/config.yml b/recipes/hunspell/config.yml index 0f57b11de8fb0a..cc37272dbe648e 100644 --- a/recipes/hunspell/config.yml +++ b/recipes/hunspell/config.yml @@ -1,3 +1,5 @@ versions: + "1.7.2": + folder: all "1.7.0": folder: all diff --git a/recipes/hwdata/all/conandata.yml b/recipes/hwdata/all/conandata.yml new file mode 100644 index 00000000000000..8654aa367ec46c --- /dev/null +++ b/recipes/hwdata/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.376": + url: "https://github.com/vcrhonek/hwdata/archive/v0.376.tar.gz" + sha256: "48d85dbf05650b2c382ffaadeb601cac1650f5a34ee5c452df8021af988ea090" + "0.374": + url: "https://github.com/vcrhonek/hwdata/archive/v0.374.tar.gz" + sha256: "2a0988bf5e97e49159d7f02a5e02a719c8976d4ec883a8abb635149d221ceca0" diff --git a/recipes/hwdata/all/conanfile.py b/recipes/hwdata/all/conanfile.py new file mode 100644 index 00000000000000..a8f5e3c5ad1185 --- /dev/null +++ b/recipes/hwdata/all/conanfile.py @@ -0,0 +1,84 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.53.0" + + +class HwDataConan(ConanFile): + name = "hwdata" + description = "hwdata contains various hardware identification and configuration data, such as the pci.ids and usb.ids databases" + license = ("GPL-2.0-or-later", "XFree86-1.1") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/vcrhonek/hwdata" + topics = ("hardware", "id", "pci", "usb") + package_type = "unknown" + settings = "os", "arch", "compiler", "build_type" + options = { + "disable_blacklist": [True, False], + } + default_options = { + "disable_blacklist": False, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + self.folders.build = "src" + + def package_id(self): + del self.info.settings.arch + del self.info.settings.build_type + del self.info.settings.compiler + del self.info.settings.os + + def build_requirements(self): + 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): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--datarootdir=/res") + if self.options.disable_blacklist: + tc.configure_args.append("--disable-blacklist") + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", self.source_folder, 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() + rmdir(self, os.path.join(self.package_folder, "res", "pkgconfig")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] + pkg_config_variables = { + "pkgdatadir": os.path.join(self.package_folder, "res", self.name) + } + self.cpp_info.set_property("pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkg_config_variables.items())) diff --git a/recipes/hwdata/all/test_package/conanfile.py b/recipes/hwdata/all/test_package/conanfile.py new file mode 100644 index 00000000000000..0edcd74c5d4d61 --- /dev/null +++ b/recipes/hwdata/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conan import ConanFile +from conan.tools.files import save, load +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + save(self, "hwdata_pkg_dir", self.dependencies[self.tested_reference_str].package_folder) + + def test(self): + pkg_dir = load(self, "hwdata_pkg_dir") + assert os.path.isfile(os.path.join(pkg_dir, "res", "hwdata", "usb.ids")) diff --git a/recipes/hwdata/config.yml b/recipes/hwdata/config.yml new file mode 100644 index 00000000000000..daf8b29da7ddeb --- /dev/null +++ b/recipes/hwdata/config.yml @@ -0,0 +1,5 @@ +versions: + "0.376": + folder: all + "0.374": + folder: all diff --git a/recipes/hwloc/all/conandata.yml b/recipes/hwloc/all/conandata.yml index 7281cec31bd364..c3a77f045e4add 100644 --- a/recipes/hwloc/all/conandata.yml +++ b/recipes/hwloc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.9.3": + sha256: "5985db3a30bbe51234c2cd26ebe4ae9b4c3352ab788b1a464c40c0483bf4de59" + url: https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.3.tar.gz "2.9.2": sha256: "ffb554d5735e0e0a19d1fd4b2b86e771d3b58b2d97f257eedacae67ade5054b3" url: https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.2.tar.gz diff --git a/recipes/hwloc/all/conanfile.py b/recipes/hwloc/all/conanfile.py index ac1264a7b4049c..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,32 +17,22 @@ 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") def requirements(self): if self.options.with_libxml2: - self.requires("libxml2/2.9.12") + self.requires("libxml2/2.11.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -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/hwloc/config.yml b/recipes/hwloc/config.yml index b0052643e431c5..d1ef77599f89a2 100644 --- a/recipes/hwloc/config.yml +++ b/recipes/hwloc/config.yml @@ -1,4 +1,6 @@ versions: + "2.9.3": + folder: all "2.9.2": folder: all "2.9.1": diff --git a/recipes/hyperscan/all/conandata.yml b/recipes/hyperscan/all/conandata.yml index b46d4ac06c6166..e3925c18673ce7 100644 --- a/recipes/hyperscan/all/conandata.yml +++ b/recipes/hyperscan/all/conandata.yml @@ -1,12 +1,22 @@ sources: + "5.4.2": + url: "https://github.com/intel/hyperscan/archive/v5.4.2.tar.gz" + sha256: "32b0f24b3113bbc46b6bfaa05cf7cf45840b6b59333d078cc1f624e4c40b2b99" "5.4.0": url: "https://github.com/intel/hyperscan/archive/v5.4.0.tar.gz" sha256: "e51aba39af47e3901062852e5004d127fa7763b5dbbc16bcca4265243ffa106f" patches: + "5.4.2": + - patch_file: "patches/5.4.2-0001-fix-cmake.patch" + patch_description: "modify cmake files to build with conan" + patch_type: "conan" + - patch_file: "patches/5.4.2-0002-use-ue2-make_unique.patch" + patch_description: "add ue2:: prefix to make_unique for name collision" + patch_type: "portability" "5.4.0": - - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/5.4.0-0001-fix-cmake.patch" patch_description: "modify cmake files to build with conan" patch_type: "conan" - - patch_file: "patches/0002-use-ue2-make_unique.patch" + - patch_file: "patches/5.4.0-0002-use-ue2-make_unique.patch" patch_description: "add ue2:: prefix to make_unique for name collision" patch_type: "portability" diff --git a/recipes/hyperscan/all/conanfile.py b/recipes/hyperscan/all/conanfile.py index 5e30dac82fb957..8ccc3f01da9594 100644 --- a/recipes/hyperscan/all/conanfile.py +++ b/recipes/hyperscan/all/conanfile.py @@ -16,6 +16,7 @@ class HyperscanConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.hyperscan.io" topics = ("regex", "regular expressions") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -57,7 +58,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") if self.options.build_chimera: self.requires("pcre/8.45") @@ -88,6 +89,7 @@ def generate(self): tc.variables["BUILD_AVX512"] = self.options.build_avx512 tc.variables["FAT_RUNTIME"] = self.options.fat_runtime tc.variables["BUILD_CHIMERA"] = self.options.build_chimera + tc.variables["BUILD_EXAMPLES"] = False if self.options.dump_support != "auto": tc.variables["DUMP_SUPPORT"] = self.options.dump_support tc.generate() diff --git a/recipes/hyperscan/all/patches/0001-fix-cmake.patch b/recipes/hyperscan/all/patches/0001-fix-cmake.patch deleted file mode 100644 index 872966c197543c..00000000000000 --- a/recipes/hyperscan/all/patches/0001-fix-cmake.patch +++ /dev/null @@ -1,327 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8bc6077..0fbed25 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ set (HS_MINOR_VERSION 4) - set (HS_PATCH_VERSION 0) - set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION}) - --set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) -+list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") - include(CheckCCompilerFlag) - include(CheckCXXCompilerFlag) - include(CheckCXXSymbolExists) -@@ -17,8 +17,8 @@ INCLUDE (CheckLibraryExists) - INCLUDE (CheckSymbolExists) - include (CMakeDependentOption) - include (GNUInstallDirs) --include (${CMAKE_MODULE_PATH}/platform.cmake) --include (${CMAKE_MODULE_PATH}/ragel.cmake) -+include (platform) -+include (ragel) - - find_package(PkgConfig QUIET) - -@@ -69,7 +69,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src) - include_directories(${PROJECT_BINARY_DIR}) - include_directories(SYSTEM include) - --include (${CMAKE_MODULE_PATH}/boost.cmake) -+include (boost) - - # -- make this work? set(python_ADDITIONAL_VERSIONS 2.7 2.6) - find_package(PythonInterp) -@@ -84,7 +84,7 @@ endif() - # allow for reproducible builds - python for portability - if (DEFINED ENV{SOURCE_DATE_EPOCH}) - execute_process( -- COMMAND "${PYTHON}" "${CMAKE_MODULE_PATH}/formatdate.py" "$ENV{SOURCE_DATE_EPOCH}" -+ COMMAND "${PYTHON}" "${PROJECT_SOURCE_DIR}/cmake/formatdate.py" "$ENV{SOURCE_DATE_EPOCH}" - OUTPUT_VARIABLE BUILD_DATE - OUTPUT_STRIP_TRAILING_WHITESPACE) - else () -@@ -326,7 +326,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") - message (STATUS "Building the fat runtime requires the Unix Makefiles generator, or Ninja with CMake v3.0 or higher") - set (FAT_RUNTIME_REQUISITES FALSE) - else() -- include (${CMAKE_MODULE_PATH}/attrib.cmake) -+ include (attrib) - if (NOT HAS_C_ATTR_IFUNC) - message(STATUS "Compiler does not support ifunc attribute, cannot build fat runtime") - set (FAT_RUNTIME_REQUISITES FALSE) -@@ -337,7 +337,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") - CMAKE_DEPENDENT_OPTION(FAT_RUNTIME "Build a library that supports multiple microarchitectures" ${RELEASE_BUILD} "FAT_RUNTIME_REQUISITES" OFF) - endif () - --include (${CMAKE_MODULE_PATH}/arch.cmake) -+include (arch) - - # testing a builtin takes a little more work - CHECK_C_SOURCE_COMPILES("void *aa_test(void *x) { return __builtin_assume_aligned(x, 16);}\nint main(void) { return 0; }" HAVE_CC_BUILTIN_ASSUME_ALIGNED) -@@ -463,7 +463,7 @@ else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - endif() - --add_subdirectory(util) -+# add_subdirectory(util) - add_subdirectory(doc/dev-reference) - - if (NOT WIN32) -@@ -472,7 +472,7 @@ if (NOT WIN32) - set(PCRE_REQUIRED_MAJOR_VERSION 8) - set(PCRE_REQUIRED_MINOR_VERSION 41) - set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION}) --include (${CMAKE_MODULE_PATH}/pcre.cmake) -+include (pcre) - if (NOT CORRECT_PCRE_VERSION) - message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") - endif() -@@ -482,17 +482,19 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) - set(BUILD_CHIMERA TRUE) - endif() - -+if(0) - add_subdirectory(unit) --if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) -+if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt) - add_subdirectory(tools) - endif() --if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) -+endif() -+if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) - add_subdirectory(chimera) - endif() - endif() - - # do substitutions --configure_file(${CMAKE_MODULE_PATH}/config.h.in ${PROJECT_BINARY_DIR}/config.h) -+configure_file(${PROJECT_SOURCE_DIR}/cmake/config.h.in ${PROJECT_BINARY_DIR}/config.h) - configure_file(src/hs_version.h.in ${PROJECT_BINARY_DIR}/hs_version.h) - - if (NOT WIN32) -@@ -505,7 +507,7 @@ if (NOT WIN32) - endforeach() - - configure_file(libhs.pc.in libhs.pc @ONLY) # only replace @ quoted vars -- install(FILES ${CMAKE_BINARY_DIR}/libhs.pc -+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libhs.pc - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - endif() - -@@ -524,7 +526,7 @@ if (WIN32) - set(PCRE_REQUIRED_MAJOR_VERSION 8) - set(PCRE_REQUIRED_MINOR_VERSION 41) - set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION}) --include (${CMAKE_MODULE_PATH}/pcre.cmake) -+include (pcre) - if (NOT CORRECT_PCRE_VERSION) - message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") - endif() -@@ -534,11 +536,13 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) - set(BUILD_CHIMERA TRUE) - endif() - -+if(0) - add_subdirectory(unit) --if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) -+if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt) - add_subdirectory(tools) - endif() --if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) -+endif() -+if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) - add_subdirectory(chimera) - endif() - endif() -@@ -548,14 +552,14 @@ set(RAGEL_C_FLAGS "-Wno-unused") - endif() - - set_source_files_properties( -- ${CMAKE_BINARY_DIR}/src/parser/Parser.cpp -+ ${CMAKE_CURRENT_BINARY_DIR}/src/parser/Parser.cpp - PROPERTIES - COMPILE_FLAGS "${RAGEL_C_FLAGS}") - - ragelmaker(src/parser/Parser.rl) - - set_source_files_properties( -- ${CMAKE_BINARY_DIR}/src/parser/control_verbs.cpp -+ ${CMAKE_CURRENT_BINARY_DIR}/src/parser/control_verbs.cpp - PROPERTIES - COMPILE_FLAGS "${RAGEL_C_FLAGS}") - -@@ -1216,28 +1220,28 @@ else (FAT_RUNTIME) - list(APPEND RUNTIME_LIBS $) - set_target_properties(hs_exec_core2 PROPERTIES - COMPILE_FLAGS "-march=core2" -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - - add_library(hs_exec_corei7 OBJECT ${hs_exec_SRCS}) - list(APPEND RUNTIME_LIBS $) - set_target_properties(hs_exec_corei7 PROPERTIES - COMPILE_FLAGS "-march=corei7" -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - - add_library(hs_exec_avx2 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) - list(APPEND RUNTIME_LIBS $) - set_target_properties(hs_exec_avx2 PROPERTIES - COMPILE_FLAGS "-march=core-avx2" -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - if (BUILD_AVX512) - add_library(hs_exec_avx512 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) - list(APPEND RUNTIME_LIBS $) - set_target_properties(hs_exec_avx512 PROPERTIES - COMPILE_FLAGS "${SKYLAKE_FLAG}" -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - endif (BUILD_AVX512) - if (BUILD_AVX512VBMI) -@@ -1245,7 +1249,7 @@ else (FAT_RUNTIME) - list(APPEND RUNTIME_LIBS $) - set_target_properties(hs_exec_avx512vbmi PROPERTIES - COMPILE_FLAGS "${ICELAKE_FLAG}" -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - endif (BUILD_AVX512VBMI) - -@@ -1280,21 +1284,21 @@ else (FAT_RUNTIME) - set_target_properties(hs_exec_shared_core2 PROPERTIES - COMPILE_FLAGS "-march=core2" - POSITION_INDEPENDENT_CODE TRUE -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - add_library(hs_exec_shared_corei7 OBJECT ${hs_exec_SRCS}) - list(APPEND RUNTIME_SHLIBS $) - set_target_properties(hs_exec_shared_corei7 PROPERTIES - COMPILE_FLAGS "-march=corei7" - POSITION_INDEPENDENT_CODE TRUE -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - add_library(hs_exec_shared_avx2 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) - list(APPEND RUNTIME_SHLIBS $) - set_target_properties(hs_exec_shared_avx2 PROPERTIES - COMPILE_FLAGS "-march=core-avx2" - POSITION_INDEPENDENT_CODE TRUE -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - - if (BUILD_AVX512) -@@ -1303,7 +1307,7 @@ else (FAT_RUNTIME) - set_target_properties(hs_exec_shared_avx512 PROPERTIES - COMPILE_FLAGS "${SKYLAKE_FLAG}" - POSITION_INDEPENDENT_CODE TRUE -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - endif (BUILD_AVX512) - if (BUILD_AVX512VBMI) -@@ -1312,7 +1316,7 @@ else (FAT_RUNTIME) - set_target_properties(hs_exec_shared_avx512vbmi PROPERTIES - COMPILE_FLAGS "${ICELAKE_FLAG}" - POSITION_INDEPENDENT_CODE TRUE -- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${CMAKE_MODULE_PATH}/keep.syms.in" -+ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" - ) - endif (BUILD_AVX512VBMI) - add_library(hs_exec_common_shared OBJECT -diff --git a/chimera/CMakeLists.txt b/chimera/CMakeLists.txt -index 1cd66a3..ebb3b49 100644 ---- a/chimera/CMakeLists.txt -+++ b/chimera/CMakeLists.txt -@@ -44,6 +44,6 @@ if (NOT WIN32) - set(PRIVATE_LIBS "${PRIVATE_LIBS} -L${LIBDIR} -lpcre") - - configure_file(libch.pc.in libch.pc @ONLY) # only replace @ quoted vars -- install(FILES ${CMAKE_BINARY_DIR}/chimera/libch.pc -+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libch.pc - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - endif() -diff --git a/chimera/ch_database.h b/chimera/ch_database.h -index 28bde86..d757c82 100644 ---- a/chimera/ch_database.h -+++ b/chimera/ch_database.h -@@ -38,7 +38,7 @@ extern "C" - { - #endif - --#define PCRE_STATIC -+/* #define PCRE_STATIC */ - #include - - #include "ch_compile.h" // for CH_MODE_ flags -diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake -index e0acda5..c3cbbc7 100644 ---- a/cmake/pcre.cmake -+++ b/cmake/pcre.cmake -@@ -1,4 +1,5 @@ - # first look in pcre-$version or pcre subdirs -+ - if (PCRE_SOURCE) - # either provided on cmdline or we've seen it already - set (PCRE_BUILD_SOURCE TRUE) -@@ -50,14 +51,10 @@ if (PCRE_BUILD_SOURCE) - set(PCRE_INCLUDE_DIRS ${PCRE_SOURCE} ${PROJECT_BINARY_DIR}/pcre) - set(PCRE_LDFLAGS -L"${LIBDIR}" -lpcre) - else () -- # pkgconf should save us -- find_package(PkgConfig) -- pkg_check_modules(PCRE libpcre>=${PCRE_REQUIRED_VERSION}) -- if (PCRE_FOUND) -+ # conan should save us -+ find_package(pcre) -+ if(pcre_FOUND AND (pcre_VERSION VERSION_GREATER_EQUAL PCRE_REQUIRED_VERSION)) - set(CORRECT_PCRE_VERSION TRUE) -- message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above") -- else () -- message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above not found") -- return () -- endif () -+ set(PCRE_LDFLAGS "pcre::pcre") -+ endif() - endif (PCRE_BUILD_SOURCE) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 6ca3fd8..378afd0 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -1,3 +1,7 @@ -+ -+# Tools are not installed -+return () -+ - find_package(Threads) - - # remove some warnings -diff --git a/tools/hsbench/CMakeLists.txt b/tools/hsbench/CMakeLists.txt -index bbceda4..18545d0 100644 ---- a/tools/hsbench/CMakeLists.txt -+++ b/tools/hsbench/CMakeLists.txt -@@ -1,4 +1,4 @@ --include (${CMAKE_MODULE_PATH}/sqlite3.cmake) -+include (sqlite3) - if (NOT SQLITE3_FOUND) - message(STATUS "sqlite3 not found, not building hsbench") - return() -diff --git a/tools/hscollider/CMakeLists.txt b/tools/hscollider/CMakeLists.txt -index a4d71b2..f733479 100644 ---- a/tools/hscollider/CMakeLists.txt -+++ b/tools/hscollider/CMakeLists.txt -@@ -5,7 +5,7 @@ endif() - - include_directories(${PCRE_INCLUDE_DIRS}) - --include(${CMAKE_MODULE_PATH}/backtrace.cmake) -+include(backtrace) - - # we need static libs - too much deep magic for shared libs - if (NOT BUILD_STATIC_LIBS) diff --git a/recipes/hyperscan/all/patches/5.4.0-0001-fix-cmake.patch b/recipes/hyperscan/all/patches/5.4.0-0001-fix-cmake.patch new file mode 100644 index 00000000000000..ab66becd930f5b --- /dev/null +++ b/recipes/hyperscan/all/patches/5.4.0-0001-fix-cmake.patch @@ -0,0 +1,338 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8bc6077..2dfdf29 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ set (HS_MINOR_VERSION 4) + set (HS_PATCH_VERSION 0) + set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION}) + +-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) ++list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + include(CheckCCompilerFlag) + include(CheckCXXCompilerFlag) + include(CheckCXXSymbolExists) +@@ -17,8 +17,8 @@ INCLUDE (CheckLibraryExists) + INCLUDE (CheckSymbolExists) + include (CMakeDependentOption) + include (GNUInstallDirs) +-include (${CMAKE_MODULE_PATH}/platform.cmake) +-include (${CMAKE_MODULE_PATH}/ragel.cmake) ++include (platform) ++include (ragel) + + find_package(PkgConfig QUIET) + +@@ -69,7 +69,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src) + include_directories(${PROJECT_BINARY_DIR}) + include_directories(SYSTEM include) + +-include (${CMAKE_MODULE_PATH}/boost.cmake) ++include (boost) + + # -- make this work? set(python_ADDITIONAL_VERSIONS 2.7 2.6) + find_package(PythonInterp) +@@ -84,7 +84,7 @@ endif() + # allow for reproducible builds - python for portability + if (DEFINED ENV{SOURCE_DATE_EPOCH}) + execute_process( +- COMMAND "${PYTHON}" "${CMAKE_MODULE_PATH}/formatdate.py" "$ENV{SOURCE_DATE_EPOCH}" ++ COMMAND "${PYTHON}" "${PROJECT_SOURCE_DIR}/cmake/formatdate.py" "$ENV{SOURCE_DATE_EPOCH}" + OUTPUT_VARIABLE BUILD_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE) + else () +@@ -242,8 +242,8 @@ else() + if (NOT RELEASE_BUILD) + # -Werror is most useful during development, don't potentially break + # release builds +- set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror") +- set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Werror") ++ #set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror") ++ #set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Werror") + endif() + + if (DISABLE_ASSERTS) +@@ -326,7 +326,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") + message (STATUS "Building the fat runtime requires the Unix Makefiles generator, or Ninja with CMake v3.0 or higher") + set (FAT_RUNTIME_REQUISITES FALSE) + else() +- include (${CMAKE_MODULE_PATH}/attrib.cmake) ++ include (attrib) + if (NOT HAS_C_ATTR_IFUNC) + message(STATUS "Compiler does not support ifunc attribute, cannot build fat runtime") + set (FAT_RUNTIME_REQUISITES FALSE) +@@ -337,7 +337,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") + CMAKE_DEPENDENT_OPTION(FAT_RUNTIME "Build a library that supports multiple microarchitectures" ${RELEASE_BUILD} "FAT_RUNTIME_REQUISITES" OFF) + endif () + +-include (${CMAKE_MODULE_PATH}/arch.cmake) ++include (arch) + + # testing a builtin takes a little more work + CHECK_C_SOURCE_COMPILES("void *aa_test(void *x) { return __builtin_assume_aligned(x, 16);}\nint main(void) { return 0; }" HAVE_CC_BUILTIN_ASSUME_ALIGNED) +@@ -463,7 +463,7 @@ else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + +-add_subdirectory(util) ++# add_subdirectory(util) + add_subdirectory(doc/dev-reference) + + if (NOT WIN32) +@@ -472,7 +472,7 @@ if (NOT WIN32) + set(PCRE_REQUIRED_MAJOR_VERSION 8) + set(PCRE_REQUIRED_MINOR_VERSION 41) + set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION}) +-include (${CMAKE_MODULE_PATH}/pcre.cmake) ++include (pcre) + if (NOT CORRECT_PCRE_VERSION) + message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") + endif() +@@ -482,17 +482,19 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) + set(BUILD_CHIMERA TRUE) + endif() + ++if(0) + add_subdirectory(unit) +-if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) ++if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt) + add_subdirectory(tools) + endif() +-if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) ++endif() ++if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) + add_subdirectory(chimera) + endif() + endif() + + # do substitutions +-configure_file(${CMAKE_MODULE_PATH}/config.h.in ${PROJECT_BINARY_DIR}/config.h) ++configure_file(${PROJECT_SOURCE_DIR}/cmake/config.h.in ${PROJECT_BINARY_DIR}/config.h) + configure_file(src/hs_version.h.in ${PROJECT_BINARY_DIR}/hs_version.h) + + if (NOT WIN32) +@@ -505,7 +507,7 @@ if (NOT WIN32) + endforeach() + + configure_file(libhs.pc.in libhs.pc @ONLY) # only replace @ quoted vars +- install(FILES ${CMAKE_BINARY_DIR}/libhs.pc ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libhs.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif() + +@@ -524,7 +526,7 @@ if (WIN32) + set(PCRE_REQUIRED_MAJOR_VERSION 8) + set(PCRE_REQUIRED_MINOR_VERSION 41) + set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION}) +-include (${CMAKE_MODULE_PATH}/pcre.cmake) ++include (pcre) + if (NOT CORRECT_PCRE_VERSION) + message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") + endif() +@@ -534,11 +536,13 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) + set(BUILD_CHIMERA TRUE) + endif() + ++if(0) + add_subdirectory(unit) +-if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) ++if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt) + add_subdirectory(tools) + endif() +-if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) ++endif() ++if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) + add_subdirectory(chimera) + endif() + endif() +@@ -548,14 +552,14 @@ set(RAGEL_C_FLAGS "-Wno-unused") + endif() + + set_source_files_properties( +- ${CMAKE_BINARY_DIR}/src/parser/Parser.cpp ++ ${CMAKE_CURRENT_BINARY_DIR}/src/parser/Parser.cpp + PROPERTIES + COMPILE_FLAGS "${RAGEL_C_FLAGS}") + + ragelmaker(src/parser/Parser.rl) + + set_source_files_properties( +- ${CMAKE_BINARY_DIR}/src/parser/control_verbs.cpp ++ ${CMAKE_CURRENT_BINARY_DIR}/src/parser/control_verbs.cpp + PROPERTIES + COMPILE_FLAGS "${RAGEL_C_FLAGS}") + +@@ -1216,28 +1220,28 @@ else (FAT_RUNTIME) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_core2 PROPERTIES + COMPILE_FLAGS "-march=core2" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + + add_library(hs_exec_corei7 OBJECT ${hs_exec_SRCS}) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_corei7 PROPERTIES + COMPILE_FLAGS "-march=corei7" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + + add_library(hs_exec_avx2 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_avx2 PROPERTIES + COMPILE_FLAGS "-march=core-avx2" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + if (BUILD_AVX512) + add_library(hs_exec_avx512 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_avx512 PROPERTIES + COMPILE_FLAGS "${SKYLAKE_FLAG}" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512) + if (BUILD_AVX512VBMI) +@@ -1245,7 +1249,7 @@ else (FAT_RUNTIME) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_avx512vbmi PROPERTIES + COMPILE_FLAGS "${ICELAKE_FLAG}" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512VBMI) + +@@ -1280,21 +1284,21 @@ else (FAT_RUNTIME) + set_target_properties(hs_exec_shared_core2 PROPERTIES + COMPILE_FLAGS "-march=core2" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + add_library(hs_exec_shared_corei7 OBJECT ${hs_exec_SRCS}) + list(APPEND RUNTIME_SHLIBS $) + set_target_properties(hs_exec_shared_corei7 PROPERTIES + COMPILE_FLAGS "-march=corei7" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + add_library(hs_exec_shared_avx2 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) + list(APPEND RUNTIME_SHLIBS $) + set_target_properties(hs_exec_shared_avx2 PROPERTIES + COMPILE_FLAGS "-march=core-avx2" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + + if (BUILD_AVX512) +@@ -1303,7 +1307,7 @@ else (FAT_RUNTIME) + set_target_properties(hs_exec_shared_avx512 PROPERTIES + COMPILE_FLAGS "${SKYLAKE_FLAG}" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512) + if (BUILD_AVX512VBMI) +@@ -1312,7 +1316,7 @@ else (FAT_RUNTIME) + set_target_properties(hs_exec_shared_avx512vbmi PROPERTIES + COMPILE_FLAGS "${ICELAKE_FLAG}" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512VBMI) + add_library(hs_exec_common_shared OBJECT +diff --git a/chimera/CMakeLists.txt b/chimera/CMakeLists.txt +index 1cd66a3..ebb3b49 100644 +--- a/chimera/CMakeLists.txt ++++ b/chimera/CMakeLists.txt +@@ -44,6 +44,6 @@ if (NOT WIN32) + set(PRIVATE_LIBS "${PRIVATE_LIBS} -L${LIBDIR} -lpcre") + + configure_file(libch.pc.in libch.pc @ONLY) # only replace @ quoted vars +- install(FILES ${CMAKE_BINARY_DIR}/chimera/libch.pc ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libch.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif() +diff --git a/chimera/ch_database.h b/chimera/ch_database.h +index 28bde86..d757c82 100644 +--- a/chimera/ch_database.h ++++ b/chimera/ch_database.h +@@ -38,7 +38,7 @@ extern "C" + { + #endif + +-#define PCRE_STATIC ++/* #define PCRE_STATIC */ + #include + + #include "ch_compile.h" // for CH_MODE_ flags +diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake +index e0acda5..c3cbbc7 100644 +--- a/cmake/pcre.cmake ++++ b/cmake/pcre.cmake +@@ -1,4 +1,5 @@ + # first look in pcre-$version or pcre subdirs ++ + if (PCRE_SOURCE) + # either provided on cmdline or we've seen it already + set (PCRE_BUILD_SOURCE TRUE) +@@ -50,14 +51,10 @@ if (PCRE_BUILD_SOURCE) + set(PCRE_INCLUDE_DIRS ${PCRE_SOURCE} ${PROJECT_BINARY_DIR}/pcre) + set(PCRE_LDFLAGS -L"${LIBDIR}" -lpcre) + else () +- # pkgconf should save us +- find_package(PkgConfig) +- pkg_check_modules(PCRE libpcre>=${PCRE_REQUIRED_VERSION}) +- if (PCRE_FOUND) ++ # conan should save us ++ find_package(pcre) ++ if(pcre_FOUND AND (pcre_VERSION VERSION_GREATER_EQUAL PCRE_REQUIRED_VERSION)) + set(CORRECT_PCRE_VERSION TRUE) +- message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above") +- else () +- message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above not found") +- return () +- endif () ++ set(PCRE_LDFLAGS "pcre::pcre") ++ endif() + endif (PCRE_BUILD_SOURCE) +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 6ca3fd8..378afd0 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -1,3 +1,7 @@ ++ ++# Tools are not installed ++return () ++ + find_package(Threads) + + # remove some warnings +diff --git a/tools/hsbench/CMakeLists.txt b/tools/hsbench/CMakeLists.txt +index bbceda4..18545d0 100644 +--- a/tools/hsbench/CMakeLists.txt ++++ b/tools/hsbench/CMakeLists.txt +@@ -1,4 +1,4 @@ +-include (${CMAKE_MODULE_PATH}/sqlite3.cmake) ++include (sqlite3) + if (NOT SQLITE3_FOUND) + message(STATUS "sqlite3 not found, not building hsbench") + return() +diff --git a/tools/hscollider/CMakeLists.txt b/tools/hscollider/CMakeLists.txt +index a4d71b2..f733479 100644 +--- a/tools/hscollider/CMakeLists.txt ++++ b/tools/hscollider/CMakeLists.txt +@@ -5,7 +5,7 @@ endif() + + include_directories(${PCRE_INCLUDE_DIRS}) + +-include(${CMAKE_MODULE_PATH}/backtrace.cmake) ++include(backtrace) + + # we need static libs - too much deep magic for shared libs + if (NOT BUILD_STATIC_LIBS) diff --git a/recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch b/recipes/hyperscan/all/patches/5.4.0-0002-use-ue2-make_unique.patch similarity index 100% rename from recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch rename to recipes/hyperscan/all/patches/5.4.0-0002-use-ue2-make_unique.patch diff --git a/recipes/hyperscan/all/patches/5.4.2-0001-fix-cmake.patch b/recipes/hyperscan/all/patches/5.4.2-0001-fix-cmake.patch new file mode 100644 index 00000000000000..87c26ae4533b62 --- /dev/null +++ b/recipes/hyperscan/all/patches/5.4.2-0001-fix-cmake.patch @@ -0,0 +1,282 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7757916..6f05b5b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ set (HS_MINOR_VERSION 4) + set (HS_PATCH_VERSION 2) + set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION}) + +-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) ++list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + include(CheckCCompilerFlag) + include(CheckCXXCompilerFlag) + include(CheckCXXSymbolExists) +@@ -17,8 +17,8 @@ INCLUDE (CheckLibraryExists) + INCLUDE (CheckSymbolExists) + include (CMakeDependentOption) + include (GNUInstallDirs) +-include (${CMAKE_MODULE_PATH}/platform.cmake) +-include (${CMAKE_MODULE_PATH}/ragel.cmake) ++include (platform) ++include (ragel) + + find_package(PkgConfig QUIET) + +@@ -69,7 +69,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src) + include_directories(${PROJECT_BINARY_DIR}) + include_directories(SYSTEM include) + +-include (${CMAKE_MODULE_PATH}/boost.cmake) ++include (boost) + + # -- make this work? set(python_ADDITIONAL_VERSIONS 2.7 2.6) + find_package(PythonInterp) +@@ -84,7 +84,7 @@ endif() + # allow for reproducible builds - python for portability + if (DEFINED ENV{SOURCE_DATE_EPOCH}) + execute_process( +- COMMAND "${PYTHON}" "${CMAKE_MODULE_PATH}/formatdate.py" "$ENV{SOURCE_DATE_EPOCH}" ++ COMMAND "${PYTHON}" "${PROJECT_SOURCE_DIR}/cmake/formatdate.py" "$ENV{SOURCE_DATE_EPOCH}" + OUTPUT_VARIABLE BUILD_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE) + else () +@@ -242,8 +242,8 @@ else() + if (NOT RELEASE_BUILD) + # -Werror is most useful during development, don't potentially break + # release builds +- set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror") +- set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Werror") ++ #set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror") ++ #set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Werror") + endif() + + if (DISABLE_ASSERTS) +@@ -326,7 +326,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") + message (STATUS "Building the fat runtime requires the Unix Makefiles generator, or Ninja with CMake v3.0 or higher") + set (FAT_RUNTIME_REQUISITES FALSE) + else() +- include (${CMAKE_MODULE_PATH}/attrib.cmake) ++ include (attrib) + if (NOT HAS_C_ATTR_IFUNC) + message(STATUS "Compiler does not support ifunc attribute, cannot build fat runtime") + set (FAT_RUNTIME_REQUISITES FALSE) +@@ -337,7 +337,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") + CMAKE_DEPENDENT_OPTION(FAT_RUNTIME "Build a library that supports multiple microarchitectures" ${RELEASE_BUILD} "FAT_RUNTIME_REQUISITES" OFF) + endif () + +-include (${CMAKE_MODULE_PATH}/arch.cmake) ++include (arch) + + # testing a builtin takes a little more work + CHECK_C_SOURCE_COMPILES("void *aa_test(void *x) { return __builtin_assume_aligned(x, 16);}\nint main(void) { return 0; }" HAVE_CC_BUILTIN_ASSUME_ALIGNED) +@@ -477,7 +477,6 @@ else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + +-add_subdirectory(util) + add_subdirectory(doc/dev-reference) + + if (NOT WIN32) +@@ -486,7 +485,7 @@ if (NOT WIN32) + set(PCRE_REQUIRED_MAJOR_VERSION 8) + set(PCRE_REQUIRED_MINOR_VERSION 41) + set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION}) +-include (${CMAKE_MODULE_PATH}/pcre.cmake) ++include (pcre) + if (NOT CORRECT_PCRE_VERSION) + message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") + endif() +@@ -496,17 +495,19 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) + set(BUILD_CHIMERA TRUE) + endif() + ++if(0) + add_subdirectory(unit) + if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) + add_subdirectory(tools) + endif() +-if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) ++endif() ++if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) + add_subdirectory(chimera) + endif() + endif() + + # do substitutions +-configure_file(${CMAKE_MODULE_PATH}/config.h.in ${PROJECT_BINARY_DIR}/config.h) ++configure_file(${PROJECT_SOURCE_DIR}/cmake/config.h.in ${PROJECT_BINARY_DIR}/config.h) + configure_file(src/hs_version.h.in ${PROJECT_BINARY_DIR}/hs_version.h) + + if (NOT WIN32) +@@ -519,7 +520,7 @@ if (NOT WIN32) + endforeach() + + configure_file(libhs.pc.in libhs.pc @ONLY) # only replace @ quoted vars +- install(FILES ${CMAKE_BINARY_DIR}/libhs.pc ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libhs.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif() + +@@ -538,7 +539,7 @@ if (WIN32) + set(PCRE_REQUIRED_MAJOR_VERSION 8) + set(PCRE_REQUIRED_MINOR_VERSION 41) + set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION}) +-include (${CMAKE_MODULE_PATH}/pcre.cmake) ++include (pcre) + if (NOT CORRECT_PCRE_VERSION) + message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") + endif() +@@ -548,10 +549,12 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) + set(BUILD_CHIMERA TRUE) + endif() + ++if(0) + add_subdirectory(unit) + if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) + add_subdirectory(tools) + endif() ++endif() + if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) + add_subdirectory(chimera) + endif() +@@ -562,14 +565,14 @@ set(RAGEL_C_FLAGS "-Wno-unused") + endif() + + set_source_files_properties( +- ${CMAKE_BINARY_DIR}/src/parser/Parser.cpp ++ ${CMAKE_CURRENT_BINARY_DIR}/src/parser/Parser.cpp + PROPERTIES + COMPILE_FLAGS "${RAGEL_C_FLAGS}") + + ragelmaker(src/parser/Parser.rl) + + set_source_files_properties( +- ${CMAKE_BINARY_DIR}/src/parser/control_verbs.cpp ++ ${CMAKE_CURRENT_BINARY_DIR}/src/parser/control_verbs.cpp + PROPERTIES + COMPILE_FLAGS "${RAGEL_C_FLAGS}") + +@@ -1230,28 +1233,28 @@ else (FAT_RUNTIME) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_core2 PROPERTIES + COMPILE_FLAGS "-march=core2" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + + add_library(hs_exec_corei7 OBJECT ${hs_exec_SRCS}) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_corei7 PROPERTIES + COMPILE_FLAGS "-march=corei7" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + + add_library(hs_exec_avx2 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_avx2 PROPERTIES + COMPILE_FLAGS "-march=core-avx2" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + if (BUILD_AVX512) + add_library(hs_exec_avx512 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_avx512 PROPERTIES + COMPILE_FLAGS "${SKYLAKE_FLAG}" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512) + if (BUILD_AVX512VBMI) +@@ -1259,7 +1262,7 @@ else (FAT_RUNTIME) + list(APPEND RUNTIME_LIBS $) + set_target_properties(hs_exec_avx512vbmi PROPERTIES + COMPILE_FLAGS "${ICELAKE_FLAG}" +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512VBMI) + +@@ -1294,14 +1297,14 @@ else (FAT_RUNTIME) + set_target_properties(hs_exec_shared_core2 PROPERTIES + COMPILE_FLAGS "-march=core2" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} core2 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + add_library(hs_exec_shared_corei7 OBJECT ${hs_exec_SRCS}) + list(APPEND RUNTIME_SHLIBS $) + set_target_properties(hs_exec_shared_corei7 PROPERTIES + COMPILE_FLAGS "-march=corei7" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} corei7 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + add_library(hs_exec_shared_avx2 OBJECT ${hs_exec_SRCS} ${hs_exec_avx2_SRCS}) + list(APPEND RUNTIME_SHLIBS $) +@@ -1317,7 +1320,7 @@ else (FAT_RUNTIME) + set_target_properties(hs_exec_shared_avx512 PROPERTIES + COMPILE_FLAGS "${SKYLAKE_FLAG}" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512 ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512) + if (BUILD_AVX512VBMI) +@@ -1326,7 +1329,7 @@ else (FAT_RUNTIME) + set_target_properties(hs_exec_shared_avx512vbmi PROPERTIES + COMPILE_FLAGS "${ICELAKE_FLAG}" + POSITION_INDEPENDENT_CODE TRUE +- RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${CMAKE_MODULE_PATH}/keep.syms.in" ++ RULE_LAUNCH_COMPILE "${BUILD_WRAPPER} avx512vbmi ${PROJECT_SOURCE_DIR}/cmake/keep.syms.in" + ) + endif (BUILD_AVX512VBMI) + add_library(hs_exec_common_shared OBJECT +diff --git a/chimera/ch_database.h b/chimera/ch_database.h +index 28bde86..33cda9d 100644 +--- a/chimera/ch_database.h ++++ b/chimera/ch_database.h +@@ -38,7 +38,6 @@ extern "C" + { + #endif + +-#define PCRE_STATIC + #include + + #include "ch_compile.h" // for CH_MODE_ flags +diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake +index e0acda5..0f9e8ac 100644 +--- a/cmake/pcre.cmake ++++ b/cmake/pcre.cmake +@@ -50,14 +50,10 @@ if (PCRE_BUILD_SOURCE) + set(PCRE_INCLUDE_DIRS ${PCRE_SOURCE} ${PROJECT_BINARY_DIR}/pcre) + set(PCRE_LDFLAGS -L"${LIBDIR}" -lpcre) + else () +- # pkgconf should save us +- find_package(PkgConfig) +- pkg_check_modules(PCRE libpcre>=${PCRE_REQUIRED_VERSION}) +- if (PCRE_FOUND) ++ # conan should save us ++ find_package(pcre) ++ if(pcre_FOUND AND (pcre_VERSION VERSION_GREATER_EQUAL PCRE_REQUIRED_VERSION)) + set(CORRECT_PCRE_VERSION TRUE) +- message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above") +- else () +- message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above not found") +- return () +- endif () ++ set(PCRE_LDFLAGS "pcre::pcre") ++ endif() + endif (PCRE_BUILD_SOURCE) +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 6ca3fd8..73c299d 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -1,3 +1,6 @@ ++# Tools are not installed ++return () ++ + find_package(Threads) + + # remove some warnings diff --git a/recipes/hyperscan/all/patches/5.4.2-0002-use-ue2-make_unique.patch b/recipes/hyperscan/all/patches/5.4.2-0002-use-ue2-make_unique.patch new file mode 100644 index 00000000000000..7c24368a9f0e10 --- /dev/null +++ b/recipes/hyperscan/all/patches/5.4.2-0002-use-ue2-make_unique.patch @@ -0,0 +1,875 @@ +diff --git a/src/nfa/castlecompile.cpp b/src/nfa/castlecompile.cpp +index 5884ebb..1af6cd2 100644 +--- a/src/nfa/castlecompile.cpp ++++ b/src/nfa/castlecompile.cpp +@@ -281,7 +281,7 @@ vector> checkExclusion(u32 &streamStateSize, + size_t total = 0; + while (lower < trigSize) { + vector vertices; +- unique_ptr cg = make_unique(); ++ unique_ptr cg = ue2::make_unique(); + + vector> min_reset_dist; + size_t upper = min(lower + CLIQUE_GRAPH_MAX_SIZE, trigSize); +diff --git a/src/nfagraph/ng_equivalence.cpp b/src/nfagraph/ng_equivalence.cpp +index a42a0ac..9b1f072 100644 +--- a/src/nfagraph/ng_equivalence.cpp ++++ b/src/nfagraph/ng_equivalence.cpp +@@ -269,7 +269,7 @@ vector> getVertexInfos(const NGHolder &g) { + vertex_map.resize(num_verts); + + for (auto v : vertices_range(g)) { +- infos.push_back(make_unique(v, g)); ++ infos.push_back(ue2::make_unique(v, g)); + vertex_map[g[v].index] = infos.back().get(); + } + +@@ -516,7 +516,7 @@ void mergeClass(vector> &infos, NGHolder &g, + g[new_v].reports.clear(); /* populated as we pull in succs */ + + // store this vertex in our global vertex list +- infos.push_back(make_unique(new_v, g)); ++ infos.push_back(ue2::make_unique(new_v, g)); + VertexInfo *new_vertex_info = infos.back().get(); + + NFAVertex new_v_eod = NGHolder::null_vertex(); +@@ -525,7 +525,7 @@ void mergeClass(vector> &infos, NGHolder &g, + if (require_separate_eod_vertex(cur_class_vertices, g)) { + new_v_eod = clone_vertex(g, old_v); + g[new_v_eod].reports.clear(); +- infos.push_back(make_unique(new_v_eod, g)); ++ infos.push_back(ue2::make_unique(new_v_eod, g)); + new_vertex_info_eod = infos.back().get(); + } + +diff --git a/src/nfagraph/ng_violet.cpp b/src/nfagraph/ng_violet.cpp +index ba6b350..106b900 100644 +--- a/src/nfagraph/ng_violet.cpp ++++ b/src/nfagraph/ng_violet.cpp +@@ -375,7 +375,7 @@ void getSimpleRoseLiterals(const NGHolder &g, bool seeking_anchored, + + DEBUG_PRINTF("candidate is a candidate\n"); + scores[v] = score; +- lit_info[v] = make_unique(v, s, anchored); ++ lit_info[v] = ue2::make_unique(v, s, anchored); + } + + /* try to filter out cases where appending some characters produces worse +@@ -531,7 +531,7 @@ void getRegionRoseLiterals(const NGHolder &g, bool seeking_anchored, + } + + DEBUG_PRINTF("candidate is a candidate\n"); +- lits->push_back(make_unique(vv, s, anchored)); ++ lits->push_back(ue2::make_unique(vv, s, anchored)); + } + } + +@@ -1848,7 +1848,7 @@ static + unique_ptr make_chain(u32 count) { + assert(count); + +- auto rv = make_unique(NFA_INFIX); ++ auto rv = ue2::make_unique(NFA_INFIX); + + NGHolder &h = *rv; + +diff --git a/src/rose/rose_build_add.cpp b/src/rose/rose_build_add.cpp +index aa043fa..f680dbb 100644 +--- a/src/rose/rose_build_add.cpp ++++ b/src/rose/rose_build_add.cpp +@@ -1802,7 +1802,7 @@ bool RoseBuildImpl::addOutfix(const NGHolder &h, const raw_som_dfa &haig) { + + bool RoseBuildImpl::addOutfix(const raw_puff &rp) { + if (!mpv_outfix) { +- mpv_outfix = make_unique(MpvProto()); ++ mpv_outfix = ue2::make_unique(MpvProto()); + } + + auto *mpv = mpv_outfix->mpv(); +@@ -1827,7 +1827,7 @@ bool RoseBuildImpl::addOutfix(const raw_puff &rp) { + bool RoseBuildImpl::addChainTail(const raw_puff &rp, u32 *queue_out, + u32 *event_out) { + if (!mpv_outfix) { +- mpv_outfix = make_unique(MpvProto()); ++ mpv_outfix = ue2::make_unique(MpvProto()); + } + + auto *mpv = mpv_outfix->mpv(); +diff --git a/src/rose/rose_build_anchored.cpp b/src/rose/rose_build_anchored.cpp +index 8ea07c9..1f918bb 100644 +--- a/src/rose/rose_build_anchored.cpp ++++ b/src/rose/rose_build_anchored.cpp +@@ -249,7 +249,7 @@ unique_ptr populate_holder(const simple_anchored_info &sai, + const flat_set &exit_ids) { + DEBUG_PRINTF("populating holder for ^.{%u,%u}%s\n", sai.min_bound, + sai.max_bound, dumpString(sai.literal).c_str()); +- auto h_ptr = make_unique(); ++ auto h_ptr = ue2::make_unique(); + NGHolder &h = *h_ptr; + auto ends = addDotsToGraph(h, h.start, sai.min_bound, sai.max_bound, + CharReach::dot()); +diff --git a/src/rose/rose_build_exclusive.cpp b/src/rose/rose_build_exclusive.cpp +index 6a5a710..966c908 100644 +--- a/src/rose/rose_build_exclusive.cpp ++++ b/src/rose/rose_build_exclusive.cpp +@@ -280,7 +280,7 @@ void findCliques(const map> &exclusiveGroups, + } + // Construct the exclusivity graph + map vertex_map; +- unique_ptr cg = make_unique(); ++ unique_ptr cg = ue2::make_unique(); + + // Add vertices representing infixes/suffixes + for (const auto &e : exclusiveGroups) { +diff --git a/src/rose/rose_build_program.cpp b/src/rose/rose_build_program.cpp +index 96c95db..81d605b 100644 +--- a/src/rose/rose_build_program.cpp ++++ b/src/rose/rose_build_program.cpp +@@ -95,7 +95,7 @@ OffsetMap makeOffsetMap(const RoseProgram &program, u32 *total_len) { + } + + RoseProgram::RoseProgram() { +- prog.push_back(make_unique()); ++ prog.push_back(ue2::make_unique()); + } + + RoseProgram::~RoseProgram() = default; +@@ -297,28 +297,28 @@ void addEnginesEodProgram(u32 eodNfaIterOffset, RoseProgram &program) { + } + + RoseProgram block; +- block.add_before_end(make_unique(eodNfaIterOffset)); ++ block.add_before_end(ue2::make_unique(eodNfaIterOffset)); + program.add_block(move(block)); + } + + void addSuffixesEodProgram(RoseProgram &program) { + RoseProgram block; +- block.add_before_end(make_unique()); ++ block.add_before_end(ue2::make_unique()); + program.add_block(move(block)); + } + + void addMatcherEodProgram(RoseProgram &program) { + RoseProgram block; +- block.add_before_end(make_unique()); ++ block.add_before_end(ue2::make_unique()); + program.add_block(move(block)); + } + + void addFlushCombinationProgram(RoseProgram &program) { +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + void addLastFlushCombinationProgram(RoseProgram &program) { +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + static +@@ -342,11 +342,11 @@ void makeRoleCheckLeftfix(const RoseBuildImpl &build, + + unique_ptr ri; + if (is_prefix) { +- ri = make_unique(lni.queue, build.g[v].left.lag, ++ ri = ue2::make_unique(lni.queue, build.g[v].left.lag, + build.g[v].left.leftfix_report, + end_inst); + } else { +- ri = make_unique(lni.queue, build.g[v].left.lag, ++ ri = ue2::make_unique(lni.queue, build.g[v].left.lag, + build.g[v].left.leftfix_report, + end_inst); + } +@@ -384,7 +384,7 @@ void makeAnchoredLiteralDelay(const RoseBuildImpl &build, + u32 anch_id = prog_build.anchored_programs.at(lit_id); + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(groups, anch_id, end_inst); ++ auto ri = ue2::make_unique(groups, anch_id, end_inst); + program.add_before_end(move(ri)); + } + +@@ -393,7 +393,7 @@ void makeDedupe(const ReportManager &rm, const Report &report, + RoseProgram &program) { + const auto *end_inst = program.end_instruction(); + auto ri = +- make_unique(report.quashSom, rm.getDkey(report), ++ ue2::make_unique(report.quashSom, rm.getDkey(report), + report.offsetAdjust, end_inst); + program.add_before_end(move(ri)); + } +@@ -402,7 +402,7 @@ static + void makeDedupeSom(const ReportManager &rm, const Report &report, + RoseProgram &program) { + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(report.quashSom, ++ auto ri = ue2::make_unique(report.quashSom, + rm.getDkey(report), + report.offsetAdjust, end_inst); + program.add_before_end(move(ri)); +@@ -428,7 +428,7 @@ void makeCatchup(const ReportManager &rm, bool needs_catchup, + return; + } + +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + static +@@ -511,12 +511,12 @@ void addLogicalSetRequired(const Report &report, ReportManager &rm, + return; + } + // set matching status of current lkey +- auto risl = make_unique(report.lkey, ++ auto risl = ue2::make_unique(report.lkey, + report.offsetAdjust); + program.add_before_end(move(risl)); + // set current lkey's corresponding ckeys active, pending to check + for (auto ckey : rm.getRelateCKeys(report.lkey)) { +- auto risc = make_unique(ckey); ++ auto risc = ue2::make_unique(ckey); + program.add_before_end(move(risc)); + } + } +@@ -532,7 +532,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + + // Handle min/max offset checks. + if (report.minOffset > 0 || report.maxOffset < MAX_OFFSET) { +- auto ri = make_unique(report.minOffset, ++ auto ri = ue2::make_unique(report.minOffset, + report.maxOffset, end_inst); + report_block.add_before_end(move(ri)); + } +@@ -540,7 +540,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + // If this report has an exhaustion key, we can check it in the program + // rather than waiting until we're in the callback adaptor. + if (report.ekey != INVALID_EKEY) { +- auto ri = make_unique(report.ekey, end_inst); ++ auto ri = ue2::make_unique(report.ekey, end_inst); + report_block.add_before_end(move(ri)); + } + +@@ -548,7 +548,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + // calculated. + if (isExternalSomReport(report) && + report.type != EXTERNAL_CALLBACK_SOM_PASS) { +- auto ri = make_unique(); ++ auto ri = ue2::make_unique(); + writeSomOperation(report, &ri->som); + report_block.add_before_end(move(ri)); + } +@@ -556,13 +556,13 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + // Min length constraint. + if (report.minLength > 0) { + assert(build.hasSom); +- auto ri = make_unique( ++ auto ri = ue2::make_unique( + report.offsetAdjust, report.minLength, end_inst); + report_block.add_before_end(move(ri)); + } + + if (report.quashSom) { +- report_block.add_before_end(make_unique()); ++ report_block.add_before_end(ue2::make_unique()); + } + + switch (report.type) { +@@ -578,7 +578,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + if (needs_dedupe) { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.quashSom, build.rm.getDkey(report), + report.onmatch, report.offsetAdjust, end_inst)); + } else { +@@ -587,7 +587,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } +@@ -597,28 +597,28 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + } + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + } else { // has_som + makeDedupeSom(build.rm, report, report_block); + if (report.ekey == INVALID_EKEY) { + if (!report.quiet) { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + } +@@ -639,17 +639,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + addFlushCombinationProgram(report_block); + } + if (has_som) { +- auto ri = make_unique(); ++ auto ri = ue2::make_unique(); + writeSomOperation(report, &ri->som); + report_block.add_before_end(move(ri)); + } else { +- auto ri = make_unique(); ++ auto ri = ue2::make_unique(); + writeSomOperation(report, &ri->som); + report_block.add_before_end(move(ri)); + } + break; + case INTERNAL_ROSE_CHAIN: { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.topSquashDistance)); + break; + } +@@ -663,17 +663,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + makeDedupeSom(build.rm, report, report_block); + if (report.ekey == INVALID_EKEY) { + if (!report.quiet) { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + addLogicalSetRequired(report, build.rm, report_block); +@@ -685,17 +685,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + makeDedupeSom(build.rm, report, report_block); + if (report.ekey == INVALID_EKEY) { + if (!report.quiet) { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + addLogicalSetRequired(report, build.rm, report_block); +@@ -722,11 +722,11 @@ void makeRoleReports(const RoseBuildImpl &build, + assert(contains(leftfix_info, v)); + const left_build_info &lni = leftfix_info.at(v); + program.add_before_end( +- make_unique(lni.queue, g[v].left.lag)); ++ ue2::make_unique(lni.queue, g[v].left.lag)); + report_som = true; + } else if (g[v].som_adjust) { + program.add_before_end( +- make_unique(g[v].som_adjust)); ++ ue2::make_unique(g[v].som_adjust)); + report_som = true; + } + +@@ -748,7 +748,7 @@ void makeRoleSetState(const unordered_map &roleStateIndices, + if (it == end(roleStateIndices)) { + return; + } +- program.add_before_end(make_unique(it->second)); ++ program.add_before_end(ue2::make_unique(it->second)); + } + + static +@@ -772,7 +772,7 @@ void makePushDelayedInstructions(const RoseLiteralMap &literals, + }); + + for (const auto &ri : delay_instructions) { +- program.add_before_end(make_unique(ri)); ++ program.add_before_end(ue2::make_unique(ri)); + } + } + +@@ -801,10 +801,10 @@ void makeCheckLiteralInstruction(const rose_literal_id &lit, + const auto *end_inst = program.end_instruction(); + unique_ptr ri; + if (lit.s.any_nocase()) { +- ri = make_unique(lit.s.get_string(), ++ ri = ue2::make_unique(lit.s.get_string(), + end_inst); + } else { +- ri = make_unique(lit.s.get_string(), ++ ri = ue2::make_unique(lit.s.get_string(), + end_inst); + } + program.add_before_end(move(ri)); +@@ -820,10 +820,10 @@ void makeCheckLiteralInstruction(const rose_literal_id &lit, + const auto *end_inst = program.end_instruction(); + unique_ptr ri; + if (lit.s.any_nocase()) { +- ri = make_unique(lit.s.get_string(), ++ ri = ue2::make_unique(lit.s.get_string(), + end_inst); + } else { +- ri = make_unique(lit.s.get_string(), end_inst); ++ ri = ue2::make_unique(lit.s.get_string(), end_inst); + } + program.add_before_end(move(ri)); + } +@@ -840,7 +840,7 @@ void makeRoleCheckNotHandled(ProgramBuild &prog_build, RoseVertex v, + } + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(handled_key, end_inst); ++ auto ri = ue2::make_unique(handled_key, end_inst); + program.add_before_end(move(ri)); + } + +@@ -889,7 +889,7 @@ void makeRoleCheckBounds(const RoseBuildImpl &build, RoseVertex v, + + const auto *end_inst = program.end_instruction(); + program.add_before_end( +- make_unique(min_bound, max_bound, end_inst)); ++ ue2::make_unique(min_bound, max_bound, end_inst)); + } + + static +@@ -924,7 +924,7 @@ void makeRoleGroups(const RoseGraph &g, ProgramBuild &prog_build, + return; + } + +- program.add_before_end(make_unique(groups)); ++ program.add_before_end(ue2::make_unique(groups)); + } + + static +@@ -968,7 +968,7 @@ bool makeRoleByte(const vector &look, RoseProgram &program) { + s32 checkbyte_offset = verify_s32(entry.offset); + DEBUG_PRINTF("CHECK BYTE offset=%d\n", checkbyte_offset); + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(andmask_u8, cmpmask_u8, flip, ++ auto ri = ue2::make_unique(andmask_u8, cmpmask_u8, flip, + checkbyte_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1000,7 +1000,7 @@ bool makeRoleMask(const vector &look, RoseProgram &program) { + DEBUG_PRINTF("CHECK MASK and_mask=%llx cmp_mask=%llx\n", + and_mask, cmp_mask); + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(and_mask, cmp_mask, neg_mask, ++ auto ri = ue2::make_unique(and_mask, cmp_mask, neg_mask, + base_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1055,7 +1055,7 @@ bool makeRoleMask32(const vector &look, + DEBUG_PRINTF("base_offset %d\n", base_offset); + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(and_mask, cmp_mask, neg_mask, ++ auto ri = ue2::make_unique(and_mask, cmp_mask, neg_mask, + base_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1098,7 +1098,7 @@ bool makeRoleMask64(const vector &look, + DEBUG_PRINTF("base_offset %d\n", base_offset); + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(and_mask, cmp_mask, neg_mask, ++ auto ri = ue2::make_unique(and_mask, cmp_mask, neg_mask, + base_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1235,7 +1235,7 @@ makeCheckShufti16x8(u32 offset_range, u8 bucket_idx, + copy(hi_mask.begin(), hi_mask.begin() + 16, nib_mask.begin() + 16); + copy(bucket_select_mask.begin(), bucket_select_mask.begin() + 16, + bucket_select_mask_16.begin()); +- return make_unique ++ return ue2::make_unique + (nib_mask, bucket_select_mask_16, + neg_mask & 0xffff, base_offset, end_inst); + } +@@ -1255,7 +1255,7 @@ makeCheckShufti32x8(u32 offset_range, u8 bucket_idx, + array lo_mask_16; + copy(hi_mask.begin(), hi_mask.begin() + 16, hi_mask_16.begin()); + copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_16.begin()); +- return make_unique ++ return ue2::make_unique + (hi_mask_16, lo_mask_16, bucket_select_mask, + neg_mask, base_offset, end_inst); + } +@@ -1277,7 +1277,7 @@ makeCheckShufti16x16(u32 offset_range, u8 bucket_idx, + bucket_select_mask_32.begin()); + copy(bucket_select_mask_hi.begin(), bucket_select_mask_hi.begin() + 16, + bucket_select_mask_32.begin() + 16); +- return make_unique ++ return ue2::make_unique + (hi_mask, lo_mask, bucket_select_mask_32, + neg_mask & 0xffff, base_offset, end_inst); + } +@@ -1294,7 +1294,7 @@ makeCheckShufti32x16(u32 offset_range, u8 bucket_idx, + return nullptr; + } + +- return make_unique ++ return ue2::make_unique + (hi_mask, lo_mask, bucket_select_mask_hi, + bucket_select_mask_lo, neg_mask, base_offset, end_inst); + } +@@ -1321,7 +1321,7 @@ makeCheckShufti64x8(u32 offset_range, u8 bucket_idx, + copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_64.begin() + 32); + copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_64.begin() + 48); + +- return make_unique ++ return ue2::make_unique + (hi_mask_64, lo_mask_64, bucket_select_mask, + neg_mask, base_offset, end_inst); + } +@@ -1361,7 +1361,7 @@ makeCheckShufti64x16(u32 offset_range, u8 bucket_idx, + copy(lo_mask.begin() + 16, lo_mask.begin() + 32, lo_mask_2.begin() + 32); + copy(lo_mask.begin() + 16, lo_mask.begin() + 32, lo_mask_2.begin() + 48); + +- return make_unique ++ return ue2::make_unique + (hi_mask_1, hi_mask_2, lo_mask_1, lo_mask_2, bucket_select_mask_hi, + bucket_select_mask_lo, neg_mask, base_offset, end_inst); + } +@@ -1486,7 +1486,7 @@ void makeLookaroundInstruction(const vector &look, + if (look.size() == 1) { + s8 offset = look.begin()->offset; + const CharReach &reach = look.begin()->reach; +- auto ri = make_unique(offset, reach, ++ auto ri = ue2::make_unique(offset, reach, + program.end_instruction()); + program.add_before_end(move(ri)); + return; +@@ -1508,7 +1508,7 @@ void makeLookaroundInstruction(const vector &look, + return; + } + +- auto ri = make_unique(look, ++ auto ri = ue2::make_unique(look, + program.end_instruction()); + program.add_before_end(move(ri)); + } +@@ -1584,7 +1584,7 @@ void makeCheckLitEarlyInstruction(const RoseBuildImpl &build, u32 lit_id, + + DEBUG_PRINTF("adding lit early check, min_offset=%u\n", min_offset); + const auto *end = prog.end_instruction(); +- prog.add_before_end(make_unique(min_offset, end)); ++ prog.add_before_end(ue2::make_unique(min_offset, end)); + } + + static +@@ -1595,7 +1595,7 @@ void makeGroupCheckInstruction(const RoseBuildImpl &build, u32 lit_id, + if (!info.group_mask) { + return; + } +- prog.add_before_end(make_unique(info.group_mask)); ++ prog.add_before_end(ue2::make_unique(info.group_mask)); + } + + static +@@ -1762,7 +1762,7 @@ bool makeRoleMultipathShufti(const vector> &multi_look, + copy(begin(lo_mask), begin(lo_mask) + 16, nib_mask.begin()); + copy(begin(hi_mask), begin(hi_mask) + 16, nib_mask.begin() + 16); + +- auto ri = make_unique ++ auto ri = ue2::make_unique + (nib_mask, bucket_select_lo, data_select_mask, hi_bits_mask, + lo_bits_mask, neg_mask, base_offset, last_start, end_inst); + program.add_before_end(move(ri)); +@@ -1771,20 +1771,20 @@ bool makeRoleMultipathShufti(const vector> &multi_look, + assert(!(hi_bits_mask & ~0xffffffffULL)); + assert(!(lo_bits_mask & ~0xffffffffULL)); + if (bit_index <= 8) { +- auto ri = make_unique ++ auto ri = ue2::make_unique + (hi_mask, lo_mask, bucket_select_lo, data_select_mask, + hi_bits_mask, lo_bits_mask, neg_mask, base_offset, + last_start, end_inst); + program.add_before_end(move(ri)); + } else { +- auto ri = make_unique ++ auto ri = ue2::make_unique + (hi_mask, lo_mask, bucket_select_hi, bucket_select_lo, + data_select_mask, hi_bits_mask, lo_bits_mask, neg_mask, + base_offset, last_start, end_inst); + program.add_before_end(move(ri)); + } + } else { +- auto ri = make_unique ++ auto ri = ue2::make_unique + (hi_mask, lo_mask, bucket_select_lo, data_select_mask, + hi_bits_mask, lo_bits_mask, neg_mask, base_offset, + last_start, end_inst); +@@ -1856,7 +1856,7 @@ void makeRoleMultipathLookaround(const vector> &multi_look, + ordered_look.emplace_back(multi_entry); + } + +- auto ri = make_unique(move(ordered_look), ++ auto ri = ue2::make_unique(move(ordered_look), + last_start, start_mask, + program.end_instruction()); + program.add_before_end(move(ri)); +@@ -1932,7 +1932,7 @@ void makeRoleSuffix(const RoseBuildImpl &build, + event = MQE_TOP; + } + +- prog.add_before_end(make_unique(queue, event)); ++ prog.add_before_end(ue2::make_unique(queue, event)); + } + + static +@@ -1945,7 +1945,7 @@ void addInfixTriggerInstructions(vector triggers, + }); + for (const auto &ti : triggers) { + prog.add_before_end( +- make_unique(ti.cancel, ti.queue, ti.event)); ++ ue2::make_unique(ti.cancel, ti.queue, ti.event)); + } + } + +@@ -2039,7 +2039,7 @@ static + void addCheckOnlyEodInstruction(RoseProgram &prog) { + DEBUG_PRINTF("only at eod\n"); + const auto *end_inst = prog.end_instruction(); +- prog.add_before_end(make_unique(end_inst)); ++ prog.add_before_end(ue2::make_unique(end_inst)); + } + + static +@@ -2164,7 +2164,7 @@ void makeGroupSquashInstruction(const RoseBuildImpl &build, u32 lit_id, + DEBUG_PRINTF("squashes 0x%llx\n", info.group_mask); + assert(info.group_mask); + /* Note: group_mask is negated. */ +- prog.add_before_end(make_unique(~info.group_mask)); ++ prog.add_before_end(ue2::make_unique(~info.group_mask)); + } + + namespace { +@@ -2209,7 +2209,7 @@ RoseProgram assembleProgramBlocks(vector &&blocks_in) { + * only set if a state has been. */ + if (!prog.empty() && reads_work_done_flag(block)) { + RoseProgram clear_block; +- clear_block.add_before_end(make_unique()); ++ clear_block.add_before_end(ue2::make_unique()); + prog.add_block(move(clear_block)); + } + +@@ -2369,7 +2369,7 @@ void makeCatchupMpv(const ReportManager &rm, bool needs_mpv_catchup, + return; + } + +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + RoseProgram makeReportProgram(const RoseBuildImpl &build, +@@ -2402,7 +2402,7 @@ RoseProgram makeBoundaryProgram(const RoseBuildImpl &build, + void addIncludedJumpProgram(RoseProgram &program, u32 child_offset, + u8 squash) { + RoseProgram block; +- block.add_before_end(make_unique(child_offset, ++ block.add_before_end(ue2::make_unique(child_offset, + squash)); + program.add_block(move(block)); + } +@@ -2413,7 +2413,7 @@ void addPredBlockSingle(u32 pred_state, RoseProgram &pred_block, + // Prepend an instruction to check the pred state is on. + const auto *end_inst = pred_block.end_instruction(); + pred_block.insert(begin(pred_block), +- make_unique(pred_state, end_inst)); ++ ue2::make_unique(pred_state, end_inst)); + program.add_block(move(pred_block)); + } + +@@ -2428,7 +2428,7 @@ void addPredBlocksAny(map &pred_blocks, u32 num_states, + } + + const RoseInstruction *end_inst = sparse_program.end_instruction(); +- auto ri = make_unique(num_states, keys, end_inst); ++ auto ri = ue2::make_unique(num_states, keys, end_inst); + sparse_program.add_before_end(move(ri)); + + RoseProgram &block = pred_blocks.begin()->second; +@@ -2451,14 +2451,14 @@ void addPredBlocksMulti(map &pred_blocks, + vector> jump_table; + + // BEGIN instruction. +- auto ri_begin = make_unique(num_states, end_inst); ++ auto ri_begin = ue2::make_unique(num_states, end_inst); + RoseInstrSparseIterBegin *begin_inst = ri_begin.get(); + sparse_program.add_before_end(move(ri_begin)); + + // NEXT instructions, one per pred program. + u32 prev_key = pred_blocks.begin()->first; + for (auto it = next(begin(pred_blocks)); it != end(pred_blocks); ++it) { +- auto ri = make_unique(prev_key, begin_inst, ++ auto ri = ue2::make_unique(prev_key, begin_inst, + end_inst); + sparse_program.add_before_end(move(ri)); + prev_key = it->first; +@@ -2539,7 +2539,7 @@ void applyFinalSpecialisation(RoseProgram &program) { + auto it = next(program.rbegin()); + if (auto *ri = dynamic_cast(it->get())) { + DEBUG_PRINTF("replacing REPORT with FINAL_REPORT\n"); +- program.replace(it, make_unique( ++ program.replace(it, ue2::make_unique( + ri->onmatch, ri->offset_adjust)); + } + } +diff --git a/src/rose/rose_in_util.cpp b/src/rose/rose_in_util.cpp +index 9fe47c2..6fa56d1 100644 +--- a/src/rose/rose_in_util.cpp ++++ b/src/rose/rose_in_util.cpp +@@ -93,7 +93,7 @@ private: + + unique_ptr cloneRoseGraph(const RoseInGraph &ig) { + assert(hasCorrectlyNumberedVertices(ig)); +- unique_ptr out = make_unique(); ++ unique_ptr out = ue2::make_unique(); + + unordered_map> graph_map; + unordered_map> haig_map; +diff --git a/src/smallwrite/smallwrite_build.cpp b/src/smallwrite/smallwrite_build.cpp +index ea89669..fc4e5cb 100644 +--- a/src/smallwrite/smallwrite_build.cpp ++++ b/src/smallwrite/smallwrite_build.cpp +@@ -680,7 +680,7 @@ unique_ptr buildDfa(LitTrie &trie, bool nocase) { + // Construct DFA states in BFS order. + const auto state_ids = makeStateMap(trie, ordering); + +- auto rdfa = make_unique(NFA_OUTFIX); ++ auto rdfa = ue2::make_unique(NFA_OUTFIX); + + // Calculate alphabet. + array unalpha; +diff --git a/tools/hsbench/main.cpp b/tools/hsbench/main.cpp +index 22becbd..4c671c0 100644 +--- a/tools/hsbench/main.cpp ++++ b/tools/hsbench/main.cpp +@@ -1043,7 +1043,7 @@ void runBenchmark(const Engine &db, + int HS_CDECL main(int argc, char *argv[]) { + unique_ptr grey; + #if !defined(RELEASE_BUILD) +- grey = make_unique(); ++ grey = ue2::make_unique(); + #endif + setlocale(LC_ALL, ""); // use the user's locale + +diff --git a/tools/hscheck/main.cpp b/tools/hscheck/main.cpp +index 197087b..bdecab8 100644 +--- a/tools/hscheck/main.cpp ++++ b/tools/hscheck/main.cpp +@@ -664,7 +664,7 @@ int HS_CDECL main(int argc, char **argv) { + num_of_threads = max(1u, std::thread::hardware_concurrency()); + + #if !defined(RELEASE_BUILD) +- g_grey = make_unique(); ++ g_grey = ue2::make_unique(); + #endif + processArgs(argc, argv, g_grey); + +diff --git a/tools/hscollider/GraphTruth.cpp b/tools/hscollider/GraphTruth.cpp +index 0b67b11..e43beb1 100644 +--- a/tools/hscollider/GraphTruth.cpp ++++ b/tools/hscollider/GraphTruth.cpp +@@ -134,7 +134,7 @@ void CNGInfo::compile() { + auto pl = ue2::make_unique(); + pl->parseLogicalCombination(id, re.c_str(), ~0U, 0, ~0ULL); + pl->logicalKeyRenumber(); +- cng = make_unique(move(pl)); ++ cng = ue2::make_unique(move(pl)); + return; + } + +@@ -193,7 +193,7 @@ void CNGInfo::compile() { + } + } + +- cng = make_unique(move(g), move(rm)); ++ cng = ue2::make_unique(move(g), move(rm)); + } catch (CompileError &e) { + throw NGCompileFailure(e.reason); + } catch (NGUnsupportedFailure &e) { +@@ -257,7 +257,7 @@ unique_ptr GraphTruth::preprocess(unsigned id, + } + } + +- auto cngi = make_unique(id, m_expr); ++ auto cngi = ue2::make_unique(id, m_expr); + cngi->utf8 = hs_flags & HS_FLAG_UTF8; + cngi->highlander = highlander; + cngi->prefilter = prefilter; +diff --git a/tools/hscollider/GroundTruth.cpp b/tools/hscollider/GroundTruth.cpp +index a267306..d9293dc 100644 +--- a/tools/hscollider/GroundTruth.cpp ++++ b/tools/hscollider/GroundTruth.cpp +@@ -331,7 +331,7 @@ GroundTruth::compile(unsigned id, bool no_callouts) { + int errloc = 0; + int errcode = 0; + +- unique_ptr compiled = make_unique(); ++ unique_ptr compiled = ue2::make_unique(); + compiled->utf8 = flags & PCRE_UTF8; + compiled->highlander = highlander; + compiled->prefilter = prefilter; +diff --git a/tools/hscollider/main.cpp b/tools/hscollider/main.cpp +index afa6ef5..c85526e 100644 +--- a/tools/hscollider/main.cpp ++++ b/tools/hscollider/main.cpp +@@ -1606,7 +1606,7 @@ void generateTests(CorporaSource &corpora_src, const ExpressionMap &exprMap, + max_generator_queue_len); + vector> generators; + for (size_t i = 0; i < numGeneratorThreads; i++) { +- auto c = make_unique(i, testq, corpq, corpora_src); ++ auto c = ue2::make_unique(i, testq, corpq, corpora_src); + c->start(); + generators.push_back(move(c)); + } +diff --git a/util/ng_corpus_generator.cpp b/util/ng_corpus_generator.cpp +index f796cd4..1613082 100644 +--- a/util/ng_corpus_generator.cpp ++++ b/util/ng_corpus_generator.cpp +@@ -200,7 +200,7 @@ void findPaths(const NGHolder &g, CorpusProperties &cProps, + if (boost::next(ai) == ae) { + new_path = std::move(p); + } else { +- new_path = make_unique(*p); ++ new_path = ue2::make_unique(*p); + } + + new_path->push_back(v); diff --git a/recipes/hyperscan/all/test_package/conanfile.py b/recipes/hyperscan/all/test_package/conanfile.py index f5c91753bcba3d..5e1749b052fcf1 100644 --- a/recipes/hyperscan/all/test_package/conanfile.py +++ b/recipes/hyperscan/all/test_package/conanfile.py @@ -9,6 +9,8 @@ class TestPackageConan(ConanFile): generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" + _with_chimera = False + def layout(self): cmake_layout(self) @@ -20,6 +22,8 @@ def generate(self): tc.variables["BUILD_CHIMERA"] = self.dependencies["hyperscan"].options.build_chimera tc.generate() + self._with_chimera = self.dependencies["hyperscan"].options.build_chimera + def build(self): cmake = CMake(self) cmake.configure() @@ -30,6 +34,6 @@ def test(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "hs_example") self.run(bin_path, env="conanrun") - if self.options["hyperscan"].build_chimera: + if self._with_chimera: bin_path = os.path.join(self.cpp.build.bindirs[0], "ch_example") self.run(bin_path, env="conanrun") diff --git a/recipes/hyperscan/config.yml b/recipes/hyperscan/config.yml index d02161efd202ba..4915e863cdb5a4 100644 --- a/recipes/hyperscan/config.yml +++ b/recipes/hyperscan/config.yml @@ -1,3 +1,5 @@ versions: + "5.4.2": + folder: all "5.4.0": folder: all 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 new file mode 100644 index 00000000000000..9cba4ae5061fd3 --- /dev/null +++ b/recipes/iconfontcppheaders/all/conandata.yml @@ -0,0 +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 new file mode 100644 index 00000000000000..5541ed9fd754df --- /dev/null +++ b/recipes/iconfontcppheaders/all/conanfile.py @@ -0,0 +1,38 @@ +import os + +from conan import ConanFile +from conan.tools.layout import basic_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.52.0" + + +class FireHppConan(ConanFile): + name = "iconfontcppheaders" + 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" + topics = ("icons", "fonts", "icon-fonts", "header-only") + no_copy_source = True + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + + 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, "licence.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", self.source_folder, os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/iconfontcppheaders/all/test_package/CMakeLists.txt b/recipes/iconfontcppheaders/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..edfa602f53039b --- /dev/null +++ b/recipes/iconfontcppheaders/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1.2) +project(test_package CXX) + +find_package(iconfontcppheaders REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE iconfontcppheaders::iconfontcppheaders) diff --git a/recipes/iconfontcppheaders/all/test_package/conanfile.py b/recipes/iconfontcppheaders/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a2ac5bf6805ee3 --- /dev/null +++ b/recipes/iconfontcppheaders/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" + 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): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/iconfontcppheaders/all/test_package/test_package.cpp b/recipes/iconfontcppheaders/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..99ac9eb113bd74 --- /dev/null +++ b/recipes/iconfontcppheaders/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() { + std::cout << FONT_ICON_FILE_NAME_FAR << std::endl + << FONT_ICON_FILE_NAME_FAS << std::endl; + return 0; +} diff --git a/recipes/iconfontcppheaders/config.yml b/recipes/iconfontcppheaders/config.yml new file mode 100644 index 00000000000000..4c1b72279193a2 --- /dev/null +++ b/recipes/iconfontcppheaders/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20231102": + folder: all + "cci.20231026": + folder: all diff --git a/recipes/icu/all/conandata.yml b/recipes/icu/all/conandata.yml index 24eb6e8181a952..3f814d74e3bae1 100644 --- a/recipes/icu/all/conandata.yml +++ b/recipes/icu/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "74.1": + url: "https://github.com/unicode-org/icu/releases/download/release-74-1/icu4c-74_1-src.tgz" + sha256: "86ce8e60681972e60e4dcb2490c697463fcec60dd400a5f9bffba26d0b52b8d0" "73.2": url: "https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz" sha256: "818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1" @@ -21,6 +24,8 @@ sources: url: "https://github.com/unicode-org/icu/releases/download/release-68-2/icu4c-68_2-src.tgz" sha256: "c79193dee3907a2199b8296a93b52c5cb74332c26f3d167269487680d479d625" patches: + "74.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" "73.2": - patch_file: "patches/0001-69.1-fix-mingw.patch" "73.1": 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/icu/config.yml b/recipes/icu/config.yml index af733c9ce0ff15..4259c6010a85b9 100644 --- a/recipes/icu/config.yml +++ b/recipes/icu/config.yml @@ -1,4 +1,6 @@ versions: + "74.1": + folder: all "73.2": folder: all "73.1": diff --git a/recipes/ignition-cmake/all/CMakeLists.txt b/recipes/ignition-cmake/all/CMakeLists.txt deleted file mode 100644 index 8d6da516c42c73..00000000000000 --- a/recipes/ignition-cmake/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.10.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/ignition-cmake/all/conandata.yml b/recipes/ignition-cmake/all/conandata.yml index 91e85702d37b5f..ccb98d28636f33 100644 --- a/recipes/ignition-cmake/all/conandata.yml +++ b/recipes/ignition-cmake/all/conandata.yml @@ -8,8 +8,6 @@ sources: patches: "2.5.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-cmake-fixes.patch" + - patch_file: "patches/0001-cmake-fixes.patch" "2.10.0": - - base_path: "source_subfolder" - patch_file: "patches/0002-ignition-cmake-2.10.0-fixes.patch" + - patch_file: "patches/0002-ignition-cmake-2.10.0-fixes.patch" diff --git a/recipes/ignition-cmake/all/conanfile.py b/recipes/ignition-cmake/all/conanfile.py index f09f2bd8badbc4..90598402ac8d14 100644 --- a/recipes/ignition-cmake/all/conanfile.py +++ b/recipes/ignition-cmake/all/conanfile.py @@ -1,115 +1,121 @@ -from conans import CMake, ConanFile, tools, RunEnvironment -import conan.tools.files import os import textwrap +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, save +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class IgnitionCmakeConan(ConanFile): name = "ignition-cmake" + description = "A set of CMake modules that are used by the C++-based Ignition projects." license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/gazebosim/gz-cmake" - description = "A set of CMake modules that are used by the C++-based Ignition projects." - topics = ("ignition", "robotics", "cmake") - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" - exports_sources = "CMakeLists.txt", "patches/**" + topics = ("ignition", "robotics", "cmake", "gazebo", "header-only") - _cmake = None + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True - @property - def _module_file_rel_path(self): - return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + def export_sources(self): + export_conandata_patches(self) - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") def package_id(self): - self.info.header_only() - - def _configure_cmake(self): - if self._cmake is not None: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_INSTALL_DATAROOTDIR"] = "lib" - self._cmake.definitions["SKIP_component_name"] = False - self._cmake.configure(source_folder=self._source_subfolder) - return self._cmake + self.info.clear() 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["CMAKE_INSTALL_DATAROOTDIR"] = "lib" + tc.variables["SKIP_component_name"] = False + tc.generate() def build(self): - version_major = tools.Version(self.version).major - env_build = RunEnvironment(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.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - version_major = tools.Version(self.version).major - cmake_config_files_dir = os.path.join(self.package_folder, "lib", "cmake",f"ignition-cmake{version_major}") - files = os.listdir(cmake_config_files_dir) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "bin")) - # retain the special config file for utilities target provided by ignition-cmake - # removing it from the list - files.remove(f"ignition-cmake{version_major}-utilities-targets.cmake") - - # remove all other xxx.cmake files from the list - for file in files: + version_major = Version(self.version).major + cmake_config_files_dir = os.path.join(self.package_folder, "lib", "cmake", f"ignition-cmake{version_major}") + for file in os.listdir(cmake_config_files_dir): if file.endswith(".cmake"): + if file == f"ignition-cmake{version_major}-utilities-targets.cmake": + # retain the special config file for utilities target provided by ignition-cmake + continue os.remove(os.path.join(cmake_config_files_dir, file)) - - # add version information for downstream dependencies consuming ign-cmake through cmake_find_package generators + + # add version information for downstream dependencies consuming ign-cmake through CMake generators self._create_cmake_module_variables( os.path.join(self.package_folder, self._module_file_rel_path), - tools.Version(self.version) + Version(self.version) ) - @staticmethod - def _create_cmake_module_variables(module_file, version): + def _create_cmake_module_variables(self, module_file, version): # the version info is needed by downstream ignition-dependencies - content = textwrap.dedent("""\ - set(ignition-cmake{major}_VERSION_MAJOR {major}) - set(ignition-cmake{major}_VERSION_MINOR {minor}) - set(ignition-cmake{major}_VERSION_PATCH {patch}) - set(ignition-cmake{major}_VERSION_STRING "{major}.{minor}.{patch}") - """.format(major=version.major, minor=version.minor, patch=version.patch)) - tools.save(module_file, content) + content = textwrap.dedent(f"""\ + set(ignition-cmake{version.major}_VERSION_MAJOR {version.major}) + set(ignition-cmake{version.major}_VERSION_MINOR {version.minor}) + set(ignition-cmake{version.major}_VERSION_PATCH {version.patch}) + set(ignition-cmake{version.major}_VERSION_STRING "{version.major}.{version.minor}.{version.patch}") + """) + save(self, module_file, content) + + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") def package_info(self): - version_major = tools.Version(self.version).major + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.frameworkdirs = [] + + version_major = Version(self.version).major ign_cmake_component = f"ignition-cmake{version_major}" - base_module_path = os.path.join(self.package_folder, "lib", "cmake", ign_cmake_component) + self.cpp_info.set_property("cmake_file_name", ign_cmake_component) + + base_module_path = os.path.join("lib", "cmake", ign_cmake_component) ign_cmake_file = os.path.join(base_module_path, f"cmake{version_major}", "IgnCMake.cmake") utils_targets_file = os.path.join(base_module_path, f"{ign_cmake_component}-utilities-targets.cmake") - + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path, ign_cmake_file, utils_targets_file]) + + self.cpp_info.components[ign_cmake_component].set_property("cmake_target_name", f"{ign_cmake_component}::{ign_cmake_component}") + self.cpp_info.components[ign_cmake_component].builddirs.append(os.path.join(base_module_path, f"cmake{version_major}")) + + self.cpp_info.components["utilities"].set_property("cmake_target_name", f"{ign_cmake_component}::utilities") + self.cpp_info.components["utilities"].builddirs.append(os.path.join(base_module_path, f"cmake{version_major}")) + self.cpp_info.components["utilities"].includedirs.append(os.path.join("include", "ignition", f"cmake{version_major}")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = ign_cmake_component self.cpp_info.names["cmake_find_package_multi"] = ign_cmake_component self.cpp_info.names["cmake_paths"] = ign_cmake_component - self.cpp_info.components[ign_cmake_component].names["cmake_find_package"] = ign_cmake_component self.cpp_info.components[ign_cmake_component].names["cmake_find_package_multi"] = ign_cmake_component self.cpp_info.components[ign_cmake_component].names["cmake_paths"] = ign_cmake_component - self.cpp_info.components[ign_cmake_component].builddirs.append(os.path.join(base_module_path, f"cmake{version_major}")) - self.cpp_info.components[ign_cmake_component].build_modules["cmake_find_package"] = [self._module_file_rel_path, ign_cmake_file] self.cpp_info.components[ign_cmake_component].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path, ign_cmake_file] self.cpp_info.components[ign_cmake_component].build_modules["cmake_paths"] = [self._module_file_rel_path, ign_cmake_file] - self.cpp_info.components["utilities"].names["cmake_find_package"] = "utilities" self.cpp_info.components["utilities"].names["cmake_find_package_multi"] = "utilities" self.cpp_info.components["utilities"].names["cmake_paths"] = "utilities" - self.cpp_info.components["utilities"].includedirs.append(f"include/ignition/cmake{version_major}") - - self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path, ign_cmake_file]) self.cpp_info.components["utilities"].build_modules["cmake_find_package"] = [self._module_file_rel_path, ign_cmake_file, utils_targets_file] self.cpp_info.components["utilities"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path, ign_cmake_file, utils_targets_file] self.cpp_info.components["utilities"].build_modules["cmake_paths"] = [self._module_file_rel_path, ign_cmake_file, utils_targets_file] diff --git a/recipes/ignition-cmake/all/test_package/CMakeLists.txt b/recipes/ignition-cmake/all/test_package/CMakeLists.txt index 9595663869a7f8..de43752ed55758 100644 --- a/recipes/ignition-cmake/all/test_package/CMakeLists.txt +++ b/recipes/ignition-cmake/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.10.2) +cmake_minimum_required(VERSION 3.15) project(test_package VERSION 1.0) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - set(IGN_CMAKE_VER "" CACHE STRING "Version of igition-cmake") if(NOT IGN_CMAKE_VER) diff --git a/recipes/ignition-cmake/all/test_package/conanfile.py b/recipes/ignition-cmake/all/test_package/conanfile.py index 5b49fe0a15144c..708eb36d16238e 100644 --- a/recipes/ignition-cmake/all/test_package/conanfile.py +++ b/recipes/ignition-cmake/all/test_package/conanfile.py @@ -1,23 +1,47 @@ import os -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" test_type = "explicit" + def requirements(self): - self.requires(self.tested_reference_str) + # For headers + self.requires(self.tested_reference_str) + + def build_requirements(self): + # For *.cmake files + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["IGN_CMAKE_VER"] = Version(self.dependencies["ignition-cmake"].ref.version).major + tc.generate() + deps = CMakeDeps(self) + # If using as a build requirement, the following lines are necessary + # deps.build_context_activated = ["ignition-cmake"] + # deps.build_context_build_modules = ["ignition-cmake"] + deps.generate() def build(self): cmake = CMake(self) - cmake.definitions["IGN_CMAKE_VER"] = tools.Version(self.deps_cpp_info["ignition-cmake"].version).major 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) + if can_run(self): + if is_msvc(self): + bin_path = os.path.join(self.build_folder, "bin", str(self.settings.build_type), "test_package") + else: + bin_path = os.path.join(self.build_folder, "bin", "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ignition-cmake/all/test_package/src/CMakeLists.txt b/recipes/ignition-cmake/all/test_package/src/CMakeLists.txt index e050db890afd7f..3934b5db47f4a6 100644 --- a/recipes/ignition-cmake/all/test_package/src/CMakeLists.txt +++ b/recipes/ignition-cmake/all/test_package/src/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) ign_add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} ignition-cmake${IGN_CMAKE_VER}::utilities) diff --git a/recipes/ignition-cmake/all/test_v1_package/CMakeLists.txt b/recipes/ignition-cmake/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/ignition-cmake/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/ignition-cmake/all/test_v1_package/conanfile.py b/recipes/ignition-cmake/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..8f851887ec419b --- /dev/null +++ b/recipes/ignition-cmake/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os + +from conans import CMake, ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.definitions["IGN_CMAKE_VER"] = tools.Version(self.deps_cpp_info["ignition-cmake"].version).major + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join(self.build_folder, "bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/im95able-rea/all/conanfile.py b/recipes/im95able-rea/all/conanfile.py index 74423119b26028..66b814aa4851f8 100644 --- a/recipes/im95able-rea/all/conanfile.py +++ b/recipes/im95able-rea/all/conanfile.py @@ -18,6 +18,7 @@ class Im95ableReaConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/im95able/Rea/" topics = ("slot_map", "slot_list", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @property diff --git a/recipes/imagl/all/CMakeLists.txt b/recipes/imagl/all/CMakeLists.txt deleted file mode 100644 index 434aea21733de3..00000000000000 --- a/recipes/imagl/all/CMakeLists.txt +++ /dev/null @@ -1,7 +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/imagl/all/conandata.yml b/recipes/imagl/all/conandata.yml index 4c28973c33e6b8..338c8a935d27e9 100644 --- a/recipes/imagl/all/conandata.yml +++ b/recipes/imagl/all/conandata.yml @@ -1,26 +1,30 @@ sources: "0.1.0": - url: "https://gitlab-lepuy.iut-clermont.uca.fr/opengl/imagl/-/archive/v0.1.0/imagl-v0.1.0.tar.gz" - sha256: "9dcfba4c2efa8d44bf4cc9edd324794865dd6d6331467d3c69f5c5574db3844e" + url: "https://github.com/Woazim/imaGL/archive/refs/tags/v0.1.0.tar.gz" + sha256: "070d155f61c3036be67683dcec7bef57d5407f5aa7ca35487358b55fd2762ef8" "0.1.1": - url: "https://gitlab-lepuy.iut-clermont.uca.fr/opengl/imagl/-/archive/v0.1.1/imagl-v0.1.1.tar.gz" - sha256: "4a7502cc733431af6423246fe5144e2eddb984454a66cca51742c852980ac862" + url: "https://github.com/Woazim/imaGL/archive/refs/tags/v0.1.1.tar.gz" + sha256: "25c1df00dfd1741b013044de9407f30f58ca64d155d862db740518ed8667f3ec" "0.1.2": - url: "https://gitlab-lepuy.iut-clermont.uca.fr/opengl/imagl/-/archive/v0.1.2/imagl-v0.1.2.tar.gz" - sha256: "d1edf74e00f969a47dc56e4400b805600d6997270339d49e91b7c6112a2cb37e" + url: "https://github.com/Woazim/imaGL/archive/refs/tags/v0.1.2.tar.gz" + sha256: "03296707f4c6b5a03cd4d6670c7444c0660d22ca09de981e57fcb75111fd16a5" "0.2.1": - url: "https://gitlab-lepuy.iut-clermont.uca.fr/opengl/imagl/-/archive/v0.2.1/imagl-v0.2.1.tar.gz" - sha256: "5a68cdeff4338e411695cca16c4230567de298f8efee2a9fadcc6fa644a70248" + url: "https://github.com/Woazim/imaGL/archive/refs/tags/v0.2.1.tar.gz" + sha256: "b0109b1d0cadf3054ad959ed4a0420b61202f8143f5a7ad766c1e449603d30d8" patches: "0.1.0": - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" - base_path: "source_subfolder" + patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" + patch_type: conan "0.1.1": - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" - base_path: "source_subfolder" + patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" + patch_type: conan "0.1.2": - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" - base_path: "source_subfolder" + patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" + patch_type: conan "0.2.1": - patch_file: "patches/0001-no-unmanaged-conan-0.2.1.patch" - base_path: "source_subfolder" + patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" + patch_type: conan diff --git a/recipes/imagl/all/conanfile.py b/recipes/imagl/all/conanfile.py index a8994d4c2ba67a..e756a56a2d5483 100644 --- a/recipes/imagl/all/conanfile.py +++ b/recipes/imagl/all/conanfile.py @@ -1,12 +1,18 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.errors import ConanInvalidConfiguration +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class ImaglConan(ConanFile): name = "imagl" - license = "GPL-3.0-or-later" + license = "LGPL-3.0-only" homepage = "https://github.com/Woazim/imaGL" url = "https://github.com/conan-io/conan-center-index" description = "A lightweight library to load image for OpenGL application." @@ -24,108 +30,88 @@ class ImaglConan(ConanFile): "with_png": True, "with_jpeg": True, } - generators = "cmake" - exports_sources = ["CMakeLists.txt", "patches/**"] - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 20 @property def _compilers_minimum_version(self): - minimum_versions = { + return { "gcc": "9", - "Visual Studio": "16.2", - "msvc": "19.22", "clang": "10", "apple-clang": "11" } - if tools.Version(self.version) <= "0.1.1" or tools.Version(self.version) == "0.2.0": - minimum_versions["Visual Studio"] = "16.5" - minimum_versions["msvc"] = "19.25" - return minimum_versions @property def _supports_jpeg(self): - return tools.Version(self.version) >= "0.2.0" + return Version(self.version) >= "0.2.0" + + 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 not self._supports_jpeg: - del self.options.with_jpeg + self.options.rm_safe("with_jpeg") 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_png: - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.40") if self._supports_jpeg and self.options.with_jpeg: - self.requires("libjpeg/9d") + self.requires("libjpeg/9e") def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 20) - - def lazy_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] - - #Special check for clang that can only be linked to libc++ - if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++": + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + 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." + ) + + # INFO: Special check for clang that can only be linked to libc++ + if self.settings.compiler == "clang" and self.settings.get_safe("compiler.libcxx") != "libc++": raise ConanInvalidConfiguration("imagl requires some C++20 features, which are available in libc++ for clang compiler.") - compiler_version = str(self.settings.compiler.version) - - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn("imaGL requires C++20. Your compiler is unknown. Assuming it supports C++20.") - elif lazy_lt_semver(compiler_version, minimum_version): - raise ConanInvalidConfiguration("imaGL requires some C++20 features, which your {} {} compiler does not support.".format(str(self.settings.compiler), compiler_version)) - else: - print("Your compiler is {} {} and is compatible.".format(str(self.settings.compiler), compiler_version)) 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["STATIC_LIB"] = not self.options.shared - self._cmake.definitions["SUPPORT_PNG"] = self.options.with_png + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.variables["STATIC_LIB"] = not self.options.shared + tc.variables["SUPPORT_PNG"] = self.options.with_png if self._supports_jpeg: - self._cmake.definitions["SUPPORT_JPEG"] = self.options.with_jpeg - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["SUPPORT_JPEG"] = self.options.with_jpeg + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): debug_suffix = "d" if self.settings.build_type == "Debug" else "" static_suffix = "" if self.options.shared else "s" - self.cpp_info.libs = ["imaGL{}{}".format(debug_suffix, static_suffix)] + self.cpp_info.libs = [f"imaGL{debug_suffix}{static_suffix}"] if not self.options.shared: self.cpp_info.defines = ["IMAGL_STATIC=1"] - diff --git a/recipes/imagl/all/test_package/CMakeLists.txt b/recipes/imagl/all/test_package/CMakeLists.txt index 15d229320021ca..ba0d23b2326bb9 100644 --- a/recipes/imagl/all/test_package/CMakeLists.txt +++ b/recipes/imagl/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(imagl CONFIG REQUIRED) add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) -set_target_properties(example PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON) +target_link_libraries(example PRIVATE imagl::imagl) +target_compile_features(example PRIVATE cxx_std_20) diff --git a/recipes/imagl/all/test_package/conanfile.py b/recipes/imagl/all/test_package/conanfile.py index 156e2a8976e7c0..0d267f1fe3b58f 100644 --- a/recipes/imagl/all/test_package/conanfile.py +++ b/recipes/imagl/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 ImaglTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + 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) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.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/imagl/all/test_v1_package/CMakeLists.txt b/recipes/imagl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/imagl/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/imagl/all/test_v1_package/conanfile.py b/recipes/imagl/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..923bd771c14e7a --- /dev/null +++ b/recipes/imagl/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class ImaglTestConan(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", "example") + self.run(bin_path, run_environment=True) 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/CMakeLists.txt b/recipes/imgui/all/CMakeLists.txt index 97b98049ec042b..0626bf7008e526 100644 --- a/recipes/imgui/all/CMakeLists.txt +++ b/recipes/imgui/all/CMakeLists.txt @@ -7,6 +7,7 @@ set(IMGUI_EXPORT_HEADERS imgui_export_headers.h) file(GLOB SOURCE_FILES ${IMGUI_SRC_DIR}/*.cpp) file(GLOB HEADER_FILES ${IMGUI_SRC_DIR}/*.h) + file(GLOB EXTRA_FONTS_FILES ${EXTRA_FONTS_DIR}/*.ttf) if (MSVC) file(GLOB EXTRA_NATVIS_FILES ${MISC_DIR}/natvis/*.natvis) diff --git a/recipes/imgui/all/conandata.yml b/recipes/imgui/all/conandata.yml index 82db7f4c7e4b5b..5a380f8aab078b 100644 --- a/recipes/imgui/all/conandata.yml +++ b/recipes/imgui/all/conandata.yml @@ -1,4 +1,22 @@ 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" + "1.89.9-docking": + url: "https://github.com/ocornut/imgui/archive/v1.89.9-docking.tar.gz" + sha256: "2481489ce9091239b3cab8a330d0409ffdd9ee607ad1f3fe3a0b0b751c27a8eb" + "1.89.8": + url: "https://github.com/ocornut/imgui/archive/v1.89.8.tar.gz" + sha256: "6680ccc32430009a8204291b1268b2367d964bd6d1b08a4e0358a017eb8e8c9e" + "1.89.8-docking": + url: "https://github.com/ocornut/imgui/archive/v1.89.8-docking.tar.gz" + sha256: "d48c4856e42a8fa3e6df3efae7eae86012fa65d9dceb03d1a2080a2386063635" "1.89.7": url: "https://github.com/ocornut/imgui/archive/v1.89.7.tar.gz" sha256: "115ee9e242af98a884302ac0f6ca3b2b26b1f10c660205f5e7ad9f1d1c96d269" diff --git a/recipes/imgui/all/conanfile.py b/recipes/imgui/all/conanfile.py index b71a56e771c7a5..ffe8b2248047c5 100644 --- a/recipes/imgui/all/conanfile.py +++ b/recipes/imgui/all/conanfile.py @@ -77,6 +77,15 @@ def package(self): copy(self, pattern="imgui_impl_*", dst=os.path.join(self.package_folder, "res", "bindings"), src=backends_folder) + copy(self, pattern="imgui*.cpp", + dst=os.path.join(self.package_folder, "res", "src"), + src=os.path.join(self.source_folder)) + copy(self, pattern="*.*", + dst=os.path.join(self.package_folder, "res", "misc", "cpp"), + src=os.path.join(self.source_folder, "misc", "cpp")) + copy(self, pattern="*.*", + dst=os.path.join(self.package_folder, "res", "misc", "freetype"), + src=os.path.join(self.source_folder, "misc", "freetype")) cmake = CMake(self) cmake.install() diff --git a/recipes/imgui/config.yml b/recipes/imgui/config.yml index 737cb8b3dbc2cf..8714c2dcec41f2 100644 --- a/recipes/imgui/config.yml +++ b/recipes/imgui/config.yml @@ -1,4 +1,16 @@ versions: + "1.90": + folder: all + "1.90-docking": + folder: all + "1.89.9": + folder: all + "1.89.9-docking": + folder: all + "1.89.8": + folder: all + "1.89.8-docking": + folder: all "1.89.7": folder: all "1.89.7-docking": diff --git a/recipes/imguizmo/all/CMakeLists.txt b/recipes/imguizmo/all/CMakeLists.txt index 73784d828761a7..00a03f50329728 100644 --- a/recipes/imguizmo/all/CMakeLists.txt +++ b/recipes/imguizmo/all/CMakeLists.txt @@ -1,27 +1,22 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(imguizmo CXX) + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) - -include(conanbuildinfo.cmake) -conan_basic_setup() - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -set(SOURCE_DIR source_subfolder) +set(SOURCE_DIR src) file(GLOB SOURCE_FILES ${SOURCE_DIR}/*.cpp) file(GLOB HEADER_FILES ${SOURCE_DIR}/*.h) +find_package(imgui CONFIG REQUIRED) + add_library(${PROJECT_NAME} ${SOURCE_FILES}) target_include_directories(${PROJECT_NAME} PRIVATE ${SOURCE_DIR}) -target_link_libraries(${PROJECT_NAME} PUBLIC ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PUBLIC imgui::imgui) include(GNUInstallDirs) - -install(TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ${PROJECT_NAME}) install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) diff --git a/recipes/imguizmo/all/conanfile.py b/recipes/imguizmo/all/conanfile.py index 62c65e6489c8be..57281934555cff 100644 --- a/recipes/imguizmo/all/conanfile.py +++ b/recipes/imguizmo/all/conanfile.py @@ -1,31 +1,33 @@ -import functools -from conans import ConanFile, CMake, tools +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.53.0" class ImGuizmoConan(ConanFile): name = "imguizmo" + description = "Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/CedricGuillemet/ImGuizmo" - description = "Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui" topics = ("imgui", "3d", "graphics", "guizmo") - license = "MIT" - settings = "os", "arch", "compiler", "build_type" - - exports_sources = ["CMakeLists.txt"] - generators = "cmake" + 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 + "fPIC": True, } - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -33,28 +35,34 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("imgui/1.87") + # 1.89 is the newest imgui version compatible with imguizmo + self.requires("imgui/1.89.3", transitive_headers=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def source(self): + 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): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) 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): diff --git a/recipes/imguizmo/all/test_package/CMakeLists.txt b/recipes/imguizmo/all/test_package/CMakeLists.txt index 4db4d9b97252ba..bca22087e39204 100644 --- a/recipes/imguizmo/all/test_package/CMakeLists.txt +++ b/recipes/imguizmo/all/test_package/CMakeLists.txt @@ -1,13 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(imgui REQUIRED) -find_package(imguizmo REQUIRED) +find_package(imgui REQUIRED CONFIG) +find_package(imguizmo REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} imgui::imgui) diff --git a/recipes/imguizmo/all/test_package/conanfile.py b/recipes/imguizmo/all/test_package/conanfile.py index 23ba95e79f465d..ef5d7042163ecc 100644 --- a/recipes/imguizmo/all/test_package/conanfile.py +++ b/recipes/imguizmo/all/test_package/conanfile.py @@ -1,9 +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) @@ -11,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/imguizmo/all/test_v1_package/CMakeLists.txt b/recipes/imguizmo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/imguizmo/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/imguizmo/all/test_v1_package/conanfile.py b/recipes/imguizmo/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6c9d5dba712c72 --- /dev/null +++ b/recipes/imguizmo/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/immer/all/conandata.yml b/recipes/immer/all/conandata.yml index 811b858690dba0..dcc90952900823 100644 --- a/recipes/immer/all/conandata.yml +++ b/recipes/immer/all/conandata.yml @@ -1,10 +1,10 @@ sources: + "0.8.1": + url: "https://github.com/arximboldi/immer/archive/v0.8.1.tar.gz" + sha256: "de8411c84830864604bb685dc8f2e3c0dbdc40b95b2f6726092f7dcc85e75209" "0.8.0": url: "https://github.com/arximboldi/immer/archive/v0.8.0.tar.gz" sha256: "4ed9e86a525f293e0ba053107b937d88b032674ec6e5db958816f2e412677fde" "0.7.0": url: "https://github.com/arximboldi/immer/archive/v0.7.0.tar.gz" sha256: "cf67ab428aa3610eb0f72d0ea936c15cce3f91df26ee143ab783acd053507fe4" - "0.6.2": - url: "https://github.com/arximboldi/immer/archive/refs/tags/v0.6.2.tar.gz" - sha256: "c3bb8847034437dee64adacb04e1e0163ae640b596c582eb4c0aa1d7c6447cd7" diff --git a/recipes/immer/all/conanfile.py b/recipes/immer/all/conanfile.py index 952501519b5549..dadfcc5005ec64 100644 --- a/recipes/immer/all/conanfile.py +++ b/recipes/immer/all/conanfile.py @@ -1,40 +1,32 @@ -from conans import ConanFile, tools, errors +import os + +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" -required_conan_version = ">=1.33.0" class ImmerConan(ConanFile): name = "immer" + description = "Postmodern immutable and persistent data structures for C++ - value semantics at scale" license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/arximboldi/immer" - description = "Postmodern immutable and persistent data structures for C++---value semantics at scale" - topics = ("header", "header-only", "persistent", "modern", "immutable", - "data structures", "functional", "value semantics", "postmodern", - "rrb-tree") + topics = ("header", "header-only", "persistent", "modern", "immutable", "data structures", + "functional", "value semantics", "postmodern", "rrb-tree") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = "compiler" @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 14 - @property - def _source_subfolder(self): - return "source_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, - destination=self._source_subfolder) - - def package(self): - include_folder = self._source_subfolder - self.copy(pattern="*.hpp", dst="include", src=include_folder) - self.copy(pattern="LICENSE", dst="licenses", src=include_folder) - - def package_id(self): - self.info.header_only() - @property def _minimum_compilers_version(self): # Reference: https://en.cppreference.com/w/cpp/compiler_support/14 @@ -44,17 +36,36 @@ def _minimum_compilers_version(self): "gcc": "6", "intel": "17", "sun-cc": "5.15", - "Visual Studio": "15" + "Visual Studio": "15", } + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._min_cppstd) min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) if not min_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) + self.output.warning(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") else: - if tools.Version(self.settings.compiler.version) < min_version: - raise errors.ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( - self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._min_cppstd} support. The current compiler" + f" {self.settings.compiler} {self.settings.compiler.version} does not support it." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + include_folder = self.source_folder + copy(self, pattern="*.hpp", dst=os.path.join(self.package_folder, "include"), src=include_folder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=include_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/immer/all/test_package/CMakeLists.txt b/recipes/immer/all/test_package/CMakeLists.txt index 870b269d2d6609..3e9a18f3dcd2f6 100644 --- a/recipes/immer/all/test_package/CMakeLists.txt +++ b/recipes/immer/all/test_package/CMakeLists.txt @@ -1,13 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.15) +project(PackageTest LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(immer REQUIRED CONFIG) -find_package(immer CONFIG REQUIRED) - -add_executable(example example.cpp) - -target_link_libraries(example immer::immer) - -target_compile_features(example PUBLIC cxx_std_14) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE immer::immer) +target_compile_features(test_package PRIVATE cxx_std_14) diff --git a/recipes/immer/all/test_package/conanfile.py b/recipes/immer/all/test_package/conanfile.py index 0242d96a644cae..ef5d7042163ecc 100644 --- a/recipes/immer/all/test_package/conanfile.py +++ b/recipes/immer/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", "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,6 @@ def build(self): cmake.build() def test(self): - if not tools.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, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/immer/all/test_package/example.cpp b/recipes/immer/all/test_package/example.cpp deleted file mode 100644 index 3778564a310823..00000000000000 --- a/recipes/immer/all/test_package/example.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "immer/vector.hpp" -#include - -int main() { - const auto v0 = immer::vector{}; - const auto v1 = v0.push_back(13); - assert(v0.size() == 0 && v1.size() == 1 && v1[0] == 13); - - const auto v2 = v1.set(0, 42); - assert(v1[0] == 13 && v2[0] == 42); - - return 0; -} diff --git a/recipes/immer/all/test_package/test_package.cpp b/recipes/immer/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..78e26ad5b37e63 --- /dev/null +++ b/recipes/immer/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include "immer/vector.hpp" +#include + +int main() { + const auto v0 = immer::vector{}; + const auto v1 = v0.push_back(13); + assert(v0.size() == 0 && v1.size() == 1 && v1[0] == 13); + + const auto v2 = v1.set(0, 42); + assert(v1[0] == 13 && v2[0] == 42); + + return 0; +} diff --git a/recipes/immer/all/test_v1_package/CMakeLists.txt b/recipes/immer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/immer/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/immer/all/test_v1_package/conanfile.py b/recipes/immer/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..90eb89e3f2f46b --- /dev/null +++ b/recipes/immer/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") + self.run(bin_path, run_environment=True) diff --git a/recipes/immer/config.yml b/recipes/immer/config.yml index 9e53a8732b4037..249b90e4014bae 100644 --- a/recipes/immer/config.yml +++ b/recipes/immer/config.yml @@ -1,7 +1,7 @@ versions: + "0.8.1": + folder: all "0.8.0": folder: all "0.7.0": folder: all - "0.6.2": - folder: all diff --git a/recipes/implot/all/CMakeLists.txt b/recipes/implot/all/CMakeLists.txt index ec869caed90292..8f2c9651b41e68 100644 --- a/recipes/implot/all/CMakeLists.txt +++ b/recipes/implot/all/CMakeLists.txt @@ -1,14 +1,13 @@ cmake_minimum_required(VERSION 3.4) -project(implot CXX) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +project(implot LANGUAGES CXX) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -file(GLOB SOURCE_FILES ${IMPLOT_SRC_DIR}/*.cpp) file(GLOB HEADER_FILES ${IMPLOT_SRC_DIR}/*.h) -add_library(${PROJECT_NAME} ${SOURCE_FILES}) +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}) find_package(imgui CONFIG REQUIRED) @@ -16,6 +15,8 @@ find_package(imgui CONFIG REQUIRED) target_link_libraries(${PROJECT_NAME} PUBLIC imgui::imgui) target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_DEFINE_MATH_OPERATORS) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) include(GNUInstallDirs) diff --git a/recipes/implot/all/conandata.yml b/recipes/implot/all/conandata.yml index 21af4dfe87312a..5aa143a53a4986 100644 --- a/recipes/implot/all/conandata.yml +++ b/recipes/implot/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.16": + url: "https://github.com/epezent/implot/archive/v0.16.tar.gz" + sha256: "961df327d8a756304d1b0a67316eebdb1111d13d559f0d3415114ec0eb30abd1" + "0.15": + url: "https://github.com/epezent/implot/archive/v0.15.tar.gz" + sha256: "4c20f22fbfbe4ad055f3d344581918d62cde72070b233dad75419a4334f82146" "0.14": url: "https://github.com/epezent/implot/archive/v0.14.tar.gz" sha256: "1613af3e6554c0a74de20c6e60e9bce5ce35c2d4f9e1aa5ff963f7fe2d48af88" diff --git a/recipes/implot/all/conanfile.py b/recipes/implot/all/conanfile.py index ce2e069d3196dc..0f83131c241162 100644 --- a/recipes/implot/all/conanfile.py +++ b/recipes/implot/all/conanfile.py @@ -1,28 +1,29 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import get, copy from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.54" class ImplotConan(ConanFile): name = "implot" + description = "Advanced 2D Plotting for Dear ImGui" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/epezent/implot" - description = "Advanced 2D Plotting for Dear ImGui" topics = ("imgui", "plot", "graphics", ) - license = "MIT" - settings = "os", "arch", "compiler", "build_type" 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 + "fPIC": True, } def export_sources(self): @@ -37,7 +38,9 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - if Version(self.version) >= "0.14": + if Version(self.version) >= "0.15": + self.requires("imgui/1.90", transitive_headers=True) + elif Version(self.version) >= "0.14": self.requires("imgui/1.89.4", transitive_headers=True) elif Version(self.version) >= "0.13": # imgui 1.89 renamed ImGuiKeyModFlags_* to ImGuiModFlags_* @@ -48,6 +51,10 @@ def requirements(self): def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + if Version(self.version) < "0.13" and is_msvc(self) and self.dependencies["imgui"].options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared imgui.") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -65,6 +72,7 @@ def build(self): def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="implot*.cpp", dst=os.path.join(self.package_folder, "res", "src"), src=self.source_folder) cmake = CMake(self) cmake.install() 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/implot/config.yml b/recipes/implot/config.yml index d62abd0d999a89..60016fd219bda6 100644 --- a/recipes/implot/config.yml +++ b/recipes/implot/config.yml @@ -1,4 +1,8 @@ versions: + "0.16": + folder: "all" + "0.15": + folder: "all" "0.14": folder: "all" "0.13": diff --git a/recipes/imutils-cpp/all/conanfile.py b/recipes/imutils-cpp/all/conanfile.py index f6e8787dbdea2a..d9f313c9e9b84a 100644 --- a/recipes/imutils-cpp/all/conanfile.py +++ b/recipes/imutils-cpp/all/conanfile.py @@ -56,8 +56,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("opencv/4.5.5", transitive_headers=True, transitive_libs=True) - self.requires("libcurl/7.87.0") + self.requires("opencv/4.8.1", transitive_headers=True, transitive_libs=True) + self.requires("libcurl/[>=7.78.0 <9]") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/incbin/all/conanfile.py b/recipes/incbin/all/conanfile.py index 2e27608fee20f5..446fadbc04892f 100644 --- a/recipes/incbin/all/conanfile.py +++ b/recipes/incbin/all/conanfile.py @@ -16,12 +16,15 @@ class IncbinConan(ConanFile): homepage = "https://github.com/graphitemaster/incbin/" topics = ("include", "binary", "preprocess", "header-only") package_type = "header-library" - settings = "compiler" + 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 validate(self): if is_msvc(self): raise ConanInvalidConfiguration("Currently incbin recipe is not supported for Visual Studio because it requires external command 'incbin'.") @@ -33,5 +36,6 @@ def package(self): copy(self, "UNLICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy(self, "incbin.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) - def package_id(self): - self.info.clear() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/indicators/all/conanfile.py b/recipes/indicators/all/conanfile.py index e0917bf5ba07b5..fa47f76cede992 100644 --- a/recipes/indicators/all/conanfile.py +++ b/recipes/indicators/all/conanfile.py @@ -7,7 +7,8 @@ from conan.tools.microsoft import is_msvc from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.50.0" + class IndicatorsConan(ConanFile): name = "indicators" @@ -16,6 +17,7 @@ class IndicatorsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/p-ranav/indicators" topics = ("activity", "indicator", "loading", "spinner", "animation", "progress", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -47,6 +49,8 @@ def package(self): copy(self, pattern="*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "indicators") + self.cpp_info.set_property("cmake_target_name", "indicators::indicators") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/inih/all/conanfile.py b/recipes/inih/all/conanfile.py index 7b43c7f01710cf..559726ced856f6 100644 --- a/recipes/inih/all/conanfile.py +++ b/recipes/inih/all/conanfile.py @@ -62,7 +62,7 @@ def validate(self): raise ConanInvalidConfiguration("Shared inih is not supported with msvc") def build_requirements(self): - self.tool_requires("meson/1.1.1") + self.tool_requires("meson/1.2.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/inja/all/conanfile.py b/recipes/inja/all/conanfile.py index e211c74ba199b4..e6c08750f56818 100644 --- a/recipes/inja/all/conanfile.py +++ b/recipes/inja/all/conanfile.py @@ -16,6 +16,7 @@ class InjaConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "Inja is a template engine for modern C++, loosely inspired by jinja for python" topics = ("jinja2", "string templates", "templates engine") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -35,8 +36,11 @@ def _compilers_minimum_version(self): "apple-clang": "10", } + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.3") def package_id(self): self.info.clear() @@ -50,12 +54,8 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -68,9 +68,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "inja") self.cpp_info.set_property("cmake_target_name", "pantor::inja") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once legacy generators removed self.cpp_info.filenames["cmake_find_package"] = "inja" @@ -82,6 +80,4 @@ def package_info(self): self.cpp_info.components["libinja"].set_property("cmake_target_name", "pantor::inja") self.cpp_info.components["libinja"].requires = ["nlohmann_json::nlohmann_json"] self.cpp_info.components["libinja"].bindirs = [] - self.cpp_info.components["libinja"].frameworkdirs = [] self.cpp_info.components["libinja"].libdirs = [] - self.cpp_info.components["libinja"].resdirs = [] diff --git a/recipes/inja/all/test_package/conanfile.py b/recipes/inja/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/inja/all/test_package/conanfile.py +++ b/recipes/inja/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/intel-neon2sse/all/conanfile.py b/recipes/intel-neon2sse/all/conanfile.py index a50107175e4669..9d152bb546968c 100644 --- a/recipes/intel-neon2sse/all/conanfile.py +++ b/recipes/intel-neon2sse/all/conanfile.py @@ -4,6 +4,9 @@ from conan.tools.files import copy, get, rmdir from os import path +required_conan_version = ">=1.50.0" + + class IntelNeon2sseConan(ConanFile): name = "intel-neon2sse" url = "https://github.com/conan-io/conan-center-index" @@ -11,6 +14,7 @@ class IntelNeon2sseConan(ConanFile): description = "Header only library intended to simplify ARM->IA32 porting" license = "BSD-2-Clause" topics = "neon", "sse", "port", "translation", "intrinsics" + package_type = "header-library" settings = "os", "compiler", "build_type", "arch" options = { "SSE4": [True, False], @@ -21,16 +25,18 @@ class IntelNeon2sseConan(ConanFile): "disable_performance_warnings": False, } + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.arch not in ("x86", "x86_64"): raise ConanInvalidConfiguration("neon2sse only supports arch={x86,x86_64}") - def layout(self): - cmake_layout(self, src_folder="src") - 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) @@ -47,13 +53,11 @@ def package(self): copy(self, "LICENSE", dst=path.join(self.package_folder, "licenses"), src=self.source_folder) rmdir(self, path.join(self.package_folder, "lib")) - def package_id(self): - self.info.clear() - def package_info(self): + self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] self.cpp_info.set_property("cmake_file_name", "NEON_2_SSE") - self.cpp_info.set_property("cmake_target_name", "NEON_2_SSE::NEON_2_SSE") + self.cpp_info.set_property("cmake_target_name", "NEON_2_SSE::NEON_2_SSE") if self.options.SSE4: self.cpp_info.defines.append("USE_SSE4") if self.options.disable_performance_warnings: diff --git a/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt b/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt index 0f782736008531..b21cc49efde95c 100644 --- a/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt +++ b/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(NEON_2_SSE REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} NEON_2_SSE::NEON_2_SSE) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/intel-neon2sse/all/test_v1_package/conanfile.py b/recipes/intel-neon2sse/all/test_v1_package/conanfile.py index 5493d58611803c..1bf1c7e26255d4 100644 --- a/recipes/intel-neon2sse/all/test_v1_package/conanfile.py +++ b/recipes/intel-neon2sse/all/test_v1_package/conanfile.py @@ -3,7 +3,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) diff --git a/recipes/intx/all/conandata.yml b/recipes/intx/all/conandata.yml new file mode 100644 index 00000000000000..82ca4023ed3e56 --- /dev/null +++ b/recipes/intx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.10.1": + url: "https://github.com/chfast/intx/archive/v0.10.1.tar.gz" + sha256: "4663073458b5e0564e92058e5aa1a7ce88634fc72827191856b17bd7335de29b" diff --git a/recipes/intx/all/conanfile.py b/recipes/intx/all/conanfile.py new file mode 100644 index 00000000000000..fcbc0174dcfbbb --- /dev/null +++ b/recipes/intx/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.51.1" + +class IntxConan(ConanFile): + name = "intx" + description = "Extended precision integer C++ library" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/chfast/intx" + topics = ("evm", "biginteger", "arbitrary-precision", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 20 + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "11", + "clang": "13", + "apple-clang": "14.1", + } + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("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 package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.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.libdirs = [] diff --git a/recipes/intx/all/test_package/CMakeLists.txt b/recipes/intx/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..460d6198ba06f5 --- /dev/null +++ b/recipes/intx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(intx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE intx::intx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/intx/all/test_package/conanfile.py b/recipes/intx/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/intx/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/intx/all/test_package/test_package.cpp b/recipes/intx/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..e9521bde28299a --- /dev/null +++ b/recipes/intx/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char**) +{ + return static_cast(intx::uint512{argc} / (intx::uint512{1} << 111)); +} diff --git a/recipes/intx/all/test_v1_package/CMakeLists.txt b/recipes/intx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..9652e22fc19d54 --- /dev/null +++ b/recipes/intx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) + +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/soplex/all/test_v1_package/conanfile.py b/recipes/intx/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/soplex/all/test_v1_package/conanfile.py rename to recipes/intx/all/test_v1_package/conanfile.py diff --git a/recipes/intx/config.yml b/recipes/intx/config.yml new file mode 100644 index 00000000000000..36cf695df0df63 --- /dev/null +++ b/recipes/intx/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.1": + folder: all diff --git a/recipes/iowow/all/conandata.yml b/recipes/iowow/all/conandata.yml new file mode 100644 index 00000000000000..3dc81fcb105884 --- /dev/null +++ b/recipes/iowow/all/conandata.yml @@ -0,0 +1,20 @@ +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" + patch_type: "portability" + patch_source: "https://github.com/Softmotions/iowow/pull/56" + - patch_file: "patches/1.4.16-0002-fix-uint64_t-format.patch" + patch_description: "fix uint64_t printf format" + patch_type: "portability" diff --git a/recipes/iowow/all/conanfile.py b/recipes/iowow/all/conanfile.py new file mode 100644 index 00000000000000..5a4fade27f4f64 --- /dev/null +++ b/recipes/iowow/all/conanfile.py @@ -0,0 +1,78 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir, export_conandata_patches, apply_conandata_patches +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + +class IowowConan(ConanFile): + name = "iowow" + description = "A C utility library and persistent key/value storage engine." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://iowow.softmotions.com/" + topics = ("database", "nosql", "key-value", "kvstore", "skiplist", "ejdb") + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_BUILD_TYPE"] = self.settings.build_type + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["PACKAGE_ZIP"] = False + tc.variables["PACKAGE_TGZ"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["iowow-1"] + self.cpp_info.set_property("pkg_config_name", "package") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("m") diff --git a/recipes/iowow/all/patches/1.4.16-0001-some-fix-for-macOS.patch b/recipes/iowow/all/patches/1.4.16-0001-some-fix-for-macOS.patch new file mode 100644 index 00000000000000..0a42af275a2ee7 --- /dev/null +++ b/recipes/iowow/all/patches/1.4.16-0001-some-fix-for-macOS.patch @@ -0,0 +1,148 @@ +diff --git a/a/src/CMakeLists.txt b/b/src/CMakeLists.txt +index 7fd40ff..6c5990e 100644 +--- a/a/src/CMakeLists.txt ++++ b/b/src/CMakeLists.txt +@@ -184,7 +184,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \ + -Wno-sign-compare -Wno-unused-parameter \ + -Wno-implicit-fallthrough -Wno-unknown-pragmas -Wno-unused-function -Wno-missing-field-initializers \ + -Wno-missing-braces") +-if (APPLE) ++if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shorten-64-to-32") + endif() + +diff --git a/a/src/platform/unix/unix.c b/b/src/platform/unix/unix.c +index 96b4920..0f8ceb4 100644 +--- a/a/src/platform/unix/unix.c ++++ b/b/src/platform/unix/unix.c +@@ -348,6 +348,7 @@ iwrc iwp_exec_path(char *opath, size_t opath_maxlen) { + if (ret < 0) { + return iwrc_set_errno(IW_ERROR_ERRNO, errno); + } ++ return 0; + #else + // TODO: + return IW_ERROR_NOT_IMPLEMENTED; +diff --git a/a/src/utils/iwhmap.c b/b/src/utils/iwhmap.c +index 07ae953..757e31f 100644 +--- a/a/src/utils/iwhmap.c ++++ b/b/src/utils/iwhmap.c +@@ -109,13 +109,13 @@ IW_INLINE uint32_t _hash_uint64(uint64_t x) { + } + + IW_INLINE uint32_t _hash_uint64_key(const void *key) { +- if (sizeof(uintptr_t) >= sizeof(uint64_t)) { ++#ifdef IW_64 + return _hash_uint64((uint64_t) key); +- } else { ++#else + uint64_t lv; + memcpy(&lv, key, sizeof(lv)); + return _hash_uint64(lv); +- } ++#endif + } + + IW_INLINE uint32_t _hash_uint32_key(const void *key) { +diff --git a/a/src/utils/murmur3.c b/b/src/utils/murmur3.c +index c09bf73..7f3a066 100644 +--- a/a/src/utils/murmur3.c ++++ b/b/src/utils/murmur3.c +@@ -7,7 +7,7 @@ + #include "murmur3.h" + #include + +-#if !defined(__x86_64__) || defined(IW_TESTS) ++#if !defined(IW64) || defined(IW_TESTS) + + IW_INLINE uint32_t rotl32(uint32_t x, int8_t r) { + return (x << r) | (x >> (32 - r)); +@@ -22,10 +22,28 @@ IW_INLINE uint64_t rotl64(uint64_t x, int8_t r) { + #define ROTL32(x, y) rotl32(x, y) + #define ROTL64(x, y) rotl64(x, y) + ++IW_INLINE uint32_t getblock32 (const uint32_t * p, size_t i) ++{ ++#ifndef IW_BIGENDIAN ++ return p[i]; ++#else ++ return IW_SWAB32(p[i]); ++#endif ++} ++ ++IW_INLINE uint64_t getblock64 (const uint64_t * p, size_t i) ++{ ++#ifndef IW_BIGENDIAN ++ return p[i]; ++#else ++ return IW_SWAB64(p[i]); ++#endif ++} ++ + static uint32_t seed_value = 0x2fa1bca; + + // Finalization mix - force all bits of a hash block to avalanche +-#if !defined(__x86_64__) || defined(IW_TESTS) ++#if !defined(IW64) || defined(IW_TESTS) + + IW_INLINE uint32_t fmix32(uint32_t h) { + h ^= h >> 16; +@@ -47,7 +65,7 @@ IW_INLINE uint64_t fmix64(uint64_t k) { + return k; + } + +-#if !defined(__x86_64__) || defined(IW_TESTS) ++#if !defined(IW64) || defined(IW_TESTS) + + void murmur3_x86_32(const void *key, size_t len, uint32_t seed, void *out) { + const uint8_t *data = (const uint8_t*) key; +@@ -59,9 +77,7 @@ void murmur3_x86_32(const void *key, size_t len, uint32_t seed, void *out) { + + const uint32_t *blocks = (const uint32_t*) (data + nblocks * 4); + for (i = -nblocks; i; i++) { +- uint32_t k1; +- +- memcpy(&k1, blocks + i, sizeof(k1)); ++ uint32_t k1 = getblock32(blocks, i); + + k1 *= c1; + k1 = ROTL32(k1, 15); +@@ -113,12 +129,10 @@ void murmur3_x86_128(const void *key, const size_t len, uint32_t seed, void *out + const uint32_t *blocks = (const uint32_t*) (data + nblocks * 16); + + for (i = -nblocks; i; i++) { +- uint32_t k1, k2, k3, k4; +- +- memcpy(&k1, blocks + i * 4 + 0, sizeof(k1)); +- memcpy(&k2, blocks + i * 4 + 1, sizeof(k2)); +- memcpy(&k3, blocks + i * 4 + 2, sizeof(k3)); +- memcpy(&k4, blocks + i * 4 + 3, sizeof(k4)); ++ uint32_t k1 = getblock32(blocks, i * 4 + 0); ++ uint32_t k2 = getblock32(blocks, i * 4 + 1); ++ uint32_t k3 = getblock32(blocks, i * 4 + 2); ++ uint32_t k4 = getblock32(blocks, i * 4 + 3); + + k1 *= c1; + k1 = ROTL32(k1, 15); +@@ -264,10 +278,8 @@ void murmur3_x64_128(const void *key, const size_t len, const uint32_t seed, voi + + const uint64_t *blocks = (const uint64_t*) (data); + for (i = 0; i < nblocks; i++) { +- uint64_t k1, k2; +- +- memcpy(&k1, blocks + i * 2 + 0, sizeof(k1)); +- memcpy(&k2, blocks + i * 2 + 1, sizeof(k2)); ++ uint64_t k1 = getblock64(blocks, i * 2 + 0); ++ uint64_t k2 = getblock64(blocks, i * 2 + 1); + + k1 *= c1; + k1 = ROTL64(k1, 31); +@@ -358,7 +370,7 @@ void murmur3_x64_128(const void *key, const size_t len, const uint32_t seed, voi + } + + uint32_t murmur3(const char *keyptr, size_t len) { +-#ifdef __x86_64__ ++#ifdef IW_64 + uint64_t hash[2]; + murmur3_x64_128(keyptr, len, seed_value, hash); + return (uint32_t) hash[1]; diff --git a/recipes/iowow/all/patches/1.4.16-0002-fix-uint64_t-format.patch b/recipes/iowow/all/patches/1.4.16-0002-fix-uint64_t-format.patch new file mode 100644 index 00000000000000..82d76f00b56a7a --- /dev/null +++ b/recipes/iowow/all/patches/1.4.16-0002-fix-uint64_t-format.patch @@ -0,0 +1,13 @@ +diff --git a/a/src/fs/iwfsmfile.c b/b/src/fs/iwfsmfile.c +index 75cc4d5..6ee3f7e 100644 +--- a/a/src/fs/iwfsmfile.c ++++ b/b/src/fs/iwfsmfile.c +@@ -1338,7 +1338,7 @@ static iwrc _fsm_read_meta_lr(struct fsm *fsm) { + fsm->bmlen = llv; + if (llv & (64 - 1)) { + rc = IWFS_ERROR_INVALID_FILEMETA; +- iwlog_ecode_error(rc, "Free-space bitmap length is not 64bit aligned: %" PRIuMAX "", fsm->bmlen); ++ iwlog_ecode_error(rc, "Free-space bitmap length is not 64bit aligned: %" PRIx64 "", fsm->bmlen); + } + rp += sizeof(llv); + diff --git a/recipes/iowow/all/test_package/CMakeLists.txt b/recipes/iowow/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..9e0ebfd3d59d1a --- /dev/null +++ b/recipes/iowow/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(iowow REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE iowow::iowow) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/iowow/all/test_package/conanfile.py b/recipes/iowow/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/iowow/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/iowow/all/test_package/test_package.c b/recipes/iowow/all/test_package/test_package.c new file mode 100644 index 00000000000000..2ee836be4e2af0 --- /dev/null +++ b/recipes/iowow/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include "iowow/iwkv.h" + +int main() { + IWKV_OPTS opts = { + .path = "example1.db", + .oflags = IWKV_TRUNC // Cleanup database before open + }; + IWKV iwkv; + iwrc rc = iwkv_open(&opts, &iwkv); + + iwkv_close(&iwkv); + + return 0; +} diff --git a/recipes/iowow/config.yml b/recipes/iowow/config.yml new file mode 100644 index 00000000000000..764e66b7855a67 --- /dev/null +++ b/recipes/iowow/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.17": + folder: all + "1.4.16": + folder: all diff --git a/recipes/iqa/all/CMakeLists.txt b/recipes/iqa/all/CMakeLists.txt index 04c167a387fc10..6b7355d4159537 100644 --- a/recipes/iqa/all/CMakeLists.txt +++ b/recipes/iqa/all/CMakeLists.txt @@ -1,22 +1,16 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.12) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup() - if(MSVC AND BUILD_SHARED_LIBS) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() -file(GLOB IQA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/source/*.c) -file(GLOB IQA_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/include/*.h) +file(GLOB IQA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/source/*.c) +file(GLOB IQA_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/include/*.h) add_library(iqa ${IQA_SOURCES}) -target_include_directories(iqa PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/include) +target_include_directories(iqa PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/include) -install(TARGETS iqa - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin -) +include(GNUInstallDirs) +install(TARGETS iqa) install(FILES ${IQA_HEADERS} DESTINATION include) diff --git a/recipes/iqa/all/conanfile.py b/recipes/iqa/all/conanfile.py index 1f64617c876763..5fed7c16effcfd 100644 --- a/recipes/iqa/all/conanfile.py +++ b/recipes/iqa/all/conanfile.py @@ -1,16 +1,22 @@ import os -import glob -from conans import ConanFile, CMake, tools + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, save + +required_conan_version = ">=1.53.0" class IqaConan(ConanFile): name = "iqa" description = "Image Quality Analysis Library" license = "BSD-3-Clause" - topics = ("conan", "iqa", "image", "quality", "analysis") - homepage = "https://github.com/tjdistler/iqa" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/tjdistler/iqa" + topics = ("image", "quality", "analysis") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -19,18 +25,9 @@ class IqaConan(ConanFile): "shared": False, "fPIC": True, } - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -38,40 +35,38 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + 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") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob('iqa-*/')[0] - os.rename(extracted_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.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) cmake.build() def _extract_license(self): - content_lines = open(os.path.join(self._source_subfolder, "include", "iqa.h")).readlines() + content_lines = open(os.path.join(self.source_folder, "include", "iqa.h")).readlines() license_content = [] for i in range(1, 31): license_content.append(content_lines[i][3:-1]) - tools.save("LICENSE", "\n".join(license_content)) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), "\n".join(license_content)) def package(self): - cmake = self._configure_cmake() - cmake.install() self._extract_license() - self.copy("LICENSE", dst="licenses") + cmake = CMake(self) + cmake.install() def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.settings.os == "Linux": self.cpp_info.system_libs = ["m"] diff --git a/recipes/iqa/all/test_package/CMakeLists.txt b/recipes/iqa/all/test_package/CMakeLists.txt index 094a38e418f47a..54014934310409 100644 --- a/recipes/iqa/all/test_package/CMakeLists.txt +++ b/recipes/iqa/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(iqa REQUIRED CONFIG) add_executable(test_package test_package.c) -target_link_libraries(test_package ${CONAN_LIBS}) +target_link_libraries(test_package PRIVATE iqa::iqa) diff --git a/recipes/iqa/all/test_package/conanfile.py b/recipes/iqa/all/test_package/conanfile.py index 02bdaace3b783f..ef5d7042163ecc 100644 --- a/recipes/iqa/all/test_package/conanfile.py +++ b/recipes/iqa/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 TestConan(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) @@ -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/iqa/all/test_v1_package/CMakeLists.txt b/recipes/iqa/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/iqa/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/iqa/all/test_v1_package/conanfile.py b/recipes/iqa/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..54e4743603cf39 --- /dev/null +++ b/recipes/iqa/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) + 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/isa-l/all/conanfile.py b/recipes/isa-l/all/conanfile.py index 56f45edf048a41..09af37c4cc9004 100644 --- a/recipes/isa-l/all/conanfile.py +++ b/recipes/isa-l/all/conanfile.py @@ -1,17 +1,24 @@ -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.env import VirtualBuildEnv +from conan.tools.files import chdir, collect_libs, copy, get, replace_in_file +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.53.0" + class LibisalConan(ConanFile): name = "isa-l" description = "Intel's Intelligent Storage Acceleration Library" - license = "BSD-3" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/intel/isa-l" - topics = ("isa-l", "compression") + topics = "compression" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -19,54 +26,82 @@ class LibisalConan(ConanFile): } default_options = { "shared": False, - "fPIC" :True + "fPIC": True, } - build_requires = ( - "libtool/2.4.6", - "nasm/2.15.05", - ) - - @property - def _source_subfolder(self): - return "source_subfolder" - def validate(self): - if self.settings.arch not in [ "x86", "x86_64", "armv8" ]: - raise ConanInvalidConfiguration("CPU Architecture not supported") - if self.settings.os not in ["Linux", "FreeBSD"]: - raise ConanInvalidConfiguration("Only Linux and FreeBSD builds are supported") + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC 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") if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.settings.arch} architecture is not supported") + if self.version == "2.30.0" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration(f"Version {self.version} does not support armv8") + + def build_requirements(self): + self.tool_requires("nasm/2.15.05") + if self.settings.os != "Windows": + self.tool_requires("libtool/2.4.7") 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) + # ./configure bugs out if $AS executable has an absolute path + env = tc.environment() + env.define("AS", "nasm") + tc.generate(env) def build(self): - with tools.chdir(self._source_subfolder): - self.run("./autogen.sh") - env_build = AutoToolsBuildEnvironment(self) - extra_args = list() - if self.options.shared: - extra_args.extend(('--enable-static=no',)) + with chdir(self, self.source_folder): + if is_msvc(self): + replace_in_file(self, "Makefile.nmake", + " static" if self.options.shared else " dll", "") + self.run("nmake /f Makefile.nmake") else: - extra_args.extend(('--enable-shared=no',)) - env_build.configure(".", args=extra_args, build=False, host=False, target=False) - env_build.make() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("*/isa-l.h", dst="include/isa-l", keep_path=False) - self.copy("*.h", dst="include/isa-l", src="%s/include" % (self._source_subfolder) , keep_path=False) - if self.options.shared: - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.so*", dst="lib", keep_path=False, symlinks=True) - self.copy("*.dylib", dst="lib", keep_path=False) - else: - self.copy("*.a", dst="lib", keep_path=False) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*/isa-l.h", + dst=os.path.join(self.package_folder, "include/isa-l"), + src=self.source_folder, + keep_path=False) + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include/isa-l"), + src=os.path.join(self.source_folder, "include"), + keep_path=False) + copy(self, "*.dll", + dst=os.path.join(self.package_folder, "bin"), + src=self.source_folder, + keep_path=False) + for pattern in ["*.so*", "*.dylib", "*.lib", "*.a"]: + copy(self, pattern, + dst=os.path.join(self.package_folder, "lib"), + src=self.source_folder, + keep_path=False) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) diff --git a/recipes/isa-l/all/test_package/CMakeLists.txt b/recipes/isa-l/all/test_package/CMakeLists.txt index 196188113685c8..9e88b9de0b7095 100644 --- a/recipes/isa-l/all/test_package/CMakeLists.txt +++ b/recipes/isa-l/all/test_package/CMakeLists.txt @@ -1,8 +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(isa-l REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE isa-l::isa-l) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/isa-l/all/test_package/conanfile.py b/recipes/isa-l/all/test_package/conanfile.py index e1f2192537436a..ef5d7042163ecc 100644 --- a/recipes/isa-l/all/test_package/conanfile.py +++ b/recipes/isa-l/all/test_package/conanfile.py @@ -1,16 +1,19 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from conans import ConanFile, CMake, tools, RunEnvironment -from conan.tools.build import cross_building +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -import subprocess -import re 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) @@ -18,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/isa-l/all/test_v1_package/CMakeLists.txt b/recipes/isa-l/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/isa-l/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/isa-l/all/test_v1_package/conanfile.py b/recipes/isa-l/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..9d2678d8486a0e --- /dev/null +++ b/recipes/isa-l/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from conans import ConanFile, CMake, tools, RunEnvironment +from conan.tools.build import cross_building +import os +import subprocess +import re + + +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/itk/all/CMakeLists.txt b/recipes/itk/all/CMakeLists.txt deleted file mode 100644 index 7ae2d73951a0de..00000000000000 --- a/recipes/itk/all/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 3.10.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -# conan created FindXXX.cmake modules that create IMPORTED targets -# that not have the GLOBAL option set. By requiring them here, -# these targets are visible in all the subprojects. -file(GLOB conan_modules "Find*.cmake") -message("modules: ${conan_modules}") -foreach(module ${conan_modules}) - get_filename_component(modname "${module}" NAME) - string(REGEX MATCH "^Find(.*).cmake$" modmatch "${modname}") - if(NOT modmatch) - message(FATAL_ERROR "Not a module?? ${module} (${modname})") - endif() - message(STATUS "requiring package ${CMAKE_MATCH_1}") - find_package("${CMAKE_MATCH_1}" REQUIRED) -endforeach() - -add_subdirectory(source_subfolder) diff --git a/recipes/itk/all/conan_cmake_project_include.cmake b/recipes/itk/all/conan_cmake_project_include.cmake new file mode 100644 index 00000000000000..1583596ab78787 --- /dev/null +++ b/recipes/itk/all/conan_cmake_project_include.cmake @@ -0,0 +1,8 @@ +find_package(double-conversion REQUIRED CONFIG) +find_package(Eigen3 REQUIRED CONFIG) +find_package(EXPAT REQUIRED MODULE) +find_package(JPEG REQUIRED CONFIG) +find_package(OpenJPEG REQUIRED CONFIG) +find_package(PNG REQUIRED) +find_package(TIFF REQUIRED) +find_package(ZLIB REQUIRED) diff --git a/recipes/itk/all/conandata.yml b/recipes/itk/all/conandata.yml index 3cb9b81826a595..9e7f86e6f5246c 100644 --- a/recipes/itk/all/conandata.yml +++ b/recipes/itk/all/conandata.yml @@ -8,7 +8,9 @@ sources: patches: "5.1.2": - patch_file: "patches/0001-find-conan-packages.patch" - base_path: "source_subfolder" + patch_description: "inject thirdparties from conan" + patch_type: "conan" "5.1.0": - patch_file: "patches/0001-find-conan-packages.patch" - base_path: "source_subfolder" + patch_description: "inject thirdparties from conan" + patch_type: "conan" diff --git a/recipes/itk/all/conanfile.py b/recipes/itk/all/conanfile.py index 3c833fb68b4469..c9a9ded1e49f49 100644 --- a/recipes/itk/all/conanfile.py +++ b/recipes/itk/all/conanfile.py @@ -1,20 +1,25 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +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, rmdir, save +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import glob import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class ITKConan(ConanFile): name = "itk" - topics = ("itk", "scientific", "image", "processing") - homepage = "http://www.itk.org/" - url = "https://github.com/conan-io/conan-center-index" + description = "Open-source, cross-platform toolkit for N-dimensional scientific image processing, segmentation, and registration" license = "Apache-2.0" - description = "Insight Segmentation and Registration Toolkit" - + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.itk.org/" + topics = ("medical-imaging", "scientific", "image", "processing") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,26 +31,23 @@ class ITKConan(ConanFile): } short_paths = True - generators = "cmake", "cmake_find_package" - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 @property - def _build_subfolder(self): - return "build_subfolder" - - # TODO: Some packages can be added as optional, but they are not in CCI: - # - mkl - # - vtk - # - opencv + def _compilers_minimum_version(self): + return { + "Visual Studio": "14", + "gcc": "4.8.1", + "clang": "3.3", + "apple-clang": "9", + } 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, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -53,250 +55,222 @@ 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("dcmtk/3.6.6") - self.requires("double-conversion/3.2.0") + # TODO: Some packages can be added as optional, but they are not in CCI: + # - mkl + # - vtk + # - opencv + #todo: enable after fixing dcmtk compatibility with openssl on Windows + #self.requires("dcmtk/3.6.7") + self.requires("double-conversion/3.3.0") self.requires("eigen/3.4.0") - self.requires("expat/2.4.8") - self.requires("fftw/3.3.9") - self.requires("gdcm/3.0.9") - self.requires("hdf5/1.12.0") - self.requires("icu/71.1") # TODO: to remove? Seems to be a transitivie dependency through dcmtk - self.requires("libjpeg/9d") - self.requires("libpng/1.6.37") - self.requires("libtiff/4.3.0") - self.requires("openjpeg/2.4.0") - self.requires("onetbb/2020.3") - self.requires("zlib/1.2.12") - - @property - def _minimum_cpp_standard(self): - return 11 - - @property - def _minimum_compilers_version(self): - return { - "Visual Studio": "14", - "gcc": "4.8.1", - "clang": "3.3", - "apple-clang": "9", - } + self.requires("expat/2.5.0") + self.requires("fftw/3.3.10") + self.requires("gdcm/3.0.21") + self.requires("hdf5/1.14.1") + self.requires("libjpeg/9e") + self.requires("libpng/1.6.40") + self.requires("libtiff/4.5.1") + self.requires("openjpeg/2.5.0") + self.requires("onetbb/2021.9.0") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): - if self.options.shared and not self.options["hdf5"].shared: + if self.options.shared and not self.dependencies["hdf5"].options.shared: raise ConanInvalidConfiguration("When building a shared itk, hdf5 needs to be shared too (or not linked to by the consumer).\n" "This is because H5::DataSpace::ALL might get initialized twice, which will cause a H5::DataSpaceIException to be thrown).") - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if not min_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) - else: - if tools.Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( - self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) - + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 190) + 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): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["BUILD_EXAMPLES"] = False - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["BUILD_DOCUMENTATION"] = False - self._cmake.definitions["ITK_SKIP_PATH_LENGTH_CHECKS"] = True - - self._cmake.definitions["ITK_USE_SYSTEM_LIBRARIES"] = True - self._cmake.definitions["ITK_USE_SYSTEM_DCMTK"] = True - self._cmake.definitions["ITK_USE_SYSTEM_DOUBLECONVERSION"] = True - self._cmake.definitions["ITK_USE_SYSTEM_EIGEN"] = True - self._cmake.definitions["ITK_USE_SYSTEM_FFTW"] = True - self._cmake.definitions["ITK_USE_SYSTEM_GDCM"] = True - self._cmake.definitions["ITK_USE_SYSTEM_HDF5"] = True - self._cmake.definitions["ITK_USE_SYSTEM_ICU"] = True - self._cmake.definitions["ITK_USE_SYSTEM_JPEG"] = True - self._cmake.definitions["ITK_USE_SYSTEM_PNG"] = True - self._cmake.definitions["ITK_USE_SYSTEM_TIFF"] = True - self._cmake.definitions["ITK_USE_SYSTEM_ZLIB"] = True + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + #call find_package on top level + tc.cache_variables["CMAKE_PROJECT_ITK_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["ITK_SKIP_PATH_LENGTH_CHECKS"] = True + + tc.variables["ITK_USE_SYSTEM_LIBRARIES"] = True + tc.variables["ITK_USE_SYSTEM_DCMTK"] = True + tc.variables["ITK_USE_SYSTEM_DOUBLECONVERSION"] = True + tc.variables["ITK_USE_SYSTEM_EIGEN"] = True + tc.variables["ITK_USE_SYSTEM_FFTW"] = True + tc.variables["ITK_USE_SYSTEM_GDCM"] = True + tc.variables["ITK_USE_SYSTEM_HDF5"] = True + tc.variables["ITK_USE_SYSTEM_ICU"] = True + tc.variables["ITK_USE_SYSTEM_JPEG"] = True + tc.variables["ITK_USE_SYSTEM_PNG"] = True + tc.variables["ITK_USE_SYSTEM_TIFF"] = True + tc.variables["ITK_USE_SYSTEM_ZLIB"] = True # FIXME: Missing Kwiml recipe - self._cmake.definitions["ITK_USE_SYSTEM_KWIML"] = False + tc.variables["ITK_USE_SYSTEM_KWIML"] = False # FIXME: Missing VXL recipe - self._cmake.definitions["ITK_USE_SYSTEM_VXL"] = False - self._cmake.definitions["GDCM_USE_SYSTEM_OPENJPEG"] = True - - self._cmake.definitions["ITK_BUILD_DEFAULT_MODULES"] = False - self._cmake.definitions["Module_ITKDeprecated"] = False - self._cmake.definitions["Module_ITKMINC"] = False - self._cmake.definitions["Module_ITKIOMINC"] = False - - self._cmake.definitions["Module_ITKVideoBridgeOpenCV"] = False - - self._cmake.definitions["Module_ITKDCMTK"] = True - self._cmake.definitions["Module_ITKIODCMTK"] = True - self._cmake.definitions["Module_ITKIOHDF5"] = True - self._cmake.definitions["Module_ITKIOTransformHDF5"] = False - self._cmake.definitions["Module_ITKAnisotropicSmoothing"] = True - self._cmake.definitions["Module_ITKAntiAlias"] = True - self._cmake.definitions["Module_ITKBiasCorrection"] = True - self._cmake.definitions["Module_ITKBinaryMathematicalMorphology"] = True - self._cmake.definitions["Module_ITKBioCell"] = True - self._cmake.definitions["Module_ITKClassifiers"] = True - self._cmake.definitions["Module_ITKColormap"] = True - self._cmake.definitions["Module_ITKConnectedComponents"] = True - self._cmake.definitions["Module_ITKConvolution"] = True - self._cmake.definitions["Module_ITKCurvatureFlow"] = True - self._cmake.definitions["Module_ITKDeconvolution"] = True - self._cmake.definitions["Module_ITKDeformableMesh"] = True - self._cmake.definitions["Module_ITKDenoising"] = True - self._cmake.definitions["Module_ITKDiffusionTensorImage"] = True - self._cmake.definitions["Module_ITKDisplacementField"] = True - self._cmake.definitions["Module_ITKDistanceMap"] = True - self._cmake.definitions["Module_ITKEigen"] = True - self._cmake.definitions["Module_ITKFEM"] = True - self._cmake.definitions["Module_ITKFEMRegistration"] = True - self._cmake.definitions["Module_ITKFFT"] = True - self._cmake.definitions["Module_ITKFastMarching"] = True - self._cmake.definitions["Module_ITKGIFTI"] = True - self._cmake.definitions["Module_ITKGPUAnisotropicSmoothing"] = True - self._cmake.definitions["Module_ITKGPUImageFilterBase"] = True - self._cmake.definitions["Module_ITKGPUPDEDeformableRegistration"] = True - self._cmake.definitions["Module_ITKGPURegistrationCommon"] = True - self._cmake.definitions["Module_ITKGPUSmoothing"] = True - self._cmake.definitions["Module_ITKGPUThresholding"] = True - self._cmake.definitions["Module_ITKIOCSV"] = True - self._cmake.definitions["Module_ITKIOGE"] = True - self._cmake.definitions["Module_ITKIOIPL"] = True - self._cmake.definitions["Module_ITKIOMesh"] = True - self._cmake.definitions["Module_ITKIOPhilipsREC"] = True - self._cmake.definitions["Module_ITKIORAW"] = True - self._cmake.definitions["Module_ITKIOSiemens"] = True - self._cmake.definitions["Module_ITKIOSpatialObjects"] = True - self._cmake.definitions["Module_ITKIOTransformBase"] = True - self._cmake.definitions["Module_ITKIOTransformInsightLegacy"] = True - self._cmake.definitions["Module_ITKIOTransformMatlab"] = True - self._cmake.definitions["Module_ITKIOXML"] = True - self._cmake.definitions["Module_ITKImageCompare"] = True - self._cmake.definitions["Module_ITKImageCompose"] = True - self._cmake.definitions["Module_ITKImageFeature"] = True - self._cmake.definitions["Module_ITKImageFusion"] = True - self._cmake.definitions["Module_ITKImageGradient"] = True - self._cmake.definitions["Module_ITKImageGrid"] = True - self._cmake.definitions["Module_ITKImageIntensity"] = True - self._cmake.definitions["Module_ITKImageLabel"] = True - self._cmake.definitions["Module_ITKImageSources"] = True - self._cmake.definitions["Module_ITKImageStatistics"] = True - self._cmake.definitions["Module_ITKIntegratedTest"] = True - self._cmake.definitions["Module_ITKKLMRegionGrowing"] = True - self._cmake.definitions["Module_ITKLabelMap"] = True - self._cmake.definitions["Module_ITKLabelVoting"] = True - self._cmake.definitions["Module_ITKLevelSets"] = True - self._cmake.definitions["Module_ITKLevelSetsv4"] = True - self._cmake.definitions["Module_ITKMarkovRandomFieldsClassifiers"] = True - self._cmake.definitions["Module_ITKMathematicalMorphology"] = True - self._cmake.definitions["Module_ITKMetricsv4"] = True - self._cmake.definitions["Module_ITKNarrowBand"] = True - self._cmake.definitions["Module_ITKNeuralNetworks"] = True - self._cmake.definitions["Module_ITKOptimizers"] = True - self._cmake.definitions["Module_ITKOptimizersv4"] = True - self._cmake.definitions["Module_ITKPDEDeformableRegistration"] = True - self._cmake.definitions["Module_ITKPath"] = True - self._cmake.definitions["Module_ITKPolynomials"] = True - self._cmake.definitions["Module_ITKQuadEdgeMeshFiltering"] = True - self._cmake.definitions["Module_ITKRegionGrowing"] = True - self._cmake.definitions["Module_ITKRegistrationCommon"] = True - self._cmake.definitions["Module_ITKRegistrationMethodsv4"] = True - self._cmake.definitions["Module_ITKReview"] = True - self._cmake.definitions["Module_ITKSignedDistanceFunction"] = True - self._cmake.definitions["Module_ITKSmoothing"] = True - self._cmake.definitions["Module_ITKSpatialFunction"] = True - self._cmake.definitions["Module_ITKTBB"] = True - self._cmake.definitions["Module_ITKThresholding"] = True - self._cmake.definitions["Module_ITKVideoCore"] = True - self._cmake.definitions["Module_ITKVideoFiltering"] = True - self._cmake.definitions["Module_ITKVideoIO"] = False - self._cmake.definitions["Module_ITKVoronoi"] = True - self._cmake.definitions["Module_ITKWatersheds"] = True - self._cmake.definitions["Module_ITKDICOMParser"] = True - - self._cmake.definitions["Module_ITKVTK"] = False - self._cmake.definitions["Module_ITKVtkGlue"] = False + tc.variables["ITK_USE_SYSTEM_VXL"] = False + tc.variables["GDCM_USE_SYSTEM_OPENJPEG"] = True + + tc.variables["ITK_BUILD_DEFAULT_MODULES"] = False + tc.variables["Module_ITKDeprecated"] = False + tc.variables["Module_ITKMINC"] = False + tc.variables["Module_ITKIOMINC"] = False + + tc.variables["Module_ITKVideoBridgeOpenCV"] = False + + #todo: enable after fixing dcmtk compatibility with openssl on Windows + tc.variables["Module_ITKDCMTK"] = False + tc.variables["Module_ITKIODCMTK"] = False + + tc.variables["Module_ITKIOHDF5"] = True + tc.variables["Module_ITKIOTransformHDF5"] = False + tc.variables["Module_ITKAnisotropicSmoothing"] = True + tc.variables["Module_ITKAntiAlias"] = True + tc.variables["Module_ITKBiasCorrection"] = True + tc.variables["Module_ITKBinaryMathematicalMorphology"] = True + tc.variables["Module_ITKBioCell"] = True + tc.variables["Module_ITKClassifiers"] = True + tc.variables["Module_ITKColormap"] = True + tc.variables["Module_ITKConnectedComponents"] = True + tc.variables["Module_ITKConvolution"] = True + tc.variables["Module_ITKCurvatureFlow"] = True + tc.variables["Module_ITKDeconvolution"] = True + tc.variables["Module_ITKDeformableMesh"] = True + tc.variables["Module_ITKDenoising"] = True + tc.variables["Module_ITKDiffusionTensorImage"] = True + tc.variables["Module_ITKDisplacementField"] = True + tc.variables["Module_ITKDistanceMap"] = True + tc.variables["Module_ITKEigen"] = True + tc.variables["Module_ITKFEM"] = True + tc.variables["Module_ITKFEMRegistration"] = True + tc.variables["Module_ITKFFT"] = True + tc.variables["Module_ITKFastMarching"] = True + tc.variables["Module_ITKGIFTI"] = True + tc.variables["Module_ITKGPUAnisotropicSmoothing"] = True + tc.variables["Module_ITKGPUImageFilterBase"] = True + tc.variables["Module_ITKGPUPDEDeformableRegistration"] = True + tc.variables["Module_ITKGPURegistrationCommon"] = True + tc.variables["Module_ITKGPUSmoothing"] = True + tc.variables["Module_ITKGPUThresholding"] = True + tc.variables["Module_ITKIOCSV"] = True + tc.variables["Module_ITKIOGE"] = True + tc.variables["Module_ITKIOIPL"] = True + tc.variables["Module_ITKIOMesh"] = True + tc.variables["Module_ITKIOPhilipsREC"] = True + tc.variables["Module_ITKIORAW"] = True + tc.variables["Module_ITKIOSiemens"] = True + tc.variables["Module_ITKIOSpatialObjects"] = True + tc.variables["Module_ITKIOTransformBase"] = True + tc.variables["Module_ITKIOTransformInsightLegacy"] = True + tc.variables["Module_ITKIOTransformMatlab"] = True + tc.variables["Module_ITKIOXML"] = True + tc.variables["Module_ITKImageCompare"] = True + tc.variables["Module_ITKImageCompose"] = True + tc.variables["Module_ITKImageFeature"] = True + tc.variables["Module_ITKImageFusion"] = True + tc.variables["Module_ITKImageGradient"] = True + tc.variables["Module_ITKImageGrid"] = True + tc.variables["Module_ITKImageIntensity"] = True + tc.variables["Module_ITKImageLabel"] = True + tc.variables["Module_ITKImageSources"] = True + tc.variables["Module_ITKImageStatistics"] = True + tc.variables["Module_ITKIntegratedTest"] = True + tc.variables["Module_ITKKLMRegionGrowing"] = True + tc.variables["Module_ITKLabelMap"] = True + tc.variables["Module_ITKLabelVoting"] = True + tc.variables["Module_ITKLevelSets"] = True + tc.variables["Module_ITKLevelSetsv4"] = True + tc.variables["Module_ITKMarkovRandomFieldsClassifiers"] = True + tc.variables["Module_ITKMathematicalMorphology"] = True + tc.variables["Module_ITKMetricsv4"] = True + tc.variables["Module_ITKNarrowBand"] = True + tc.variables["Module_ITKNeuralNetworks"] = True + tc.variables["Module_ITKOptimizers"] = True + tc.variables["Module_ITKOptimizersv4"] = True + tc.variables["Module_ITKPDEDeformableRegistration"] = True + tc.variables["Module_ITKPath"] = True + tc.variables["Module_ITKPolynomials"] = True + tc.variables["Module_ITKQuadEdgeMeshFiltering"] = True + tc.variables["Module_ITKRegionGrowing"] = True + tc.variables["Module_ITKRegistrationCommon"] = True + tc.variables["Module_ITKRegistrationMethodsv4"] = True + tc.variables["Module_ITKReview"] = True + tc.variables["Module_ITKSignedDistanceFunction"] = True + tc.variables["Module_ITKSmoothing"] = True + tc.variables["Module_ITKSpatialFunction"] = True + tc.variables["Module_ITKTBB"] = True + tc.variables["Module_ITKThresholding"] = True + tc.variables["Module_ITKVideoCore"] = True + tc.variables["Module_ITKVideoFiltering"] = True + tc.variables["Module_ITKVideoIO"] = False + tc.variables["Module_ITKVoronoi"] = True + tc.variables["Module_ITKWatersheds"] = True + tc.variables["Module_ITKDICOMParser"] = True + + tc.variables["Module_ITKVTK"] = False + tc.variables["Module_ITKVtkGlue"] = False # Disabled on Linux (link errors) - self._cmake.definitions["Module_ITKLevelSetsv4Visualization"] = False + tc.variables["Module_ITKLevelSetsv4Visualization"] = False # Disabled because Vxl vidl is not built anymore - self._cmake.definitions["Module_ITKVideoBridgeVXL"] = False + tc.variables["Module_ITKVideoBridgeVXL"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + #The CMake policy CMP0091 must be NEW, but is '' + replace_in_file(self, + os.path.join(self.source_folder, "Modules", "ThirdParty", "VNL", "src", "vxl", "config", "cmake", "config", "VXLIntrospectionConfig.cmake"), + "-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}", + "-DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() - def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, self._cmake_module_dir, "Modules")) - # Do not remove UseITK.cmake and *.h.in files - for cmake_file in glob.glob(os.path.join(self.package_folder, self._cmake_module_dir, "*.cmake")): - if os.path.basename(cmake_file) != "UseITK.cmake": - os.remove(cmake_file) - - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {target:"ITK::{}".format(target) for target in self._itk_components.keys()}, - ) - - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): - content = "" - for alias, aliased in targets.items(): - content += textwrap.dedent("""\ - 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) - @property - def _module_file_rel_path(self): - return os.path.join(self._cmake_module_dir, "conan-official-{}-targets.cmake".format(self.name)) + def _itk_subdir(self): + v = Version(self.version) + return f"ITK-{v.major}.{v.minor}" @property def _cmake_module_dir(self): return os.path.join("lib", "cmake", self._itk_subdir) @property - def _itk_subdir(self): - v = tools.Version(self.version) - return "ITK-{}.{}".format(v.major, v.minor) + def _module_file_rel_path(self): + return os.path.join(self._cmake_module_dir, f"conan-official-{self.name}-targets.cmake") @property def _itk_components(self): def libm(): return ["m"] if self.settings.os in ["Linux", "FreeBSD"] else [] + def libdl(): + return ["dl"] if self.settings.os in ["Linux", "FreeBSD"] else [] return { - "itksys": {}, + "itksys": {"system_libs": libdl()}, "itkvcl": {"system_libs": libm()}, "itkv3p_netlib": {"system_libs": libm()}, "itkvnl": {"requires": ["itkvcl"]}, @@ -386,7 +360,8 @@ def libm(): "ITKIOBMP": {"requires": ["ITKIOImageBase"]}, "ITKIOBioRad": {"requires": ["ITKIOImageBase"]}, "ITKIOCSV": {"requires": ["ITKIOImageBase"]}, - "ITKIODCMTK": {"requires": ["ITKIOImageBase", "dcmtk::dcmtk", "icu::icu"]}, + #todo: enable after fixing dcmtk compatibility with openssl on Windows + #"ITKIODCMTK": {"requires": ["ITKIOImageBase", "dcmtk::dcmtk"]}, "ITKIOGDCM": {"requires": ["ITKCommon", "ITKIOImageBase", "gdcm::gdcmDICT", "gdcm::gdcmMSFF"]}, "ITKIOIPL": {"requires": ["ITKIOImageBase"]}, "ITKIOGE": {"requires": ["ITKIOIPL", "ITKIOImageBase"]}, @@ -477,32 +452,58 @@ def libm(): "ITKVideoCore": {"requires": ["ITKCommon"]}, } + def _create_cmake_module_alias_targets(self): + targets = {target:f"ITK::{target}" for target in self._itk_components.keys()} + content = "" + for alias, aliased in targets.items(): + 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() + """) + save(self, os.path.join(self.package_folder, self._module_file_rel_path), content) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(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, self._cmake_module_dir, "Modules")) + # Do not remove UseITK.cmake and *.h.in files + for cmake_file in glob.glob(os.path.join(self.package_folder, self._cmake_module_dir, "*.cmake")): + if os.path.basename(cmake_file) != "UseITK.cmake": + os.remove(cmake_file) + self._create_cmake_module_alias_targets() + def package_info(self): self.cpp_info.set_property("cmake_file_name", "ITK") self.cpp_info.set_property("cmake_build_modules", [os.path.join(self._cmake_module_dir, "UseITK.cmake")]) - itk_version = tools.Version(self.version) - lib_suffix = "-{}.{}".format(itk_version.major, itk_version.minor) + itk_version = Version(self.version) + lib_suffix = f"-{itk_version.major}.{itk_version.minor}" for name, values in self._itk_components.items(): is_header_only = values.get("header_only", False) system_libs = values.get("system_libs", []) requires = values.get("requires", []) self.cpp_info.components[name].set_property("cmake_target_name", name) + self.cpp_info.components[name].set_property("cmake_target_aliases", [f"ITK::{name}"]) self.cpp_info.components[name].builddirs.append(self._cmake_module_dir) self.cpp_info.components[name].includedirs.append(os.path.join("include", self._itk_subdir)) if not is_header_only: - self.cpp_info.components[name].libs = ["{}{}".format(name, lib_suffix)] + self.cpp_info.components[name].libs = [f"{name}{lib_suffix}"] self.cpp_info.components[name].system_libs = system_libs self.cpp_info.components[name].requires = requires # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.components[name].names["cmake_find_package"] = name - self.cpp_info.components[name].names["cmake_find_package_multi"] = name - self.cpp_info.components[name].build_modules.append(os.path.join(self._cmake_module_dir, "UseITK.cmake")) - self.cpp_info.components[name].build_modules["cmake_find_package"].append(self._module_file_rel_path) - self.cpp_info.components[name].build_modules["cmake_find_package_multi"].append(self._module_file_rel_path) + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.components[name].names[generator] = name + self.cpp_info.components[name].build_modules[generator].append(self._module_file_rel_path) + self.cpp_info.components[name].build_modules[generator].append(os.path.join(self._cmake_module_dir, "UseITK.cmake")) # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "ITK" - self.cpp_info.names["cmake_find_package_multi"] = "ITK" + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.names[generator] = "ITK" diff --git a/recipes/itk/all/test_package/CMakeLists.txt b/recipes/itk/all/test_package/CMakeLists.txt index f9c2acebbb0bbc..ad9e58069124d6 100644 --- a/recipes/itk/all/test_package/CMakeLists.txt +++ b/recipes/itk/all/test_package/CMakeLists.txt @@ -1,12 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package CXX) find_package(ITK REQUIRED CONFIG) -find_package(HDF5 COMPONENTS CXX) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ITKCommon hdf5::hdf5_cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE ITKCommon) +#itksys is already linked through dependencies of ITKCommon but we also want to check name alias +target_link_libraries(${PROJECT_NAME} PRIVATE ITK::itksys) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/itk/all/test_package/conanfile.py b/recipes/itk/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/itk/all/test_package/conanfile.py +++ b/recipes/itk/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/itk/all/test_package/test_package.cpp b/recipes/itk/all/test_package/test_package.cpp index ef775457ccc9cb..56077cb584102e 100644 --- a/recipes/itk/all/test_package/test_package.cpp +++ b/recipes/itk/all/test_package/test_package.cpp @@ -1,8 +1,5 @@ #include "itkLightObject.h" -#include -#include - #include class Test : public itk::LightObject { @@ -12,12 +9,9 @@ class Test : public itk::LightObject { const char *GetNameOfClass() { return "Test"; } }; -int main(int, char **) try { - //Test::Pointer test = Test::New(); - //std::cout << test->GetNameOfClass() << std::endl; - return 0; -} catch(const H5::DataSpaceIException &e) { - std::cerr << "CAUGHT\n"; - e.printErrorStack(); +int main(int, char **) +{ + Test::Pointer test = Test::New(); + std::cout << test->GetNameOfClass() << std::endl; return 0; } diff --git a/recipes/itk/all/test_v1_package/CMakeLists.txt b/recipes/itk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/itk/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/itk/all/test_v1_package/conanfile.py b/recipes/itk/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..5a05af3c2dfd2f --- /dev/null +++ b/recipes/itk/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/itlib/all/conandata.yml b/recipes/itlib/all/conandata.yml index 55fc01342577f4..4f1d604b9b789a 100644 --- a/recipes/itlib/all/conandata.yml +++ b/recipes/itlib/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.10.3": + url: "https://github.com/iboB/itlib/archive/v1.10.3.tar.gz" + sha256: "e533c44354d48b2251ca57f1502778033b38170d9d6aba6bb2bbad90f2bf9d27" + "1.10.0": + url: "https://github.com/iboB/itlib/archive/v1.10.0.tar.gz" + sha256: "a97b98514aa7194241383b537c368a01d4a56e05316a94551cd183a986caa9c7" "1.9.2": url: "https://github.com/iboB/itlib/archive/v1.9.2.tar.gz" sha256: "70627c57edff91dfae219e101c0672560f65567272e889f461069c8ea506bef1" @@ -20,18 +26,3 @@ sources: "1.8.0": url: "https://github.com/iboB/itlib/archive/v1.8.0.tar.gz" sha256: "70b6493b0cc3a720ffd48e98e3f009e8d94003380800bf07e61f167e813a9add" - "1.7.0": - url: "https://github.com/iboB/itlib/archive/v1.7.0.tar.gz" - sha256: "9a27138cfa8554eb69436bb1afacfafc5a3888b6e05f9124b2d20da7ab55b723" - "1.6.3": - url: "https://github.com/iboB/itlib/archive/v1.6.3.tar.gz" - sha256: "d2e320d9218269c421407d6df819ca0bfae3ea5bc897b341b9babaedc0b7103f" - "1.5.2": - url: "https://github.com/iboB/itlib/archive/v1.5.2.tar.gz" - sha256: "9ebff09fcdc873d2b01d8a2d0de2a7d7bd11844ef632f80ec5041f78bdc6ddec" - "1.4.5": - url: "https://github.com/iboB/itlib/archive/v1.4.5.tar.gz" - sha256: "f1d3533014433316475b6196cd2b1890bb42db1ae3059616538788712e1a33aa" - "1.3.0": - url: "https://github.com/iboB/itlib/archive/v1.3.0.tar.gz" - sha256: "d3af2ea3cf0dae63fe1e186af79562e584bfb86bf02f358cab9675662fb9b5ef" diff --git a/recipes/itlib/config.yml b/recipes/itlib/config.yml index fa9e9daa2fe0e7..09616d2e081cf7 100644 --- a/recipes/itlib/config.yml +++ b/recipes/itlib/config.yml @@ -1,4 +1,8 @@ versions: + "1.10.3": + folder: all + "1.10.0": + folder: all "1.9.2": folder: all "1.9.1": @@ -13,13 +17,3 @@ versions: folder: all "1.8.0": folder: all - "1.7.0": - folder: all - "1.6.3": - folder: all - "1.5.2": - folder: all - "1.4.5": - folder: all - "1.3.0": - folder: all diff --git a/recipes/ixwebsocket/all/conanfile.py b/recipes/ixwebsocket/all/conanfile.py index c627577a9f00e7..839ba03a95e16f 100644 --- a/recipes/ixwebsocket/all/conanfile.py +++ b/recipes/ixwebsocket/all/conanfile.py @@ -56,9 +56,9 @@ def layout(self): def requirements(self): if self.options.get_safe("with_zlib", True): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.tls == "openssl": - self.requires("openssl/1.1.1s") + self.requires("openssl/1.1.1w") elif self.options.tls == "mbedtls": self.requires("mbedtls/2.25.0") @@ -119,6 +119,10 @@ def _patch_sources(self): replace_in_file(self, cmakelists, "ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}", "ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION bin") + # INFO: IXWebSocketHttpHeaders.cpp consumes WSAEINVAL but there is no winsock2.h included + replace_in_file(self, os.path.join(self.source_folder, "ixwebsocket", "IXWebSocketHttpHeaders.cpp"), '#include "IXSocket.h"', '#include "IXNetSystem.h"\n#include "IXSocket.h"') + # INFO: IXHttpClient.cpp consumes WSAEINVAL but there is no winsock2.h included + replace_in_file(self, os.path.join(self.source_folder, "ixwebsocket", "IXHttpClient.h"), '#include "IXSocket.h"', '#include "IXNetSystem.h"\n#include "IXSocket.h"') def build(self): self._patch_sources() diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index 249c9d8054efc5..6e9ac4e8ea75b2 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.1.0": + url: "https://github.com/jasper-software/jasper/releases/download/version-4.1.0/jasper-4.1.0.tar.gz" + sha256: "ffe1543d87f7ffc5039d2415afd48c314a7cc0b0c750b4982cd881d6ed4b5743" "4.0.0": url: "https://github.com/jasper-software/jasper/releases/download/version-4.0.0/jasper-4.0.0.tar.gz" sha256: "39514e1b53a5333fcff817e19565371f016ea536c36fd2d13a9c4d8da8f0be0c" @@ -9,6 +12,17 @@ sources: url: "https://github.com/jasper-software/jasper/releases/download/version-2.0.33/jasper-2.0.33.tar.gz" sha256: "28d28290cc2eaf70c8756d391ed8bcc8ab809a895b9a67ea6e89da23a611801a" patches: + "4.1.0": + - patch_file: "patches/4.1.0-0001-skip-rpath.patch" + patch_description: "Do not enforce rpath configuration" + patch_source: "https://github.com/jasper-software/jasper/pull/347" + patch_type: "conan" + - patch_file: "patches/4.1.0-0002-find-libjpeg.patch" + patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" + patch_type: "conan" + - patch_file: "patches/4.1.0-0003-deterministic-libname.patch" + patch_description: "No generator dependent libname" + patch_type: "conan" "4.0.0": - patch_file: "patches/4.0.0-0001-skip-rpath.patch" patch_description: "Do not enforce rpath configuration" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 6bc3bfb690d58a..9a1c9b8badf364 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -49,7 +49,7 @@ def requirements(self): if self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.0") elif self.options.with_libjpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") diff --git a/recipes/jasper/all/patches/4.1.0-0001-skip-rpath.patch b/recipes/jasper/all/patches/4.1.0-0001-skip-rpath.patch new file mode 100644 index 00000000000000..9ebb0ac66b98cc --- /dev/null +++ b/recipes/jasper/all/patches/4.1.0-0001-skip-rpath.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ba6f117..6b79a94 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -804,19 +804,19 @@ if(JAS_ENABLE_SHARED) + # (but later on when installing) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") ++# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH +- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) ++# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # The RPATH to be used when installing, but only if it's not a + # system directory + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + if(isSystemDir EQUAL -1) +- set(CMAKE_INSTALL_RPATH +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") ++# set(CMAKE_INSTALL_RPATH ++# "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + endif() + endif() + diff --git a/recipes/jasper/all/patches/4.1.0-0002-find-libjpeg.patch b/recipes/jasper/all/patches/4.1.0-0002-find-libjpeg.patch new file mode 100644 index 00000000000000..05dd6ce68abe8b --- /dev/null +++ b/recipes/jasper/all/patches/4.1.0-0002-find-libjpeg.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6b79a94..86eb065 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -742,13 +742,13 @@ if(JAS_ENABLE_LIBJPEG) + # (e.g., stdio.h and stdint.h). So, we cannot reliably use + # check_include_file here. + jas_get_includes_from_targets(CMAKE_REQUIRED_INCLUDES JPEG::JPEG) +- check_c_source_compiles(" +- #include +- #include +- #include +- int main() {} +- " JAS_HAVE_JPEGLIB_H) +- if(JAS_HAVE_JPEGLIB_H) ++ # check_c_source_compiles(" ++ # #include ++ # #include ++ # #include ++ # int main() {} ++ # " JAS_HAVE_JPEGLIB_H) ++ if(1) + set(JAS_HAVE_LIBJPEG 1) + set(JAS_LIBJPEG_TARGET JPEG::JPEG) + list(APPEND JAS_PKGCONFIG_REQUIRES libjpeg) diff --git a/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch b/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch new file mode 100644 index 00000000000000..0603e4f6650335 --- /dev/null +++ b/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 86eb065..9c2da51 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -274,7 +274,7 @@ endif() + # If a multiconfiguration generator is used, ensure that various output + # files are not placed in subdirectories (such as Debug and Release) + # as this will cause the CTest test suite to fail. +-if(JAS_MULTICONFIGURATION_GENERATOR) ++if(0) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY .) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY .) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY .) diff --git a/recipes/jasper/config.yml b/recipes/jasper/config.yml index 4a60a36eef3ae0..70e516cc72ceb4 100644 --- a/recipes/jasper/config.yml +++ b/recipes/jasper/config.yml @@ -1,4 +1,6 @@ versions: + "4.1.0": + folder: all "4.0.0": folder: all "3.0.6": diff --git a/recipes/jeaiii-itoa/all/conanfile.py b/recipes/jeaiii-itoa/all/conanfile.py index e7cabf3b1a327e..43dfc55725a27d 100644 --- a/recipes/jeaiii-itoa/all/conanfile.py +++ b/recipes/jeaiii-itoa/all/conanfile.py @@ -15,30 +15,26 @@ class ItoaConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jeaiii/itoa/" topics = ("string-conversion", "itona", "integer-conversion",) + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 17 - 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) - def layout(self): basic_layout(self, src_folder="src") def validate(self): if self.settings.compiler.cppstd: - check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._min_cppstd) 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 @@ -49,6 +45,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt b/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt index d27bc00b656155..09813e133a4726 100644 --- a/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt +++ b/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(jeaiii-itoa REQUIRED CONFIG) diff --git a/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt b/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt index f35b931b51133d..b21cc49efde95c 100644 --- a/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt +++ b/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(jeaiii-itoa REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE jeaiii-itoa::jeaiii-itoa) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/jerryscript/all/CMakeLists.txt b/recipes/jerryscript/all/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9a..00000000000000 --- a/recipes/jerryscript/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/jerryscript/all/conandata.yml b/recipes/jerryscript/all/conandata.yml index f587b0a08830d9..466f9de6c36b38 100644 --- a/recipes/jerryscript/all/conandata.yml +++ b/recipes/jerryscript/all/conandata.yml @@ -10,13 +10,9 @@ sources: url: https://github.com/jerryscript-project/jerryscript/archive/v2.4.0.zip patches: "2.2.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-2.3.0-remove-werror.patch" + - patch_file: "patches/0001-2.3.0-remove-werror.patch" "2.3.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-2.3.0-remove-werror.patch" + - patch_file: "patches/0001-2.3.0-remove-werror.patch" "2.4.0": - - base_path: "source_subfolder" - patch_file: "patches/0002-2.4.0-remove-werror.patch" - - base_path: "source_subfolder" - patch_file: "patches/0003-2.4.0-no-CMAKE_SOURCE_DIR.patch" + - patch_file: "patches/0002-2.4.0-remove-werror.patch" + - patch_file: "patches/0003-2.4.0-no-CMAKE_SOURCE_DIR.patch" diff --git a/recipes/jerryscript/all/conanfile.py b/recipes/jerryscript/all/conanfile.py index d7fc6037445eb6..b262445d3a4897 100644 --- a/recipes/jerryscript/all/conanfile.py +++ b/recipes/jerryscript/all/conanfile.py @@ -1,18 +1,26 @@ -from conans import CMake, 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.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + class JerryScriptStackConan(ConanFile): name = "jerryscript" + description = "Ultra-lightweight JavaScript engine for the Internet of Things" license = "Apache-2.0" - homepage = "https://github.com/jerryscript-project/jerryscript" url = "https://github.com/conan-io/conan-center-index" - description = "Ultra-lightweight JavaScript engine for the Internet of Things" - topics = ["javascript", "iot", "jerryscript", "javascript-engine"] - exports_sources = "CMakeLists.txt", "patches/**" - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/jerryscript-project/jerryscript" + topics = ("javascript", "iot", "javascript-engine") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -27,7 +35,7 @@ class JerryScriptStackConan(ConanFile): "amalgamated": [True, False], "debugger": [True, False], "keep_line_info": [True, False], - "profile": "ANY", + "profile": ["ANY"], "promise_callback": [True, False], "external_context": [True, False], "snapshot_execution": [True, False], @@ -39,10 +47,10 @@ class JerryScriptStackConan(ConanFile): "error_messages": [True, False], "logging": [True, False], "memory_statistics": [True, False], - "heap_size": "ANY", - "gc_limit": "ANY", - "gc_mark_limit": "ANY", - "stack_limit": "ANY", + "heap_size": ["ANY"], + "gc_limit": ["ANY"], + "gc_mark_limit": ["ANY"], + "stack_limit": ["ANY"], "cpointer_32_bit": [True, False], "system_allocator": [True, False], "valgrind": [True, False], @@ -85,47 +93,41 @@ class JerryScriptStackConan(ConanFile): "gc_before_each_alloc": False, "vm_exec_stop": False, } - generators = "cmake" - short_paths = True - - _cmake = None - _predefined_profiles = ["es.next", "es5.1", "minimal"] - - @property - def _source_subfolder(self): - return "source_subfolder" @property - def _build_subfolder(self): - return "build_subfolder" + def _predefined_profiles(self): + return ["es.next", "es5.1", "minimal"] @property def _jerry_math(self): return self.options.get_safe("jerry_math", False) + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC # profile and jerry_match default option value depend on version - if tools.Version(self.version) < "2.4.0": + if Version(self.version) < "2.4.0": self.options.profile = "es5.1" self.options.jerry_math = True - if self.settings.compiler == "Visual Studio": + if is_msvc(self): del self.options.jerry_math # forced to False else: self.options.profile = "es.next" self.options.jerry_math = False - if self.settings.os == "Macos": + if is_apple_os(self): del self.options.jerry_math # forced to False del self.options.link_time_optimization # forced to False - del self.options.strip # forced to False + del self.options.strip_symbols # forced to False 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") if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.debugger: del self.options.keep_line_info @@ -133,6 +135,13 @@ def configure(self): if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("jerryscript shared lib is not yet supported under windows") + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.profile not in self._predefined_profiles: + self.info.options.profile = load(self, str(self.info.options.profile)) + def validate(self): # validate integers try: @@ -146,105 +155,107 @@ def validate(self): if not check_res: raise ConanInvalidConfiguration(txt) except ValueError as e: - raise ConanInvalidConfiguration("jerryscript heap size, gc mark limit, stack limit, gc limit should be a positive integer") + raise ConanInvalidConfiguration( + "jerryscript heap size, gc mark limit, stack limit, " + "gc limit should be a positive integer" + ) # validate profile file if self.options.profile not in self._predefined_profiles and not os.path.isfile(str(self.options.profile)): - raise ConanInvalidConfiguration("Invalid profile option. Feature profile must either be a valid file or one of these: es.next, es5.1, minimal") + raise ConanInvalidConfiguration( + "Invalid profile option. " + "Feature profile must either be a valid file or one of these: es.next, es5.1, minimal" + ) # validate the use of the system allocator option if self.settings.arch == "x86_64" and self.options.system_allocator: raise ConanInvalidConfiguration("jerryscript system allocator not available on 64bit systems") if self.options.system_allocator and not self.options.cpointer_32_bit: raise ConanInvalidConfiguration("jerryscript system allocator must be used with 32 bit pointers") - def package_id(self): - if self.options.profile not in self._predefined_profiles: - self.info.options.profile = tools.load(str(self.options.profile)) - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + 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) + def generate(self): + tc = CMakeToolchain(self) amalgamation_definition = "ENABLE_AMALGAM" libmath_definition = "JERRY_MATH" - if tools.Version(self.version) < tools.Version("2.4.0"): + if Version(self.version) < "2.4.0": amalgamation_definition = "ENABLE_ALL_IN_ONE" libmath_definition = "JERRY_LIBM" - self._cmake.definitions["JERRY_CMDLINE"] = self.options.tool_cmdline - self._cmake.definitions["JERRY_CMDLINE_TEST"] = self.options.tool_cmdline_test - self._cmake.definitions["JERRY_CMDLINE_SNAPSHOT"] = self.options.tool_cmdline_snapshot - self._cmake.definitions["JERRY_PORT_DEFAULT"] = self.options.default_port_implementation - self._cmake.definitions["JERRY_EXT"] = self.options.jerry_ext - self._cmake.definitions[libmath_definition] = self._jerry_math - self._cmake.definitions["ENABLE_STRIP"] = self.options.get_safe("jerry_strip", False) - self._cmake.definitions["ENABLE_LTO"] = self.options.get_safe("link_time_optimization", False) - self._cmake.definitions[amalgamation_definition] = self.options.amalgamated - self._cmake.definitions["JERRY_DEBUGGER"] = self.options.debugger - self._cmake.definitions["JERRY_LINE_INFO"] = self.options.get_safe("keep_line_info", False) - self._cmake.definitions["JERRY_PROFILE"] = self.options.profile - self._cmake.definitions["JERRY_EXTERNAL_CONTEXT"] = self.options.external_context - self._cmake.definitions["JERRY_SNAPSHOT_EXEC"] = self.options.snapshot_execution - self._cmake.definitions["JERRY_SNAPSHOT_SAVE"] = self.options.snapshot_saving - self._cmake.definitions["JERRY_PARSER"] = self.options.parser - self._cmake.definitions["JERRY_PARSER_DUMP_BYTE_CODE"] = self.options.enable_dump_bytecode - self._cmake.definitions["JERRY_REGEXP_DUMP_BYTE_CODE"] = self.options.enable_dump_regexp_bytecode - self._cmake.definitions["JERRY_REGEXP_STRICT_MODE"] = self.options.strict_regexp - self._cmake.definitions["JERRY_ERROR_MESSAGES"] = self.options.error_messages - self._cmake.definitions["JERRY_LOGGING"] = self.options.logging - self._cmake.definitions["JERRY_MEM_STATS"] = self.options.memory_statistics - self._cmake.definitions["JERRY_GLOBAL_HEAP_SIZE"] = "(%s)" % self.options.heap_size - self._cmake.definitions["JERRY_GC_LIMIT"] = "(%s)" % self.options.gc_limit - self._cmake.definitions["JERRY_GC_MARK_LIMIT"] = "(%s)" % self.options.gc_mark_limit - self._cmake.definitions["JERRY_STACK_LIMIT"] = "(%s)" % self.options.stack_limit - self._cmake.definitions["JERRY_CPOINTER_32_BIT"] = self.options.cpointer_32_bit - self._cmake.definitions["JERRY_SYSTEM_ALLOCATOR"] = self.options.system_allocator - self._cmake.definitions["JERRY_VALGRIND"] = self.options.valgrind - self._cmake.definitions["JERRY_MEM_GC_BEFORE_EACH_ALLOC"] = self.options.gc_before_each_alloc - self._cmake.definitions["JERRY_VM_EXEC_STOP"] = self.options.vm_exec_stop - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["JERRY_CMDLINE"] = self.options.tool_cmdline + tc.variables["JERRY_CMDLINE_TEST"] = self.options.tool_cmdline_test + tc.variables["JERRY_CMDLINE_SNAPSHOT"] = self.options.tool_cmdline_snapshot + tc.variables["JERRY_PORT_DEFAULT"] = self.options.default_port_implementation + tc.variables["JERRY_EXT"] = self.options.jerry_ext + tc.variables[libmath_definition] = self._jerry_math + tc.variables["ENABLE_STRIP"] = self.options.get_safe("jerry_strip", False) + tc.variables["ENABLE_LTO"] = self.options.get_safe("link_time_optimization", False) + tc.variables[amalgamation_definition] = self.options.amalgamated + tc.variables["JERRY_DEBUGGER"] = self.options.debugger + tc.variables["JERRY_LINE_INFO"] = self.options.get_safe("keep_line_info", False) + tc.variables["JERRY_PROFILE"] = self.options.profile + tc.variables["JERRY_EXTERNAL_CONTEXT"] = self.options.external_context + tc.variables["JERRY_SNAPSHOT_EXEC"] = self.options.snapshot_execution + tc.variables["JERRY_SNAPSHOT_SAVE"] = self.options.snapshot_saving + tc.variables["JERRY_PARSER"] = self.options.parser + tc.variables["JERRY_PARSER_DUMP_BYTE_CODE"] = self.options.enable_dump_bytecode + tc.variables["JERRY_REGEXP_DUMP_BYTE_CODE"] = self.options.enable_dump_regexp_bytecode + tc.variables["JERRY_REGEXP_STRICT_MODE"] = self.options.strict_regexp + tc.variables["JERRY_ERROR_MESSAGES"] = self.options.error_messages + tc.variables["JERRY_LOGGING"] = self.options.logging + tc.variables["JERRY_MEM_STATS"] = self.options.memory_statistics + tc.variables["JERRY_GLOBAL_HEAP_SIZE"] = "(%s)" % self.options.heap_size + tc.variables["JERRY_GC_LIMIT"] = "(%s)" % self.options.gc_limit + tc.variables["JERRY_GC_MARK_LIMIT"] = "(%s)" % self.options.gc_mark_limit + tc.variables["JERRY_STACK_LIMIT"] = "(%s)" % self.options.stack_limit + tc.variables["JERRY_CPOINTER_32_BIT"] = self.options.cpointer_32_bit + tc.variables["JERRY_SYSTEM_ALLOCATOR"] = self.options.system_allocator + tc.variables["JERRY_VALGRIND"] = self.options.valgrind + tc.variables["JERRY_MEM_GC_BEFORE_EACH_ALLOC"] = self.options.gc_before_each_alloc + tc.variables["JERRY_VM_EXEC_STOP"] = self.options.vm_exec_stop + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) def build(self): self._patch_sources() - cmake = self._configure_cmake() + 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, "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.components["libjerry-port-default"].names["pkg_config"] = ["libjerry-port-default"] + self.cpp_info.components["libjerry-port-default"].set_property("pkg_config_name", "libjerry-port-default") self.cpp_info.components["libjerry-port-default"].libs = ["jerry-port-default"] if self._jerry_math: - mathlibname = "jerry-libm" if tools.Version(self.version) < "2.4.0" else "jerry-math" - self.cpp_info.components["libjerry-math"].names["pkg_config"] = "lib{}".format(mathlibname) + mathlibname = "jerry-libm" if Version(self.version) < "2.4.0" else "jerry-math" + self.cpp_info.components["libjerry-math"].set_property("pkg_config_name", f"lib{mathlibname}") self.cpp_info.components["libjerry-math"].libs = [mathlibname] self.cpp_info.components["libjerry-math"].requires = ["libjerry-port-default"] self.cpp_info.components["libjerry-core"].requires.append("libjerry-math") - if tools.Version(self.version) < "2.4.0": - self.cpp_info.components["libjerry-port-default-minimal"].names["pkg_config"] = ["libjerry-port-default-minimal"] + if Version(self.version) < "2.4.0": + self.cpp_info.components["libjerry-port-default-minimal"].set_property("pkg_config_name", "libjerry-port-default-minimal") self.cpp_info.components["libjerry-port-default-minimal"].libs = ["jerry-port-default-minimal"] self.cpp_info.components["libjerry-port-default"].requires.append("libjerry-port-default-minimal") - self.cpp_info.components["libjerry-core"].names["pkg_config"] = "libjerry-core" + self.cpp_info.components["libjerry-core"].set_property("pkg_config_name", "libjerry-core") self.cpp_info.components["libjerry-core"].libs = ["jerry-core"] # The pc file does not explicitly add the port. But it's needed for the test self.cpp_info.components["libjerry-core"].requires = ["libjerry-port-default"] if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.components["libjerry-core"].system_libs.append("m") - self.cpp_info.components["libjerry-ext"].names["pkg_config"] = "libjerry-ext" + self.cpp_info.components["libjerry-ext"].set_property("pkg_config_name", "libjerry-ext") self.cpp_info.components["libjerry-ext"].libs = ["jerry-ext"] self.cpp_info.components["libjerry-ext"].requires = ["libjerry-core"] diff --git a/recipes/jerryscript/all/test_package/CMakeLists.txt b/recipes/jerryscript/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..d0cab5c74bc2f9 100644 --- a/recipes/jerryscript/all/test_package/CMakeLists.txt +++ b/recipes/jerryscript/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(jerryscript REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE jerryscript::jerryscript) diff --git a/recipes/jerryscript/all/test_package/conanfile.py b/recipes/jerryscript/all/test_package/conanfile.py index bbf2351737349b..ef5d7042163ecc 100644 --- a/recipes/jerryscript/all/test_package/conanfile.py +++ b/recipes/jerryscript/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 TestConan(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) @@ -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/jerryscript/all/test_v1_package/CMakeLists.txt b/recipes/jerryscript/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/jerryscript/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/jerryscript/all/test_v1_package/conanfile.py b/recipes/jerryscript/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..f575dfc3e9c8a3 --- /dev/null +++ b/recipes/jerryscript/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestConan(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/jfalcou-eve/all/conanfile.py b/recipes/jfalcou-eve/all/conanfile.py index dbd0bf0ff0d12e..51aa78ce2dd314 100644 --- a/recipes/jfalcou-eve/all/conanfile.py +++ b/recipes/jfalcou-eve/all/conanfile.py @@ -20,6 +20,7 @@ class JfalcouEveConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://jfalcou.github.io/eve/" topics = ("cpp", "simd", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/jinja2cpp/all/conanfile.py b/recipes/jinja2cpp/all/conanfile.py index f6bfa2d0a3b341..7e812e5ef15e35 100644 --- a/recipes/jinja2cpp/all/conanfile.py +++ b/recipes/jinja2cpp/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import msvc_runtime_flag, is_msvc -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, 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 @@ -56,7 +56,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.82.0") + self.requires("boost/1.83.0") self.requires("expected-lite/0.6.3", transitive_headers=True) self.requires("optional-lite/3.5.0", transitive_headers=True) self.requires("rapidjson/cci.20220822") @@ -66,7 +66,7 @@ def requirements(self): self.requires("fmt/6.2.1") # not compatible with fmt >= 7.0.0 else: self.requires("nlohmann_json/3.11.2") - self.requires("fmt/10.0.0") + self.requires("fmt/10.1.1") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -86,7 +86,9 @@ def generate(self): tc.variables["JINJA2CPP_STRICT_WARNINGS"] = False tc.variables["JINJA2CPP_BUILD_SHARED"] = self.options.shared tc.variables["JINJA2CPP_DEPS_MODE"] = "conan-build" - tc.variables["JINJA2CPP_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", 14) + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + tc.cache_variables["JINJA2CPP_CXX_STANDARD"] = str(cppstd).replace("gnu", "") if is_msvc(self): # Runtime type configuration for Jinja2C++ should be strictly '/MT' or '/MD' runtime = "/MD" if "MD" in msvc_runtime_flag(self) else "/MT" diff --git a/recipes/jsbsim/all/conandata.yml b/recipes/jsbsim/all/conandata.yml new file mode 100644 index 00000000000000..e42c1af7e0ef06 --- /dev/null +++ b/recipes/jsbsim/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.1.13": + url: "https://github.com/JSBSim-Team/jsbsim/archive/refs/tags/v1.1.13.tar.gz" + sha256: "e6cc167d4e7bb9d36e8cbb75bfaac270b15926e87367eebe9559e69ca32ad7e6" +patches: + "1.1.13": + - patch_file: "patches/1.1.13-0001-expat-link.patch" + patch_description: "CMake: fix link to expat" + patch_type: "conan" + - patch_file: "patches/1.1.13-0002-cmake-install.patch" + patch_description: "CMake: fix installation" + patch_type: "conan" + - patch_file: "patches/1.1.13-0003-fix-use-t-before-auto-deduction.patch" + patch_description: "Fix 'use of t before deduction of auto' in FGTable.cpp" + patch_type: "portability" diff --git a/recipes/jsbsim/all/conanfile.py b/recipes/jsbsim/all/conanfile.py new file mode 100644 index 00000000000000..3d180281b56495 --- /dev/null +++ b/recipes/jsbsim/all/conanfile.py @@ -0,0 +1,95 @@ +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, rmdir + +required_conan_version = ">=1.53.0" + + +class JsbsimConan(ConanFile): + name = "jsbsim" + description = ( + "JSBSim is a multi-platform, general purpose object-oriented " + "Flight Dynamics Model (FDM) written in C++" + ) + license = "LGPL-2.1-or-later" + topics = ("aircraft", "aerospace", "flight-dynamics", "flight-simulation") + homepage = "https://github.com/JSBSim-Team/jsbsim" + 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], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "11" + + 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("expat/2.5.0") + + def validate(self): + 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) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SYSTEM_EXPAT"] = True + tc.variables["BUILD_DOCS"] = False + tc.variables["BUILD_PYTHON_MODULE"] = False + tc.generate() + deps = CMakeDeps(self) + deps.set_property("expat", "cmake_file_name", "EXPAT") + deps.set_property("expat", "cmake_target_name", "EXPAT::EXPAT") + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", 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")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "JSBSim") + self.cpp_info.libs = ["JSBSim"] + self.cpp_info.includedirs = [os.path.join("include", "JSBSim")] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["wsock32", "ws2_32"]) + if not self.options.shared: + self.cpp_info.defines.append("JSBSIM_STATIC_LINK") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/jsbsim/all/patches/1.1.13-0001-expat-link.patch b/recipes/jsbsim/all/patches/1.1.13-0001-expat-link.patch new file mode 100644 index 00000000000000..422dcb5cbf527e --- /dev/null +++ b/recipes/jsbsim/all/patches/1.1.13-0001-expat-link.patch @@ -0,0 +1,28 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -65,12 +65,11 @@ add_library(libJSBSim ${HEADERS} ${SOURCES} + add_coverage(libJSBSim) + + if(EXPAT_FOUND) +- include_directories(${EXPAT_INCLUDE_DIRS}) +- if (PKG_CONFIG_FOUND) ++ if (0) + target_link_libraries(libJSBSim ${PC_EXPAT_LIBRARIES}) + set(ALL_LINK_LIBRARIES ${PC_EXPAT_LIBRARIES}) + else() +- target_link_libraries(libJSBSim ${EXPAT_LIBRARIES}) ++ target_link_libraries(libJSBSim EXPAT::EXPAT) + set(ALL_LINK_LIBRARIES ${EXPAT_LIBRARIES}) + endif() + else() +--- a/src/simgear/xml/CMakeLists.txt ++++ b/src/simgear/xml/CMakeLists.txt +@@ -28,5 +28,8 @@ endif() + add_library(Xml OBJECT ${HEADERS} ${SOURCES}) + set_target_properties(Xml PROPERTIES TARGET_DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}) ++if(EXPAT_FOUND) ++ target_link_libraries(Xml EXPAT::EXPAT) ++endif() + + install(FILES ${HEADERS} DESTINATION include/JSBSim/simgear/xml COMPONENT devel) diff --git a/recipes/jsbsim/all/patches/1.1.13-0002-cmake-install.patch b/recipes/jsbsim/all/patches/1.1.13-0002-cmake-install.patch new file mode 100644 index 00000000000000..0f6fb6ace3ef3c --- /dev/null +++ b/recipes/jsbsim/all/patches/1.1.13-0002-cmake-install.patch @@ -0,0 +1,39 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -135,26 +135,12 @@ elseif(UNIX) + endforeach() + endif() + +-if(BUILD_SHARED_LIBS) + set_target_properties (libJSBSim PROPERTIES + SOVERSION ${LIBRARY_SOVERSION} +- FRAMEWORK ON) ++ ) + install(TARGETS libJSBSim LIBRARY DESTINATION lib +- NAMELINK_SKIP +- COMPONENT runtime +- # For Mac +- FRAMEWORK DESTINATION "/Library/Frameworks") +- install(TARGETS libJSBSim LIBRARY DESTINATION lib +- NAMELINK_ONLY +- COMPONENT devel +- # For Mac +- FRAMEWORK DESTINATION "/Library/Frameworks") +-else() +- install(TARGETS libJSBSim ARCHIVE DESTINATION lib +- COMPONENT devel +- # For Mac +- FRAMEWORK DESTINATION "/Library/Frameworks") +-endif() ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin) + + ################################################################################ + # Build and install command line executable # +--- a/utils/aeromatic++/CMakeLists.txt ++++ b/utils/aeromatic++/CMakeLists.txt +@@ -47,4 +47,3 @@ ADD_EXECUTABLE( aeromatic aeromatic.cpp ) + TARGET_LINK_LIBRARIES( aeromatic ${LIBAEROMATIC3} ${EXTRA_LIBS}) + + INSTALL(TARGETS aeromatic RUNTIME DESTINATION bin COMPONENT runtime) +-INSTALL(TARGETS ${LIBAEROMATIC3} ARCHIVE DESTINATION lib COMPONENT devel) diff --git a/recipes/jsbsim/all/patches/1.1.13-0003-fix-use-t-before-auto-deduction.patch b/recipes/jsbsim/all/patches/1.1.13-0003-fix-use-t-before-auto-deduction.patch new file mode 100644 index 00000000000000..958e041dc87529 --- /dev/null +++ b/recipes/jsbsim/all/patches/1.1.13-0003-fix-use-t-before-auto-deduction.patch @@ -0,0 +1,13 @@ +--- a/src/math/FGTable.cpp ++++ b/src/math/FGTable.cpp +@@ -87,8 +87,8 @@ FGTable::FGTable(const FGTable& t) + + // Deep copy of t.Tables + Tables.reserve(t.Tables.size()); +- for(const auto &t: t.Tables) +- Tables.push_back(std::unique_ptr(new FGTable(*t))); ++ for(const auto &table: t.Tables) ++ Tables.push_back(std::unique_ptr(new FGTable(*table))); + + Data = t.Data; + } diff --git a/recipes/jsbsim/all/test_package/CMakeLists.txt b/recipes/jsbsim/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..5ee8eae7c8e6fd --- /dev/null +++ b/recipes/jsbsim/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(jsbsim REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jsbsim::jsbsim) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jsbsim/all/test_package/conanfile.py b/recipes/jsbsim/all/test_package/conanfile.py new file mode 100644 index 00000000000000..0a6bc68712d901 --- /dev/null +++ b/recipes/jsbsim/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, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/jsbsim/all/test_package/test_package.cpp b/recipes/jsbsim/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..bd360361a7c3d9 --- /dev/null +++ b/recipes/jsbsim/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + JSBSim::FGFDMExec FDMExec; + return 0; +} diff --git a/recipes/openjpeg/all/test_v1_package/CMakeLists.txt b/recipes/jsbsim/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/openjpeg/all/test_v1_package/CMakeLists.txt rename to recipes/jsbsim/all/test_v1_package/CMakeLists.txt diff --git a/recipes/jsbsim/all/test_v1_package/conanfile.py b/recipes/jsbsim/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/jsbsim/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/jsbsim/config.yml b/recipes/jsbsim/config.yml new file mode 100644 index 00000000000000..26b3368e2a6929 --- /dev/null +++ b/recipes/jsbsim/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.13": + folder: all diff --git a/recipes/jsmn/all/conanfile.py b/recipes/jsmn/all/conanfile.py index 80c11f45949cba..eff4b5d9d95719 100644 --- a/recipes/jsmn/all/conanfile.py +++ b/recipes/jsmn/all/conanfile.py @@ -16,6 +16,7 @@ class JsmnConan(ConanFile): topics = ("json", "parser") homepage = "https://github.com/zserge/jsmn" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -26,8 +27,7 @@ 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 diff --git a/recipes/json-c/all/conandata.yml b/recipes/json-c/all/conandata.yml index 7ed706059e17cb..a27364e09b956a 100644 --- a/recipes/json-c/all/conandata.yml +++ b/recipes/json-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.17": + url: "https://github.com/json-c/json-c/archive/json-c-0.17-20230812.tar.gz" + sha256: "024d302a3aadcbf9f78735320a6d5aedf8b77876c8ac8bbb95081ca55054c7eb" "0.16": url: "https://github.com/json-c/json-c/archive/json-c-0.16-20220414.tar.gz" sha256: "3ecaeedffd99a60b1262819f9e60d7d983844073abc74e495cb822b251904185" diff --git a/recipes/json-c/config.yml b/recipes/json-c/config.yml index 1e4023fe840463..301a8d09f5b3a5 100644 --- a/recipes/json-c/config.yml +++ b/recipes/json-c/config.yml @@ -1,4 +1,6 @@ versions: + "0.17": + folder: all "0.16": folder: all "0.15": diff --git a/recipes/json_dto/all/conandata.yml b/recipes/json_dto/all/conandata.yml index 3d6e5b35876d7b..48460b81acb17c 100644 --- a/recipes/json_dto/all/conandata.yml +++ b/recipes/json_dto/all/conandata.yml @@ -1,22 +1,22 @@ sources: - "0.2.11": - url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.11.tar.gz" - sha256: "9ce409a8210ee78ef5b1e60dfb919186ba6a2e928e391e46f0e1d36049e06b1c" - "0.2.12": - url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.12.tar.gz" - sha256: "3b1ca412a74c339c01bcbf739542fa69b2391d24c321742098a2d6dfa7402d84" - "0.2.13": - url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.13.tar.gz" - sha256: "ed4138bf86e0724c95508a9c74bed6fa0c98814b96f4cb3a1b540857e2302663" - "0.2.14": - url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.14.tar.gz" - sha256: "d885fe16cf621f7470a45fb6e955e8aded02958bb2212819dc151feac930905b" - "0.2.15": - url: "https://github.com/Stiffstream/json_dto/archive/v.0.2.15.tar.gz" - sha256: "d7631d21785ddddc81b2fe04a7998d0d49323c2224168568cb80cc32093da3ac" - "0.3.0": - url: "https://github.com/Stiffstream/json_dto/archive/v.0.3.0.tar.gz" - sha256: "cd497c9ee5556c45aaa3402a23ab935e6a90c1e62076562efd0708d1ec8f4c30" "0.3.1": - url: "https://github.com/Stiffstream/json_dto/archive/v.0.3.1.tar.gz" + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.3.1.tar.gz" sha256: "515a2d1510d3d8f8b240eb2149f44aeb47a70d26a7071609cca45c0ee198d1d1" + "0.3.0": + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.3.0.tar.gz" + sha256: "cd497c9ee5556c45aaa3402a23ab935e6a90c1e62076562efd0708d1ec8f4c30" + "0.2.15": + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.2.15.tar.gz" + sha256: "d7631d21785ddddc81b2fe04a7998d0d49323c2224168568cb80cc32093da3ac" + "0.2.14": + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.2.14.tar.gz" + sha256: "d885fe16cf621f7470a45fb6e955e8aded02958bb2212819dc151feac930905b" + "0.2.13": + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.2.13.tar.gz" + sha256: "ed4138bf86e0724c95508a9c74bed6fa0c98814b96f4cb3a1b540857e2302663" + "0.2.12": + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.2.12.tar.gz" + sha256: "3b1ca412a74c339c01bcbf739542fa69b2391d24c321742098a2d6dfa7402d84" + "0.2.11": + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.2.11.tar.gz" + sha256: "9ce409a8210ee78ef5b1e60dfb919186ba6a2e928e391e46f0e1d36049e06b1c" diff --git a/recipes/json_dto/all/conanfile.py b/recipes/json_dto/all/conanfile.py index 44aa1adf3256ae..59d836f7770704 100644 --- a/recipes/json_dto/all/conanfile.py +++ b/recipes/json_dto/all/conanfile.py @@ -10,13 +10,14 @@ required_conan_version = ">=1.52.0" -class PackageConan(ConanFile): +class JsonDtoConan(ConanFile): name = "json_dto" license = "BSD-3-Clause" homepage = "https://github.com/Stiffstream/json_dto" url = "https://github.com/conan-io/conan-center-index" description = "A small header-only helper for converting data between json representation and c++ structs" topics = ("json", "dto", "serialization") + package_type = "header-library" settings = "os", "compiler", "build_type", "arch" no_copy_source = True @@ -38,7 +39,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("rapidjson/1.1.0", transitive_headers=True) + self.requires("rapidjson/1.1.0") def package_id(self): self.info.clear() @@ -53,7 +54,7 @@ def validate(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 package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) diff --git a/recipes/json_dto/all/test_package/CMakeLists.txt b/recipes/json_dto/all/test_package/CMakeLists.txt index 45401a5b844aeb..b20143685a5e93 100644 --- a/recipes/json_dto/all/test_package/CMakeLists.txt +++ b/recipes/json_dto/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(json-dto REQUIRED CONFIG) -add_executable(example example.cpp) -target_link_libraries(example json-dto::json-dto) -set_property(TARGET example PROPERTY CXX_STANDARD 14) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE json-dto::json-dto) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/json_dto/all/test_package/conanfile.py b/recipes/json_dto/all/test_package/conanfile.py index 21d7adcc4bb1ce..81d4d29e64c73d 100644 --- a/recipes/json_dto/all/test_package/conanfile.py +++ b/recipes/json_dto/all/test_package/conanfile.py @@ -1,11 +1,20 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout -class JsondtoTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "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) @@ -13,6 +22,6 @@ def build(self): cmake.build() def test(self): - if not tools.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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/json_dto/all/test_package/example.cpp b/recipes/json_dto/all/test_package/test_package.cpp similarity index 100% rename from recipes/json_dto/all/test_package/example.cpp rename to recipes/json_dto/all/test_package/test_package.cpp diff --git a/recipes/json_dto/all/test_v1_package/CMakeLists.txt b/recipes/json_dto/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..b21cc49efde95c --- /dev/null +++ b/recipes/json_dto/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/json_dto/all/test_v1_package/conanfile.py b/recipes/json_dto/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/json_dto/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/json_dto/config.yml b/recipes/json_dto/config.yml index 464caddcd41365..87de86e844c69d 100644 --- a/recipes/json_dto/config.yml +++ b/recipes/json_dto/config.yml @@ -1,15 +1,15 @@ versions: - "0.2.11": + "0.3.1": folder: all - "0.2.12": + "0.3.0": folder: all - "0.2.13": + "0.2.15": folder: all "0.2.14": folder: all - "0.2.15": + "0.2.13": folder: all - "0.3.0": + "0.2.12": folder: all - "0.3.1": + "0.2.11": folder: all diff --git a/recipes/jsoncons/all/conandata.yml b/recipes/jsoncons/all/conandata.yml index ee163c0bae4778..612bdd0c9980f7 100644 --- a/recipes/jsoncons/all/conandata.yml +++ b/recipes/jsoncons/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.172.1": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.172.1.tar.gz" + sha256: "710ac7656373a118cee4ad10ecb2225d331ca5b4706a4add3a2b482b7fceef1f" + "0.172.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.172.0.tar.gz" + sha256: "a0b9f8c9afcfc30993bc9122a659e3790351b621c354e5dee09dd7c53665df14" + "0.171.1": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.171.1.tar.gz" + sha256: "e84d71bcf7c78f21de8bbd88a8da6f6afa458f562f6b846ef51f1aa5697ad904" "0.171.0": url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.171.0.tar.gz" sha256: "0be840e984e30e70747c01e55669bbd4c49737cffc5852ccc5625dfe3dd38530" diff --git a/recipes/jsoncons/all/conanfile.py b/recipes/jsoncons/all/conanfile.py index acb202ad18e688..54b1abb2a2c3e6 100644 --- a/recipes/jsoncons/all/conanfile.py +++ b/recipes/jsoncons/all/conanfile.py @@ -1,6 +1,9 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.files import get, copy from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version import os required_conan_version = ">=1.50.0" @@ -23,12 +26,37 @@ class JsonconsConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "0.172.0" 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 layout(self): basic_layout(self, src_folder="src") 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) diff --git a/recipes/jsoncons/all/test_package/CMakeLists.txt b/recipes/jsoncons/all/test_package/CMakeLists.txt index 15f5b1aabdb291..067c8673df55ba 100644 --- a/recipes/jsoncons/all/test_package/CMakeLists.txt +++ b/recipes/jsoncons/all/test_package/CMakeLists.txt @@ -5,4 +5,8 @@ find_package(jsoncons CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE jsoncons) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(jsoncons_VERSION VERSION_LESS "0.172.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/jsoncons/all/test_v1_package/CMakeLists.txt b/recipes/jsoncons/all/test_v1_package/CMakeLists.txt index 2e4adc0eddf167..a5743e33125cdf 100644 --- a/recipes/jsoncons/all/test_v1_package/CMakeLists.txt +++ b/recipes/jsoncons/all/test_v1_package/CMakeLists.txt @@ -8,4 +8,8 @@ find_package(jsoncons CONFIG REQUIRED) add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE jsoncons::jsoncons) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(jsoncons_VERSION VERSION_LESS "0.172.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/jsoncons/config.yml b/recipes/jsoncons/config.yml index 9830af3e7e5e02..d03c26c731d887 100644 --- a/recipes/jsoncons/config.yml +++ b/recipes/jsoncons/config.yml @@ -1,4 +1,10 @@ versions: + "0.172.1": + folder: "all" + "0.172.0": + folder: "all" + "0.171.1": + folder: "all" "0.171.0": folder: "all" "0.170.2": diff --git a/recipes/jthread-lite/all/conanfile.py b/recipes/jthread-lite/all/conanfile.py index efd2ef2fde6ab0..b1f862a6ab31f1 100644 --- a/recipes/jthread-lite/all/conanfile.py +++ b/recipes/jthread-lite/all/conanfile.py @@ -12,8 +12,9 @@ class JthreadLiteConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinmoene/jthread-lite" description = "jthread lite - C++20's jthread for C++11 and later in a single-file header-only library " - topics = ("jthread-lite", "jthread", "cpp11") + topics = ("jthread", "cpp11") license = "BSL-1.0" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,8 +29,7 @@ def validate(self): check_min_cppstd(self, 11) 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 diff --git a/recipes/jungle/all/CMakeLists.txt b/recipes/jungle/all/CMakeLists.txt deleted file mode 100644 index d2b01e47d9d637..00000000000000 --- a/recipes/jungle/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.11) -project(jungle) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory("source_subfolder") diff --git a/recipes/jungle/all/conandata.yml b/recipes/jungle/all/conandata.yml index bd27aef1a8932e..804a4efea38b21 100644 --- a/recipes/jungle/all/conandata.yml +++ b/recipes/jungle/all/conandata.yml @@ -10,31 +10,19 @@ patches: - patch_file: "patches/0001-cmake-alterations.patch" patch_description: "CMake dependency discovery outside subtree." patch_type: "conan" - base_path: "source_subfolder" - sha256: "a7111a290e145717ae0cbdace9866db69c70782731c8568a806f8579e30759eb" - patch_file: "patches/0002-forestdb-path.patch" patch_description: "Update include macros for ForestDB headers." patch_type: "conan" - base_path: "source_subfolder" - sha256: "84ec45a312c52e2fa8cb7ab615aaa11088f24dcb4e4b880340b46c2763900d6b" - patch_file: "patches/0003-stdatomic.patch" patch_description: "Include std::atomic from all compilers." patch_type: "portability" - base_path: "source_subfolder" - sha256: "3ca66676f89e2425255eeb15bf18a77ae21c4f383124013bd6d1cb660cbc1544" "cci.20221201": - patch_file: "patches/0004-cmake-alterations-cci.20221201.patch" patch_description: "CMake dependency discovery outside subtree." patch_type: "conan" - base_path: "source_subfolder" - sha256: "a7111a290e145717ae0cbdace9866db69c70782731c8568a806f8579e30759eb" - patch_file: "patches/0002-forestdb-path.patch" patch_description: "Update include macros for ForestDB headers." patch_type: "conan" - base_path: "source_subfolder" - sha256: "84ec45a312c52e2fa8cb7ab615aaa11088f24dcb4e4b880340b46c2763900d6b" - patch_file: "patches/0003-stdatomic.patch" patch_description: "Include std::atomic from all compilers." patch_type: "portability" - base_path: "source_subfolder" - sha256: "3ca66676f89e2425255eeb15bf18a77ae21c4f383124013bd6d1cb660cbc1544" diff --git a/recipes/jungle/all/conanfile.py b/recipes/jungle/all/conanfile.py index 5350d8f70668d4..dba32eb6f0f01a 100644 --- a/recipes/jungle/all/conanfile.py +++ b/recipes/jungle/all/conanfile.py @@ -1,21 +1,23 @@ -from os.path import join +import os + from conan import ConanFile -from conan.tools.files import apply_conandata_patches, copy, get from conan.tools.build import check_min_cppstd -from conans import CMake +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.53.0" -required_conan_version = ">=1.50.0" class JungleConan(ConanFile): name = "jungle" - homepage = "https://github.com/eBay/Jungle" description = "Key-value storage library, based on a combined index of LSM-tree and copy-on-write B+tree" - topics = ("kv-store", "cow") - url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eBay/Jungle" + topics = ("kv-store", "cow") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = { "shared": [True, False], "fPIC": [True, False], @@ -25,16 +27,19 @@ class JungleConan(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" + def export_sources(self): + export_conandata_patches(self) + + 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") - def export_sources(self): - self.copy("CMakeLists.txt") - for patch_file in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch_file["patch_file"]) + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("forestdb/cci.20220727") @@ -43,12 +48,14 @@ def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, 11) - def configure(self): - if self.options.shared: - del self.options.fPIC - def source(self): - get(self, **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): apply_conandata_patches(self) @@ -57,18 +64,17 @@ def build(self): cmake.build() def package(self): - src_dir = join(self.source_folder, self._source_subfolder) - copy(self, "LICENSE*", src_dir, join(self.package_folder, "licenses")) - - hdr_src = join(src_dir, "include") - copy(self, "*.h", hdr_src, join(self.package_folder, "include"), keep_path=True) - - lib_dir = join(self.package_folder, "lib") - copy(self, "*.a", self.build_folder, lib_dir, keep_path=False) - copy(self, "*.lib", self.build_folder, lib_dir, keep_path=False) - copy(self, "*.so*", self.build_folder, lib_dir, keep_path=False) - copy(self, "*.dylib*", self.build_folder, lib_dir, keep_path=False) - copy(self, "*.dll*", self.build_folder, join(self.package_folder, "bin"), keep_path=False) + copy(self, "LICENSE*", + src=self.source_folder, + dst=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")) + for pattern in ["*.a", "*.lib", "*.so*", "*.dylib*", "*.dll*"]: + copy(self, pattern, + src=self.build_folder, + dst=os.path.join(self.package_folder, "lib"), + keep_path=False) def package_info(self): self.cpp_info.libs = ["jungle"] diff --git a/recipes/jungle/all/test_package/CMakeLists.txt b/recipes/jungle/all/test_package/CMakeLists.txt index 354670d11c755c..fdc2bc33ffe24c 100644 --- a/recipes/jungle/all/test_package/CMakeLists.txt +++ b/recipes/jungle/all/test_package/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required(VERSION 3.11) -set(CMAKE_CXX_STANDARD 11) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +set(CMAKE_CXX_STANDARD 11) -find_package(jungle CONFIG REQUIRED) +find_package(jungle REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} jungle::jungle) diff --git a/recipes/jungle/all/test_package/conanfile.py b/recipes/jungle/all/test_package/conanfile.py index 9ebf26743f34b4..ef5d7042163ecc 100644 --- a/recipes/jungle/all/test_package/conanfile.py +++ b/recipes/jungle/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -from conans import ConanFile -from conan.tools.build import cross_building -from conans import CMake +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) @@ -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/jungle/all/test_v1_package/CMakeLists.txt b/recipes/jungle/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/jungle/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/jungle/all/test_v1_package/conanfile.py b/recipes/jungle/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..9ebf26743f34b4 --- /dev/null +++ b/recipes/jungle/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile +from conan.tools.build import cross_building +from conans import CMake +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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jwasm/all/conanfile.py b/recipes/jwasm/all/conanfile.py index 682db91532894a..fb10aeba03ec3d 100644 --- a/recipes/jwasm/all/conanfile.py +++ b/recipes/jwasm/all/conanfile.py @@ -1,44 +1,36 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.53.0" class JwasmConan(ConanFile): name = "jwasm" description = "JWasm is intended to be a free Masm-compatible assembler." license = "Watcom-1.0" - topics = ("jwasm", "masm", "assembler") + topics = ("masm", "assembler") homepage = "https://github.com/JWasm/JWasm" url = "https://github.com/conan-io/conan-center-index" - + package_type = "application" settings = "os", "arch", "compiler", "build_type" 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 configure(self): - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass - - def package_id(self): - del self.info.settings.compiler + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") + def package_id(self): + del self.info.settings.compiler + 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) @@ -56,11 +48,8 @@ def package(self): cmake.install() def package_info(self): - self.cpp_info.frameworkdirs = [] self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] - 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) + # TODO: to remove once conan v1 support dropped + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/jwt-cpp/all/conanfile.py b/recipes/jwt-cpp/all/conanfile.py index bbf3918d2b2357..5a0889c19e2e19 100644 --- a/recipes/jwt-cpp/all/conanfile.py +++ b/recipes/jwt-cpp/all/conanfile.py @@ -24,7 +24,7 @@ def export_sources(self): export_conandata_patches(self) def requirements(self): - self.requires("openssl/[>1.1.1c,<1.1.1u]") + self.requires("openssl/[>=1.1 <4]") if not self._supports_generic_json: self.requires("picojson/1.3.0") diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml b/recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml index 1a2d17950129d6..86037b3ef63f66 100644 --- a/recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.10.1": + url: "https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime/archive/refs/tags/0.10.1.tar.gz" + sha256: "19a7fb2d386d1bb14c04ffa514d26673444c71fef73246984e2a587dc5ae1ab2" "0.10": url: "https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime/archive/refs/tags/0.10.tar.gz" sha256: "9a7d382b2acbbe6498ecca23fc7b6b98cbcc418af83fb569f94395f29712171c" @@ -6,11 +9,16 @@ sources: url: "https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime/archive/cb09b3a84c7e905c6a3fecfe9617cf864d9af781.zip" sha256: "058c01828692bf193cb862372651c572fcc43babbf2d664674409511b9f54e5b" patches: + "0.10.1": + - patch_file: "patches/0.10.1-0001-remove-template-id.patch" + patch_description: "rempte template-id from constructor/destructor" + patch_type: "portability" + patch_source: "https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime/pull/68" "0.10": - - patch_file: "patches/0001-cmake-minimum-required.patch" + - patch_file: "patches/0.10-0001-cmake-minimum-required.patch" patch_description: "declare cmake_minimum_required first" patch_type: "portability" "cci.20210701": - - patch_file: "patches/0001-cmake-minimum-required.patch" + - patch_file: "patches/0.10-0001-cmake-minimum-required.patch" patch_description: "declare cmake_minimum_required first" patch_type: "portability" diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/conanfile.py b/recipes/kaitai_struct_cpp_stl_runtime/all/conanfile.py index 4940a6da6e8575..ee40515a48071e 100644 --- a/recipes/kaitai_struct_cpp_stl_runtime/all/conanfile.py +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/conanfile.py @@ -12,6 +12,7 @@ class KaitaiStructCppStlRuntimeConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://kaitai.io/" topics = ("parsers", "streams", "dsl", "kaitai struct") + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" options = { "with_zlib": [True, False], @@ -31,7 +32,7 @@ def layout(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_iconv: self.requires("libiconv/1.17") @@ -44,6 +45,7 @@ def generate(self): tc.variables["STRING_ENCODING_TYPE"] = "ICONV" else: tc.variables["STRING_ENCODING_TYPE"] = "NONE" + tc.variables["BUILD_TESTS"] = False tc.generate() deps = CMakeDeps(self) @@ -62,3 +64,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["kaitai_struct_cpp_stl_runtime"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/patches/0001-cmake-minimum-required.patch b/recipes/kaitai_struct_cpp_stl_runtime/all/patches/0.10-0001-cmake-minimum-required.patch similarity index 100% rename from recipes/kaitai_struct_cpp_stl_runtime/all/patches/0001-cmake-minimum-required.patch rename to recipes/kaitai_struct_cpp_stl_runtime/all/patches/0.10-0001-cmake-minimum-required.patch diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/patches/0.10.1-0001-remove-template-id.patch b/recipes/kaitai_struct_cpp_stl_runtime/all/patches/0.10.1-0001-remove-template-id.patch new file mode 100644 index 00000000000000..ca0d4c309f4aac --- /dev/null +++ b/recipes/kaitai_struct_cpp_stl_runtime/all/patches/0.10.1-0001-remove-template-id.patch @@ -0,0 +1,94 @@ +diff --git a/kaitai/exceptions.h b/kaitai/exceptions.h +index 1c1e414..8033b98 100644 +--- a/kaitai/exceptions.h ++++ b/kaitai/exceptions.h +@@ -115,7 +115,7 @@ protected: + template + class validation_not_equal_error: public validation_failed_error { + public: +- validation_not_equal_error(const T& expected, const T& actual, kstream* io, const std::string src_path): ++ validation_not_equal_error(const T& expected, const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not equal", io, src_path), + m_expected(expected), + m_actual(actual) +@@ -124,7 +124,7 @@ public: + + // "not equal, expected #{expected.inspect}, but got #{actual.inspect}" + +- virtual ~validation_not_equal_error() KS_NOEXCEPT {}; ++ virtual ~validation_not_equal_error() KS_NOEXCEPT {}; + + protected: + const T& m_expected; +@@ -138,7 +138,7 @@ protected: + template + class validation_less_than_error: public validation_failed_error { + public: +- validation_less_than_error(const T& min, const T& actual, kstream* io, const std::string src_path): ++ validation_less_than_error(const T& min, const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not in range", io, src_path), + m_min(min), + m_actual(actual) +@@ -147,7 +147,7 @@ public: + + // "not in range, min #{min.inspect}, but got #{actual.inspect}" + +- virtual ~validation_less_than_error() KS_NOEXCEPT {}; ++ virtual ~validation_less_than_error() KS_NOEXCEPT {}; + + protected: + const T& m_min; +@@ -161,7 +161,7 @@ protected: + template + class validation_greater_than_error: public validation_failed_error { + public: +- validation_greater_than_error(const T& max, const T& actual, kstream* io, const std::string src_path): ++ validation_greater_than_error(const T& max, const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not in range", io, src_path), + m_max(max), + m_actual(actual) +@@ -170,7 +170,7 @@ public: + + // "not in range, max #{max.inspect}, but got #{actual.inspect}" + +- virtual ~validation_greater_than_error() KS_NOEXCEPT {}; ++ virtual ~validation_greater_than_error() KS_NOEXCEPT {}; + + protected: + const T& m_max; +@@ -184,7 +184,7 @@ protected: + template + class validation_not_any_of_error: public validation_failed_error { + public: +- validation_not_any_of_error(const T& actual, kstream* io, const std::string src_path): ++ validation_not_any_of_error(const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not any of the list", io, src_path), + m_actual(actual) + { +@@ -192,7 +192,7 @@ public: + + // "not any of the list, got #{actual.inspect}" + +- virtual ~validation_not_any_of_error() KS_NOEXCEPT {}; ++ virtual ~validation_not_any_of_error() KS_NOEXCEPT {}; + + protected: + const T& m_actual; +@@ -205,7 +205,7 @@ protected: + template + class validation_expr_error: public validation_failed_error { + public: +- validation_expr_error(const T& actual, kstream* io, const std::string src_path): ++ validation_expr_error(const T& actual, kstream* io, const std::string src_path): + validation_failed_error("not matching the expression", io, src_path), + m_actual(actual) + { +@@ -213,7 +213,7 @@ public: + + // "not matching the expression, got #{actual.inspect}" + +- virtual ~validation_expr_error() KS_NOEXCEPT {}; ++ virtual ~validation_expr_error() KS_NOEXCEPT {}; + + protected: + const T& m_actual; diff --git a/recipes/kaitai_struct_cpp_stl_runtime/config.yml b/recipes/kaitai_struct_cpp_stl_runtime/config.yml index 25aabe969604ca..aa873ad2d383ce 100644 --- a/recipes/kaitai_struct_cpp_stl_runtime/config.yml +++ b/recipes/kaitai_struct_cpp_stl_runtime/config.yml @@ -1,4 +1,6 @@ versions: + "0.10.1": + folder: all "0.10": folder: all "cci.20210701": diff --git a/recipes/kangaru/all/conandata.yml b/recipes/kangaru/all/conandata.yml index 7cacb93f9b6160..5c977f020a27d6 100644 --- a/recipes/kangaru/all/conandata.yml +++ b/recipes/kangaru/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.3.1": + url: "https://github.com/gracicot/kangaru/archive/v4.3.1.tar.gz" + sha256: "3896ea2a13cc1c220b4d83bf598e27e77004170b4a212af8f14264f8a6fb0e45" "4.3.0": url: "https://github.com/gracicot/kangaru/archive/refs/tags/v4.3.0.tar.gz" sha256: "98a0d7f2e5ac65d93fe83615ead1627fab2237b173e18151fb68d50234ed6eaf" diff --git a/recipes/kangaru/config.yml b/recipes/kangaru/config.yml index f77751b7637b42..a57d047923a8af 100644 --- a/recipes/kangaru/config.yml +++ b/recipes/kangaru/config.yml @@ -1,4 +1,6 @@ versions: + "4.3.1": + folder: all "4.3.0": folder: all "4.2.4": diff --git a/recipes/kcp/all/CMakeLists.txt b/recipes/kcp/all/CMakeLists.txt deleted file mode 100644 index 0feb437e184184..00000000000000 --- a/recipes/kcp/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/kcp/all/conandata.yml b/recipes/kcp/all/conandata.yml index da8ca059669a33..4ecaaa44cfb1c9 100644 --- a/recipes/kcp/all/conandata.yml +++ b/recipes/kcp/all/conandata.yml @@ -5,10 +5,3 @@ sources: "1.7": url: "https://github.com/skywind3000/kcp/archive/1.7.tar.gz" sha256: "b4d26994d95599ab0c44e1f93002f9fda275094a879d66c192d79d596529199e" -patches: - "1.5": - - patch_file: "patches/0001-kcp-remove-add_library-STATIC.patch" - base_path: "source_subfolder" - "1.7": - - patch_file: "patches/0001-kcp-remove-add_library-STATIC.patch" - base_path: "source_subfolder" diff --git a/recipes/kcp/all/conanfile.py b/recipes/kcp/all/conanfile.py index ea23c3a999a55c..0146b7ee7c3cc8 100644 --- a/recipes/kcp/all/conanfile.py +++ b/recipes/kcp/all/conanfile.py @@ -1,17 +1,23 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, export_conandata_patches, get, rmdir, replace_in_file + +required_conan_version = ">=1.53.0" class KcpConan(ConanFile): name = "kcp" description = "A Fast and Reliable ARQ Protocol" - topics = ("conan", "kcp", "ARQ", "TCP", "protocol") - homepage = "https://github.com/skywind3000/kcp" - url = "https://github.com/conan-io/conan-center-index" license = "MIT" - exports_sources = "CMakeLists.txt", "patches/**" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/skywind3000/kcp" + topics = ("ARQ", "TCP", "protocol") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -20,18 +26,9 @@ class KcpConan(ConanFile): "shared": False, "fPIC": True, } - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" - - @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": @@ -39,36 +36,46 @@ 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], - 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["BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["BUILD_TESTING"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + # Fix shared builds on Windows + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + " STATIC", "") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "ARCHIVE DESTINATION", + "RUNTIME DESTINATION bin\nARCHIVE DESTINATION") def build(self): self._patch_sources() - 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")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["kcp"] diff --git a/recipes/kcp/all/patches/0001-kcp-remove-add_library-STATIC.patch b/recipes/kcp/all/patches/0001-kcp-remove-add_library-STATIC.patch deleted file mode 100644 index b8c9f32e1e6583..00000000000000 --- a/recipes/kcp/all/patches/0001-kcp-remove-add_library-STATIC.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -5,12 +5,14 @@ - include(CTest) - include(GNUInstallDirs) - --add_library(kcp STATIC ikcp.c) -+add_library(kcp ikcp.c) - - install(FILES ikcp.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - - install(TARGETS kcp - EXPORT kcp-targets -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ) diff --git a/recipes/kcp/all/test_package/CMakeLists.txt b/recipes/kcp/all/test_package/CMakeLists.txt index d5b08913be93be..b15d2eca4c2a32 100644 --- a/recipes/kcp/all/test_package/CMakeLists.txt +++ b/recipes/kcp/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(kcp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/kcp/all/test_package/conanfile.py b/recipes/kcp/all/test_package/conanfile.py index f8eeed898d7bd1..ef5d7042163ecc 100644 --- a/recipes/kcp/all/test_package/conanfile.py +++ b/recipes/kcp/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,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/kcp/all/test_v1_package/CMakeLists.txt b/recipes/kcp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/kcp/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/kcp/all/test_v1_package/conanfile.py b/recipes/kcp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..f8eeed898d7bd1 --- /dev/null +++ b/recipes/kcp/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/kdbindings/all/conandata.yml b/recipes/kdbindings/all/conandata.yml new file mode 100644 index 00000000000000..fa9ce176c1b03e --- /dev/null +++ b/recipes/kdbindings/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.3": + url: "https://github.com/KDAB/KDBindings/archive/refs/tags/v1.0.3.tar.gz" + sha256: "da8de679d12bf123df6a3c63a482a862d4122a2f3d3567c9b3b2fc2c4f574393" diff --git a/recipes/kdbindings/all/conanfile.py b/recipes/kdbindings/all/conanfile.py new file mode 100644 index 00000000000000..9f1cf776a90f2c --- /dev/null +++ b/recipes/kdbindings/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.scm import Version +import os + +class KDBindingsConan(ConanFile): + name = "kdbindings" + license = "MIT" + topics = ("c++17", "reactive", "kdab", "header-only") + description = "Reactive programming & data binding in C++" + homepage = "https://github.com/KDAB/KDBindings" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "15.7", + "clang": "7", + "apple-clang": "11", + } + + def validate(self): + if self.settings.compiler.get_safe("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.") + + def build(self): + pass + + def package(self): + copy(self, "*.h", os.path.join(self.source_folder, "src","kdbindings"), os.path.join(self.package_folder, "include", "kdbindings")) + copy(self, "LICENSES/*", dst=os.path.join(self.package_folder,"licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "KDBindings") + self.cpp_info.set_property("cmake_target_name", "KDAB::KDBindings") + self.cpp_info.set_property("cmake_target_aliases", ["KDBindings"]) diff --git a/recipes/kdbindings/all/test_package/CMakeLists.txt b/recipes/kdbindings/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..cbd352d1e0df77 --- /dev/null +++ b/recipes/kdbindings/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(KDBindings REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} main.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE KDAB::KDBindings) + +set_target_properties(${PROJECT_NAME} + PROPERTIES + CMAKE_INCLUDE_CURRENT_DIRS ON + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON +) diff --git a/recipes/kdbindings/all/test_package/conanfile.py b/recipes/kdbindings/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e845ae751a3017 --- /dev/null +++ b/recipes/kdbindings/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/kdbindings/all/test_package/main.cpp b/recipes/kdbindings/all/test_package/main.cpp new file mode 100644 index 00000000000000..82e0dc503f17b6 --- /dev/null +++ b/recipes/kdbindings/all/test_package/main.cpp @@ -0,0 +1,63 @@ +/* + This file is part of KDBindings. + + SPDX-FileCopyrightText: 2021-2022 Klarälvdalens Datakonsult AB, a KDAB Group company + Author: Leon Matthes + + SPDX-License-Identifier: MIT + + Contact KDAB at for commercial licensing options. +*/ + +#include +#include + +#include +#include + +using namespace KDBindings; + +void display() +{ + std::cout << "Hello World!" << std::endl; +} + +void displayLabelled(const std::string &label, int value) +{ + std::cout << label << ": " << value << std::endl; +} + +class SignalHandler +{ +public: + bool received = 0; + + void receive() + { + received = true; + } +}; + +int main() +{ + Signal signal; + + // Signal::connect allows connecting functions that take too few arguments. + signal.connect(display); + + // As well as functions with too many arguments, as long as default values are provided. + signal.connect(displayLabelled, "Emitted value"); + + // This is very useful to connect member functions, where the first implicit argument + // is a pointer to the "this" object. + SignalHandler handler; + signal.connect(&SignalHandler::receive, &handler); + + // This will print "Hello World!" and "Emitted value: 5" in an unspecified order. + // It will also set handler.received to true + signal.emit(5); + + std::cout << std::boolalpha << handler.received << std::endl; + + return 0; +} diff --git a/recipes/kdbindings/config.yml b/recipes/kdbindings/config.yml new file mode 100644 index 00000000000000..372dd1cb646bd1 --- /dev/null +++ b/recipes/kdbindings/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.3": + folder: all diff --git a/recipes/keychain/all/conanfile.py b/recipes/keychain/all/conanfile.py index 216336cf7d3683..64b3ee8743d71b 100644 --- a/recipes/keychain/all/conanfile.py +++ b/recipes/keychain/all/conanfile.py @@ -33,12 +33,12 @@ def validate(self): def requirements(self): if self.settings.os == "Linux": - self.requires("libsecret/0.20.4") - self.requires("glib/2.76.0") + self.requires("libsecret/0.20.5") + self.requires("glib/2.78.1") def build_requirements(self): if self.settings.os == "Linux": - self.tool_requires("pkgconf/1.7.3") + self.tool_requires("pkgconf/2.0.3") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/khrplatform/all/conanfile.py b/recipes/khrplatform/all/conanfile.py index 4125f97c39bdb8..8a3e15b829a646 100644 --- a/recipes/khrplatform/all/conanfile.py +++ b/recipes/khrplatform/all/conanfile.py @@ -13,6 +13,7 @@ class KhrplatformConan(ConanFile): homepage = "https://www.khronos.org/registry/EGL/" description = "Khronos EGL platform interfaces" topics = ("opengl", "gl", "egl", "khr", "khronos") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/kickcat/all/conandata.yml b/recipes/kickcat/all/conandata.yml new file mode 100644 index 00000000000000..f0a390ebfac916 --- /dev/null +++ b/recipes/kickcat/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "v2-alpha4": + url: "https://github.com/Siviuze/KickCAT/archive/refs/tags/v2-alpha4.zip" + sha256: "483a374f77808cb35823652eb37c5ab864a3f12a1c3a957d3315c319ca0ec528" + "v2-alpha3": + url: "https://github.com/Siviuze/KickCAT/archive/refs/tags/v2-alpha3.zip" + sha256: "dadd8518c3232162b7455fdcd837578120ece5a42c3bc2701147a68cbee60da4" diff --git a/recipes/kickcat/all/conanfile.py b/recipes/kickcat/all/conanfile.py new file mode 100644 index 00000000000000..abaf5d422d5881 --- /dev/null +++ b/recipes/kickcat/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import get, copy +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.55" + + +class KickCATRecipe(ConanFile): + name = "kickcat" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Siviuze/KickCAT" + description = "Thin EtherCAT stack designed to be embedded in a more complex software and with efficiency in mind" + license = "CeCILL-C" + topics = ("ethercat") + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def configure(self): + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 17) + + if self.settings.os != "Linux": + raise ConanInvalidConfiguration( + f"{self.ref} is not supported on {self.settings.os}.") + + if self.settings.compiler != "gcc": + raise ConanInvalidConfiguration( + f"{self.ref} is not supported on {self.settings.compiler}.") + + if self.settings.compiler == 'gcc' and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration("Building requires GCC >= 7") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_UNIT_TESTS"] = "OFF" + tc.cache_variables["BUILD_EXAMPLES"] = "OFF" + tc.cache_variables["BUILD_SIMULATION"] = "OFF" + tc.cache_variables["BUILD_TOOLS"] = "OFF" + tc.cache_variables["DEBUG"] = "OFF" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "*.h", os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include")) + copy(self, "*.a", self.build_folder, + os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.so", self.build_folder, + os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "LICENSE", self.source_folder, + os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.libs = ["kickcat"] diff --git a/recipes/kickcat/all/test_package/CMakeLists.txt b/recipes/kickcat/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..8b77c31d9ca128 --- /dev/null +++ b/recipes/kickcat/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) + +find_package(kickcat REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cc) +target_link_libraries(${PROJECT_NAME} PRIVATE kickcat::kickcat) diff --git a/recipes/kickcat/all/test_package/conanfile.py b/recipes/kickcat/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e46a141327eede --- /dev/null +++ b/recipes/kickcat/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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" + + 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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/kickcat/all/test_package/test_package.cc b/recipes/kickcat/all/test_package/test_package.cc new file mode 100644 index 00000000000000..a0ac4c8fdf423d --- /dev/null +++ b/recipes/kickcat/all/test_package/test_package.cc @@ -0,0 +1,32 @@ +#include "kickcat/Bus.h" +#include "kickcat/Link.h" +#include "kickcat/Prints.h" +#include "kickcat/SocketNull.h" + +#include + +using namespace kickcat; + +int main(int argc, char *argv[]) +{ + std::shared_ptr socket = std::make_shared(); + try + { + socket->open("null"); + } + catch (std::exception const &e) + { + std::cerr << e.what() << std::endl; + return 1; + } + + auto report_redundancy = []() { + }; + + std::shared_ptr link = std::make_shared(socket, socket, report_redundancy); + link->setTimeout(2ms); + link->checkRedundancyNeeded(); + + Bus bus(link); + return 0; +} diff --git a/recipes/kickcat/config.yml b/recipes/kickcat/config.yml new file mode 100644 index 00000000000000..e031f21fd364ad --- /dev/null +++ b/recipes/kickcat/config.yml @@ -0,0 +1,5 @@ +versions: + "v2-alpha4": + folder: all + "v2-alpha3": + folder: all diff --git a/recipes/kitten/all/CMakeLists.txt b/recipes/kitten/all/CMakeLists.txt deleted file mode 100644 index d17aaff199b4a6..00000000000000 --- a/recipes/kitten/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/kitten/all/conanfile.py b/recipes/kitten/all/conanfile.py index 7db05a55fbcac1..04b20a94ca5f99 100644 --- a/recipes/kitten/all/conanfile.py +++ b/recipes/kitten/all/conanfile.py @@ -1,28 +1,30 @@ -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.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class KittenConan(ConanFile): name = "kitten" description = "A small C++ library inspired by Category Theory focused on functional composition." - homepage = "https://github.com/rvarago/kitten" - url = "https://github.com/conan-io/conan-center-index" license = "MIT" - topics = ("category-theory", "composition", "monadic-interface", "declarative-programming") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rvarago/kitten" + topics = ("category-theory", "composition", "monadic-interface", "declarative-programming", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True - exports_sources = "CMakeLists.txt" - generators = "cmake" - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property def _minimum_compilers_version(self): @@ -33,50 +35,46 @@ def _minimum_compilers_version(self): "apple-clang": "10", } + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) - - 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] + check_min_cppstd(self, self._min_cppstd) min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if min_version and loose_lt_semver(str(self.settings.compiler.version), min_version): - raise ConanInvalidConfiguration( - "{} requires C++17, which your compiler does not support.".format(self.name) - ) - - def package_id(self): - self.info.header_only() + if min_version and Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"{self.name} 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 _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTS"] = False - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.generate() def build(self): - cmake = self._configure_cmake() + 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, pattern="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")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "kitten") self.cpp_info.set_property("cmake_target_name", "rvarago::kitten") + self.cpp_info.components["libkitten"].set_property("cmake_target_name", "rvarago::kitten") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "kitten" @@ -85,4 +83,3 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "rvarago" self.cpp_info.components["libkitten"].names["cmake_find_package"] = "kitten" self.cpp_info.components["libkitten"].names["cmake_find_package_multi"] = "kitten" - self.cpp_info.components["libkitten"].set_property("cmake_target_name", "rvarago::kitten") diff --git a/recipes/kitten/all/test_package/CMakeLists.txt b/recipes/kitten/all/test_package/CMakeLists.txt index 60b5b3b426db6b..8f30ef6f011383 100644 --- a/recipes/kitten/all/test_package/CMakeLists.txt +++ b/recipes/kitten/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(kitten REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/kitten/all/test_package/conanfile.py b/recipes/kitten/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/kitten/all/test_package/conanfile.py +++ b/recipes/kitten/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/kitten/all/test_package/test_package.cpp b/recipes/kitten/all/test_package/test_package.cpp index 8ddfae2423dd72..50559e2a32b1d0 100644 --- a/recipes/kitten/all/test_package/test_package.cpp +++ b/recipes/kitten/all/test_package/test_package.cpp @@ -1,14 +1,15 @@ +#include "kitten/instances/optional.h" +#include "kitten/kitten.h" + #include #include -#include "kitten/kitten.h" -#include "kitten/instances/optional.h" - using namespace rvarago::kitten; int main() { auto constexpr maybe_an_approximate_answer = std::optional{41}; - auto constexpr exact_answer = (maybe_an_approximate_answer | [](auto const& el) { return el + 1; }).value(); + auto constexpr exact_answer = + (maybe_an_approximate_answer | [](auto const& el) { return el + 1; }).value(); static_assert(42 == exact_answer); std::cout << "rvarago::kitten works! The exact answer is: " << exact_answer << '\n'; return 0; diff --git a/recipes/kitten/all/test_v1_package/CMakeLists.txt b/recipes/kitten/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/kitten/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/kitten/all/test_v1_package/conanfile.py b/recipes/kitten/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/kitten/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/kmod/all/conanfile.py b/recipes/kmod/all/conanfile.py index f60d2ebc28242b..9877db42cb1183 100644 --- a/recipes/kmod/all/conanfile.py +++ b/recipes/kmod/all/conanfile.py @@ -47,9 +47,9 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.with_xz: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.4") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") @@ -59,7 +59,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.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/ktx/all/conanfile.py b/recipes/ktx/all/conanfile.py index 872df15047bc59..5d9cc3ea680507 100644 --- a/recipes/ktx/all/conanfile.py +++ b/recipes/ktx/all/conanfile.py @@ -53,7 +53,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("lodepng/cci.20200615") + self.requires("lodepng/cci.20230410") self.requires("zstd/1.5.5") def validate(self): 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/lazycsv/all/conandata.yml b/recipes/lazycsv/all/conandata.yml new file mode 100644 index 00000000000000..1f9c6533da7ceb --- /dev/null +++ b/recipes/lazycsv/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20221117": + url: "https://github.com/ashtum/lazycsv/archive/844e3f318af2d9ede96039dd9f57ebf4cad59ce2.tar.gz" + sha256: "cb8592fc0b563a1236dfadfc423a91d63e705ff0086941218800abda22530540" diff --git a/recipes/lazycsv/all/conanfile.py b/recipes/lazycsv/all/conanfile.py new file mode 100644 index 00000000000000..f0f8f490335f92 --- /dev/null +++ b/recipes/lazycsv/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 + + +required_conan_version = ">=1.52.0" + + +class LazyCSVConan(ConanFile): + name = "lazycsv" + description = "A fast, lightweight and single-header C++ csv parser library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ashtum/lazycsv" + topics = ("csv", "csv-parser", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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 does not support." + ) + if is_msvc(self): + raise ConanInvalidConfiguration( + f"{self.ref} doen't support MSVC." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.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.libdirs = [] diff --git a/recipes/lazycsv/all/test_package/CMakeLists.txt b/recipes/lazycsv/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..655f63d80bdcf5 --- /dev/null +++ b/recipes/lazycsv/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(lazycsv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lazycsv::lazycsv) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/lazycsv/all/test_package/conanfile.py b/recipes/lazycsv/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/lazycsv/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/lazycsv/all/test_package/test_package.cpp b/recipes/lazycsv/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..c0e33ee18739a8 --- /dev/null +++ b/recipes/lazycsv/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include "lazycsv.hpp" + + +int main(void) { + std::string csv_data{ "name,lastname,age\nPeter,Griffin,45\nchris,Griffin,14\n" }; + + lazycsv::parser parser_a{ csv_data }; + lazycsv::parser parser_b{ csv_data }; +} diff --git a/recipes/lazycsv/config.yml b/recipes/lazycsv/config.yml new file mode 100644 index 00000000000000..4d61dda20e41ab --- /dev/null +++ b/recipes/lazycsv/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221117": + folder: all diff --git a/recipes/lcms/all/conanfile.py b/recipes/lcms/all/conanfile.py index 6a996a28f1758b..bc10e97d6f1111 100644 --- a/recipes/lcms/all/conanfile.py +++ b/recipes/lcms/all/conanfile.py @@ -45,7 +45,7 @@ def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.2.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/ldns/all/conanfile.py b/recipes/ldns/all/conanfile.py index b6e94e58b15d80..531318c15033cd 100644 --- a/recipes/ldns/all/conanfile.py +++ b/recipes/ldns/all/conanfile.py @@ -1,9 +1,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import XCRun +from conan.tools.apple import fix_apple_shared_install_name, XCRun from conan.tools.build import cross_building from conan.tools.env import VirtualRunEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm +from conan.tools.files import copy, get, rm from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain from conan.tools.layout import basic_layout import os @@ -18,7 +18,7 @@ class LdnsConan(ConanFile): homepage = "https://www.nlnetlabs.nl/projects/ldns" description = "LDNS is a DNS library that facilitates DNS tool programming" topics = ("dns") - + package_type = "library" settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], @@ -29,13 +29,6 @@ class LdnsConan(ConanFile): "fPIC": True, } - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") @@ -50,7 +43,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.os == "Windows": @@ -100,7 +93,6 @@ def generate(self): tc.generate() def build(self): - apply_conandata_patches(self) autotools = Autotools(self) autotools.configure() autotools.make() @@ -111,6 +103,7 @@ def package(self): autotools.install(target=target) rm(self, "*.la", os.path.join(self.package_folder, "lib")) copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["ldns"] diff --git a/recipes/lefticus-tools/all/conanfile.py b/recipes/lefticus-tools/all/conanfile.py index b9179faa1d97b1..d3dbf33094acc5 100644 --- a/recipes/lefticus-tools/all/conanfile.py +++ b/recipes/lefticus-tools/all/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile -from conan.tools.files import get, copy +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, check_min_vs -from conan.errors import ConanInvalidConfiguration -from conan import Version +from conan.tools.scm import Version import os @@ -33,6 +34,9 @@ def _compilers_minimum_version(self): "apple-clang": "14", } + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() diff --git a/recipes/lely-core/all/conanfile.py b/recipes/lely-core/all/conanfile.py index f57056df761975..9ed8f191a0a192 100644 --- a/recipes/lely-core/all/conanfile.py +++ b/recipes/lely-core/all/conanfile.py @@ -1,33 +1,23 @@ import os from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, rmdir from conan.tools.gnu import AutotoolsToolchain, Autotools from conan.tools.layout import basic_layout -from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.files import ( - export_conandata_patches, - apply_conandata_patches, - get, - copy, - rmdir, - rm, -) -from conan.errors import ConanInvalidConfiguration required_conan_version = ">=1.53.0" class LelyConan(ConanFile): name = "lely-core" - - # Optional metadata license = "Apache-2.0" homepage = "https://gitlab.com/lely_industries/lely-core/" url = "https://github.com/conan-io/conan-center-index" description = "The Lely core libraries are a collection of C and C++ libraries and tools, providing high-performance I/O and sensor/actuator control for robotics and IoT applications. The libraries are cross-platform and have few dependencies. They can be even be used on bare-metal microcontrollers with as little as 32 kB RAM." topics = ("canopen",) - - # Binary configuration + package_type = "library" settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], @@ -108,13 +98,17 @@ class LelyConan(ConanFile): "coapp-slave": True, } - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration( @@ -127,20 +121,18 @@ def validate(self): f"{self.ref} can only be compiled with GCC currently" ) - def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True, - ) + def build_requirements(self): + self.tool_requires("libtool/2.4.7") - def layout(self): - basic_layout(self, src_folder="src") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - at_toolchain = AutotoolsToolchain(self) - at_toolchain.configure_args += [ + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args += [ "--disable-cython", "--disable-python", "--disable-tools", @@ -148,7 +140,7 @@ def generate(self): "--disable-maintainer-mode", ] if self.options.get_safe("ecss-compliance"): - at_toolchain.configure_args.append("--enable-ecss-compliance") + tc.configure_args.append("--enable-ecss-compliance") disable_options = { "threads", @@ -188,16 +180,11 @@ def generate(self): } for option in disable_options: if not self.options.get_safe(option): - at_toolchain.configure_args.append(f"--disable-{option}") - - at_toolchain.generate() + tc.configure_args.append(f"--disable-{option}") - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") + tc.generate() def build(self): - apply_conandata_patches(self) autotools = Autotools(self) autotools.autoreconf() autotools.configure() @@ -206,7 +193,6 @@ def build(self): def package(self): autotools = Autotools(self) autotools.install() - fix_apple_shared_install_name(self) copy( self, @@ -232,6 +218,7 @@ def package_info(self): "util": {"requires": ["libc"], "system_libs": ["m"]}, } for component, dependencies in components.items(): + self.cpp_info.components[component].set_property("pkg_config_name", f"liblely-{component}") self.cpp_info.components[component].libs = [f"lely-{component}"] self.cpp_info.components[component].requires = dependencies.get( "requires", [] diff --git a/recipes/leptonica/all/conandata.yml b/recipes/leptonica/all/conandata.yml index 2902df5b0c405c..49782e81d8fcd3 100644 --- a/recipes/leptonica/all/conandata.yml +++ b/recipes/leptonica/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.83.1": + url: "https://github.com/DanBloomberg/leptonica/archive/1.83.1.tar.gz" + sha256: "4289d0a4224b614010072253531c0455a33a4d7c7a0017fe7825ed382290c0da" "1.83.0": url: "https://github.com/DanBloomberg/leptonica/archive/1.83.0.tar.gz" sha256: "14cf531c2219a1414e8e3c51a3caa5cf021a52e782c4a6561bf64d0ef2119282" diff --git a/recipes/leptonica/all/conanfile.py b/recipes/leptonica/all/conanfile.py index 405081e59b3848..6bcb75d8840d65 100644 --- a/recipes/leptonica/all/conanfile.py +++ b/recipes/leptonica/all/conanfile.py @@ -66,28 +66,28 @@ def layout(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_gif: self.requires("giflib/5.2.1") 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.1") elif self.options.with_jpeg == "mozjpeg": - self.requires("mozjpeg/4.1.1") + self.requires("mozjpeg/4.1.5") if self.options.with_png: self.requires("libpng/1.6.40") if self.options.with_tiff: - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_webp: - self.requires("libwebp/1.3.1") + self.requires("libwebp/1.3.2") def build_requirements(self): if self.options.with_webp or self.options.with_openjpeg: if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/leptonica/config.yml b/recipes/leptonica/config.yml index 36297367918ece..7de53a77a39165 100644 --- a/recipes/leptonica/config.yml +++ b/recipes/leptonica/config.yml @@ -1,4 +1,6 @@ versions: + "1.83.1": + folder: all "1.83.0": folder: all "1.82.0": diff --git a/recipes/lerc/all/conandata.yml b/recipes/lerc/all/conandata.yml index f1d58df7a46b7e..73b69372cf8f46 100644 --- a/recipes/lerc/all/conandata.yml +++ b/recipes/lerc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.0.1": + url: "https://github.com/Esri/lerc/archive/js_v4.0.1.tar.gz" + sha256: "d771f45b90dd033187d5fad2b99159d0a98d46878d88d3236147c3df297dd544" "4.0.0": url: "https://github.com/Esri/lerc/archive/refs/tags/v4.0.0.tar.gz" sha256: "91431c2b16d0e3de6cbaea188603359f87caed08259a645fd5a3805784ee30a0" @@ -9,6 +12,10 @@ sources: url: "https://github.com/Esri/lerc/archive/v2.1.tar.gz" sha256: "7c48de40cd5f09319de4b39c417ff4eec4ad4b6aa5d6144f6ffa9b10d18ec94e" patches: + "4.0.1": + - patch_file: "patches/4.0.0-include-algorithm.patch" + patch_description: "include algorithm header for std::min/max" + patch_type: "portability" "4.0.0": - patch_file: "patches/4.0.0-include-algorithm.patch" patch_description: "include algorithm header for std::min/max" diff --git a/recipes/lerc/config.yml b/recipes/lerc/config.yml index 6bcfdf0332e1f2..a09a8d0001ec66 100644 --- a/recipes/lerc/config.yml +++ b/recipes/lerc/config.yml @@ -1,4 +1,6 @@ versions: + "4.0.1": + folder: all "4.0.0": folder: all "2.2": diff --git a/recipes/lexbor/all/conandata.yml b/recipes/lexbor/all/conandata.yml index ae25e89b70b284..ea023ab0ff4cf3 100644 --- a/recipes/lexbor/all/conandata.yml +++ b/recipes/lexbor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.0": + url: "https://github.com/lexbor/lexbor/archive/v2.3.0.zip" + sha256: "5ebdaca76715d737ba5ce5cb782c743caabccdf918854c19c1d5a9a3dd5f19e9" "2.2.0": url: "https://github.com/lexbor/lexbor/archive/v2.2.0.zip" sha256: "837d75e253c9dc157e20246984d7357a7288e2bd2a2b53f371ac047fec3b88e9" diff --git a/recipes/lexbor/config.yml b/recipes/lexbor/config.yml index ca654973c95120..1da7c205b6ff26 100644 --- a/recipes/lexbor/config.yml +++ b/recipes/lexbor/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.0": + folder: "all" "2.2.0": folder: "all" "2.1.0": diff --git a/recipes/libaesgm/all/CMakeLists.txt b/recipes/libaesgm/all/CMakeLists.txt new file mode 100644 index 00000000000000..423d807676428b --- /dev/null +++ b/recipes/libaesgm/all/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 3.8) +project(LibAesgm LANGUAGES C) + +add_library(Aesgm + #sources + ${LIBAESGM_SRC_DIR}/aescrypt.c + ${LIBAESGM_SRC_DIR}/aeskey.c + ${LIBAESGM_SRC_DIR}/aes_modes.c + ${LIBAESGM_SRC_DIR}/aes_ni.c + ${LIBAESGM_SRC_DIR}/aestab.c + #headers + ${LIBAESGM_SRC_DIR}/aescpp.h + ${LIBAESGM_SRC_DIR}/aes.h + ${LIBAESGM_SRC_DIR}/aes_ni.h + ${LIBAESGM_SRC_DIR}/aesopt.h + ${LIBAESGM_SRC_DIR}/aestab.h + ${LIBAESGM_SRC_DIR}/aes_via_ace.h + ${LIBAESGM_SRC_DIR}/brg_endian.h + ${LIBAESGM_SRC_DIR}/brg_types.h +) + +target_include_directories(Aesgm + INTERFACE + $ + $ +) + +if(WIN32 AND BUILD_SHARED_LIBS) + target_compile_definitions(Aesgm PRIVATE DLL_EXPORT) +endif() + +install(TARGETS Aesgm + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install( + FILES + ${LIBAESGM_SRC_DIR}/aes.h + ${LIBAESGM_SRC_DIR}/aes_ni.h + ${LIBAESGM_SRC_DIR}/aes_via_ace.h + ${LIBAESGM_SRC_DIR}/aescpp.h + ${LIBAESGM_SRC_DIR}/aesopt.h + ${LIBAESGM_SRC_DIR}/aestab.h + ${LIBAESGM_SRC_DIR}/brg_endian.h + ${LIBAESGM_SRC_DIR}/brg_types.h + DESTINATION include +) diff --git a/recipes/libaesgm/all/conandata.yml b/recipes/libaesgm/all/conandata.yml new file mode 100644 index 00000000000000..5a2d1592cd3739 --- /dev/null +++ b/recipes/libaesgm/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2013.1.1": + url: "https://github.com/xmake-mirror/libaesgm/archive/refs/tags/2013.1.1.tar.gz" + sha256: "102353a486126c91ccab791c3e718d056d8fbb1be488da81b26561bc7ef4f363" diff --git a/recipes/libaesgm/all/conanfile.py b/recipes/libaesgm/all/conanfile.py new file mode 100644 index 00000000000000..17f6f991a5f99d --- /dev/null +++ b/recipes/libaesgm/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.files import get, copy, load, save +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class LibaesgmConan(ConanFile): + name = "libaesgm" + description = "Library implementation of AES (Rijndael) cryptographic methods" + license = "LicenseRef-libaesgm-BSD" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xmake-mirror/libaesgm" + topics = ("aes", "cryptographic") + 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): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + 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): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBAESGM_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + filename = os.path.join(self.source_folder, "aes.h") + file_content = load(self, filename) + license_end = "*/" + license_contents = file_content[:file_content.find(license_end)].replace("/*", "") + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["Aesgm"] + + self.cpp_info.set_property("cmake_file_name", "Aesgm") + self.cpp_info.set_property("cmake_target_name", "Aesgm::Aesgm") diff --git a/recipes/libaesgm/all/test_package/CMakeLists.txt b/recipes/libaesgm/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..ed4bf02743021a --- /dev/null +++ b/recipes/libaesgm/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +find_package(Aesgm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Aesgm::Aesgm) diff --git a/recipes/libaesgm/all/test_package/conanfile.py b/recipes/libaesgm/all/test_package/conanfile.py new file mode 100644 index 00000000000000..f5cf204295e195 --- /dev/null +++ b/recipes/libaesgm/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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/libaesgm/all/test_package/test_package.c b/recipes/libaesgm/all/test_package/test_package.c new file mode 100644 index 00000000000000..af965724829275 --- /dev/null +++ b/recipes/libaesgm/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +int main() { + aes_encrypt_ctx ctx; + char message[] = "test"; + char key[] = "0123456789ABCDEF"; + aes_encrypt(message, key, &ctx); + + return 0; +} diff --git a/recipes/libaesgm/config.yml b/recipes/libaesgm/config.yml new file mode 100644 index 00000000000000..97cadcf3a32278 --- /dev/null +++ b/recipes/libaesgm/config.yml @@ -0,0 +1,3 @@ +versions: + "2013.1.1": + folder: all diff --git a/recipes/libalsa/all/conandata.yml b/recipes/libalsa/all/conandata.yml index 55a14a6d4051e6..c612ddb389783b 100644 --- a/recipes/libalsa/all/conandata.yml +++ b/recipes/libalsa/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.10": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.10.tar.gz" + sha256: "f55749847fd98274501f4691a2d847e89280c07d40a43cdac43d6443f69fc939" "1.2.7.2": url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.7.2.tar.gz" sha256: "2ed6d908120beb4a91c2271b01489181b28dc9f35f32229ef83bcd5ac8817654" diff --git a/recipes/libalsa/config.yml b/recipes/libalsa/config.yml index b1fdda2825fa62..ce651c2f0d63a3 100644 --- a/recipes/libalsa/config.yml +++ b/recipes/libalsa/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.10": + folder: all "1.2.7.2": folder: all "1.2.7": diff --git a/recipes/libaom-av1/all/conandata.yml b/recipes/libaom-av1/all/conandata.yml index 17b677e8b1c9a1..bb3a5a205cc9ff 100644 --- a/recipes/libaom-av1/all/conandata.yml +++ b/recipes/libaom-av1/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.6.1": + url: "https://storage.googleapis.com/aom-releases/libaom-3.6.1.tar.gz" + sha256: "42b862f58b3d00bd3902d2dc469526574f5b012e5b178e6a9652845a113d6887" "3.6.0": url: "https://storage.googleapis.com/aom-releases/libaom-3.6.0.tar.gz" sha256: "a4a6c0fab685da743b796662a928fcdf7ae60594edc306efb73e78a17ea6cde6" @@ -21,6 +24,10 @@ sources: url: "https://storage.googleapis.com/aom-releases/libaom-2.0.1.tar.gz" sha256: "a0cff299621e2ef885aba219c498fa39a7d9a7ddf47585a118fd66c64ad1b312" patches: + "3.6.1": + - patch_file: "patches/0001-3.4.0-fix-install.patch" + patch_type: conan + patch_description: Install just aom library without aom_static. "3.6.0": - patch_file: "patches/0001-3.4.0-fix-install.patch" patch_type: conan diff --git a/recipes/libaom-av1/config.yml b/recipes/libaom-av1/config.yml index 55199e78919564..2ac5e2242b2d44 100644 --- a/recipes/libaom-av1/config.yml +++ b/recipes/libaom-av1/config.yml @@ -1,4 +1,6 @@ versions: + "3.6.1": + folder: all "3.6.0": folder: all "3.5.0": diff --git a/recipes/libarchive/all/conandata.yml b/recipes/libarchive/all/conandata.yml index 9a164839a427bb..b08c943036aa4d 100644 --- a/recipes/libarchive/all/conandata.yml +++ b/recipes/libarchive/all/conandata.yml @@ -1,4 +1,10 @@ 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" "3.6.2": url: "https://github.com/libarchive/libarchive/releases/download/v3.6.2/libarchive-3.6.2.tar.xz" sha256: "9e2c1b80d5fbe59b61308fdfab6c79b5021d7ff4ff2489fb12daf0a96a83551d" @@ -21,6 +27,36 @@ 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" + patch_type: "portability" + patch_source: "https://github.com/libarchive/libarchive/pull/2007" + - patch_file: "patches/0001-3.7.1-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.6.2": - patch_file: "patches/0001-3.6.2-zlib-winapi.patch" patch_description: "Remove broken ZLIB WINAPI check" @@ -31,6 +67,9 @@ patches: - patch_file: "patches/0005-3.6.2-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.6.2-fix-msvc-build.patch" + patch_description: "Fix MSVC build" + patch_type: "conan" "3.6.1": - patch_file: "patches/0001-3.6.0-zlib-winapi.patch" patch_description: "Remove broken ZLIB WINAPI check" @@ -62,7 +101,7 @@ patches: - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" patch_description: "Remove broken ZLIB WINAPI check" patch_type: "portability" - - patch_file: "patches/0003-3.4.3-cmake.patch" + - patch_file: "patches/0003-3.5.1-cmake.patch" patch_description: "Make CMake cooperate with Conan" patch_type: "conan" "3.4.3": diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 7b3f2cc70c9d01..41ace49a160e29 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -81,17 +81,17 @@ def layout(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_libxml2: - self.requires("libxml2/2.10.4") + self.requires("libxml2/2.12.2") if self.options.with_expat: self.requires("expat/2.5.0") if self.options.with_iconv: self.requires("libiconv/1.17") if self.options.with_pcreposix: - self.requires("pcre/8.45") + self.requires("pcre2/10.42") if self.options.with_nettle: self.requires("nettle/3.8.1") if self.options.with_openssl: @@ -103,11 +103,11 @@ def requirements(self): if self.options.with_lzo: self.requires("lzo/2.10") if self.options.with_lzma: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.5") if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.get_safe("with_mbedtls"): - self.requires("mbedtls/3.2.1") + self.requires("mbedtls/3.5.0") def validate(self): if self.settings.os != "Windows" and self.options.with_cng: @@ -149,11 +149,15 @@ 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": tc.variables["ENABLE_MBEDTLS"] = self.options.with_mbedtls tc.variables["ENABLE_XATTR"] = self.options.with_xattr + # TODO: Remove after fixing https://github.com/conan-io/conan/issues/12012 + if is_msvc(self): + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) tc.generate() def build(self): diff --git a/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch index 62dd3ef8198757..9e88323972df92 100644 --- a/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch +++ b/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 713e3bc..2315da5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -430,14 +430,7 @@ IF(ZLIB_FOUND) +@@ -430,14 +430,14 @@ IF(ZLIB_FOUND) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) IF(WIN32 AND NOT CYGWIN) @@ -14,6 +14,13 @@ index 713e3bc..2315da5 100644 - 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) diff --git a/recipes/libarchive/all/patches/0001-3.7.1-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.7.1-zlib-winapi.patch new file mode 100644 index 00000000000000..beb5f743fa31fb --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.7.1-zlib-winapi.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6849ce40..57cf7f8f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -444,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/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.4.0-cmake.patch b/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch index 7b724f1fba1643..7b34085f1a3a25 100644 --- a/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch +++ b/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch @@ -56,6 +56,47 @@ index 4ffd0930..01e8592c 100644 FIND_PACKAGE(OpenSSL) IF(OPENSSL_FOUND) SET(HAVE_LIBCRYPTO 1) +@@ -1316,7 +1316,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1348,11 +1348,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCRTOMB 1) ++set(HAVE_WCSCMP 1) ++set(HAVE_WCSCPY 1) ++set(HAVE_WCSLEN 1) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1364,10 +1364,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_VPRINTF 1) ++set(HAVE_WMEMCMP 1) ++set(HAVE_WMEMCPY 1) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt index ec775bb4..8ef2d620 100644 --- a/libarchive/CMakeLists.txt diff --git a/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch b/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch index 5c46b58290b772..45a9561474f8e2 100644 --- a/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch +++ b/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch @@ -56,6 +56,55 @@ index 6013d9e6..125b1cb3 100644 FIND_PACKAGE(OpenSSL) IF(OPENSSL_FOUND) SET(HAVE_LIBCRYPTO 1) +@@ -1349,7 +1349,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1371,6 +1371,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR) + CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP) + CHECK_FUNCTION_EXISTS_GLIBC(strerror HAVE_STRERROR) + CHECK_FUNCTION_EXISTS_GLIBC(strncpy_s HAVE_STRNCPY_S) ++CHECK_FUNCTION_EXISTS_GLIBC(strnlen HAVE_STRNLEN) + CHECK_FUNCTION_EXISTS_GLIBC(strrchr HAVE_STRRCHR) + CHECK_FUNCTION_EXISTS_GLIBC(symlink HAVE_SYMLINK) + CHECK_FUNCTION_EXISTS_GLIBC(timegm HAVE_TIMEGM) +@@ -1381,11 +1382,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCRTOMB 1) ++set(HAVE_WCSCMP 1) ++set(HAVE_WCSCPY 1) ++set(HAVE_WCSLEN 1) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1398,10 +1399,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_VPRINTF 1) ++set(HAVE_WMEMCMP 1) ++set(HAVE_WMEMCPY 1) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt index 9389bbc9..76e0b5c7 100644 --- a/libarchive/CMakeLists.txt diff --git a/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch b/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch new file mode 100644 index 00000000000000..181a183093fc3e --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch @@ -0,0 +1,142 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 256b966e..30c42967 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ endif() + # + PROJECT(libarchive C) + # +-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") ++list(APPEND 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() +@@ -418,7 +418,7 @@ IF(ZLIB_FOUND) + SET(HAVE_LIBZ 1) + SET(HAVE_ZLIB_H 1) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) +- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) ++ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) + IF(WIN32 AND NOT CYGWIN) + set(ZLIB_WINAPI yes) + IF(ZLIB_WINAPI) +@@ -480,7 +480,7 @@ IF(LIBLZMA_FOUND) + SET(HAVE_LIBLZMA 1) + SET(HAVE_LZMA_H 1) + CMAKE_PUSH_CHECK_STATE() +- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) ++ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) + INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) + LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) +@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) + ELSE(LIBLZMA_FOUND) + # LZMA not found and will not be used. + ENDIF(LIBLZMA_FOUND) +-MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) ++MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) + MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) + + # +@@ -567,7 +567,7 @@ IF(ENABLE_LZ4) + ENDIF (LZ4_INCLUDE_DIR) + + FIND_PATH(LZ4_INCLUDE_DIR lz4.h) +- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) ++ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) + INCLUDE(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) + ELSE(ENABLE_LZ4) +@@ -783,7 +783,7 @@ ENDIF(ENABLE_NETTLE) + # Find OpenSSL + # (Except on Mac, where OpenSSL is deprecated.) + # +-IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") ++IF(ENABLE_OPENSSL) + FIND_PACKAGE(OpenSSL) + IF(OPENSSL_FOUND) + SET(HAVE_LIBCRYPTO 1) +@@ -1349,7 +1349,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1382,11 +1382,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCRTOMB 1) ++set(HAVE_WCSCMP 1) ++set(HAVE_WCSCPY 1) ++set(HAVE_WCSLEN 1) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1399,10 +1399,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_VPRINTF 1) ++set(HAVE_WMEMCMP 1) ++set(HAVE_WMEMCPY 1) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + +diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt +index 9389bbc9..76e0b5c7 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -236,11 +236,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) + ENDIF() + + # Libarchive is a shared library ++if (BUILD_SHARED_LIBS) ++ + ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) + TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) + SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) + ++else() ++ + # archive_static is a static library + ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +@@ -250,13 +254,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS + IF(NOT WIN32 OR CYGWIN) + SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) + ENDIF(NOT WIN32 OR CYGWIN) ++endif() + + IF(ENABLE_INSTALL) + # How to install the libraries +- INSTALL(TARGETS archive archive_static ++ if (BUILD_SHARED_LIBS) ++ INSTALL(TARGETS archive ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ else() ++ 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/all/patches/0003-3.5.2-cmake.patch b/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch index 5584b5f1606bc0..46955b7f8f7ce1 100644 --- a/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch +++ b/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch @@ -56,6 +56,47 @@ index e0359b51..3927a742 100644 FIND_PACKAGE(OpenSSL) IF(OPENSSL_FOUND) SET(HAVE_LIBCRYPTO 1) +@@ -1350,7 +1350,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1383,11 +1383,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCRTOMB 1) ++set(HAVE_WCSCMP 1) ++set(HAVE_WCSCPY 1) ++set(HAVE_WCSLEN 1) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1400,10 +1400,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_VPRINTF 1) ++set(HAVE_WMEMCMP 1) ++set(HAVE_WMEMCPY 1) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt index e1d76a51..792b26b3 100644 --- a/libarchive/CMakeLists.txt diff --git a/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch b/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch index 436c8194e3e4dc..3c89010df2abab 100644 --- a/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch +++ b/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch @@ -56,6 +56,47 @@ index 646e5ce7..9bca273f 100644 FIND_PACKAGE(OpenSSL) IF(OPENSSL_FOUND) SET(HAVE_LIBCRYPTO 1) +@@ -1357,7 +1357,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1390,11 +1390,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCRTOMB 1) ++set(HAVE_WCSCMP 1) ++set(HAVE_WCSCPY 1) ++set(HAVE_WCSLEN 1) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1407,10 +1407,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_VPRINTF 1) ++set(HAVE_WMEMCMP 1) ++set(HAVE_WMEMCPY 1) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt index e1d76a51..713c6496 100644 --- a/libarchive/CMakeLists.txt diff --git a/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch b/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch index 80d49396aac872..aca2961950d2df 100644 --- a/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch +++ b/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2315da5..1d8de96 100644 +index a4a9284a..f5dbccac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ endif() @@ -18,9 +18,9 @@ index 2315da5..1d8de96 100644 - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) + LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -490,7 +490,7 @@ IF(LIBLZMA_FOUND) + + +@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) SET(HAVE_LIBLZMA 1) SET(HAVE_LZMA_H 1) CMAKE_PUSH_CHECK_STATE() @@ -29,7 +29,7 @@ index 2315da5..1d8de96 100644 SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -507,7 +507,7 @@ IF(LIBLZMA_FOUND) +@@ -514,7 +514,7 @@ IF(LIBLZMA_FOUND) ELSE(LIBLZMA_FOUND) # LZMA not found and will not be used. ENDIF(LIBLZMA_FOUND) @@ -38,7 +38,7 @@ index 2315da5..1d8de96 100644 MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) # -@@ -577,7 +577,7 @@ IF(ENABLE_LZ4) +@@ -584,7 +584,7 @@ IF(ENABLE_LZ4) ENDIF (LZ4_INCLUDE_DIR) FIND_PATH(LZ4_INCLUDE_DIR lz4.h) @@ -47,7 +47,7 @@ index 2315da5..1d8de96 100644 INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) ELSE(ENABLE_LZ4) -@@ -799,7 +799,7 @@ ENDIF(ENABLE_NETTLE) +@@ -806,7 +806,7 @@ ENDIF(ENABLE_NETTLE) # Find OpenSSL # (Except on Mac, where OpenSSL is deprecated.) # @@ -57,46 +57,41 @@ index 2315da5..1d8de96 100644 IF(OPENSSL_FOUND) SET(HAVE_LIBCRYPTO 1) diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index ff7ade0..1438819 100644 +index ff7ade00..8c867130 100644 --- a/libarchive/CMakeLists.txt +++ b/libarchive/CMakeLists.txt -@@ -243,11 +243,14 @@ ELSEIF(ARCHIVE_ACL_SUNOS) +@@ -242,13 +242,13 @@ ELSEIF(ARCHIVE_ACL_SUNOS) + LIST(APPEND libarchive_SOURCES archive_disk_acl_sunos.c) ENDIF() - # Libarchive is a shared library +-# Libarchive is a shared library +if (BUILD_SHARED_LIBS) ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) +-# archive_static is a static library +else() -+ - # archive_static is a static library ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -257,13 +260,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS + SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS +@@ -257,13 +257,13 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS IF(NOT WIN32 OR CYGWIN) SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) ENDIF(NOT WIN32 OR CYGWIN) +- +endif() - IF(ENABLE_INSTALL) - # How to install the libraries +- # How to install the libraries - INSTALL(TARGETS archive archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) ++ INSTALL(TARGETS archive RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + else() -+ INSTALL(TARGETS archive_static -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) ++ INSTALL(TARGETS archive_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + endif() INSTALL_MAN(${libarchive_MANS}) INSTALL(FILES ${include_HEADERS} DESTINATION include) diff --git a/recipes/libarchive/all/patches/0003-3.7.1-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.1-cmake.patch new file mode 100644 index 00000000000000..67a75a07b08b2c --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.7.1-cmake.patch @@ -0,0 +1,91 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6849ce40..8d5b6018 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,7 @@ endif() + # + PROJECT(libarchive C) + # +-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") ++LIST(APPEND 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() +@@ -442,7 +442,7 @@ IF(ZLIB_FOUND) + SET(HAVE_LIBZ 1) + SET(HAVE_ZLIB_H 1) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) +- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) ++ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) + IF(WIN32 AND NOT CYGWIN) + + +@@ -511,7 +511,7 @@ IF(LIBLZMA_FOUND) + SET(HAVE_LIBLZMA 1) + SET(HAVE_LZMA_H 1) + CMAKE_PUSH_CHECK_STATE() +- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) ++ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) + INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) + LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) +@@ -532,7 +532,7 @@ ELSE(LIBLZMA_FOUND) + # LZMA not found and will not be used. + SET(HAVE_LZMA_STREAM_ENCODER_MT 0) + ENDIF(LIBLZMA_FOUND) +-MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) ++MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) + MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) + + # +@@ -603,7 +603,7 @@ IF(ENABLE_LZ4) + ENDIF (LZ4_INCLUDE_DIR) + + FIND_PATH(LZ4_INCLUDE_DIR lz4.h) +- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) ++ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) + INCLUDE(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) + ELSE(ENABLE_LZ4) +@@ -827,7 +827,7 @@ ENDIF(ENABLE_NETTLE) + # Find OpenSSL + # (Except on Mac, where OpenSSL is deprecated.) + # +-IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") ++IF(ENABLE_OPENSSL) + 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/all/patches/0005-3.6.2-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch index 4bca48088c19b8..69e42f1f5678b4 100644 --- a/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch +++ b/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch @@ -1,27 +1,35 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1d8de96f..d54975b7 100644 +index f5dbccac..ea7ff16a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -829,6 +829,8 @@ ENDIF(NOT OPENSSL_FOUND) +@@ -830,12 +830,11 @@ IF(NOT OPENSSL_FOUND) + ENDIF(NOT OPENSSL_FOUND) + + # +-# How to prove that CRYPTO functions, which have several names on various +-# platforms, just see if archive_digest.c can compile and link against +-# required libraries. # MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) - FOREACH(ALGORITHM ${ALGORITHMS}) +- FOREACH(ALGORITHM ${ALGORITHMS}) ++ FOREACH(ALGORITHM ${ALGORITHMS}) + include(CMakePushCheckState) + cmake_push_check_state() IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) STRING(TOLOWER "${ALGORITHM}" lower_algorithm) STRING(TOUPPER "${ALGORITHM}" algorithm) -@@ -849,8 +851,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) +@@ -856,8 +855,8 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) SET(TRY_CRYPTO_REQUIRED_INCLUDES "${TRY_CRYPTO_REQUIRED_INCLUDES};${OPENSSL_INCLUDE_DIR}") - SET(TRY_CRYPTO_REQUIRED_LIBS - "-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}") -+ set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES ++ ${OPENSSL_LIBRARIES}) ELSEIF("${IMPLEMENTATION}" MATCHES "^MBEDTLS$" AND MBEDTLS_FOUND) SET(TRY_CRYPTO_REQUIRED_INCLUDES "${TRY_CRYPTO_REQUIRED_INCLUDES};${MBEDTLS_INCLUDE_DIRS}") -@@ -927,6 +928,7 @@ main(int argc, char **argv) +@@ -934,6 +933,7 @@ main(int argc, char **argv) ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) diff --git a/recipes/libarchive/all/patches/0005-3.7.1-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.1-try-compile-cmakedeps.patch new file mode 100644 index 00000000000000..c71291d02944a7 --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.1-try-compile-cmakedeps.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6849ce40..e7c9fbee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -854,14 +854,14 @@ IF(NOT OPENSSL_FOUND) + ENDIF(LIBMD_FOUND) + ENDIF(NOT OPENSSL_FOUND) + +-# + # How to prove that CRYPTO functions, which have several names on various + # platforms, just see if archive_digest.c can compile and link against + # required libraries. +-# + MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) ++ include(CMakePushCheckState) + FOREACH(ALGORITHM ${ALGORITHMS}) + IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) ++ cmake_push_check_state() + STRING(TOLOWER "${ALGORITHM}" lower_algorithm) + STRING(TOUPPER "${ALGORITHM}" algorithm) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) +@@ -881,8 +881,8 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "${TRY_CRYPTO_REQUIRED_INCLUDES};${OPENSSL_INCLUDE_DIR}") +- SET(TRY_CRYPTO_REQUIRED_LIBS +- "-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}") ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) ++ + ELSEIF("${IMPLEMENTATION}" MATCHES "^MBEDTLS$" AND MBEDTLS_FOUND) + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "${TRY_CRYPTO_REQUIRED_INCLUDES};${MBEDTLS_INCLUDE_DIRS}") diff --git a/recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch new file mode 100644 index 00000000000000..c0903cf80cf947 --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 713e3bc5..9bc36214 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1374,7 +1374,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1407,11 +1407,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCRTOMB 1) ++set(HAVE_WCSCMP 1) ++set(HAVE_WCSCPY 1) ++set(HAVE_WCSLEN 1) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1424,10 +1424,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_VPRINTF 1) ++set(HAVE_WMEMCMP 1) ++set(HAVE_WMEMCPY 1) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + +-- +2.33.0.windows.1 + diff --git a/recipes/libarchive/all/patches/0006-3.7.1-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.1-fix-msvc-build.patch new file mode 100644 index 00000000000000..04ec53a2e20baf --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.7.1-fix-msvc-build.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6849ce40..d5dac48b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1401,7 +1401,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++SET(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1434,11 +1434,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++SET(HAVE_WCRTOMB 1) ++SET(HAVE_WCSCMP 1) ++SET(HAVE_WCSCPY 1) ++SET(HAVE_WCSLEN 1) ++SET(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) + CHECK_SYMBOL_EXISTS(ctime_s "time.h" HAVE_CTIME_S) +@@ -1451,10 +1451,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++SET(HAVE_VPRINTF 1) ++SET(HAVE_WMEMCMP 1) ++SET(HAVE_WMEMCPY 1) ++SET(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + diff --git a/recipes/libarchive/all/patches/0007-3.7.1-include-getopt.patch b/recipes/libarchive/all/patches/0007-3.7.1-include-getopt.patch new file mode 100644 index 00000000000000..6db790a6cd811f --- /dev/null +++ b/recipes/libarchive/all/patches/0007-3.7.1-include-getopt.patch @@ -0,0 +1,13 @@ +--- unzip/bsdunzip.c 2023-07-29 19:27:43.000000000 +0200 ++++ unzip/bsdunzip.c 2023-10-28 13:19:27.181106700 +0200 +@@ -78,6 +78,10 @@ + #include + #endif + #endif ++#ifdef HAVE_GETOPT_OPTRESET ++#include ++#endif ++ + + #include + #include diff --git a/recipes/libarchive/config.yml b/recipes/libarchive/config.yml index 2cfb62acf52281..03318759191465 100644 --- a/recipes/libarchive/config.yml +++ b/recipes/libarchive/config.yml @@ -1,4 +1,8 @@ versions: + "3.7.2": + folder: all + "3.7.1": + folder: all "3.6.2": folder: all "3.6.1": diff --git a/recipes/libassert/all/conandata.yml b/recipes/libassert/all/conandata.yml index ce3617941de3e7..1cae5dc94ff578 100644 --- a/recipes/libassert/all/conandata.yml +++ b/recipes/libassert/all/conandata.yml @@ -1,5 +1,13 @@ sources: # Newer versions at the top + "1.2.2": + url: + - "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v1.2.2.tar.gz" + sha256: "68206b43bc4803357ba7d366574b4631bd327c46ab76ddef6ff9366784fa6b3c" + "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 +18,14 @@ sources: sha256: "e1bb3b50767994ca4d0f60b7977b279cf32b8569ff92c5830e7a1de567b82fd5" patches: + "1.2.2": + - patch_file: "patches/1.2.2/0001-cpptrace-dll-copy.patch" + patch_type: "conan" + patch_description: "Disable custom command to copy cpptrace.dll on windows" + "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..c596be696aeb2e 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,12 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + if Version(self.version) >= Version("1.2.2"): + self.requires("cpptrace/0.3.1") + elif 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 +77,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) - toolchain.generate() + 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() + + tc.generate() def build(self): apply_conandata_patches(self) @@ -93,6 +105,15 @@ def package(self): 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")) rmdir(self, os.path.join(self.package_folder, "share")) @@ -106,13 +127,19 @@ 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" self.cpp_info.filenames["cmake_find_package_multi"] = "assert" 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/patches/1.2.2/0001-cpptrace-dll-copy.patch b/recipes/libassert/all/patches/1.2.2/0001-cpptrace-dll-copy.patch new file mode 100644 index 00000000000000..27871ced2d3f05 --- /dev/null +++ b/recipes/libassert/all/patches/1.2.2/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 +@@ -163,7 +163,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..8ade5083845352 100644 --- a/recipes/libassert/config.yml +++ b/recipes/libassert/config.yml @@ -1,5 +1,9 @@ versions: # Newer versions at the top + "1.2.2": + folder: all + "1.2.1": + folder: all "1.1": folder: all "1.0": diff --git a/recipes/libavif/all/conandata.yml b/recipes/libavif/all/conandata.yml index 1889bd2ede18fd..4c6e091c13d316 100644 --- a/recipes/libavif/all/conandata.yml +++ b/recipes/libavif/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.0.2": + url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v1.0.2.tar.gz" + sha256: "de8bf79488c5b523b77358df8b85ae69c3078e6b3f1636fc1f313f952269ad20" + "1.0.1": + url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v1.0.1.tar.gz" + sha256: "398fe7039ce35db80fe7da8d116035924f2c02ea4a4aa9f4903df6699287599c" "0.11.1": url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.11.1.tar.gz" sha256: "0eb49965562a0e5e5de58389650d434cff32af84c34185b6c9b7b2fccae06d4e" @@ -6,6 +12,14 @@ sources: url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.9.3.tar.gz" sha256: "bcd9a1f57f982a9615eb7e2faf87236dc88eb1d0c886f3471c7440ead605060d" patches: + "1.0.2": + - patch_file: patches/1.0.1-0001-disable-developer-only-codepaths.patch + patch_description: "disable compiler options for develop" + patch_type: "portability" + "1.0.1": + - patch_file: patches/1.0.1-0001-disable-developer-only-codepaths.patch + patch_description: "disable compiler options for develop" + patch_type: "portability" "0.11.1": - patch_file: patches/0.11.1-0001-disable-developer-only-codepaths.patch patch_description: "disable compiler options for develop" diff --git a/recipes/libavif/all/conanfile.py b/recipes/libavif/all/conanfile.py index dc46d0267dd992..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) @@ -47,14 +54,19 @@ def _has_dav1d(self): return self.options.with_decoder == "dav1d" def requirements(self): - self.requires("libaom-av1/3.5.0") + self.requires("libaom-av1/3.6.1") self.requires("libyuv/1854") if self._has_dav1d: - self.requires("dav1d/1.0.0") + 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/libavif/all/patches/1.0.1-0001-disable-developer-only-codepaths.patch b/recipes/libavif/all/patches/1.0.1-0001-disable-developer-only-codepaths.patch new file mode 100644 index 00000000000000..9bedacfdc3b86e --- /dev/null +++ b/recipes/libavif/all/patches/1.0.1-0001-disable-developer-only-codepaths.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1f0cde1..4ad03b6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,11 +70,13 @@ if(AVIF_LOCAL_LIBGAV1) + enable_language(CXX) + endif() + ++if(0) + if(APPLE) + set(XCRUN xcrun) + else() + set(XCRUN) + endif() ++endif() + + if(BUILD_SHARED_LIBS) + set(AVIF_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}") +@@ -209,6 +211,7 @@ else(libsharpyuv_FOUND) + endif(libsharpyuv_FOUND) + # --------------------------------------------------------------------------------------- + ++if(0) + # Enable all warnings + include(CheckCCompilerFlag) + if(CMAKE_C_COMPILER_ID MATCHES "Clang") +@@ -257,6 +260,7 @@ if(AVIF_ENABLE_COVERAGE) + message(WARNING "libavif: Ignoring request for coverage (AVIF_ENABLE_COVERAGE); only clang is currently supported.") + endif() + endif() ++endif() + + if(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R) + add_compile_definitions(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R) diff --git a/recipes/libavif/config.yml b/recipes/libavif/config.yml index f3e6d6038f1fa1..4c37b1d7a9e9ab 100644 --- a/recipes/libavif/config.yml +++ b/recipes/libavif/config.yml @@ -1,4 +1,8 @@ versions: + "1.0.2": + folder: all + "1.0.1": + folder: all "0.11.1": folder: all "0.9.3": diff --git a/recipes/libb2/all/CMakeLists.txt b/recipes/libb2/all/CMakeLists.txt index ba9b7e9e279482..9834b369a4d4be 100644 --- a/recipes/libb2/all/CMakeLists.txt +++ b/recipes/libb2/all/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.12) project(b2 C) -include("conanbuildinfo.cmake") -conan_basic_setup() - if(WIN32 AND BUILD_SHARED_LIBS AND MSVC) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() @@ -11,38 +8,40 @@ endif() option(USE_SSE "Optimized for speed on CPUs supporting SSE2, SSSE3, SSE4.1, AVX, or XOP" OFF) option(USE_NEON "Optimiced for arm CPUs" OFF) +set(src ${CMAKE_CURRENT_LIST_DIR}/src) + if (USE_NEON) message(STATUS "Using neon sources") - set(SOURCE_FILES source_subfolder/neon/blake2b-neon.c - source_subfolder/neon/blake2bp.c - source_subfolder/neon/blake2s-neon.c - source_subfolder/neon/blake2xb.c - source_subfolder/neon/blake2sp.c - source_subfolder/neon/blake2xs.c) + set(SOURCE_FILES ${src}/neon/blake2b-neon.c + ${src}/neon/blake2bp.c + ${src}/neon/blake2s-neon.c + ${src}/neon/blake2xb.c + ${src}/neon/blake2sp.c + ${src}/neon/blake2xs.c) elseif (USE_SSE) message(STATUS "Using sse sources") - set(SOURCE_FILES source_subfolder/sse/blake2b.c - source_subfolder/sse/blake2bp.c - source_subfolder/sse/blake2s.c - source_subfolder/sse/blake2sp.c - source_subfolder/sse/blake2xb.c - source_subfolder/sse/blake2xs.c) + set(SOURCE_FILES ${src}/sse/blake2b.c + ${src}/sse/blake2bp.c + ${src}/sse/blake2s.c + ${src}/sse/blake2sp.c + ${src}/sse/blake2xb.c + ${src}/sse/blake2xs.c) else () message(STATUS "Using ref sources") - set(SOURCE_FILES source_subfolder/ref/blake2bp-ref.c - source_subfolder/ref/blake2b-ref.c - source_subfolder/ref/blake2sp-ref.c - source_subfolder/ref/blake2s-ref.c - source_subfolder/ref/blake2xb-ref.c - source_subfolder/ref/blake2xs-ref.c) + set(SOURCE_FILES ${src}/ref/blake2bp-ref.c + ${src}/ref/blake2b-ref.c + ${src}/ref/blake2sp-ref.c + ${src}/ref/blake2s-ref.c + ${src}/ref/blake2xb-ref.c + ${src}/ref/blake2xs-ref.c) endif() add_library(${CMAKE_PROJECT_NAME} ${SOURCE_FILES}) -set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER source_subfolder/ref/blake2.h) +set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER ${src}/ref/blake2.h) +include(GNUInstallDirs) install(TARGETS ${CMAKE_PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libb2 - ) + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libb2) diff --git a/recipes/libb2/all/conanfile.py b/recipes/libb2/all/conanfile.py index 88ad67891d73b3..ffc67ff6345fe6 100644 --- a/recipes/libb2/all/conanfile.py +++ b/recipes/libb2/all/conanfile.py @@ -1,65 +1,83 @@ import os -import glob -from conans import ConanFile, tools, CMake -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 + +required_conan_version = ">=1.53.0" + class libb2Conan(ConanFile): name = "libb2" + description = ( + "libb2 is a library that implements the BLAKE2 cryptographic hash function, which is faster than MD5, " + "SHA-1, SHA-2, and SHA-3, yet is at least as secure as the latest standard SHA-3" + ) license = ["CC0-1.0", "OpenSSL", "APSL-2.0"] url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/BLAKE2/BLAKE2" - description = ("libb2 is a library that implemets the BLAKE2 cryptographic hash function, which is faster than MD5, \ - SHA-1, SHA-2, and SHA-3, yet is at least as secure as the latest standard SHA-3") + topics = ("blake2", "hash") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - topics = ("conan", "blake2", "hash") - exports_sources = ["CMakeLists.txt"] - generators = ["cmake"] - options = {"fPIC": [True, False], "shared": [True, False], "use_sse": [True, False], "use_neon": [True, False]} - default_options = {"fPIC": True, "shared": False, "use_sse": False, "use_neon": False} - _cmake = None + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_sse": [True, False], + "use_neon": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_sse": False, + "use_neon": False, + } - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) - @property - def _build_subfolder(self): - return "build_subfolder" + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + if self.options.shared: + 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") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) if self.options.use_neon and not "arm" in self.settings.arch: raise ConanInvalidConfiguration("Neon sources only supported on arm-based CPUs") if self.options.use_neon and self.options.use_sse: raise ConanInvalidConfiguration("Neon and SSE can not be used together.") - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("BLAKE2-*")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["USE_SSE"] = self.options.use_sse - self._cmake.definitions["USE_NEON"] = self.options.use_neon - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_SSE"] = self.options.use_sse + tc.variables["USE_NEON"] = self.options.use_neon + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) cmake.build() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "COPYING", 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 = tools.collect_libs(self) - self.cpp_info.includedirs = ["include", os.path.join("include","libb2")] + self.cpp_info.libs = ["b2"] + self.cpp_info.includedirs = ["include", os.path.join("include", "libb2")] diff --git a/recipes/libb2/all/test_package/CMakeLists.txt b/recipes/libb2/all/test_package/CMakeLists.txt index 6aab347eddf535..a422f3ac0c116e 100644 --- a/recipes/libb2/all/test_package/CMakeLists.txt +++ b/recipes/libb2/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libb2 REQUIRED CONFIG) add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example libb2::libb2) set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/libb2/all/test_package/conanfile.py b/recipes/libb2/all/test_package/conanfile.py index 0383b1729b0649..8d52b7021efe14 100644 --- a/recipes/libb2/all/test_package/conanfile.py +++ b/recipes/libb2/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 blake2TestConan(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) @@ -11,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/libb2/all/test_v1_package/CMakeLists.txt b/recipes/libb2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libb2/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/libb2/all/test_v1_package/conanfile.py b/recipes/libb2/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..24ecc57793dc6f --- /dev/null +++ b/recipes/libb2/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class blake2TestConan(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", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/libbasisu/all/CMakeLists.txt b/recipes/libbasisu/all/CMakeLists.txt deleted file mode 100644 index bd4164cb5c1c75..00000000000000 --- a/recipes/libbasisu/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/libbasisu/all/conandata.yml b/recipes/libbasisu/all/conandata.yml index 7cca98d66479be..7f4a8cfdd695f4 100644 --- a/recipes/libbasisu/all/conandata.yml +++ b/recipes/libbasisu/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "1.15.0": - patch_file: "patches/cmakelist_build_lib.patch" - base_path: "source_subfolder" diff --git a/recipes/libbasisu/all/conanfile.py b/recipes/libbasisu/all/conanfile.py index 6dfaf4ee7f3dec..2c8606aca448ad 100644 --- a/recipes/libbasisu/all/conanfile.py +++ b/recipes/libbasisu/all/conanfile.py @@ -1,114 +1,133 @@ import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -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, collect_libs, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class LibBasisUniversalConan(ConanFile): name = "libbasisu" description = "Basis Universal Supercompressed GPU Texture Codec" - homepage = "https://github.com/BinomialLLC/basis_universal" - topics = ("conan", "basis", "textures", "compression") - url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" - exports_sources = ["CMakeLists.txt", "patches/*"] - generators = "cmake" - settings = "os", "compiler", "build_type", "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/BinomialLLC/basis_universal" + topics = ("basis", "textures", "compression") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { - "fPIC": [True, False], "shared": [True, False], + "fPIC": [True, False], "use_sse4": [True, False], "with_zstd": [True, False], "enable_encoder": [True, False], - "custom_iterator_debug_level": [True, False] + "custom_iterator_debug_level": [True, False], } default_options = { - "fPIC": True, "shared": False, + "fPIC": True, "use_sse4": False, "with_zstd": True, "enable_encoder": True, - "custom_iterator_debug_level": False + "custom_iterator_debug_level": False, } - _cmake = None + def _minimum_compiler_version(self): + return { + "Visual Studio": "15", + "gcc": "5.4", + "clang": "3.9", + "apple-clang": "10", + } - @property - def _source_subfolder(self): - return "source_subfolder" + def _use_custom_iterator_debug_level(self): + return self.options.get_safe("custom_iterator_debug_level", + default=self.default_options["custom_iterator_debug_level"]) - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) - def _use_custom_iterator_debug_level(self): - return self.options.get_safe("custom_iterator_debug_level", default=self.default_options["custom_iterator_debug_level"]) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.compiler != "Visual Studio": - del self.options.custom_iterator_debug_level + if not is_msvc(self): + self.options.rm_safe("custom_iterator_debug_level") - def _minimum_compiler_version(self) -> bool: - return { - "Visual Studio": "15", - "gcc": "5.4", - "clang": "3.9", - "apple-clang": "10" - } + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + if self.options.with_zstd: + self.requires("zstd/1.5.5") + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): min_version = self._minimum_compiler_version().get(str(self.settings.compiler)) if not min_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) - elif tools.Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} {} does not support compiler with version {} {}, minimum supported compiler version is {} ".format(self.name, self.version, self.settings.compiler, self.settings.compiler.version, min_version)) + self.output.warning( + f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support." + ) + elif Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.name} {self.version} does not support compiler with version" + f" {self.settings.compiler} {self.settings.compiler.version}, minimum supported compiler" + f" version is {min_version} " + ) if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) - - def configure(self): - if self.options.shared: - del self.options.fPIC + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["SSE4"] = self.options.use_sse4 - self._cmake.definitions["ZSTD"] = self.options.with_zstd - self._cmake.definitions["ENABLE_ENCODER"] = self.options.enable_encoder - self._cmake.definitions["NO_ITERATOR_DEBUG_LEVEL"] = not self._use_custom_iterator_debug_level() - 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["SSE4"] = self.options.use_sse4 + tc.variables["ZSTD"] = self.options.with_zstd + tc.variables["ENABLE_ENCODER"] = self.options.enable_encoder + tc.variables["NO_ITERATOR_DEBUG_LEVEL"] = not self._use_custom_iterator_debug_level() + 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) - self.copy("*.h", dst=os.path.join("include", self.name, "transcoder"), src=os.path.join(self._source_subfolder, "transcoder")) + 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", self.name, "transcoder"), + src=os.path.join(self.source_folder, "transcoder")) if self.options.enable_encoder: - self.copy("*.h", dst=os.path.join("include", self.name, "encoder"), src=os.path.join(self._source_subfolder, "encoder")) - self.copy(pattern="*.a", dst="lib", keep_path=False) - self.copy(pattern="*.so", dst="lib", keep_path=False) - self.copy(pattern="*.dylib*", dst="lib", keep_path=False) - self.copy(pattern="*.lib", dst="lib", keep_path=False) - self.copy(pattern="*.dll", dst="bin", keep_path=False) + copy(self,"*.h", + dst=os.path.join(self.package_folder, "include", self.name, "encoder"), + src=os.path.join(self.source_folder, "encoder")) + for pattern in ["*.a", "*.so*", "*.dylib*", "*.lib"]: + copy(self, pattern, + dst=os.path.join(self.package_folder, "lib"), + src=self.build_folder, keep_path=False) + copy(self, "*.dll", + dst=os.path.join(self.package_folder, "bin"), + src=self.build_folder, keep_path=False) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) - self.cpp_info.names["cmake_find_package"] = self.name - self.cpp_info.names["cmake_find_package_multi"] = self.name + self.cpp_info.libs = collect_libs(self) self.cpp_info.includedirs = ["include", os.path.join("include", self.name)] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m", "pthread"] - self.cpp_info.defines.append("BASISU_NO_ITERATOR_DEBUG_LEVEL={}".format("1" if self._use_custom_iterator_debug_level() else "0")) + self.cpp_info.defines.append( + "BASISU_NO_ITERATOR_DEBUG_LEVEL={}".format("1" if self._use_custom_iterator_debug_level() else "0") + ) diff --git a/recipes/libbasisu/all/patches/cmakelist_build_lib.patch b/recipes/libbasisu/all/patches/cmakelist_build_lib.patch index 043a9778c605d6..69bef6820b1385 100644 --- a/recipes/libbasisu/all/patches/cmakelist_build_lib.patch +++ b/recipes/libbasisu/all/patches/cmakelist_build_lib.patch @@ -17,7 +17,7 @@ -if( NOT CMAKE_BUILD_TYPE ) - set( CMAKE_BUILD_TYPE Release ) -endif() -+project(basisu VERSION 1.15.0 LANGUAGES CXX) ++project(basisu VERSION 1.15.0 LANGUAGES CXX C) -message( ${PROJECT_NAME} " build type: " ${CMAKE_BUILD_TYPE} ) - @@ -55,7 +55,7 @@ - if (NOT BUILD_X64) - set(GCC_COMPILE_FLAGS "${GCC_COMPILE_FLAGS} -m32") - endif() -+ set(GCC_COMPILE_FLAGS "-fPIC -fno-strict-aliasing -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wno-unused-local-typedefs -Wno-unused-value -Wno-unused-parameter -Wno-unused-variable") ++ set(GCC_COMPILE_FLAGS "-fno-strict-aliasing -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wno-unused-local-typedefs -Wno-unused-value -Wno-unused-parameter -Wno-unused-variable") - if (EMSCRIPTEN) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -DBASISU_SUPPORT_SSE=0") @@ -99,7 +99,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBASISU_SUPPORT_SSE=1") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_SUPPORT_SSE=1") else() -@@ -93,64 +51,57 @@ else() +@@ -93,64 +51,63 @@ else() endif() endif() @@ -173,6 +173,12 @@ if (ZSTD) - target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=1) + target_compile_definitions(${PROJECT_NAME} PRIVATE BASISD_SUPPORT_KTX2_ZSTD=1) ++ find_package(zstd REQUIRED) ++ if (TARGET zstd::libzstd_static) ++ target_link_libraries(${PROJECT_NAME} PRIVATE zstd::libzstd_static) ++ else() ++ target_link_libraries(${PROJECT_NAME} PRIVATE zstd::libzstd_shared) ++ endif() else() - target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0) + target_compile_definitions(${PROJECT_NAME} PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0) diff --git a/recipes/libbasisu/all/test_package/CMakeLists.txt b/recipes/libbasisu/all/test_package/CMakeLists.txt index 2adca01f3e68a3..e4b4ddeb886b64 100644 --- a/recipes/libbasisu/all/test_package/CMakeLists.txt +++ b/recipes/libbasisu/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.10) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(libbasisu REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) - -target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::libbasisu) +target_link_libraries(${PROJECT_NAME} PRIVATE libbasisu::libbasisu) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/libbasisu/all/test_package/conanfile.py b/recipes/libbasisu/all/test_package/conanfile.py index 12dd810a6ab3bc..ef5d7042163ecc 100644 --- a/recipes/libbasisu/all/test_package/conanfile.py +++ b/recipes/libbasisu/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", "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.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/libbasisu/all/test_v1_package/CMakeLists.txt b/recipes/libbasisu/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libbasisu/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/libbasisu/all/test_v1_package/conanfile.py b/recipes/libbasisu/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..abcaeed3f89b67 --- /dev/null +++ b/recipes/libbasisu/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/libbigwig/all/conanfile.py b/recipes/libbigwig/all/conanfile.py index cf0ba30f73906f..e242d7f2f554c1 100644 --- a/recipes/libbigwig/all/conanfile.py +++ b/recipes/libbigwig/all/conanfile.py @@ -45,11 +45,11 @@ def requirements(self): if self.options.with_curl: # transitive_headers=True is required due to includes in bigWigIO.h # https://github.com/dpryan79/libBigWig/blob/master/bigWigIO.h#L5 - self.requires("libcurl/8.1.2", transitive_headers=True) + self.requires("libcurl/[>=7.78.0 <9]", transitive_headers=True) if self.options.with_zlibng: - self.requires("zlib-ng/2.1.3") + self.requires("zlib-ng/2.1.5") else: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.info.settings.os == "Windows": diff --git a/recipes/libbpf/all/conandata.yml b/recipes/libbpf/all/conandata.yml index dced81ebf510c8..2d16ec72388000 100644 --- a/recipes/libbpf/all/conandata.yml +++ b/recipes/libbpf/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.3.0": + url: "https://github.com/libbpf/libbpf/archive/v1.3.0.tar.gz" + sha256: "11db86acd627e468bc48b7258c1130aba41a12c4d364f78e184fd2f5a913d861" + "1.1.0": + url: "https://github.com/libbpf/libbpf/archive/refs/tags/v1.1.0.tar.gz" + sha256: "5da826c968fdb8a2f714701cfef7a4b7078be030cf58b56143b245816301cbb8" "0.7.0": url: "https://github.com/libbpf/libbpf/archive/refs/tags/v0.7.0.tar.gz" sha256: "5083588ce5a3a620e395ee1e596af77b4ec5771ffc71cff2af49dfee38c06361" diff --git a/recipes/libbpf/all/conanfile.py b/recipes/libbpf/all/conanfile.py index fcb6be22798a81..b154fd66ef174d 100644 --- a/recipes/libbpf/all/conanfile.py +++ b/recipes/libbpf/all/conanfile.py @@ -14,14 +14,18 @@ class LibbpfConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/libbpf/libbpf" topics = ("berkeley-packet-filter", "bpf", "ebpf", "network", "tracing") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], - "fPIC": [True, False] + "fPIC": [True, False], + "with_uapi_headers": [True, False] } default_options = { "shared": False, - "fPIC": True + "fPIC": True, + "with_uapi_headers": False } def config_options(self): @@ -38,9 +42,9 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("linux-headers-generic/5.14.9") - self.requires("libelf/0.8.13") - self.requires("zlib/1.2.13") + self.requires("linux-headers-generic/5.15.128", transitive_headers=True) + self.requires("elfutils/0.190", transitive_headers=True, transitive_libs=True) + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.settings.os != "Linux": @@ -73,6 +77,8 @@ def build(self): with chdir(self, os.path.join(self.source_folder, "src")): autotools = Autotools(self) autotools.make() + if self.options.with_uapi_headers: + autotools.make('install_uapi_headers') def package(self): copy(self, pattern="LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) @@ -88,5 +94,9 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.names["pkg_config"] = "libbpf" self.cpp_info.libs = ["bpf"] + self.cpp_info.set_property("pkg_config_name", "libbpf") + + # TODO: Remove once v1 is no longer needed + self.cpp_info.names["pkg_config"] = "libbpf" + diff --git a/recipes/libbpf/config.yml b/recipes/libbpf/config.yml index 4383f9baf52297..6fd5fe398b43d9 100644 --- a/recipes/libbpf/config.yml +++ b/recipes/libbpf/config.yml @@ -1,4 +1,8 @@ versions: + "1.3.0": + folder: all + "1.1.0": + folder: all "0.7.0": folder: all "0.5.0": diff --git a/recipes/libcap/all/conandata.yml b/recipes/libcap/all/conandata.yml index 5d119b718f418b..16d2439fd2b120 100644 --- a/recipes/libcap/all/conandata.yml +++ b/recipes/libcap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.69": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.69.tar.xz" + sha256: "f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb" "2.68": url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.68.tar.xz" sha256: "90be3b6d41be5f81ae4b03ec76012b0d27c829293684f6c05b65d5f9cce724b2" @@ -30,6 +33,13 @@ sources: url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.45.tar.xz" sha256: "d66639f765c0e10557666b00f519caf0bd07a95f867dddaee131cd284fac3286" patches: + "2.69": + - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" "2.68": - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" patch_description: "allow to configure fPIC option from conan recipe" 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/libcap/config.yml b/recipes/libcap/config.yml index 24a13cbb3bd22e..9ca623681ce664 100644 --- a/recipes/libcap/config.yml +++ b/recipes/libcap/config.yml @@ -1,4 +1,6 @@ versions: + "2.69": + folder: all "2.68": folder: all "2.66": 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/libcoro/all/conandata.yml b/recipes/libcoro/all/conandata.yml index 61258b10a8ddf9..08d79c6bc3667c 100644 --- a/recipes/libcoro/all/conandata.yml +++ b/recipes/libcoro/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9": + url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.9.tar.gz" + sha256: "680479582023f019bfa58b17bbcd30aa2ef1a8ba2c09d4ea9b296dbc77e93f1f" "0.8": url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.8.tar.gz" sha256: "09d8de39c9233d79c0dd1379c6826c636f63667f21001b66eb9b2080f6b270ad" @@ -6,6 +9,17 @@ sources: url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.7.tar.gz" sha256: "ce1f3f1c4fa21b53d1cd195a29bd5a2313e53aa35637b402db04207d02316e51" patches: + "0.9": + - patch_file: "patches/0.9-0001-allow-shared-lib.patch" + patch_type: "conan" + patch_description: "Allow to build the library as a shared library" + - patch_file: "patches/0.9-0002-disable-git-config.patch" + patch_type: "conan" + patch_description: "Comment out invocation of git config command" + - patch_file: "patches/0.9-0003-include-exception.patch" + patch_type: "backport" + patch_source: "https://github.com/jbaldwin/libcoro/pull/169" + patch_description: "include std headers" "0.8": - patch_file: "patches/0.8-0001-allow-shared-lib.patch" patch_type: "conan" diff --git a/recipes/libcoro/all/conanfile.py b/recipes/libcoro/all/conanfile.py index ea05c701592dce..1117b3d012d2ad 100644 --- a/recipes/libcoro/all/conanfile.py +++ b/recipes/libcoro/all/conanfile.py @@ -22,11 +22,15 @@ class LibcoroConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_networking": [True, False], + "with_ssl": [True, False], + "with_threading": [True, False], } default_options = { "shared": False, "fPIC": True, "with_networking": True, + "with_ssl": True, + "with_threading": True, } @property @@ -47,6 +51,9 @@ def config_options(self): del self.options.fPIC if Version(self.version) < "0.8": del self.options.with_networking + if Version(self.version) < "0.9": + del self.options.with_ssl + del self.options.with_threading def configure(self): if self.options.shared: @@ -56,7 +63,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + if "with_ssl" not in self.options or self.options.with_ssl: + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) self.requires("c-ares/1.19.1", transitive_headers=True) self.requires("tl-expected/1.1.0", transitive_headers=True) @@ -84,6 +92,9 @@ def generate(self): if Version(self.version) >= "0.8": tc.variables["LIBCORO_EXTERNAL_DEPENDENCIES"] = True tc.variables["LIBCORO_FEATURE_NETWORKING"] = self.options.with_networking + if Version(self.version) >= "0.9": + tc.variables["LIBCORO_FEATURE_THREADING"] = self.options.with_threading + tc.variables["LIBCORO_FEATURE_SSL"] = self.options.with_ssl tc.generate() deps = CMakeDeps(self) deps.generate() @@ -108,4 +119,12 @@ def package_info(self): else: self.cpp_info.libs = ["libcoro"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["pthread"] + self.cpp_info.system_libs = ["pthread", "m"] + + if Version(self.version) >= "0.9": + if self.options.with_networking: + self.cpp_info.defines.append("LIBCORO_FEATURE_NETWORKING") + if self.options.with_ssl: + self.cpp_info.defines.append("LIBCORO_FEATURE_SSL") + if self.options.with_threading: + self.cpp_info.defines.append("LIBCORO_FEATURE_THREADING") diff --git a/recipes/libcoro/all/patches/0.9-0001-allow-shared-lib.patch b/recipes/libcoro/all/patches/0.9-0001-allow-shared-lib.patch new file mode 100644 index 00000000000000..4838c6103aa0fa --- /dev/null +++ b/recipes/libcoro/all/patches/0.9-0001-allow-shared-lib.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ef0eea4..4c342e3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -110,7 +110,7 @@ if(LIBCORO_FEATURE_NETWORKING) + endif() + endif() + +-add_library(${PROJECT_NAME} STATIC ${LIBCORO_SOURCE_FILES}) ++add_library(${PROJECT_NAME} ${LIBCORO_SOURCE_FILES}) + set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX PREFIX "") + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) + target_include_directories(${PROJECT_NAME} PUBLIC inc) diff --git a/recipes/libcoro/all/patches/0.9-0002-disable-git-config.patch b/recipes/libcoro/all/patches/0.9-0002-disable-git-config.patch new file mode 100644 index 00000000000000..b169455e6e1bae --- /dev/null +++ b/recipes/libcoro/all/patches/0.9-0002-disable-git-config.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ef0eea4..4c342e3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,11 +12,11 @@ if (NOT "$ENV{version}" STREQUAL "") + endif() + + # Set the githooks directory to auto format and update the readme. +-message("${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} -> git config --local core.hooksPath .githooks") +-execute_process( +- COMMAND git config --local core.hooksPath .githooks +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +-) ++#message("${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} -> git config --local core.hooksPath .githooks") ++#execute_process( ++# COMMAND git config --local core.hooksPath .githooks ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++#) + + option(LIBCORO_EXTERNAL_DEPENDENCIES "Use Cmake find_package to resolve dependencies instead of embedded libraries, Default=OFF." OFF) + option(LIBCORO_BUILD_TESTS "Build the tests, Default=ON." ON) diff --git a/recipes/libcoro/all/patches/0.9-0003-include-exception.patch b/recipes/libcoro/all/patches/0.9-0003-include-exception.patch new file mode 100644 index 00000000000000..eac4b8bc794e63 --- /dev/null +++ b/recipes/libcoro/all/patches/0.9-0003-include-exception.patch @@ -0,0 +1,15 @@ +diff --git a/inc/coro/generator.hpp b/inc/coro/generator.hpp +index ede42d0..b103fb8 100644 +--- a/inc/coro/generator.hpp ++++ b/inc/coro/generator.hpp +@@ -1,8 +1,8 @@ + #pragma once +- + #include + #include +- ++#include ++#include + namespace coro + { + template diff --git a/recipes/libcoro/config.yml b/recipes/libcoro/config.yml index a836136a326319..77538762e21e74 100644 --- a/recipes/libcoro/config.yml +++ b/recipes/libcoro/config.yml @@ -1,4 +1,6 @@ versions: + "0.9": + folder: all "0.8": folder: all "0.7": 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 ed67365a84b810..372042901c2cc3 100644 --- a/recipes/libcurl/all/conandata.yml +++ b/recipes/libcurl/all/conandata.yml @@ -1,46 +1,79 @@ 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" + - "https://github.com/curl/curl/releases/download/curl-8_2_1/curl-8.2.1.tar.xz" + sha256: "dd322f6bd0a20e6cebdfd388f69e98c3d183bed792cf4713c8a7ef498cba4894" + "8.2.0": + url: + - "https://curl.se/download/curl-8.2.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_2_0/curl-8.2.0.tar.xz" + sha256: "2859ec79e2cd96e976a99493547359b8001af1d1e21f3a3a3b846544ef54500f" "8.1.2": - url: "https://curl.se/download/curl-8.1.2.tar.gz" - sha256: "2e5a9b8fcdc095bdd2f079561f369de71c5eb3b80f00a702fbe9a8b8d9897891" + url: + - "https://curl.se/download/curl-8.1.2.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_1_2/curl-8.1.2.tar.xz" + sha256: "31b1118eb8bfd43cd95d9a3f146f814ff874f6ed3999b29d94f4d1e7dbac5ef6" "8.1.1": - url: "https://curl.se/download/curl-8.1.1.tar.gz" - sha256: "44915e6708551bff2b4fd1615d593bc843b00ba013012634c04208702e354ab2" + url: + - "https://curl.se/download/curl-8.1.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_1_1/curl-8.1.1.tar.xz" + sha256: "08a948e061929645597c1ef7194e07b308b22084ff03fa7400b465e6c05149e5" "8.0.1": - url: "https://curl.se/download/curl-8.0.1.tar.gz" - sha256: "5fd29000a4089934f121eff456101f0a5d09e2a3e89da1d714adf06c4be887cb" + url: + - "https://curl.se/download/curl-8.0.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_0_1/curl-8.0.1.tar.xz" + sha256: "0a381cd82f4d00a9a334438b8ca239afea5bfefcfa9a1025f2bf118e79e0b5f0" "7.88.1": - url: "https://curl.se/download/curl-7.88.1.tar.gz" - sha256: "cdb38b72e36bc5d33d5b8810f8018ece1baa29a8f215b4495e495ded82bbf3c7" + url: + - "https://curl.se/download/curl-7.88.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_88_1/curl-7.88.1.tar.xz" + sha256: "1dae31b2a7c1fe269de99c0c31bb488346aab3459b5ffca909d6938249ae415f" "7.87.0": - url: "https://curl.se/download/curl-7.87.0.tar.gz" - sha256: "8a063d664d1c23d35526b87a2bf15514962ffdd8ef7fd40519191b3c23e39548" + url: + - "https://curl.se/download/curl-7.87.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_87_0/curl-7.87.0.tar.xz" + sha256: "ee5f1a1955b0ed413435ef79db28b834ea5f0fb7c8cfb1ce47175cc3bee08fff" "7.86.0": - url: "https://curl.se/download/curl-7.86.0.tar.gz" - sha256: "3dfdd39ba95e18847965cd3051ea6d22586609d9011d91df7bc5521288987a82" + url: + - "https://curl.se/download/curl-7.86.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_86_0/curl-7.86.0.tar.xz" + sha256: "2d61116e5f485581f6d59865377df4463f2e788677ac43222b496d4e49fb627b" "7.85.0": - url: "https://curl.se/download/curl-7.85.0.tar.gz" - sha256: "78a06f918bd5fde3c4573ef4f9806f56372b32ec1829c9ec474799eeee641c27" + url: + - "https://curl.se/download/curl-7.85.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_85_0/curl-7.85.0.tar.xz" + sha256: "88b54a6d4b9a48cb4d873c7056dcba997ddd5b7be5a2d537a4acb55c20b04be6" "7.84.0": - url: "https://curl.se/download/curl-7.84.0.tar.gz" - sha256: "3c6893d38d054d4e378267166858698899e9d87258e8ff1419d020c395384535" + url: + - "https://curl.se/download/curl-7.84.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_84_0/curl-7.84.0.tar.xz" + sha256: "2d118b43f547bfe5bae806d8d47b4e596ea5b25a6c1f080aef49fbcd817c5db8" "7.83.1": - url: "https://curl.se/download/curl-7.83.1.tar.gz" - sha256: "93fb2cd4b880656b4e8589c912a9fd092750166d555166370247f09d18f5d0c0" + url: + - "https://curl.se/download/curl-7.83.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_83_1/curl-7.83.1.tar.xz" + sha256: "2cb9c2356e7263a1272fd1435ef7cdebf2cd21400ec287b068396deb705c22c4" "7.82.0": - url: "https://curl.se/download/curl-7.82.0.tar.gz" - sha256: "910cc5fe279dc36e2cca534172c94364cf3fcf7d6494ba56e6c61a390881ddce" + url: + - "https://curl.se/download/curl-7.82.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_82_0/curl-7.82.0.tar.xz" + sha256: "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c" "7.80.0": - url: "https://curl.se/download/curl-7.80.0.tar.gz" - sha256: "dab997c9b08cb4a636a03f2f7f985eaba33279c1c52692430018fae4a4878dc7" + url: + - "https://curl.se/download/curl-7.80.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_80_0/curl-7.80.0.tar.xz" + sha256: "a132bd93188b938771135ac7c1f3ac1d3ce507c1fcbef8c471397639214ae2ab" "7.79.1": - url: "https://curl.se/download/curl-7.79.1.tar.gz" - sha256: "370b11201349816287fb0ccc995e420277fbfcaf76206e309b3f60f0eda090c2" + url: + - "https://curl.se/download/curl-7.79.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_79_1/curl-7.79.1.tar.xz" + sha256: "0606f74b1182ab732a17c11613cbbaf7084f2e6cca432642d0e3ad7c224c3689" "7.78.0": - url: "https://curl.se/download/curl-7.78.0.tar.gz" - sha256: "ed936c0b02c06d42cf84b39dd12bb14b62d77c7c4e875ade022280df5dcc81d7" - "7.77.0": - url: "https://curl.se/download/curl-7.77.0.tar.gz" - sha256: "b0a3428acb60fa59044c4d0baae4e4fc09ae9af1d8a3aa84b2e3fbcd99841f77" - "7.76.0": - url: "https://curl.se/download/curl-7.76.0.tar.gz" - sha256: "3b4378156ba09e224008e81dcce854b7ce4d182b1f9cfb97fe5ed9e9c18c6bd3" + url: + - "https://curl.se/download/curl-7.78.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_78_0/curl-7.78.0.tar.xz" + sha256: "be42766d5664a739c3974ee3dfbbcbe978a4ccb1fe628bb1d9b59ac79e445fb5" diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py index 6fc552c1f2f774..6ad8bd967a379f 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -49,7 +49,6 @@ class LibcurlConan(ConanFile): "with_libidn": [True, False], "with_librtmp": [True, False], "with_libgsasl": [True, False], - "with_libmetalink": [True, False], "with_libpsl": [True, False], "with_largemaxwritesize": [True, False], "with_nghttp2": [True, False], @@ -95,7 +94,6 @@ class LibcurlConan(ConanFile): "with_libidn": False, "with_librtmp": False, "with_libgsasl": False, - "with_libmetalink": False, "with_libpsl": False, "with_largemaxwritesize": False, "with_nghttp2": False, @@ -136,11 +134,6 @@ def _is_win_x_android(self): def _is_using_cmake_build(self): return is_msvc(self) or self._is_win_x_android - @property - def _has_metalink_option(self): - # Support for metalink was removed in version 7.78.0 https://github.com/curl/curl/pull/7176 - return Version(self.version) < "7.78.0" and not self._is_using_cmake_build - @property def _has_with_libpsl_option(self): return not (self._is_using_cmake_build and Version(self.version) < "7.84.0") @@ -152,8 +145,6 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self._has_metalink_option: - del self.options.with_libmetalink if not self._has_with_libpsl_option: del self.options.with_libpsl if self._is_using_cmake_build: @@ -185,17 +176,17 @@ def requirements(self): elif self.options.with_ssl == "wolfssl": self.requires("wolfssl/5.6.3") if self.options.with_nghttp2: - self.requires("libnghttp2/1.54.0") + self.requires("libnghttp2/1.58.0") if self.options.with_libssh2: self.requires("libssh2/1.11.0") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_brotli: - self.requires("brotli/1.0.9") + self.requires("brotli/1.1.0") if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.with_c_ares: - self.requires("c-ares/1.19.1") + self.requires("c-ares/1.22.1") if self.options.get_safe("with_libpsl"): self.requires("libpsl/0.21.1") @@ -216,7 +207,7 @@ def build_requirements(self): else: 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.settings.os in [ "tvOS", "watchOS" ]: self.tool_requires("gnu-config/cci.20210814") if self._settings_build.os == "Windows": @@ -303,7 +294,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,11 +321,15 @@ 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 - replace_in_file(self, cmakelists, "find_package(Brotli QUIET)", "find_package(brotli REQUIRED CONFIG)") + if Version(self.version) < "8.2.0": + replace_in_file(self, cmakelists, "find_package(Brotli QUIET)", "find_package(brotli REQUIRED CONFIG)") + else: + replace_in_file(self, cmakelists, "find_package(Brotli REQUIRED)", "find_package(brotli REQUIRED CONFIG)") replace_in_file(self, cmakelists, "if(BROTLI_FOUND)", "if(brotli_FOUND)") replace_in_file(self, cmakelists, "${BROTLI_LIBRARIES}", "brotli::brotli") replace_in_file(self, cmakelists, "${BROTLI_INCLUDE_DIRS}", "${brotli_INCLUDE_DIRS}") @@ -432,15 +427,14 @@ def _generate_with_autotools(self): ]) # Since 7.77.0, disabling TLS must be explicitly requested otherwise it fails - if Version(self.version) >= "7.77.0" and not self.options.with_ssl: + if not self.options.with_ssl: tc.configure_args.append("--without-ssl") - openssl_option = "ssl" if Version(self.version) < "7.77.0" else "openssl" if self.options.with_ssl == "openssl": path = unix_path(self, self.dependencies["openssl"].package_folder) - tc.configure_args.append(f"--with-{openssl_option}={path}") + tc.configure_args.append(f"--with-openssl={path}") else: - tc.configure_args.append(f"--without-{openssl_option}") + tc.configure_args.append("--without-openssl") if self.options.with_ssl == "wolfssl": path = unix_path(self, self.dependencies["wolfssl"].package_folder) @@ -466,9 +460,6 @@ def _generate_with_autotools(self): else: tc.configure_args.append("--without-zlib") - if self._has_metalink_option: - tc.configure_args.append(f"--with-libmetalink={self._yes_no(self.options.with_libmetalink)}") - if not self.options.with_proxy: tc.configure_args.append("--disable-proxy") @@ -480,10 +471,7 @@ def _generate_with_autotools(self): # ntlm will default to enabled if any SSL options are enabled if not self.options.with_ntlm: - if Version(self.version) <= "7.77.0": - tc.configure_args.append("--disable-crypto-auth") - else: - tc.configure_args.append("--disable-ntlm") + tc.configure_args.append("--disable-ntlm") if not self.options.with_ntlm_wb: tc.configure_args.append("--disable-ntlm-wb") @@ -603,10 +591,7 @@ def _generate_with_cmake(self): # Also disables NTLM_WB if set to false if not self.options.with_ntlm: - if Version(self.version) <= "7.77.0": - tc.variables["CURL_DISABLE_CRYPTO_AUTH"] = True - else: - tc.variables["CURL_DISABLE_NTLM"] = True + tc.variables["CURL_DISABLE_NTLM"] = True tc.variables["NTLM_WB_ENABLED"] = self.options.with_ntlm_wb if self.options.with_ca_bundle: @@ -621,6 +606,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) @@ -673,10 +665,8 @@ def package_info(self): if self.options.with_ssl == "schannel": self.cpp_info.components["curl"].system_libs.append("crypt32") elif is_apple_os(self): - if Version(self.version) >= "7.78.0" or self.options.with_ssl == "darwinssl": - self.cpp_info.components["curl"].frameworks.append("CoreFoundation") - if Version(self.version) >= "7.77.0": - self.cpp_info.components["curl"].frameworks.append("SystemConfiguration") + self.cpp_info.components["curl"].frameworks.append("CoreFoundation") + self.cpp_info.components["curl"].frameworks.append("SystemConfiguration") if self.options.with_ldap: self.cpp_info.components["curl"].system_libs.append("ldap") if self.options.with_ssl == "darwinssl": diff --git a/recipes/libcurl/all/patches/004-no-checksrc.patch b/recipes/libcurl/all/patches/004-no-checksrc.patch deleted file mode 100644 index 7a5cb866faa933..00000000000000 --- a/recipes/libcurl/all/patches/004-no-checksrc.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ruN a/lib/Makefile.am b/lib/Makefile.am ---- a/lib/Makefile.am -+++ b/lib/Makefile.am -@@ -138,8 +138,6 @@ - CS_ = $(CS_0) - - checksrc: -- $(CHECKSRC)(@PERL@ $(srcdir)/checksrc.pl -D$(srcdir) -W$(srcdir)/curl_config.h \ -- $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] $(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] $(srcdir)/vssh/*.[ch]) - - if CURLDEBUG - # for debug builds, we scan the sources on all regular make invokes diff --git a/recipes/libcurl/config.yml b/recipes/libcurl/config.yml index cb27832872bdf3..3f099810578c8c 100644 --- a/recipes/libcurl/config.yml +++ b/recipes/libcurl/config.yml @@ -1,4 +1,10 @@ versions: + "8.4.0": + folder: all + "8.2.1": + folder: all + "8.2.0": + folder: all "8.1.2": folder: all "8.1.1": @@ -25,7 +31,3 @@ versions: folder: all "7.78.0": folder: all - "7.77.0": - folder: all - "7.76.0": - folder: all diff --git a/recipes/libdb/all/conandata.yml b/recipes/libdb/all/conandata.yml index 0707d6df726bff..f522bcff963228 100644 --- a/recipes/libdb/all/conandata.yml +++ b/recipes/libdb/all/conandata.yml @@ -5,10 +5,11 @@ sources: patches: "5.3.28": - patch_file: "patches/0001-rename_atomic_compare_exchange.patch" - base_path: "source_subfolder" + patch_description: "Rename __atomic_compare_exchange to __atomic_compare_exchange_db" + patch_type: "portability" - patch_file: "patches/0002-no-conditional-tcl-include.patch" - base_path: "source_subfolder" + patch_description: "Always include tcl.h. Remove conditions." + patch_type: "conan" - patch_file: "patches/0003-msvc-db_tcl-add-static-configuration.patch" - base_path: "source_subfolder" - - patch_file: "patches/0004-msvc-tcl-include-conanbuildinfo-props.patch" - base_path: "source_subfolder" + patch_description: "Add static configuration" + patch_type: "conan" diff --git a/recipes/libdb/all/conanfile.py b/recipes/libdb/all/conanfile.py index 2500bfb57361a4..7e15eabaa687f0 100644 --- a/recipes/libdb/all/conanfile.py +++ b/recipes/libdb/all/conanfile.py @@ -1,14 +1,15 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file, rename, rm, rmdir -from conan.tools.microsoft import is_msvc, check_min_vs, unix_path +from conan.tools.microsoft import MSBuild, MSBuildDeps, MSBuildToolchain, is_msvc, check_min_vs, vs_layout +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout from conan.tools.scm import Version -# FIXME: Needs to be migrted to Conan v2 -from conans import AutoToolsBuildEnvironment, MSBuild -from conans import tools as legacy_tools +from conan.tools.apple import fix_apple_shared_install_name import glob import os +import shutil required_conan_version = ">=1.55.0" @@ -35,13 +36,6 @@ class LibdbConan(ConanFile): "with_cxx": False, } - generators = "visual_studio" - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" @property def _mingw_build(self): @@ -51,18 +45,14 @@ def _mingw_build(self): 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): export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC - if self.settings.compiler == "Visual Studio": - del self.options.with_cxx + self.options.rm_safe("fPIC") + if is_msvc(self): + self.options.rm_safe("with_cxx") def configure(self): if self.options.shared: @@ -76,8 +66,9 @@ def requirements(self): self.requires("tcl/8.6.10") def validate(self): - if is_msvc(self) and check_min_vs(self, "191", raise_invalid=False): + if is_msvc(self) and check_min_vs(self, "192", raise_invalid=False): # FIXME: it used to work with previous versions of Visual Studio 2019 in CI of CCI. + # Currently won't work with Visual Studio 2019 or newer raise ConanInvalidConfiguration(f"{self.ref} Visual Studio 2019 is currently not supported. Contributions are welcomed!") if self.settings.os == "Macos" and self.settings.arch == "armv8": @@ -85,81 +76,126 @@ def validate(self): if self.options.get_safe("with_cxx"): if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "6": - raise ConanInvalidConfiguration(f"{self.ref} does no support clang<6 with_cxx=True") + raise ConanInvalidConfiguration(f"{self.ref} does not support clang<6 with_cxx=True") if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "10": - raise ConanInvalidConfiguration(f"{self.ref} does no support apple-clang<10 with_cxx=True") + raise ConanInvalidConfiguration(f"{self.ref} does not support apple-clang<10 with_cxx=True") def build_requirements(self): - 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") + if not self._settings_build.os == "Windows": + self.tool_requires("gnu-config/cci.20201022") + + def layout(self): + if is_msvc(self): + vs_layout(self) + else: + basic_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def _patch_sources(self): apply_conandata_patches(self) - if is_msvc(self): + 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"" + projects = ["db", "db_sql", "db_stl"] + if self.options.with_tcl: + projects.append("db_tcl") + for project in projects: + # ================================= + # TODO: To remove once https://github.com/conan-io/conan/pull/12817 is available in conan client + project_file = os.path.join(self.source_folder, "build_windows", "VS10", f"{project}.vcxproj") + toolset = MSBuildToolchain(self).toolset + replace_in_file( + self, project_file, + "", + f" {toolset}\n ", + ) + replace_in_file( + self, project_file, + "", + f"\n {toolset}", + ) + if import_conan_generators: + replace_in_file( + self, project_file, + "", + f"{import_conan_generators}", + ) + # ================================= + + for file in glob.glob(os.path.join(self.source_folder, "build_windows", "VS10", "*.vcxproj")): + pass + # The WindowsTargetPlatformVersion selected below will depend on what Windows SDK is installed. + replace_in_file(self, file, + "", + # 10.0 should select the "latest" SDK available, but doesn't always work. It may be necessary to specify a specific version + #"10.0") + "10.0.20348.0") + #"10.0.19041.0") + else: for subdir in [ "dist", os.path.join("lang", "sql", "jdbc"), os.path.join("lang", "sql", "odbc"), os.path.join("lang", "sql", "sqlite"), ]: - 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=os.path.join(self._source_subfolder, subdir)) - - for file in glob.glob(os.path.join(self._source_subfolder, "build_windows", "VS10", "*.vcxproj")): - replace_in_file(self, file, - "", - "10.0.17763.0") - - dist_configure = os.path.join(self._source_subfolder, "dist", "configure") - replace_in_file(self, dist_configure, "../$sqlite_dir", "$sqlite_dir") - replace_in_file(self, dist_configure, - "\n --disable-option-checking)", - "\n --datarootdir=*)" - "\n ;;" - "\n --disable-option-checking)") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=legacy_tools.os_info.is_windows) - if self.settings.compiler in ["apple-clang", "clang"] and Version(self.settings.compiler.version) >= "12": - self._autotools.flags.append("-Wno-error=implicit-function-declaration") - conf_args = [ - "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug", - "--enable-mingw" if self._mingw_build else "--disable-mingw", - "--enable-compat185", - "--enable-sql", - ] - if self.options.with_cxx: - conf_args.extend(["--enable-cxx", "--enable-stl"]) - else: - conf_args.extend(["--disable-cxx", "--disable-stl"]) + shutil.copy(self.dependencies.build["gnu-config"].conf_info.get("user.gnu-config:config_sub"), + os.path.join(self.source_folder, subdir, "config.sub")) + shutil.copy(self.dependencies.build["gnu-config"].conf_info.get("user.gnu-config:config_guess"), + os.path.join(self.source_folder, subdir, "config.guess")) + + dist_configure = os.path.join(self.source_folder, "dist", "configure") + replace_in_file(self, dist_configure, "../$sqlite_dir", "$sqlite_dir") + replace_in_file(self, dist_configure, + "\n --disable-option-checking)", + "\n --datarootdir=*)" + "\n ;;" + "\n --disable-option-checking)") + + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.generate() + + deps = MSBuildDeps(self) + deps.generate() - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) else: - conf_args.extend(["--disable-shared", "--enable-static"]) - if self.options.with_tcl: - conf_args.append("--with-tcl={}".format(unix_path(self, os.path.join(self.deps_cpp_info["tcl"].rootpath, "lib")))) - self._autotools.configure(configure_dir=os.path.join(self.source_folder, self._source_subfolder, "dist"), args=conf_args) - if self.settings.os == "Windows" and self.options.shared: - replace_in_file(self, os.path.join(self.build_folder, "libtool"), - "\ndeplibs_check_method=", - "\ndeplibs_check_method=pass_all\n#deplibs_check_method=") - replace_in_file(self, os.path.join(self.build_folder, "Makefile"), - ".a", - ".dll.a") - return self._autotools + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug") + tc.configure_args.append("--enable-mingw" if self._mingw_build else "--disable-mingw") + tc.configure_args.append("--enable-compat185") + tc.configure_args.append("--enable-sql") + if self.options.with_cxx: + tc.configure_args.extend(["--enable-cxx", "--enable-stl"]) + else: + tc.configure_args.extend(["--disable-cxx", "--disable-stl"]) + + if self.options.shared: + tc.configure_args.extend(["--enable-shared", "--disable-static"]) + else: + tc.configure_args.extend(["--disable-shared", "--enable-static"]) + + if self.options.with_tcl: + tc.configure_args.append(f"--with-tcl={os.path.join(self.dependencies['tcl'].package_folder, 'lib')}") + + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) >= "12": + tc.extra_cflags.append("-Wno-error=implicit-function-declaration") + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "15": + # -Wimplicit-function-declaration is default as of clang 15 + # https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html#improvements-to-clang-s-diagnostics + # https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes + tc.extra_cflags.append("-Wno-error=implicit-function-declaration") + + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() @property def _msvc_build_type(self): @@ -174,33 +210,34 @@ def _msvc_build_type(self): def _msvc_arch(self): return self._msvc_platforms[str(self.settings.arch)] - def _build_msvc(self): - projects = ["db", "db_sql", "db_stl"] - if self.options.with_tcl: - projects.append("db_tcl") - msbuild = MSBuild(self) - upgraded = False - for project in projects: - msbuild.build(os.path.join(self._source_subfolder, "build_windows", "VS10", "{}.vcxproj".format(project)), - build_type=self._msvc_build_type, platforms=self._msvc_platforms, - upgrade_project=not upgraded) - upgraded = True - def build(self): self._patch_sources() if is_msvc(self): - self._build_msvc() + msbuild = MSBuild(self) + projects = ["db", "db_sql", "db_stl"] + if self.options.with_tcl: + projects.append("db_tcl") + for project in projects: + project_file = os.path.join(self.source_folder, "build_windows", "VS10", f"{project}.vcxproj") + build_type = "{}{}".format( + "" if self.options.shared else "Static ", + "Debug" if self.settings.build_type == "Debug" else "Release", + ) + msbuild.build_type = build_type if Version(conan_version).major >= 2 else f"\"{build_type}\"" + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(sln=project_file) else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure(build_script_folder=os.path.join(self.source_folder, "dist")) autotools.make() def package(self): - copy(self, "LICENSE", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) bindir = os.path.join(self.package_folder, "bin") libdir = os.path.join(self.package_folder, "lib") if is_msvc(self): - build_windows = os.path.join(self._source_subfolder, "build_windows") - build_dir = os.path.join(self._source_subfolder, "build_windows", self._msvc_arch, self._msvc_build_type) + build_windows = os.path.join(self.source_folder, "build_windows") + build_dir = os.path.join(self.source_folder, "build_windows", self._msvc_arch, self._msvc_build_type) copy(self, "*.lib", src=build_dir, dst=libdir) copy(self, "*.dll", src=build_dir, dst=bindir) for fn in ("db.h", "db.cxx", "db_int.h", "dbstl_common.h"): @@ -217,7 +254,7 @@ def _lib_to_msvc_lib(lib): rename(self, os.path.join(libdir, "{}.lib".format(msvc_lib)), os.path.join(libdir, "{}.lib".format(lib))) else: - autotools = self._configure_autotools() + autotools = Autotools(self) autotools.install() if self.settings.os == "Windows": @@ -244,6 +281,7 @@ def _lib_to_msvc_lib(lib): if not self.options.shared: # autotools installs the static libraries twice as libXXX.a and libXXX-5.3.a ==> remove libXXX-5.3.a rm(self, "*-{}.a".format(".".join(self._major_minor_version)), libdir) + fix_apple_shared_install_name(self) @property def _major_minor_version(self): @@ -258,8 +296,8 @@ def _libs(self): if self.options.get_safe("with_cxx"): libs.extend(["db_cxx", "db_stl"]) libs.extend(["db_sql", "db"]) - if self.settings.compiler == "Visual Studio": - libs = ["lib{}".format(lib) for lib in libs] + if is_msvc(self): + libs = [f"lib{libname}" for libname in libs] return libs def package_info(self): @@ -268,5 +306,5 @@ def package_info(self): self.cpp_info.defines = ["DB_USE_DLL"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "pthread"]) - elif self.settings.os == "Windows" : + elif self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libdb/all/patches/0004-msvc-tcl-include-conanbuildinfo-props.patch b/recipes/libdb/all/patches/0004-msvc-tcl-include-conanbuildinfo-props.patch deleted file mode 100644 index 742431d50ece22..00000000000000 --- a/recipes/libdb/all/patches/0004-msvc-tcl-include-conanbuildinfo-props.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- build_windows/VS10/db_tcl.vcxproj -+++ build_windows/VS10/db_tcl.vcxproj -@@ -1,5 +2,5 @@ - -- -+ - - - Debug diff --git a/recipes/libdb/all/test_package/CMakeLists.txt b/recipes/libdb/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..ee5ced82bf710d 100644 --- a/recipes/libdb/all/test_package/CMakeLists.txt +++ b/recipes/libdb/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(PackageTest C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libdb CONFIG REQUIRED) -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(example src/test_package.c) +target_link_libraries(example libdb::libdb) diff --git a/recipes/libdb/all/test_package/conanfile.py b/recipes/libdb/all/test_package/conanfile.py index d919133e5c230c..91a8fc7a09b42a 100644 --- a/recipes/libdb/all/test_package/conanfile.py +++ b/recipes/libdb/all/test_package/conanfile.py @@ -1,16 +1,26 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + +class fooTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) cmake.configure() cmake.build() + def layout(self): + cmake_layout(self) + def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "example") + self.run(cmd, env="conanrun") diff --git a/recipes/libdb/all/test_package/src/test_package.c b/recipes/libdb/all/test_package/src/test_package.c new file mode 100644 index 00000000000000..a83b3cc09a879e --- /dev/null +++ b/recipes/libdb/all/test_package/src/test_package.c @@ -0,0 +1,22 @@ +#include + +#include +#include + +int main(int argc, char *argv[]) { + DB *dbp; + int res; + res = db_create(&dbp, NULL, 0); + if (res != 0) { + puts("db_create failed\n"); + return EXIT_FAILURE; + } + + res = dbp->close(dbp, 0); + if (res != 0) { + puts("DP->close failed\n"); + return EXIT_FAILURE; + } + puts("libdb test_package success!\n"); + return EXIT_SUCCESS; +} diff --git a/recipes/libdb/all/test_package/test_package.c b/recipes/libdb/all/test_package/test_package.c deleted file mode 100644 index d94592e5c75f12..00000000000000 --- a/recipes/libdb/all/test_package/test_package.c +++ /dev/null @@ -1,21 +0,0 @@ -#include - -#include -#include - -int main(int argc, char *argv[]) { - DB *dbp; - int res; - res = db_create(&dbp, NULL, 0); - if (res != 0) { - puts("db_create failed\n"); - return EXIT_FAILURE; - } - - res = dbp->close(dbp, 0); - if (res != 0) { - puts("DP->close failed\n"); - return EXIT_FAILURE; - } - return EXIT_SUCCESS; -} diff --git a/recipes/libdb/all/test_v1_package/CMakeLists.txt b/recipes/libdb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..b9027a80ab6af0 --- /dev/null +++ b/recipes/libdb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} ../test_package/src/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libdb/all/test_v1_package/conanfile.py b/recipes/libdb/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..d919133e5c230c --- /dev/null +++ b/recipes/libdb/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "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/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/libde265/all/conandata.yml b/recipes/libde265/all/conandata.yml index 1536fa75197a75..d9b1262d06c1f6 100644 --- a/recipes/libde265/all/conandata.yml +++ b/recipes/libde265/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.12": + url: "https://github.com/strukturag/libde265/releases/download/v1.0.12/libde265-1.0.12.tar.gz" + sha256: "62185ea2182e68cf68bba20cc6eb4c287407b509cf0a827d7ddb75614db77b5c" "1.0.11": url: "https://github.com/strukturag/libde265/releases/download/v1.0.11/libde265-1.0.11.tar.gz" sha256: "2f8f12cabbdb15e53532b7c1eb964d4e15d444db1be802505e6ac97a25035bab" diff --git a/recipes/libde265/all/conanfile.py b/recipes/libde265/all/conanfile.py index 286e6952e05dca..6618b97bf0692d 100644 --- a/recipes/libde265/all/conanfile.py +++ b/recipes/libde265/all/conanfile.py @@ -106,7 +106,8 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "de265") self.cpp_info.set_property("cmake_target_aliases", ["libde265"]) # official imported target before 1.0.10 self.cpp_info.set_property("pkg_config_name", "libde265") - prefix = "lib" if Version(self.version) < "1.0.10" else "" + version = Version(self.version) + prefix = "lib" if (version < "1.0.10" or (version > "1.0.11" and self.settings.os == "Windows" and not self.options.shared)) else "" self.cpp_info.libs = [f"{prefix}de265"] if not self.options.shared: self.cpp_info.defines = ["LIBDE265_STATIC_BUILD"] diff --git a/recipes/libde265/config.yml b/recipes/libde265/config.yml index d32ffee4c65d8b..2745db31bb6cde 100644 --- a/recipes/libde265/config.yml +++ b/recipes/libde265/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.12": + folder: all "1.0.11": folder: all "1.0.9": diff --git a/recipes/libdeflate/all/conandata.yml b/recipes/libdeflate/all/conandata.yml index 01ec059a63c200..720157d82ac2bd 100644 --- a/recipes/libdeflate/all/conandata.yml +++ b/recipes/libdeflate/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.19": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.19.tar.gz" + sha256: "27bf62d71cd64728ff43a9feb92f2ac2f2bf748986d856133cc1e51992428c25" "1.18": url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.18.tar.gz" sha256: "225d982bcaf553221c76726358d2ea139bb34913180b20823c782cede060affd" diff --git a/recipes/libdeflate/config.yml b/recipes/libdeflate/config.yml index 2ecdca807a8d64..fe3db2bc74050b 100644 --- a/recipes/libdeflate/config.yml +++ b/recipes/libdeflate/config.yml @@ -1,4 +1,6 @@ versions: + "1.19": + folder: "all" "1.18": folder: "all" "1.17": 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/libdrm/all/conanfile.py b/recipes/libdrm/all/conanfile.py index aad89cccd5bf6d..9fc352be868112 100644 --- a/recipes/libdrm/all/conanfile.py +++ b/recipes/libdrm/all/conanfile.py @@ -4,19 +4,24 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.files import get, load, mkdir, rmdir, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import MesonToolchain, Meson from conan.tools.scm import Version -from conans import Meson + +required_conan_version = ">=1.53.0" class LibdrmConan(ConanFile): name = "libdrm" - description = "User space library for accessing the Direct Rendering Manager, on operating systems that support the ioctl interface" - topics = ("libdrm", "graphics") + description = ("User space library for accessing the Direct Rendering Manager, " + "on operating systems that support the ioctl interface") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.freedesktop.org/mesa/drm" - license = "MIT" - generators = "PkgConfigDeps" + topics = ("graphics",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,7 +40,7 @@ class LibdrmConan(ConanFile): "etnaviv": [True, False], "valgrind": [True, False], "freedreno-kgsl": [True, False], - "udev": [True, False] + "udev": [True, False], } default_options = { "shared": False, @@ -54,100 +59,93 @@ class LibdrmConan(ConanFile): "etnaviv": False, "valgrind": False, "freedreno-kgsl": False, - "udev": False + "udev": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def build_requirements(self): - self.build_requires("meson/0.64.1") - def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC if Version(self.version) >= "2.4.111": del self.options.libkms 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") if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.intel: - self.requires("libpciaccess/0.16") - if self.settings.os == "Linux": - self.requires("linux-headers-generic/5.14.9") + self.requires("libpciaccess/0.17") + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("linux-headers-generic/5.15.128") def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration("libdrm supports only Linux or FreeBSD") + def build_requirements(self): + self.tool_requires("meson/1.2.2") + 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, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_meson(self): - meson = Meson(self) + def generate(self): + tc = PkgConfigDeps(self) + tc.generate() + + tc = MesonToolchain(self) + tc.project_options["cairo-tests"] = "disabled" if Version(self.version) >= "2.4.113" else "false" + tc.project_options["install-test-programs"] = "false" - defs={ - "cairo-tests" : "disabled" if Version(self.version) >= "2.4.113" else "false", - "install-test-programs": "false" - } if Version(self.version) < "2.4.111": - defs["libkms"] = "true" if self.options.libkms else "false" - - defs["freedreno-kgsl"] = "true" if getattr(self.options, "freedreno-kgsl") else "false" - defs["udev"] = "true" if self.options.udev else "false" - - for o in ["intel", "radeon", "amdgpu","nouveau", "vmwgfx", "omap", "exynos", - "freedreno", "tegra", "vc4", "etnaviv", "valgrind"]: + tc.project_options["libkms"] = "true" if self.options.libkms else "false" + + tc.project_options["freedreno-kgsl"] = "true" if getattr(self.options, "freedreno-kgsl") else "false" + tc.project_options["udev"] = "true" if self.options.udev else "false" + + for o in ["intel", "radeon", "amdgpu", "nouveau", "vmwgfx", "omap", + "exynos", "freedreno", "tegra", "vc4", "etnaviv", "valgrind"]: if Version(self.version) >= "2.4.113": - defs[o] = "enabled" if getattr(self.options, o) else "disabled" + tc.project_options[o] = "enabled" if getattr(self.options, o) else "disabled" else: - defs[o] = "true" if getattr(self.options, o) else "false" + tc.project_options[o] = "true" if getattr(self.options, o) else "false" - defs["datadir"] = os.path.join(self.package_folder, "res") - defs["mandir"] = os.path.join(self.package_folder, "res", "man") - - meson.configure( - defs = defs, - source_folder=self._source_subfolder, - build_folder=self._build_subfolder) - return meson + tc.project_options["datadir"] = os.path.join(self.package_folder, "res") + tc.project_options["mandir"] = os.path.join(self.package_folder, "res", "man") + tc.generate() def build(self): - meson = self._configure_meson() + meson = Meson(self) + meson.configure() meson.build() def package(self): - meson = self._configure_meson() + meson = Meson(self) meson.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) mkdir(self, os.path.join(self.package_folder, "licenses")) # Extract the License/s from the header to a file - tmp = load(self, os.path.join(self._source_subfolder, "include", "drm", "drm.h")) - license_contents = re.search("\*\/.*(\/\*(\*(?!\/)|[^*])*\*\/)", tmp, re.DOTALL)[1] + tmp = load(self, os.path.join(self.source_folder, "include", "drm", "drm.h")) + license_contents = re.search(r"\*/.*(/\*(\*(?!/)|[^*])*\*/)", tmp, re.DOTALL)[1] save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package_info(self): self.cpp_info.components["libdrm_libdrm"].libs = ["drm"] - self.cpp_info.components["libdrm_libdrm"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_libdrm"].includedirs.append(os.path.join("include", "libdrm")) self.cpp_info.components["libdrm_libdrm"].set_property("pkg_config_name", "libdrm") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libdrm_libdrm"].requires = ["linux-headers-generic::linux-headers-generic"] if Version(self.version) < "2.4.111": if self.options.libkms: self.cpp_info.components["libdrm_libkms"].libs = ["kms"] - self.cpp_info.components["libdrm_libkms"].includedirs.append(os.path.join('include', 'libkms')) + self.cpp_info.components["libdrm_libkms"].includedirs.append(os.path.join("include", "libkms")) self.cpp_info.components["libdrm_libkms"].requires = ["libdrm_libdrm"] self.cpp_info.components["libdrm_libkms"].set_property("pkg_config_name", "libkms") @@ -157,32 +155,33 @@ def package_info(self): if self.options.freedreno: self.cpp_info.components["libdrm_freedreno"].libs = ["drm_freedreno"] - self.cpp_info.components["libdrm_freedreno"].includedirs.append(os.path.join('include', 'libdrm')) - self.cpp_info.components["libdrm_freedreno"].includedirs.append(os.path.join('include', 'freedreno')) + self.cpp_info.components["libdrm_freedreno"].includedirs.append(os.path.join("include", "libdrm")) + self.cpp_info.components["libdrm_freedreno"].includedirs.append(os.path.join("include", "freedreno")) self.cpp_info.components["libdrm_freedreno"].requires = ["libdrm_libdrm"] self.cpp_info.components["libdrm_freedreno"].set_property("pkg_config_name", "libdrm_freedreno") if self.options.amdgpu: self.cpp_info.components["libdrm_amdgpu"].libs = ["drm_amdgpu"] - self.cpp_info.components["libdrm_amdgpu"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_amdgpu"].includedirs.append(os.path.join("include", "libdrm")) self.cpp_info.components["libdrm_amdgpu"].requires = ["libdrm_libdrm"] self.cpp_info.components["libdrm_amdgpu"].set_property("pkg_config_name", "libdrm_amdgpu") if self.options.nouveau: self.cpp_info.components["libdrm_nouveau"].libs = ["drm_nouveau"] - self.cpp_info.components["libdrm_nouveau"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_nouveau"].includedirs.extend([os.path.join("include", "libdrm"), os.path.join("include", "libdrm", "nouveau")]) self.cpp_info.components["libdrm_nouveau"].requires = ["libdrm_libdrm"] self.cpp_info.components["libdrm_nouveau"].set_property("pkg_config_name", "libdrm_nouveau") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libdrm_nouveau"].system_libs = ["pthread"] if self.options.intel: self.cpp_info.components["libdrm_intel"].libs = ["drm_intel"] - self.cpp_info.components["libdrm_intel"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_intel"].includedirs.append(os.path.join("include", "libdrm")) self.cpp_info.components["libdrm_intel"].requires = ["libdrm_libdrm", "libpciaccess::libpciaccess"] self.cpp_info.components["libdrm_intel"].set_property("pkg_config_name", "libdrm_intel") if self.options.radeon: self.cpp_info.components["libdrm_radeon"].libs = ["drm_radeon"] - self.cpp_info.components["libdrm_radeon"].includedirs.append(os.path.join('include', 'libdrm')) + self.cpp_info.components["libdrm_radeon"].includedirs.append(os.path.join("include", "libdrm")) self.cpp_info.components["libdrm_radeon"].requires = ["libdrm_libdrm"] self.cpp_info.components["libdrm_radeon"].set_property("pkg_config_name", "libdrm_radeon") - diff --git a/recipes/libdrm/all/test_package/CMakeLists.txt b/recipes/libdrm/all/test_package/CMakeLists.txt index afa24763570742..0561a690e26c10 100644 --- a/recipes/libdrm/all/test_package/CMakeLists.txt +++ b/recipes/libdrm/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 C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libdrm REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libdrm::libdrm) diff --git a/recipes/libdrm/all/test_package/conanfile.py b/recipes/libdrm/all/test_package/conanfile.py index 8e9e5fdc7aa40a..ef5d7042163ecc 100644 --- a/recipes/libdrm/all/test_package/conanfile.py +++ b/recipes/libdrm/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" + 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,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/libdrm/all/test_v1_package/CMakeLists.txt b/recipes/libdrm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libdrm/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/libdrm/all/test_v1_package/conanfile.py b/recipes/libdrm/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..994065a7574452 --- /dev/null +++ b/recipes/libdrm/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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/libdwarf/all/conandata.yml b/recipes/libdwarf/all/conandata.yml index 75d6fc5547c895..6abc97da6d65a8 100644 --- a/recipes/libdwarf/all/conandata.yml +++ b/recipes/libdwarf/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.8.0": + url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.8.0.tar.gz" + sha256: "8ef0dbfb0816b02aac97b87426689ebaa4efb8ec2ca2c759ea34c5e4678dff3f" + "0.7.0": + url: "https://www.prevanders.net/libdwarf-0.7.0.tar.xz" + sha256: "23b71829de875fa5842e49f232c8ee1a5043805749738bc61424d9abc1189f38" "0.5.0": url: "https://www.prevanders.net/libdwarf-0.5.0.tar.xz" sha256: "11fa822c60317fa00e1a01a2ac9e8388f6693e8662ab72d352c5f50c7e0112a9" @@ -6,6 +12,17 @@ sources: url: "https://www.prevanders.net/libdwarf-20191104.tar.gz" sha256: "45f50a966314421b7dab525859853616df6c9680f0ccf2f44b030c505236eaba" patches: + "0.8.0": + - patch_file: "patches/0.8.0-0001-fixes.patch" + patch_description: "fix DW_API definition and cmake" + patch_type: "portability" + "0.7.0": + - patch_file: "patches/0.7.0-0001-fix-cmake.patch" + patch_description: "use cci package, remove lib64/bin64 install folders" + patch_type: "conan" + - patch_file: "patches/0.5.0-0001-fix-DW_API.patch" + patch_description: "fix DW_API definition" + patch_type: "portability" "0.5.0": - patch_file: "patches/0.5.0-0001-fix-cmake.patch" patch_description: "use cci package, remove lib64/bin64 install folders" diff --git a/recipes/libdwarf/all/conanfile.py b/recipes/libdwarf/all/conanfile.py index ddc9a73438a95f..0149255b7e4f03 100644 --- a/recipes/libdwarf/all/conanfile.py +++ b/recipes/libdwarf/all/conanfile.py @@ -47,8 +47,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libelf/0.8.13") - self.requires("zlib/1.2.13") + if self.options.with_dwarfgen or self.version == "20191104": + self.requires("libelf/0.8.13") + self.requires("zlib/[>=1.2.11 <2]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -104,4 +105,4 @@ def package_info(self): self.env_info.PATH.append(bindir) if self.version != "20191104": - self.cpp_info.libs.append = ["dwarfp"] + self.cpp_info.libs.append("dwarfp") diff --git a/recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch b/recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch index fce5a0373f748e..cd8664d42f3dc9 100644 --- a/recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch +++ b/recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch @@ -6,7 +6,7 @@ index 4f58f43..69e0238 100644 ### cmake provides no way to guarantee uint32_t present. ### configure does guarantee that. -+find_package(libelf REQUIRED) ++find_package(libelf) if(HAVE_STDINT_H) check_c_source_compiles(" #include @@ -103,3 +103,13 @@ index 0b7d578..62b67da 100644 set(LIBDIR lib${SUFFIX}) set(BINDIR bin${SUFFIX}) +@@ -119,6 +121,9 @@ install( + ) + install(DIRECTORY libdwarf DESTINATION include/ + FILES_MATCHING PATTERN "*.h") ++install( ++ FILES ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.h ++ DESTINATION include/libdwarf) + install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/libdwarf.h + DESTINATION include/libdwarf) diff --git a/recipes/libdwarf/all/patches/0.7.0-0001-fix-cmake.patch b/recipes/libdwarf/all/patches/0.7.0-0001-fix-cmake.patch new file mode 100644 index 00000000000000..bb0a859d8fd823 --- /dev/null +++ b/recipes/libdwarf/all/patches/0.7.0-0001-fix-cmake.patch @@ -0,0 +1,128 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dd09dde8..8162a985 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -129,6 +129,9 @@ check_include_file( "libelf/libelf.h" HAVE_LIBELF_LIBELF_H) + + ### cmake provides no way to guarantee uint32_t present. + ### configure does guarantee that. ++if (BUILD_DWARFGEN) ++ find_package(libelf REQUIRED) ++endif() + if(HAVE_STDINT_H) + check_c_source_compiles(" + #include +@@ -192,7 +195,8 @@ elseif(HAVE_LIBELF_LIBELF_H) + endif() + + if (HAVE_LIBELF_H OR HAVE_LIBELF_LIBELF_H) +- set (CMAKE_REQUIRED_LIBRARIES elf) ++ set (CMAKE_REQUIRED_LIBRARIES libelf::libelf) ++ set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getehdr") + check_symbol_exists( elf64_getehdr ${PLAIN_JUST_LIBELF} HAVE_ELF64_GETEHDR) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getshdr") +@@ -216,6 +220,9 @@ if (DWARF_WITH_LIBELF) + message(STATUS "checking using elf header ... ${HAVE_LOCATION_OF_LIBELFHEADER}") + message(STATUS "checking using libelf header ... ${JUST_LIBELF}") + ++set (CMAKE_REQUIRED_LIBRARIES libelf::libelf) ++set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) ++ + check_c_source_compiles(" + #include ${HAVE_LOCATION_OF_LIBELFHEADER} + int main() +@@ -361,7 +368,6 @@ message(STATUS "Building api tests ... ${DOTESTS}") + ### end what was configure.cmake + + # This references cmake/FindLibElf.cmake. See cmake documentation. +-find_package(LibElf REQUIRED) + list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBELF_INCLUDE_DIRS}) + + configure_file(cmake/config.h.cmake config.h) +@@ -384,7 +390,6 @@ if(BUILD_SHARED) + endif() + + add_subdirectory(src/lib/libdwarf) +-add_subdirectory(src/bin/dwarfdump) + + if ( BUILD_DWARFEXAMPLE ) + add_subdirectory(src/bin/dwarfexample) +diff --git a/src/bin/dwarfdump/CMakeLists.txt b/src/bin/dwarfdump/CMakeLists.txt +index 507f761d..8ddb0d90 100644 +--- a/src/bin/dwarfdump/CMakeLists.txt ++++ b/src/bin/dwarfdump/CMakeLists.txt +@@ -64,7 +64,7 @@ target_compile_options(dwarfdump PRIVATE ${DW_FWALL}) + + target_link_libraries(dwarfdump PRIVATE ${dwarf-target} ${DW_FZLIB} ${DW_FZSTD} ) + +-if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) ++if(0) + set(SUFFIX 64) + endif() + set(LIBDIR lib${SUFFIX}) +diff --git a/src/bin/dwarfgen/CMakeLists.txt b/src/bin/dwarfgen/CMakeLists.txt +index a7f5d78e..60293f6b 100644 +--- a/src/bin/dwarfgen/CMakeLists.txt ++++ b/src/bin/dwarfgen/CMakeLists.txt +@@ -28,7 +28,7 @@ target_include_directories(dwarfgen PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/libdwarfp) + + target_link_libraries(dwarfgen PRIVATE ${dwarfp-target} +- ${dwarf-target} ${DW_FZLIB}) ++ ${dwarf-target} ${DW_FZLIB} libelf::libelf) + + set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) +diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt +index 913274b8..8515e2b0 100644 +--- a/src/lib/libdwarf/CMakeLists.txt ++++ b/src/lib/libdwarf/CMakeLists.txt +@@ -70,7 +70,7 @@ set_source_group(CONFIGURATION_FILES "Configuration Files" + + list(LENGTH DWARF_TARGETS targetCount) + math(EXPR targetCount "${targetCount} - 1") +-list(APPEND DWARF_LIBS ${LIBELF_LIBRARIES}) ++list(APPEND DWARF_LIBS ${libelf_LIBRARIES}) + if (DW_FZLIB) + list(APPEND DWARF_LIBS z) + endif() +@@ -88,13 +88,15 @@ foreach(i RANGE ${targetCount}) + ${LIBELF_INCLUDE_DIRS}) + target_compile_options(${target} PRIVATE -DLIBDWARF_BUILD + ${DW_FWALL}) +- msvc_posix(${target}) ++ if(BUILD_SHARED) ++ target_compile_definitions(${target} PRIVATE LIBDWARF_SHARED) ++ endif() ++ msvc_posix(${target}) + + target_link_libraries(${target} PUBLIC ${LIBELF_LIBRARIES} ${DW_FZLIB} ${DW_FZSTD} ) + + set_target_properties(${target} PROPERTIES OUTPUT_NAME dwarf) + +- set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) + set(BINDIR bin${SUFFIX}) + +@@ -105,7 +107,6 @@ foreach(i RANGE ${targetCount}) + endforeach() + + # add_library(libdwarf) +-configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY ) + + # The install has to be here, not in + # another CMakeLists.txt to make install work properly +@@ -126,9 +127,9 @@ install( + ) + install(DIRECTORY libdwarf DESTINATION include/ + FILES_MATCHING PATTERN "*.h") ++install( ++ FILES ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.h ++ DESTINATION include/libdwarf) + install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/libdwarf.h + DESTINATION include/libdwarf) +-install( FILES ${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc +- DESTINATION lib/pkgconfig +-) diff --git a/recipes/libdwarf/all/patches/0.8.0-0001-fixes.patch b/recipes/libdwarf/all/patches/0.8.0-0001-fixes.patch new file mode 100644 index 00000000000000..0393ff627c4caa --- /dev/null +++ b/recipes/libdwarf/all/patches/0.8.0-0001-fixes.patch @@ -0,0 +1,57 @@ +diff --git src/bin/dwarfdump/CMakeLists.txt src/bin/dwarfdump/CMakeLists.txt +index 1b8aa3ae..72819160 100644 +--- src/bin/dwarfdump/CMakeLists.txt ++++ src/bin/dwarfdump/CMakeLists.txt +@@ -65,7 +65,7 @@ target_compile_options(dwarfdump PRIVATE ${DW_FWALL}) + + target_link_libraries(dwarfdump PRIVATE ${dwarf-target} ${DW_FZLIB} ${DW_FZSTD} ) + +-if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) ++if(0) + set(SUFFIX 64) + endif() + set(LIBDIR lib${SUFFIX}) +diff --git src/lib/libdwarf/CMakeLists.txt src/lib/libdwarf/CMakeLists.txt +index 09908bba..a33f92c8 100644 +--- src/lib/libdwarf/CMakeLists.txt ++++ src/lib/libdwarf/CMakeLists.txt +@@ -109,7 +109,6 @@ foreach(i RANGE ${targetCount}) + + set_target_properties(${target} PROPERTIES OUTPUT_NAME dwarf) + +- set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) + set(BINDIR bin${SUFFIX}) + +@@ -119,7 +118,7 @@ foreach(i RANGE ${targetCount}) + ARCHIVE DESTINATION ${LIBDIR}) + endforeach() + +-configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY ) ++#configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY ) + + # The install has to be here, not in + # another CMakeLists.txt to make install work properly +@@ -144,6 +143,6 @@ install( + install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.h + DESTINATION include/libdwarf) +-install( FILES ${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc +- DESTINATION lib/pkgconfig +-) ++#install( FILES ${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc ++# DESTINATION lib/pkgconfig ++#) +diff --git src/lib/libdwarf/libdwarf.h src/lib/libdwarf/libdwarf.h +index 9a0783e3..0bce4d09 100644 +--- src/lib/libdwarf/libdwarf.h ++++ src/lib/libdwarf/libdwarf.h +@@ -51,7 +51,7 @@ + #endif /* DW_API */ + + #ifndef LIBDWARF_STATIC +-# if defined(_WIN32) || defined(__CYGWIN__) ++# if defined(LIBDWARF_SHARED) && (defined(_WIN32) || defined(__CYGWIN__)) + # ifdef LIBDWARF_BUILD + # define DW_API __declspec(dllexport) + # else /* !LIBDWARF_BUILD */ diff --git a/recipes/libdwarf/all/test_package/test_package.c b/recipes/libdwarf/all/test_package/test_package.c index 33cfec6d8bf917..27d0d196b5a8d4 100644 --- a/recipes/libdwarf/all/test_package/test_package.c +++ b/recipes/libdwarf/all/test_package/test_package.c @@ -7,6 +7,7 @@ #include "dwarf.h" #include "libdwarf.h" #else + #include "libdwarf/dwarf.h" #include "libdwarf/libdwarf.h" #endif @@ -20,6 +21,8 @@ void example1(Dwarf_Die somedie) { errv = dwarf_attrlist(somedie, &atlist, &atcount, &error); if (errv == DW_DLV_OK) { for (i = 0; i < atcount; ++i) { + Dwarf_Bool is_string; + dwarf_hasform(atlist[i], DW_FORM_string, &is_string, &error); dwarf_dealloc(dbg, atlist[i], DW_DLA_ATTR); } dwarf_dealloc(dbg, atlist, DW_DLA_LIST); diff --git a/recipes/libdwarf/config.yml b/recipes/libdwarf/config.yml index aa4d403dacd897..2bad80aa2207b2 100644 --- a/recipes/libdwarf/config.yml +++ b/recipes/libdwarf/config.yml @@ -1,4 +1,8 @@ versions: + "0.8.0": + folder: all + "0.7.0": + folder: all "0.5.0": folder: all "20191104": diff --git a/recipes/libenvpp/all/conandata.yml b/recipes/libenvpp/all/conandata.yml new file mode 100644 index 00000000000000..6d0d3123e3cdf3 --- /dev/null +++ b/recipes/libenvpp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.3.0": + url: "https://github.com/ph3at/libenvpp/archive/refs/tags/v1.3.0.tar.gz" + sha256: "9201ae39dc67118ee46b4e60fe2e5d22b046faceae4a4b4eec6ab62bc48875dd" +patches: + "1.3.0": + - patch_file: "patches/0001-use-cci-fmt.patch" + patch_description: "use cci fmt package, remove static flag from add_library" + patch_type: "conan" diff --git a/recipes/libenvpp/all/conanfile.py b/recipes/libenvpp/all/conanfile.py new file mode 100644 index 00000000000000..06b2bc9d3e325f --- /dev/null +++ b/recipes/libenvpp/all/conanfile.py @@ -0,0 +1,93 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +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" + +class LibenvppConan(ConanFile): + name = "libenvpp" + description = "A modern C++ library for type-safe environment variable parsing" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ph3at/libenvpp" + topics = ("environment", "type-safe") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "191", + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("fmt/10.1.1", transitive_headers=True) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + + 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 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["LIBENVPP_TESTS"] = False + tc.variables["LIBENVPP_EXAMPLES"] = False + tc.variables["LIBENVPP_CHECKS"] = False + tc.variables["LIBENVPP_INSTALL"] = True + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["envpp" if self.settings.os != "Windows" else "libenvpp"] diff --git a/recipes/libenvpp/all/patches/0001-use-cci-fmt.patch b/recipes/libenvpp/all/patches/0001-use-cci-fmt.patch new file mode 100644 index 00000000000000..d89edb409485de --- /dev/null +++ b/recipes/libenvpp/all/patches/0001-use-cci-fmt.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e3ecffb..49cae57 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -54,6 +54,7 @@ function(libenvpp_set_compiler_parameters TARGET) + endfunction() + + # External dependencies. ++if(0) + if(LIBENVPP_INSTALL) + set(FMT_INSTALL ON CACHE BOOL "" FORCE) + endif() +@@ -63,6 +63,8 @@ FetchContent_Declare(fmt + GIT_TAG 9.1.0 + ) + FetchContent_MakeAvailable(fmt) ++endif() ++find_package(fmt REQUIRED CONFIG) + + if(LIBENVPP_TESTS) + FetchContent_Declare(Catch2 +@@ -133,6 +134,8 @@ endif() + + # Installation target. + if(LIBENVPP_INSTALL) ++ include(CMakePackageConfigHelpers) ++ + # Libenvpp installation. + set(LIBENVPP_PROJECT_CONFIG_OUT "${CMAKE_CURRENT_BINARY_DIR}/libenvpp-config.cmake") + set(LIBENVPP_VERSION_CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/libenvpp-config-version.cmake") diff --git a/recipes/libenvpp/all/test_package/CMakeLists.txt b/recipes/libenvpp/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..59cf4056ecd208 --- /dev/null +++ b/recipes/libenvpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(libenvpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libenvpp::libenvpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libenvpp/all/test_package/conanfile.py b/recipes/libenvpp/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/libenvpp/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libenvpp/all/test_package/test_package.cpp b/recipes/libenvpp/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..9be10c22b43a73 --- /dev/null +++ b/recipes/libenvpp/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include + +#include "libenvpp/env.hpp" + +int main() +{ + auto pre = env::prefix("MYPROG"); + + const auto num_threads_id = pre.register_required_variable("NUM_THREADS"); + + const auto parsed_and_validated_pre = pre.parse_and_validate(); + + if (parsed_and_validated_pre.ok()) { + const auto num_threads = parsed_and_validated_pre.get(num_threads_id); + + std::cout << "Num threads: " << num_threads << std::endl; + } else { + std::cout << parsed_and_validated_pre.warning_message(); + std::cout << parsed_and_validated_pre.error_message(); + } + + return 0; +} diff --git a/recipes/libenvpp/config.yml b/recipes/libenvpp/config.yml new file mode 100644 index 00000000000000..426a0e4c79e9b1 --- /dev/null +++ b/recipes/libenvpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/libepoxy/all/conanfile.py b/recipes/libepoxy/all/conanfile.py index c8c1d778cd3603..2f9f112de0a990 100644 --- a/recipes/libepoxy/all/conanfile.py +++ b/recipes/libepoxy/all/conanfile.py @@ -70,7 +70,7 @@ def validate(self): raise ConanInvalidConfiguration("Static builds on Windows are not supported") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.2.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libevdev/all/conandata.yml b/recipes/libevdev/all/conandata.yml new file mode 100644 index 00000000000000..36ae01fb48f05b --- /dev/null +++ b/recipes/libevdev/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.13.1": + url: "https://www.freedesktop.org/software/libevdev/libevdev-1.13.1.tar.xz" + sha256: "06a77bf2ac5c993305882bc1641017f5bec1592d6d1b64787bad492ab34f2f36" diff --git a/recipes/libevdev/all/conanfile.py b/recipes/libevdev/all/conanfile.py new file mode 100644 index 00000000000000..bd31989739c14f --- /dev/null +++ b/recipes/libevdev/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + +class LibEvdevConan(ConanFile): + name = "libevdev" + description = "libevdev is a wrapper library for evdev devices." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freedesktop.org/wiki/Software/libevdev" + topics = ("device", "evdev", "freedesktop", "input") + 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 validate(self): + if not self.settings.os in ["FreeBSD", "Linux"]: + raise ConanInvalidConfiguration(f"{self.name} Only supports FreeBSD and Linux") + + def build_requirements(self): + self.tool_requires("meson/1.2.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["tests"] = "disabled" + tc.project_options["documentation"] = "disabled" + tc.project_options["coverity"] = "false" + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", 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")) + + def package_info(self): + self.cpp_info.libs = ["evdev"] + self.cpp_info.includedirs = [os.path.join("include", f"libevdev-{Version(self.version).major}.0")] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "rt"]) diff --git a/recipes/libevdev/all/test_package/conanfile.py b/recipes/libevdev/all/test_package/conanfile.py new file mode 100644 index 00000000000000..5aab0703e7a4ef --- /dev/null +++ b/recipes/libevdev/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.2") + 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/libevdev/all/test_package/meson.build b/recipes/libevdev/all/test_package/meson.build new file mode 100644 index 00000000000000..16df74e848742a --- /dev/null +++ b/recipes/libevdev/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +libevdev_dep = dependency('libevdev') +executable('test_package', + sources : ['test_package.c'], + dependencies : [libevdev_dep]) diff --git a/recipes/libevdev/all/test_package/test_package.c b/recipes/libevdev/all/test_package/test_package.c new file mode 100644 index 00000000000000..c8e6a5edda83f7 --- /dev/null +++ b/recipes/libevdev/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main(void) { + libevdev_new_from_fd(0, NULL); + return 0; +} diff --git a/recipes/libevdev/config.yml b/recipes/libevdev/config.yml new file mode 100644 index 00000000000000..aac1819cc10c01 --- /dev/null +++ b/recipes/libevdev/config.yml @@ -0,0 +1,3 @@ +versions: + "1.13.1": + folder: all diff --git a/recipes/libfreenect/all/conandata.yml b/recipes/libfreenect/all/conandata.yml index d95c75077fd157..5f576feee3083f 100644 --- a/recipes/libfreenect/all/conandata.yml +++ b/recipes/libfreenect/all/conandata.yml @@ -1,7 +1,12 @@ sources: + "0.7.0": + url: "https://github.com/OpenKinect/libfreenect/archive/v0.7.0.tar.gz" + sha256: "adbfc6e7ce72f77cccb3341807a1e2cc6fe2ee62e1bc4d70a6c9b05fac83fe8f" "0.6.2": url: "https://github.com/OpenKinect/libfreenect/archive/refs/tags/v0.6.2.tar.gz" sha256: "e135f5e60ae290bf1aa403556211f0a62856a9e34f12f12400ec593620a36bfa" patches: + "0.7.0": + - patch_file: "patches/0.6.2-fix-cmake.patch" "0.6.2": - patch_file: "patches/0.6.2-fix-cmake.patch" diff --git a/recipes/libfreenect/config.yml b/recipes/libfreenect/config.yml index a09c617182ab2d..d4f601d9832b33 100644 --- a/recipes/libfreenect/config.yml +++ b/recipes/libfreenect/config.yml @@ -1,3 +1,5 @@ versions: + "0.7.0": + folder: all "0.6.2": folder: all diff --git a/recipes/libfreenect2/all/CMakeLists.txt b/recipes/libfreenect2/all/CMakeLists.txt index c986d294c75479..ff20e4a7a17dda 100644 --- a/recipes/libfreenect2/all/CMakeLists.txt +++ b/recipes/libfreenect2/all/CMakeLists.txt @@ -1,7 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") +add_subdirectory(src) diff --git a/recipes/libfreenect2/all/conandata.yml b/recipes/libfreenect2/all/conandata.yml index 7fab4fd83db66c..95824e496a47a6 100644 --- a/recipes/libfreenect2/all/conandata.yml +++ b/recipes/libfreenect2/all/conandata.yml @@ -5,6 +5,4 @@ sources: patches: "0.2.1": - patch_file: "patches/0.2.1-fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0.2.1-generate-resources.patch" - base_path: "source_subfolder" diff --git a/recipes/libfreenect2/all/conanfile.py b/recipes/libfreenect2/all/conanfile.py index dbb951cc733d99..b9a827fb5ffdb0 100644 --- a/recipes/libfreenect2/all/conanfile.py +++ b/recipes/libfreenect2/all/conanfile.py @@ -1,21 +1,32 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +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 apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir, replace_in_file +from conan.tools.gnu import PkgConfigDeps + +required_conan_version = ">=1.53.0" + class Libfreenect2Conan(ConanFile): name = "libfreenect2" + description = "Open source drivers for the Kinect for Windows v2 device." license = ("Apache-2.0", "GPL-2.0") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/OpenKinect/libfreenect2" - description = "Open source drivers for the Kinect for Windows v2 device." topics = ("usb", "camera", "kinect") - settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "with_opencl": [True, False], "with_opengl": [True, False], "with_vaapi": [True, False], + "with_cuda": [True, False], } default_options = { "shared": False, @@ -23,88 +34,133 @@ class Libfreenect2Conan(ConanFile): "with_opencl": True, "with_opengl": True, "with_vaapi": True, + "with_cuda": False, } - generators = "cmake", "cmake_find_package" - exports_sources = ["CMakeLists.txt", "patches/*"] - - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" - - @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": del self.options.fPIC - if self.settings.os != "Linux": - del self.options.with_vaapi + if self.settings.os not in ["Linux", "FreeBSD"]: + self.options.rm_safe("with_vaapi") 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("libusb/1.0.24") - self.requires("libjpeg-turbo/2.1.1") + self.requires("libusb/1.0.26") + self.requires("libjpeg-turbo/3.0.0") if self.options.with_opencl: - self.requires("opencl-headers/2021.04.29") - self.requires("opencl-icd-loader/2021.04.29") + # 2023.02.06 is the latest compatible version + self.requires("opencl-headers/2023.02.06") + self.requires("opencl-icd-loader/2023.02.06") if self.options.with_opengl: self.requires("opengl/system") - self.requires("glfw/3.3.4") + self.requires("glfw/3.3.8") if self.options.get_safe("with_vaapi"): self.requires("vaapi/system") + if self.options.with_cuda: + self.requires("cuda-samples/12.2") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + if self.options.with_cuda: + self.output.warning("Conan package for CUDA is not available, will use system CUDA") 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.variables["CMAKE_FIND_ROOT_PATH_MODE_PACKAGE"] = "NONE" + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_OPENNI2_DRIVER"] = False + tc.variables["ENABLE_CXX11"] = True + tc.variables["ENABLE_OPENCL"] = self.options.with_opencl + tc.variables["ENABLE_CUDA"] = self.options.with_cuda + tc.variables["ENABLE_OPENGL"] = self.options.with_opengl + tc.variables["ENABLE_VAAPI"] = self.options.get_safe("with_vaapi", False) + tc.variables["ENABLE_TEGRAJPEG"] = False # TODO: TegraJPEG + tc.variables["ENABLE_PROFILING"] = False + if self.options.with_cuda: + tc.variables["NVCUDASAMPLES_ROOT"] = os.path.join(self.dependencies["cuda-samples"].package_folder, "include") + # Required for deprecated FindCUDA support + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0146"] = "OLD" + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("libusb", "cmake_file_name", "LibUSB") + deps.set_property("glfw3", "cmake_file_name", "GLFW3") + deps.set_property("libjpeg-turbo", "cmake_file_name", "TurboJPEG") + deps.generate() + + deps = PkgConfigDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_EXAMPLES"] = False - self._cmake.definitions["BUILD_OPENNI2_DRIVER"] = False - self._cmake.definitions["ENABLE_CXX11"] = True - self._cmake.definitions["ENABLE_OPENCL"] = self.options.with_opencl - self._cmake.definitions["ENABLE_CUDA"] = False # TODO: CUDA - self._cmake.definitions["ENABLE_OPENGL"] = self.options.with_opengl - self._cmake.definitions["ENABLE_VAAPI"] = self.options.get_safe("with_vaapi", False) - self._cmake.definitions["ENABLE_TEGRAJPEG"] = False # TODO: TegraJPEG - self._cmake.definitions["ENABLE_PROFILING"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "FIND_PACKAGE(JPEG)", "FIND_PACKAGE(TurboJPEG REQUIRED CONFIG)") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + " JPEG_FOUND", " TRUE") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("APACHE20", src=self._source_subfolder, dst="licenses", keep_path=False) - self.copy("GPL2", src=self._source_subfolder, dst="licenses", keep_path=False) - cmake = self._configure_cmake() + copy(self, "APACHE20", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + keep_path=False) + copy(self, "GPL2", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + keep_path=False) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(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, "lib", "cmake")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "freenect2" - self.cpp_info.names["cmake_find_package_multi"] = "freenect2" - self.cpp_info.names["pkg_config"] = "freenect2" - self.cpp_info.libs = tools.collect_libs(self) - if self.settings.os == "Linux": + self.cpp_info.set_property("cmake_file_name", "freenect2") + self.cpp_info.set_property("cmake_target_name", "freenect2::freenect2") + self.cpp_info.set_property("pkg_config_name", "freenect2") + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) - elif self.settings.os == "Macos": + elif is_apple_os(self): self.cpp_info.frameworks.extend(["VideoToolbox", "CoreFoundation", "CoreMedia", "CoreVideo"]) + + self.cpp_info.requires += [ + "libusb::libusb", + "libjpeg-turbo::jpeg", + "libjpeg-turbo::turbojpeg", + ] + if self.options.with_opencl: + self.cpp_info.requires += [ + "opencl-headers::opencl-headers", + "opencl-icd-loader::opencl-icd-loader", + ] + if self.options.with_opengl: + self.cpp_info.requires += [ + "opengl::opengl", + "glfw::glfw", + ] + if self.options.get_safe("with_vaapi"): + self.cpp_info.requires += ["vaapi::vaapi"] + if self.options.with_cuda: + self.cpp_info.requires += ["cuda-samples::cuda-samples"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "freenect2" + self.cpp_info.names["cmake_find_package_multi"] = "freenect2" diff --git a/recipes/libfreenect2/all/patches/0.2.1-fix-cmake.patch b/recipes/libfreenect2/all/patches/0.2.1-fix-cmake.patch index 93324460a3d713..fcc8f8dfa20e82 100644 --- a/recipes/libfreenect2/all/patches/0.2.1-fix-cmake.patch +++ b/recipes/libfreenect2/all/patches/0.2.1-fix-cmake.patch @@ -1,27 +1,6 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d8ef047..a81aa8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -90,8 +90,7 @@ SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) - SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) - - # dependencies --FIND_PACKAGE(PkgConfig) # try find PKGConfig as it will be used if found --FIND_PACKAGE(LibUSB REQUIRED) -+find_package(libusb REQUIRED) - - # Add includes - INCLUDE_DIRECTORIES( -@@ -99,7 +98,7 @@ INCLUDE_DIRECTORIES( - "${MY_DIR}/include/internal" - ${PROJECT_BINARY_DIR} # for generated headers - ${LIBFREENECT2_THREADING_INCLUDE_DIR} -- ${LibUSB_INCLUDE_DIRS} -+ # ${LibUSB_INCLUDE_DIRS} - ) - - SET(RESOURCES_INC_FILE "${PROJECT_BINARY_DIR}/resources.inc.h") -@@ -157,12 +156,12 @@ SET(SOURCES +@@ -157,7 +157,7 @@ ) SET(LIBRARIES @@ -30,174 +9,88 @@ index d8ef047..a81aa8e 100644 ${LIBFREENECT2_THREADING_LIBRARIES} ) - SET(LIBFREENECT2_DLLS -- ${LibUSB_DLL} -+ #${LibUSB_DLL} - ) - - SET(HAVE_VideoToolbox "no (Apple only)") -@@ -193,13 +192,14 @@ ENDIF(APPLE) - - SET(HAVE_VAAPI disabled) - IF(ENABLE_VAAPI) -- IF(PKG_CONFIG_FOUND) -- PKG_CHECK_MODULES(VAAPI libva libva-drm) -- ENDIF() -- FIND_PACKAGE(JPEG) -+ # IF(PKG_CONFIG_FOUND) -+ # PKG_CHECK_MODULES(VAAPI libva libva-drm) -+ # ENDIF() -+ find_package(vaapi REQUIRED) -+ find_package(libjpeg-turbo REQUIRED) - - SET(HAVE_VAAPI no) -- IF(VAAPI_FOUND AND JPEG_FOUND) -+ # IF(VAAPI_FOUND AND JPEG_FOUND) - SET(LIBFREENECT2_WITH_VAAPI_SUPPORT 1) - SET(HAVE_VAAPI yes) - -@@ -209,10 +209,10 @@ IF(ENABLE_VAAPI) - src/vaapi_rgb_packet_processor.cpp - ) - LIST(APPEND LIBRARIES -- ${VAAPI_LIBRARIES} -- ${JPEG_LIBRARY} -+ vaapi::vaapi -+ libjpeg-turbo::libjpeg-turbo - ) -- ENDIF() -+ # ENDIF() - ENDIF(ENABLE_VAAPI) - - SET(HAVE_TegraJPEG disabled) -@@ -237,38 +237,38 @@ IF(ENABLE_TEGRAJPEG) - ENDIF() - - IF(LIBFREENECT2_WITH_VT_SUPPORT) -- FIND_PACKAGE(TurboJPEG) -+ find_package(libjpeg-turbo REQUIRED) - ELSE() - # VAAPI can fail to start at runtime. It must have a fallback. -- FIND_PACKAGE(TurboJPEG REQUIRED) -+ find_package(libjpeg-turbo REQUIRED) - ENDIF() - - SET(HAVE_TurboJPEG no) --IF(TurboJPEG_FOUND) -+IF(libjpeg-turbo_FOUND) - SET(LIBFREENECT2_WITH_TURBOJPEG_SUPPORT 1) - SET(HAVE_TurboJPEG yes) - -- INCLUDE_DIRECTORIES(${TurboJPEG_INCLUDE_DIRS}) -+ #INCLUDE_DIRECTORIES(${TurboJPEG_INCLUDE_DIRS}) - - LIST(APPEND SOURCES - src/turbo_jpeg_rgb_packet_processor.cpp - ) - - LIST(APPEND LIBRARIES -- ${TurboJPEG_LIBRARIES} -+ libjpeg-turbo::libjpeg-turbo - ) - - LIST(APPEND LIBFREENECT2_DLLS -- ${TurboJPEG_DLL} -+ #${TurboJPEG_DLL} - ) - ENDIF() - - SET(HAVE_OpenGL disabled) - IF(ENABLE_OPENGL) -- FIND_PACKAGE(GLFW3) -- FIND_PACKAGE(OpenGL) -+ find_package(glfw3 REQUIRED) -+ find_package(opengl_system REQUIRED) - SET(HAVE_OpenGL no) -- IF(GLFW3_FOUND AND OPENGL_FOUND) -+ # IF(GLFW3_FOUND AND OPENGL_FOUND) - SET(LIBFREENECT2_WITH_OPENGL_SUPPORT 1) - SET(HAVE_OpenGL yes) - -@@ -276,8 +276,8 @@ IF(ENABLE_OPENGL) +@@ -276,8 +272,8 @@ LIST(APPEND LIBFREENECT2_DLLS ${GLFW3_DLL}) LIST(APPEND LIBRARIES - ${GLFW3_LIBRARIES} - ${OPENGL_gl_LIBRARY} -+ glfw::glfw -+ opengl::opengl ++ ${GLFW3_LIBRARIES} glfw ++ ${OPENGL_gl_LIBRARY} opengl::opengl ) LIST(APPEND SOURCES src/flextGL.cpp -@@ -292,19 +292,19 @@ IF(ENABLE_OPENGL) - src/shader/stage1.fs - src/shader/stage2.fs - ) -- ENDIF() -+ # ENDIF() - ENDIF(ENABLE_OPENGL) +@@ -297,10 +293,10 @@ SET(HAVE_OpenCL disabled) IF(ENABLE_OPENCL) - FIND_PACKAGE(OpenCL) -+ find_package(opencl-icd-loader REQUIRED) ++ find_package(OpenCLICDLoader REQUIRED) ++ find_package(OpenCLHeaders REQUIRED) SET(HAVE_OpenCL no) - IF(OpenCL_FOUND) -+ #IF(OpenCL_FOUND) SET(LIBFREENECT2_WITH_OPENCL_SUPPORT 1) SET(HAVE_OpenCL yes) -- IF(UNIX AND NOT APPLE) -+ IF(0) - INCLUDE(CheckOpenCLICDLoader) - IF(OpenCL_C_WORKS AND NOT OpenCL_CXX_WORKS) - SET(LIBFREENECT2_OPENCL_ICD_LOADER_IS_OLD 1) -@@ -312,7 +312,7 @@ IF(ENABLE_OPENCL) +@@ -312,7 +308,7 @@ MESSAGE(WARNING "Your libOpenCL.so is incompatible with CL/cl.h. Install ocl-icd-opencl-dev to update libOpenCL.so?") ENDIF() ENDIF() - INCLUDE_DIRECTORIES(${OpenCL_INCLUDE_DIRS}) -+ #INCLUDE_DIRECTORIES(${OpenCL_INCLUDE_DIRS}) ++ INCLUDE_DIRECTORIES(${OpenCLHeaders_INCLUDE_DIRS}) LIST(APPEND SOURCES src/opencl_depth_packet_processor.cpp -@@ -320,7 +320,7 @@ IF(ENABLE_OPENCL) +@@ -320,7 +316,7 @@ ) LIST(APPEND LIBRARIES - ${OpenCL_LIBRARIES} -+ opencl-icd-loader::opencl-icd-loader ++ OpenCL::Headers OpenCL::OpenCL ) LIST(APPEND RESOURCES -@@ -334,7 +334,7 @@ IF(ENABLE_OPENCL) +@@ -334,12 +330,11 @@ IF(UNIX AND NOT APPLE) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") ENDIF() - ENDIF(OpenCL_FOUND) -+ #ENDIF(OpenCL_FOUND) ENDIF(ENABLE_OPENCL) SET(HAVE_CUDA disabled) -@@ -385,7 +385,7 @@ IF(ENABLE_CUDA) - ENDIF(ENABLE_CUDA) - - # RPATH handling for CUDA 8.0 libOpenCL.so conflict. See #804. --IF(HAVE_OpenCL STREQUAL yes AND UNIX AND NOT APPLE) -+IF(0) - FILE(GLOB CUDA_ld_so_conf /etc/ld.so.conf.d/cuda*.conf) - IF(CUDA_ld_so_conf) - MESSAGE(WARNING "Your CUDA installation overrides OpenCL system library path.") -@@ -403,9 +403,9 @@ ENDIF() + IF(ENABLE_CUDA) +- FIND_PACKAGE(CUDA) ++ FIND_PACKAGE(CUDA REQUIRED) + SET(HAVE_CUDA no) + IF(CUDA_FOUND AND MSVC14 AND CUDA_VERSION VERSION_LESS 8.0) + SET(HAVE_CUDA "no (VS2015 not supported)") +@@ -347,12 +342,15 @@ + SET(LIBFREENECT2_WITH_CUDA_SUPPORT 1) + SET(HAVE_CUDA yes) + +- STRING(REPLACE "\\" "/" NVCUDASAMPLES_ROOT "$ENV{NVCUDASAMPLES_ROOT}") ++ IF(NOT DEFINED NVCUDASAMPLES_ROOT) ++ STRING(REPLACE "\\" "/" NVCUDASAMPLES_ROOT "$ENV{NVCUDASAMPLES_ROOT}") ++ ENDIF() + STRING(REPLACE "\\" "/" NVCUDASAMPLES8_0_ROOT "$ENV{NVCUDASAMPLES8_0_ROOT}") + CUDA_INCLUDE_DIRECTORIES( + "${MY_DIR}/include/" + "${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc" + "${NVCUDASAMPLES_ROOT}/common/inc" ++ "${NVCUDASAMPLES_ROOT}/Common" + "${NVCUDASAMPLES8_0_ROOT}/common/inc" + ) + SET(CUDA_FLAGS -use_fast_math) +@@ -403,11 +401,6 @@ # Both command line -DCMAKE_INSTALL_RPATH=... and CMake GUI settings are accepted. # # Anyway if wrong versions of libusb is used, errors will be reported explicitly. -IF(NOT DEFINED CMAKE_INSTALL_RPATH AND NOT ${LibUSB_LIBDIR} MATCHES "^/usr/lib") -+IF(0 AND NOT DEFINED CMAKE_INSTALL_RPATH AND NOT ${LibUSB_LIBDIR} MATCHES "^/usr/lib") - SET(CMAKE_INSTALL_RPATH ${LibUSB_LIBDIR} CACHE STRING "Set RPATH for a private libusb") +- SET(CMAKE_INSTALL_RPATH ${LibUSB_LIBDIR} CACHE STRING "Set RPATH for a private libusb") -ELSEIF(DEFINED CMAKE_INSTALL_RPATH) -+ELSEIF(0 AND DEFINED CMAKE_INSTALL_RPATH) - SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} CACHE STRING "Set RPATH for a private libusb") - ENDIF() +- SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} CACHE STRING "Set RPATH for a private libusb") +-ENDIF() IF(DEFINED CMAKE_INSTALL_RPATH) + MESSAGE(STATUS "RPATH set to ${CMAKE_INSTALL_RPATH}") + ENDIF() diff --git a/recipes/libfreenect2/all/test_package/CMakeLists.txt b/recipes/libfreenect2/all/test_package/CMakeLists.txt index 5742a7e29c0d54..9acae9b9766205 100644 --- a/recipes/libfreenect2/all/test_package/CMakeLists.txt +++ b/recipes/libfreenect2/all/test_package/CMakeLists.txt @@ -1,12 +1,14 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(freenect2 REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE ${freenect2_LIBRARIES}) -target_include_directories(${PROJECT_NAME} PRIVATE ${freenect2_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} PRIVATE freenect2::freenect2) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + +if (WITH_CUDA) + cmake_minimum_required(VERSION 3.17) + find_package(CUDAToolkit REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE CUDA::cudart) +endif() diff --git a/recipes/libfreenect2/all/test_package/conanfile.py b/recipes/libfreenect2/all/test_package/conanfile.py index 3da371b660e0a3..66cde37e06dd27 100644 --- a/recipes/libfreenect2/all/test_package/conanfile.py +++ b/recipes/libfreenect2/all/test_package/conanfile.py @@ -1,10 +1,24 @@ -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, CMakeToolchain import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_CUDA"] = self.dependencies[self.tested_reference_str].options.with_cuda + tc.generate() def build(self): cmake = CMake(self) @@ -12,6 +26,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/libfreenect2/all/test_v1_package/CMakeLists.txt b/recipes/libfreenect2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libfreenect2/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/libfreenect2/all/test_v1_package/conanfile.py b/recipes/libfreenect2/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/libfreenect2/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/libftdi/0.x/CMakeLists.txt b/recipes/libftdi/0.x/CMakeLists.txt index 5b33131a68c48d..922dfc4a145e34 100644 --- a/recipes/libftdi/0.x/CMakeLists.txt +++ b/recipes/libftdi/0.x/CMakeLists.txt @@ -1,10 +1,9 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.12) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(libusb-compat CONFIG REQUIRED) +find_package(Boost CONFIG REQUIRED) -link_libraries(CONAN_PKG::libusb-compat) -include_directories(${CONAN_INCLUDE_DIRS_BOOST}) +link_libraries(libusb-compat::libusb-compat Boost::boost) -add_subdirectory(source_subfolder) +add_subdirectory(src) diff --git a/recipes/libftdi/0.x/conandata.yml b/recipes/libftdi/0.x/conandata.yml index 87f1338e3ed67f..362a6680a82150 100644 --- a/recipes/libftdi/0.x/conandata.yml +++ b/recipes/libftdi/0.x/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "0.20": - patch_file: "patches/0001-cmake-fixes.patch" - base_path: "source_subfolder" diff --git a/recipes/libftdi/0.x/conanfile.py b/recipes/libftdi/0.x/conanfile.py index bdc298e8839777..3ae320b47fbec0 100644 --- a/recipes/libftdi/0.x/conanfile.py +++ b/recipes/libftdi/0.x/conanfile.py @@ -1,16 +1,22 @@ -from conans import CMake, ConanFile, tools -from contextlib import contextmanager import os +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +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 + +required_conan_version = ">=1.53.0" + class LibFtdi(ConanFile): name = "libftdi" description = "libFTDI - FTDI USB driver with bitbang mode" - topics = ("conan", "libconfuse", "configuration", "parser") + license = "LGPL-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.intra2net.com/en/developer/libftdi" - license = "LGPL-2.0" - exports_sources = "CMakeLists.txt", "patches/**" + topics = ("libconfuse", "configuration", "parser") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,17 +28,10 @@ class LibFtdi(ConanFile): "fPIC": True, "enable_cpp_wrapper": 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): + 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": @@ -40,51 +39,55 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.enable_cpp_wrapper: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("libftdi-{}".format(self.version), self._source_subfolder) + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libusb-compat/0.1.7") + self.requires("libusb-compat/0.1.7", transitive_headers=True, transitive_libs=True) if self.options.enable_cpp_wrapper: - self.requires("boost/1.74.0") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["FTDIPP"] = self.options.enable_cpp_wrapper - self._cmake.definitions["PYTHON_BINDINGS"] = False - self._cmake.definitions["EXAMPLES"] = False - self._cmake.definitions["DOCUMENTATION"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + self.requires("boost/1.83.0", transitive_headers=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FTDIPP"] = self.options.enable_cpp_wrapper + tc.variables["PYTHON_BINDINGS"] = False + tc.variables["EXAMPLES"] = False + tc.variables["DOCUMENTATION"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "CMAKE_BINARY_DIR", "PROJECT_BINARY_DIR") - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") - tools.replace_in_file(os.path.join(self._source_subfolder, "ftdipp", "CMakeLists.txt"), "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "CMAKE_BINARY_DIR", "PROJECT_BINARY_DIR") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") + replace_in_file(self, os.path.join(self.source_folder, "ftdipp", "CMakeLists.txt"), + "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") 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): - self.copy(pattern="COPYING*", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "COPYING*", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - - 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.libs = ["ftdi"] + self.cpp_info.requires = ["libusb-compat::libusb-compat"] if self.options.enable_cpp_wrapper: self.cpp_info.libs.append("ftdipp") - self.cpp_info.libs.append("ftdi") + self.cpp_info.requires.append("boost::headers") diff --git a/recipes/libftdi/0.x/test_package/CMakeLists.txt b/recipes/libftdi/0.x/test_package/CMakeLists.txt index 7b9b613cbb24a3..6f4e1992a2351c 100644 --- a/recipes/libftdi/0.x/test_package/CMakeLists.txt +++ b/recipes/libftdi/0.x/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(libftdi REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libftdi::libftdi) diff --git a/recipes/libftdi/0.x/test_package/conanfile.py b/recipes/libftdi/0.x/test_package/conanfile.py index 8c64bd2e6fd248..35930df6e35fdf 100644 --- a/recipes/libftdi/0.x/test_package/conanfile.py +++ b/recipes/libftdi/0.x/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" + 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,7 +21,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") config_path = os.path.join(self.source_folder, "hello.conf") - self.run("{} {}".format(bin_path, config_path), run_environment=True) + self.run(f"{bin_path} {config_path}", env="conanrun") diff --git a/recipes/libftdi/0.x/test_v1_package/CMakeLists.txt b/recipes/libftdi/0.x/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libftdi/0.x/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/libftdi/0.x/test_v1_package/conanfile.py b/recipes/libftdi/0.x/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a86b3a5dad12e9 --- /dev/null +++ b/recipes/libftdi/0.x/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.settings): + bin_path = os.path.join("bin", "test_package") + config_path = os.path.join(self.source_folder, "hello.conf") + self.run("{} {}".format(bin_path, config_path), run_environment=True) diff --git a/recipes/libftdi/1.x/conanfile.py b/recipes/libftdi/1.x/conanfile.py index 16c0bb3e46d342..93a939465107f5 100644 --- a/recipes/libftdi/1.x/conanfile.py +++ b/recipes/libftdi/1.x/conanfile.py @@ -1,20 +1,23 @@ import os + from conan import ConanFile -from conan.tools.files import get, rmdir, export_conandata_patches -from conan.tools.files import apply_conandata_patches, copy +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.files import get, rmdir, export_conandata_patches, apply_conandata_patches, copy from conan.tools.microsoft import is_msvc -from conan.errors import ConanInvalidConfiguration required_conan_version = ">=1.53.0" + class LibFtdiConan(ConanFile): name = "libftdi" description = "A library to talk to FTDI chips" - license = "LGPL-2.0-only", "GPLv2-or-later" - topics = "ftdi" - homepage = "https://www.intra2net.com/en/developer/libftdi/" + license = ("LGPL-2.0-only", "GPLv2-or-later") url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.intra2net.com/en/developer/libftdi/" + topics = "ftdi" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared" : [True, False], @@ -34,23 +37,36 @@ class LibFtdiConan(ConanFile): def export_sources(self): export_conandata_patches(self) - 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 if is_msvc(self): self.options.use_streaming = False - def layout(self): - cmake_layout(self, src_folder="src") - def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - self.license = ("LGPL-2.1-only", "GPL-2.0-only") if self.options.build_eeprom_tool or self.options.enable_cpp_wrapper else ("LGPL-2.1-only") + if self.options.build_eeprom_tool or self.options.enable_cpp_wrapper: + self.license = ("LGPL-2.1-only", "GPL-2.0-only") + else: + self.license = "LGPL-2.1-only" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # libusb.h is used in public ftdi.h + self.requires("libusb/1.0.26", transitive_headers=True, transitive_libs=True) + if self.options.enable_cpp_wrapper: + # boost/shared_ptr.hpp is used in public ftdi.hpp + self.requires("boost/1.83.0", transitive_headers=True) + + def validate(self): + if is_msvc(self) and self.options.use_streaming: + raise ConanInvalidConfiguration("VS doesn't not compile with enabled option use_streaming") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -64,15 +80,6 @@ def generate(self): tc = CMakeDeps(self) tc.generate() - def requirements(self): - self.requires("libusb/1.0.26") - if self.options.enable_cpp_wrapper: - self.requires("boost/1.80.0") - - def validate(self): - if is_msvc(self) and self.options.use_streaming: - raise ConanInvalidConfiguration("VS doesn't not compile with enabled option use_streaming") - def build(self): apply_conandata_patches(self) cmake = CMake(self) @@ -91,21 +98,20 @@ def package(self): rmdir(self, os.path.join(lib_folder, "pkgconfig")) def package_info(self): - # Remove "self.cpp_info.filenames.." statements in Conan V2 - self.cpp_info.filenames['cmake_find_package'] = "LibFTDI1" - self.cpp_info.filenames['cmake_find_package_multi'] = "LibFTDI1" - self.cpp_info.set_property("cmake_file_name", "LibFTDI1") + self.cpp_info.components["ftdi"].set_property("pkg_config_name", "libftdi1") self.cpp_info.components["ftdi"].libs = ["ftdi1"] self.cpp_info.components["ftdi"].requires = ["libusb::libusb"] self.cpp_info.components["ftdi"].includedirs.append(os.path.join("include", "libftdi1")) - self.cpp_info.components["ftdi"].names["pkg_config"] = "libftdi1" if self.options.enable_cpp_wrapper: self.cpp_info.components["ftdipp"].set_property("pkg_config_name", "libftdipp1") self.cpp_info.components["ftdipp"].libs = ["ftdipp1"] self.cpp_info.components["ftdipp"].requires = ["ftdi", "boost::headers"] - self.cpp_info.components["ftdipp"].names["pkg_config"] = "libftdipp1" if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["ftdipp"].system_libs.append("m") + + # TODO: Remove "self.cpp_info.filenames.." statements in Conan V2 + self.cpp_info.filenames["cmake_find_package"] = "LibFTDI1" + self.cpp_info.filenames["cmake_find_package_multi"] = "LibFTDI1" diff --git a/recipes/libftdi/1.x/test_package/CMakeLists.txt b/recipes/libftdi/1.x/test_package/CMakeLists.txt index efdfd6bd92c126..40064cdad12f40 100644 --- a/recipes/libftdi/1.x/test_package/CMakeLists.txt +++ b/recipes/libftdi/1.x/test_package/CMakeLists.txt @@ -1,5 +1,4 @@ -cmake_minimum_required(VERSION 3.1) - +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) diff --git a/recipes/libftdi/1.x/test_v1_package/CMakeLists.txt b/recipes/libftdi/1.x/test_v1_package/CMakeLists.txt index eb26d0c1b0943b..65f19e16d7a621 100644 --- a/recipes/libftdi/1.x/test_v1_package/CMakeLists.txt +++ b/recipes/libftdi/1.x/test_v1_package/CMakeLists.txt @@ -1,5 +1,4 @@ -cmake_minimum_required(VERSION 3.1) - +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/libfuse/2.x.x/conanfile.py b/recipes/libfuse/2.x.x/conanfile.py index 4cc77383a646b9..d233b32a706317 100644 --- a/recipes/libfuse/2.x.x/conanfile.py +++ b/recipes/libfuse/2.x.x/conanfile.py @@ -14,7 +14,8 @@ class LibfuseConan(ConanFile): homepage = "https://github.com/libfuse/libfuse" license = "LGPL-2.1" description = "The reference implementation of the Linux FUSE interface" - topics = ("fuse", "libfuse", "filesystem", "linux") + topics = ("fuse", "filesystem", "linux") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -26,9 +27,13 @@ class LibfuseConan(ConanFile): "fPIC": True, } + 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") self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") @@ -72,6 +77,5 @@ def package_info(self): self.cpp_info.system_libs = ["pthread"] # libfuse requires this define to compile successfully self.cpp_info.defines = ["_FILE_OFFSET_BITS=64"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("dl") - diff --git a/recipes/libfuse/2.x.x/test_package/CMakeLists.txt b/recipes/libfuse/2.x.x/test_package/CMakeLists.txt index 701d331873021b..b328202f167f95 100644 --- a/recipes/libfuse/2.x.x/test_package/CMakeLists.txt +++ b/recipes/libfuse/2.x.x/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(libfuse REQUIRED CONFIG) diff --git a/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt b/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt index 0d20897301b68b..b21cc49efde95c 100644 --- a/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt +++ b/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/libfuse/all/conanfile.py b/recipes/libfuse/all/conanfile.py index 0f2c7852403e0a..2b5f67a4fee988 100644 --- a/recipes/libfuse/all/conanfile.py +++ b/recipes/libfuse/all/conanfile.py @@ -15,7 +15,7 @@ class LibfuseConan(ConanFile): homepage = "https://github.com/libfuse/libfuse" license = "LGPL-2.1" description = "The reference implementation of the Linux FUSE interface" - topics = ("fuse", "libfuse", "filesystem", "linux") + topics = ("fuse", "filesystem", "linux") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -27,9 +27,13 @@ class LibfuseConan(ConanFile): "fPIC": True, } + 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") self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") @@ -41,7 +45,7 @@ def validate(self): raise ConanInvalidConfiguration("libfuse supports only Linux and FreeBSD") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.2.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -72,6 +76,5 @@ def package_info(self): self.cpp_info.libs = ["fuse3"] self.cpp_info.includedirs = [os.path.join("include", "fuse3")] self.cpp_info.system_libs = ["pthread"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "rt"]) - diff --git a/recipes/libfuse/all/test_package/CMakeLists.txt b/recipes/libfuse/all/test_package/CMakeLists.txt index c8bc174f2164d2..2fd81a9f515e75 100644 --- a/recipes/libfuse/all/test_package/CMakeLists.txt +++ b/recipes/libfuse/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(libfuse REQUIRED CONFIG) diff --git a/recipes/libfuse/all/test_v1_package/CMakeLists.txt b/recipes/libfuse/all/test_v1_package/CMakeLists.txt index 0d20897301b68b..b21cc49efde95c 100644 --- a/recipes/libfuse/all/test_v1_package/CMakeLists.txt +++ b/recipes/libfuse/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) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/libgcrypt/all/conanfile.py b/recipes/libgcrypt/all/conanfile.py index 5ec59b6726d5f7..825994cdd94805 100644 --- a/recipes/libgcrypt/all/conanfile.py +++ b/recipes/libgcrypt/all/conanfile.py @@ -38,7 +38,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libcap/2.66") + self.requires("libcap/2.69") self.requires("libgpg-error/1.36", transitive_headers=True) def validate(self): diff --git a/recipes/libgd/all/conandata.yml b/recipes/libgd/all/conandata.yml index e4acad43d15b22..f0b126888eb32a 100644 --- a/recipes/libgd/all/conandata.yml +++ b/recipes/libgd/all/conandata.yml @@ -22,6 +22,9 @@ patches: - patch_file: "patches/2.3.x-png-msvc.patch" patch_description: "support png on msvc" patch_type: "portability" + - patch_file: "patches/2.3.3-use-cci.patch" + patch_description: "use cci's package" + patch_type: "conan" "2.3.2": - patch_file: "patches/remove-unistd-h.patch" patch_description: "remove unistd.h to fix build error" @@ -32,6 +35,9 @@ patches: - patch_file: "patches/2.3.x-png-msvc.patch" patch_description: "support png on msvc" patch_type: "portability" + - patch_file: "patches/2.3.2-use-cci.patch" + patch_description: "use cci's package" + patch_type: "conan" "2.3.1": - patch_file: "patches/remove-unistd-h.patch" patch_description: "remove unistd.h to fix build error" @@ -42,6 +48,9 @@ patches: - patch_file: "patches/2.3.x-png-msvc.patch" patch_description: "support png on msvc" patch_type: "portability" + - patch_file: "patches/2.3.0-use-cci.patch" + patch_description: "use cci's package" + patch_type: "conan" "2.3.0": - patch_file: "patches/remove-unistd-h.patch" patch_description: "remove unistd.h to fix build error" @@ -52,6 +61,9 @@ patches: - patch_file: "patches/2.3.x-png-msvc.patch" patch_description: "support png on msvc" patch_type: "conan" + - patch_file: "patches/2.3.0-use-cci.patch" + patch_description: "use cci's package" + patch_type: "conan" "2.2.5": - patch_file: "patches/2.2.5-msvc-static-lib.patch" patch_description: "support static build on msvc" @@ -59,3 +71,6 @@ patches: - patch_file: "patches/2.2.5-qualify-nondll.patch" patch_description: "use BGD_NONDLL instead NONDLL" patch_type: "conan" + - patch_file: "patches/2.2.5-use-cci.patch" + patch_description: "use cci's package" + patch_type: "conan" diff --git a/recipes/libgd/all/conanfile.py b/recipes/libgd/all/conanfile.py index 169f9e3ba1f8c7..5de7e7911d0ed1 100644 --- a/recipes/libgd/all/conanfile.py +++ b/recipes/libgd/all/conanfile.py @@ -51,17 +51,17 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if is_msvc(self): self.requires("getopt-for-visual-studio/20200201") if self.options.with_jpeg: self.requires("libjpeg/9e") if self.options.with_tiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.6.0") if self.options.with_freetype: - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.2") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libgd/all/patches/2.2.5-use-cci.patch b/recipes/libgd/all/patches/2.2.5-use-cci.patch new file mode 100644 index 00000000000000..7a3609a12620d2 --- /dev/null +++ b/recipes/libgd/all/patches/2.2.5-use-cci.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5b764eb..c411860 100755 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -110,7 +110,7 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S + + SET(LIBGD_DEP_LIBS + ${ZLIB_LIBRARIES} +- ${FREETYPE_LIBRARIES} ++ ${freetype_LIBRARIES} + ${PNG_LIBRARIES} + ${ICONV_LIBRARIES} + ${LIQ_LIBRARIES} diff --git a/recipes/libgd/all/patches/2.3.0-use-cci.patch b/recipes/libgd/all/patches/2.3.0-use-cci.patch new file mode 100644 index 00000000000000..cdb3bfc14381a3 --- /dev/null +++ b/recipes/libgd/all/patches/2.3.0-use-cci.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e1f8eda..aa06600 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -125,7 +125,7 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S + + SET(LIBGD_DEP_LIBS + ${ZLIB_LIBRARIES} +- ${FREETYPE_LIBRARIES} ++ ${freetype_LIBRARIES} + ${PNG_LIBRARIES} + ${ICONV_LIBRARIES} + ${LIQ_LIBRARIES} diff --git a/recipes/libgd/all/patches/2.3.2-use-cci.patch b/recipes/libgd/all/patches/2.3.2-use-cci.patch new file mode 100644 index 00000000000000..489c66beb62369 --- /dev/null +++ b/recipes/libgd/all/patches/2.3.2-use-cci.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 1d1be42..447458f 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -122,7 +122,7 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S + + SET(LIBGD_DEP_LIBS + ${ZLIB_LIBRARIES} +- ${FREETYPE_LIBRARIES} ++ ${freetype_LIBRARIES} + ${PNG_LIBRARIES} + ${ICONV_LIBRARIES} + ${LIQ_LIBRARIES} diff --git a/recipes/libgd/all/patches/2.3.3-use-cci.patch b/recipes/libgd/all/patches/2.3.3-use-cci.patch new file mode 100644 index 00000000000000..4a067840ce98f5 --- /dev/null +++ b/recipes/libgd/all/patches/2.3.3-use-cci.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3b271a8..2ee5ef9 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -102,7 +102,7 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S + + SET(LIBGD_DEP_LIBS + ${ZLIB_LIBRARIES} +- ${FREETYPE_LIBRARIES} ++ ${freetype_LIBRARIES} + ${PNG_LIBRARIES} + ${ICONV_LIBRARIES} + ${LIQ_LIBRARIES} diff --git a/recipes/libgeotiff/all/conanfile.py b/recipes/libgeotiff/all/conanfile.py index 4125b818ee21da..8420d20d07e091 100644 --- a/recipes/libgeotiff/all/conanfile.py +++ b/recipes/libgeotiff/all/conanfile.py @@ -15,7 +15,7 @@ class LibgeotiffConan(ConanFile): topics = ("geotiff", "tiff") homepage = "https://github.com/OSGeo/libgeotiff" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -44,8 +44,8 @@ def layout(self): def requirements(self): # libgeotiff/include/xtiffio.h includes libtiff/include/tiffio.h - self.requires("libtiff/4.5.1", transitive_headers=True, transitive_libs=True) - self.requires("proj/9.1.1") + self.requires("libtiff/4.6.0", transitive_headers=True, transitive_libs=True) + self.requires("proj/9.3.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libgettext/all/conanfile.py b/recipes/libgettext/all/conanfile.py index 30249cef99da1b..a3d65fe027cb3d 100644 --- a/recipes/libgettext/all/conanfile.py +++ b/recipes/libgettext/all/conanfile.py @@ -26,7 +26,11 @@ class GetTextConan(ConanFile): topics = ("gettext", "intl", "libintl", "i18n") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.gnu.org/software/gettext" - license = "GPL-3.0-or-later" + # Some parts of the project are GPL-3.0-or-later and some are LGPL-2.1-or-later. + # At this time, only libintl is packaged, which is licensed under the LGPL-2.1-or-later. + # If you modify this package to include other portions of the library, please configure the license accordingly. + # The licensing of the project is documented here: https://www.gnu.org/software/gettext/manual/gettext.html#Licenses + license = "LGPL-2.1-or-later" package_type = "library" settings = "os", "arch", "compiler", "build_type" diff --git a/recipes/libglvnd/all/conandata.yml b/recipes/libglvnd/all/conandata.yml index 930441157c427b..8d9b790ae637c8 100644 --- a/recipes/libglvnd/all/conandata.yml +++ b/recipes/libglvnd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.0": + url: "https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v1.7.0/libglvnd-v1.7.0.tar.gz" + sha256: "2b6e15b06aafb4c0b6e2348124808cbd9b291c647299eaaba2e3202f51ff2f3d" "1.5.0": url: "https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v1.5.0/libglvnd-v1.5.0.tar.gz" sha256: "8c246d573bdaabbab32874befa79c8b92b12c05d3eb4bbefbe62afa630842793" diff --git a/recipes/libglvnd/all/conanfile.py b/recipes/libglvnd/all/conanfile.py index 7d1919c184d04a..91471af4e7c756 100644 --- a/recipes/libglvnd/all/conanfile.py +++ b/recipes/libglvnd/all/conanfile.py @@ -1,8 +1,10 @@ from conan import ConanFile -from conan.tools.meson import Meson, MesonToolchain -from conan.tools.files import get, rmdir, save from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, rmdir, save +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain import os import textwrap @@ -11,11 +13,12 @@ class LibGlvndConan(ConanFile): name = "libglvnd" description = "The GL Vendor-Neutral Dispatch library" - license = "LicenseRef-LICENSE" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.freedesktop.org/glvnd/libglvnd" - topics = ("gl", "vendor-neutral", "dispatch") + topics = ("dispatch", "egl", "gl", "gles", "glx", "glvnd", "opengl", "vendor-neutral") settings = "os", "arch", "compiler", "build_type" + package_type = "shared-library" options = { "asm": [True, False], "x11": [True, False], @@ -41,21 +44,9 @@ class LibGlvndConan(ConanFile): "entrypoint_patching": True, } - generators = "PkgConfigDeps" - - # don't use self.settings_build - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - # don't use self.user_info_build - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) - def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def requirements(self): if self.options.x11: @@ -65,20 +56,25 @@ def requirements(self): def validate(self): if self.settings.os not in ['Linux', 'FreeBSD']: - raise ConanInvalidConfiguration("libglvnd is only compatible with Linux and FreeBSD") + raise ConanInvalidConfiguration(f"{self.name} is only compatible with Linux and FreeBSD") def build_requirements(self): - self.build_requires("meson/0.63.2") - self.build_requires("pkgconf/1.9.3") + self.tool_requires("meson/1.2.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") def layout(self): - basic_layout(self) + basic_layout(self, src_folder="src") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() tc = MesonToolchain(self) tc.project_options["asm"] = "enabled" if self.options.asm else "disabled" tc.project_options["x11"] = "enabled" if self.options.x11 else "disabled" @@ -141,7 +137,9 @@ def package_info(self): if self.options.egl: self.cpp_info.components['egl'].libs = ["EGL"] self.cpp_info.components['egl'].system_libs.extend(["pthread", "dl", "m"]) - self.cpp_info.components['egl'].requires.extend(["xorg::x11", "gldispatch"]) + self.cpp_info.components['egl'].requires.append("gldispatch") + if self.options.x11: + self.cpp_info.components['egl'].requires.append("xorg::x11") self.cpp_info.components['egl'].set_property("pkg_config_name", "egl") if self.options.glx: diff --git a/recipes/libglvnd/all/test_package/CMakeLists.txt b/recipes/libglvnd/all/test_package/CMakeLists.txt index 34af13462f44f8..60cf6714783e83 100644 --- a/recipes/libglvnd/all/test_package/CMakeLists.txt +++ b/recipes/libglvnd/all/test_package/CMakeLists.txt @@ -1,8 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package LANGUAGES C) + +find_package(libglvnd REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libglvnd::libglvnd) + diff --git a/recipes/libglvnd/all/test_package/conanfile.py b/recipes/libglvnd/all/test_package/conanfile.py index 8b7f471a280d57..ef5d7042163ecc 100644 --- a/recipes/libglvnd/all/test_package/conanfile.py +++ b/recipes/libglvnd/all/test_package/conanfile.py @@ -1,12 +1,19 @@ from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake +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 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 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/libglvnd/config.yml b/recipes/libglvnd/config.yml index bd6887e2cfe662..3283e92e6372fc 100644 --- a/recipes/libglvnd/config.yml +++ b/recipes/libglvnd/config.yml @@ -1,4 +1,6 @@ versions: + "1.7.0": + folder: "all" "1.5.0": folder: "all" "1.4.0": diff --git a/recipes/libgphoto2/all/conanfile.py b/recipes/libgphoto2/all/conanfile.py index e3382ba23526ba..af18cb02458ef6 100644 --- a/recipes/libgphoto2/all/conanfile.py +++ b/recipes/libgphoto2/all/conanfile.py @@ -55,11 +55,11 @@ def requirements(self): if self.options.with_libusb: self.requires("libusb/1.0.26") if self.options.with_libcurl: - self.requires("libcurl/8.0.0") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.with_libxml2: - self.requires("libxml2/2.10.3") + self.requires("libxml2/2.11.5") if self.options.with_libexif: - self.requires("libexif/0.6.23") + self.requires("libexif/0.6.24") if self.options.with_libjpeg: self.requires("libjpeg/9e") @@ -69,7 +69,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.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/libgpiod/all/conandata.yml b/recipes/libgpiod/all/conandata.yml index 851ae98da0f81e..e57f9b7713c5fa 100644 --- a/recipes/libgpiod/all/conandata.yml +++ b/recipes/libgpiod/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.1": + url: "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-2.1.tar.gz" + sha256: "fd6ed4b2c674fe6cc3b481880f6cde1eea79e296e95a139b85401eaaea6de3fc" + "2.0.1": + url: "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-2.0.1.tar.gz" + sha256: "b6eda55356160a8e73906e3d48e959ef81296787d764975b10f257e9660668e9" + "1.6.4": + url: "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-1.6.4.tar.gz" + sha256: "829d4ac268df07853609d67cfc7f476e9aa736cb2a68a630be99e8fad197be0a" "1.6.3": url: "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-1.6.3.tar.gz" sha256: "eb446070be1444fd7d32d32bbca53c2f3bbb0a21193db86198cf6050b7a28441" 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/libgpiod/all/test_package/test_package.c b/recipes/libgpiod/all/test_package/test_package.c index 686dc9682cd7dd..624c4536ecb0e4 100644 --- a/recipes/libgpiod/all/test_package/test_package.c +++ b/recipes/libgpiod/all/test_package/test_package.c @@ -2,6 +2,6 @@ int main(int argc, char *argv[]) { struct gpiod_chip *chip; - chip = gpiod_chip_open_by_name("gpiochip0"); + chip = gpiod_chip_open("/dev/gpiochip0"); return 0; } diff --git a/recipes/libgpiod/config.yml b/recipes/libgpiod/config.yml index bfd56b0a1b59f3..032322a67e7ab9 100644 --- a/recipes/libgpiod/config.yml +++ b/recipes/libgpiod/config.yml @@ -1,3 +1,9 @@ versions: + "2.1": + folder: all + "2.0.1": + folder: all + "1.6.4": + folder: all "1.6.3": folder: all diff --git a/recipes/libgta/all/CMakeLists.txt b/recipes/libgta/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d4..00000000000000 --- a/recipes/libgta/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/libgta/all/conanfile.py b/recipes/libgta/all/conanfile.py index a0064e504c27d2..a15e741e867e1a 100644 --- a/recipes/libgta/all/conanfile.py +++ b/recipes/libgta/all/conanfile.py @@ -1,69 +1,87 @@ 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 collect_libs, copy, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" + class LibgtaConan(ConanFile): name = "libgta" description = "Library that reads and writes GTA (Generic Tagged Arrays) files." license = "LGPL-2.1-or-later" - topics = ("conan", "libgta", "gta") - homepage = "https://marlam.de/gta" url = "https://github.com/conan-io/conan-center-index" - exports_sources = "CMakeLists.txt" - generators = "cmake" - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + homepage = "https://marlam.de/gta" + topics = ("gta",) - @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 config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + if self.options.shared: + 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]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GTA_BUILD_STATIC_LIB"] = not self.options.shared + tc.variables["GTA_BUILD_SHARED_LIB"] = self.options.shared + tc.variables["GTA_BUILD_DOCUMENTATION"] = False + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "${CMAKE_SOURCE_DIR}", + "${CMAKE_CURRENT_SOURCE_DIR}") def build(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "${CMAKE_SOURCE_DIR}", "${CMAKE_CURRENT_SOURCE_DIR}") - 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.definitions["GTA_BUILD_STATIC_LIB"] = not self.options.shared - self._cmake.definitions["GTA_BUILD_SHARED_LIB"] = self.options.shared - self._cmake.definitions["GTA_BUILD_DOCUMENTATION"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - 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")) def package_info(self): + # https://marlam.de/gta/documentation/ uses GTA as the package name + self.cpp_info.set_property("cmake_file_name", "GTA") + self.cpp_info.set_property("cmake_target_name", "GTA::GTA") + self.cpp_info.set_property("pkg_config_name", "gta") + self.cpp_info.libs = collect_libs(self) + if is_msvc(self) and not self.options.shared: + self.cpp_info.defines.append("GTA_STATIC") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "GTA" self.cpp_info.names["cmake_find_package_multi"] = "GTA" - self.cpp_info.names["pkg_config"] = "gta" - self.cpp_info.libs = tools.collect_libs(self) - if self.settings.compiler == "Visual Studio" and not self.options.shared: - self.cpp_info.defines.append("GTA_STATIC") diff --git a/recipes/libgta/all/test_package/CMakeLists.txt b/recipes/libgta/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..3bb9ae06e8bb8e 100644 --- a/recipes/libgta/all/test_package/CMakeLists.txt +++ b/recipes/libgta/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(GTA REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE GTA::GTA) diff --git a/recipes/libgta/all/test_package/conanfile.py b/recipes/libgta/all/test_package/conanfile.py index ea57a464900be9..ef5d7042163ecc 100644 --- a/recipes/libgta/all/test_package/conanfile.py +++ b/recipes/libgta/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/libgta/all/test_v1_package/CMakeLists.txt b/recipes/libgta/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libgta/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/libgta/all/test_v1_package/conanfile.py b/recipes/libgta/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..84ee68733e5167 --- /dev/null +++ b/recipes/libgta/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/libhal/all/conandata.yml b/recipes/libhal/all/conandata.yml index 0a5fcff604fbd1..5f30969947a89d 100644 --- a/recipes/libhal/all/conandata.yml +++ b/recipes/libhal/all/conandata.yml @@ -1,4 +1,7 @@ sources: - "0.0.0": - url: "https://github.com/libhal/libhal/archive/refs/tags/0.0.0.tar.gz" - sha256: "f49d6cee9adfe9d98212ba77aa955c88994693185d4870b86a6e12bad4eb9915" + "2.0.2": + url: "https://github.com/libhal/libhal/archive/refs/tags/2.0.2.tar.gz" + sha256: "bb69fffbff58ac9a91f71636422d81a4426fe70c3b47ca9b07c87fb074c989dc" + "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..b7115968781856 100644 --- a/recipes/libhal/all/conanfile.py +++ b/recipes/libhal/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.files import get, copy 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,26 @@ def _compilers_minimum_version(self): "Visual Studio": "17", "msvc": "193", "clang": "13", - "apple-clang": "13.1.6" + "apple-clang": "14" } + @property + def _bare_metal(self): + return self.settings.os == "baremetal" + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("tl-function-ref/1.0.0") + # NOTE from the author, kammce, and CCI maintainers: + # although boost-leaf is deprecated, we've kept it for 2.x versions, + # don't update it as upstream code won't work with boost itself + self.requires("boost-leaf/1.81.0") + + 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 +66,49 @@ 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") + f"{self.ref} 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): + pass 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", + src=self.source_folder, + dst=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") + ) + copy(self, + "*.hpp", + 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.frameworkdirs = [] self.cpp_info.libdirs = [] self.cpp_info.resdirs = [] + + version = Version(self.version) + if self._bare_metal and version < "3.0.0": + self.cpp_info.defines = [ + "BOOST_LEAF_EMBEDDED", + "BOOST_LEAF_NO_THREADS" + ] + + # Note from CCI maintainers: Ensure users are aware of the deprecated + # dependency + if version < "3.0": + self.output.warning(f"{self.name} < 3.0.0 uses boost-leaf which is a deprecated recipe. " + f"Once 3.0 is released, 2.x will also be deprecated.") 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..f702ac0fa86170 --- /dev/null +++ b/recipes/libhal/all/test_package/test_package.cpp @@ -0,0 +1,118 @@ +#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 +#include +#include + +class test_pwm : public hal::pwm +{ +private: + hal::result driver_frequency(hal::hertz p_frequency) override + { + std::printf("frequency = %f Hz\n", p_frequency); + + return frequency_t{}; + } + hal::result driver_duty_cycle(float p_position) override + { + 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; +}; + +class test_timer : public hal::timer +{ +private: + hal::result driver_is_running() override + { + return is_running_t{}; + } + hal::result driver_cancel() override + { + return cancel_t{}; + } + hal::result driver_schedule( + hal::callback, + hal::time_duration) override + { + return schedule_t{}; + } +}; + +int +main() +{ + using namespace hal::literals; + using namespace std::literals; + + int status = 0; + test_pwm pwm; + test_timer timer; + hal::attempt_all( + [&pwm, &timer]() -> 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)); + + HAL_CHECK(timer.schedule([]() {}, 1ms)); + + 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..855e335e2fd53b 100644 --- a/recipes/libhal/config.yml +++ b/recipes/libhal/config.yml @@ -1,3 +1,5 @@ versions: - "0.0.0": + "2.0.2": + folder: "all" + "2.0.1": folder: "all" diff --git a/recipes/libharu/all/conandata.yml b/recipes/libharu/all/conandata.yml index 29a286d695d61d..0e549c3a82e1fc 100644 --- a/recipes/libharu/all/conandata.yml +++ b/recipes/libharu/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.4": + url: "https://github.com/libharu/libharu/archive/v2.4.4.tar.gz" + sha256: "227ab0ae62979ad65c27a9bc36d85aa77794db3375a0a30af18acdf4d871aee6" "2.4.3": url: "https://github.com/libharu/libharu/archive/refs/tags/v2.4.3.tar.gz" sha256: "a2c3ae4261504a0fda25b09e7babe5df02b21803dd1308fdf105588f7589d255" diff --git a/recipes/libharu/all/conanfile.py b/recipes/libharu/all/conanfile.py index 73045d8d62bce7..c35f205e346da7 100644 --- a/recipes/libharu/all/conanfile.py +++ b/recipes/libharu/all/conanfile.py @@ -47,7 +47,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") self.requires("libpng/1.6.40") def source(self): diff --git a/recipes/libharu/config.yml b/recipes/libharu/config.yml index 39ca57fe00f3bb..be72156e0ef73a 100644 --- a/recipes/libharu/config.yml +++ b/recipes/libharu/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.4": + folder: "all" "2.4.3": folder: "all" "2.3.0": diff --git a/recipes/libheif/all/conandata.yml b/recipes/libheif/all/conandata.yml index c5668b6d3c93a0..e7a2fc9ba8c253 100644 --- a/recipes/libheif/all/conandata.yml +++ b/recipes/libheif/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.16.2": + url: "https://github.com/strukturag/libheif/releases/download/v1.16.2/libheif-1.16.2.tar.gz" + sha256: "7f97e4205c0bd9f9b8560536c8bd2e841d1c9a6d610401eb3eb87ed9cdfe78ea" "1.13.0": url: "https://github.com/strukturag/libheif/releases/download/v1.13.0/libheif-1.13.0.tar.gz" sha256: "c20ae01bace39e89298f6352f1ff4a54b415b33b9743902da798e8a1e51d7ca1" @@ -12,6 +15,9 @@ sources: url: "https://github.com/strukturag/libheif/releases/download/v1.9.1/libheif-1.9.1.tar.gz" sha256: "5f65ca2bd2510eed4e13bdca123131c64067e9dd809213d7aef4dc5e37948bca" patches: + "1.16.2": + - patch_file: "patches/0001-cmake_1.16.2.patch" + - patch_file: "patches/0002-plugins_cmake_1.16.2.patch" "1.13.0": - patch_file: "patches/0001-cmake_1.13.0.patch" "1.12.0": diff --git a/recipes/libheif/all/conanfile.py b/recipes/libheif/all/conanfile.py index 55d521d49ca387..912d662dba19ef 100644 --- a/recipes/libheif/all/conanfile.py +++ b/recipes/libheif/all/conanfile.py @@ -50,13 +50,13 @@ def layout(self): def requirements(self): if self.options.with_libde265: - self.requires("libde265/1.0.9") + self.requires("libde265/1.0.12") if self.options.with_x265: self.requires("libx265/3.4") if self.options.with_libaomav1: - self.requires("libaom-av1/3.5.0") + self.requires("libaom-av1/3.6.1") if self.options.with_dav1d: - self.requires("dav1d/1.0.0") + self.requires("dav1d/1.2.1") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -73,6 +73,7 @@ def generate(self): tc.variables["WITH_RAV1E"] = False tc.variables["WITH_DAV1D"] = self.options.with_dav1d tc.variables["WITH_EXAMPLES"] = False + tc.variables["WITH_GDK_PIXBUF"] = False tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/libheif/all/patches/0001-cmake_1.16.2.patch b/recipes/libheif/all/patches/0001-cmake_1.16.2.patch new file mode 100644 index 00000000000000..957b6fe2587f27 --- /dev/null +++ b/recipes/libheif/all/patches/0001-cmake_1.16.2.patch @@ -0,0 +1,60 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index de15948..589eab5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,7 +41,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) + + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # Create the compile command database for clang by default + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +@@ -54,7 +54,7 @@ if (has_potentially_evaluated_expression) + add_definitions(-Wno-error=potentially-evaluated-expression) + endif() + +-LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") ++# LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") + + option(ENABLE_PLUGIN_LOADING "Support loading of plugins" ON) + set(PLUGIN_DIRECTORY "${CMAKE_INSTALL_FULL_LIBDIR}/libheif" CACHE STRING "Plugin install directory") +@@ -74,9 +74,9 @@ + find_package(${packageName}) + endif () + +- if (${variableName}_FOUND AND WITH_${variableName}_PLUGIN AND PLUGIN_LOADING_SUPPORTED_AND_ENABLED) ++ if (${packageName}_FOUND AND WITH_${packageName}_PLUGIN AND PLUGIN_LOADING_SUPPORTED_AND_ENABLED) + set(msg "found (plugin)") +- elseif (${variableName}_FOUND) ++ elseif (${packageName}_FOUND) + set(msg "found (built-in)") + elseif (WITH_${variableName}) + set(msg "not found") +@@ -88,11 +88,11 @@ macro(plugin_option variableName packageName displayName displayType defaultPlug + unset(msg) + endmacro() + +-plugin_option(LIBDE265 LIBDE265 "libde265" "HEIC decoder" OFF) +-plugin_option(X265 X265 "x265" "HEIC encoder" OFF) +-plugin_option(DAV1D DAV1D "Dav1d" "AVIF decoder" OFF) +-plugin_option(AOM_ENCODER AOM "aom" "AVIF encoder" OFF) +-plugin_option(AOM_DECODER AOM "aom" "AVIF decoder" OFF) ++plugin_option(LIBDE265 libde265 "libde265" "HEIC decoder" OFF) ++plugin_option(X265 libx265 "x265" "HEIC encoder" OFF) ++plugin_option(DAV1D dav1d "Dav1d" "AVIF decoder" OFF) ++plugin_option(AOM_ENCODER libaom-av1 "aom" "AVIF encoder" OFF) ++plugin_option(AOM_DECODER libaom-av1 "aom" "AVIF decoder" OFF) + plugin_option(SvtEnc SvtEnc "Svt-av1" "AVIF encoder" ON) + plugin_option(RAV1E RAV1E "Rav1e" "AVIF encoder" ON) + +@@ -219,7 +219,7 @@ if (WITH_GDK_PIXBUF) + add_subdirectory (gdk-pixbuf) + endif() + +-add_subdirectory (gnome) ++#add_subdirectory (gnome) + + + # --- packaging (source code) diff --git a/recipes/libheif/all/patches/0002-plugins_cmake_1.16.2.patch b/recipes/libheif/all/patches/0002-plugins_cmake_1.16.2.patch new file mode 100644 index 00000000000000..ca167755d4ece0 --- /dev/null +++ b/recipes/libheif/all/patches/0002-plugins_cmake_1.16.2.patch @@ -0,0 +1,31 @@ +--- a/libheif/plugins/CMakeLists.txt ++++ b/libheif/plugins/CMakeLists.txt +@@ -44,23 +44,23 @@ + + set(X265_sources encoder_x265.h encoder_x265.cc) + set(X265_extra_plugin_sources) +-plugin_compilation(x265 X265 X265 X265) ++plugin_compilation(x265 x265 X265 X265) + + set(LIBDE265_sources decoder_libde265.cc decoder_libde265.h) + set(LIBDE265_extra_plugin_sources ../error.cc) +-plugin_compilation(libde265 LIBDE265 LIBDE265 LIBDE265) ++plugin_compilation(libde265 libde265 LIBDE265 LIBDE265) + + set(DAV1D_sources decoder_dav1d.cc decoder_dav1d.h) + set(DAV1D_extra_plugin_sources ../common_utils.cc ../common_utils.h) +-plugin_compilation(dav1d DAV1D DAV1D DAV1D) ++plugin_compilation(dav1d Dav1d DAV1D DAV1D) + + set(AOM_DECODER_sources decoder_aom.cc decoder_aom.h) + set(AOM_DECODER_extra_plugin_sources) +-plugin_compilation(aomdec AOM AOM_DECODER AOM_DECODER) ++plugin_compilation(aomdec libaom-av1 AOM_DECODER AOM_DECODER) + + set(AOM_ENCODER_sources encoder_aom.cc encoder_aom.h) + set(AOM_ENCODER_extra_plugin_sources ../error.cc ../common_utils.cc ../common_utils.h) +-plugin_compilation(aomenc AOM AOM_ENCODER AOM_ENCODER) ++plugin_compilation(aomenc libaom-av1 AOM_ENCODER AOM_ENCODER) + + set(SvtEnc_sources encoder_svt.cc encoder_svt.h) + set(SvtEnc_extra_plugin_sources) diff --git a/recipes/libheif/config.yml b/recipes/libheif/config.yml index 1b1bac20e2e23c..887a8fb56ade32 100644 --- a/recipes/libheif/config.yml +++ b/recipes/libheif/config.yml @@ -1,4 +1,6 @@ versions: + "1.16.2": + folder: all "1.13.0": folder: all "1.12.0": diff --git a/recipes/libinterpolate/all/conanfile.py b/recipes/libinterpolate/all/conanfile.py index b1c88daae5803a..c6aadd8b682fe0 100644 --- a/recipes/libinterpolate/all/conanfile.py +++ b/recipes/libinterpolate/all/conanfile.py @@ -17,6 +17,7 @@ class PackageConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/CD3/libInterpolate" topics = ("math", "spline", "interpolation", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,13 +29,12 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "Visual Studio": "15", - "msvc": "19.0", + "msvc": "191", "gcc": "7", "clang": "4", "apple-clang": "10", } - def layout(self): basic_layout(self, src_folder="src") @@ -42,6 +42,9 @@ def requirements(self): self.requires("boost/1.80.0", transitive_headers=True) self.requires("eigen/3.3.7", transitive_headers=True) + def package_id(self): + self.info.clear() + def validate(self): if Version(self.version) < "2.6.4" and self.settings.os != "Linux": raise ConanInvalidConfiguration(f"{self.ref} is not supported by {self.settings.os}; Try the version >= 2.6.4") @@ -80,9 +83,6 @@ def package(self): src=os.path.join(self.source_folder, "src"), ) - def package_id(self): - self.info.clear() - def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/libipt/all/CMakeLists.txt b/recipes/libipt/all/CMakeLists.txt deleted file mode 100644 index f62f6ae283c5ff..00000000000000 --- a/recipes/libipt/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libipt/all/conandata.yml b/recipes/libipt/all/conandata.yml index 91a36f41590f64..702bec04ce824d 100644 --- a/recipes/libipt/all/conandata.yml +++ b/recipes/libipt/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.6": + url: "https://github.com/intel/libipt/archive/v2.0.6.tar.gz" + sha256: "631f4ebc81e12c0493288af3cc307b0de5b65f018d3e3839c87014b0d26acd75" "2.0.5": url: https://github.com/intel/libipt/archive/refs/tags/v2.0.5.tar.gz sha256: 95acf499fdf0a0f5ebd07587bb443c702b1fd79f7d869749824234388b9bff80 diff --git a/recipes/libipt/all/conanfile.py b/recipes/libipt/all/conanfile.py index 73c8a14fe3622e..e7687b6d7c00d7 100644 --- a/recipes/libipt/all/conanfile.py +++ b/recipes/libipt/all/conanfile.py @@ -1,30 +1,34 @@ -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, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.33.0" class LibIptConan(ConanFile): name = "libipt" + description = "Intel(R) Processor Trace Decoder Library" license = "BSD-3-Clause" - homepage = "https://github.com/intel/libipt" url = "https://github.com/conan-io/conan-center-index" - description = "Intel(R) Processor Trace Decoder Library" + homepage = "https://github.com/intel/libipt" topics = ("profiling", "tracing") - settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], - "fPIC": [True, False], + "shared": [True, False], + "fPIC": [True, False], } default_options = { - "shared": False, - "fPIC": True, + "shared": False, + "fPIC": True, } - generators = "cmake" - _cmake = None - - @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": @@ -32,43 +36,35 @@ 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): - pass + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) - 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 _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - self._patch_sources() - 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() def package_info(self): - self.cpp_info.libs = ["libipt"] if self.settings.os == "Windows" else ["ipt"] - self.cpp_info.set_property("cmake_file_name", "libipt") - self.cpp_info.set_property("cmake_target_name", "libipt::libipt") - + if self.settings.os == "Windows": + self.cpp_info.libs = ["libipt"] + else: + self.cpp_info.libs = ["ipt"] diff --git a/recipes/libipt/all/test_package/CMakeLists.txt b/recipes/libipt/all/test_package/CMakeLists.txt index 614fc23d88dda8..9f56367278f327 100644 --- a/recipes/libipt/all/test_package/CMakeLists.txt +++ b/recipes/libipt/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(libipt REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/libipt/all/test_package/conanfile.py b/recipes/libipt/all/test_package/conanfile.py index a8c92dea633357..ef5d7042163ecc 100644 --- a/recipes/libipt/all/test_package/conanfile.py +++ b/recipes/libipt/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/libipt/all/test_package/test_package.cpp b/recipes/libipt/all/test_package/test_package.cpp index 6b9e18b8eb1337..26def6a295d25c 100644 --- a/recipes/libipt/all/test_package/test_package.cpp +++ b/recipes/libipt/all/test_package/test_package.cpp @@ -1,9 +1,8 @@ #include -int main(int argc, char **argv) +int main() { pt_config cfg; pt_config_init(&cfg); - return 0; } diff --git a/recipes/libipt/all/test_v1_package/CMakeLists.txt b/recipes/libipt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libipt/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/libipt/all/test_v1_package/conanfile.py b/recipes/libipt/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a8c92dea633357 --- /dev/null +++ b/recipes/libipt/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +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.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/libipt/config.yml b/recipes/libipt/config.yml index 16ab573dd6bd38..c14d5aed738ae0 100644 --- a/recipes/libipt/config.yml +++ b/recipes/libipt/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.6": + folder: all "2.0.5": folder: all diff --git a/recipes/libjpeg-turbo/all/conandata.yml b/recipes/libjpeg-turbo/all/conandata.yml index 1821235633f652..6b84ea73c442fe 100644 --- a/recipes/libjpeg-turbo/all/conandata.yml +++ b/recipes/libjpeg-turbo/all/conandata.yml @@ -1,25 +1,13 @@ 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" "2.1.5": url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.5/libjpeg-turbo-2.1.5.tar.gz" sha256: "bc12bc9dce55300c6bf4342bc233bcc26bd38bf289eedf147360d731c668ddaf" - "2.1.4": - url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.4/libjpeg-turbo-2.1.4.tar.gz" - sha256: "d3ed26a1131a13686dfca4935e520eb7c90ae76fbc45d98bb50a8dc86230342b" - "2.1.3": - url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.3/libjpeg-turbo-2.1.3.tar.gz" - sha256: "467b310903832b033fe56cd37720d1b73a6a3bd0171dbf6ff0b620385f4f76d0" - "2.1.2": - url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.2/libjpeg-turbo-2.1.2.tar.gz" - sha256: "09b96cb8cbff9ea556a9c2d173485fd19488844d55276ed4f42240e1e2073ce5" - "2.1.1": - url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.1/libjpeg-turbo-2.1.1.tar.gz" - sha256: "b76aaedefb71ba882cbad4e9275b30c2ae493e3195be0a099425b5c6b99bd510" - "2.1.0": - url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.0/libjpeg-turbo-2.1.0.tar.gz" - sha256: "bef89803e506f27715c5627b1e3219c95b80fc31465d4452de2a909d382e4444" "2.0.6": url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.0.6/libjpeg-turbo-2.0.6.tar.gz" sha256: "d74b92ac33b0e3657123ddcf6728788c90dc84dcb6a52013d758af3c4af481bb" - "2.0.5": - url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.0.5/libjpeg-turbo-2.0.5.tar.gz" - sha256: "16f8f6f2715b3a38ab562a84357c793dd56ae9899ce130563c72cd93d8357b5d" diff --git a/recipes/libjpeg-turbo/all/conanfile.py b/recipes/libjpeg-turbo/all/conanfile.py index afc30df36cff23..ebe4c40f125451 100644 --- a/recipes/libjpeg-turbo/all/conanfile.py +++ b/recipes/libjpeg-turbo/all/conanfile.py @@ -13,7 +13,7 @@ class LibjpegTurboConan(ConanFile): name = "libjpeg-turbo" description = "SIMD-accelerated libjpeg-compatible JPEG codec library" - license = "BSD-3-Clause, Zlib" + license = ("IJG", "BSD-3-Clause", "Zlib") url = "https://github.com/conan-io/conan-center-index" homepage = "https://libjpeg-turbo.org" topics = ("jpeg", "libjpeg", "image", "multimedia", "format", "graphics") @@ -49,6 +49,9 @@ class LibjpegTurboConan(ConanFile): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) >= "3.0.0": + del self.options.enable12bit + del self.options.mem_src_dst def configure(self): if self.options.shared: @@ -56,22 +59,22 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") - if self.options.enable12bit: + if self.options.get_safe("enable12bit"): del self.options.java del self.options.turbojpeg - if self.options.enable12bit or self.settings.os == "Emscripten": + if self.options.get_safe("enable12bit") or self.settings.os == "Emscripten": del self.options.SIMD - if self.options.enable12bit or self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility: + if self.options.get_safe("enable12bit") or self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility: del self.options.arithmetic_encoder del self.options.arithmetic_decoder if self.options.libjpeg8_compatibility: - del self.options.mem_src_dst + self.options.rm_safe("mem_src_dst") def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.options.enable12bit and (self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility): + if self.options.get_safe("enable12bit") and (self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility): raise ConanInvalidConfiguration("12-bit samples is not allowed with libjpeg v7/v8 API/ABI") if self.options.get_safe("java") and not self.options.shared: raise ConanInvalidConfiguration("java wrapper requires shared libjpeg-turbo") @@ -107,10 +110,11 @@ def generate(self): tc.variables["WITH_ARITH_DEC"] = self._is_arithmetic_decoding_enabled tc.variables["WITH_JPEG7"] = self.options.libjpeg7_compatibility tc.variables["WITH_JPEG8"] = self.options.libjpeg8_compatibility - tc.variables["WITH_MEM_SRCDST"] = self.options.get_safe("mem_src_dst", False) tc.variables["WITH_TURBOJPEG"] = self.options.get_safe("turbojpeg", False) tc.variables["WITH_JAVA"] = self.options.get_safe("java", False) - tc.variables["WITH_12BIT"] = self.options.enable12bit + if Version(self.version) < "3.0.0": + tc.variables["WITH_MEM_SRCDST"] = self.options.get_safe("mem_src_dst", False) + tc.variables["WITH_12BIT"] = self.options.enable12bit if is_msvc(self): tc.variables["WITH_CRT_DLL"] = True # avoid replacing /MD by /MT in compiler flags if Version(self.version) <= "2.1.0": @@ -135,6 +139,7 @@ def build(self): def package(self): copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "README.ijg", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() # remove unneeded directories diff --git a/recipes/libjpeg-turbo/config.yml b/recipes/libjpeg-turbo/config.yml index cdfe1237074c71..382a6fb1070c9e 100644 --- a/recipes/libjpeg-turbo/config.yml +++ b/recipes/libjpeg-turbo/config.yml @@ -1,17 +1,9 @@ versions: - "2.1.5": - folder: all - "2.1.4": - folder: all - "2.1.3": + "3.0.1": folder: all - "2.1.2": + "3.0.0": folder: all - "2.1.1": - folder: all - "2.1.0": + "2.1.5": folder: all "2.0.6": folder: all - "2.0.5": - folder: all diff --git a/recipes/libkml/all/conanfile.py b/recipes/libkml/all/conanfile.py index 1b2a9bb8fba8b7..1a9d0a90947d11 100644 --- a/recipes/libkml/all/conanfile.py +++ b/recipes/libkml/all/conanfile.py @@ -46,7 +46,7 @@ def requirements(self): self.requires("expat/2.5.0") self.requires("minizip/1.2.13") self.requires("uriparser/0.9.7") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): diff --git a/recipes/libliftoff/all/conandata.yml b/recipes/libliftoff/all/conandata.yml new file mode 100644 index 00000000000000..9cc2caed8889e3 --- /dev/null +++ b/recipes/libliftoff/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.1": + url: "https://gitlab.freedesktop.org/emersion/libliftoff/-/archive/v0.4.1/libliftoff-v0.4.1.tar.bz2" + sha256: "2ec4a6b467dda20476acb4d6bd864538ccdaa946e8666f96efa98156bf25cfb5" diff --git a/recipes/libliftoff/all/conanfile.py b/recipes/libliftoff/all/conanfile.py new file mode 100644 index 00000000000000..28626c0146534f --- /dev/null +++ b/recipes/libliftoff/all/conanfile.py @@ -0,0 +1,83 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, 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 LibliftoffConan(ConanFile): + name = "libliftoff" + description = "Lightweight KMS plane library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/package" + topics = ("drm", "KMS", "plane") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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("libdrm/2.4.114") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"{self.name} only supports FreeBSD and Linux") + + def build_requirements(self): + self.tool_requires("meson/1.2.2") + 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["werror"] = False + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.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")) + + def package_info(self): + self.cpp_info.libs = ["liftoff"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/recipes/libliftoff/all/test_package/conanfile.py b/recipes/libliftoff/all/test_package/conanfile.py new file mode 100644 index 00000000000000..5aab0703e7a4ef --- /dev/null +++ b/recipes/libliftoff/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.2") + 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/libliftoff/all/test_package/meson.build b/recipes/libliftoff/all/test_package/meson.build new file mode 100644 index 00000000000000..a943f09604a97f --- /dev/null +++ b/recipes/libliftoff/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('libliftoff') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/libliftoff/all/test_package/test_package.c b/recipes/libliftoff/all/test_package/test_package.c new file mode 100644 index 00000000000000..82017ed512aff1 --- /dev/null +++ b/recipes/libliftoff/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include +#include + +int main(void) { + liftoff_log_set_priority(LIFTOFF_DEBUG); + return EXIT_SUCCESS; +} diff --git a/recipes/libliftoff/config.yml b/recipes/libliftoff/config.yml new file mode 100644 index 00000000000000..3a9d5538921fcd --- /dev/null +++ b/recipes/libliftoff/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.1": + folder: all 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/libmbus/all/CMakeLists.txt b/recipes/libmbus/all/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9a..00000000000000 --- a/recipes/libmbus/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/libmbus/all/conanfile.py b/recipes/libmbus/all/conanfile.py index 5c3ff6e87aae2c..841dbf22c8b0d9 100644 --- a/recipes/libmbus/all/conanfile.py +++ b/recipes/libmbus/all/conanfile.py @@ -1,36 +1,31 @@ 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.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir + +required_conan_version = ">=1.53.0" class LibMbusConan(ConanFile): name = "libmbus" + description = "Meter-bus library and utility programs" license = "BSD-3-Clause" - homepage = "https://github.com/rscada/libmbus" url = "https://github.com/conan-io/conan-center-index" - description = """Meter-bus library and utility programs""" - topics = "conan", "mbus", "metering", "iot", "meter", "bus", "protocol" - exports_sources = "CMakeLists.txt" - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/rscada/libmbus" + topics = ("mbus", "metering", "iot", "meter", "bus", "protocol") + + 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 + "fPIC": True, } - generators = "cmake", "cmake_find_package" - - _cmake = None - - @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": @@ -38,43 +33,41 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + 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 validate(self): if self.settings.os not in ["Linux"]: - raise ConanInvalidConfiguration("Only Linux supported") - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + raise ConanInvalidConfiguration("Only Linux is supported") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + \ - os.path.basename( - self.conan_data["sources"][self.version]["url"]).split(".")[0] - os.rename(extracted_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['LIBMBUS_ENABLE_COVERAGE'] = False - self._cmake.definitions['LIBMBUS_BUILD_TESTS'] = False - self._cmake.definitions['LIBMBUS_BUILD_EXAMPLES'] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBMBUS_ENABLE_COVERAGE"] = False + tc.variables["LIBMBUS_BUILD_TESTS"] = False + tc.variables["LIBMBUS_BUILD_EXAMPLES"] = False + 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, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, - "lib", "libmbus", "cmake")) + rmdir(self, 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", "libmbus", "cmake")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) - if self.settings.os == "Linux": + self.cpp_info.libs = ["libmbus"] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/libmbus/all/test_package/CMakeLists.txt b/recipes/libmbus/all/test_package/CMakeLists.txt index 34af13462f44f8..076d1645a34b0e 100644 --- a/recipes/libmbus/all/test_package/CMakeLists.txt +++ b/recipes/libmbus/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libmbus REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libmbus::libmbus) diff --git a/recipes/libmbus/all/test_package/conanfile.py b/recipes/libmbus/all/test_package/conanfile.py index 933dbf96533ae4..fae501d0afb9e4 100644 --- a/recipes/libmbus/all/test_package/conanfile.py +++ b/recipes/libmbus/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" + test_type = "explicit" -class TestConan(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,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") - 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/libmbus/all/test_v1_package/CMakeLists.txt b/recipes/libmbus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libmbus/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/libmbus/all/test_v1_package/conanfile.py b/recipes/libmbus/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..9de3689208f00b --- /dev/null +++ b/recipes/libmbus/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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) + 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) diff --git a/recipes/libmediainfo/all/conanfile.py b/recipes/libmediainfo/all/conanfile.py index 88fc1cba470649..29fb127a8927a8 100644 --- a/recipes/libmediainfo/all/conanfile.py +++ b/recipes/libmediainfo/all/conanfile.py @@ -49,10 +49,10 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libcurl/8.0.1") + self.requires("libcurl/[>=7.78.0 <9]") self.requires("libzen/0.4.38", transitive_headers=True, transitive_libs=True) self.requires("tinyxml2/9.0.0") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if not self.dependencies["libzen"].options.enable_unicode: diff --git a/recipes/libmetalink/all/conanfile.py b/recipes/libmetalink/all/conanfile.py index 26b6f8a3d96558..a17aa7f18af8a0 100644 --- a/recipes/libmetalink/all/conanfile.py +++ b/recipes/libmetalink/all/conanfile.py @@ -53,9 +53,9 @@ def layout(self): def requirements(self): if self.options.xml_backend == "expat": - self.requires("expat/2.4.9") + self.requires("expat/2.5.0") elif self.options.xml_backend == "libxml2": - self.requires("libxml2/2.9.14") + self.requires("libxml2/2.11.4") def validate(self): if is_msvc(self): @@ -63,7 +63,7 @@ def validate(self): def build_requirements(self): self.tool_requires("gnu-config/cci.20210814") - 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/libmicrohttpd/all/conanfile.py b/recipes/libmicrohttpd/all/conanfile.py index 82ca43a61b7adc..c81f9e360d523c 100644 --- a/recipes/libmicrohttpd/all/conanfile.py +++ b/recipes/libmicrohttpd/all/conanfile.py @@ -71,7 +71,7 @@ def layout(self): def requirements(self): if self.options.get_safe("with_zlib"): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if is_msvc(self) and self.settings.arch not in ("x86", "x86_64"): diff --git a/recipes/libmikmod/all/conanfile.py b/recipes/libmikmod/all/conanfile.py index d4af224f4ca599..b2f6c5dadec51f 100644 --- a/recipes/libmikmod/all/conanfile.py +++ b/recipes/libmikmod/all/conanfile.py @@ -68,7 +68,7 @@ def layout(self): def requirements(self): if self.settings.os == "Linux": if self.options.with_alsa: - self.requires("libalsa/1.2.7.2") + self.requires("libalsa/1.2.10") if self.options.with_pulse: self.requires("pulseaudio/14.2") diff --git a/recipes/libmnl/all/conanfile.py b/recipes/libmnl/all/conanfile.py index 14628c1889b0d5..4542e12fe1d349 100644 --- a/recipes/libmnl/all/conanfile.py +++ b/recipes/libmnl/all/conanfile.py @@ -1,8 +1,12 @@ import os -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.29.1" +from conan import ConanFile +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.files import copy, get, rmdir, rm +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.53.0" class LibmnlConan(ConanFile): name = "libmnl" @@ -14,50 +18,40 @@ class LibmnlConan(ConanFile): settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} - _autotools = None + package_type = "library" - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") 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 configure(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("libmnl is only supported on Linux") if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - conf_args = [] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(configure_dir=self._source_subfolder, args=conf_args) - return self._autotools + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.libs = ["mnl"] diff --git a/recipes/libmnl/all/test_package/CMakeLists.txt b/recipes/libmnl/all/test_package/CMakeLists.txt index d4fdee1a8a79c3..941d5b3d99ff84 100644 --- a/recipes/libmnl/all/test_package/CMakeLists.txt +++ b/recipes/libmnl/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libmnl REQUIRED) add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example libmnl::libmnl) diff --git a/recipes/libmnl/all/test_package/conanfile.py b/recipes/libmnl/all/test_package/conanfile.py index 58e0d68615142a..39ac1b7b500082 100644 --- a/recipes/libmnl/all/test_package/conanfile.py +++ b/recipes/libmnl/all/test_package/conanfile.py @@ -1,11 +1,19 @@ import os -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 class LibmnlTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + 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", "example") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmorton/all/conandata.yml b/recipes/libmorton/all/conandata.yml index 388df27940d460..db08154a617a3b 100644 --- a/recipes/libmorton/all/conandata.yml +++ b/recipes/libmorton/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.12": + url: "https://github.com/Forceflow/libmorton/archive/v0.2.12.tar.gz" + sha256: "48ec3e4ad1d9348052dcb64bff012ff95db226da3fec5522ae6e674fabbd686f" "0.2.11": url: "https://github.com/Forceflow/libmorton/archive/refs/tags/v0.2.11.tar.gz" sha256: "3650ce8eb3deee28bc580e5bb1594fe07f7a33aa2531490bf09b5ab8207d55f6" diff --git a/recipes/libmorton/config.yml b/recipes/libmorton/config.yml index 88387c424a149d..056827a88e63b4 100644 --- a/recipes/libmorton/config.yml +++ b/recipes/libmorton/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.12": + folder: all "0.2.11": folder: all "0.2.10": diff --git a/recipes/libmount/all/conandata.yml b/recipes/libmount/all/conandata.yml index 18c98b7cab46ce..d36ca36c23c13b 100644 --- a/recipes/libmount/all/conandata.yml +++ b/recipes/libmount/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.39.2": + url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.2.tar.xz" + sha256: "87abdfaa8e490f8be6dde976f7c80b9b5ff9f301e1b67e3899e1f05a59a1531f" "2.39": url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.tar.xz" sha256: "32b30a336cda903182ed61feb3e9b908b762a5e66fe14e43efb88d37162075cb" diff --git a/recipes/libmount/all/conanfile.py b/recipes/libmount/all/conanfile.py index 04bcc9f5b860fe..b9ec541d71963d 100644 --- a/recipes/libmount/all/conanfile.py +++ b/recipes/libmount/all/conanfile.py @@ -61,7 +61,8 @@ def build(self): autotools.make() def package(self): - copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING", src=os.path.join(self.source_folder, "libmount"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING.LGPL-2.1-or-later", src=os.path.join(self.source_folder, "Documentation", "licenses"), dst=os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) autotools.install() rmdir(self, os.path.join(self.package_folder, "sbin")) diff --git a/recipes/libmount/config.yml b/recipes/libmount/config.yml index b9150d1aa9e481..867141253ca23f 100644 --- a/recipes/libmount/config.yml +++ b/recipes/libmount/config.yml @@ -1,4 +1,6 @@ versions: + "2.39.2": + folder: all "2.39": folder: all "2.36.2": diff --git a/recipes/libmpdclient/all/conandata.yml b/recipes/libmpdclient/all/conandata.yml new file mode 100644 index 00000000000000..254f1016519492 --- /dev/null +++ b/recipes/libmpdclient/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.20": + url: "https://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.20.tar.xz" + sha256: "18793f68e939c3301e34d8fcadea1f7daa24143941263cecadb80126194e277d" diff --git a/recipes/libmpdclient/all/conanfile.py b/recipes/libmpdclient/all/conanfile.py new file mode 100644 index 00000000000000..6a838ea6cdaa35 --- /dev/null +++ b/recipes/libmpdclient/all/conanfile.py @@ -0,0 +1,111 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class LibmpdclientConan(ConanFile): + name = "libmpdclient" + description = "libmpdclient is a C library which implements the Music Player Daemon protocol." + license = "BSD-3-Clause" + topics = ("music", "music-player-demon", "sound") + homepage = "https://www.musicpd.org/libs/libmpdclient" + 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], + "default_socket": ["ANY"], + "default_host": ["ANY"], + "default_port": ["ANY"], + "tcp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "default_socket": "/var/run/mpd/socket", + "default_host": "localhost", + "default_port": "6600", + "tcp": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.default_socket + + 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 validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support build of shared lib with msvc") + + def build_requirements(self): + self.tool_requires("meson/1.2.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + if self.settings.os != "Windows": + tc.project_options["default_socket"] = str(self.options.default_socket) + tc.project_options["default_host"] = str(self.options.default_host) + tc.project_options["default_port"] = str(self.options.default_port) + tc.project_options["tcp"] = self.options.tcp + tc.project_options["documentation"] = False + tc.project_options["test"] = False + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=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")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libmpdclient") + self.cpp_info.libs = ["mpdclient"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + from conan.tools.files import rename + import glob + if not conanfile.settings.get_safe("compiler.runtime"): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/libmpdclient/all/test_package/CMakeLists.txt b/recipes/libmpdclient/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..f00d9cb1c388cf --- /dev/null +++ b/recipes/libmpdclient/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libmpdclient CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmpdclient::libmpdclient) diff --git a/recipes/libmpdclient/all/test_package/conanfile.py b/recipes/libmpdclient/all/test_package/conanfile.py new file mode 100644 index 00000000000000..0a6bc68712d901 --- /dev/null +++ b/recipes/libmpdclient/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, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmpdclient/all/test_package/test_package.c b/recipes/libmpdclient/all/test_package/test_package.c new file mode 100644 index 00000000000000..bb53ebecfee6d6 --- /dev/null +++ b/recipes/libmpdclient/all/test_package/test_package.c @@ -0,0 +1,25 @@ +#include +#include + +#include +#include + +int main() +{ + struct mpd_connection *conn = mpd_connection_new(NULL, 0, 0); + + if (conn == NULL) { + fprintf(stderr, "Out of memory\n"); + return 1; + } + if (mpd_connection_get_error(conn) != MPD_ERROR_SUCCESS) { + fprintf(stderr, "%s\n", mpd_connection_get_error_message(conn)); + mpd_connection_free(conn); + return 0; + } + + mpd_run_next(conn); + mpd_connection_free(conn); + + return 0; +} diff --git a/recipes/vulkan-loader/all/test_v1_package/CMakeLists.txt b/recipes/libmpdclient/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/vulkan-loader/all/test_v1_package/CMakeLists.txt rename to recipes/libmpdclient/all/test_v1_package/CMakeLists.txt diff --git a/recipes/libmpdclient/all/test_v1_package/conanfile.py b/recipes/libmpdclient/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/libmpdclient/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/libmpdclient/config.yml b/recipes/libmpdclient/config.yml new file mode 100644 index 00000000000000..e36906bed874c8 --- /dev/null +++ b/recipes/libmpdclient/config.yml @@ -0,0 +1,3 @@ +versions: + "2.20": + folder: "all" diff --git a/recipes/libmysqlclient/all/conandata.yml b/recipes/libmysqlclient/all/conandata.yml index 7533ad1b401d84..78b5ed97e3e15f 100644 --- a/recipes/libmysqlclient/all/conandata.yml +++ b/recipes/libmysqlclient/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "8.1.0": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.1/mysql-8.1.0.tar.gz" + sha256: "3dd017a940734aa90796a4c65e125e6712f64bbbbe3388d36469deaa87b599eb" + "8.0.34": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.34.tar.gz" + sha256: "e65d03a3c42618b5fbf99042aed33209402e9b27aa62c7c8743ffd4788d8db1d" "8.0.31": url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.31.tar.gz" sha256: "67bb8cba75b28e95c7f7948563f01fb84528fcbb1a35dba839d4ce44fe019baa" @@ -9,6 +15,14 @@ sources: url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.25.tar.gz" sha256: "c16aa9cf621bc028efba2bb11f3c36a323b125fa0d108ff92fab60e46309206e" patches: + "8.1.0": + - patch_file: "patches/0006-fix-cpp20-build-8.1.0.patch" + patch_description: "Fix C++20 compilation" + patch_type: "portability" + "8.0.34": + - patch_file: "patches/0006-fix-cpp20-build-8.0.29.patch" + patch_description: "Fix C++20 compilation" + patch_type: "portability" "8.0.31": - patch_file: "patches/0006-fix-cpp20-build-8.0.29.patch" patch_description: "Fix C++20 compilation" diff --git a/recipes/libmysqlclient/all/conanfile.py b/recipes/libmysqlclient/all/conanfile.py index 46f8df1537d5e8..3222c3020d2f0d 100644 --- a/recipes/libmysqlclient/all/conanfile.py +++ b/recipes/libmysqlclient/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.env import VirtualRunEnv, VirtualBuildEnv -from conan.tools.files import rename, get, apply_conandata_patches, replace_in_file, rmdir, rm, export_conandata_patches, copy, mkdir +from conan.tools.files import rename, get, apply_conandata_patches, replace_in_file, rmdir, rm, export_conandata_patches, mkdir from conan.tools.gnu import PkgConfigDeps from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version @@ -63,14 +63,14 @@ def layout(self): def requirements(self): if Version(self.version) < "8.0.30": - self.requires("openssl/1.1.1t") + self.requires("openssl/1.1.1w") else: self.requires("openssl/[>=1.1 <4]") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") self.requires("zstd/1.5.5") self.requires("lz4/1.9.4") if self.settings.os == "FreeBSD": - self.requires("libunwind/1.6.2") + self.requires("libunwind/1.7.2") def validate_build(self): if self.settings.compiler.get_safe("cppstd"): @@ -90,11 +90,6 @@ def loose_lt_semver(v1, v2): if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration(f"{self.ref} requires {self.settings.compiler} {minimum_version} or newer") - # Sice 8.0.17 this doesn't support shared library on MacOS. - # https://github.com/mysql/mysql-server/blob/mysql-8.0.17/cmake/libutils.cmake#L333-L335 - if self.settings.compiler == "apple-clang" and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared library") - # mysql < 8.0.29 uses `requires` in source code. It is the reserved keyword in C++20. # https://github.com/mysql/mysql-server/blob/mysql-8.0.0/include/mysql/components/services/dynamic_loader.h#L270 if self.settings.compiler.get_safe("cppstd") == "20" and Version(self.version) < "8.0.29": @@ -104,7 +99,7 @@ def build_requirements(self): if is_apple_os(self): self.tool_requires("cmake/[>=3.18 <4]") if self.settings.os == "FreeBSD" and 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) @@ -127,14 +122,13 @@ def _patch_sources(self): f"# WARN_MISSING_SYSTEM_{lib.upper()}({lib.upper()}_WARN_GIVEN)", strict=False) - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - f"SET({lib.upper()}_WARN_GIVEN)", - f"# SET({lib.upper()}_WARN_GIVEN)", - strict=False) + if lib != "libevent" or Version(self.version) < "8.0.34": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"SET({lib.upper()}_WARN_GIVEN)", + f"# SET({lib.upper()}_WARN_GIVEN)", + strict=False) - rmdir(self, os.path.join(self.source_folder, "extra")) for folder in ["client", "man", "mysql-test", "libbinlogstandalone"]: - rmdir(self, os.path.join(self.source_folder, folder)) replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), f"ADD_SUBDIRECTORY({folder})\n", "", @@ -147,9 +141,10 @@ def _patch_sources(self): strict=False) # Upstream does not actually load lz4 directories for system, force it to - replace_in_file(self, os.path.join(self.source_folder, "libbinlogevents", "CMakeLists.txt"), - "INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libbinlogevents/include)", - "MY_INCLUDE_SYSTEM_DIRECTORIES(LZ4)\nINCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libbinlogevents/include)") + if Version(self.version) < "8.0.34": + replace_in_file(self, os.path.join(self.source_folder, "libbinlogevents", "CMakeLists.txt"), + "INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libbinlogevents/include)", + "MY_INCLUDE_SYSTEM_DIRECTORIES(LZ4)\nINCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libbinlogevents/include)") replace_in_file(self, os.path.join(self.source_folder, "cmake", "zstd.cmake"), "NAMES zstd", @@ -180,7 +175,9 @@ def _patch_sources(self): "if(0)") # Do not copy shared libs of dependencies to package folder - deps_shared = ["SSL", "KERBEROS", "SASL", "LDAP", "PROTOBUF", "CURL"] + deps_shared = ["SSL", "KERBEROS", "SASL", "LDAP", "PROTOBUF"] + if Version(self.version) < "8.0.34": + deps_shared.append("CURL") for dep in deps_shared: replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), f"MYSQL_CHECK_{dep}_DLLS()", @@ -211,7 +208,7 @@ def generate(self): tc.cache_variables["ENABLED_PROFILING"] = False tc.cache_variables["MYSQL_MAINTAINER_MODE"] = False tc.cache_variables["WIX_DIR"] = False - # Disable additional Linux distro-specific compiler checks. + # Disable additional Linux distro-specific compiler checks. # The recipe already checks for minimum versions of supported # compilers. tc.cache_variables["FORCE_UNSUPPORTED_COMPILER"] = True @@ -227,6 +224,9 @@ def generate(self): tc.cache_variables["WITH_SSL"] = self.dependencies["openssl"].package_folder.replace("\\", "/") tc.cache_variables["WITH_ZLIB"] = "system" + + # Remove to ensure reproducible build, this only affects docs generation + tc.cache_variables["CMAKE_DISABLE_FIND_PACKAGE_Doxygen"] = True tc.generate() deps = CMakeDeps(self) @@ -250,16 +250,23 @@ def package(self): rm(self, "README", self.package_folder) rm(self, "*.pdb", self.package_folder, recursive=True) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "plugin")) rmdir(self, os.path.join(self.package_folder, "docs")) rmdir(self, os.path.join(self.package_folder, "share")) - 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) - if self.options.shared: - rm(self, "*.a", self.package_folder, recursive=True) + if self.settings.os == "Windows": + if self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libmysql.dll"), + os.path.join(self.package_folder, "bin", "libmysql.dll")) + rm(self, "*mysqlclient.*", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.dll", os.path.join(self.package_folder, "lib")) + rm(self, "*libmysql.*", os.path.join(self.package_folder, "lib")) else: - rm(self, "*.dll", self.package_folder, recursive=True) - rm(self, "*.dylib", self.package_folder, recursive=True) - rm(self, "*.so*", self.package_folder, recursive=True) + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.dylib", os.path.join(self.package_folder, "lib")) + rm(self, "*.so*", os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.set_property("pkg_config_name", "mysqlclient") diff --git a/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.1.0.patch b/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.1.0.patch new file mode 100644 index 00000000000000..ebaba58ec7fab0 --- /dev/null +++ b/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.1.0.patch @@ -0,0 +1,17 @@ +diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h +index 0f4a540..bd81a40 100644 +--- a/sql/sql_bitmap.h ++++ b/sql/sql_bitmap.h +@@ -145,10 +145,10 @@ class Bitmap<64> { + ulonglong map; + + public: +- Bitmap<64>() { init(); } ++ Bitmap() { init(); } + enum { ALL_BITS = 64 }; + +- explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); } ++ explicit Bitmap(uint prefix_to_set) { set_prefix(prefix_to_set); } + void init() { clear_all(); } + void init(uint prefix_to_set) { set_prefix(prefix_to_set); } + uint length() const { return 64; } diff --git a/recipes/libmysqlclient/config.yml b/recipes/libmysqlclient/config.yml index d2183e51a5f3cd..1b617851b7de68 100644 --- a/recipes/libmysqlclient/config.yml +++ b/recipes/libmysqlclient/config.yml @@ -1,4 +1,8 @@ versions: + "8.1.0": + folder: all + "8.0.34": + folder: all "8.0.31": folder: all "8.0.30": diff --git a/recipes/libnetfilter_conntrack/all/conanfile.py b/recipes/libnetfilter_conntrack/all/conanfile.py index b4f68103f83c15..838c21aea601be 100644 --- a/recipes/libnetfilter_conntrack/all/conanfile.py +++ b/recipes/libnetfilter_conntrack/all/conanfile.py @@ -1,67 +1,78 @@ import os -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + class Libnetfilter_conntrackConan(ConanFile): name = "libnetfilter_conntrack" + description = "userspace library that provides an API to the in-kernel connection tracking state table" license = "GPL-2.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://netfilter.org/projects/libnetfilter_conntrack/index.html" - description = "userspace library that provides an API to the in-kernel connection tracking state table" - topics = ("libnetfilter_conntrack", "netfilter") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "pkg_config" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" + topics = ("netfilter",) - def requirements(self): - self.requires("libmnl/1.0.4") - self.requires("libnfnetlink/1.0.1") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": 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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC def configure(self): - if self.settings.os != "Linux": + if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration("libnetfilter_conntrack is only supported on Linux") 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 _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - conf_args = [] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(configure_dir=self._source_subfolder, args=conf_args) - return self._autotools + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libmnl/1.0.4", transitive_headers=True, transitive_libs=True) + self.requires("libnfnetlink/1.0.2", transitive_headers=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() def build(self): - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + autotools = Autotools(self) autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.libs = ["netfilter_conntrack"] - self.cpp_info.names["pkg_config"] = "libnetfilter_conntrack" + self.cpp_info.set_property("pkg_config_name", "libnetfilter_conntrack") diff --git a/recipes/libnetfilter_conntrack/all/test_package/CMakeLists.txt b/recipes/libnetfilter_conntrack/all/test_package/CMakeLists.txt index 4dbc40cd2c4d9e..133b0de0016706 100644 --- a/recipes/libnetfilter_conntrack/all/test_package/CMakeLists.txt +++ b/recipes/libnetfilter_conntrack/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.10) -project(PackageTest) +cmake_minimum_required(VERSION 3.15) +project(PackageTest LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libnetfilter_conntrack REQUIRED CONFIG) add_executable(example example.c) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example libnetfilter_conntrack::libnetfilter_conntrack) diff --git a/recipes/libnetfilter_conntrack/all/test_package/conanfile.py b/recipes/libnetfilter_conntrack/all/test_package/conanfile.py index 49596606491864..cf3b9d75009a72 100644 --- a/recipes/libnetfilter_conntrack/all/test_package/conanfile.py +++ b/recipes/libnetfilter_conntrack/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 Libnetfilter_conntrackTestConan(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) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "example") - self.run("{} {}".format(bin_path, 0), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "example") + self.run(f"{bin_path} 0", env="conanrun") diff --git a/recipes/libnetfilter_conntrack/all/test_package/example.c b/recipes/libnetfilter_conntrack/all/test_package/example.c index 331a7d9d4f8548..ccdf8593d195fa 100644 --- a/recipes/libnetfilter_conntrack/all/test_package/example.c +++ b/recipes/libnetfilter_conntrack/all/test_package/example.c @@ -1,12 +1,12 @@ +#include +#include + #include #include #include #include #include -#include -#include - static int data_cb(const struct nlmsghdr *nlh, void *data) { struct nf_conntrack *ct; diff --git a/recipes/libnetfilter_conntrack/all/test_v1_package/CMakeLists.txt b/recipes/libnetfilter_conntrack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libnetfilter_conntrack/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/libnetfilter_conntrack/all/test_v1_package/conanfile.py b/recipes/libnetfilter_conntrack/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..ebd551d13e3991 --- /dev/null +++ b/recipes/libnetfilter_conntrack/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + +class Libnetfilter_conntrackTestConan(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", "example") + self.run("{} {}".format(bin_path, 0), run_environment=True) diff --git a/recipes/libnetfilter_queue/all/conanfile.py b/recipes/libnetfilter_queue/all/conanfile.py index 56576ded262ce0..3552a30ecc625f 100644 --- a/recipes/libnetfilter_queue/all/conanfile.py +++ b/recipes/libnetfilter_queue/all/conanfile.py @@ -1,69 +1,83 @@ import os -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.29.1" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + class Libnetfilter_queueConan(ConanFile): name = "libnetfilter_queue" + description = ("userspace library that provides an API to packets" + " that have been queued by the kernel packet filter") license = "GPL-2.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://netfilter.org/projects/libnetfilter_queue/index.html" - description = "userspace library that provides an API to packets that have been queued by the kernel packet filter" - topics = ("libnetfilter_queue", "netfilter") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "pkg_config" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" + topics = "netfilter" - def requirements(self): - self.requires("libmnl/1.0.4") - self.requires("libnfnetlink/1.0.1") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": 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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC - def configure(self): + def validate(self): if self.settings.os != "Linux": - raise ConanInvalidConfiguration("libnetfilter_queue is only supported on Linux") - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - conf_args = [] + raise ConanInvalidConfiguration(f"{self.ref} is only supported on Linux.") + + def configure(self): if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(configure_dir=self._source_subfolder, args=conf_args) - return self._autotools + 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("libmnl/1.0.4", transitive_headers=True, transitive_libs=True) + self.requires("libnfnetlink/1.0.2", transitive_headers=True) + + 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], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() def build(self): - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + autotools = Autotools(self) autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.libs = ["netfilter_queue"] - self.cpp_info.names["pkg_config"] = "libnetfilter_queue" + self.cpp_info.set_property("pkg_config_name", "libnetfilter_queue") diff --git a/recipes/libnetfilter_queue/all/test_package/CMakeLists.txt b/recipes/libnetfilter_queue/all/test_package/CMakeLists.txt index 4dbc40cd2c4d9e..58e2406eaac645 100644 --- a/recipes/libnetfilter_queue/all/test_package/CMakeLists.txt +++ b/recipes/libnetfilter_queue/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.10) -project(PackageTest) +cmake_minimum_required(VERSION 3.15) +project(PackageTest LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libnetfilter_queue REQUIRED CONFIG) add_executable(example example.c) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example libnetfilter_queue::libnetfilter_queue) diff --git a/recipes/libnetfilter_queue/all/test_package/conanfile.py b/recipes/libnetfilter_queue/all/test_package/conanfile.py index 1097433829a7c2..cf3b9d75009a72 100644 --- a/recipes/libnetfilter_queue/all/test_package/conanfile.py +++ b/recipes/libnetfilter_queue/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 Libnetfilter_queueTestConan(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,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "example") - self.run("{} {}".format(bin_path, 0), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "example") + self.run(f"{bin_path} 0", env="conanrun") diff --git a/recipes/libnetfilter_queue/all/test_package/example.c b/recipes/libnetfilter_queue/all/test_package/example.c index f229443f228aa4..6260070d870800 100644 --- a/recipes/libnetfilter_queue/all/test_package/example.c +++ b/recipes/libnetfilter_queue/all/test_package/example.c @@ -1,17 +1,17 @@ +#include #include #include #include -#include #include #include -#include +#include #include #include #include -#include #include +#include #include @@ -20,153 +20,149 @@ static struct mnl_socket *nl; -static void -nfq_send_verdict(int queue_num, uint32_t id) -{ - char buf[MNL_SOCKET_BUFFER_SIZE]; - struct nlmsghdr *nlh; - struct nlattr *nest; +static void nfq_send_verdict(int queue_num, uint32_t id) { + char buf[MNL_SOCKET_BUFFER_SIZE]; + struct nlmsghdr *nlh; + struct nlattr *nest; - nlh = nfq_nlmsg_put(buf, NFQNL_MSG_VERDICT, queue_num); - nfq_nlmsg_verdict_put(nlh, id, NF_ACCEPT); + nlh = nfq_nlmsg_put(buf, NFQNL_MSG_VERDICT, queue_num); + nfq_nlmsg_verdict_put(nlh, id, NF_ACCEPT); - /* example to set the connmark. First, start NFQA_CT section: */ - nest = mnl_attr_nest_start(nlh, NFQA_CT); + /* example to set the connmark. First, start NFQA_CT section: */ + nest = mnl_attr_nest_start(nlh, NFQA_CT); - /* then, add the connmark attribute: */ - mnl_attr_put_u32(nlh, CTA_MARK, htonl(42)); - /* more conntrack attributes, e.g. CTA_LABELS could be set here */ + /* then, add the connmark attribute: */ + mnl_attr_put_u32(nlh, CTA_MARK, htonl(42)); + /* more conntrack attributes, e.g. CTA_LABELS could be set here */ - /* end conntrack section */ - mnl_attr_nest_end(nlh, nest); + /* end conntrack section */ + mnl_attr_nest_end(nlh, nest); - if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { - perror("mnl_socket_send"); - exit(EXIT_FAILURE); - } + if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { + perror("mnl_socket_send"); + exit(EXIT_FAILURE); + } } -static int queue_cb(const struct nlmsghdr *nlh, void *data) -{ - struct nfqnl_msg_packet_hdr *ph = NULL; - struct nlattr *attr[NFQA_MAX+1] = {}; - uint32_t id = 0, skbinfo; - struct nfgenmsg *nfg; - uint16_t plen; +static int queue_cb(const struct nlmsghdr *nlh, void *data) { + struct nfqnl_msg_packet_hdr *ph = NULL; + struct nlattr *attr[NFQA_MAX + 1] = {}; + uint32_t id = 0, skbinfo; + struct nfgenmsg *nfg; + uint16_t plen; - if (nfq_nlmsg_parse(nlh, attr) < 0) { - perror("problems parsing"); - return MNL_CB_ERROR; - } + if (nfq_nlmsg_parse(nlh, attr) < 0) { + perror("problems parsing"); + return MNL_CB_ERROR; + } - nfg = mnl_nlmsg_get_payload(nlh); + nfg = mnl_nlmsg_get_payload(nlh); - if (attr[NFQA_PACKET_HDR] == NULL) { - fputs("metaheader not set\n", stderr); - return MNL_CB_ERROR; - } + if (attr[NFQA_PACKET_HDR] == NULL) { + fputs("metaheader not set\n", stderr); + return MNL_CB_ERROR; + } - ph = mnl_attr_get_payload(attr[NFQA_PACKET_HDR]); + ph = mnl_attr_get_payload(attr[NFQA_PACKET_HDR]); - plen = mnl_attr_get_payload_len(attr[NFQA_PAYLOAD]); - /* void *payload = mnl_attr_get_payload(attr[NFQA_PAYLOAD]); */ + plen = mnl_attr_get_payload_len(attr[NFQA_PAYLOAD]); + /* void *payload = mnl_attr_get_payload(attr[NFQA_PAYLOAD]); */ - skbinfo = attr[NFQA_SKB_INFO] ? ntohl(mnl_attr_get_u32(attr[NFQA_SKB_INFO])) : 0; + skbinfo = attr[NFQA_SKB_INFO] ? ntohl(mnl_attr_get_u32(attr[NFQA_SKB_INFO])) : 0; - if (attr[NFQA_CAP_LEN]) { - uint32_t orig_len = ntohl(mnl_attr_get_u32(attr[NFQA_CAP_LEN])); - if (orig_len != plen) - printf("truncated "); - } + if (attr[NFQA_CAP_LEN]) { + uint32_t orig_len = ntohl(mnl_attr_get_u32(attr[NFQA_CAP_LEN])); + if (orig_len != plen) + printf("truncated "); + } - if (skbinfo & NFQA_SKB_GSO) - printf("GSO "); + if (skbinfo & NFQA_SKB_GSO) + printf("GSO "); - id = ntohl(ph->packet_id); - printf("packet received (id=%u hw=0x%04x hook=%u, payload len %u", - id, ntohs(ph->hw_protocol), ph->hook, plen); + id = ntohl(ph->packet_id); + printf("packet received (id=%u hw=0x%04x hook=%u, payload len %u", id, ntohs(ph->hw_protocol), + ph->hook, plen); - /* - * ip/tcp checksums are not yet valid, e.g. due to GRO/GSO. - * The application should behave as if the checksums are correct. - * - * If these packets are later forwarded/sent out, the checksums will - * be corrected by kernel/hardware. - */ - if (skbinfo & NFQA_SKB_CSUMNOTREADY) - printf(", checksum not ready"); - puts(")"); + /* + * ip/tcp checksums are not yet valid, e.g. due to GRO/GSO. + * The application should behave as if the checksums are correct. + * + * If these packets are later forwarded/sent out, the checksums will + * be corrected by kernel/hardware. + */ + if (skbinfo & NFQA_SKB_CSUMNOTREADY) + printf(", checksum not ready"); + puts(")"); - nfq_send_verdict(ntohs(nfg->res_id), id); + nfq_send_verdict(ntohs(nfg->res_id), id); - return MNL_CB_OK; + return MNL_CB_OK; } -int main(int argc, char *argv[]) -{ - char *buf; - /* largest possible packet payload, plus netlink data overhead: */ - size_t sizeof_buf = 0xffff + (MNL_SOCKET_BUFFER_SIZE/2); - struct nlmsghdr *nlh; - int ret; - unsigned int portid, queue_num; - - if (argc != 2) { - printf("Usage: %s [queue_num]\n", argv[0]); - exit(EXIT_FAILURE); - } - queue_num = atoi(argv[1]); - - nl = mnl_socket_open(NETLINK_NETFILTER); - if (nl == NULL) { - perror("mnl_socket_open"); - exit(EXIT_FAILURE); - } - - if (mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) { - perror("mnl_socket_bind"); - exit(EXIT_FAILURE); - } - portid = mnl_socket_get_portid(nl); - - buf = malloc(sizeof_buf); - if (!buf) { - perror("allocate receive buffer"); - exit(EXIT_FAILURE); - } - - nlh = nfq_nlmsg_put(buf, NFQNL_MSG_CONFIG, queue_num); - nfq_nlmsg_cfg_put_cmd(nlh, AF_INET, NFQNL_CFG_CMD_BIND); - - if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { - perror("mnl_socket_send"); - exit(EXIT_FAILURE); - } - - nlh = nfq_nlmsg_put(buf, NFQNL_MSG_CONFIG, queue_num); - nfq_nlmsg_cfg_put_params(nlh, NFQNL_COPY_PACKET, 0xffff); - - mnl_attr_put_u32(nlh, NFQA_CFG_FLAGS, htonl(NFQA_CFG_F_GSO)); - mnl_attr_put_u32(nlh, NFQA_CFG_MASK, htonl(NFQA_CFG_F_GSO)); - - if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { - perror("mnl_socket_send"); - exit(EXIT_FAILURE); - } - - /* ENOBUFS is signalled to userspace when packets were lost - * on kernel side. In most cases, userspace isn't interested - * in this information, so turn it off. - */ - ret = 1; - mnl_socket_setsockopt(nl, NETLINK_NO_ENOBUFS, &ret, sizeof(int)); - ret = mnl_socket_recvfrom(nl, buf, sizeof_buf); - if (ret == -1) { - perror("mnl_socket_recvfrom"); - exit(EXIT_FAILURE); - } - - mnl_socket_close(nl); - - return 0; +int main(int argc, char *argv[]) { + char *buf; + /* largest possible packet payload, plus netlink data overhead: */ + size_t sizeof_buf = 0xffff + (MNL_SOCKET_BUFFER_SIZE / 2); + struct nlmsghdr *nlh; + int ret; + unsigned int portid, queue_num; + + if (argc != 2) { + printf("Usage: %s [queue_num]\n", argv[0]); + exit(EXIT_FAILURE); + } + queue_num = atoi(argv[1]); + + nl = mnl_socket_open(NETLINK_NETFILTER); + if (nl == NULL) { + perror("mnl_socket_open"); + exit(EXIT_FAILURE); + } + + if (mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) { + perror("mnl_socket_bind"); + exit(EXIT_FAILURE); + } + portid = mnl_socket_get_portid(nl); + + buf = malloc(sizeof_buf); + if (!buf) { + perror("allocate receive buffer"); + exit(EXIT_FAILURE); + } + + nlh = nfq_nlmsg_put(buf, NFQNL_MSG_CONFIG, queue_num); + nfq_nlmsg_cfg_put_cmd(nlh, AF_INET, NFQNL_CFG_CMD_BIND); + + if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { + perror("mnl_socket_send"); + exit(EXIT_FAILURE); + } + + nlh = nfq_nlmsg_put(buf, NFQNL_MSG_CONFIG, queue_num); + nfq_nlmsg_cfg_put_params(nlh, NFQNL_COPY_PACKET, 0xffff); + + mnl_attr_put_u32(nlh, NFQA_CFG_FLAGS, htonl(NFQA_CFG_F_GSO)); + mnl_attr_put_u32(nlh, NFQA_CFG_MASK, htonl(NFQA_CFG_F_GSO)); + + if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { + perror("mnl_socket_send"); + exit(EXIT_FAILURE); + } + + /* ENOBUFS is signalled to userspace when packets were lost + * on kernel side. In most cases, userspace isn't interested + * in this information, so turn it off. + */ + ret = 1; + mnl_socket_setsockopt(nl, NETLINK_NO_ENOBUFS, &ret, sizeof(int)); + ret = mnl_socket_recvfrom(nl, buf, sizeof_buf); + if (ret == -1) { + perror("mnl_socket_recvfrom"); + exit(EXIT_FAILURE); + } + + mnl_socket_close(nl); + + return 0; } diff --git a/recipes/libnetfilter_queue/all/test_v1_package/CMakeLists.txt b/recipes/libnetfilter_queue/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libnetfilter_queue/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/libnetfilter_queue/all/test_v1_package/conanfile.py b/recipes/libnetfilter_queue/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..528904ad9f9595 --- /dev/null +++ b/recipes/libnetfilter_queue/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class Libnetfilter_queueTestConan(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", "example") + self.run("{} {}".format(bin_path, 0), run_environment=True) diff --git a/recipes/libnfnetlink/all/conanfile.py b/recipes/libnfnetlink/all/conanfile.py index 10540d39fbf9cb..3797ae3ceea3a6 100644 --- a/recipes/libnfnetlink/all/conanfile.py +++ b/recipes/libnfnetlink/all/conanfile.py @@ -1,67 +1,70 @@ import os -import functools -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + class LibnfnetlinkConan(ConanFile): name = "libnfnetlink" + description = "low-level library for netfilter related kernel/userspace communication" license = "GPL-2.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://netfilter.org/projects/libnfnetlink/index.html" - description = "low-level library for netfilter related kernel/userspace communication" - topics = ("libnfnetlink", "netlink", "netfilter") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + topics = ("netlink", "netfilter") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + 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 validate(self): - if self.settings.os != "Linux": + if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration("libnfnetlink is only supported on Linux") - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - autotools.configure(configure_dir=self._source_subfolder, args=conf_args) - return autotools + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + autotools = Autotools(self) autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.libs = ["nfnetlink"] - self.cpp_info.set_property("pkg_config_name", "libnfnetlink") - - # TODO: to remove in conan v2 once pkg_config generator is removed - self.cpp_info.names["pkg_config"] = "libnfnetlink" + self.cpp_info.set_property("pkg_config_name", "libnfnetlink") diff --git a/recipes/libnfnetlink/all/test_package/CMakeLists.txt b/recipes/libnfnetlink/all/test_package/CMakeLists.txt index d4fdee1a8a79c3..7e1aa1808dfd53 100644 --- a/recipes/libnfnetlink/all/test_package/CMakeLists.txt +++ b/recipes/libnfnetlink/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libnfnetlink REQUIRED CONFIG) add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example libnfnetlink::libnfnetlink) diff --git a/recipes/libnfnetlink/all/test_package/conanfile.py b/recipes/libnfnetlink/all/test_package/conanfile.py index e4f1965959dece..e0f447388fa1b4 100644 --- a/recipes/libnfnetlink/all/test_package/conanfile.py +++ b/recipes/libnfnetlink/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" + test_type = "explicit" -class LibnfnetlinkTestConan(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,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.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/libnfnetlink/all/test_package/example.cpp b/recipes/libnfnetlink/all/test_package/example.cpp index 95153d8532f515..395453bdde08aa 100644 --- a/recipes/libnfnetlink/all/test_package/example.cpp +++ b/recipes/libnfnetlink/all/test_package/example.cpp @@ -1,7 +1,8 @@ -#include -#include #include +#include +#include + int main() { struct nfnl_handle *nl = nfnl_open(); if (nl == NULL) { diff --git a/recipes/libnfnetlink/all/test_v1_package/CMakeLists.txt b/recipes/libnfnetlink/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libnfnetlink/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/libnfnetlink/all/test_v1_package/conanfile.py b/recipes/libnfnetlink/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c8689f282274d7 --- /dev/null +++ b/recipes/libnfnetlink/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class LibnfnetlinkTestConan(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", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index 16a85daa582800..a883c4b7d535a5 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.58.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.58.0.tar.gz" + sha256: "7da19947b33a07ddcf97b9791331bfee8a8545e6b394275a9971f43cae9d636b" + "1.57.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.57.0.tar.gz" + sha256: "3c0b4e023dddf2afa087aa4409f7dbe03c099b4c63655e7545a607035085848a" + "1.56.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.56.0.tar.gz" + sha256: "63dd705b524eec3c843b8e4e24914600a30c2804a113e8e5baeeb9695d09590a" "1.55.1": url: "https://github.com/nghttp2/nghttp2/archive/v1.55.1.tar.gz" sha256: "b89dece5bc3382b82c22db8dc8d1e062258cb7af8e4ad55278fa7149645a588d" @@ -17,28 +26,3 @@ sources: "1.50.0": url: "https://github.com/nghttp2/nghttp2/releases/download/v1.50.0/nghttp2-1.50.0.tar.xz" sha256: "af24007e34c18c782393a1dc3685f8fd5b50283e90a9191d25488eb50aa2c825" - "1.49.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.49.0/nghttp2-1.49.0.tar.xz" - sha256: "b0cfd492bbf0b131c472e8f6501c9f4ee82b51b68130f47b278c0b7c9848a66e" - "1.48.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.48.0/nghttp2-1.48.0.tar.xz" - sha256: "47d8f30ee4f1bc621566d10362ca1b3ac83a335c63da7144947c806772d016e4" - "1.47.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.47.0/nghttp2-1.47.0.tar.xz" - sha256: "68271951324554c34501b85190f22f2221056db69f493afc3bbac8e7be21e7cc" - "1.46.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.46.0/nghttp2-1.46.0.tar.xz" - sha256: "1a68cc4a5732afb735baf50aaac3cb3a6771e49f744bd5db6c49ab5042f12a43" -patches: - "1.49.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - "1.48.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - "1.47.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - "1.46.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" diff --git a/recipes/libnghttp2/all/conanfile.py b/recipes/libnghttp2/all/conanfile.py index b7976951f311e5..ac841e13b7b864 100644 --- a/recipes/libnghttp2/all/conanfile.py +++ b/recipes/libnghttp2/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, save, replace_in_file, rmdir, copy +from conan.tools.files import get, save, replace_in_file, rmdir, copy from conan.tools.gnu import PkgConfigDeps from conan.tools.microsoft import is_msvc from conan.tools.scm import Version @@ -15,10 +15,10 @@ class Nghttp2Conan(ConanFile): name = "libnghttp2" description = "HTTP/2 C Library and tools" - topics = ("http", "http2") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://nghttp2.org" - license = "MIT" + topics = ("http", "http2") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -38,9 +38,6 @@ class Nghttp2Conan(ConanFile): "with_asio": False, } - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -63,17 +60,17 @@ def requirements(self): if self.options.with_app or self.options.get_safe("with_asio"): self.requires("openssl/[>=1.1 <4]") if self.options.with_app: - self.requires("c-ares/1.19.1") + self.requires("c-ares/1.20.1") self.requires("libev/4.33") self.requires("libevent/2.1.12") - self.requires("libxml2/2.11.4") - self.requires("zlib/1.2.13") + self.requires("libxml2/2.11.5") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_jemalloc: self.requires("jemalloc/5.3.0") if self.options.with_hpack: self.requires("jansson/2.14") if self.options.get_safe("with_asio"): - self.requires("boost/1.82.0") + self.requires("boost/1.83.0") def validate(self): if self.options.get_safe("with_asio") and is_msvc(self): @@ -97,8 +94,6 @@ def generate(self): # disable unneeded auto-picked dependencies tc.variables["WITH_LIBXML2"] = False tc.variables["WITH_JEMALLOC"] = self.options.get_safe("with_jemalloc", False) - if Version(self.version) < "1.47.0": - tc.variables["WITH_SPDYLAY"] = False if Version(self.version) < "1.52.0": tc.variables["ENABLE_ASIO_LIB"] = self.options.with_asio if is_apple_os(self): @@ -112,7 +107,6 @@ def generate(self): tc.generate() def _patch_sources(self): - apply_conandata_patches(self) if not self.options.shared: # easier to patch here rather than have patch 'nghttp_static_include_directories' for each version save(self, os.path.join(self.source_folder, "lib", "CMakeLists.txt"), diff --git a/recipes/libnghttp2/all/patches/fix-findJemalloc.cmake b/recipes/libnghttp2/all/patches/fix-findJemalloc.cmake deleted file mode 100644 index f072d3a7f8d5ae..00000000000000 --- a/recipes/libnghttp2/all/patches/fix-findJemalloc.cmake +++ /dev/null @@ -1,14 +0,0 @@ ---- cmake/FindJemalloc.cmake -+++ cmake/FindJemalloc.cmake -@@ -10,10 +10,10 @@ - find_path(JEMALLOC_INCLUDE_DIR - NAMES jemalloc/jemalloc.h - HINTS ${PC_JEMALLOC_INCLUDE_DIRS} - ) - find_library(JEMALLOC_LIBRARY -- NAMES jemalloc -+ NAMES jemalloc jemalloc_s jemalloc_pic - HINTS ${PC_JEMALLOC_LIBRARY_DIRS} - ) - - if(JEMALLOC_INCLUDE_DIR) diff --git a/recipes/libnghttp2/all/patches/fix-findLibevent.cmake b/recipes/libnghttp2/all/patches/fix-findLibevent.cmake deleted file mode 100644 index b58cd730c3bff7..00000000000000 --- a/recipes/libnghttp2/all/patches/fix-findLibevent.cmake +++ /dev/null @@ -1,11 +0,0 @@ ---- cmake/FindLibevent.cmake -+++ cmake/FindLibevent.cmake -@@ -35,7 +35,7 @@ - ) - - if(LIBEVENT_INCLUDE_DIR) -- set(_version_regex "^#define[ \t]+_EVENT_VERSION[ \t]+\"([^\"]+)\".*") -+ set(_version_regex "^#define[ \t]+EVENT__VERSION[ \t]+\"([^\"]+)\".*") - if(EXISTS "${LIBEVENT_INCLUDE_DIR}/event2/event-config.h") - # Libevent 2.0 - file(STRINGS "${LIBEVENT_INCLUDE_DIR}/event2/event-config.h" diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index 80c7ccd82ad1ff..9868faae8fd3c2 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,4 +1,10 @@ versions: + "1.58.0": + folder: all + "1.57.0": + folder: all + "1.56.0": + folder: all "1.55.1": folder: all "1.55.0": @@ -11,11 +17,3 @@ versions: folder: all "1.50.0": folder: all - "1.49.0": - folder: all - "1.48.0": - folder: all - "1.47.0": - folder: all - "1.46.0": - folder: all diff --git a/recipes/libnice/all/conanfile.py b/recipes/libnice/all/conanfile.py index 5fd9fcdbbc036c..e35ebe0fd79254 100644 --- a/recipes/libnice/all/conanfile.py +++ b/recipes/libnice/all/conanfile.py @@ -5,8 +5,10 @@ from conan.tools.layout import basic_layout from conan.tools.gnu import PkgConfigDeps from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.apple import fix_apple_shared_install_name from conan.errors import ConanInvalidConfiguration +required_conan_version = ">=1.60.0 <2 || >=2.0.6" class LibniceConan(ConanFile): name = "libnice" @@ -59,16 +61,16 @@ def validate(self): "-o glib/*:shared=True with static runtime is not supported") def requirements(self): - self.requires("glib/2.75.2") + self.requires("glib/2.78.1", transitive_headers=True, transitive_libs=True) if self.options.crypto_library == "openssl": - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") if self.options.with_gstreamer: - self.requires("gstreamer/1.19.2") + self.requires("gstreamer/1.22.3") def build_requirements(self): - self.tool_requires("meson/1.0.0") - self.tool_requires("pkgconf/1.9.3") - self.tool_requires("glib/2.75.2") # for glib-mkenums + 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") @@ -107,6 +109,7 @@ def package(self): if not self.options.shared: with chdir(self, os.path.join(self.package_folder, "lib")): rename(self, "libnice.a", "nice.lib") + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["nice"] diff --git a/recipes/libnice/all/test_package/conanfile.py b/recipes/libnice/all/test_package/conanfile.py index 22dd4e9d14ebe5..a91756abf0bec7 100644 --- a/recipes/libnice/all/test_package/conanfile.py +++ b/recipes/libnice/all/test_package/conanfile.py @@ -1,7 +1,6 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake -from conan.tools.layout import cmake_layout +from conan.tools.cmake import CMake, cmake_layout from conan.tools.build import can_run diff --git a/recipes/libnice/all/test_v1_package/conanfile.py b/recipes/libnice/all/test_v1_package/conanfile.py index 8c9580d2d52b25..ecf464197e0a59 100644 --- a/recipes/libnice/all/test_v1_package/conanfile.py +++ b/recipes/libnice/all/test_v1_package/conanfile.py @@ -1,7 +1,5 @@ import os -from conan import ConanFile -from conans import CMake -from conan.tools.build import can_run +from conans import ConanFile, CMake, tools class LibniceTestConan(ConanFile): @@ -14,6 +12,6 @@ def build(self): cmake.build() def test(self): - if can_run(self): + if not tools.cross_building(self): bin_path = os.path.join("bin", "example") self.run(bin_path, run_environment=True) diff --git a/recipes/libnl/all/conandata.yml b/recipes/libnl/all/conandata.yml index cf3856e1f84ca3..c4437c5cec3bc6 100644 --- a/recipes/libnl/all/conandata.yml +++ b/recipes/libnl/all/conandata.yml @@ -1,7 +1,10 @@ sources: + "3.8.0": + url: "https://github.com/thom311/libnl/releases/download/libnl3_8_0/libnl-3.8.0.tar.gz" + sha256: "bb726c6d7a08b121978d73ff98425bf313fa26a27a331d465e4f1d7ec5b838c6" "3.7.0": - sha256: 9fe43ccbeeea72c653bdcf8c93332583135cda46a79507bfd0a483bb57f65939 - url: https://github.com/thom311/libnl/releases/download/libnl3_7_0/libnl-3.7.0.tar.gz + url: "https://github.com/thom311/libnl/releases/download/libnl3_7_0/libnl-3.7.0.tar.gz" + sha256: "9fe43ccbeeea72c653bdcf8c93332583135cda46a79507bfd0a483bb57f65939" "3.2.25": - sha256: 8beb7590674957b931de6b7f81c530b85dc7c1ad8fbda015398bc1e8d1ce8ec5 - url: https://github.com/thom311/libnl/releases/download/libnl3_2_25/libnl-3.2.25.tar.gz + url: "https://github.com/thom311/libnl/releases/download/libnl3_2_25/libnl-3.2.25.tar.gz" + sha256: "8beb7590674957b931de6b7f81c530b85dc7c1ad8fbda015398bc1e8d1ce8ec5" diff --git a/recipes/libnl/all/conanfile.py b/recipes/libnl/all/conanfile.py index 2dd67d7ee45afd..a355e8b21201e2 100644 --- a/recipes/libnl/all/conanfile.py +++ b/recipes/libnl/all/conanfile.py @@ -7,38 +7,42 @@ required_conan_version = ">=1.53.0" - class LibNlConan(ConanFile): name = "libnl" description = "A collection of libraries providing APIs to netlink protocol based Linux kernel interfaces." - topics = ("netlink") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://www.infradead.org/~tgr/libnl/" license = "LGPL-2.1-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/thom311/libnl" + topics = ("netlink") settings = "os", "arch", "compiler", "build_type" - options = {"fPIC": [True, False], "shared": [True, False]} - default_options = {"fPIC": True, "shared": False} - - def build_requirements(self): - self.tool_requires("bison/3.8.2") - self.tool_requires("flex/2.6.4") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - # This is a pure C library self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + def layout(self): + basic_layout(self, src_folder="src") + def validate(self): if self.settings.os != "Linux": - raise ConanInvalidConfiguration("Libnl is only supported on Linux") + raise ConanInvalidConfiguration(f"{self.ref} is only supported on Linux") - def layout(self): - basic_layout(self, src_folder="src") + def build_requirements(self): + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = AutotoolsToolchain(self) @@ -61,8 +65,7 @@ def package(self): def package_info(self): self.cpp_info.components["nl"].libs = ["nl-3"] self.cpp_info.components["nl"].includedirs = [os.path.join('include', 'libnl3')] - if self.settings.os != "Windows": - self.cpp_info.components["nl"].system_libs = ["pthread", "m"] + self.cpp_info.components["nl"].system_libs = ["pthread", "m"] self.cpp_info.components["nl-route"].libs = ["nl-route-3"] self.cpp_info.components["nl-route"].requires = ["nl"] self.cpp_info.components["nl-genl"].libs = ["nl-genl-3"] @@ -71,7 +74,6 @@ def package_info(self): self.cpp_info.components["nl-nf"].requires = ["nl-route"] self.cpp_info.components["nl-cli"].libs = ["nl-cli-3"] self.cpp_info.components["nl-cli"].requires = ["nl-nf", "nl-genl"] - if self.settings.os != "Windows": - self.cpp_info.components["nl-cli"].system_libs = ["dl"] + self.cpp_info.components["nl-cli"].system_libs = ["dl"] self.cpp_info.components["nl-idiag"].libs = ["nl-idiag-3"] self.cpp_info.components["nl-idiag"].requires = ["nl"] diff --git a/recipes/libnl/config.yml b/recipes/libnl/config.yml index 3901cc1eb7ac99..20abb72c5e1b94 100644 --- a/recipes/libnl/config.yml +++ b/recipes/libnl/config.yml @@ -1,4 +1,6 @@ versions: + 3.8.0: + folder: all 3.7.0: folder: all 3.2.25: diff --git a/recipes/libnpy/all/conandata.yml b/recipes/libnpy/all/conandata.yml new file mode 100644 index 00000000000000..f7c435c55da391 --- /dev/null +++ b/recipes/libnpy/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.1": + url: "https://github.com/llohse/libnpy/archive/refs/tags/v1.0.1.tar.gz" + sha256: "43452a4db1e8c1df606c64376ea1e32789124051d7640e7e4e8518ab4f0fba44" diff --git a/recipes/libnpy/all/conanfile.py b/recipes/libnpy/all/conanfile.py new file mode 100644 index 00000000000000..1a453076924de6 --- /dev/null +++ b/recipes/libnpy/all/conanfile.py @@ -0,0 +1,68 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +import os + +required_conan_version = ">=1.52.0" + +class LibNPYConan(ConanFile): + name = "libnpy" + description = "C++ library for reading and writing of numpy's .npy files" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/llohse/libnpy" + topics = ("python", "numpy", "npy", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + # Author didn't explicitly make it C++11 compatible, but turns out it is, + # maybe this changes in a future version but for now it's set to C++11 + # See https://github.com/llohse/libnpy/issues/35#issuecomment-1727327678 + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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 does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.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.libdirs = [] diff --git a/recipes/libnpy/all/test_package/CMakeLists.txt b/recipes/libnpy/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d8ff7a7d074355 --- /dev/null +++ b/recipes/libnpy/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(libnpy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libnpy::libnpy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/libnpy/all/test_package/conanfile.py b/recipes/libnpy/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/libnpy/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/libnpy/all/test_package/test_package.cpp b/recipes/libnpy/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..896ab340a0523a --- /dev/null +++ b/recipes/libnpy/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include "npy.hpp" +#include +#include + +int main() { + const std::vector data{1, 2, 3, 4, 5, 6}; + + npy::npy_data d; + d.data = data; + d.shape = {2, 3}; + d.fortran_order = false; + + const std::string path{"out.npy"}; + npy::write_npy(path, d); +} diff --git a/recipes/libnpy/config.yml b/recipes/libnpy/config.yml new file mode 100644 index 00000000000000..715e55357a17be --- /dev/null +++ b/recipes/libnpy/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/liboping/all/conandata.yml b/recipes/liboping/all/conandata.yml index 383d4f884713fa..a9da5ce81e6952 100644 --- a/recipes/liboping/all/conandata.yml +++ b/recipes/liboping/all/conandata.yml @@ -5,5 +5,3 @@ sources: patches: "1.10.0": - patch_file: "patches/1.10.0-suppress_truncate.patch" - base_path: "source_subfolder" - diff --git a/recipes/liboping/all/conanfile.py b/recipes/liboping/all/conanfile.py index 21125770e672e3..811729afcf6e25 100644 --- a/recipes/liboping/all/conanfile.py +++ b/recipes/liboping/all/conanfile.py @@ -1,19 +1,26 @@ -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, fix_apple_shared_install_name +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +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.47.0" class LibopingConan(ConanFile): name = "liboping" description = "A multi server ping library" - topics = ("oping", "ping", "icmp") + license = ["LGPL-2.1", "GPL-2.0"] url = "https://github.com/conan-io/conan-center-index" homepage = "https://noping.cc" - license = ["LGPL-2.1", "GPL-2.0"] + topics = ("oping", "ping", "icmp", "pre-built") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - exports_sources = ["patches/**"] options = { "shared": [True, False], "fPIC": [True, False], @@ -23,81 +30,77 @@ class LibopingConan(ConanFile): "fPIC": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + 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: - 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 validate(self): - if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("liboping is not supported by Visual Studio") if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Liboping could not be built on {} as shared library".format(self.settings.os)) - if self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration( + f"Liboping could not be built on {self.settings.os} as shared library" + ) + if is_apple_os(self) and self.settings.arch == "armv8": # Build error - NO Access to a Mac/M1 - please fix when possible - see issue 8634 raise ConanInvalidConfiguration("Liboping cannot be built on a Mac/M1 at this time") 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_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) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - 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)), + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args += [ "--without-ncurses", "--without-perl-bindings", ] - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + tc.generate() def build(self): - self._patch_sources() - autotools = self._configure_autotools() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + autotools = Autotools(self) autotools.install() - - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) 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.libs = ["oping"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") elif self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") + + # TODO: Legacy, to be removed on Conan 2.0 + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) diff --git a/recipes/liboping/all/test_package/CMakeLists.txt b/recipes/liboping/all/test_package/CMakeLists.txt index 30961cdb0ded2e..76c10855ad585b 100644 --- a/recipes/liboping/all/test_package/CMakeLists.txt +++ b/recipes/liboping/all/test_package/CMakeLists.txt @@ -1,10 +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(TARGETS) - -find_package(liboping CONFIG REQUIRED) +find_package(liboping REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} liboping::liboping) diff --git a/recipes/liboping/all/test_package/conanfile.py b/recipes/liboping/all/test_package/conanfile.py index b7bbf79eba926c..ef5d7042163ecc 100644 --- a/recipes/liboping/all/test_package/conanfile.py +++ b/recipes/liboping/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", "arch", "build_type" - 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,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/liboping/all/test_v1_package/CMakeLists.txt b/recipes/liboping/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/liboping/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/liboping/all/test_v1_package/conanfile.py b/recipes/liboping/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..b7bbf79eba926c --- /dev/null +++ b/recipes/liboping/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "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) 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/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py index f8d672f0bb237c..f5410a3afa2d7a 100644 --- a/recipes/libpng/all/conanfile.py +++ b/recipes/libpng/all/conanfile.py @@ -92,7 +92,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if Version(self.version) < "1.6" and self.settings.arch == "armv8" and is_apple_os(self): diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml index eef5fefc1dd9a2..862caa7abf5418 100644 --- a/recipes/libpq/all/conandata.yml +++ b/recipes/libpq/all/conandata.yml @@ -1,64 +1,58 @@ sources: + "15.4": + url: "https://ftp.postgresql.org/pub/source/v15.4/postgresql-15.4.tar.bz2" + sha256: "baec5a4bdc4437336653b6cb5d9ed89be5bd5c0c58b94e0becee0a999e63c8f9" "15.3": url: "https://ftp.postgresql.org/pub/source/v15.3/postgresql-15.3.tar.bz2" sha256: "ffc7d4891f00ffbf5c3f4eab7fbbced8460b8c0ee63c5a5167133b9e6599d932" - "14.8": - url: "https://ftp.postgresql.org/pub/source/v14.8/postgresql-14.8.tar.bz2" - sha256: "39d38f0030737ed03835debeefee3b37d335462ce4995e2497bc38d621ebe45a" - "14.7": - url: "https://ftp.postgresql.org/pub/source/v14.7/postgresql-14.7.tar.bz2" - sha256: "cef60f0098fa8101c1546f4254e45b722af5431337945b37af207007630db331" - "14.5": - url: "https://ftp.postgresql.org/pub/source/v14.5/postgresql-14.5.tar.bz2" - sha256: "d4f72cb5fb857c9a9f75ec8cf091a1771272802f2178f0b2e65b7b6ff64f4a30" - "14.2": - url: "https://ftp.postgresql.org/pub/source/v14.2/postgresql-14.2.tar.bz2" - sha256: "2cf78b2e468912f8101d695db5340cf313c2e9f68a612fb71427524e8c9a977a" - "13.6": - url: "https://ftp.postgresql.org/pub/source/v13.6/postgresql-13.6.tar.gz" - sha256: "42dcde620b627d35bf51dfc2c1d0f7f25f44d3dbedd81cc459da2d2c9e859059" - "12.10": - url: "https://ftp.postgresql.org/pub/source/v12.10/postgresql-12.10.tar.gz" - sha256: "987e008699d52d5de4bae0580416f6c75aa28016b11543c42f5fbde5efbdfb56" - "11.15": - url: "https://ftp.postgresql.org/pub/source/v11.15/postgresql-11.15.tar.gz" - sha256: "5f6ef2add1acb93d69012a55c3f276b91f4f0c91aa9a91243d9c5737ed5b5541" - "10.20": - url: "https://ftp.postgresql.org/pub/source/v10.20/postgresql-10.20.tar.gz" - sha256: "403bdad47101f7c0a15824627dd0fa0ad4abf1fa26d2bde77dea8921da25a48e" + "14.9": + url: "https://ftp.postgresql.org/pub/source/v14.9/postgresql-14.9.tar.bz2" + sha256: "b1fe3ba9b1a7f3a9637dd1656dfdad2889016073fd4d35f13b50143cbbb6a8ef" + "13.12": + url: "https://ftp.postgresql.org/pub/source/v13.12/postgresql-13.12.tar.gz" + sha256: "3aef84ff557087bd01df4365a7a85e11678faa55ab6fb6c4283d57e41997a80c" + "12.16": + url: "https://ftp.postgresql.org/pub/source/v12.16/postgresql-12.16.tar.gz" + sha256: "5cca6efb649bce91d9b3637f935ce8714a86b87b3b1092010f50349a6edde0e9" + "11.21": + url: "https://ftp.postgresql.org/pub/source/v11.21/postgresql-11.21.tar.gz" + sha256: "e48b5d5dc68cd5549ef6258facaaf7941ae8bd1cde56709203846167aa20af04" + "10.23": + url: "https://ftp.postgresql.org/pub/source/v10.23/postgresql-10.23.tar.gz" + sha256: "39886b7fbf375fdd79e94b676d8346a62c3c190ccf00b3f763002c8fc8fb71f0" "9.6.24": url: "https://ftp.postgresql.org/pub/source/v9.6.24/postgresql-9.6.24.tar.gz" sha256: "52947ecc119846eace5164399d173576c0d4a47ec116ae58a46a8fd0c576c7c3" patches: - "14.7": - - patch_file: "patches/14.7/002-mingw-build-static-libraries.patch" + "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" - "14.5": - - patch_file: "patches/14.5/002-mingw-build-static-libraries.patch" + "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.2": - - patch_file: "patches/14.2/002-mingw-build-static-libraries.patch" + "14.9": + - patch_file: "patches/13/002-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." patch_type: "portability" - "13.6": - - patch_file: "patches/13.6/002-mingw-build-static-libraries.patch" + "13.12": + - patch_file: "patches/13/002-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." patch_type: "portability" - "12.10": - - patch_file: "patches/12.10/002-mingw-build-static-libraries.patch" + "12.16": + - patch_file: "patches/12/002-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." patch_type: "portability" - "11.15": - - patch_file: "patches/11.15/002-mingw-build-static-libraries.patch" + "11.21": + - patch_file: "patches/10/002-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." patch_type: "portability" - "10.20": - - patch_file: "patches/10.20/002-mingw-build-static-libraries.patch" + "10.23": + - patch_file: "patches/10/002-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." patch_type: "portability" "9.6.24": - - patch_file: "patches/9.6.24/002-mingw-build-static-libraries.patch" + - patch_file: "patches/9.6/002-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." patch_type: "portability" diff --git a/recipes/libpq/all/conanfile.py b/recipes/libpq/all/conanfile.py index b4e66be74d3631..53f51b549f74e9 100644 --- a/recipes/libpq/all/conanfile.py +++ b/recipes/libpq/all/conanfile.py @@ -65,7 +65,10 @@ def layout(self): def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1t") + if Version(self.version) < "13.5": + self.requires("openssl/1.1.1w") + else: + self.requires("openssl/[>=1.1 <4]") def build_requirements(self): if is_msvc(self): diff --git a/recipes/libpq/all/patches/10.20/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/10/002-mingw-build-static-libraries.patch similarity index 100% rename from recipes/libpq/all/patches/10.20/002-mingw-build-static-libraries.patch rename to recipes/libpq/all/patches/10/002-mingw-build-static-libraries.patch diff --git a/recipes/libpq/all/patches/11.15/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/11.15/002-mingw-build-static-libraries.patch deleted file mode 100644 index bfa322133c73cd..00000000000000 --- a/recipes/libpq/all/patches/11.15/002-mingw-build-static-libraries.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -371,7 +371,10 @@ else - # Win32 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 $@ - - # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit -@@ -384,12 +387,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 - endif - - endif # PORTNAME == cygwin -@@ -484,6 +487,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/libpq/all/patches/12.10/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/12/002-mingw-build-static-libraries.patch similarity index 100% rename from recipes/libpq/all/patches/12.10/002-mingw-build-static-libraries.patch rename to recipes/libpq/all/patches/12/002-mingw-build-static-libraries.patch diff --git a/recipes/libpq/all/patches/13.3/001-Remove-thread-safety-check.patch b/recipes/libpq/all/patches/13.3/001-Remove-thread-safety-check.patch deleted file mode 100644 index c650bf767f6d5c..00000000000000 --- a/recipes/libpq/all/patches/13.3/001-Remove-thread-safety-check.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff --git a/configure b/configure -index cbbaf77..f723154 100755 ---- a/configure -+++ b/configure -@@ -18836,60 +18836,6 @@ fi - fi - fi - --# Thread testing -- --# We have to run the thread test near the end so we have all our symbols --# defined. Cross compiling throws a warning. --# --if test "$enable_thread_safety" = yes; then --if test "$PORTNAME" != "win32" --then --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking thread safety of required library functions" >&5 --$as_echo_n "checking thread safety of required library functions... " >&6; } -- --_CFLAGS="$CFLAGS" --_LIBS="$LIBS" --CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE" --LIBS="$LIBS $PTHREAD_LIBS" --if test "$cross_compiling" = yes; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: maybe" >&5 --$as_echo "maybe" >&6; } -- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --*** Skipping thread test program because of cross-compile build. --*** Run the program in src/test/thread on the target machine. --" >&5 --$as_echo "$as_me: WARNING: --*** Skipping thread test program because of cross-compile build. --*** Run the program in src/test/thread on the target machine. --" >&2;} --else -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ --#include "$srcdir/src/test/thread/thread_test.c" --_ACEOF --if ac_fn_c_try_run "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- as_fn_error $? "thread test program failed --This platform is not thread-safe. Check the file 'config.log' or compile --and run src/test/thread/thread_test for the exact reason. --Use --disable-thread-safety to disable thread safety." "$LINENO" 5 --fi --rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -- conftest.$ac_objext conftest.beam conftest.$ac_ext --fi -- --CFLAGS="$_CFLAGS" --LIBS="$_LIBS" --else --{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** skipping thread test on Win32" >&5 --$as_echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;} --fi --fi -- - # If compiler will take -Wl,--as-needed (or various platform-specific - # spellings thereof) then add that to LDFLAGS. This is much easier than - # trying to filter LIBS to the minimum for each executable. diff --git a/recipes/libpq/all/patches/13.6/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/13/002-mingw-build-static-libraries.patch similarity index 100% rename from recipes/libpq/all/patches/13.6/002-mingw-build-static-libraries.patch rename to recipes/libpq/all/patches/13/002-mingw-build-static-libraries.patch diff --git a/recipes/libpq/all/patches/14.2/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/14.2/002-mingw-build-static-libraries.patch deleted file mode 100644 index ce588507063738..00000000000000 --- a/recipes/libpq/all/patches/14.2/002-mingw-build-static-libraries.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -358,7 +358,10 @@ else - # Win32 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 $@ - - # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit -@@ -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') - -@@ -452,6 +455,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/libpq/all/patches/14.5/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/14.5/002-mingw-build-static-libraries.patch deleted file mode 100644 index ce588507063738..00000000000000 --- a/recipes/libpq/all/patches/14.5/002-mingw-build-static-libraries.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -358,7 +358,10 @@ else - # Win32 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 $@ - - # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit -@@ -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') - -@@ -452,6 +455,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/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch deleted file mode 100644 index ce588507063738..00000000000000 --- a/recipes/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -358,7 +358,10 @@ else - # Win32 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 $@ - - # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit -@@ -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') - -@@ -452,6 +455,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/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/libpq/all/patches/9.6.24/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/9.6/002-mingw-build-static-libraries.patch similarity index 100% rename from recipes/libpq/all/patches/9.6.24/002-mingw-build-static-libraries.patch rename to recipes/libpq/all/patches/9.6/002-mingw-build-static-libraries.patch diff --git a/recipes/libpq/all/test_package/CMakeLists.txt b/recipes/libpq/all/test_package/CMakeLists.txt index db0dafd7c09848..b9f4d7ab61bce5 100644 --- a/recipes/libpq/all/test_package/CMakeLists.txt +++ b/recipes/libpq/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(PostgreSQL REQUIRED) diff --git a/recipes/libpq/all/test_v1_package/CMakeLists.txt b/recipes/libpq/all/test_v1_package/CMakeLists.txt index de3b75d9538de0..2f11d9b196ef70 100644 --- a/recipes/libpq/all/test_v1_package/CMakeLists.txt +++ b/recipes/libpq/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 LANGUAGES C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/libpq/config.yml b/recipes/libpq/config.yml index bf80d539d9d1e2..e010db029229d5 100644 --- a/recipes/libpq/config.yml +++ b/recipes/libpq/config.yml @@ -1,21 +1,17 @@ versions: - "15.3": - folder: all - "14.8": + "15.4": folder: all - "14.7": - folder: all - "14.5": + "15.3": folder: all - "14.2": + "14.9": folder: all - "13.6": + "13.12": folder: all - "12.10": + "12.16": folder: all - "11.15": + "11.21": folder: all - "10.20": + "10.23": folder: all "9.6.24": folder: all diff --git a/recipes/libpqxx/all/conandata.yml b/recipes/libpqxx/all/conandata.yml index a8a8be54d6643c..dcbdf0b15a551b 100644 --- a/recipes/libpqxx/all/conandata.yml +++ b/recipes/libpqxx/all/conandata.yml @@ -1,25 +1,16 @@ sources: + "7.8.1": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.8.1.tar.gz" + sha256: "0f4c0762de45a415c9fd7357ce508666fa88b9a4a463f5fb76c235bc80dd6a84" + "7.8.0": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.8.0.tar.gz" + sha256: "bc471d8d34588f820f38e19e1cc217f399212eef900416cf12f90fab293628af" "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" @@ -29,52 +20,63 @@ 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" patches: - "7.7.5": - - patch_file: "patches/0001-cmake-fix-module.patch" - "7.7.4": - - patch_file: "patches/0001-cmake-fix-module.patch" - "7.7.3": + "7.8.1": - patch_file: "patches/0001-cmake-fix-module.patch" - "7.7.2": + patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." + patch_type: "conan" + "7.8.0": - patch_file: "patches/0001-cmake-fix-module.patch" - - patch_file: "patches/fix-install-library-symlink-7.7.2.patch" - "7.7.0": + patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." + patch_type: "conan" + - patch_file: "patches/fix-alternative-operator-error-7.8.0.patch" + patch_source: "https://github.com/jtv/libpqxx/pull/714" + patch_description: "Fix a bug undeclared identifier alternative operator." + patch_type: "bugfix" + "7.7.5": - patch_file: "patches/0001-cmake-fix-module.patch" - - patch_file: "patches/fix-clang-compilation-7.7.0.patch" + patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." + patch_type: "conan" "7.6.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/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" - "7.6.0": - - patch_file: "patches/0001-cmake-fix-module.patch" - - patch_file: "patches/fix-inline-constexpr-local-variable-problem-7.6.0.patch" - - 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." + patch_type: "conan" "7.4.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/stop-using-strnlen-7.4.2.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.3.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-msvc-compilation-7.3.1.patch" - "7.2.1": - - patch_file: "patches/0001-cmake-fix-module.patch" - "7.1.2": - - patch_file: "patches/0001-cmake-fix-module.patch" - "7.0.7": - - patch_file: "patches/0001-cmake-fix-module.patch" - - patch_file: "patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch" + patch_source: "https://github.com/jtv/libpqxx/pull/406" + patch_description: "Fix a bug that syntax error on Visual Studio 2017" + patch_type: "bugfix" + - patch_file: "patches/stop-using-strnlen-7.3.2.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" "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." + patch_type: "conan" diff --git a/recipes/libpqxx/all/conanfile.py b/recipes/libpqxx/all/conanfile.py index ef9bfe326bc0ae..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"): @@ -104,6 +104,12 @@ def generate(self): tc.variables["BUILD_TEST"] = False # Set `-mmacosx-version-min` to enable C++17 standard library support. tc.variables["CMAKE_OSX_DEPLOYMENT_TARGET"] = self._mac_os_minimum_required_version + if Version(self.version) < "7.0": + if self.options.shared: + tc.variables["SKIP_PQXX_STATIC"] = True + else: + tc.variables["SKIP_PQXX_SHARED"] = True + tc.generate() deps = CMakeDeps(self) diff --git a/recipes/libpqxx/all/patches/fix-alternative-operator-error-7.8.0.patch b/recipes/libpqxx/all/patches/fix-alternative-operator-error-7.8.0.patch new file mode 100644 index 00000000000000..9a792a2cc015e3 --- /dev/null +++ b/recipes/libpqxx/all/patches/fix-alternative-operator-error-7.8.0.patch @@ -0,0 +1,24 @@ +Fix a bug undeclared identifier alternative operator (https://github.com/jtv/libpqxx/pull/714) +diff --git a/include/pqxx/internal/header-pre.hxx b/include/pqxx/internal/header-pre.hxx +index 595a53b4..9d4c60e7 100644 +--- a/include/pqxx/internal/header-pre.hxx ++++ b/include/pqxx/internal/header-pre.hxx +@@ -58,6 +58,18 @@ + // Workarounds & definitions that need to be included even in library's headers + #include "pqxx/config-public-compiler.h" + ++#if defined(_MSC_VER) ++# define PQXX_CPLUSPLUS _MSVC_LANG ++#else ++# define PQXX_CPLUSPLUS __cplusplus ++#endif ++ ++// C++20: No longer needed. ++// Enable ISO-646 alternative operaotr representations: "and" instead of "&&" ++// etc. on older compilers. C++20 removes this header. ++#if PQXX_CPLUSPLUS <= 201703L && __has_include() ++# include ++#endif + + #if defined(PQXX_HAVE_GCC_PURE) + /// Declare function "pure": no side effects, only reads globals and its args. 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.3.2.patch b/recipes/libpqxx/all/patches/stop-using-strnlen-7.3.2.patch new file mode 100644 index 00000000000000..5602c77e030c69 --- /dev/null +++ b/recipes/libpqxx/all/patches/stop-using-strnlen-7.3.2.patch @@ -0,0 +1,28 @@ +diff --git a/src/strconv.cxx b/src/strconv.cxx +index d82e5c53..ee1628ff 100644 +--- a/src/strconv.cxx ++++ b/src/strconv.cxx +@@ -264,18 +264,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/all/patches/stop-using-strnlen-7.4.2.patch b/recipes/libpqxx/all/patches/stop-using-strnlen-7.4.2.patch new file mode 100644 index 00000000000000..0c628fb55fdff3 --- /dev/null +++ b/recipes/libpqxx/all/patches/stop-using-strnlen-7.4.2.patch @@ -0,0 +1,28 @@ +diff --git a/src/strconv.cxx b/src/strconv.cxx +index ea4d3c82..08d645eb 100644 +--- a/src/strconv.cxx ++++ b/src/strconv.cxx +@@ -264,18 +264,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 96d5c5cc009569..9d72f7f742ccbb 100644 --- a/recipes/libpqxx/config.yml +++ b/recipes/libpqxx/config.yml @@ -1,29 +1,17 @@ versions: - "7.7.5": - folder: all - "7.7.4": + "7.8.1": folder: all - "7.7.3": + "7.8.0": folder: all - "7.7.2": - folder: all - "7.7.0": + "7.7.5": 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/libpsl/all/conanfile.py b/recipes/libpsl/all/conanfile.py index ec026aac098e8e..0de3f9766ed38f 100644 --- a/recipes/libpsl/all/conanfile.py +++ b/recipes/libpsl/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): def requirements(self): if self.options.with_idna == "icu": - self.requires("icu/72.1") + self.requires("icu/73.2") elif self.options.with_idna == "libidn": self.requires("libidn/1.36") elif self.options.with_idna == "libidn2": @@ -57,9 +57,9 @@ def requirements(self): self.requires("libunistring/0.9.10") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.2.1") 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/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/librdkafka/all/conandata.yml b/recipes/librdkafka/all/conandata.yml index 79827450beb2cd..bf7c468b0c4c11 100644 --- a/recipes/librdkafka/all/conandata.yml +++ b/recipes/librdkafka/all/conandata.yml @@ -1,92 +1,42 @@ sources: + "2.3.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.3.0.tar.gz" + sha256: "2d49c35c77eeb3d42fa61c43757fcbb6a206daa560247154e60642bcdcc14d12" + "2.2.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.2.0.tar.gz" + sha256: "af9a820cbecbc64115629471df7c7cecd40403b6c34bfdbb9223152677a47226" "2.0.2": url: "https://github.com/edenhill/librdkafka/archive/v2.0.2.tar.gz" sha256: "f321bcb1e015a34114c83cf1aa7b99ee260236aab096b85c003170c90a47ca9d" "1.9.2": url: "https://github.com/edenhill/librdkafka/archive/v1.9.2.tar.gz" sha256: "3fba157a9f80a0889c982acdd44608be8a46142270a389008b22d921be1198ad" - "1.9.1": - url: "https://github.com/edenhill/librdkafka/archive/v1.9.1.tar.gz" - sha256: "3a54cf375218977b7af4716ed9738378e37fe400a6c5ddb9d622354ca31fdc79" - "1.8.2": - url: "https://github.com/edenhill/librdkafka/archive/v1.8.2.tar.gz" - sha256: "6a747d293a7a4613bd2897e28e8791476fbe1ae7361f2530a876e0fd483482a6" - "1.8.0": - url: "https://github.com/edenhill/librdkafka/archive/v1.8.0.tar.gz" - sha256: "93b12f554fa1c8393ce49ab52812a5f63e264d9af6a50fd6e6c318c481838b7f" - "1.7.0": - url: "https://github.com/edenhill/librdkafka/archive/v1.7.0.tar.gz" - sha256: "c71b8c5ff419da80c31bb8d3036a408c87ad523e0c7588e7660ee5f3c8973057" - "1.6.1": - url: "https://github.com/edenhill/librdkafka/archive/v1.6.1.tar.gz" - sha256: "689028b5fdfdce026f396fc2f3bfe9e38947210d9bd22be28c3159cc8c41b57e" - "1.6.0": - url: "https://github.com/edenhill/librdkafka/archive/v1.6.0.tar.gz" - sha256: "3130cbd391ef683dc9acf9f83fe82ff93b8730a1a34d0518e93c250929be9f6b" - "1.5.3": - url: "https://github.com/edenhill/librdkafka/archive/v1.5.3.tar.gz" - sha256: "2105ca01fef5beca10c9f010bc50342b15d5ce6b73b2489b012e6d09a008b7bf" patches: - "2.0.2": + "2.3.0": - patch_file: patches/0001-Change-library-names-1-9-1.patch patch_description: "find_package conan packages" patch_type: "conan" - - patch_file: patches/0002-Change-library-targets-and-result-variables-2-0-2.patch + - patch_file: patches/0002-Change-library-targets-and-result-variables-2-3-0.patch patch_description: "refer conan package names" patch_type: "conan" - "1.9.2": + "2.2.0": - patch_file: patches/0001-Change-library-names-1-9-1.patch patch_description: "find_package conan packages" patch_type: "conan" - - patch_file: patches/0002-Change-library-targets-and-result-variables-1-9-1.patch + - patch_file: patches/0002-Change-library-targets-and-result-variables-2-0-2.patch patch_description: "refer conan package names" patch_type: "conan" - "1.9.1": + "2.0.2": - patch_file: patches/0001-Change-library-names-1-9-1.patch patch_description: "find_package conan packages" patch_type: "conan" - - patch_file: patches/0002-Change-library-targets-and-result-variables-1-9-1.patch - patch_description: "refer conan package names" - patch_type: "conan" - "1.8.2": - - patch_file: patches/0001-Change-library-names-1-7-0.patch - patch_description: "find_package conan packages" - patch_type: "conan" - - patch_file: patches/0002-Change-library-targets-and-result-variables-1-7-0.patch - patch_description: "refer conan package names" - patch_type: "conan" - "1.8.0": - - patch_file: patches/0001-Change-library-names-1-7-0.patch - patch_description: "find_package conan packages" - patch_type: "conan" - - patch_file: patches/0002-Change-library-targets-and-result-variables-1-7-0.patch + - patch_file: patches/0002-Change-library-targets-and-result-variables-2-0-2.patch patch_description: "refer conan package names" patch_type: "conan" - "1.7.0": - - patch_file: patches/0001-Change-library-names-1-7-0.patch + "1.9.2": + - patch_file: patches/0001-Change-library-names-1-9-1.patch patch_description: "find_package conan packages" patch_type: "conan" - - patch_file: patches/0002-Change-library-targets-and-result-variables-1-7-0.patch - patch_description: "refer conan package names" - patch_type: "conan" - "1.6.1": - - patch_file: patches/0001-Change-library-names-1-5-2.patch - patch_description: "find_package conan packages, link sasl libraries" - patch_type: "conan" - - patch_file: patches/0002-Change-library-targets-and-result-variables-1-6-1.patch - patch_description: "refer conan package names" - patch_type: "conan" - "1.6.0": - - patch_file: patches/0001-Change-library-names-1-5-2.patch - patch_description: "find_package conan packages, link sasl libraries" - patch_type: "conan" - - patch_file: patches/0002-Change-library-targets-and-result-variables-1-6-0.patch - patch_description: "refer conan package names" - patch_type: "conan" - "1.5.3": - - patch_file: patches/0001-Change-library-names-1-5-2.patch - patch_description: "find_package conan packages, link sasl libraries" - patch_type: "conan" - - patch_file: patches/0002-Change-library-targets-and-result-variables-1-5-2.patch + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-9-1.patch patch_description: "refer conan package names" patch_type: "conan" diff --git a/recipes/librdkafka/all/conanfile.py b/recipes/librdkafka/all/conanfile.py index fbd6361872d879..cd2ea0b4f86306 100644 --- a/recipes/librdkafka/all/conanfile.py +++ b/recipes/librdkafka/all/conanfile.py @@ -1,7 +1,8 @@ from conan import ConanFile 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, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc from conan.tools.gnu import PkgConfigDeps from conan.tools.scm import Version import os @@ -52,8 +53,6 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) < "1.9.0": - del self.options.curl def configure(self): if self.options.shared: @@ -65,19 +64,19 @@ def layout(self): def requirements(self): self.requires("lz4/1.9.4") if self.options.zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.zstd: self.requires("zstd/1.5.5") if self.options.ssl: self.requires("openssl/[>=1.1 <4]") if self._depends_on_cyrus_sasl: self.requires("cyrus-sasl/2.1.27") - if self.options.get_safe("curl", False): - self.requires("libcurl/8.0.1") + if self.options.curl: + self.requires("libcurl/[>=7.78.0 <9]") def build_requirements(self): if self._depends_on_cyrus_sasl: - 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) @@ -113,6 +112,12 @@ def generate(self): def build(self): apply_conandata_patches(self) + # There are references to libcrypto.lib and libssl.lib in rdkafka_ssl.c for versions >= 1.8.0 + if Version(self.version) >= "1.8.0" and is_msvc(self) and \ + self.settings.build_type == "Debug" and self.options.get_safe("ssl", False): + rdkafka_ssl_path = os.path.join(self.source_folder, "src", "rdkafka_ssl.c") + replace_in_file(self, rdkafka_ssl_path, "libcrypto.lib", "libcryptod.lib") + replace_in_file(self, rdkafka_ssl_path, "libssl.lib", "libssld.lib") cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/librdkafka/all/patches/0001-Change-library-names-1-5-2.patch b/recipes/librdkafka/all/patches/0001-Change-library-names-1-5-2.patch deleted file mode 100644 index 63c4787d111f34..00000000000000 --- a/recipes/librdkafka/all/patches/0001-Change-library-names-1-5-2.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -54,7 +54,7 @@ endif() - # } - - # ZSTD { --find_package(ZSTD QUIET) -+find_package(zstd QUIET CONFIG) - if(ZSTD_FOUND) - set(with_zstd_default ON) - else() -@@ -133,6 +133,9 @@ else() - endif() - option(WITH_SASL "With SASL" ${with_sasl_default}) - if(WITH_SASL) -+ if(SASL_FOUND) -+ link_directories(${SASL_LIBRARY_DIRS}) -+ endif() - if(WITH_SSL) - set(WITH_SASL_SCRAM ON) - set(WITH_SASL_OAUTHBEARER ON) -@@ -149,7 +152,8 @@ endif() - option(ENABLE_LZ4_EXT "Enable external LZ4 library support" ON) - set(WITH_LZ4_EXT OFF) - if(ENABLE_LZ4_EXT) -- find_package(LZ4) -+ find_package(lz4 REQUIRED CONFIG) -+ set(LZ4_FOUND ON) - if(LZ4_FOUND) - set(WITH_LZ4_EXT ON) - list(APPEND BUILT_WITH "LZ4_EXT") diff --git a/recipes/librdkafka/all/patches/0001-Change-library-names-1-7-0.patch b/recipes/librdkafka/all/patches/0001-Change-library-names-1-7-0.patch deleted file mode 100644 index 966ba38247ca44..00000000000000 --- a/recipes/librdkafka/all/patches/0001-Change-library-names-1-7-0.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 07bd30c67a532be3c1f31aa383a1061c832a034d Mon Sep 17 00:00:00 2001 -From: Alejandro Colomar -Date: Sun, 30 May 2021 11:02:57 +0200 -Subject: [PATCH] Change library names - ---- - CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d1129bce..14d9e7f0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -54,7 +54,7 @@ endif() - # } - - # ZSTD { --find_package(ZSTD QUIET) -+find_package(zstd QUIET CONFIG) - if(ZSTD_FOUND) - set(with_zstd_default ON) - else() -@@ -152,7 +152,8 @@ endif() - option(ENABLE_LZ4_EXT "Enable external LZ4 library support" ON) - set(WITH_LZ4_EXT OFF) - if(ENABLE_LZ4_EXT) -- find_package(LZ4) -+ find_package(lz4 REQUIRED CONFIG) -+ set(LZ4_FOUND ON) - if(LZ4_FOUND) - set(WITH_LZ4_EXT ON) - list(APPEND BUILT_WITH "LZ4_EXT") --- -2.32.0.rc0 - diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-5-2.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-5-2.patch deleted file mode 100644 index 2c6f62c68a4789..00000000000000 --- a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-5-2.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -209,9 +209,7 @@ if(WITH_ZLIB) - endif() - - if(WITH_ZSTD) -- target_link_libraries(rdkafka PUBLIC ${ZSTD_LIBRARY}) -- target_include_directories(rdkafka PUBLIC ${ZSTD_INCLUDE_DIR}) -- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") -+ target_link_libraries(rdkafka PUBLIC $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - - if(WITH_SSL) -@@ -246,8 +244,7 @@ if(WITH_LIBDL) - endif() - - if(WITH_LZ4_EXT) -- target_include_directories(rdkafka PUBLIC ${LZ4_INCLUDE_DIRS}) -- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) -+ target_link_libraries(rdkafka PUBLIC lz4::lz4) - endif() - - # Set up path to these sources for other sub-projects (tests, examples) diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-0.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-0.patch deleted file mode 100644 index 71155e468786f8..00000000000000 --- a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-0.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -212,9 +212,7 @@ if(WITH_ZLIB) - endif() - - if(WITH_ZSTD) -- target_link_libraries(rdkafka PUBLIC ${ZSTD_LIBRARY}) -- target_include_directories(rdkafka PUBLIC ${ZSTD_INCLUDE_DIR}) -- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") -+ target_link_libraries(rdkafka PUBLIC $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - - if(WITH_SSL) -@@ -249,8 +247,7 @@ if(WITH_LIBDL) - endif() - - if(WITH_LZ4_EXT) -- target_include_directories(rdkafka PUBLIC ${LZ4_INCLUDE_DIRS}) -- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) -+ target_link_libraries(rdkafka PUBLIC lz4::lz4) - endif() - - # Set up path to these sources for other sub-projects (tests, examples) diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-1.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-1.patch deleted file mode 100644 index 0a478997b23736..00000000000000 --- a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-6-1.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -212,9 +212,7 @@ if(WITH_ZLIB) - endif() - - if(WITH_ZSTD) -- target_link_libraries(rdkafka PUBLIC ${ZSTD_LIBRARY}) -- target_include_directories(rdkafka PUBLIC ${ZSTD_INCLUDE_DIR}) -- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") -+ target_link_libraries(rdkafka PUBLIC $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - - if(WITH_SSL) -@@ -253,8 +251,7 @@ if(WITH_LIBDL) - endif() - - if(WITH_LZ4_EXT) -- target_include_directories(rdkafka PUBLIC ${LZ4_INCLUDE_DIRS}) -- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) -+ target_link_libraries(rdkafka PUBLIC lz4::lz4) - endif() - - # Set up path to these sources for other sub-projects (tests, examples) diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-7-0.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-7-0.patch deleted file mode 100644 index 377bc8af8e4378..00000000000000 --- a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-7-0.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 994ad21e1a136e11d1dc5870d991b034e41e6a4c Mon Sep 17 00:00:00 2001 -From: Alejandro Colomar -Date: Sun, 30 May 2021 11:08:36 +0200 -Subject: [PATCH] Change library targets and result variables - ---- - src/CMakeLists.txt | 7 ++----- - 1 file changed, 2 insertions(+), 5 deletions(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 6e24a238..4379c060 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -198,9 +198,7 @@ if(WITH_ZLIB) - endif() - - if(WITH_ZSTD) -- target_link_libraries(rdkafka PRIVATE ${ZSTD_LIBRARY}) -- target_include_directories(rdkafka PRIVATE ${ZSTD_INCLUDE_DIR}) -- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") -+ target_link_libraries(rdkafka PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - - if(WITH_SSL) -@@ -239,8 +237,7 @@ if(WITH_LIBDL) - endif() - - if(WITH_LZ4_EXT) -- target_include_directories(rdkafka PRIVATE ${LZ4_INCLUDE_DIRS}) -- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) -+ target_link_libraries(rdkafka PUBLIC lz4::lz4) - endif() - - if(WIN32) --- -2.32.0.rc0 - diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-3-0.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-3-0.patch new file mode 100644 index 00000000000000..169e5bb94d3b20 --- /dev/null +++ b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-3-0.patch @@ -0,0 +1,24 @@ +iff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index cbcff50..38ad38e 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -215,9 +215,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PRIVATE ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PRIVATE ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -257,7 +255,7 @@ endif() + + if(WITH_LZ4_EXT) + target_include_directories(rdkafka PRIVATE ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + if(WIN32) diff --git a/recipes/librdkafka/config.yml b/recipes/librdkafka/config.yml index 92b3b67d04bdf0..edafdb9b6c2ac0 100644 --- a/recipes/librdkafka/config.yml +++ b/recipes/librdkafka/config.yml @@ -1,19 +1,9 @@ versions: - "2.0.2": - folder: all - "1.9.2": - folder: all - "1.9.1": - folder: all - "1.8.2": + "2.3.0": folder: all - "1.8.0": + "2.2.0": folder: all - "1.7.0": - folder: all - "1.6.1": - folder: all - "1.6.0": + "2.0.2": folder: all - "1.5.3": + "1.9.2": 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/librttopo/all/conanfile.py b/recipes/librttopo/all/conanfile.py index ceb7c7bc70c186..a6752906fedc25 100644 --- a/recipes/librttopo/all/conanfile.py +++ b/recipes/librttopo/all/conanfile.py @@ -45,7 +45,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("geos/3.11.1", transitive_headers=True, transitive_libs=True) + self.requires("geos/3.12.0", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libsafec/all/conanfile.py b/recipes/libsafec/all/conanfile.py index 6924adfd04703a..7086816ccca537 100644 --- a/recipes/libsafec/all/conanfile.py +++ b/recipes/libsafec/all/conanfile.py @@ -1,23 +1,28 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration, ConanException -from conan.tools.files import get, rmdir, copy, rm, chdir +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc from conan.tools.scm import Version -from conans import AutoToolsBuildEnvironment, tools -import os required_conan_version = ">=1.53.0" class LibSafeCConan(ConanFile): name = "libsafec" - description = "This library implements the secure C11 Annex K[^5] functions" \ - " on top of most libc implementations, which are missing from them." + description = ("This library implements the secure C11 Annex K[^5] functions" + " on top of most libc implementations, which are missing from them.") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/rurban/safeclib" - license = "MIT" - topics = ("safec", "libc", "bounds-checking") + topics = ("safec", "libc", "bounds-checking", "pre-built") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -32,16 +37,20 @@ class LibSafeCConan(ConanFile): "memmax": 268435456, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + @property + def _supported_compiler(self): + compiler = self.settings.compiler + version = Version(self.settings.compiler.version) + if is_msvc(self): + return False + if compiler == "gcc" and version < "5": + return False + return True + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -52,71 +61,67 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") - def build_requirements(self): - self.tool_requires("libtool/2.4.6") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.tool_requires("msys2/cci.latest") - - @property - def _supported_compiler(self): - compiler = self.settings.compiler - version = Version(self.settings.compiler.version) - if is_msvc(self): - return False - if compiler == "gcc" and version < "5": - return False - return True + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - raise ConanInvalidConfiguration(f"This platform is not yet supported by {self.ref} (os=Macos arch=armv8)") + if is_apple_os(self) and self.settings.arch == "armv8": + raise ConanInvalidConfiguration( + f"This platform is not yet supported by {self.ref} (os=Macos arch=armv8)" + ) if not self._supported_compiler: raise ConanInvalidConfiguration( - f"{self.ref} doesn't support {self.settings.compiler}-{self.settings.compiler.version}") + f"{self.ref} doesn't support {self.settings.compiler}-{self.settings.compiler.version}" + ) if not str(self.info.options.strmax).isdigit(): raise ConanException(f"{self.ref} option 'strmax' must be a valid integer number.") + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + 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): - get(self, **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_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(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-debug={}".format(yes_no(self.settings.build_type == "Debug")), + tc.configure_args += [ + f"--enable-debug={yes_no(self.settings.build_type == 'Debug')}", "--disable-doc", "--disable-Werror", - "--enable-strmax={}".format(self.options.strmax), - "--enable-memmax={}".format(self.options.memmax), + f"--enable-strmax={self.options.strmax}", + f"--enable-memmax={self.options.memmax}", ] - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools + tc.generate() def build(self): - with chdir(self, self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), - win_bash=tools.os_info.is_windows, run_environment=True) - autotools = self._configure_autotools() - autotools.make() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - copy(self, "COPYING", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) - autotools = self._configure_autotools() - autotools.install() + copy(self, "COPYING", 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, "lib", "pkgconfig")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.includedirs.append(os.path.join("include", "libsafec")) - self.cpp_info.libs = ["safec-{}".format(self.version)] + self.cpp_info.libs = [f"safec-{self.version}"] self.cpp_info.set_property("pkg_config_name", "libsafec") bin_dir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_dir)) + self.output.info(f"Appending PATH environment variable: {bin_dir}") self.env_info.PATH.append(bin_dir) diff --git a/recipes/libsafec/all/test_package/CMakeLists.txt b/recipes/libsafec/all/test_package/CMakeLists.txt index 31762006efa776..2a28db28a9c5d2 100644 --- a/recipes/libsafec/all/test_package/CMakeLists.txt +++ b/recipes/libsafec/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(libsafec REQUIRED CONFIG) add_executable(test_package test_package.c) -target_link_libraries(test_package ${CONAN_LIBS}) +target_link_libraries(test_package PRIVATE libsafec::libsafec) diff --git a/recipes/libsafec/all/test_package/conanfile.py b/recipes/libsafec/all/test_package/conanfile.py index b7cd0e8fa4f622..ef5d7042163ecc 100644 --- a/recipes/libsafec/all/test_package/conanfile.py +++ b/recipes/libsafec/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import CMake, ConanFile, 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 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/libsafec/all/test_v1_package/CMakeLists.txt b/recipes/libsafec/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libsafec/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/libsafec/all/test_v1_package/conanfile.py b/recipes/libsafec/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..043b77522562fc --- /dev/null +++ b/recipes/libsafec/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, 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/libsass/all/conanfile.py b/recipes/libsass/all/conanfile.py index 374c7b2afb2fde..9bc7cc167e99f9 100644 --- a/recipes/libsass/all/conanfile.py +++ b/recipes/libsass/all/conanfile.py @@ -1,36 +1,34 @@ from conan import ConanFile -from conan.tools.files import get, chdir, save, replace_in_file, rmdir, rm -from conan.tools.microsoft import is_msvc -from conans import AutoToolsBuildEnvironment, MSBuild, tools +from conan.tools.build import stdcpp_library +from conan.tools.files import chdir, copy, get, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuild, MSBuildToolchain, is_msvc import os import re -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibsassConan(ConanFile): name = "libsass" + description = "A C/C++ implementation of a Sass compiler" license = "MIT" - homepage = "libsass.org" url = "https://github.com/conan-io/conan-center-index" - description = "A C/C++ implementation of a Sass compiler" - topics = ("Sass", "LibSass", "compiler") - settings = "os", "compiler", "build_type", "arch" + homepage = "libsass.org" + topics = ("Sass", "compiler") + + 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 + "fPIC": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" @@ -41,107 +39,134 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): if self.settings.os != "Windows": self.tool_requires("libtool/2.4.7") 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 - self._autotools = AutoToolsBuildEnvironment(self) - args = [] - args.append("--disable-tests") - args.append("--enable-%s" % ("shared" if self.options.shared else "static")) - args.append("--disable-%s" % ("static" if self.options.shared else "shared")) - self._autotools.configure(args=args) - return self._autotools - - def _build_autotools(self): - with chdir(self, self._source_subfolder): - save(self, path="VERSION", content=f"{self.version}") - self.run("{} -fiv".format(tools.get_env("AUTORECONF"))) - autotools = self._configure_autotools() - autotools.make() + get(self, **self.conan_data["sources"][self.version], strip_root=True) @property - def _make_program(self): - return tools.get_env("CONAN_MAKE_PROGRAM", tools.which("make") or tools.which("mingw32-make")) - - def _build_mingw(self): - makefile = os.path.join(self._source_subfolder, "Makefile") - replace_in_file(self, makefile, "CFLAGS += -O2", "") - replace_in_file(self, makefile, "CXXFLAGS += -O2", "") - replace_in_file(self, makefile, "LDFLAGS += -O2", "") - with chdir(self, self._source_subfolder): - env_vars = AutoToolsBuildEnvironment(self).vars - env_vars.update({ - "BUILD": "shared" if self.options.shared else "static", - "PREFIX": tools.unix_path(os.path.join(self.package_folder)), + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + def generate(self): + if not is_msvc(self): + tc = AutotoolsToolchain(self) + tc.configure_args += ["--disable-tests"] + env = tc.environment() + if self._is_mingw: + env.define("BUILD", "shared" if self.options.shared else "static") # Don't force static link to mingw libs, leave this decision to consumer (through LDFLAGS in env) - "STATIC_ALL": "0", - "STATIC_LIBGCC": "0", - "STATIC_LIBSTDCPP": "0", - }) - with tools.environment_append(env_vars): - self.run(f"{self._make_program} -f Makefile") - - def _build_visual_studio(self): - with chdir(self, self._source_subfolder): - properties = { - "LIBSASS_STATIC_LIB": "" if self.options.shared else "true", - "WholeProgramOptimization": "true" if any(re.finditer("(^| )[/-]GL($| )", tools.get_env("CFLAGS", ""))) else "false", - } - platforms = { - "x86": "Win32", - "x86_64": "Win64" - } - msbuild = MSBuild(self) - msbuild.build(os.path.join("win", "libsass.sln"), platforms=platforms, properties=properties) + env.define("STATIC_ALL", "0") + env.define("STATIC_LIBGCC", "0") + env.define("STATIC_LIBSTDCPP", "0") + tc.generate(env) + else: + with chdir(self, self.source_folder): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.platform = "Win32" if self.settings.arch == "x86" else "Win64" + tc.properties["LIBSASS_STATIC_LIB"] = "" if self.options.shared else "true" + wpo_enabled = any(re.finditer("(^| )[/-]GL($| )", os.environ.get("CFLAGS", ""))) + tc.properties["WholeProgramOptimization"] = "true" if wpo_enabled else "false" + tc.generate() + + def _patch_sources(self): + 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, "win", "libsass.vcxproj") + for exiting_toolset in ["v120", "v140", "v141", "v142", "v143"]: + replace_in_file(self, vcxproj_file, + f"{exiting_toolset}", + f"{platform_toolset}", strict=False) + # Inject VS 2022 support + replace_in_file(self, vcxproj_file, + '\n' + f' {platform_toolset}\n' + '\n' + '', + f'msbuild/2003">\n{import_conan_generators}') + else: + makefile = os.path.join(self.source_folder, "Makefile") + replace_in_file(self, makefile, "+= -O2", "+=") def build(self): - if self._is_mingw: - self._build_mingw() - elif is_msvc(self): - self._build_visual_studio() - else: - self._build_autotools() + self._patch_sources() + with chdir(self, self.source_folder): + if is_msvc(self): + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.platform = "Win32" if self.settings.arch == "x86" else "Win64" + msbuild.build(sln=os.path.join("win", "libsass.sln")) + else: + save(self, path="VERSION", content=f"{self.version}") + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def _install_autotools(self): - with chdir(self, self._source_subfolder): - autotools = self._configure_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.la", self.package_folder, recursive=True) def _install_mingw(self): - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*.dll", dst="bin", src=os.path.join(self._source_subfolder, "lib")) - self.copy("*.a", dst="lib", src=os.path.join(self._source_subfolder, "lib")) - - def _install_visual_studio(self): - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*.dll", dst="bin", src=os.path.join(self._source_subfolder, "win", "bin"), keep_path=False) - self.copy("*.lib", dst="lib", src=os.path.join(self._source_subfolder, "win", "bin"), keep_path=False) + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "*.dll", + dst=os.path.join(self.package_folder, "bin"), + src=os.path.join(self.source_folder, "lib")) + copy(self, "*.a", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.source_folder, "lib")) + + def _install_msvc(self): + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "*.dll", + dst=os.path.join(self.package_folder, "bin"), + src=os.path.join(self.source_folder, "win", "bin"), + keep_path=False) + copy(self, "*.lib", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.source_folder, "win", "bin"), + keep_path=False) 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._is_mingw: self._install_mingw() elif is_msvc(self): - self._install_visual_studio() + self._install_msvc() else: self._install_autotools() def package_info(self): - self.cpp_info.names["pkg_config"] = "libsass" + self.cpp_info.set_property("pkg_config_name", "libsass") self.cpp_info.libs = ["libsass" if is_msvc(self) else "sass"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "m"]) - if not self.options.shared and tools.stdcpp_library(self): - self.cpp_info.system_libs.append(tools.stdcpp_library(self)) + if not self.options.shared and stdcpp_library(self): + self.cpp_info.system_libs.append(stdcpp_library(self)) diff --git a/recipes/libsass/all/test_package/CMakeLists.txt b/recipes/libsass/all/test_package/CMakeLists.txt index 2c3751c7f5fee9..fc8049a7834b98 100644 --- a/recipes/libsass/all/test_package/CMakeLists.txt +++ b/recipes/libsass/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(libsass REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/libsass/all/test_package/conanfile.py b/recipes/libsass/all/test_package/conanfile.py index 814aa7bbb26c77..ef5d7042163ecc 100644 --- a/recipes/libsass/all/test_package/conanfile.py +++ b/recipes/libsass/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 LibsassTestConan(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) @@ -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/libsass/all/test_v1_package/CMakeLists.txt b/recipes/libsass/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libsass/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/libsass/all/test_v1_package/conanfile.py b/recipes/libsass/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..814aa7bbb26c77 --- /dev/null +++ b/recipes/libsass/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class LibsassTestConan(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/libseat/all/conandata.yml b/recipes/libseat/all/conandata.yml new file mode 100644 index 00000000000000..119dc8ef93144b --- /dev/null +++ b/recipes/libseat/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.8.0": + url: "https://git.sr.ht/~kennylevinsen/seatd/archive/0.8.0.tar.gz" + sha256: "a562a44ee33ccb20954a1c1ec9a90ecb2db7a07ad6b18d0ac904328efbcf65a0" +patches: + "0.8.0": + - patch_file: "patches/0001-Disable-building-tests.patch" + patch_description: "Disable building tests" + patch_type: "conan" diff --git a/recipes/libseat/all/conanfile.py b/recipes/libseat/all/conanfile.py new file mode 100644 index 00000000000000..4131ba65c629a8 --- /dev/null +++ b/recipes/libseat/all/conanfile.py @@ -0,0 +1,113 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, 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 LibseatConan(ConanFile): + name = "libseat" + description = ("A minimal seat management daemon, and a universal seat management library") + topics = ("login", "session", "seat", "seatd") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sr.ht/~kennylevinsen/seatd/" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "builtin": [True, False], + "defaultpath": [None, "ANY"], + "logind": [False, "elogind", "systemd"], + "seatd": [True, False], + "server": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "defaultpath": None, + "builtin": False, + "logind": False, + "seatd": True, + "server": True, + } + + def export_sources(self): + export_conandata_patches(self) + + 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 self.options.logind == "systemd": + self.requires("libsystemd/253.10") + + def validate(self): + if not self.settings.os in ["FreeBSD", "Linux"]: + raise ConanInvalidConfiguration(f"{self.ref} only supports FreeBSD and Linux") + if self.options.logind == "elogind": + raise ConanInvalidConfiguration(f"{self.ref} may not be built with elogind support since there is no elogind Conan package yet") + + def build_requirements(self): + self.tool_requires("meson/1.2.2") + 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["libseat-builtin"] = "enabled" if self.options.builtin else "disabled" + tc.project_options["libseat-logind"] = str(self.options.logind) if self.options.logind else "disabled" + tc.project_options["libseat-seatd"] = "enabled" if self.options.seatd else "disabled" + tc.project_options["server"] = "enabled" if self.options.server else "disabled" + tc.project_options["examples"] = "disabled" + tc.project_options["man-pages"] = "disabled" + tc.project_options["defaultpath"] = "" if self.options.defaultpath is None else str(self.options.defaultpath) + tc.c_args.append("-Wno-error") + tc.generate() + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + env = VirtualBuildEnv(self) + env.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + 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() + pkg_config_dir = os.path.join(self.package_folder, "lib", "pkgconfig") + rmdir(self, pkg_config_dir) + + def package_info(self): + self.cpp_info.libs = ["seat"] + self.cpp_info.system_libs.append("rt") + pkgconfig_variables = { + "have_builtin": self.options.builtin, + "have_logind": "true" if self.options.logind else "false", + "have_seatd": self.options.seatd, + } + self.cpp_info.set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items())) diff --git a/recipes/libseat/all/patches/0001-Disable-building-tests.patch b/recipes/libseat/all/patches/0001-Disable-building-tests.patch new file mode 100644 index 00000000000000..8a62a0a48cda00 --- /dev/null +++ b/recipes/libseat/all/patches/0001-Disable-building-tests.patch @@ -0,0 +1,33 @@ +From 5f4738e980b688b26522603a9173a72b007968d3 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Thu, 28 Sep 2023 15:25:30 -0500 +Subject: [PATCH] Disable building tests + +--- + meson.build | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/meson.build b/meson.build +index 516d7d2..f37109e 100644 +--- a/meson.build ++++ b/meson.build +@@ -241,11 +241,11 @@ if get_option('examples') == 'enabled' + ) + endif + +-tests = { +- 'linked_list': ['common/linked_list.c'], +- 'connection': ['common/connection.c'], +- 'poller': ['common/linked_list.c', 'seatd/poller.c'], +-} ++tests = {} ++# 'linked_list': ['common/linked_list.c'], ++# 'connection': ['common/connection.c'], ++# 'poller': ['common/linked_list.c', 'seatd/poller.c'], ++#} + + foreach name, value : tests + test(name, executable( +-- +2.41.0 + diff --git a/recipes/libseat/all/test_package/CMakeLists.txt b/recipes/libseat/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..027296c50f1b38 --- /dev/null +++ b/recipes/libseat/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(libseat COMPONENTS libseat REQUIRED) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE libseat::libseat) diff --git a/recipes/libseat/all/test_package/conanfile.py b/recipes/libseat/all/test_package/conanfile.py new file mode 100644 index 00000000000000..433561157a4130 --- /dev/null +++ b/recipes/libseat/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", "VirtualBuildEnv", "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/libseat/all/test_package/test_package.c b/recipes/libseat/all/test_package/test_package.c new file mode 100644 index 00000000000000..3f2ecd791512e9 --- /dev/null +++ b/recipes/libseat/all/test_package/test_package.c @@ -0,0 +1,6 @@ +#include "libseat.h" + +int main(int argc, char *argv[]) { + libseat_set_log_level(LIBSEAT_LOG_LEVEL_DEBUG); + return 0; +} diff --git a/recipes/libseat/config.yml b/recipes/libseat/config.yml new file mode 100644 index 00000000000000..675f954f2770e1 --- /dev/null +++ b/recipes/libseat/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.0": + folder: all diff --git a/recipes/libsecret/all/conanfile.py b/recipes/libsecret/all/conanfile.py index 2988bdf94bf2c7..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.76.0", 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.0.0") + 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.3") + self.tool_requires("pkgconf/2.0.3") self.tool_requires("glib/") if self.settings.os == "Macos": diff --git a/recipes/libselinux/all/conandata.yml b/recipes/libselinux/all/conandata.yml index bc06101ad2d727..3db74c02a2ca7b 100644 --- a/recipes/libselinux/all/conandata.yml +++ b/recipes/libselinux/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "3.5": + - url: "https://github.com/SELinuxProject/selinux/releases/download/3.5/libselinux-3.5.tar.gz" + sha256: "9a3a3705ac13a2ccca2de6d652b6356fead10f36fb33115c185c5ccdf29eec19" + - url: "https://github.com/SELinuxProject/selinux/releases/download/3.5/libsepol-3.5.tar.gz" + sha256: "78fdaf69924db780bac78546e43d9c44074bad798c2c415d0b9bb96d065ee8a2" "3.3": - url: "https://github.com/SELinuxProject/selinux/releases/download/3.3/libselinux-3.3.tar.gz" sha256: "acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057" diff --git a/recipes/libselinux/all/conanfile.py b/recipes/libselinux/all/conanfile.py index b584e1b1696aaa..11d688ce34c154 100644 --- a/recipes/libselinux/all/conanfile.py +++ b/recipes/libselinux/all/conanfile.py @@ -1,11 +1,12 @@ +import os + from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, replace_in_file, save from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration -import os required_conan_version = ">=1.53.0" @@ -20,7 +21,14 @@ class LibSELinuxConan(ConanFile): topics = ("linux", "selinux", "security", "security-enhanced") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/SELinuxProject/selinux" - license = "Unlicense" + license = ( + # https://github.com/SELinuxProject/selinux/blob/main/libselinux/LICENSE + # For the libselinux component: public domain with a limited liability clause + "libselinux-1.0", + # https://github.com/SELinuxProject/selinux/blob/main/libsepol/LICENSE + # For the libsepol component: LGPL-2.1 + "LGPL-2.1-or-later", + ) package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -48,34 +56,18 @@ def requirements(self): self.requires("pcre2/10.42") def validate(self): - if self.settings.os != "Linux": + if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def build_requirements(self): self.tool_requires("flex/2.6.4") 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") def source(self): for download in self.conan_data["sources"][self.version]: get(self, **download) - @property - def _sepol_soversion(self): - return "2" if Version(self.version) >= "3.2" else "1" - - @property - def _selinux_soversion(self): - return "1" - - @property - def _sepol_library_target(self): - return f"libsepol.so.{self._sepol_soversion}" if self.options.shared else "libsepol.a" - - @property - def _selinux_library_target(self): - return f"libselinux.so.{self._selinux_soversion}" if self.options.shared else "libselinux.a" - @property def _sepol_source_folder(self): return os.path.join(self.source_folder, f"libsepol-{self.version}") @@ -100,13 +92,31 @@ def generate(self): def build(self): apply_conandata_patches(self) autotools = Autotools(self) - with chdir(self, os.path.join(self._sepol_source_folder, "src")): - autotools.make(self._sepol_library_target) - with chdir(self, os.path.join(self._selinux_source_folder)): - autotools.make() + for subdir in [self._sepol_source_folder, self._selinux_source_folder]: + with chdir(self, subdir): + # Build only .a or .so, not both + replace_in_file(self, os.path.join("src", "Makefile"), + "all: $(LIBA) $(LIBSO) $(LIBPC)", + "all: $(LIBSO)" if self.options.shared else "all: $(LIBA)") + # Skip utils dir by truncating its Makefile + save(self, os.path.join("utils", "Makefile"), "all:\n") + autotools.make() + + def _copy_licenses(self): + copy(self, "LICENSE", self._selinux_source_folder, os.path.join(self.package_folder, "licenses")) + rename(self, os.path.join(self.package_folder, "licenses", "LICENSE"), + os.path.join(self.package_folder, "licenses", "LICENSE-libselinux")) + if Version(self.version) >= "3.5": + copy(self, "LICENSE", self._sepol_source_folder, os.path.join(self.package_folder, "licenses")) + rename(self, os.path.join(self.package_folder, "licenses", "LICENSE"), + os.path.join(self.package_folder, "licenses", "LICENSE-libsepol")) + else: + copy(self, "COPYING", self._sepol_source_folder, os.path.join(self.package_folder, "licenses")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), + os.path.join(self.package_folder, "licenses", "LICENSE-libsepol")) def package(self): - copy(self, "LICENSE", self._selinux_source_folder, os.path.join(self.package_folder, "licenses")) + self._copy_licenses() for library in [self._sepol_source_folder, self._selinux_source_folder]: copy(self, "*.h", os.path.join(library, "include"), os.path.join(self.package_folder, "include")) if self.options.shared: diff --git a/recipes/libselinux/all/test_package/CMakeLists.txt b/recipes/libselinux/all/test_package/CMakeLists.txt index 7a316858398f3f..a2c8fc569bb2f2 100644 --- a/recipes/libselinux/all/test_package/CMakeLists.txt +++ b/recipes/libselinux/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(libselinux REQUIRED CONFIG) diff --git a/recipes/libselinux/all/test_v1_package/CMakeLists.txt b/recipes/libselinux/all/test_v1_package/CMakeLists.txt index 925ecbe19e448d..91630d79f4abb3 100644 --- a/recipes/libselinux/all/test_v1_package/CMakeLists.txt +++ b/recipes/libselinux/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) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/libselinux/config.yml b/recipes/libselinux/config.yml index 3fc66eb377b843..761b7522ae137c 100644 --- a/recipes/libselinux/config.yml +++ b/recipes/libselinux/config.yml @@ -1,4 +1,6 @@ versions: + "3.5": + folder: all "3.3": folder: all "3.2": diff --git a/recipes/libserial/all/conandata.yml b/recipes/libserial/all/conandata.yml index f2d6529173319e..3c560a2bb697e4 100644 --- a/recipes/libserial/all/conandata.yml +++ b/recipes/libserial/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230909": + url: "https://github.com/crayzeewulf/libserial/archive/ee1992dc3c5dc41a0e18e2d1dad18c103eb405ec.tar.gz" + sha256: "2b83141630c76e119b19d85958c8685efab6eff3e2af3435933b8f2ac147f62a" "cci.20200930": url: "https://github.com/crayzeewulf/libserial/archive/1d1e47a2faae0470f93eb291263b0ce7ea119a81.tar.gz" sha256: "a433b04bd42e8b4504e5e1fbe7ec22b648f2872d3d125e58c17b9c6c1b171bba" diff --git a/recipes/libserial/config.yml b/recipes/libserial/config.yml index 27812caf46f4d9..3318e67617d628 100644 --- a/recipes/libserial/config.yml +++ b/recipes/libserial/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20230909": + folder: all "cci.20200930": folder: all diff --git a/recipes/libsgp4/all/conandata.yml b/recipes/libsgp4/all/conandata.yml index acdc9ee85a4536..427372b5ece502 100644 --- a/recipes/libsgp4/all/conandata.yml +++ b/recipes/libsgp4/all/conandata.yml @@ -1,7 +1,12 @@ sources: + "1.0": + url: "https://github.com/dnwrnr/sgp4/archive/refs/tags/v1.0.tar.gz" + sha256: "34cdcce25adbe25234b5113b06537bec9d6e6c2a74f70919c9d71710dc3773f4" "20191207": - url: "https://github.com/dnwrnr/sgp4/archive/f5cb54b382a5b4787432ab5b9a1e83de1a224610.zip" - sha256: "e8ce05b5e62ffe81e2e07020ac693cb5f3eb7dd90587e9c2203639564c030495" + url: "https://github.com/dnwrnr/sgp4/archive/f5cb54b382a5b4787432ab5b9a1e83de1a224610.tar.gz" + sha256: "260f3524ead05c191bdf19c2f018376394b4856d2fbcc1ed63bcdd475b81c338" patches: + "1.0": + - patch_file: "patches/1.0-fix-cmake-files.patch" "20191207": - - patch_file: "patches/fix-cmake-files.patch" + - patch_file: "patches/20191207-fix-cmake-files.patch" diff --git a/recipes/libsgp4/all/patches/1.0-fix-cmake-files.patch b/recipes/libsgp4/all/patches/1.0-fix-cmake-files.patch new file mode 100644 index 00000000000000..0b0946d73305a1 --- /dev/null +++ b/recipes/libsgp4/all/patches/1.0-fix-cmake-files.patch @@ -0,0 +1,27 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,8 +27,3 @@ + include_directories(libsgp4) + + add_subdirectory(libsgp4) +-add_subdirectory(sattrack) +-add_subdirectory(runtest) +-add_subdirectory(passpredict) +- +-file(COPY SGP4-VER.TLE DESTINATION ${PROJECT_BINARY_DIR}) +--- a/libsgp4/CMakeLists.txt ++++ b/libsgp4/CMakeLists.txt +@@ -35,7 +35,10 @@ + Vector.h + ) + +-add_library(sgp4 STATIC ${SRCS} ${INCS}) +-add_library(sgp4s SHARED ${SRCS} ${INCS}) +-install( TARGETS sgp4s LIBRARY DESTINATION lib ) ++add_library(sgp4 ${SRCS}) ++if(BUILD_SHARED_LIBS) ++ set_target_properties(sgp4 PROPERTIES OUTPUT_NAME sgp4s) ++endif() ++include(GNUInstallDirs) ++install(TARGETS sgp4) + install( FILES ${INCS} DESTINATION include/SGP4 ) diff --git a/recipes/libsgp4/all/patches/20191207-fix-cmake-files.patch b/recipes/libsgp4/all/patches/20191207-fix-cmake-files.patch new file mode 100644 index 00000000000000..7874f13bef92ac --- /dev/null +++ b/recipes/libsgp4/all/patches/20191207-fix-cmake-files.patch @@ -0,0 +1,52 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,16 +1,7 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.15) + PROJECT(SGP4) + +-include(CheckCXXCompilerFlag) +-CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +-if(COMPILER_SUPPORTS_CXX11) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +-else() +- message(SEND_ERROR "The compiler ${CMAKE_CXX_COMPILER} doesnt support C++11.") +-endif() +- +-set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +- ++if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow") +@@ -19,12 +10,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion") ++endif() + + include_directories(libsgp4) + + add_subdirectory(libsgp4) +-add_subdirectory(sattrack) +-add_subdirectory(runtest) +-add_subdirectory(passpredict) +- +-file(COPY SGP4-VER.TLE DESTINATION ${PROJECT_BINARY_DIR}) +--- a/libsgp4/CMakeLists.txt ++++ b/libsgp4/CMakeLists.txt +@@ -35,7 +35,11 @@ set(SRCS + Vector.h + ) + +-add_library(sgp4 STATIC ${SRCS} ${INCS}) +-add_library(sgp4s SHARED ${SRCS} ${INCS}) +-install( TARGETS sgp4s LIBRARY DESTINATION lib ) ++add_library(sgp4 ${SRCS}) ++set_target_properties(sgp4 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++if(BUILD_SHARED_LIBS) ++ set_target_properties(sgp4 PROPERTIES OUTPUT_NAME sgp4s) ++endif() ++target_compile_features(sgp4 PRIVATE cxx_std_11) ++install( TARGETS sgp4 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install( FILES ${INCS} DESTINATION include/SGP4 ) diff --git a/recipes/libsgp4/all/patches/fix-cmake-files.patch b/recipes/libsgp4/all/patches/fix-cmake-files.patch deleted file mode 100644 index c465c328534391..00000000000000 --- a/recipes/libsgp4/all/patches/fix-cmake-files.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,16 +1,7 @@ --CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -+CMAKE_MINIMUM_REQUIRED(VERSION 3.8) - PROJECT(SGP4) - --include(CheckCXXCompilerFlag) --CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) --if(COMPILER_SUPPORTS_CXX11) -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") --else() -- message(SEND_ERROR "The compiler ${CMAKE_CXX_COMPILER} doesnt support C++11.") --endif() -- --set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -- -+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow") -@@ -19,12 +10,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion") -+endif() - - include_directories(libsgp4) - - add_subdirectory(libsgp4) --add_subdirectory(sattrack) --add_subdirectory(runtest) --add_subdirectory(passpredict) -- --file(COPY SGP4-VER.TLE DESTINATION ${PROJECT_BINARY_DIR}) ---- a/libsgp4/CMakeLists.txt -+++ b/libsgp4/CMakeLists.txt -@@ -35,7 +35,11 @@ set(SRCS - Vector.h - ) - --add_library(sgp4 STATIC ${SRCS} ${INCS}) --add_library(sgp4s SHARED ${SRCS} ${INCS}) --install( TARGETS sgp4s LIBRARY DESTINATION lib ) -+add_library(sgp4 ${SRCS}) -+set_target_properties(sgp4 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) -+if(BUILD_SHARED_LIBS) -+ set_target_properties(sgp4 PROPERTIES OUTPUT_NAME sgp4s) -+endif() -+target_compile_features(sgp4 PRIVATE cxx_std_11) -+install( TARGETS sgp4 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install( FILES ${INCS} DESTINATION include/SGP4 ) diff --git a/recipes/libsgp4/config.yml b/recipes/libsgp4/config.yml index 72af20020d59f6..323fde5efbec23 100644 --- a/recipes/libsgp4/config.yml +++ b/recipes/libsgp4/config.yml @@ -1,3 +1,5 @@ versions: + "1.0": + folder: all "20191207": folder: all 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/libsigcpp/2.x.x/test_v1_package/conanfile.py b/recipes/libsigcpp/2.x.x/test_v1_package/conanfile.py index e6b0fdb8110e8d..b3607270e232e7 100644 --- a/recipes/libsigcpp/2.x.x/test_v1_package/conanfile.py +++ b/recipes/libsigcpp/2.x.x/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/libsixel/all/conanfile.py b/recipes/libsixel/all/conanfile.py index 8748a8a951d306..941e12b1392155 100644 --- a/recipes/libsixel/all/conanfile.py +++ b/recipes/libsixel/all/conanfile.py @@ -1,18 +1,28 @@ import os -import functools -from conans import ConanFile, Meson, tools -from conans.errors import ConanInvalidConfiguration + +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.files import copy, get, rmdir, rm +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 -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" + class LibSixelConan(ConanFile): name = "libsixel" - description = "A SIXEL encoder/decoder implementation derived from kmiya's sixel (https://github.com/saitoha/sixel)." - topics = ("sixel") + description = ("A SIXEL encoder/decoder implementation derived from kmiya's sixel" + " (https://github.com/saitoha/sixel).") license = "MIT" - homepage = "https://github.com/libsixel/libsixel" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libsixel/libsixel" + topics = "sixel" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -32,75 +42,80 @@ class LibSixelConan(ConanFile): "with_jpeg": True, "with_png": True, } - generators = "cmake", "pkg_config" - - @property - def _source_subfolder(self): - return "source_subfolder" def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - - def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self): - raise ConanInvalidConfiguration("Cross-building not implemented") - if is_msvc(self): - raise ConanInvalidConfiguration("{}/{} does not support Visual Studio".format(self.name, self.version)) + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") - def build_requirements(self): - self.build_requires("meson/0.62.2") - self.build_requires("pkgconf/1.7.4") + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_curl: - self.requires("libcurl/7.83.1") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.with_gd: - self.requires("libgd/2.3.2") + self.requires("libgd/2.3.3") if self.options.with_gdk_pixbuf2: - self.requires("gdk-pixbuf/2.42.6") + self.requires("gdk-pixbuf/2.42.10") if self.options.with_jpeg: - self.requires("libjpeg/9d") + self.requires("libjpeg/9e") if self.options.with_png: - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.40") + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("Cross-building not implemented") + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support Visual Studio") + + 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): - 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_meson(self): - meson = Meson(self) - defs = { + def generate(self): + tc = MesonToolchain(self) + tc.project_options = { "libcurl": "enabled" if self.options.with_curl else "disabled", "gd": "enabled" if self.options.with_gd else "disabled", "gdk-pixbuf2": "enabled" if self.options.with_gdk_pixbuf2 else "disabled", "img2sixel": "disabled", "sixel2png": "disabled", "python2": "disabled", + "libdir": "lib", } - meson.configure( - defs=defs, - source_folder=self._source_subfolder, - ) - return meson + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() def build(self): - meson = self._configure_meson() + meson = Meson(self) + meson.configure() meson.build() def package(self): - self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) - meson = self._configure_meson() + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + meson = Meson(self) meson.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + rm(self, "*.lib", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "*.so*", os.path.join(self.package_folder, "lib")) + rm(self, "*.dylib", os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.libs = ["sixel"] diff --git a/recipes/libsixel/all/test_package/CMakeLists.txt b/recipes/libsixel/all/test_package/CMakeLists.txt index 199ae95ae65fc3..9bb9b6871d67d6 100644 --- a/recipes/libsixel/all/test_package/CMakeLists.txt +++ b/recipes/libsixel/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(libsixel REQUIRED CONFIG) add_executable(${PROJECT_NAME} ${PROJECT_NAME}.c) diff --git a/recipes/libsixel/all/test_package/conanfile.py b/recipes/libsixel/all/test_package/conanfile.py index e556cc050d509c..ef5d7042163ecc 100644 --- a/recipes/libsixel/all/test_package/conanfile.py +++ b/recipes/libsixel/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 TestConan(ConanFile): +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/libsixel/all/test_v1_package/CMakeLists.txt b/recipes/libsixel/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libsixel/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/libsixel/all/test_v1_package/conanfile.py b/recipes/libsixel/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..e556cc050d509c --- /dev/null +++ b/recipes/libsixel/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(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) diff --git a/recipes/libslz/all/CMakeLists.txt b/recipes/libslz/all/CMakeLists.txt index 3086b45fa1be2a..84ba240aba82bf 100644 --- a/recipes/libslz/all/CMakeLists.txt +++ b/recipes/libslz/all/CMakeLists.txt @@ -1,24 +1,17 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.12) project(slz LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -include(GNUInstallDirs) - -add_library(slz source_subfolder/src/slz.c) -include_directories(source_subfolder/src) +add_library(slz src/src/slz.c) +include_directories(src/src) set_target_properties(slz PROPERTIES - PUBLIC_HEADER source_subfolder/src/slz.h + PUBLIC_HEADER src/src/slz.h WINDOWS_EXPORT_ALL_SYMBOLS ON C_STANDARD 11 C_EXTENSIONS ON ) +include(GNUInstallDirs) install( TARGETS slz - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/recipes/libslz/all/conanfile.py b/recipes/libslz/all/conanfile.py index b33407244e1ebd..56bb34708956f1 100644 --- a/recipes/libslz/all/conanfile.py +++ b/recipes/libslz/all/conanfile.py @@ -1,17 +1,23 @@ -import functools -from conans import ConanFile, CMake, tools -from conans.tools import ConanInvalidConfiguration +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get from conan.tools.microsoft import is_msvc -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" + class LibslzConan(ConanFile): name = "libslz" description = "Simple, modern libpng alternative " - topics = ("zlib", "compression",) license = "X11" url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.libslz.org/" + topics = ("zlib", "compression") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,14 +27,9 @@ class LibslzConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -36,31 +37,34 @@ 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 validate(self): if is_msvc(self): - raise ConanInvalidConfiguration("{}/{} does not support Visual Studio.".format(self.name, self.version)) + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC.") 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.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) - cmake = self._configure_cmake() + copy(self, "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/libslz/all/test_package/CMakeLists.txt b/recipes/libslz/all/test_package/CMakeLists.txt index 13e3af8ad27912..14c66f6f3d628f 100644 --- a/recipes/libslz/all/test_package/CMakeLists.txt +++ b/recipes/libslz/all/test_package/CMakeLists.txt @@ -1,10 +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(TARGETS) - -find_package(libslz REQUIRED) +find_package(libslz REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} libslz::libslz) diff --git a/recipes/libslz/all/test_package/conanfile.py b/recipes/libslz/all/test_package/conanfile.py index 19e6a0c06e3d81..fae501d0afb9e4 100644 --- a/recipes/libslz/all/test_package/conanfile.py +++ b/recipes/libslz/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" + generators = "CMakeDeps", "CMakeToolchain" + 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/libslz/all/test_v1_package/CMakeLists.txt b/recipes/libslz/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libslz/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/libslz/all/test_v1_package/conanfile.py b/recipes/libslz/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/libslz/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/libsndfile/all/conandata.yml b/recipes/libsndfile/all/conandata.yml index 77ba2985f3b59d..cc9d3fa6bc38cb 100644 --- a/recipes/libsndfile/all/conandata.yml +++ b/recipes/libsndfile/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.2": + url: "https://github.com/libsndfile/libsndfile/releases/download/1.2.2/libsndfile-1.2.2.tar.xz" + sha256: "3799ca9924d3125038880367bf1468e53a1b7e3686a934f098b7e1d286cdb80e" "1.2.0": url: "https://github.com/libsndfile/libsndfile/releases/download/1.2.0/libsndfile-1.2.0.tar.xz" sha256: "0e30e7072f83dc84863e2e55f299175c7e04a5902ae79cfb99d4249ee8f6d60a" @@ -12,6 +15,10 @@ sources: url: "https://github.com/libsndfile/libsndfile/releases/download/v1.0.29/libsndfile-1.0.29.tar.bz2" sha256: "2ba20d44817c8176f097ab25eff44ef0aeec9e00973def5a7174c5ae0764b22f" patches: + "1.2.2": + - patch_file: "patches/1.0.31-0001-fix-msvc-runtime-logic.patch" + patch_description: "always set CMP0091" + patch_type: "portability" "1.2.0": - patch_file: "patches/1.0.31-0001-fix-msvc-runtime-logic.patch" patch_description: "always set CMP0091" diff --git a/recipes/libsndfile/all/conanfile.py b/recipes/libsndfile/all/conanfile.py index ef6e2406db7619..6ce8582b646858 100644 --- a/recipes/libsndfile/all/conanfile.py +++ b/recipes/libsndfile/all/conanfile.py @@ -58,12 +58,12 @@ def layout(self): def requirements(self): if self.options.get_safe("with_alsa"): - self.requires("libalsa/1.2.7.2") + self.requires("libalsa/1.2.10") if self.options.with_external_libs: self.requires("ogg/1.3.5") self.requires("vorbis/1.3.7") self.requires("flac/1.4.2") - self.requires("opus/1.3.1") + self.requires("opus/1.4") if self.options.get_safe("with_mpeg", False): self.requires("mpg123/1.31.2") self.requires("libmp3lame/3.100") @@ -92,7 +92,8 @@ def generate(self): if is_msvc(self) and Version(self.version) < "1.0.30": tc.variables["ENABLE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.variables["BUILD_REGTEST"] = False - if Version(self.version) > "1.11.0": + # https://github.com/libsndfile/libsndfile/commit/663a59aa6ea5e24cf5159b8e1c2b0735712ea74e#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20a + if Version(self.version) >= "1.1.0": tc.variables["ENABLE_MPEG"] = self.options.with_mpeg # Fix iOS/tvOS/watchOS tc.variables["CMAKE_MACOSX_BUNDLE"] = False diff --git a/recipes/libsndfile/config.yml b/recipes/libsndfile/config.yml index 2248a847a68f02..47a9d6a6d063ea 100644 --- a/recipes/libsndfile/config.yml +++ b/recipes/libsndfile/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.2": + folder: "all" "1.2.0": folder: "all" "1.0.31": diff --git a/recipes/libsodium/all/conandata.yml b/recipes/libsodium/all/conandata.yml index d0974216f8865e..c399471111c38b 100644 --- a/recipes/libsodium/all/conandata.yml +++ b/recipes/libsodium/all/conandata.yml @@ -1,6 +1,9 @@ # To update the version on CCI, add a new cci.date entry from the stable branch: # https://github.com/jedisct1/libsodium/commits/stable sources: + "1.0.19": + url: "https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz" + sha256: "018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea" "1.0.18": url: "https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz" sha256: "6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1" diff --git a/recipes/libsodium/config.yml b/recipes/libsodium/config.yml index 819e72ce108262..4dfbbb5c3d410c 100644 --- a/recipes/libsodium/config.yml +++ b/recipes/libsodium/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.19": + folder: all "1.0.18": folder: all "cci.20220430": 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/libspng/all/conanfile.py b/recipes/libspng/all/conanfile.py index b9d182dd24f28f..f151ee813b2194 100644 --- a/recipes/libspng/all/conanfile.py +++ b/recipes/libspng/all/conanfile.py @@ -47,7 +47,7 @@ def requirements(self): if self.options.with_miniz: self.requires("miniz/3.0.2") else: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libssh2/all/conandata.yml b/recipes/libssh2/all/conandata.yml index f30a9ab38ce9b7..46c0ee9468864d 100644 --- a/recipes/libssh2/all/conandata.yml +++ b/recipes/libssh2/all/conandata.yml @@ -1,7 +1,7 @@ sources: "1.11.0": - sha256: 3736161e41e2693324deb38c26cfdc3efe6209d634ba4258db1cecff6a5ad461 - url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.0/libssh2-1.11.0.tar.gz + sha256: a488a22625296342ddae862de1d59633e6d446eff8417398e06674a49be3d7c2 + url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.0/libssh2-1.11.0.tar.xz "1.10.0": sha256: 2d64e90f3ded394b91d3a2e774ca203a4179f69aebee03003e5a6fa621e41d51 url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.10.0/libssh2-1.10.0.tar.gz diff --git a/recipes/libssh2/all/conanfile.py b/recipes/libssh2/all/conanfile.py index eb8b1cad9c233d..3ccfe30d867cce 100644 --- a/recipes/libssh2/all/conanfile.py +++ b/recipes/libssh2/all/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, collect_libs from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -80,12 +81,14 @@ def configure(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.crypto_backend == "openssl": self.requires("openssl/[>=1.1 <4]") elif self.options.crypto_backend == "mbedtls": - # libssh2/<=1.10.0 doesn't support mbedtls/3.x.x - self.requires("mbedtls/2.25.0") + if Version(self.version) >= "1.11": + self.requires("mbedtls/3.5.0") + else: + self.requires("mbedtls/2.28.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libssh2/all/patches/0001-threads.patch b/recipes/libssh2/all/patches/0001-threads.patch deleted file mode 100644 index 05985dac07a46e..00000000000000 --- a/recipes/libssh2/all/patches/0001-threads.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index eee1a80..3373f2a 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -42,6 +42,11 @@ include(CheckSymbolExists) - include(CheckNonblockingSocketSupport) - include(SocketLibraries) - -+if(UNIX AND NOT APPLE) -+ find_package(Threads REQUIRED) -+ list(APPEND LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) -+endif() -+ - ## Cryptography backend choice - - set(CRYPTO_BACKEND diff --git a/recipes/libsvm/all/conandata.yml b/recipes/libsvm/all/conandata.yml index 5712311441eb33..4ce3fd15b7dbaa 100644 --- a/recipes/libsvm/all/conandata.yml +++ b/recipes/libsvm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "332": + url: "https://github.com/cjlin1/libsvm/archive/v332.tar.gz" + sha256: "e1d7d316112d199ebd69c9695f79226d236b86e2c8d88e70cfe35fd383954ed8" "330": url: "https://github.com/cjlin1/libsvm/archive/v330.tar.gz" sha256: "e4fe41308c87cc210aec73e4f5f0fb4da14234d90e7a131763fbad3788ca2d80" diff --git a/recipes/libsvm/config.yml b/recipes/libsvm/config.yml index 026fbb9e303568..c1b9e6f3043949 100644 --- a/recipes/libsvm/config.yml +++ b/recipes/libsvm/config.yml @@ -1,4 +1,6 @@ versions: + "332": + folder: all "330": folder: all "325": diff --git a/recipes/libsvtav1/all/conandata.yml b/recipes/libsvtav1/all/conandata.yml index 74d595eb1046fb..54555aa218224f 100644 --- a/recipes/libsvtav1/all/conandata.yml +++ b/recipes/libsvtav1/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.7.0": + url: "https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.7.0/SVT-AV1-v1.7.0.tar.gz" + sha256: "ce0973584f1a187aa4abf63f509ff8464397120878e322a3153f87e9c161fc4f" + "1.6.0": + url: https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.6.0/SVT-AV1-v1.6.0.tar.bz2 + sha256: c6b49111a2d4c5113f1ada0c2f716d94bd4a8db704623d453066826401ecdab5 "1.4.1": url: https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.4.1/SVT-AV1-v1.4.1.tar.bz2 sha256: 0e988582f315fe76c909accf5e7f81b975c5bd2b850ee760d8e9fac297f70b5d diff --git a/recipes/libsvtav1/config.yml b/recipes/libsvtav1/config.yml index 37cfc8825c04fd..c8fea3589a745b 100644 --- a/recipes/libsvtav1/config.yml +++ b/recipes/libsvtav1/config.yml @@ -1,4 +1,8 @@ versions: + "1.7.0": + folder: all + "1.6.0": + folder: all "1.4.1": folder: all "1.3.0": diff --git a/recipes/libsystemd/all/conandata.yml b/recipes/libsystemd/all/conandata.yml index d4431fac17cc4a..4c9f3dfcddb62d 100644 --- a/recipes/libsystemd/all/conandata.yml +++ b/recipes/libsystemd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "253.10": + url: "https://github.com/systemd/systemd-stable/archive/v253.10.tar.gz" + sha256: "7c869513b2ad015568e8e35304942f84378b0c59972cb44de5ac905b8eea08d4" "253.6": url: "https://github.com/systemd/systemd-stable/archive/v253.6.tar.gz" sha256: "a0aebcfaa2e001a4d846691631d1722c4cfa1a175e4ea62db6edca0ea3cf1e3e" @@ -24,6 +27,17 @@ sources: url: "https://github.com/systemd/systemd-stable/archive/v246.16.tar.gz" sha256: "b69f9940d65870f090269a28f1047a633d4b80d0001e091d53a031dd40a822d2" patches: + "253.10": + - patch_file: "patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" + patch_description: "allow to use meson.build with older versions of Python by replacing utf8 message to ascii message in the helper script" + patch_type: "conan" + - patch_file: "patches/251.15/0001-Remove-dependency-from-coreutils.patch" + patch_description: "allow to build in environments without 'realpath --relative-to' by replacing it with conan-specific build variable" + patch_type: "conan" + - patch_file: "patches/253.3/0002-meson-use-c_args-in-generator-scripts.patch" + patch_source: "https://patch-diff.githubusercontent.com/raw/systemd/systemd/pull/29538" + patch_description: "fixes cross-compilation by passing necessary compiler arguments to generator scripts" + patch_type: "portability" "253.6": - patch_file: "patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" patch_description: "allow to use meson.build with older versions of Python by replacing utf8 message to ascii message in the helper script" @@ -31,6 +45,10 @@ patches: - patch_file: "patches/251.15/0001-Remove-dependency-from-coreutils.patch" patch_description: "allow to build in environments without 'realpath --relative-to' by replacing it with conan-specific build variable" patch_type: "conan" + - patch_file: "patches/253.3/0002-meson-use-c_args-in-generator-scripts.patch" + patch_source: "https://patch-diff.githubusercontent.com/raw/systemd/systemd/pull/29538" + patch_description: "fixes cross-compilation by passing necessary compiler arguments to generator scripts" + patch_type: "portability" "253.3": - patch_file: "patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" patch_description: "allow to use meson.build with older versions of Python by replacing utf8 message to ascii message in the helper script" @@ -38,6 +56,10 @@ patches: - patch_file: "patches/251.15/0001-Remove-dependency-from-coreutils.patch" patch_description: "allow to build in environments without 'realpath --relative-to' by replacing it with conan-specific build variable" patch_type: "conan" + - patch_file: "patches/253.3/0002-meson-use-c_args-in-generator-scripts.patch" + patch_source: "https://patch-diff.githubusercontent.com/raw/systemd/systemd/pull/29538" + patch_description: "fixes cross-compilation by passing necessary compiler arguments to generator scripts" + patch_type: "portability" "252.9": - patch_file: "patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" patch_description: "allow to use meson.build with older versions of Python by replacing utf8 message to ascii message in the helper script" diff --git a/recipes/libsystemd/all/conanfile.py b/recipes/libsystemd/all/conanfile.py index 7d0c3d3c0590fa..4632a3731b01e2 100644 --- a/recipes/libsystemd/all/conanfile.py +++ b/recipes/libsystemd/all/conanfile.py @@ -52,7 +52,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libcap/2.68") + self.requires("libcap/2.69") self.requires("libmount/2.39") if Version(self.version) >= "253.6": self.requires("libxcrypt/4.4.35") @@ -61,7 +61,7 @@ def requirements(self): if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_xz: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.4") if self.options.with_zstd: self.requires("zstd/1.5.5") @@ -70,11 +70,11 @@ def validate(self): raise ConanInvalidConfiguration("Only Linux supported") def build_requirements(self): - self.tool_requires("meson/1.1.1") + self.tool_requires("meson/1.2.2") self.tool_requires("m4/1.4.19") self.tool_requires("gperf/3.1") 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) @@ -82,7 +82,7 @@ def source(self): @property def _so_version(self): meson_build = os.path.join(self.source_folder, "meson.build") - with open(meson_build, "r") as build_file: + with open(meson_build, "r", encoding="utf-8") as build_file: for line in build_file: match = re.match(r"^libsystemd_version = '(.*)'$", line) if match: diff --git a/recipes/libsystemd/all/patches/253.3/0002-meson-use-c_args-in-generator-scripts.patch b/recipes/libsystemd/all/patches/253.3/0002-meson-use-c_args-in-generator-scripts.patch new file mode 100644 index 00000000000000..478910e9a3aeb4 --- /dev/null +++ b/recipes/libsystemd/all/patches/253.3/0002-meson-use-c_args-in-generator-scripts.patch @@ -0,0 +1,33 @@ +From 7b110183b2607d57d399e977a96cb453aed37265 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Fri, 13 Oct 2023 09:41:00 -0500 +Subject: [PATCH] Revert "Revert "meson: use c_args in generator scripts + (#10289)"" + +This reverts commit 0e3cc902faec4f18d5fa606396f602b08bc94e27. + +Fixes #10288. +I have confirmed that this does now fix cross-compilation. +It appears that changes upstream in Meson, probably mesonbuild/meson#5263, have made the original MR, #10289, work now. + +This needs to be tested to ensure that it doesn't break Travis CI like when it was reverted in #10361. +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index d79263ea8b..87b5a76082 100644 +--- a/meson.build ++++ b/meson.build +@@ -498,7 +498,7 @@ if cxx_cmd != '' + add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp') + endif + +-cpp = ' '.join(cc.cmd_array()) + ' -E' ++cpp = ' '.join(cc.cmd_array() + get_option('c_args')) + ' -E' + + has_wstringop_truncation = cc.has_argument('-Wstringop-truncation') + +-- +2.41.0 + diff --git a/recipes/libsystemd/all/test_package/conanfile.py b/recipes/libsystemd/all/test_package/conanfile.py index 4fc0d2de603bc8..0e275799b53e7c 100644 --- a/recipes/libsystemd/all/test_package/conanfile.py +++ b/recipes/libsystemd/all/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 build(self): cmake = CMake(self) diff --git a/recipes/libsystemd/all/test_v1_package/conanfile.py b/recipes/libsystemd/all/test_v1_package/conanfile.py index e6b0fdb8110e8d..b3607270e232e7 100644 --- a/recipes/libsystemd/all/test_v1_package/conanfile.py +++ b/recipes/libsystemd/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/libsystemd/config.yml b/recipes/libsystemd/config.yml index f5844863606911..e30829e3e34741 100644 --- a/recipes/libsystemd/config.yml +++ b/recipes/libsystemd/config.yml @@ -1,4 +1,6 @@ versions: + "253.10": + folder: all "253.6": folder: all "253.3": diff --git a/recipes/libtar/all/conanfile.py b/recipes/libtar/all/conanfile.py index ee12aac6802ccf..18b7b52de3166f 100644 --- a/recipes/libtar/all/conanfile.py +++ b/recipes/libtar/all/conanfile.py @@ -46,7 +46,7 @@ def layout(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.settings.os == "Windows": diff --git a/recipes/libtasn1/all/conanfile.py b/recipes/libtasn1/all/conanfile.py index 069830d3c9f365..d1eea1562324a8 100644 --- a/recipes/libtasn1/all/conanfile.py +++ b/recipes/libtasn1/all/conanfile.py @@ -55,7 +55,11 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio") def build_requirements(self): - self.tool_requires("bison/3.8.2") + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.25") + else: + self.tool_requires("bison/3.8.2") + 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/libtiff/all/conandata.yml b/recipes/libtiff/all/conandata.yml index cc7431489956e4..96a6b01214da43 100644 --- a/recipes/libtiff/all/conandata.yml +++ b/recipes/libtiff/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.6.0": + url: "http://download.osgeo.org/libtiff/tiff-4.6.0.tar.gz" + sha256: "88b3979e6d5c7e32b50d7ec72fb15af724f6ab2cbf7e10880c360a77e4b5d99a" "4.5.1": url: "http://download.osgeo.org/libtiff/tiff-4.5.1.tar.gz" sha256: "d7f38b6788e4a8f5da7940c5ac9424f494d8a79eba53d555f4a507167dca5e2b" @@ -12,6 +15,10 @@ sources: url: "http://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz" sha256: "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8" patches: + "4.6.0": + - patch_file: "patches/4.5.1-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" "4.5.1": - patch_file: "patches/4.5.1-0001-cmake-dependencies.patch" patch_description: "CMake: robust handling of dependencies" diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index 6305fc3fa4a6f1..69046904447612 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -63,23 +63,23 @@ def layout(self): def requirements(self): if self.options.zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.libdeflate: - self.requires("libdeflate/1.18") + self.requires("libdeflate/1.19") if self.options.lzma: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.5") if self.options.jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.1") elif self.options.jpeg == "mozjpeg": - self.requires("mozjpeg/4.1.1") + self.requires("mozjpeg/4.1.5") if self.options.jbig: self.requires("jbig/20160605") if self.options.zstd: self.requires("zstd/1.5.5") if self.options.webp: - self.requires("libwebp/1.3.1") + self.requires("libwebp/1.3.2") def validate(self): if self.options.libdeflate and not self.options.zlib: diff --git a/recipes/libtiff/config.yml b/recipes/libtiff/config.yml index 961a315dc8eb68..d9523166c18939 100644 --- a/recipes/libtiff/config.yml +++ b/recipes/libtiff/config.yml @@ -1,4 +1,6 @@ versions: + "4.6.0": + folder: all "4.5.1": folder: all "4.5.0": diff --git a/recipes/libtins/all/conandata.yml b/recipes/libtins/all/conandata.yml index d565c818eeabe6..ee42178c90b269 100644 --- a/recipes/libtins/all/conandata.yml +++ b/recipes/libtins/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.5": + url: "https://github.com/mfontanini/libtins/archive/v4.5.tar.gz" + sha256: "6ff5fe1ada10daef8538743dccb9c9b3e19d05d028ffdc24838e62ff3fc55841" "4.4": url: "https://github.com/mfontanini/libtins/archive/v4.4.tar.gz" sha256: "ff0121b4ec070407e29720c801b7e1a972042300d37560a62c57abadc9635634" diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index 7bca8b98f2ebbd..c84ea4afb38c09 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -3,7 +3,7 @@ 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 copy, get, replace_in_file, rm, rmdir +from conan.tools.files import copy, get, rm, rmdir required_conan_version = ">=1.53.0" @@ -58,12 +58,12 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libpcap/1.10.1", transitive_headers=True, transitive_libs=True) + self.requires("libpcap/1.10.4", transitive_headers=True, transitive_libs=True) if self.options.with_ack_tracker or self.options.with_tcp_stream_custom_data: # Used in two public headers: # - https://github.com/mfontanini/libtins/blob/v4.4/include/tins/tcp_ip/ack_tracker.h#L38 # - https://github.com/mfontanini/libtins/blob/v4.4/include/tins/tcp_ip/stream.h#L48 - self.requires("boost/1.81.0", transitive_headers=True) + self.requires("boost/1.83.0", transitive_headers=True) if self.options.with_wpa2: self.requires("openssl/[>=1.1 <4]") diff --git a/recipes/libtins/all/test_package/CMakeLists.txt b/recipes/libtins/all/test_package/CMakeLists.txt index 94a84063fcb9ff..9df74f0fcf532f 100644 --- a/recipes/libtins/all/test_package/CMakeLists.txt +++ b/recipes/libtins/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(libtins REQUIRED CONFIG) diff --git a/recipes/libtins/config.yml b/recipes/libtins/config.yml index ce55c187fafe1c..a962f30c14fe9e 100644 --- a/recipes/libtins/config.yml +++ b/recipes/libtins/config.yml @@ -1,4 +1,6 @@ versions: + "4.5": + folder: all "4.4": folder: all "4.3": diff --git a/recipes/libtool/all/conanfile.py b/recipes/libtool/all/conanfile.py index 6f90b31da6ebcc..d832ae4219971f 100644 --- a/recipes/libtool/all/conanfile.py +++ b/recipes/libtool/all/conanfile.py @@ -54,7 +54,7 @@ def requirements(self): #TODO: consider adding m4 as direct dependency, perhaps when we start using version ranges. # https://github.com/conan-io/conan-center-index/pull/16248#discussion_r1116332095 - #self.requires("m4/1.4.19") + #self.requires("m4/1.4.19") @property def _settings_build(self): @@ -72,8 +72,7 @@ def build_requirements(self): self.tool_requires("msys2/cci.latest") 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 _datarootdir(self): @@ -230,12 +229,8 @@ def package_info(self): self.buildenv_info.append_path("AUTOMAKE_CONAN_INCLUDES", libtool_aclocal_dir) self.runenv_info.append_path("ACLOCAL_PATH", libtool_aclocal_dir) self.runenv_info.append_path("AUTOMAKE_CONAN_INCLUDES", libtool_aclocal_dir) - - # For Conan 1.x downstream consumers, can be removed once recipe is Conan 1.x only: - bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH env: bin_path{bin_path}") - self.env_info.PATH.append(bin_path) + # For Conan 1.x downstream consumers, can be removed once recipe is Conan 1.x only: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) self.env_info.ACLOCAL_PATH.append(unix_path_package_info_legacy(self, libtool_aclocal_dir)) self.env_info.AUTOMAKE_CONAN_INCLUDES.append(unix_path_package_info_legacy(self, libtool_aclocal_dir)) - diff --git a/recipes/libucl/all/conanfile.py b/recipes/libucl/all/conanfile.py index 99131d4e958635..f81b0da5448414 100644 --- a/recipes/libucl/all/conanfile.py +++ b/recipes/libucl/all/conanfile.py @@ -46,11 +46,11 @@ def layout(self): def requirements(self): if self.options.enable_url_include: - self.requires("libcurl/7.86.0") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.enable_url_sign: - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") if self.options.with_lua == "lua": - self.requires("lua/5.4.4") + self.requires("lua/5.4.6") elif self.options.with_lua == "luajit": self.requires("luajit/2.0.5") diff --git a/recipes/libunwind/all/conandata.yml b/recipes/libunwind/all/conandata.yml index 933dd5e18e6e00..baa8d36f9cd17a 100644 --- a/recipes/libunwind/all/conandata.yml +++ b/recipes/libunwind/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.2": + url: "https://github.com/libunwind/libunwind/releases/download/v1.7.2/libunwind-1.7.2.tar.gz" + sha256: "a18a6a24307443a8ace7a8acc2ce79fbbe6826cd0edf98d6326d0225d6a5d6e6" "1.7.0": url: "https://github.com/libunwind/libunwind/releases/download/v1.7.0/libunwind-1.70.tar.gz" sha256: "c24c913d2337d6eff851b6ab32aadfb683a86fee48d28fe1fc9cd56c8e9dfa58" diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py index bf9a535448738c..002c9bf613f236 100644 --- a/recipes/libunwind/all/conanfile.py +++ b/recipes/libunwind/all/conanfile.py @@ -53,9 +53,9 @@ def layout(self): def requirements(self): if self.options.minidebuginfo: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.5") if self.options.zlibdebuginfo: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: diff --git a/recipes/libunwind/config.yml b/recipes/libunwind/config.yml index 06062bdf416822..ce44762c05da15 100644 --- a/recipes/libunwind/config.yml +++ b/recipes/libunwind/config.yml @@ -1,4 +1,6 @@ versions: + "1.7.2": + folder: all "1.7.0": folder: all "1.6.2": 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/libuvc/all/conanfile.py b/recipes/libuvc/all/conanfile.py index c10470d935e60c..cb9de052b88cd4 100644 --- a/recipes/libuvc/all/conanfile.py +++ b/recipes/libuvc/all/conanfile.py @@ -60,9 +60,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.1") + self.requires("mozjpeg/4.1.3") def package_id(self): # TODO: to remove once deprecated jpeg_turbo option removed @@ -77,7 +77,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.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/libverto/all/conanfile.py b/recipes/libverto/all/conanfile.py index a35c9bf481ff4e..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.76.0") + 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.3") + 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/libvips/all/conanfile.py b/recipes/libvips/all/conanfile.py index e977e0d7cab2b1..4e9baa365d40f7 100644 --- a/recipes/libvips/all/conanfile.py +++ b/recipes/libvips/all/conanfile.py @@ -1,8 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.build import can_run -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +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 @@ -10,7 +9,7 @@ from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" class LibvipsConan(ConanFile): @@ -117,11 +116,11 @@ def layout(self): def requirements(self): self.requires("expat/2.5.0") - self.requires("glib/2.76.1", transitive_headers=True, transitive_libs=True, run=can_run(self)) + self.requires("glib/2.78.1", transitive_headers=True, transitive_libs=True) if self.options.with_cfitsio: - self.requires("cfitsio/4.1.0") + self.requires("cfitsio/4.3.0") if self.options.with_cgif: - self.requires("cgif/0.3.0") + self.requires("cgif/0.3.2") if self.options.with_exif: self.requires("libexif/0.6.24") if self.options.with_fftw: @@ -129,13 +128,13 @@ def requirements(self): if self.options.with_fontconfig: self.requires("fontconfig/2.14.2") if self.options.with_heif: - self.requires("libheif/1.13.0") + self.requires("libheif/1.16.2") 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.1") elif self.options.with_jpeg == "mozjpeg": - self.requires("mozjpeg/4.1.1") + self.requires("mozjpeg/4.1.5") if self.options.with_jpeg_xl: self.requires("libjxl/0.6.1") if self.options.with_lcms: @@ -143,27 +142,27 @@ def requirements(self): if self.options.with_magick: self.requires("imagemagick/7.0.11-14") if self.options.with_matio: - self.requires("matio/1.5.23") + self.requires("matio/1.5.24") if self.options.with_openexr: - self.requires("openexr/3.1.5") + self.requires("openexr/3.2.1") if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_pangocairo: self.requires("pango/1.50.10") if self.options.with_pdfium: - self.requires("pdfium/cci.20210730") + self.requires("pdfium/95.0.4629") if self.options.with_png == "libpng": - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") elif self.options.with_png == "libspng": - self.requires("libspng/0.7.3") + self.requires("libspng/0.7.4") if self.options.with_poppler: self.requires("poppler/21.07.0") if self.options.with_tiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.6.0") if self.options.with_webp: - self.requires("libwebp/1.3.0") + self.requires("libwebp/1.3.2") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.options.vapi and not self.options.introspection: @@ -200,13 +199,19 @@ def validate(self): raise ConanInvalidConfiguration("librsvg recipe not available in conancenter yet") def build_requirements(self): - self.tool_requires("meson/1.0.1") + self.tool_requires("meson/1.3.0") 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.introspection: self.tool_requires("gobject-introspection/1.72.0") - if not can_run(self): - self.tool_requires("glib/2.76.1") + self.tool_requires("glib/") + + if self.settings.os == "Macos": + # Avoid using gettext from homebrew which may be linked against + # a different/incompatible libiconv than the one being exposed + # in the runtime environment (DYLD_LIBRARY_PATH) + # See https://github.com/conan-io/conan-center-index/pull/17502#issuecomment-1542492466 + self.tool_requires("gettext/0.21") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -214,9 +219,6 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if can_run(self): - env = VirtualRunEnv(self) - env.generate(scope="build") tc = MesonToolchain(self) true_false = lambda v: "true" if v else "false" @@ -279,6 +281,12 @@ def _patch_sources(self): replace_in_file(self, meson_build, "subdir('test')", "") replace_in_file(self, meson_build, "subdir('fuzz')", "") + # workaround https://github.com/conan-io/conan/issues/14213 + replace_in_file(self, meson_build, + "cfg_var.set_quoted('VIPS_PREFIX', prefix_dir)", + "cfg_var.set_quoted('VIPS_PREFIX', prefix_dir.replace('\\\\', '/'))" + ) + def build(self): self._patch_sources() meson = Meson(self) diff --git a/recipes/libvpx/all/conandata.yml b/recipes/libvpx/all/conandata.yml index a64c42db322ce5..6d2cd134990151 100644 --- a/recipes/libvpx/all/conandata.yml +++ b/recipes/libvpx/all/conandata.yml @@ -1,26 +1,33 @@ sources: + "1.13.1": + url: "https://github.com/webmproject/libvpx/archive/refs/tags/v1.13.1.tar.gz" + sha256: "00dae80465567272abd077f59355f95ac91d7809a2d3006f9ace2637dd429d14" "1.11.0": - url: "https://github.com/webmproject/libvpx/archive/v1.11.0.tar.gz" + url: "https://github.com/webmproject/libvpx/archive/refs/tags/v1.11.0.tar.gz" sha256: "965e51c91ad9851e2337aebcc0f517440c637c506f3a03948062e3d5ea129a83" "1.10.0": - url: "https://github.com/webmproject/libvpx/archive/v1.10.0.tar.gz" + url: "https://github.com/webmproject/libvpx/archive/refs/tags/v1.10.0.tar.gz" sha256: "85803ccbdbdd7a3b03d930187cb055f1353596969c1f92ebec2db839fa4f834a" "1.9.0": - url: "https://github.com/webmproject/libvpx/archive/v1.9.0.tar.gz" + url: "https://github.com/webmproject/libvpx/archive/refs/tags/v1.9.0.tar.gz" sha256: "d279c10e4b9316bf11a570ba16c3d55791e1ad6faa4404c67422eb631782c80a" patches: "1.11.0": - patch_file: "patches/0001-extended-support-1.10.0.patch" patch_type: "portability" patch_description: "Add support for more compilers" + patch_source: "https://github.com/webmproject/libvpx/commit/cafe7cc1f10cfea74edb2ded7c3df2d69fcf1eee" "1.10.0": - patch_file: "patches/0001-extended-support-1.10.0.patch" patch_type: "portability" patch_description: "Add support for more compilers" + patch_source: "https://github.com/webmproject/libvpx/commit/cafe7cc1f10cfea74edb2ded7c3df2d69fcf1eee" "1.9.0": - patch_file: "patches/0001-extended-support-1.9.0.patch" patch_type: "portability" patch_description: "Add support for more compilers" + patch_source: "https://github.com/webmproject/libvpx/commit/cafe7cc1f10cfea74edb2ded7c3df2d69fcf1eee" - patch_file: "patches/0002-msvc_conan_build.patch" patch_type: "portability" patch_description: "Add support for more compilers" + patch_source: "https://github.com/webmproject/libvpx/commit/04086a30664d2a3e89d6a6e4e1c18f1a82c8f958" diff --git a/recipes/libvpx/all/conanfile.py b/recipes/libvpx/all/conanfile.py index e431a16c35a921..42873e7560c7df 100644 --- a/recipes/libvpx/all/conanfile.py +++ b/recipes/libvpx/all/conanfile.py @@ -53,15 +53,16 @@ def config_options(self): delattr(self.options, name) def configure(self): - if self.options.shared: + if self.settings.os == "Windows": + del self.options.shared + self.package_type = "static-library" + if self.options.get_safe("shared"): self.options.rm_safe("fPIC") def layout(self): basic_layout(self, src_folder="src") def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Windows shared builds are not supported") if str(self.settings.compiler) not in ["Visual Studio", "msvc", "gcc", "clang", "apple-clang"]: raise ConanInvalidConfiguration(f"Unsupported compiler {self.settings.compiler}") if self.settings.os == "Macos" and self.settings.arch == "armv8" and Version(self.version) < "1.10.0": @@ -255,7 +256,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("pkg_config_name", "vpx") self.cpp_info.libs = [self._lib_name] - if not self.options.shared: + if not self.options.get_safe("shared"): libcxx = stdcpp_library(self) if libcxx: self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/libvpx/config.yml b/recipes/libvpx/config.yml index 460cf69bd04b27..a39af339558384 100644 --- a/recipes/libvpx/config.yml +++ b/recipes/libvpx/config.yml @@ -1,4 +1,6 @@ versions: + "1.13.1": + folder: all "1.11.0": folder: all "1.10.0": diff --git a/recipes/libwebm/all/conandata.yml b/recipes/libwebm/all/conandata.yml index d6b7a70fca5c64..18c5b099c2c71c 100644 --- a/recipes/libwebm/all/conandata.yml +++ b/recipes/libwebm/all/conandata.yml @@ -1,3 +1,5 @@ sources: + '1.0.0.31': + url: 'https://chromium.googlesource.com/webm/libwebm/+archive/libwebm-1.0.0.31.tar.gz' '1.0.0.30': url: 'https://chromium.googlesource.com/webm/libwebm/+archive/libwebm-1.0.0.30.tar.gz' diff --git a/recipes/libwebm/all/test_package/conanfile.py b/recipes/libwebm/all/test_package/conanfile.py index 0a6bc68712d901..b02549cdf82ed9 100644 --- a/recipes/libwebm/all/test_package/conanfile.py +++ b/recipes/libwebm/all/test_package/conanfile.py @@ -1,12 +1,11 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, cmake_layout +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os - class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def layout(self): @@ -15,6 +14,15 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + def generate(self): + tc = CMakeToolchain(self) + # Later versions of the library use prefixed headers, 1.0.0.30 is the only + # version supported by this recipe that does not. + if self.dependencies[self.tested_reference_str].ref.version == "1.0.0.30": + tc.preprocessor_definitions["UNPREFIXED_HEADERS"] = "1" + + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libwebm/all/test_package/test_package.cpp b/recipes/libwebm/all/test_package/test_package.cpp index 4d44f2363caf22..07d201d6d4f515 100644 --- a/recipes/libwebm/all/test_package/test_package.cpp +++ b/recipes/libwebm/all/test_package/test_package.cpp @@ -1,7 +1,13 @@ #include #include + +#ifdef UNPREFIXED_HEADERS #include #include +#else +#include +#include +#endif // UNPREFIXED_HEADERS int main(void) { int32_t major, minor, build, revision; diff --git a/recipes/libwebm/config.yml b/recipes/libwebm/config.yml index d9683e805a917d..71746ecdc81bd8 100644 --- a/recipes/libwebm/config.yml +++ b/recipes/libwebm/config.yml @@ -1,3 +1,5 @@ versions: + '1.0.0.31': + folder: all '1.0.0.30': folder: all diff --git a/recipes/libwebp/all/conandata.yml b/recipes/libwebp/all/conandata.yml index b036ea65e60550..0aaa6446c54828 100644 --- a/recipes/libwebp/all/conandata.yml +++ b/recipes/libwebp/all/conandata.yml @@ -1,65 +1,31 @@ sources: + "1.3.2": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.2.tar.gz" + sha256: "2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562aa09b4" "1.3.1": url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.1.tar.gz" sha256: "b3779627c2dfd31e3d8c4485962c2efe17785ef975e2be5c8c0c9e6cd3c4ef66" - "1.3.0": - url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.0.tar.gz" - sha256: "64ac4614db292ae8c5aa26de0295bf1623dbb3985054cb656c55e67431def17c" "1.2.4": url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.4.tar.gz" sha256: "7bf5a8a28cc69bcfa8cb214f2c3095703c6b73ac5fba4d5480c205331d9494df" - "1.2.3": - url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.3.tar.gz" - sha256: "f5d7ab2390b06b8a934a4fc35784291b3885b557780d099bd32f09241f9d83f9" - "1.2.2": - url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2.tar.gz" - sha256: "7656532f837af5f4cec3ff6bafe552c044dc39bf453587bd5b77450802f4aee6" - "1.2.1": - url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.1.tar.gz" - sha256: "808b98d2f5b84e9b27fdef6c5372dac769c3bda4502febbfa5031bd3c4d7d018" - "1.2.0": - url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.0.tar.gz" - sha256: "2fc8bbde9f97f2ab403c0224fb9ca62b2e6852cbc519e91ceaa7c153ffd88a0c" "1.1.0": url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.1.0.tar.gz" sha256: "98a052268cc4d5ece27f76572a7f50293f439c17a98e67c4ea0c7ed6f50ef043" - "1.0.3": - url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.3.tar.gz" - sha256: "e20a07865c8697bba00aebccc6f54912d6bc333bb4d604e6b07491c1a226b34f" patches: - "1.3.1": + "1.3.2": - patch_file: "patches/1.3.1-0001-fix-cmake.patch" patch_description: "disable PIC, disable prefix library name on MSVC" patch_type: "conan" - "1.3.0": - - patch_file: "patches/1.3.0-0001-fix-cmake.patch" + "1.3.1": + - patch_file: "patches/1.3.1-0001-fix-cmake.patch" patch_description: "disable PIC, disable prefix library name on MSVC" patch_type: "conan" "1.2.4": - - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" - patch_description: "define WEBP_EXTERN for windows shared build" - patch_type: "portability" - "1.2.3": - - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" - patch_description: "define WEBP_EXTERN for windows shared build" - patch_type: "portability" - "1.2.2": - - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" - patch_description: "define WEBP_EXTERN for windows shared build" - patch_type: "portability" - "1.2.1": - - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" + - patch_file: "patches/1.1.0-0001-fix-dll-export.patch" patch_description: "define WEBP_EXTERN for windows shared build" patch_type: "portability" - "1.2.0": - - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" - patch_description: "define WEBP_EXTERN for windows shared build" - patch_type: "portability" - - patch_file: "patches/1.2.0-0003-build-libwebpmux.patch" - patch_description: "always build libwebpmux" - patch_type: "conan" "1.1.0": - - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" + - patch_file: "patches/1.1.0-0001-fix-dll-export.patch" patch_description: "define WEBP_EXTERN for windows shared build" patch_type: "portability" - patch_file: "patches/1.1.0-0002-qnx.patch" @@ -69,10 +35,3 @@ patches: - patch_file: "patches/1.1.0-0003-build-libwebpmux.patch" patch_description: "always build libwebpmux" patch_type: "conan" - "1.0.3": - - patch_file: "patches/1.0.3-0001-fix-dll-export.patch" - patch_description: "define WEBP_EXTERN for windows shared build" - patch_type: "portability" - - patch_file: "patches/1.0.3-0002-build-libwebpmux.patch" - patch_description: "always build libwebpmux" - patch_type: "conan" diff --git a/recipes/libwebp/all/conanfile.py b/recipes/libwebp/all/conanfile.py index 0044f425b95b10..5e7c1354176a42 100644 --- a/recipes/libwebp/all/conanfile.py +++ b/recipes/libwebp/all/conanfile.py @@ -55,10 +55,7 @@ def generate(self): tc = CMakeToolchain(self) # should be an option but it doesn't work yet tc.variables["WEBP_ENABLE_SIMD"] = self.options.with_simd - if Version(self.version) >= "1.0.0": - tc.variables["WEBP_NEAR_LOSSLESS"] = self.options.near_lossless - else: - tc.variables["WEBP_ENABLE_NEAR_LOSSLESS"] = self.options.near_lossless + tc.variables["WEBP_NEAR_LOSSLESS"] = self.options.near_lossless tc.variables["WEBP_ENABLE_SWAP_16BIT_CSP"] = self.options.swap_16bit_csp # avoid finding system libs tc.variables["CMAKE_DISABLE_FIND_PACKAGE_GIF"] = True diff --git a/recipes/libwebp/all/patches/1.0.3-0002-build-libwebpmux.patch b/recipes/libwebp/all/patches/1.0.3-0002-build-libwebpmux.patch deleted file mode 100644 index 0892ee3bdacd99..00000000000000 --- a/recipes/libwebp/all/patches/1.0.3-0002-build-libwebpmux.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -401,7 +401,7 @@ if(WEBP_BUILD_CWEBP) - install(TARGETS cwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() - --if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP) -+if(1) - parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS" "") - add_library(libwebpmux ${WEBP_MUX_SRCS}) - target_link_libraries(libwebpmux webp) diff --git a/recipes/libwebp/all/patches/1.0.3-0001-fix-dll-export.patch b/recipes/libwebp/all/patches/1.1.0-0001-fix-dll-export.patch similarity index 100% rename from recipes/libwebp/all/patches/1.0.3-0001-fix-dll-export.patch rename to recipes/libwebp/all/patches/1.1.0-0001-fix-dll-export.patch diff --git a/recipes/libwebp/all/patches/1.2.0-0003-build-libwebpmux.patch b/recipes/libwebp/all/patches/1.2.0-0003-build-libwebpmux.patch deleted file mode 100644 index 5f228670d57c89..00000000000000 --- a/recipes/libwebp/all/patches/1.2.0-0003-build-libwebpmux.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -449,7 +449,7 @@ if(WEBP_BUILD_CWEBP) - install(TARGETS cwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() - --if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP) -+if(1) - parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS" "") - add_library(libwebpmux ${WEBP_MUX_SRCS}) - target_link_libraries(libwebpmux webp) diff --git a/recipes/libwebp/all/patches/1.3.0-0001-fix-cmake.patch b/recipes/libwebp/all/patches/1.3.0-0001-fix-cmake.patch deleted file mode 100644 index f9c41d4f6a5417..00000000000000 --- a/recipes/libwebp/all/patches/1.3.0-0001-fix-cmake.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt -index 0a5af42..781f4c7 100644 ---- a/a/CMakeLists.txt -+++ b/b/CMakeLists.txt -@@ -58,7 +58,6 @@ if(WEBP_LINK_STATIC) - else() - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif() -- set(CMAKE_POSITION_INDEPENDENT_CODE ON) - # vwebp does not compile on Ubuntu with static libraries so disabling it for - # now. - set(WEBP_BUILD_VWEBP OFF) -@@ -142,7 +141,7 @@ endif() - set(PTHREAD_LIBS ${CMAKE_THREAD_LIBS_INIT}) - set(INSTALLED_LIBRARIES) - --if(MSVC) -+if(0) - # match the naming convention used by nmake - set(webp_libname_prefix "lib") - set(CMAKE_SHARED_LIBRARY_PREFIX "${webp_libname_prefix}") diff --git a/recipes/libwebp/config.yml b/recipes/libwebp/config.yml index 3bf80d4385ecdb..e184761fe568e1 100644 --- a/recipes/libwebp/config.yml +++ b/recipes/libwebp/config.yml @@ -1,19 +1,9 @@ versions: - "1.3.1": + "1.3.2": folder: all - "1.3.0": + "1.3.1": folder: all "1.2.4": folder: all - "1.2.3": - folder: all - "1.2.2": - folder: all - "1.2.1": - folder: all - "1.2.0": - folder: all "1.1.0": folder: all - "1.0.3": - folder: all diff --git a/recipes/libwebsockets/all/conanfile.py b/recipes/libwebsockets/all/conanfile.py index 12c738824025cf..0fd0cf66a67eaf 100644 --- a/recipes/libwebsockets/all/conanfile.py +++ b/recipes/libwebsockets/all/conanfile.py @@ -16,8 +16,9 @@ class LibwebsocketsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/warmcat/libwebsockets" license = "MIT" - topics = ("libwebsockets", "websocket") + topics = ("websocket") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -204,7 +205,7 @@ def configure(self): def requirements(self): if self.options.with_libuv: - self.requires("libuv/1.44.1") + self.requires("libuv/1.47.0") if self.options.with_libevent == "libevent": self.requires("libevent/2.1.12") @@ -212,23 +213,23 @@ def requirements(self): self.requires("libev/4.33") if self.options.with_zlib == "zlib": - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") elif self.options.with_zlib == "miniz": - self.requires("miniz/2.2.0") + self.requires("miniz/3.0.2") if self.options.with_libmount: - self.requires("libmount/2.36.2") + self.requires("libmount/2.39.2") if self.options.with_sqlite3: - self.requires("sqlite3/3.37.2") + self.requires("sqlite3/3.44.2") if self.options.with_ssl == "openssl": # Cannot add the [>=1.1 <4] range, as it seems openssl3 makes it fail - self.requires("openssl/1.1.1t", transitive_headers=True) + self.requires("openssl/1.1.1w", transitive_headers=True) elif self.options.with_ssl == "mbedtls": - self.requires("mbedtls/2.25.0") + self.requires("mbedtls/3.5.0") elif self.options.with_ssl == "wolfssl": - self.requires("wolfssl/4.8.1") + self.requires("wolfssl/5.6.3") def validate(self): if self.options.shared and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": @@ -270,7 +271,7 @@ def _cmakify_path_list(self, paths): def _find_library(self, libname, dep): prefix = "lib" if self.settings.os != "Windows" else "" - for path in self.dependencies[dep].cpp_info.libdirs: + for path in self.dependencies[dep].cpp_info.libdirs: lib_fullpath = os.path.join(path, prefix + libname + self._get_library_extension(dep)) self.output.info("Dependency library full path : " + str(lib_fullpath)) if os.path.isfile(lib_fullpath): @@ -426,13 +427,13 @@ def generate(self): def _patch_sources(self): cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - replace_in_file(self, + replace_in_file(self, cmakelists, "SET(CMAKE_INSTALL_NAME_DIR \"${CMAKE_INSTALL_PREFIX}/${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}\")", "", ) if Version(self.version) == "4.0.15" and self.options.with_ssl: - replace_in_file(self, + replace_in_file(self, cmakelists, "list(APPEND LIB_LIST ws2_32.lib userenv.lib psapi.lib iphlpapi.lib)", "list(APPEND LIB_LIST ws2_32.lib userenv.lib psapi.lib iphlpapi.lib crypt32.lib)" diff --git a/recipes/libx264/all/conanfile.py b/recipes/libx264/all/conanfile.py index d1bf4936ed733d..3312e7972a7a4b 100644 --- a/recipes/libx264/all/conanfile.py +++ b/recipes/libx264/all/conanfile.py @@ -91,6 +91,7 @@ def generate(self): args["--enable-pic"] = "" if self.settings.build_type == "Debug": args["--enable-debug"] = "" + if is_apple_os(self) and self.settings.arch == "armv8": # bitstream-a.S:29:18: error: unknown token in expression extra_asflags.append("-arch arm64") @@ -111,6 +112,7 @@ def generate(self): # FIXME: get using user_build_info env.define("AS", unix_path(self, os.path.join(self.dependencies.build["nasm"].package_folder, "bin", "nasm{}".format(".exe" if self.settings.os == "Windows" else "")))) env.vars(self).save_script("conanbuild_nasm") + if cross_building(self): if self.settings.os == "Android": # the as of ndk does not work well for building libx264 @@ -132,12 +134,23 @@ def generate(self): abi = "androideabi" if self.settings.arch == "armv7" else "android" args["--cross-prefix"] = f"{ndk_root}/bin/{arch}-linux-{abi}-" env.vars(self).save_script("conanbuild_android") + if is_msvc(self): env = Environment() env.define("CC", "cl -nologo") if check_min_vs(self, 180, False): extra_cflags.append("-FS") env.vars(self).save_script("conanbuild_msvc") + + if is_msvc(self) or self.settings.os in ["iOS", "watchOS", "tvOS"]: + # autotools does not know about the msvc and Apple embedded OS canonical name(s) + args["--build"] = None + args["--host"] = None + + # The finite-math-only optimization has no effect and can cause linking errors + # when linked against glibc >= 2.31 + extra_cflags += ["-fno-finite-math-only"] + if extra_asflags: args["--extra-asflags"] = " ".join(extra_asflags) if extra_cflags: diff --git a/recipes/libx265/all/conanfile.py b/recipes/libx265/all/conanfile.py index 4938bb30119502..677f51dce82b09 100644 --- a/recipes/libx265/all/conanfile.py +++ b/recipes/libx265/all/conanfile.py @@ -108,6 +108,11 @@ def _patch_sources(self): if self.settings.os == "Android": replace_in_file(self, cmakelists, "list(APPEND PLATFORM_LIBS pthread)", "") replace_in_file(self, cmakelists, "list(APPEND PLATFORM_LIBS rt)", "") + # The finite-math-only optimization has no effect and can cause linking errors + # when linked against glibc >= 2.31 + replace_in_file(self, cmakelists, + "add_definitions(-ffast-math)", + "add_definitions(-ffast-math -fno-finite-math-only)") def build(self): self._patch_sources() @@ -145,7 +150,7 @@ def package_info(self): if self.options.shared: self.cpp_info.defines.append("X265_API_IMPORTS") elif self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.extend(["dl", "pthread", "m"]) + self.cpp_info.system_libs.extend(["dl", "pthread", "m", "rt"]) if not self.options.shared: self.cpp_info.sharedlinkflags = ["-Wl,-Bsymbolic,-znoexecstack"] elif self.settings.os == "Android": 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/libxft/all/conandata.yml b/recipes/libxft/all/conandata.yml index e56e888b5fdb6d..83115b8c226aad 100644 --- a/recipes/libxft/all/conandata.yml +++ b/recipes/libxft/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.8": + url: "https://www.x.org/archive/individual/lib/libXft-2.3.8.tar.xz" + sha256: "5e8c3c4bc2d4c0a40aef6b4b38ed2fb74301640da29f6528154b5009b1c6dd49" "2.3.6": url: "https://www.x.org/archive/individual/lib/libXft-2.3.6.tar.gz" sha256: "b7e59f69e0bbabe9438088775f7e5a7c16a572e58b11f9722519385d38192df5" @@ -11,4 +14,3 @@ patches: patch_description: "fix gcc 5 and gcc 11 compilation" patch_type: "portability" patch_source: "https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/17" - base_path: "source_subfolder" diff --git a/recipes/libxft/all/conanfile.py b/recipes/libxft/all/conanfile.py index c237fe2cfea9c4..fdb9b1a6c86638 100644 --- a/recipes/libxft/all/conanfile.py +++ b/recipes/libxft/all/conanfile.py @@ -1,78 +1,86 @@ +import os + from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, chdir, rm, rmdir -from conans import AutoToolsBuildEnvironment -import functools +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.52.0" class libxftConan(ConanFile): name = "libxft" - description = 'X FreeType library' - topics = ("libxft", "x11", "xorg") + description = "X FreeType library" + license = "X11" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.x.org/wiki/" - license = "X11" + topics = ("x11", "xorg") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "pkg_config" - - @property - def _source_subfolder(self): - return "source_subfolder" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def export_sources(self): export_conandata_patches(self) + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): self.requires("xorg/system") - self.requires("freetype/2.13.0") - self.requires("fontconfig/2.14.2") + self.requires("freetype/2.13.2", transitive_headers=True) + self.requires("fontconfig/2.14.2", transitive_headers=True) def build_requirements(self): - self.build_requires("pkgconf/1.9.3") - self.build_requires("xorg-macros/1.19.3") - self.build_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") + self.tool_requires("xorg-macros/1.19.3") + self.tool_requires("libtool/2.4.7") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - if self.options.shared: - del self.options.fPIC + get(self, **self.conan_data["sources"][self.version], strip_root=True) - @functools.lru_cache(1) - def _configure_autotools(self): - args = ["--disable-dependency-tracking"] - if self.options.shared: - args.extend(["--disable-static", "--enable-shared"]) - else: - args.extend(["--disable-shared", "--enable-static"]) - autotools = AutoToolsBuildEnvironment(self) - autotools.configure(args=args, pkg_config_paths=self.build_folder) - return autotools + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-dependency-tracking") + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() def build(self): apply_conandata_patches(self) - with chdir(self, self._source_subfolder): - autotools = self._configure_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - with chdir(self, self._source_subfolder): - autotools = self._configure_autotools() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install(args=["-j1"]) rm(self, "*.la", f"{self.package_folder}/lib", recursive=True) rmdir(self, f"{self.package_folder}/lib/pkgconfig") rmdir(self, f"{self.package_folder}/share") def package_info(self): - self.cpp_info.names['pkg_config'] = "Xft" self.cpp_info.set_property("pkg_config_name", "xft") self.cpp_info.libs = ["Xft"] diff --git a/recipes/libxft/all/test_package/CMakeLists.txt b/recipes/libxft/all/test_package/CMakeLists.txt index e55ad61e844f5c..71362aacc231af 100644 --- a/recipes/libxft/all/test_package/CMakeLists.txt +++ b/recipes/libxft/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(libxft REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/libxft/all/test_package/conanfile.py b/recipes/libxft/all/test_package/conanfile.py index 49a3a66ea5bad4..ef5d7042163ecc 100644 --- a/recipes/libxft/all/test_package/conanfile.py +++ b/recipes/libxft/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,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/libxft/all/test_v1_package/CMakeLists.txt b/recipes/libxft/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libxft/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/libxft/all/test_v1_package/conanfile.py b/recipes/libxft/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/libxft/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/libxft/config.yml b/recipes/libxft/config.yml index 6caf25620b5dc3..d3f36d4632aefc 100644 --- a/recipes/libxft/config.yml +++ b/recipes/libxft/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.8": + folder: all "2.3.6": folder: all "2.3.4": diff --git a/recipes/libxlsxwriter/all/conanfile.py b/recipes/libxlsxwriter/all/conanfile.py index 0d8e6136fd0e5e..1c65ddbb9e2471 100644 --- a/recipes/libxlsxwriter/all/conanfile.py +++ b/recipes/libxlsxwriter/all/conanfile.py @@ -17,6 +17,7 @@ class LibxlsxwriterConan(ConanFile): topics = ("excel", "xlsx") description = "A C library for creating Excel XLSX files" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -55,9 +56,9 @@ def layout(self): def requirements(self): self.requires("minizip/1.2.13") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.md5 == "openssl": - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") def validate(self): if Version(self.version) < "1.0.6" and self.info.options.md5 == "openssl": diff --git a/recipes/libxml2/all/conandata.yml b/recipes/libxml2/all/conandata.yml index 1056eab90fe205..37ac179d3514e5 100644 --- a/recipes/libxml2/all/conandata.yml +++ b/recipes/libxml2/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.12.2": + url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.2.tar.xz" + sha256: "3f2e6464fa15073eb8f3d18602d54fafc489b7715171064615a40490c6be9f4f" + "2.12.1": + url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.1.tar.xz" + sha256: "8982b9ccdf7f456e30d8f7012d50858c6623e495333b6191def455c7e95427eb" + "2.11.5": + url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.5.tar.xz" + sha256: "3727b078c360ec69fa869de14bd6f75d7ee8d36987b071e6928d4720a28df3a6" "2.11.4": url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.4.tar.xz" sha256: "737e1d7f8ab3f139729ca13a2494fd17bf30ddb4b7a427cf336252cab57f57f7" diff --git a/recipes/libxml2/all/conanfile.py b/recipes/libxml2/all/conanfile.py index becdc73f93c9c5..3a2832d9da9e76 100644 --- a/recipes/libxml2/all/conanfile.py +++ b/recipes/libxml2/all/conanfile.py @@ -95,19 +95,19 @@ def layout(self): def requirements(self): if self.options.zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.lzma: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.4") if self.options.iconv: self.requires("libiconv/1.17", transitive_headers=True, transitive_libs=True) if self.options.icu: - self.requires("icu/73.1") + self.requires("icu/73.2") def build_requirements(self): if not (is_msvc(self) or self._is_mingw_windows): if self.options.zlib or self.options.lzma or self.options.icu: 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/libxml2/all/test_package/test_package.c b/recipes/libxml2/all/test_package/test_package.c index b4b977f00d3429..01dc455ced597a 100644 --- a/recipes/libxml2/all/test_package/test_package.c +++ b/recipes/libxml2/all/test_package/test_package.c @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/recipes/libxml2/config.yml b/recipes/libxml2/config.yml index a49601ef686b56..cde8f92b310143 100644 --- a/recipes/libxml2/config.yml +++ b/recipes/libxml2/config.yml @@ -1,4 +1,10 @@ versions: + "2.12.2": + folder: all + "2.12.1": + folder: all + "2.11.5": + folder: all "2.11.4": folder: all "2.11.3": diff --git a/recipes/libxmlpp/2.x.x/conandata.yml b/recipes/libxmlpp/2.x.x/conandata.yml deleted file mode 100644 index c28f5a99de9267..00000000000000 --- a/recipes/libxmlpp/2.x.x/conandata.yml +++ /dev/null @@ -1,15 +0,0 @@ -sources: - "5.0.1": - url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.0.1/libxml++-5.0.1.tar.xz" - sha256: "15c38307a964fa6199f4da6683a599eb7e63cc89198545b36349b87cf9aa0098" - "2.42.1": - url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/2.42.1/libxml++-2.42.1.tar.xz" - sha256: "9b59059abe5545d28ceb388a55e341095f197bd219c73e6623aeb6d801e00be8" - -patches: - "5.0.1": - - patch_file: "patches/5.0.1-0001-enable_static_builds_on_msvc.patch" - base_path: "source_subfolder" - "2.42.1": - - patch_file: "patches/2.42.1-0001-enable_static_builds_on_msvc.patch" - base_path: "source_subfolder" diff --git a/recipes/libxmlpp/2.x.x/conanfile.py b/recipes/libxmlpp/2.x.x/conanfile.py deleted file mode 100644 index 1297a686c1b40f..00000000000000 --- a/recipes/libxmlpp/2.x.x/conanfile.py +++ /dev/null @@ -1,155 +0,0 @@ -from conans import ConanFile, Meson, tools -from conan.tools.files import rename -from conans.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc -import shutil -import os -import functools - -required_conan_version = ">=1.45.0" - -class LibXMLPlusPlus(ConanFile): - # FIXME: naming the library "libxml++" causes conan not to add it to the - # environment path on windows - name = "libxmlpp" - description = "libxml++ (a.k.a. libxmlplusplus) provides a C++ interface to XML files" - license = "LGPL-2.1" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/libxmlplusplus/libxmlplusplus" - topics = ["xml", "parser", "wrapper"] - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - } - generators = "pkg_config" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - 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 - - def configure(self): - if self.options.shared: - del self.options.fPIC - - def requirements(self): - self.requires("libxml2/2.9.14") - if tools.Version(self.version) <= "2.42.1": - self.requires("glibmm/2.66.4") - else: - self.requires("glibmm/2.72.1") - - 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"): - tools.check_min_cppstd(self, 11) - - def build_requirements(self): - self.build_requires("meson/0.63.0") - self.build_requires("pkgconf/1.7.4") - - def source(self): - tools.get( - **self.conan_data["sources"][self.version], - strip_root=True, - destination=self._source_subfolder, - ) - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - if is_msvc(self): - # when using cpp_std=c++NM the /permissive- flag is added which - # attempts enforcing standard conformant c++ code. the problem is - # that older versions of the Windows SDK isn't 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++") - - @functools.lru_cache(1) - def _configure_meson(self): - meson = Meson(self) - defs = { - "build-examples": "false", - "build-tests": "false", - "build-documentation": "false", - "msvc14x-parallel-installable": "false", - "default_library": "shared" if self.options.shared else "static", - } - meson.configure( - defs=defs, - build_folder=self._build_subfolder, - source_folder=self._source_subfolder, - pkg_config_paths=[self.install_folder], - ) - return meson - - def build(self): - self._patch_sources() - with tools.environment_append(tools.RunEnvironment(self).vars): - meson = self._configure_meson() - meson.build() - - def package(self): - lib_version = "2.6" if tools.Version(self.version) <= "2.42.1" else "5.0" - - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - meson = self._configure_meson() - meson.install() - - shutil.move( - os.path.join(self.package_folder, "lib", f"libxml++-{lib_version}", "include", "libxml++config.h"), - os.path.join(self.package_folder, "include", f"libxml++-{lib_version}", "libxml++config.h")) - - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "lib", f"libxml++-{lib_version}")) - - if is_msvc(self): - tools.remove_files_by_mask( - os.path.join(self.package_folder, "bin"), "*.pdb") - if not self.options.shared: - rename( - self, - os.path.join(self.package_folder, "lib", f"libxml++-{lib_version}.a"), - os.path.join(self.package_folder, "lib", f"xml++-{lib_version}.lib")) - - def package_info(self): - lib_version = "2.6" if tools.Version(self.version) <= "2.42.1" else "5.0" - - self.cpp_info.set_property("cmake_module_file_name", "libxml++") - self.cpp_info.set_property("cmake_module_target_name", "libxml++::libxml++") - self.cpp_info.set_property("pkg_config_name", "libxml++") - self.cpp_info.components[f"libxml++-{lib_version}"].set_property("pkg_config_name", f"libxml++-{lib_version}") - self.cpp_info.components[f"libxml++-{lib_version}"].libs = [f"xml++-{lib_version}"] - self.cpp_info.components[f"libxml++-{lib_version}"].includedirs = [ - os.path.join("include", f"libxml++-{lib_version}") - ] - self.cpp_info.components[f"libxml++-{lib_version}"].requires = [ - "glibmm::glibmm", "libxml2::libxml2" - ] - - self.cpp_info.names["cmake_find_package"] = "libxml++" - self.cpp_info.names["cmake_find_package_multi"] = "libxml++" - self.cpp_info.names["pkg_config"] = "libxml++" - self.cpp_info.components[f"libxml++-{lib_version}"].names["pkg_config"] = f"libxml++-{lib_version}" diff --git a/recipes/libxmlpp/2.x.x/test_package/CMakeLists.txt b/recipes/libxmlpp/2.x.x/test_package/CMakeLists.txt deleted file mode 100644 index acd4c1ac2441b8..00000000000000 --- a/recipes/libxmlpp/2.x.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libxml++ REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -if(TARGET libxml++::libxml++-2.6) - target_link_libraries(${PROJECT_NAME} libxml++::libxml++-2.6) -else() - target_link_libraries(${PROJECT_NAME} libxml++::libxml++-5.0) -endif() diff --git a/recipes/libxmlpp/2.x.x/test_package/conanfile.py b/recipes/libxmlpp/2.x.x/test_package/conanfile.py deleted file mode 100644 index 8aaecaac427e8e..00000000000000 --- a/recipes/libxmlpp/2.x.x/test_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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 = f'{os.path.join("bin", "test_package")} \ - {os.path.join(self.source_folder, "example.xml")}' - self.run(bin_path, run_environment=True) diff --git a/recipes/libxmlpp/all/conandata.yml b/recipes/libxmlpp/all/conandata.yml new file mode 100644 index 00000000000000..70b3ca66d954f1 --- /dev/null +++ b/recipes/libxmlpp/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "5.0.3": + url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.0.3/libxml++-5.0.3.tar.xz" + sha256: "13074f59e3288a378cafe9e6847df17f764c23fa29bc94f3305b8bf81efb2cf7" + "5.0.1": + url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.0.1/libxml++-5.0.1.tar.xz" + sha256: "15c38307a964fa6199f4da6683a599eb7e63cc89198545b36349b87cf9aa0098" + "2.42.1": + url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/2.42.1/libxml++-2.42.1.tar.xz" + sha256: "9b59059abe5545d28ceb388a55e341095f197bd219c73e6623aeb6d801e00be8" +patches: + "5.0.3": + - patch_file: "patches/5.0.3-0001-enable_static_builds_on_msvc.patch" + patch_type: "portability" + patch_description: "Manage dllexport correctly to be able to build static libraries on MSVC" + patch_source: "https://github.com/libxmlplusplus/libxmlplusplus/commit/2a2825c67a30ea34f3514659bfd91111db8e009d.patch" + "5.0.1": + - patch_file: "patches/5.0.1-0001-enable_static_builds_on_msvc.patch" + patch_type: "portability" + patch_description: "Manage dllexport correctly to be able to build static libraries on MSVC" + patch_source: "https://github.com/libxmlplusplus/libxmlplusplus/commit/2a2825c67a30ea34f3514659bfd91111db8e009d.patch" + "2.42.1": + - patch_file: "patches/2.42.1-0001-enable_static_builds_on_msvc.patch" + patch_type: "portability" + patch_description: "Manage dllexport correctly to be able to build static libraries on MSVC" + patch_source: "https://github.com/libxmlplusplus/libxmlplusplus/commit/2a2825c67a30ea34f3514659bfd91111db8e009d.patch" diff --git a/recipes/libxmlpp/all/conanfile.py b/recipes/libxmlpp/all/conanfile.py new file mode 100644 index 00000000000000..861652e59145b3 --- /dev/null +++ b/recipes/libxmlpp/all/conanfile.py @@ -0,0 +1,141 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, rmdir, rename, get, rm, replace_in_file +from conan.tools.build import cross_building, check_min_cppstd +from conan.tools.layout import basic_layout +import shutil +import os + + +required_conan_version = ">=1.53.0" + + +class LibXMLPlusPlus(ConanFile): + name = "libxmlpp" + description = "libxml++ (a.k.a. libxmlplusplus) provides a C++ interface to XML files" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libxmlplusplus/libxmlplusplus" + topics = ("xml", "parser", "wrapper") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _lib_version(self): + return "2.6" if Version(self.version) <= "2.42.1" else "5.0" + + 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): + self.requires("libxml2/2.11.5") + if Version(self.version) <= "2.42.1": + self.requires("glibmm/2.66.4", transitive_headers=True, transitive_libs=True) + else: + self.requires("glibmm/2.75.0") + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("Cross-building not implemented") + if Version(self.version) < "2.91.1": + from conan import conan_version + import sys + if conan_version.major == 2: + # FIXME: linter complains, but function is there + # https://docs.conan.io/2.0/reference/tools/build.html?highlight=check_min_cppstd#conan-tools-build-check-max-cppstd + check_max_cppstd = getattr(sys.modules['conan.tools.build'], 'check_max_cppstd') + # INFO: error: no template named 'auto_ptr' in namespace 'std'. Removed in C++17. + check_max_cppstd(self, 14) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def build_requirements(self): + self.tool_requires("meson/1.2.3") + 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], strip_root=True) + + def _patch_sources(self): + apply_conandata_patches(self) + + if is_msvc(self): + # when using cpp_std=c++NM the /permissive- flag is added which + # attempts enforcing standard conformant c++ code. the problem is + # that older versions of the Windows SDK isn't 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 generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + tc = MesonToolchain(self) + tc.project_options["build-examples"] = "false" + tc.project_options["build-tests"] = "false" + tc.project_options["build-documentation"] = "false" + tc.project_options["msvc14x-parallel-installable"] = "false" + tc.project_options["default_library"] = "shared" if self.options.shared else "static" + tc.generate() + td = PkgConfigDeps(self) + td.generate() + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + meson = Meson(self) + meson.install() + + shutil.move( + os.path.join(self.package_folder, "lib", f"libxml++-{self._lib_version}", "include", "libxml++config.h"), + os.path.join(self.package_folder, "include", f"libxml++-{self._lib_version}", "libxml++config.h")) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", f"libxml++-{self._lib_version}")) + fix_apple_shared_install_name(self) + + if is_msvc(self): + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if not self.options.shared: + rename( + self, + os.path.join(self.package_folder, "lib", f"libxml++-{self._lib_version}.a"), + os.path.join(self.package_folder, "lib", f"xml++-{self._lib_version}.lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", f"libxml++-{self._lib_version}") + self.cpp_info.libs = [f"xml++-{self._lib_version}"] + self.cpp_info.includedirs = [os.path.join("include", f"libxml++-{self._lib_version}")] diff --git a/recipes/libxmlpp/2.x.x/patches/2.42.1-0001-enable_static_builds_on_msvc.patch b/recipes/libxmlpp/all/patches/2.42.1-0001-enable_static_builds_on_msvc.patch similarity index 100% rename from recipes/libxmlpp/2.x.x/patches/2.42.1-0001-enable_static_builds_on_msvc.patch rename to recipes/libxmlpp/all/patches/2.42.1-0001-enable_static_builds_on_msvc.patch diff --git a/recipes/libxmlpp/2.x.x/patches/5.0.1-0001-enable_static_builds_on_msvc.patch b/recipes/libxmlpp/all/patches/5.0.1-0001-enable_static_builds_on_msvc.patch similarity index 100% rename from recipes/libxmlpp/2.x.x/patches/5.0.1-0001-enable_static_builds_on_msvc.patch rename to recipes/libxmlpp/all/patches/5.0.1-0001-enable_static_builds_on_msvc.patch diff --git a/recipes/libxmlpp/all/patches/5.0.3-0001-enable_static_builds_on_msvc.patch b/recipes/libxmlpp/all/patches/5.0.3-0001-enable_static_builds_on_msvc.patch new file mode 100644 index 00000000000000..1359f7eb0c90c8 --- /dev/null +++ b/recipes/libxmlpp/all/patches/5.0.3-0001-enable_static_builds_on_msvc.patch @@ -0,0 +1,17 @@ +diff --git a/meson.build b/meson.build +index 935aece..5e7180e 100644 +--- a/meson.build ++++ b/meson.build +@@ -371,12 +371,6 @@ library_build_type = get_option('default_library') + pkg_conf_data.set('LIBXMLXX_STATIC', library_build_type == 'static') + + +-if cpp_compiler.get_argument_syntax() == 'msvc' +- if library_build_type == 'both' +- error('Dynamic+Static builds are not supported by MSVC-style builds') +- endif +-endif +- + configure_file( + input: 'libxml++.pc.in', + output: xmlxx_pcname + '.pc', diff --git a/recipes/libxmlpp/all/test_package/CMakeLists.txt b/recipes/libxmlpp/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..082b48301a3b9a --- /dev/null +++ b/recipes/libxmlpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(libxmlpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libxmlpp::libxmlpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libxmlpp/all/test_package/conanfile.py b/recipes/libxmlpp/all/test_package/conanfile.py new file mode 100644 index 00000000000000..5110568f15e674 --- /dev/null +++ b/recipes/libxmlpp/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) + + 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") + xml_path = os.path.join(self.source_folder, "example.xml") + self.run(f"{bin_path} {xml_path}", env="conanrun") diff --git a/recipes/libxmlpp/2.x.x/test_package/example.xml b/recipes/libxmlpp/all/test_package/example.xml similarity index 100% rename from recipes/libxmlpp/2.x.x/test_package/example.xml rename to recipes/libxmlpp/all/test_package/example.xml diff --git a/recipes/libxmlpp/2.x.x/test_package/test_package.cpp b/recipes/libxmlpp/all/test_package/test_package.cpp similarity index 100% rename from recipes/libxmlpp/2.x.x/test_package/test_package.cpp rename to recipes/libxmlpp/all/test_package/test_package.cpp diff --git a/recipes/libxmlpp/config.yml b/recipes/libxmlpp/config.yml index 4976ee096e564c..884c9a00e90006 100644 --- a/recipes/libxmlpp/config.yml +++ b/recipes/libxmlpp/config.yml @@ -1,5 +1,7 @@ versions: + "5.0.3": + folder: all "5.0.1": - folder: "2.x.x" + folder: all "2.42.1": - folder: "2.x.x" + folder: all diff --git a/recipes/libxpm/all/CMakeLists.txt b/recipes/libxpm/all/CMakeLists.txt index 77475adeda3d99..681dd5c613eecc 100644 --- a/recipes/libxpm/all/CMakeLists.txt +++ b/recipes/libxpm/all/CMakeLists.txt @@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.1) project(libXpm VERSION "${CONAN_libXpm_VERSION}" LANGUAGES C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - # ---- X11 dependency ---- if(NOT WIN32) diff --git a/recipes/libxpm/all/conanfile.py b/recipes/libxpm/all/conanfile.py index 63d51162a71f71..0312deadc10a94 100644 --- a/recipes/libxpm/all/conanfile.py +++ b/recipes/libxpm/all/conanfile.py @@ -1,19 +1,22 @@ -import functools import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class LibXpmConan(ConanFile): name = "libxpm" description = "X Pixmap (XPM) image file format library" + license = "MIT-open-group" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.freedesktop.org/xorg/lib/libxpm" - topics = "xpm" - license = "MIT-open-group" + topics = ("xpm",) + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,18 +26,15 @@ class LibXpmConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake" - exports_sources = "CMakeLists.txt", "windows/*" no_copy_source = True - def validate(self): - if self.settings.os not in ("Windows", "Linux", "FreeBSD"): - raise ConanInvalidConfiguration( - "libXpm is supported only on Windows, Linux and FreeBSD" - ) - - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True) + def export_sources(self): + copy(self, "CMakeLists.txt", + src=self.recipe_folder, + dst=os.path.join(self.export_sources_folder, "src")) + copy(self, "*", + src=os.path.join(self.recipe_folder, "windows"), + dst=os.path.join(self.export_sources_folder, "src", "windows")) def config_options(self): if self.settings.os == "Windows": @@ -42,28 +42,43 @@ 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.settings.os != "Windows": self.requires("xorg/system") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["CONAN_libXpm_VERSION"] = self.version - cmake.configure() - return cmake + def validate(self): + if self.settings.os not in ("Windows", "Linux", "FreeBSD"): + raise ConanInvalidConfiguration("libXpm is supported only on Windows, Linux and FreeBSD") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CONAN_libXpm_VERSION"] = self.version + tc.generate() def build(self): - self._configure_cmake().build() + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy("COPYING", "licenses") - self.copy("COPYRIGHT", "licenses") - self._configure_cmake().install() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "COPYRIGHT", + 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 = ["Xpm"] diff --git a/recipes/libxpm/all/test_package/CMakeLists.txt b/recipes/libxpm/all/test_package/CMakeLists.txt index 0ea6d5bc37b287..1f28dfc6ff7536 100644 --- a/recipes/libxpm/all/test_package/CMakeLists.txt +++ b/recipes/libxpm/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(libxpm REQUIRED CONFIG) add_executable(test_package test_package.c) diff --git a/recipes/libxpm/all/test_package/conanfile.py b/recipes/libxpm/all/test_package/conanfile.py index a8c92dea633357..ef5d7042163ecc 100644 --- a/recipes/libxpm/all/test_package/conanfile.py +++ b/recipes/libxpm/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/libxpm/all/test_package/test_package.c b/recipes/libxpm/all/test_package/test_package.c index ed1efad8c383c9..925df166533ce4 100644 --- a/recipes/libxpm/all/test_package/test_package.c +++ b/recipes/libxpm/all/test_package/test_package.c @@ -1,12 +1,8 @@ #include #include -int main(int argc, char const* argv[]) +int main() { - (void)argc; - (void)argv; - XpmFree(NULL); - return 0; } diff --git a/recipes/libxpm/all/test_v1_package/CMakeLists.txt b/recipes/libxpm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libxpm/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/libxpm/all/test_v1_package/conanfile.py b/recipes/libxpm/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a8c92dea633357 --- /dev/null +++ b/recipes/libxpm/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +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.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/libxshmfence/all/conanfile.py b/recipes/libxshmfence/all/conanfile.py index abd496668a102b..486b79c2c29b49 100644 --- a/recipes/libxshmfence/all/conanfile.py +++ b/recipes/libxshmfence/all/conanfile.py @@ -1,20 +1,28 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rm, rmdir -from conans import tools, AutoToolsBuildEnvironment -import contextlib -import os +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import 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, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path required_conan_version = ">=1.53.0" + class LibxshmfenceConan(ConanFile): name = "libxshmfence" + description = "Shared memory 'SyncFence' synchronization primitive" license = "X11" - homepage = "https://gitlab.freedesktop.org/xorg/lib/libxshmfence" url = "https://github.com/conan-io/conan-center-index" - description = "Shared memory 'SyncFence' synchronization primitive" + homepage = "https://gitlab.freedesktop.org/xorg/lib/libxshmfence" topics = ("shared", "memory", "syncfence", "synchronization", "interprocess") - settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -24,22 +32,10 @@ class LibxshmfenceConan(ConanFile): "fPIC": True, } - generators = "pkg_config" - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @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): export_conandata_patches(self) @@ -53,64 +49,63 @@ def configure(self): # for plain C projects only 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("xorg-proto/2022.2", transitive_headers=True) + def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration("Windows is not supported by libxshmfence recipe. Contributions are welcome") def build_requirements(self): - self.build_requires("automake/1.16.5") - self.build_requires("pkgconf/1.9.3") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - - def requirements(self): - self.requires("xorg-proto/2022.2") + 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/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): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "{} cl -nologo".format(self._user_info_build["automake"].compile).replace("\\", "/"), - } - with tools.environment_append(env): - yield - else: - yield - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows") - self._autotools.libs = [] - yes_no = lambda v: "yes" if v else "no" - configure_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] - self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder) - return self._autotools + 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) + tc.generate() + tc = PkgConfigDeps(self) + 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)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.vars(self).save_script("conanbuild_msvc") def build(self): apply_conandata_patches(self) - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() + copy(self, "COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["xshmfence"] - self.cpp_info.names["pkg_config"] = "xshmfence" self.cpp_info.set_property("pkg_config_name", "xshmfence") diff --git a/recipes/libxshmfence/all/test_package/CMakeLists.txt b/recipes/libxshmfence/all/test_package/CMakeLists.txt index b08d77d4e43289..c48db83ea92319 100644 --- a/recipes/libxshmfence/all/test_package/CMakeLists.txt +++ b/recipes/libxshmfence/all/test_package/CMakeLists.txt @@ -1,10 +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(TARGETS) - -find_package(libxshmfence REQUIRED) +find_package(libxshmfence REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} libxshmfence::libxshmfence) diff --git a/recipes/libxshmfence/all/test_package/conanfile.py b/recipes/libxshmfence/all/test_package/conanfile.py index 19e6a0c06e3d81..ef5d7042163ecc 100644 --- a/recipes/libxshmfence/all/test_package/conanfile.py +++ b/recipes/libxshmfence/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" + 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/libxshmfence/all/test_package/test_package.c b/recipes/libxshmfence/all/test_package/test_package.c index 2dc0779250663e..6b5dd2b42332cd 100644 --- a/recipes/libxshmfence/all/test_package/test_package.c +++ b/recipes/libxshmfence/all/test_package/test_package.c @@ -1,15 +1,14 @@ #include "X11/xshmfence.h" int main() { - int fd; - struct xshmfence *x; + int fd; + struct xshmfence *x; fd = xshmfence_alloc_shm(); if (fd < 0) { return 1; } - x = xshmfence_map_shm(fd); if (!x) { return 1; diff --git a/recipes/libxshmfence/all/test_v1_package/CMakeLists.txt b/recipes/libxshmfence/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libxshmfence/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/libxshmfence/all/test_v1_package/conanfile.py b/recipes/libxshmfence/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/libxshmfence/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/libxslt/all/conandata.yml b/recipes/libxslt/all/conandata.yml index 8795d460be8998..535fcb94f934bf 100644 --- a/recipes/libxslt/all/conandata.yml +++ b/recipes/libxslt/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.37": + sha256: "3a4b27dc8027ccd6146725950336f1ec520928f320f144eb5fa7990ae6123ab4" + url: "https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.37.tar.xz" "1.1.34": sha256: "28c47db33ab4daefa6232f31ccb3c65260c825151ec86ec461355247f3f56824" url: "https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.34.tar.xz" diff --git a/recipes/libxslt/all/conanfile.py b/recipes/libxslt/all/conanfile.py index 35861075ebb78d..6e5032ab981956 100644 --- a/recipes/libxslt/all/conanfile.py +++ b/recipes/libxslt/all/conanfile.py @@ -60,7 +60,7 @@ def layout(self): def requirements(self): # see https://github.com/conan-io/conan-center-index/pull/16205#discussion_r1149570846 - self.requires("libxml2/2.10.3", transitive_headers=True, transitive_libs=True) + self.requires("libxml2/2.11.5", transitive_headers=True, transitive_libs=True) def validate(self): if self.options.plugins and not self.options.shared: @@ -190,6 +190,7 @@ def package(self): autotools.install() os.remove(os.path.join(self.package_folder, "bin", "xslt-config")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) rm(self, "*.sh", os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "share")) diff --git a/recipes/libxslt/config.yml b/recipes/libxslt/config.yml index 9aafb604e965bb..d53687ed0c1862 100644 --- a/recipes/libxslt/config.yml +++ b/recipes/libxslt/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.37": + folder: all "1.1.34": folder: all diff --git a/recipes/libyuv/all/conandata.yml b/recipes/libyuv/all/conandata.yml index e839599c0c5fc3..3b9b5764537d07 100644 --- a/recipes/libyuv/all/conandata.yml +++ b/recipes/libyuv/all/conandata.yml @@ -1,6 +1,8 @@ # Versions from LIBYUV_VERSION definition in include/libyuv/version.h # Pay attention to package commits incrementing this definition sources: + "1880": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/fb6341d326846fbbe669ad5173e520f66b339621.tar.gz" "1854": url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/3abd6f36b6e4f5a2e0ce236580a8bc1da3c7cf7e.tar.gz" "1845": @@ -10,6 +12,10 @@ sources: "1768": url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/dfaf7534e0e536f7e5ef8ddd7326797bd09b8622.tar.gz" patches: + "1880": + - patch_file: "patches/1880-0001-fix-cmake.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "conan" "1854": - patch_file: "patches/1854-0001-fix-cmake.patch" patch_description: "Fix CMake to be more robust & predictable" diff --git a/recipes/libyuv/all/conanfile.py b/recipes/libyuv/all/conanfile.py index 5e5b8c258b2f3f..4d851737efc1b0 100644 --- a/recipes/libyuv/all/conanfile.py +++ b/recipes/libyuv/all/conanfile.py @@ -1,5 +1,4 @@ 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 from conan.tools.microsoft import is_msvc @@ -15,7 +14,7 @@ class LibyuvConan(ConanFile): description = "libyuv is an open source project that includes YUV scaling and conversion functionality." topics = ["YUV", "libyuv", "google", "chromium"] license = "BSD-3-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,7 +35,12 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.shared: + if is_msvc(self): + # Only static for msvc + # Injecting CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is not sufficient since there are global symbols + del self.options.shared + self.package_type = "static-library" + if self.options.get_safe("shared"): self.options.rm_safe("fPIC") def layout(self): @@ -46,17 +50,12 @@ 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.1") elif self.options.with_jpeg == "mozjpeg": - self.requires("mozjpeg/4.1.1") - - def validate(self): - if is_msvc(self) and self.options.shared: - # Injecting CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is not sufficient since there are global symbols - raise ConanInvalidConfiguration(f"{self.ref} shared not supported for msvc.") + self.requires("mozjpeg/4.1.3") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder) + get(self, **self.conan_data["sources"][self.version]) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/libyuv/all/patches/1880-0001-fix-cmake.patch b/recipes/libyuv/all/patches/1880-0001-fix-cmake.patch new file mode 100644 index 00000000000000..b44803ec7ecf38 --- /dev/null +++ b/recipes/libyuv/all/patches/1880-0001-fix-cmake.patch @@ -0,0 +1,68 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,8 +2,8 @@ + # Originally created for "roxlu build system" to compile libyuv on windows + # Run with -DTEST=ON to build unit tests + ++CMAKE_MINIMUM_REQUIRED( VERSION 3.8 ) + PROJECT ( YUV C CXX ) # "C" is required even for C++ projects +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) + OPTION( UNIT_TEST "Built unit tests" OFF ) + + SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) +@@ -27,15 +27,10 @@ if(MSVC) + endif() + + # this creates the static library (.a) +-ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) ++ADD_LIBRARY ( ${ly_lib_static} ${ly_source_files} ) ++target_compile_features(${ly_lib_static} PUBLIC cxx_std_11) + + # this creates the shared library (.so) +-ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) +-if(WIN32) +- SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) +-endif() + + # this creates the conversion tool + ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) +@@ -44,12 +39,18 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) + # this creates the yuvconstants tool + ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c ) + TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} ) ++include(CheckFunctionExists) ++check_function_exists(round HAVE_MATH_SYSTEM) ++if(NOT HAVE_MATH_SYSTEM) ++ target_link_libraries(yuvconstants m) ++endif() + +-find_package ( JPEG ) +-if (JPEG_FOUND) +- include_directories( ${JPEG_INCLUDE_DIR} ) +- target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} ) +- add_definitions( -DHAVE_JPEG ) ++option(LIBYUV_WITH_JPEG "Build libyuv with jpeg" ON) ++if (LIBYUV_WITH_JPEG) ++ find_package(JPEG REQUIRED) ++ target_link_libraries(${ly_lib_static} JPEG::JPEG ) ++ target_compile_definitions(${ly_lib_static} PRIVATE HAVE_JPEG) ++ target_compile_definitions(yuvconvert PRIVATE HAVE_JPEG) + endif() + + if(UNIT_TEST) +@@ -94,11 +95,9 @@ endif() + + + # install the conversion tool, .so, .a, and all the header files +-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) +-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) +-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++INSTALL ( TARGETS yuvconvert yuvconstants DESTINATION bin) ++INSTALL ( TARGETS ${ly_lib_static} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) + + # create the .deb and .rpm packages using cpack +-INCLUDE ( CM_linux_packages.cmake ) + diff --git a/recipes/libyuv/config.yml b/recipes/libyuv/config.yml index c1f0cfd37130fd..fe46d8f150b2cb 100644 --- a/recipes/libyuv/config.yml +++ b/recipes/libyuv/config.yml @@ -1,4 +1,6 @@ versions: + "1880": + folder: all "1854": folder: all "1845": diff --git a/recipes/libzip/all/conandata.yml b/recipes/libzip/all/conandata.yml index 567f243d79a980..0dcb786c628748 100644 --- a/recipes/libzip/all/conandata.yml +++ b/recipes/libzip/all/conandata.yml @@ -1,26 +1,56 @@ sources: + "1.10.1": + url: + - "https://libzip.org/download/libzip-1.10.1.tar.gz" + - "https://github.com/nih-at/libzip/releases/download/v1.10.1/libzip-1.10.1.tar.gz" + sha256: "9669ae5dfe3ac5b3897536dc8466a874c8cf2c0e3b1fdd08d75b273884299363" "1.9.2": - url: [ - "https://libzip.org/download/libzip-1.9.2.tar.gz", - "https://github.com/nih-at/libzip/releases/download/v1.9.2/libzip-1.9.2.tar.gz", - ] + url: + - "https://libzip.org/download/libzip-1.9.2.tar.gz" + - "https://github.com/nih-at/libzip/releases/download/v1.9.2/libzip-1.9.2.tar.gz" sha256: "fd6a7f745de3d69cf5603edc9cb33d2890f0198e415255d0987a0cf10d824c6f" "1.8.0": - url: [ - "https://libzip.org/download/libzip-1.8.0.tar.gz", - "https://github.com/nih-at/libzip/releases/download/v1.8.0/libzip-1.8.0.tar.gz", - ] + url: + - "https://libzip.org/download/libzip-1.8.0.tar.gz" + - "https://github.com/nih-at/libzip/releases/download/v1.8.0/libzip-1.8.0.tar.gz" sha256: "30ee55868c0a698d3c600492f2bea4eb62c53849bcf696d21af5eb65f3f3839e" "1.7.3": - url: [ - "https://libzip.org/download/libzip-1.7.3.tar.gz", - "https://github.com/nih-at/libzip/releases/download/v1.7.3/libzip-1.7.3.tar.gz", - ] + url: + - "https://libzip.org/download/libzip-1.7.3.tar.gz" + - "https://github.com/nih-at/libzip/releases/download/v1.7.3/libzip-1.7.3.tar.gz" sha256: "0e2276c550c5a310d4ebf3a2c3dfc43fb3b4602a072ff625842ad4f3238cb9cc" patches: + "1.10.1": + - patch_file: "patches/1.7.3-0001-cmake-install-bundle.patch" + patch_description: "fix installation path of utilities" + patch_type: "conan" + - patch_file: "patches/1.10.1-0002-remove-rpath.patch" + patch_description: "remove rpath feature" + patch_type: "conan" "1.9.2": - - patch_file: "patches/0001-cmake-install-bundle.patch" + - patch_file: "patches/1.7.3-0001-cmake-install-bundle.patch" + patch_description: "fix installation path of utilities" + patch_type: "conan" + - patch_file: "patches/1.9.2-0002-remove-rpath.patch" + patch_description: "remove rpath feature" + patch_type: "conan" + - patch_file: "patches/1.9.2-0003-fix-zstd-name.patch" + patch_description: "fix zstd name" + patch_type: "portability" "1.8.0": - - patch_file: "patches/0001-cmake-install-bundle.patch" + - patch_file: "patches/1.7.3-0001-cmake-install-bundle.patch" + patch_description: "fix installation path of utilities" + patch_type: "conan" + - patch_file: "patches/1.8.0-0002-remove-rpath.patch" + patch_description: "remove rpath feature" + patch_type: "conan" + - patch_file: "patches/1.8.0-0003-fix-zstd-name.patch" + patch_description: "fix zstd name" + patch_type: "portability" "1.7.3": - - patch_file: "patches/0001-cmake-install-bundle.patch" + - patch_file: "patches/1.7.3-0001-cmake-install-bundle.patch" + patch_description: "fix installation path of utilities" + patch_type: "conan" + - patch_file: "patches/1.7.3-0002-remove-rpath.patch" + patch_description: "remove rpath feature" + patch_type: "conan" diff --git a/recipes/libzip/all/conanfile.py b/recipes/libzip/all/conanfile.py index 466b104bf29b9e..ef4f7c2c575795 100644 --- a/recipes/libzip/all/conanfile.py +++ b/recipes/libzip/all/conanfile.py @@ -1,7 +1,7 @@ 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 +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version import os @@ -62,13 +62,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_lzma: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.5") if self.options.get_safe("with_zstd"): self.requires("zstd/1.5.5") @@ -76,7 +76,7 @@ def requirements(self): if self.options.crypto == "openssl": self.requires("openssl/[>=1.1 <4]") elif self.options.crypto == "mbedtls": - self.requires("mbedtls/3.2.1") + self.requires("mbedtls/3.5.0") def validate(self): if self.options.crypto == "win32" and self.settings.os != "Windows": @@ -105,42 +105,8 @@ def generate(self): deps = CMakeDeps(self) deps.generate() - def _patch_sources(self): - apply_conandata_patches(self) - - top_cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - # Honor zstd enabled - if self._has_zstd_support: - def zstd_find_package_pattern(version): - if version >= "1.9.2": - return "find_package(Zstd 1.3.6)" - else: - return "find_package(Zstd)" - lib_cmakelists = os.path.join(self.source_folder, "lib", "CMakeLists.txt") - replace_in_file(self, top_cmakelists, zstd_find_package_pattern(Version(self.version)), "find_package(zstd)") - replace_in_file(self, top_cmakelists, "Zstd_FOUND", "zstd_FOUND") - replace_in_file( - self, - lib_cmakelists, - "Zstd::Zstd", - "$,zstd::libzstd_shared,zstd::libzstd_static>", - ) - # Do not pollute rpath of installed binaries - replace_in_file( - self, - top_cmakelists, - "set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})", - "", - ) - replace_in_file( - self, - top_cmakelists, - "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", - "", - ) - def build(self): - self._patch_sources() + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/libzip/all/patches/1.10.1-0002-remove-rpath.patch b/recipes/libzip/all/patches/1.10.1-0002-remove-rpath.patch new file mode 100644 index 00000000000000..63858833767397 --- /dev/null +++ b/recipes/libzip/all/patches/1.10.1-0002-remove-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2e7724..d33fbd8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -285,7 +285,7 @@ if(WIN32) + endif(WIN32) + + # rpath handling: use rpath in installed binaries +-if(NOT CMAKE_SYSTEM_NAME MATCHES Linux) ++if(0) + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + endif() diff --git a/recipes/libzip/all/patches/0001-cmake-install-bundle.patch b/recipes/libzip/all/patches/1.7.3-0001-cmake-install-bundle.patch similarity index 100% rename from recipes/libzip/all/patches/0001-cmake-install-bundle.patch rename to recipes/libzip/all/patches/1.7.3-0001-cmake-install-bundle.patch diff --git a/recipes/libzip/all/patches/1.7.3-0002-remove-rpath.patch b/recipes/libzip/all/patches/1.7.3-0002-remove-rpath.patch new file mode 100644 index 00000000000000..2682986aa602f1 --- /dev/null +++ b/recipes/libzip/all/patches/1.7.3-0002-remove-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 017f7cf..e9dd8d9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -237,7 +237,7 @@ if(WIN32) + endif(WIN32) + + # rpath handling: use rpath in installed binaries +-if(NOT CMAKE_SYSTEM_NAME MATCHES Linux) ++if(0) + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + endif() diff --git a/recipes/libzip/all/patches/1.8.0-0002-remove-rpath.patch b/recipes/libzip/all/patches/1.8.0-0002-remove-rpath.patch new file mode 100644 index 00000000000000..511a8497170f98 --- /dev/null +++ b/recipes/libzip/all/patches/1.8.0-0002-remove-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 93b46a6..577865f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -237,7 +237,7 @@ if(WIN32) + endif(WIN32) + + # rpath handling: use rpath in installed binaries +-if(NOT CMAKE_SYSTEM_NAME MATCHES Linux) ++if(0) + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + endif() diff --git a/recipes/libzip/all/patches/1.8.0-0003-fix-zstd-name.patch b/recipes/libzip/all/patches/1.8.0-0003-fix-zstd-name.patch new file mode 100644 index 00000000000000..d3a2faebb601a1 --- /dev/null +++ b/recipes/libzip/all/patches/1.8.0-0003-fix-zstd-name.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 93b46a6..577865f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -196,12 +196,12 @@ if(ENABLE_LZMA) + endif(ENABLE_LZMA) + + if(ENABLE_ZSTD) +- find_package(Zstd) +- if(Zstd_FOUND) ++ find_package(zstd) ++ if(zstd_FOUND) + set(HAVE_LIBZSTD 1) + else() + message(WARNING "-- zstd library not found; zstandard support disabled") +- endif(Zstd_FOUND) ++ endif(zstd_FOUND) + endif(ENABLE_ZSTD) + + if (COMMONCRYPTO_FOUND) +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 1069cec..c0148b9 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -148,7 +148,7 @@ endif() + + if(HAVE_LIBZSTD) + target_sources(zip PRIVATE zip_algorithm_zstd.c) +- target_link_libraries(zip PRIVATE Zstd::Zstd) ++ target_link_libraries(zip PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(HAVE_COMMONCRYPTO) diff --git a/recipes/libzip/all/patches/1.9.2-0002-remove-rpath.patch b/recipes/libzip/all/patches/1.9.2-0002-remove-rpath.patch new file mode 100644 index 00000000000000..24aeef7d82680c --- /dev/null +++ b/recipes/libzip/all/patches/1.9.2-0002-remove-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d00a4f9..bc45784 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -238,7 +238,7 @@ if(WIN32) + endif(WIN32) + + # rpath handling: use rpath in installed binaries +-if(NOT CMAKE_SYSTEM_NAME MATCHES Linux) ++if(0) + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + endif() diff --git a/recipes/libzip/all/patches/1.9.2-0003-fix-zstd-name.patch b/recipes/libzip/all/patches/1.9.2-0003-fix-zstd-name.patch new file mode 100644 index 00000000000000..bbc20c6fe9ebe1 --- /dev/null +++ b/recipes/libzip/all/patches/1.9.2-0003-fix-zstd-name.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d00a4f9..bc45784 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -197,12 +197,12 @@ if(ENABLE_LZMA) + endif(ENABLE_LZMA) + + if(ENABLE_ZSTD) +- find_package(Zstd 1.3.6) +- if(Zstd_FOUND) ++ find_package(zstd) ++ if(zstd_FOUND) + set(HAVE_LIBZSTD 1) + else() + message(WARNING "-- zstd library not found; zstandard support disabled") +- endif(Zstd_FOUND) ++ endif(zstd_FOUND) + endif(ENABLE_ZSTD) + + if (COMMONCRYPTO_FOUND) +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 1213fa0..b6446cb 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -147,7 +147,7 @@ endif() + + if(HAVE_LIBZSTD) + target_sources(zip PRIVATE zip_algorithm_zstd.c) +- target_link_libraries(zip PRIVATE Zstd::Zstd) ++ target_link_libraries(zip PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(HAVE_COMMONCRYPTO) diff --git a/recipes/libzip/config.yml b/recipes/libzip/config.yml index 63ddbcf63ff111..614d36cf38cf39 100644 --- a/recipes/libzip/config.yml +++ b/recipes/libzip/config.yml @@ -1,4 +1,6 @@ versions: + "1.10.1": + folder: all "1.9.2": folder: all "1.8.0": diff --git a/recipes/libzippp/all/conandata.yml b/recipes/libzippp/all/conandata.yml index f31401deb346d5..20f731c93139a0 100644 --- a/recipes/libzippp/all/conandata.yml +++ b/recipes/libzippp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "7.0-1.10.1": + url: "https://github.com/ctabin/libzippp/archive/libzippp-v7.0-1.10.1.tar.gz" + sha256: "67d6808406b4fc255016ede52c7b5105e2d0e43899a3331de9ed86da5dea07a1" + "6.1-1.9.2": + url: "https://github.com/ctabin/libzippp/archive/libzippp-v6.1-1.9.2.tar.gz" + sha256: "3796f174780f23938749da493cf4cbc4c55f84a568ec395f2c256dfe10129305" "6.0-1.9.2": url: "https://github.com/ctabin/libzippp/archive/libzippp-v6.0-1.9.2.tar.gz" sha256: "f9aef9811802a18e69cd50527381d70c2e0f0d8a839f1d41914f6234f5964fc3" diff --git a/recipes/libzippp/all/conanfile.py b/recipes/libzippp/all/conanfile.py index e0c0670ea25f1c..b6ec87350a23e2 100644 --- a/recipes/libzippp/all/conanfile.py +++ b/recipes/libzippp/all/conanfile.py @@ -45,7 +45,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if Version(self.version) == "4.0": self.requires("libzip/1.7.3") else: @@ -64,6 +64,9 @@ def validate(self): if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": raise ConanInvalidConfiguration(f"{self.ref} does not support clang with libc++. Use libstdc++ instead.") + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -74,15 +77,17 @@ def generate(self): tc.variables["LIBZIPPP_INSTALL_HEADERS"] = True tc.variables["LIBZIPPP_BUILD_TESTS"] = False tc.variables["LIBZIPPP_ENABLE_ENCRYPTION"] = self.options.with_encryption + tc.variables["LIBZIPPP_CMAKE_CONFIG_MODE"] = True tc.generate() deps = CMakeDeps(self) deps.generate() def _patch_source(self): - replace_in_file(self, os.path.join(self.source_folder, 'CMakeLists.txt'), - 'find_package(LIBZIP MODULE REQUIRED)', - 'find_package(libzip REQUIRED CONFIG)') + if Version(self.version) <= "6.0": + replace_in_file(self, os.path.join(self.source_folder, 'CMakeLists.txt'), + 'find_package(LIBZIP MODULE REQUIRED)', + 'find_package(libzip REQUIRED CONFIG)') def build(self): self._patch_source() diff --git a/recipes/libzippp/config.yml b/recipes/libzippp/config.yml index 4ba054a3032a99..ce3931e22d5f51 100644 --- a/recipes/libzippp/config.yml +++ b/recipes/libzippp/config.yml @@ -1,4 +1,8 @@ versions: + "7.0-1.10.1": + folder: all + "6.1-1.9.2": + folder: all "6.0-1.9.2": folder: all "5.0-1.8.0": diff --git a/recipes/lightgbm/all/CMakeLists.txt b/recipes/lightgbm/all/CMakeLists.txt index 61f3d3b039e2bb..d250cd86d59919 100644 --- a/recipes/lightgbm/all/CMakeLists.txt +++ b/recipes/lightgbm/all/CMakeLists.txt @@ -1,7 +1,20 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper LANGUAGES CXX) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) +find_package(Eigen3 REQUIRED CONFIG) +find_package(fast_double_parser REQUIRED CONFIG) +find_package(fmt REQUIRED CONFIG) -add_subdirectory("source_subfolder") +add_subdirectory(src) + +if(_MAJOR_VERSION GREATER_EQUAL 4) + set(TARGETS lightgbm_objs lightgbm_capi_objs) + set(VISIBILITY PRIVATE) +else() + set(TARGETS lightgbm _lightgbm) + set(VISIBILITY "") +endif() + +foreach(target ${TARGETS}) + target_link_libraries(${target} ${VISIBILITY} Eigen3::Eigen fast_double_parser::fast_double_parser fmt::fmt) +endforeach() diff --git a/recipes/lightgbm/all/conandata.yml b/recipes/lightgbm/all/conandata.yml index 2fac2e54523aa2..5c29f9403b5ce5 100644 --- a/recipes/lightgbm/all/conandata.yml +++ b/recipes/lightgbm/all/conandata.yml @@ -1,18 +1,23 @@ sources: - "3.3.2": - url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v3.3.2.tar.gz" - sha256: "d7c0f842e94165578d5a0c046ca942838d1574149f98c84400ce511239d17b9f" + "4.1.0": + url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v4.1.0.tar.gz" + sha256: "eb896dc21c7afec95d10327777f6e77163b5bcd35f6ce5d152e6feefbe3328a5" "3.3.5": url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v3.3.5.tar.gz" sha256: "16fb9e299ced37be5ac69dd510e7323337e623019c9c578628c43b285f764be7" -patches: "3.3.2": - - patch_file: "patches/0001-fix-includes.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-fix-openmp-clang.patch" - base_path: "source_subfolder" + url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v3.3.2.tar.gz" + sha256: "d7c0f842e94165578d5a0c046ca942838d1574149f98c84400ce511239d17b9f" +patches: + "4.1.0": + - patch_file: "patches/4.1.0-0001-fix-openmp-clang.patch" + patch_type: "portability" + patch_description: "Fix OpenMP support for Clang" "3.3.5": - - patch_file: "patches/0001-fix-includes.patch" - base_path: "source_subfolder" - - patch_file: "patches/0003-fix-openmp-clang.patch" - base_path: "source_subfolder" + - patch_file: "patches/3.3.5-0001-fix-openmp-clang.patch" + patch_type: "portability" + patch_description: "Fix OpenMP support for Clang" + "3.3.2": + - patch_file: "patches/3.3.2-0001-fix-openmp-clang.patch" + patch_type: "portability" + patch_description: "Fix OpenMP support for Clang" diff --git a/recipes/lightgbm/all/conanfile.py b/recipes/lightgbm/all/conanfile.py index d00e21c352364a..cae89a9218102b 100644 --- a/recipes/lightgbm/all/conanfile.py +++ b/recipes/lightgbm/all/conanfile.py @@ -1,82 +1,107 @@ -from conans import CMake, ConanFile, tools +import os + +from conan import ConanFile, conan_version +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, replace_in_file, export_conandata_patches, apply_conandata_patches from conan.tools.microsoft import is_msvc -import functools +from conan.tools.scm import Version -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class LightGBMConan(ConanFile): name = "lightgbm" - description = "A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks." - topics = ("machine-learning", "boosting") + description = ( + "A fast, distributed, high performance gradient boosting " + "(GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, " + "used for ranking, classification and many other machine learning tasks." + ) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/microsoft/LightGBM" - license = "MIT" + topics = ("machine-learning", "boosting") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake", "cmake_find_package" options = { "shared": [True, False], "fPIC": [True, False], - "with_openmp": [True, False] + "with_openmp": [True, False], } default_options = { "shared": False, "fPIC": True, - "with_openmp": True + "with_openmp": True, } - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if conan_version.major == 1 and self.settings.compiler == "apple-clang": + # https://github.com/conan-io/conan-center-index/pull/18759#issuecomment-1817470331 + del self.options.with_openmp 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("eigen/3.4.0") - self.requires("fast_double_parser/0.6.0") - self.requires("fmt/9.0.0") - if self.options.with_openmp and self.settings.compiler in ("clang", "apple-clang"): - self.requires("llvm-openmp/11.1.0") + self.requires("fast_double_parser/0.7.0", transitive_headers=True, transitive_libs=True) + self.requires("fmt/10.1.1", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("with_openmp") and self.settings.compiler in ["clang", "apple-clang"]: + self.requires("llvm-openmp/17.0.4", transitive_headers=True, transitive_libs=True) 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) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_STATIC_LIB"] = not self.options.shared + tc.cache_variables["USE_DEBUG"] = self.settings.build_type in ["Debug", "RelWithDebInfo"] + tc.cache_variables["USE_OPENMP"] = self.options.get_safe("with_openmp", False) + tc.cache_variables["BUILD_CLI"] = False + if is_apple_os(self): + tc.cache_variables["APPLE_OUTPUT_DYLIB"] = True + tc.variables["_MAJOR_VERSION"] = Version(self.version).major + tc.generate() + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_STATIC_LIB"] = not self.options.shared - cmake.definitions["USE_DEBUG"] = self.settings.build_type == "Debug" - cmake.definitions["USE_OPENMP"] = self.options.with_openmp - if self.settings.os == "Macos": - cmake.definitions["APPLE_OUTPUT_DYLIB"] = True - cmake.configure() - return cmake + apply_conandata_patches(self) + # Fix vendored dependency includes + common_h = os.path.join(self.source_folder, "include", "LightGBM", "utils", "common.h") + for lib in ["fmt", "fast_double_parser"]: + replace_in_file(self, common_h, f"../../../external_libs/{lib}/include/", "") + # Unvendor Eigen3 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "include_directories(${EIGEN_DIR})", "") 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): - 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() def package_info(self): @@ -90,16 +115,19 @@ def package_info(self): self.cpp_info.libs = ["lib_lightgbm"] if is_msvc(self) else ["_lightgbm"] if self.settings.os == "Windows": self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi"]) - elif self.settings.os == "Linux": + elif self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") - if not self.options.shared and self.options.with_openmp: + + # OpenMP preprocessor directives are used in a number of public headers, such as: + # https://github.com/microsoft/LightGBM/blob/master/include/LightGBM/tree.h#L188 + if self.options.get_safe("with_openmp"): + openmp_flags = [] if is_msvc(self): openmp_flags = ["-openmp"] elif self.settings.compiler == "gcc": openmp_flags = ["-fopenmp"] - elif self.settings.compiler in ("clang", "apple-clang"): + elif self.settings.compiler in ["clang", "apple-clang"]: openmp_flags = ["-Xpreprocessor", "-fopenmp"] - else: - openmp_flags = [] + self.cpp_info.cxxflags.extend(openmp_flags) self.cpp_info.exelinkflags.extend(openmp_flags) self.cpp_info.sharedlinkflags.extend(openmp_flags) diff --git a/recipes/lightgbm/all/patches/0001-fix-includes.patch b/recipes/lightgbm/all/patches/0001-fix-includes.patch deleted file mode 100644 index 13fa0fe43a9984..00000000000000 --- a/recipes/lightgbm/all/patches/0001-fix-includes.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/include/LightGBM/utils/common.h b/include/LightGBM/utils/common.h -index af981062..097f20d4 100644 ---- a/include/LightGBM/utils/common.h -+++ b/include/LightGBM/utils/common.h -@@ -33,9 +33,9 @@ - - #if (!((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)))) - #define FMT_HEADER_ONLY --#include "../../../external_libs/fmt/include/fmt/format.h" -+#include - #endif --#include "../../../external_libs/fast_double_parser/include/fast_double_parser.h" -+#include - - #ifdef _MSC_VER - #include diff --git a/recipes/lightgbm/all/patches/0002-fix-openmp-clang.patch b/recipes/lightgbm/all/patches/3.3.2-0001-fix-openmp-clang.patch similarity index 100% rename from recipes/lightgbm/all/patches/0002-fix-openmp-clang.patch rename to recipes/lightgbm/all/patches/3.3.2-0001-fix-openmp-clang.patch diff --git a/recipes/lightgbm/all/patches/0003-fix-openmp-clang.patch b/recipes/lightgbm/all/patches/3.3.5-0001-fix-openmp-clang.patch similarity index 100% rename from recipes/lightgbm/all/patches/0003-fix-openmp-clang.patch rename to recipes/lightgbm/all/patches/3.3.5-0001-fix-openmp-clang.patch diff --git a/recipes/lightgbm/all/patches/4.1.0-0001-fix-openmp-clang.patch b/recipes/lightgbm/all/patches/4.1.0-0001-fix-openmp-clang.patch new file mode 100644 index 00000000000000..4de5b0a2d1c8e2 --- /dev/null +++ b/recipes/lightgbm/all/patches/4.1.0-0001-fix-openmp-clang.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -526,7 +526,7 @@ + endif() + + if(USE_OPENMP) +- if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") ++ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang|AppleClang") + target_link_libraries(lightgbm_objs PUBLIC OpenMP::OpenMP_CXX) + # c_api headers also includes OpenMP headers, thus compiling + # lightgbm_capi_objs needs include directory for OpenMP. diff --git a/recipes/lightgbm/all/test_package/CMakeLists.txt b/recipes/lightgbm/all/test_package/CMakeLists.txt index 12b8a397ff5d34..1fc3dbaef1eaad 100644 --- a/recipes/lightgbm/all/test_package/CMakeLists.txt +++ b/recipes/lightgbm/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -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(TARGETS) - -find_package(LightGBM CONFIG REQUIRED) +find_package(LightGBM REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} LightGBM::LightGBM) diff --git a/recipes/lightgbm/all/test_package/conanfile.py b/recipes/lightgbm/all/test_package/conanfile.py index 746d011e4501a1..ef5d7042163ecc 100644 --- a/recipes/lightgbm/all/test_package/conanfile.py +++ b/recipes/lightgbm/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 LightGBMTestConan(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) @@ -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/lightgbm/all/test_v1_package/CMakeLists.txt b/recipes/lightgbm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/lightgbm/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/lightgbm/all/test_v1_package/conanfile.py b/recipes/lightgbm/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..746d011e4501a1 --- /dev/null +++ b/recipes/lightgbm/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class LightGBMTestConan(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/lightgbm/config.yml b/recipes/lightgbm/config.yml index 185a3ba9f96e0c..eba2ef0bbf4fd2 100644 --- a/recipes/lightgbm/config.yml +++ b/recipes/lightgbm/config.yml @@ -1,5 +1,7 @@ versions: - "3.3.2": + "4.1.0": folder: all "3.3.5": folder: all + "3.3.2": + folder: all diff --git a/recipes/lightpcapng/all/CMakeLists.txt b/recipes/lightpcapng/all/CMakeLists.txt deleted file mode 100644 index 5cfb924ad4de79..00000000000000 --- a/recipes/lightpcapng/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/lightpcapng/all/conanfile.py b/recipes/lightpcapng/all/conanfile.py index ea6e74e5ca99f7..3625228ec25347 100644 --- a/recipes/lightpcapng/all/conanfile.py +++ b/recipes/lightpcapng/all/conanfile.py @@ -1,15 +1,21 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.53.0" + class LightPcapNgConan(ConanFile): name = "lightpcapng" - homepage = "https://github.com/Technica-Engineering/LightPcapNg" description = "Library for general-purpose tracing based on PCAPNG file format" - topics = ("pcapng", "pcap") - url = "https://github.com/conan-io/conan-center-index" license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Technica-Engineering/LightPcapNg" + topics = ("pcapng", "pcap") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,17 +27,6 @@ class LightPcapNgConan(ConanFile): "fPIC": True, "with_zstd": True, } - generators = "cmake", "cmake_paths", "cmake_find_package" - exports_sources = "CMakeLists.txt" - _cmake = None - - @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": @@ -40,43 +35,50 @@ def config_options(self): def configure(self): if self.options.with_zstd: self.options["zstd"].shared = self.options.shared - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") 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_zstd: - self.requires("zstd/1.4.5") + self.requires("zstd/1.5.5") 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.variables["LIGHT_USE_ZSTD"] = self.options.with_zstd + tc.variables["BUILD_TESTING"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["LIGHT_USE_ZSTD"] = self.options.with_zstd - self._cmake.definitions["BUILD_TESTING"] = False - 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() def package_info(self): - self.cpp_info.names["cmake_find_package"] = "light_pcapng" - self.cpp_info.names["cmake_find_package_multi"] = "light_pcapng" - self.cpp_info.components["liblight_pcapng"].names["cmake_find_package"] = "light_pcapng" - self.cpp_info.components["liblight_pcapng"].names["cmake_find_package_multi"] = "light_pcapng" + self.cpp_info.set_property("cmake_file_name", "light_pcapng") + self.cpp_info.set_property("cmake_target_name", "light_pcapng::light_pcapng") self.cpp_info.components["liblight_pcapng"].libs = ["light_pcapng"] - if self.options.with_zstd: self.cpp_info.components["liblight_pcapng"].requires = ["zstd::zstd"] + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "light_pcapng" + self.cpp_info.names["cmake_find_package_multi"] = "light_pcapng" + self.cpp_info.components["liblight_pcapng"].names["cmake_find_package"] = "light_pcapng" + self.cpp_info.components["liblight_pcapng"].names["cmake_find_package_multi"] = "light_pcapng" diff --git a/recipes/lightpcapng/all/test_package/CMakeLists.txt b/recipes/lightpcapng/all/test_package/CMakeLists.txt index 8927c32d3f4ef6..f7eaac4f3f9501 100644 --- a/recipes/lightpcapng/all/test_package/CMakeLists.txt +++ b/recipes/lightpcapng/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(light_pcapng REQUIRED) +find_package(light_pcapng REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} light_pcapng::light_pcapng) diff --git a/recipes/lightpcapng/all/test_package/conanfile.py b/recipes/lightpcapng/all/test_package/conanfile.py index 3da371b660e0a3..ef5d7042163ecc 100644 --- a/recipes/lightpcapng/all/test_package/conanfile.py +++ b/recipes/lightpcapng/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/lightpcapng/all/test_v1_package/CMakeLists.txt b/recipes/lightpcapng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/lightpcapng/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/lightpcapng/all/test_v1_package/conanfile.py b/recipes/lightpcapng/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/lightpcapng/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/linmath.h/all/conanfile.py b/recipes/linmath.h/all/conanfile.py index 72dbc48e507a80..aeda5df97ec0fe 100644 --- a/recipes/linmath.h/all/conanfile.py +++ b/recipes/linmath.h/all/conanfile.py @@ -16,18 +16,18 @@ class LinmathConan(ConanFile): topics = ("math", "graphics", "linear-algebra", "vector", "matrix", "quaternion") homepage = "https://github.com/datenwolf/linmath.h" url = "https://github.com/conan-io/conan-center-index" + 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 diff --git a/recipes/linux-headers-generic/all/conandata.yml b/recipes/linux-headers-generic/all/conandata.yml index ecc5fdb03690f3..5ce5b2106b7c87 100644 --- a/recipes/linux-headers-generic/all/conandata.yml +++ b/recipes/linux-headers-generic/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "6.5.9": + url: "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.5.9.tar.gz" + sha256: "3c269612220746ba87dc9063bec2afcb2df04b4fdaa9f7e1f67751284966cf37" + "5.19.9": + url: "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.19.9.tar.gz" + sha256: "1f01b0ee846547737793103f23cc46a382e4694e7728e8cb8c48ea51a2bb7a8d" + "5.15.128": + url: "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.128.tar.gz" + sha256: "4ce1331bb3877bc92581ec5faff76d63d19e7b1fa174acdda1f5cba4a8f2abf7" "5.14.9": url: "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.14.9.tar.gz" sha256: "b5cd37e6d193c8f6a98e41ce6f9d97260d178e0a3cfc43d7ff684f67c6c25f29" diff --git a/recipes/linux-headers-generic/all/conanfile.py b/recipes/linux-headers-generic/all/conanfile.py index 8179bf6408f184..5b72ec11402d01 100644 --- a/recipes/linux-headers-generic/all/conanfile.py +++ b/recipes/linux-headers-generic/all/conanfile.py @@ -2,7 +2,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import cross_building from conan.tools.files import chdir, copy, get from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout @@ -30,11 +29,13 @@ def package_id(self): del self.info.settings.build_type del self.info.settings.compiler + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def validate(self): - if self.settings.os != "Linux": + if self.settings.os != "Linux" or (not self._is_legacy_one_profile and self.settings_build.os != "Linux"): raise ConanInvalidConfiguration("linux-headers-generic supports only Linux") - if hasattr(self, "settings_build") and cross_building(self): - raise ConanInvalidConfiguration("linux-headers-generic can not be cross-compiled") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/linux-headers-generic/config.yml b/recipes/linux-headers-generic/config.yml index a8d9d5e7bbfa80..461cdf02e1d8f7 100644 --- a/recipes/linux-headers-generic/config.yml +++ b/recipes/linux-headers-generic/config.yml @@ -1,4 +1,10 @@ versions: + "6.5.9": + folder: all + "5.19.9": + folder: all + "5.15.128": + folder: all "5.14.9": folder: all "5.13.9": 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/CMakeLists.txt b/recipes/llvm-openmp/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2bb..00000000000000 --- a/recipes/llvm-openmp/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/llvm-openmp/all/conandata.yml b/recipes/llvm-openmp/all/conandata.yml index 499e8f40e5c344..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,22 +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" - base_path: "source_subfolder" - - patch_file: "patches/0002-disable-omp-target_12.0.1.patch" - base_path: "source_subfolder" + - 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" - base_path: "source_subfolder" - - patch_file: "patches/0003-fix-armv8-build_11.1.0.patch" - base_path: "source_subfolder" + - 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" - base_path: "source_subfolder" + - 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" - base_path: "source_subfolder" + - 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" - base_path: "source_subfolder" + - 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 4f1ee354a647ea..14e375a798b6ce 100644 --- a/recipes/llvm-openmp/all/conanfile.py +++ b/recipes/llvm-openmp/all/conanfile.py @@ -1,10 +1,16 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -import functools import textwrap -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, 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, save, move_folder_contents, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class LLVMOpenMpConan(ConanFile): @@ -16,126 +22,183 @@ class LLVMOpenMpConan(ConanFile): "in Fortran and C/C++ programs. This is the LLVM " "implementation.") license = "Apache-2.0 WITH LLVM-exception" - topics = ("conan", "llvm", "openmp", "parallelism") - homepage = "https://github.com/llvm/llvm-project/tree/master/openmp" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/llvm/llvm-project/blob/main/openmp" + topics = ("llvm", "openmp", "parallelism") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], - "fPIC": [True, False]} - default_options = {"shared": False, - "fPIC": True} - generators = "cmake" + 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 _supports_compiler(self): + supported_compilers_by_os = { + "Linux": ["clang", "gcc", "intel-cc"], + "Macos": ["apple-clang", "clang", "gcc", "intel-cc"], + "Windows": ["intel-cc"], + } + 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 _source_subfolder(self): - return "source_subfolder" + def _version_major(self): + return Version(self.version).major 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 _supports_compiler(self): - supported_compilers_by_os = \ - {"Linux": ["clang", "gcc", "intel"], - "Macos": ["apple-clang", "clang", "gcc", "intel"], - "Windows": ["intel"]} - the_compiler, the_os = self.settings.compiler.value, self.settings.os.value - return the_compiler in supported_compilers_by_os.get(the_os, []) - def configure(self): if self.options.shared: - del self.options.fPIC - if not self._supports_compiler(): - raise ConanInvalidConfiguration("llvm-openmp doesn't support compiler: {} on OS: {}.". - format(self.settings.compiler, self.settings.os)) + self.options.rm_safe("fPIC") + + 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 ( - tools.Version(self.version) <= "10.0.0" - and self.settings.os == "Macos" - 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): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "openmp-{}.src".format(self.version) - os.rename(extracted_dir, self._source_subfolder) + 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 + 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): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["OPENMP_STANDALONE_BUILD"] = True - cmake.definitions["LIBOMP_ENABLE_SHARED"] = self.options.shared - if self.settings.os == "Linux": - cmake.definitions["OPENMP_ENABLE_LIBOMPTARGET"] = self.options.shared - cmake.configure() - return cmake + apply_conandata_patches(self) + 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() - tools.replace_in_file(os.path.join(self._source_subfolder, "runtime/CMakeLists.txt"), - "add_subdirectory(test)", "") - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", + 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")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), { "OpenMP::OpenMP_C": "OpenMP::OpenMP", - "OpenMP::OpenMP_CXX": "OpenMP::OpenMP" - } + "OpenMP::OpenMP_CXX": "OpenMP::OpenMP", + }, ) - @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): self.cpp_info.set_property("cmake_file_name", "OpenMP") self.cpp_info.set_property("cmake_target_name", "OpenMP::OpenMP") self.cpp_info.set_property("cmake_target_aliases", ["OpenMP::OpenMP_C", "OpenMP::OpenMP_CXX"]) + if self.settings.compiler in ("clang", "apple-clang"): + self.cpp_info.cxxflags = ["-Xpreprocessor", "-fopenmp"] + elif self.settings.compiler == "gcc": + self.cpp_info.cxxflags = ["-fopenmp"] + elif self.settings.compiler == "intel-cc": + self.cpp_info.cxxflags = ["/Qopenmp"] if self.settings.os == "Windows" else ["-Qopenmp"] + self.cpp_info.cflags = self.cpp_info.cxxflags + self.cpp_info.libs = ["omp"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "m", "pthread", "rt"] + # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "OpenMP" self.cpp_info.names["cmake_find_package_multi"] = "OpenMP" - self.cpp_info.builddirs.append(os.path.join(self.package_folder, 'lib', 'cmake')) + self.cpp_info.builddirs.append(os.path.join(self.package_folder, "lib", "cmake")) 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] - - if self.settings.compiler in ("clang", "apple-clang"): - self.cpp_info.cxxflags = ["-Xpreprocessor", "-fopenmp"] - elif self.settings.compiler == 'gcc': - self.cpp_info.cxxflags = ["-fopenmp"] - elif self.settings.compiler == 'intel': - self.cpp_info.cxxflags = ["/Qopenmp"] if self.settings.os == 'Windows' else ["-Qopenmp"] - self.cpp_info.libs = tools.collect_libs(self) - if self.settings.os == "Linux": - self.cpp_info.system_libs = ["dl", "m", "pthread", "rt"] diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch deleted file mode 100644 index 2266bee5e1d73b..00000000000000 --- a/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch +++ /dev/null @@ -1,38 +0,0 @@ -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) - --# 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.") -- - - # Build host runtime library. - add_subdirectory(runtime) -@@ -79,5 +65,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) - add_subdirectory(libomptarget) - endif() - --# Now that we have seen all testuites, create the check-openmp target. --construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch deleted file mode 100644 index 09c16d7b0bef6b..00000000000000 --- a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch +++ /dev/null @@ -1,50 +0,0 @@ -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) - --# 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.") -- - - # Build host runtime library. - add_subdirectory(runtime) -@@ -79,17 +65,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) - 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() -- --# Now that we have seen all testuites, create the check-openmp target. --construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch deleted file mode 100644 index 910ab03dc90e10..00000000000000 --- a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch +++ /dev/null @@ -1,52 +0,0 @@ -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) - --# 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.") -- -- - # Build host runtime library. - add_subdirectory(runtime) - -@@ -78,18 +63,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) - - 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() -- --# 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_12.0.1.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_12.0.1.patch deleted file mode 100644 index a1716382cf4d8f..00000000000000 --- a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_12.0.1.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/CMakeLists_orig.txt b/CMakeLists.txt -index b8a2822..7950dde 100644 ---- a/CMakeLists_orig.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) - --# 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, -@@ -97,22 +83,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) - - 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/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/10/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/10/0001-disable-build-testing.patch new file mode 100644 index 00000000000000..65692e0ed9c158 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/10/0001-disable-build-testing.patch @@ -0,0 +1,35 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,14 +39,6 @@ endif() + 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.") +- + + # Build host runtime library. + add_subdirectory(runtime) +@@ -79,17 +65,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) + 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() +- +-# Now that we have seen all testuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/11/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/11/0001-disable-build-testing.patch new file mode 100644 index 00000000000000..dde44031170780 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/11/0001-disable-build-testing.patch @@ -0,0 +1,37 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,15 +39,6 @@ endif() + 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.") +- +- + # Build host runtime library. + add_subdirectory(runtime) + +@@ -78,18 +63,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) + + 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() +- +-# Now that we have seen all testsuites, create the check-openmp target. +-construct_check_openmp_target() 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/12/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/12/0001-disable-build-testing.patch new file mode 100644 index 00000000000000..f455aa8e371683 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/12/0001-disable-build-testing.patch @@ -0,0 +1,40 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,14 +41,6 @@ endif() + 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, +@@ -97,22 +83,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) + + 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/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/8/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/8/0001-disable-build-testing.patch new file mode 100644 index 00000000000000..3215d61a23b9f9 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/8/0001-disable-build-testing.patch @@ -0,0 +1,25 @@ +diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt +index 597eedcec0b..4395761dac4 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -45,14 +39,6 @@ endif() + 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.") +- + + # Build host runtime library. + add_subdirectory(runtime) +@@ -79,5 +65,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) + add_subdirectory(libomptarget) + endif() + +-# Now that we have seen all testuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/test_package/CMakeLists.txt b/recipes/llvm-openmp/all/test_package/CMakeLists.txt index 2d9a8574cc4d42..491aa7ec1f5d35 100644 --- a/recipes/llvm-openmp/all/test_package/CMakeLists.txt +++ b/recipes/llvm-openmp/all/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX C) find_package(OpenMP CONFIG REQUIRED) -add_executable(test_package test_package.cpp) -target_link_libraries(test_package OpenMP::OpenMP_CXX) +add_executable(test_package_cxx test_package.cpp) +target_link_libraries(test_package_cxx OpenMP::OpenMP_CXX) + +add_executable(test_package_c test_package.c) +target_link_libraries(test_package_c OpenMP::OpenMP_C) diff --git a/recipes/llvm-openmp/all/test_package/conanfile.py b/recipes/llvm-openmp/all/test_package/conanfile.py index 5ac3af772bdc06..b9c17185d658e4 100644 --- a/recipes/llvm-openmp/all/test_package/conanfile.py +++ b/recipes/llvm-openmp/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 LLVMOpenMpTestConan(ConanFile): +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,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): + for executable in ["test_package_cxx", "test_package_c"]: + bin_path = os.path.join(self.cpp.build.bindir, executable) + self.run(bin_path, env="conanrun") diff --git a/recipes/llvm-openmp/all/test_package/test_package.c b/recipes/llvm-openmp/all/test_package/test_package.c new file mode 100644 index 00000000000000..103d724f00fcde --- /dev/null +++ b/recipes/llvm-openmp/all/test_package/test_package.c @@ -0,0 +1,25 @@ +#include + +#include + +int main() +{ + int num_threads = omp_get_num_procs(); + if (num_threads < 5) + num_threads = 5; + omp_set_num_threads(num_threads); + int actual_number; + #pragma omp parallel + { + #pragma omp single + { + actual_number = omp_get_num_threads(); + } + } + if(actual_number != num_threads){ + printf("Something went wrong. Expecting %d threads but found %d.\n", num_threads, actual_number); + printf("There are probably missing compiler flags.\n"); + return 1; + } + return 0; +} diff --git a/recipes/llvm-openmp/all/test_package/test_package.cpp b/recipes/llvm-openmp/all/test_package/test_package.cpp index f6316471238aab..b602ec5a096c91 100644 --- a/recipes/llvm-openmp/all/test_package/test_package.cpp +++ b/recipes/llvm-openmp/all/test_package/test_package.cpp @@ -1,4 +1,5 @@ #include + #include int main() @@ -15,7 +16,7 @@ int main() } if(actual_number != num_threads){ std::cout << "Something went wrong. Expecting " << num_threads << " threads but found " << actual_number << ".\n"; - std::cout << "There are probably missing compiler flags.\n" ; + std::cout << "There are probably missing compiler flags.\n"; return 1; } return 0; diff --git a/recipes/llvm-openmp/all/test_v1_package/CMakeLists.txt b/recipes/llvm-openmp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/llvm-openmp/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/llvm-openmp/all/test_v1_package/conanfile.py b/recipes/llvm-openmp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..b6e98e149af122 --- /dev/null +++ b/recipes/llvm-openmp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class LLVMOpenMpTestConan(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): + for executable in ["test_package_cxx", "test_package_c"]: + bin_path = os.path.join("bin", executable) + self.run(bin_path, run_environment=True) 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/lodepng/all/conandata.yml b/recipes/lodepng/all/conandata.yml index bc34ea30306f5c..c67c30a9939fdc 100644 --- a/recipes/lodepng/all/conandata.yml +++ b/recipes/lodepng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230410": + url: "https://github.com/lvandeve/lodepng/archive/c18b949b71f45e78b1f9a28c5d458bce0da505d6.tar.gz" + sha256: "915d1bf834e67632b87bd18c932e6041ed0ca46a7e3493f5e3290980092cf2d9" "cci.20200615": url: "https://github.com/lvandeve/lodepng/archive/34628e89e80cd007179b25b0b2695e6af0f57fac.tar.gz" sha256: "486ece0b661e83e509f1c6c9a05ca8dd1dd0008eec47d2aad9359e3609ab44a9" diff --git a/recipes/lodepng/config.yml b/recipes/lodepng/config.yml index 4b29d9b93e715f..7d5d008d1120b9 100644 --- a/recipes/lodepng/config.yml +++ b/recipes/lodepng/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20230410": + folder: all "cci.20200615": folder: all diff --git a/recipes/log4cxx/all/CMakeLists.txt b/recipes/log4cxx/all/CMakeLists.txt deleted file mode 100644 index b83949de59dc55..00000000000000 --- a/recipes/log4cxx/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -project(cmake_wrapper CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 4d9c222f7d839a..6e4b69d1303a5a 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.1.0.tar.gz" + sha256: "1fc7d82697534184bc0f757348d969d24852b948f63d6b17283fd1ee29c2c28a" "0.12.1": url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" @@ -6,9 +9,15 @@ sources: url: "https://archive.apache.org/dist/logging/log4cxx/0.12.0/apache-log4cxx-0.12.0.tar.gz" sha256: "bd5b5009ca914c8fa7944b92ea6b4ca6fb7d146f65d526f21bf8b3c6a0520e44" patches: + "1.1.0": + - patch_file: "patches/1.1.0-0001-find-apr.patch" + patch_description: "use cci's package name" + patch_type: "conan" "0.12.1": - - base_path: "source_subfolder" - patch_file: "patches/0001-find-apr.patch" + - patch_file: "patches/0.12.0-0001-find-apr.patch" + patch_description: "use cci's package name" + patch_type: "conan" "0.12.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-find-apr.patch" + - patch_file: "patches/0.12.0-0001-find-apr.patch" + patch_description: "use cci's package name" + patch_type: "conan" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index ac48eb45fc460f..f7fedd1522a394 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -1,19 +1,25 @@ -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 +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.scm import Version + +required_conan_version = ">=1.53.0" class Log4cxxConan(ConanFile): name = "log4cxx" description = "Logging framework for C++ patterned after Apache log4j" - url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://logging.apache.org/log4cxx" topics = ("logging", "log") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,21 +30,22 @@ class Log4cxxConan(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package", "pkg_config" - _cmake = None - @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 { + "gcc": "7", + "Visual Studio": "15", + "msvc": "191", + "clang": "5", + "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"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -46,88 +53,75 @@ 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("apr/1.7.0") + self.requires("apr/1.7.4") self.requires("apr-util/1.6.1") - self.requires("expat/2.4.2") + self.requires("expat/2.5.0") if self.settings.os != "Windows": - self.requires("odbc/2.3.9") - - @property - def _compilers_minimum_version(self): - return { - "gcc": "7", - "Visual Studio": "15", - "clang": "5", - "apple-clang": "10", - } + self.requires("odbc/2.3.11") def validate(self): # TODO: if compiler doesn't support C++17, boost can be used instead if self.settings.compiler.get_safe("cppstd"): - tools.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("log4cxx requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("log4cxx requires a compiler that supports at least C++17") + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires a compiler that supports at least C++{self._min_cppstd}") def build_requirements(self): if self.settings.os != "Windows": - self.build_requires("pkgconf/1.7.4") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.0.3") def source(self): - #OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: - #'source_subfolder\\src\\test\\resources\\output\\xyz\\:' + # OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: + # 'src\\test\\resources\\output\\xyz\\:' pattern = "*[!:]" - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True, - pattern=pattern) - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - if self.settings.os == "Windows": - self._cmake.definitions["LOG4CXX_INSTALL_PDB"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True, pattern=pattern) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["LOG4CXX_INSTALL_PDB"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - self._patch_sources() - 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") - self.copy("NOTICE", 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")) + copy(self, "NOTICE", 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, "share")) + 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")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {"log4cxx": "log4cxx::log4cxx"} + os.path.join(self.package_folder, self._module_file_rel_path), {"log4cxx": "log4cxx::log4cxx"} ) - @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): @@ -137,6 +131,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "log4cxx") self.cpp_info.set_property("cmake_target_name", "log4cxx") self.cpp_info.set_property("pkg_config_name", "liblog4cxx") + if not self.options.shared: self.cpp_info.defines = ["LOG4CXX_STATIC"] self.cpp_info.libs = ["log4cxx"] @@ -146,4 +141,3 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed 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] - self.cpp_info.names["pkg_config"] = "liblog4cxx" diff --git a/recipes/log4cxx/all/patches/0.12.0-0001-find-apr.patch b/recipes/log4cxx/all/patches/0.12.0-0001-find-apr.patch new file mode 100644 index 00000000000000..9b75430996d184 --- /dev/null +++ b/recipes/log4cxx/all/patches/0.12.0-0001-find-apr.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,12 +25,14 @@ if(NOT BUILD_SHARED_LIBS) + endif() + + # Find Apache Runtime +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + + # Find expat for XML parsing +-find_package(EXPAT REQUIRED) ++find_package(EXPAT REQUIRED MODULE) diff --git a/recipes/log4cxx/all/patches/0001-find-apr.patch b/recipes/log4cxx/all/patches/0001-find-apr.patch deleted file mode 100644 index 11635d23e734f6..00000000000000 --- a/recipes/log4cxx/all/patches/0001-find-apr.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -25,10 +25,12 @@ if(NOT BUILD_SHARED_LIBS) - endif() - - # Find Apache Runtime --find_package(APR REQUIRED) -+find_package(apr REQUIRED) -+set(APR_LIBRARIES apr::apr) - - # Find Apache Runtime Utilities --find_package(APR-Util REQUIRED) -+find_package(apr-util REQUIRED) -+set(APR_UTIL_LIBRARIES apr-util::apr-util) - - find_package( Threads REQUIRED ) - diff --git a/recipes/log4cxx/all/patches/1.1.0-0001-find-apr.patch b/recipes/log4cxx/all/patches/1.1.0-0001-find-apr.patch new file mode 100644 index 00000000000000..5b8a283a6e00a3 --- /dev/null +++ b/recipes/log4cxx/all/patches/1.1.0-0001-find-apr.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 61c0479..6ac3e77 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,16 +51,18 @@ endif() + + # Find Apache Runtime + option(APR_STATIC "Link to the APR static library" OFF) +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities + option(APU_STATIC "Link to the APR-Util static library" OFF) +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + + # Find expat for XML parsing +-find_package(EXPAT REQUIRED) ++find_package(EXPAT REQUIRED MODULE) + if(TARGET EXPAT::EXPAT) + set(EXPAT_LIBRARIES EXPAT::EXPAT) + elseif(TARGET expat::expat) +@@ -134,7 +136,7 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/main/include/log4cxx + ) + + install(TARGETS log4cxx EXPORT log4cxxTargets +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +@@ -171,7 +173,7 @@ if(UNIX) + "${CMAKE_CURRENT_BINARY_DIR}/liblog4cxx.pc" + ) + +- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblog4cxx.pc" ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblog4cxx.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + + if(LOG4CXX_QT_SUPPORT) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index 4b7ef0dd16dbbb..a9ec878c74ebe7 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(log4cxx REQUIRED CONFIG) diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py index 0aa45c8d4db18f..382876561a2038 100644 --- a/recipes/log4cxx/all/test_package/conanfile.py +++ b/recipes/log4cxx/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,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") - bin_path = os.path.join("bin", "test_package") - self.run("{} {}".format(bin_path, config_xml_name), run_environment=True) + self.run(f"{bin_path} {config_xml_name}", env="conanrun") diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/log4cxx/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/log4cxx/all/test_v1_package/conanfile.py b/recipes/log4cxx/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..0aa45c8d4db18f --- /dev/null +++ b/recipes/log4cxx/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.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") + bin_path = os.path.join("bin", "test_package") + self.run("{} {}".format(bin_path, config_xml_name), run_environment=True) diff --git a/recipes/log4cxx/config.yml b/recipes/log4cxx/config.yml index f5578f6ffba140..18729d7b4cdc5d 100644 --- a/recipes/log4cxx/config.yml +++ b/recipes/log4cxx/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "0.12.1": folder: all "0.12.0": diff --git a/recipes/loguru/all/conanfile.py b/recipes/loguru/all/conanfile.py index 098d77e4ec8b73..8f740c8665ca64 100644 --- a/recipes/loguru/all/conanfile.py +++ b/recipes/loguru/all/conanfile.py @@ -20,6 +20,7 @@ class LoguruConan(ConanFile): description = "Loguru is a C++11 logging library." package_type = "library" settings = "os", "arch", "compiler", "build_type" + options = { "shared": [True, False], "fPIC": [True, False], @@ -79,16 +80,19 @@ def layout(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["LOGURU_USE_FMTLIB"] = self.options.with_fmt tc.variables["LOGURU_VERBOSE_SCOPE_ENDINGS"] = self.options.verbose_scope_endings tc.variables["LOGURU_REDEFINE_ASSERT"] = self.options.redefine_assert tc.variables["LOGURU_WITH_STREAMS"] = self.options.enable_streams tc.variables["LOGURU_WITH_FILEABS"] = self.options.enable_fileabs tc.variables["LOGURU_REPLACE_GLOG"] = self.options.replace_glog + tc.variables["LOGURU_SCOPE_TEXT_SIZE"] = self.options.scope_text_size tc.variables["LOGURU_SCOPE_TIME_PRECISION"] = self.options.scope_time_precision tc.variables["LOGURU_FILENAME_WIDTH"] = self.options.filename_width tc.variables["LOGURU_THREADNAME_WIDTH"] = self.options.threadname_width + if is_msvc(self) and self.options.shared: tc.preprocessor_definitions["LOGURU_EXPORT"] = "__declspec(dllexport)" tc.generate() @@ -110,7 +114,7 @@ def package(self): save(self, os.path.join(self.package_folder, 'licenses', 'LICENSE'), self._extracted_license) 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")) rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) @@ -124,16 +128,18 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "loguru") self.cpp_info.set_property("cmake_target_name", "loguru::loguru") - self.cpp_info.defines.append(f"LOGURU_USE_FMTLIB={self.options.with_fmt}") + # render each option as either 0 or 1 for loguru's #if preprocessor commands + self.cpp_info.defines.append(f"LOGURU_USE_FMTLIB={bool(self.options.with_fmt)*1}") + self.cpp_info.defines.append(f"LOGURU_VERBOSE_SCOPE_ENDINGS={bool(self.options.verbose_scope_endings)*1}") + self.cpp_info.defines.append(f"LOGURU_REDEFINE_ASSERT={bool(self.options.redefine_assert)*1}") + self.cpp_info.defines.append(f"LOGURU_WITH_STREAMS={bool(self.options.enable_streams)*1}") + self.cpp_info.defines.append(f"LOGURU_WITH_FILEABS={bool(self.options.enable_fileabs)*1}") + self.cpp_info.defines.append(f"LOGURU_REPLACE_GLOG={bool(self.options.replace_glog)*1}") + self.cpp_info.defines.append(f"LOGURU_SCOPE_TEXT_SIZE={self.options.scope_text_size}") self.cpp_info.defines.append(f"LOGURU_SCOPE_TIME_PRECISION={self.options.scope_time_precision}") self.cpp_info.defines.append(f"LOGURU_FILENAME_WIDTH={self.options.filename_width}") self.cpp_info.defines.append(f"LOGURU_THREADNAME_WIDTH={self.options.threadname_width}") - self.cpp_info.defines.append(f"LOGURU_VERBOSE_SCOPE_ENDINGS={self.options.verbose_scope_endings}") - self.cpp_info.defines.append(f"LOGURU_REDEFINE_ASSERT={self.options.redefine_assert}") - self.cpp_info.defines.append(f"LOGURU_WITH_STREAMS={self.options.enable_streams}") - self.cpp_info.defines.append(f"LOGURU_WITH_FILEABS={self.options.enable_fileabs}") - self.cpp_info.defines.append(f"LOGURU_REPLACE_GLOG={self.options.replace_glog}") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "dl", "m"] diff --git a/recipes/ls-qpack/all/conandata.yml b/recipes/ls-qpack/all/conandata.yml index 2760252082cf6f..ac7d7d333e78b6 100644 --- a/recipes/ls-qpack/all/conandata.yml +++ b/recipes/ls-qpack/all/conandata.yml @@ -1,13 +1,22 @@ sources: + "2.5.3": + url: "https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.3.tar.gz" + sha256: "075a05efee27961eac5ac92a12a6e28a61bcd6c122a0276938ef993338577337" "2.5.1": url: "https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.1.tar.gz" sha256: "dae1c159afc8541d51c12f5ad78209fe092815d37cb621b5ee46a9db049a283f" - patches: + "2.5.3": + - patch_file: "patches/2.5.1-0001-use-cci-package.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/2.5.3-0002-add-installer.patch" + patch_description: "add installer" + patch_type: "conan" "2.5.1": - - patch_file: "patches/0001-use-cci-package.patch" + - patch_file: "patches/2.5.1-0001-use-cci-package.patch" patch_description: "use cci packages" patch_type: "conan" - - patch_file: "patches/0002-add-installer.patch" + - patch_file: "patches/2.5.1-0002-add-installer.patch" patch_description: "add installer" patch_type: "conan" diff --git a/recipes/ls-qpack/all/conanfile.py b/recipes/ls-qpack/all/conanfile.py index dd139a2740293c..89421636cbe72b 100644 --- a/recipes/ls-qpack/all/conanfile.py +++ b/recipes/ls-qpack/all/conanfile.py @@ -42,7 +42,7 @@ def layout(self): def requirements(self): if self.options.with_xxh: - self.requires("xxhash/0.8.1") + self.requires("xxhash/0.8.2") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/ls-qpack/all/patches/0001-use-cci-package.patch b/recipes/ls-qpack/all/patches/0001-use-cci-package.patch deleted file mode 100644 index 21e1e856275c97..00000000000000 --- a/recipes/ls-qpack/all/patches/0001-use-cci-package.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d9d9aa3..826e99b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -20,9 +20,10 @@ add_library(ls-qpack "") - target_include_directories(ls-qpack PUBLIC .) - target_sources(ls-qpack PRIVATE lsqpack.c) - --target_include_directories(ls-qpack PRIVATE deps/xxhash/) - if(LSQPACK_XXH) -+ find_package(xxHash REQUIRED CONFIG) - target_sources(ls-qpack PRIVATE deps/xxhash/xxhash.c) -+ target_link_libraries(ls-qpack PUBLIC xxHash::xxhash) - endif() - - if(MSVC) diff --git a/recipes/ls-qpack/all/patches/2.5.1-0001-use-cci-package.patch b/recipes/ls-qpack/all/patches/2.5.1-0001-use-cci-package.patch new file mode 100644 index 00000000000000..48af51a011e2dd --- /dev/null +++ b/recipes/ls-qpack/all/patches/2.5.1-0001-use-cci-package.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d9d9aa3..826e99b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,9 +20,10 @@ add_library(ls-qpack "") + target_include_directories(ls-qpack PUBLIC .) + target_sources(ls-qpack PRIVATE lsqpack.c) + +-target_include_directories(ls-qpack PRIVATE deps/xxhash/) + if(LSQPACK_XXH) ++ find_package(xxHash REQUIRED CONFIG) +- target_sources(ls-qpack PRIVATE deps/xxhash/xxhash.c) ++ # target_sources(ls-qpack PRIVATE deps/xxhash/xxhash.c) ++ target_link_libraries(ls-qpack PUBLIC xxHash::xxhash) + endif() + + if(MSVC) diff --git a/recipes/ls-qpack/all/patches/0002-add-installer.patch b/recipes/ls-qpack/all/patches/2.5.1-0002-add-installer.patch similarity index 100% rename from recipes/ls-qpack/all/patches/0002-add-installer.patch rename to recipes/ls-qpack/all/patches/2.5.1-0002-add-installer.patch diff --git a/recipes/ls-qpack/all/patches/2.5.3-0002-add-installer.patch b/recipes/ls-qpack/all/patches/2.5.3-0002-add-installer.patch new file mode 100644 index 00000000000000..bc34f0724108af --- /dev/null +++ b/recipes/ls-qpack/all/patches/2.5.3-0002-add-installer.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7f7cd40..70e8fa8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -102,3 +102,18 @@ endif() + if(LSQPACK_BIN) + add_subdirectory(bin) + endif() ++ ++include(GNUInstallDirs) ++ ++install( ++ TARGETS ls-qpack ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++ ++install(FILES lsqpack.h DESTINATION include) ++ ++if(WIN32) ++ install(DIRECTORY wincompat DESTINATION include) ++endif() diff --git a/recipes/ls-qpack/config.yml b/recipes/ls-qpack/config.yml index eab83a303df52d..cbd3f0133afbb7 100644 --- a/recipes/ls-qpack/config.yml +++ b/recipes/ls-qpack/config.yml @@ -1,3 +1,5 @@ versions: + "2.5.3": + folder: all "2.5.1": folder: all diff --git a/recipes/luajit/all/conanfile.py b/recipes/luajit/all/conanfile.py index 5271897d749e21..47079e98290b1d 100644 --- a/recipes/luajit/all/conanfile.py +++ b/recipes/luajit/all/conanfile.py @@ -20,6 +20,7 @@ class LuajitConan(ConanFile): homepage = "http://luajit.org" description = "LuaJIT is a Just-In-Time Compiler (JIT) for the Lua programming language." topics = ("lua", "jit") + provides = "lua" settings = "os", "arch", "compiler", "build_type" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} diff --git a/recipes/luau/all/conandata.yml b/recipes/luau/all/conandata.yml index 1dc4953f665e9e..6f3f5ad765cc1a 100644 --- a/recipes/luau/all/conandata.yml +++ b/recipes/luau/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "0.593": + url: "https://github.com/Roblox/luau/archive/0.593.tar.gz" + sha256: "1cbe4390ef71bb0f2210853978c900974aa02fab73de92b6e18e7bb10dd0e3c1" + "0.589": + url: "https://github.com/Roblox/luau/archive/0.589.tar.gz" + sha256: "dc4489de52dbf29cd3d04d78c1112f812e04a03b68d57585749260ba791e65ed" "0.582": url: "https://github.com/Roblox/luau/archive/0.582.tar.gz" sha256: "ee6da6329e58afc956bcca907ed9c6bc0455cd580990aa73f7cfb285aea22a6d" @@ -17,94 +29,12 @@ sources: "0.558": url: "https://github.com/Roblox/luau/archive/0.558.tar.gz" sha256: "3484adddb18872700e033f5917af44d90c266f9e0fff2fac21aec1061f472a06" - "0.556": - url: "https://github.com/Roblox/luau/archive/0.556.tar.gz" - sha256: "dc72f91f4e866a2b25f7608e062c91c84e92a2e5611026e9789f127c3caf39f6" - "0.552": - url: "https://github.com/Roblox/luau/archive/0.552.tar.gz" - sha256: "c638aee88010197d7e6f22e592fa12360e38a69f54ed91980b11ac0f89676db5" - "0.548": - url: "https://github.com/Roblox/luau/archive/0.548.tar.gz" - sha256: "1ec0aa919955aaa2d88dbef115801681d3b4dbfa7a276435a03d20230918659c" - "0.544": - url: "https://github.com/Roblox/luau/archive/0.544.tar.gz" - sha256: "c1e2d4e04fe6f191192d1570bd83f96531804fc484a0bc0e00b53248a01d7dee" - "0.541": - url: "https://github.com/Roblox/luau/archive/0.541.tar.gz" - sha256: "02d50b8c0396a353ed641a61959851d6858607d535ed7373478b8fbc2a508eba" - "0.540": - url: "https://github.com/Roblox/luau/archive/0.540.tar.gz" - sha256: "84b3e52b3b0ccf4d5bc0e0c04055f3a9b2f045c1281e203a858335a6fe76b0ff" patches: - "0.582": - - patch_file: "patches/0.572-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - "0.577": - - patch_file: "patches/0.572-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - "0.572": - - patch_file: "patches/0.572-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - "0.568": - - patch_file: "patches/0.568-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" "0.563": - - patch_file: "patches/0.552-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - patch_file: "patches/0.536-0002-rename-lerp.patch" patch_description: "rename lerp function to avoid name conflict" patch_type: "portability" "0.558": - - patch_file: "patches/0.552-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - - patch_file: "patches/0.536-0002-rename-lerp.patch" - patch_description: "rename lerp function to avoid name conflict" - patch_type: "portability" - "0.556": - - patch_file: "patches/0.552-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - - patch_file: "patches/0.536-0002-rename-lerp.patch" - patch_description: "rename lerp function to avoid name conflict" - patch_type: "portability" - "0.552": - - patch_file: "patches/0.552-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - - patch_file: "patches/0.536-0002-rename-lerp.patch" - patch_description: "rename lerp function to avoid name conflict" - patch_type: "portability" - "0.548": - - patch_file: "patches/0.536-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - - patch_file: "patches/0.536-0002-rename-lerp.patch" - patch_description: "rename lerp function to avoid name conflict" - patch_type: "portability" - "0.544": - - patch_file: "patches/0.536-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - - patch_file: "patches/0.536-0002-rename-lerp.patch" - patch_description: "rename lerp function to avoid name conflict" - patch_type: "portability" - "0.541": - - patch_file: "patches/0.536-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - - patch_file: "patches/0.536-0002-rename-lerp.patch" - patch_description: "rename lerp function to avoid name conflict" - patch_type: "portability" - "0.540": - - patch_file: "patches/0.536-0001-fix-cmake.patch" - patch_description: "enable shared build" - patch_type: "portability" - patch_file: "patches/0.536-0002-rename-lerp.patch" patch_description: "rename lerp function to avoid name conflict" patch_type: "portability" diff --git a/recipes/luau/all/conanfile.py b/recipes/luau/all/conanfile.py index fe153e150679e6..643eab7b931701 100644 --- a/recipes/luau/all/conanfile.py +++ b/recipes/luau/all/conanfile.py @@ -1,7 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file +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, CMakeToolchain, cmake_layout @@ -17,18 +16,14 @@ class LuauConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://luau-lang.org/" topics = ("lua", "scripting", "typed", "embed") - package_type = "library" + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [False, True], - "fPIC": [True, False], "with_cli": [True, False], "with_web": [True, False], "native_code_gen": [True, False], } default_options = { - "shared": False, - "fPIC": True, "with_cli": False, "with_web": False, "native_code_gen": False, @@ -41,7 +36,7 @@ def _minimum_cpp_standard(self): @property def _compilers_minimum_version(self): return { - "gcc": "8" if Version(self.version) < "0.549" else "9", + "gcc": "9", "clang": "7", "apple-clang": "12", "Visual Studio": "15", @@ -52,16 +47,6 @@ def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) 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 Version(self.version) < "0.549": - del self.options.native_code_gen - def layout(self): cmake_layout(self, src_folder="src") @@ -74,9 +59,6 @@ def validate(self): f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." ) - if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} does not support shared build in MSVC") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -87,17 +69,12 @@ def generate(self): tc.variables["LUAU_BUILD_WEB"] = self.options.with_web tc.variables["LUAU_WERROR"] = False tc.variables["LUAU_STATIC_CRT"] = False - if Version(self.version) >= "0.549": - tc.variables["LUAU_NATIVE"] = self.options.native_code_gen + tc.variables["LUAU_NATIVE"] = self.options.native_code_gen tc.variables["LUAU_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.generate() def _patch_sources(self): apply_conandata_patches(self) - if Version(self.version) >= "0.548" and self.options.shared: - replace_in_file(self, os.path.join(self.source_folder, "VM", "include", "luaconf.h"), - "#define LUAI_FUNC __attribute__((visibility(\"hidden\"))) extern", - "#define LUAI_FUNC extern") def build(self): self._patch_sources() @@ -139,8 +116,7 @@ def package_info(self): self.cpp_info.components["CodeGen"].libs = ["Luau.CodeGen"] self.cpp_info.components["CodeGen"].set_property("cmake_target_name", "Luau::CodeGen") self.cpp_info.components["CodeGen"].requires = ["Ast"] - if Version(self.version) >= "0.548": - self.cpp_info.components["CodeGen"].requires.append("VM") + self.cpp_info.components["CodeGen"].requires.append("VM") if self.options.with_cli: bin_path = os.path.join(self.package_folder, "bin") diff --git a/recipes/luau/all/patches/0.536-0001-fix-cmake.patch b/recipes/luau/all/patches/0.536-0001-fix-cmake.patch deleted file mode 100644 index 00dcf666172050..00000000000000 --- a/recipes/luau/all/patches/0.536-0001-fix-cmake.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9200634..c1cca12 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -21,12 +21,12 @@ endif() - - project(Luau LANGUAGES CXX C) - add_library(Luau.Common INTERFACE) --add_library(Luau.Ast STATIC) --add_library(Luau.Compiler STATIC) --add_library(Luau.Analysis STATIC) --add_library(Luau.CodeGen STATIC) --add_library(Luau.VM STATIC) --add_library(isocline STATIC) -+add_library(Luau.Ast) -+add_library(Luau.Compiler) -+add_library(Luau.Analysis) -+add_library(Luau.CodeGen) -+add_library(Luau.VM) -+add_library(isocline) - - if(LUAU_BUILD_CLI) - add_executable(Luau.Repl.CLI) diff --git a/recipes/luau/all/patches/0.552-0001-fix-cmake.patch b/recipes/luau/all/patches/0.552-0001-fix-cmake.patch deleted file mode 100644 index aaff66adb45b9b..00000000000000 --- a/recipes/luau/all/patches/0.552-0001-fix-cmake.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 05d701e..4c73783 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -22,12 +22,12 @@ endif() - - project(Luau LANGUAGES CXX C) - add_library(Luau.Common INTERFACE) --add_library(Luau.Ast STATIC) --add_library(Luau.Compiler STATIC) --add_library(Luau.Analysis STATIC) --add_library(Luau.CodeGen STATIC) --add_library(Luau.VM STATIC) --add_library(isocline STATIC) -+add_library(Luau.Ast) -+add_library(Luau.Compiler) -+add_library(Luau.Analysis) -+add_library(Luau.CodeGen) -+add_library(Luau.VM) -+add_library(isocline) - - if(LUAU_BUILD_CLI) - add_executable(Luau.Repl.CLI) diff --git a/recipes/luau/all/patches/0.568-0001-fix-cmake.patch b/recipes/luau/all/patches/0.568-0001-fix-cmake.patch deleted file mode 100644 index 9901376bd09eac..00000000000000 --- a/recipes/luau/all/patches/0.568-0001-fix-cmake.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6e15e5f..63be1e1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -24,12 +24,12 @@ endif() - - project(Luau LANGUAGES CXX C) - add_library(Luau.Common INTERFACE) --add_library(Luau.Ast STATIC) --add_library(Luau.Compiler STATIC) --add_library(Luau.Analysis STATIC) --add_library(Luau.CodeGen STATIC) --add_library(Luau.VM STATIC) --add_library(isocline STATIC) -+add_library(Luau.Ast) -+add_library(Luau.Compiler) -+add_library(Luau.Analysis) -+add_library(Luau.CodeGen) -+add_library(Luau.VM) -+add_library(isocline) - - if(LUAU_BUILD_CLI) - add_executable(Luau.Repl.CLI) -diff --git a/Sources.cmake b/Sources.cmake -index 6e0a32e..53d77c6 100644 ---- a/Sources.cmake -+++ b/Sources.cmake -@@ -84,6 +84,7 @@ target_sources(Luau.CodeGen PRIVATE - CodeGen/src/CodeBlockUnwind.cpp - CodeGen/src/CodeGen.cpp - CodeGen/src/CodeGenUtils.cpp -+ CodeGen/src/CodeGenA64.cpp - CodeGen/src/CodeGenX64.cpp - CodeGen/src/EmitBuiltinsX64.cpp - CodeGen/src/EmitCommonX64.cpp diff --git a/recipes/luau/all/patches/0.572-0001-fix-cmake.patch b/recipes/luau/all/patches/0.572-0001-fix-cmake.patch deleted file mode 100644 index 24acb8d334fb95..00000000000000 --- a/recipes/luau/all/patches/0.572-0001-fix-cmake.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6e15e5f..63be1e1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -24,12 +24,12 @@ endif() - - project(Luau LANGUAGES CXX C) - add_library(Luau.Common INTERFACE) --add_library(Luau.Ast STATIC) --add_library(Luau.Compiler STATIC) --add_library(Luau.Analysis STATIC) --add_library(Luau.CodeGen STATIC) --add_library(Luau.VM STATIC) --add_library(isocline STATIC) -+add_library(Luau.Ast) -+add_library(Luau.Compiler) -+add_library(Luau.Analysis) -+add_library(Luau.CodeGen) -+add_library(Luau.VM) -+add_library(isocline) - - if(LUAU_BUILD_CLI) - add_executable(Luau.Repl.CLI) diff --git a/recipes/luau/config.yml b/recipes/luau/config.yml index 8a8c09827d38eb..80fe8362a792c8 100644 --- a/recipes/luau/config.yml +++ b/recipes/luau/config.yml @@ -1,4 +1,12 @@ versions: + "0.603": + folder: all + "0.598": + folder: all + "0.593": + folder: all + "0.589": + folder: all "0.582": folder: all "0.577": @@ -11,15 +19,3 @@ versions: folder: all "0.558": folder: all - "0.556": - folder: all - "0.552": - folder: all - "0.548": - folder: all - "0.544": - folder: all - "0.541": - folder: all - "0.540": - folder: all diff --git a/recipes/lyra/all/conandata.yml b/recipes/lyra/all/conandata.yml index f6627e78699fe4..8d693ef2d527dd 100644 --- a/recipes/lyra/all/conandata.yml +++ b/recipes/lyra/all/conandata.yml @@ -1,28 +1,16 @@ sources: - "1.0.0": - sha256: ede5446cdd2b74a8cbaa12b998e820d0a1489574649bd76e7e67e69cb841ae22 - url: https://github.com/bfgroup/Lyra/archive/lyra-1.0.tar.gz - "1.1.0": - sha256: c2d70a926f698fb7decb99c7215bb55ab770100f9574c290998bf91416bd8217 - url: https://github.com/bfgroup/Lyra/archive/1.1.tar.gz - "1.2.0": - sha256: 3134fb6d170ba78d139068232b12ca9948082fafc54a3373193c8b8d6e760cd9 - url: https://github.com/bfgroup/Lyra/archive/1.2.tar.gz - "1.3.0": - sha256: 1e9757b850d1afc14413ceb9eb47af5693f6f03a0f1231617fac39df8534db2b - url: https://github.com/bfgroup/Lyra/archive/1.3.tar.gz - "1.4.0": - sha256: 86cc0c4978312582393e196d534011a1f186db9e3e09ba34fd250c2a59ebf814 - url: https://github.com/bfgroup/Lyra/archive/1.4.tar.gz - "1.5.0": - sha256: 5a251ba8c1082875a6655cdcd11c3a7771cd9c40011f1b0e5ac8636054f27dfd - url: https://github.com/bfgroup/Lyra/archive/1.5.tar.gz - "1.5.1": - sha256: 11ccdfc6f776b9a2ebe987d9b4e492981f88f3642546fd1c2e1115741863cae0 - url: https://github.com/bfgroup/Lyra/archive/1.5.1.tar.gz - "1.6.0": - sha256: 919e92a9c02fea3f365a3a7bdccd8b306311a28a7f2044dac8e7651106d7b644 - url: https://github.com/bfgroup/Lyra/archive/1.6.tar.gz "1.6.1": sha256: a93f247ed89eba11ca36eb24c4f8ba7be636bf24e74aaaa8e1066e0954bec7e3 url: https://github.com/bfgroup/Lyra/archive/1.6.1.tar.gz + "1.6.0": + sha256: 919e92a9c02fea3f365a3a7bdccd8b306311a28a7f2044dac8e7651106d7b644 + url: https://github.com/bfgroup/Lyra/archive/1.6.tar.gz + "1.5.1": + sha256: 11ccdfc6f776b9a2ebe987d9b4e492981f88f3642546fd1c2e1115741863cae0 + url: https://github.com/bfgroup/Lyra/archive/1.5.1.tar.gz + "1.4.0": + sha256: 86cc0c4978312582393e196d534011a1f186db9e3e09ba34fd250c2a59ebf814 + url: https://github.com/bfgroup/Lyra/archive/1.4.tar.gz + "1.3.0": + sha256: 1e9757b850d1afc14413ceb9eb47af5693f6f03a0f1231617fac39df8534db2b + url: https://github.com/bfgroup/Lyra/archive/1.3.tar.gz diff --git a/recipes/lyra/all/conanfile.py b/recipes/lyra/all/conanfile.py index 184573a6e3fe94..c094e45b8f49cd 100644 --- a/recipes/lyra/all/conanfile.py +++ b/recipes/lyra/all/conanfile.py @@ -1,8 +1,9 @@ import os + from conan import ConanFile -import conan.tools.files -import conan.tools.layout -import conan.tools.build +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout required_conan_version = ">=1.50.0" @@ -13,33 +14,28 @@ class LyraConan(ConanFile): description = "A simple to use, composing, header only, command line arguments parser for C++ 11 and beyond." topics = ("cli", "cli-parser", "argparse", "commandline", "flags", "header-only", "no-dependencies", "c++11") - no_copy_source = True - settings = "compiler" url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - conan.tools.build.check_min_cppstd(self, 11) + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() - def layout(self): - conan.tools.layout.basic_layout(self, src_folder="root") + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - conan.tools.files.get( - self, - **self.conan_data["sources"][self.version], - strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - conan.tools.files.copy( - self, "LICENSE.txt", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder) - conan.tools.files.copy( + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy( self, "*.h*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) @@ -47,6 +43,8 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "lyra") self.cpp_info.set_property("cmake_target_name", "bfg::lyra") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.components["_lyra"].set_property( @@ -57,3 +55,5 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "bfg" self.cpp_info.components["_lyra"].names["cmake_find_package"] = "lyra" self.cpp_info.components["_lyra"].names["cmake_find_package_multi"] = "lyra" + self.cpp_info.components["_lyra"].bindirs = [] + self.cpp_info.components["_lyra"].libdirs = [] diff --git a/recipes/lyra/all/test_package/CMakeLists.txt b/recipes/lyra/all/test_package/CMakeLists.txt index 294a9afb37677f..8b31e74af3444c 100644 --- a/recipes/lyra/all/test_package/CMakeLists.txt +++ b/recipes/lyra/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(lyra REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} bfg::lyra) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE bfg::lyra) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/lyra/all/test_package/conanfile.py b/recipes/lyra/all/test_package/conanfile.py index 0b275b10a2f3ce..98ab55852ad565 100644 --- a/recipes/lyra/all/test_package/conanfile.py +++ b/recipes/lyra/all/test_package/conanfile.py @@ -1,26 +1,26 @@ from conan import ConanFile -import conan.tools.build -import conan.tools.cmake +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" def layout(self): - conan.tools.cmake.cmake_layout(self) + cmake_layout(self) def requirements(self): self.requires(self.tested_reference_str) def build(self): - cmake = conan.tools.cmake.CMake(self) + cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if conan.tools.build.can_run(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/lyra/all/test_v1_package/CMakeLists.txt b/recipes/lyra/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b200e21129c408..00000000000000 --- a/recipes/lyra/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(lyra REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} bfg::lyra) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/lyra/all/test_v1_package/test_package.cpp b/recipes/lyra/all/test_v1_package/test_package.cpp deleted file mode 100644 index 5298875e31c6a1..00000000000000 --- a/recipes/lyra/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, const char** argv) -{ - auto cli = lyra::cli_parser(); -} diff --git a/recipes/lyra/config.yml b/recipes/lyra/config.yml index 425271e9a388e1..839c2a460a6e7d 100644 --- a/recipes/lyra/config.yml +++ b/recipes/lyra/config.yml @@ -1,19 +1,11 @@ versions: - "1.0.0": - folder: all - "1.1.0": - folder: all - "1.2.0": - folder: all - "1.3.0": - folder: all - "1.4.0": + "1.6.1": folder: all - "1.5.0": + "1.6.0": folder: all "1.5.1": folder: all - "1.6.0": + "1.4.0": folder: all - "1.6.1": + "1.3.0": folder: all diff --git a/recipes/lz4/all/conandata.yml b/recipes/lz4/all/conandata.yml index 577763acfe7a6a..fc3f8472653fd5 100644 --- a/recipes/lz4/all/conandata.yml +++ b/recipes/lz4/all/conandata.yml @@ -9,6 +9,11 @@ sources: sha256: 658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc url: https://github.com/lz4/lz4/archive/v1.9.2.tar.gz patches: + "1.9.4": + - patch_file: "patches/0004-Added-namespace-declaration-for-xxhash-in-CMake.patch" + patch_description: "Added namespace/prefix for xxHash functions by altering CMakeLists.txt" + patch_type: official + patch_source: "https://github.com/lz4/lz4/pull/1258" "1.9.3": - patch_file: "patches/0003-cmake-minimum-required-first-1.9.3.patch" patch_description: "Move cmake_minimum_required to the top of CMakeFile.txt" diff --git a/recipes/lz4/all/patches/0004-Added-namespace-declaration-for-xxhash-in-CMake.patch b/recipes/lz4/all/patches/0004-Added-namespace-declaration-for-xxhash-in-CMake.patch new file mode 100644 index 00000000000000..04a888ec1c4442 --- /dev/null +++ b/recipes/lz4/all/patches/0004-Added-namespace-declaration-for-xxhash-in-CMake.patch @@ -0,0 +1,19 @@ +--- a/build/cmake/CMakeLists.txt ++++ b/build/cmake/CMakeLists.txt +@@ -131,6 +131,16 @@ if(BUILD_STATIC_LIBS) + list(APPEND LZ4_LIBRARIES_BUILT lz4_static) + endif() + ++# xxhash namesapce ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(lz4_shared PRIVATE ++ XXH_NAMESPACE=LZ4_) ++endif() ++if(BUILD_STATIC_LIBS) ++ target_compile_definitions(lz4_static PRIVATE ++ XXH_NAMESPACE=LZ4_) ++endif() ++ + if(BUILD_STATIC_LIBS) + set(LZ4_LINK_LIBRARY lz4_static) + else() diff --git a/recipes/lzip/all/conandata.yml b/recipes/lzip/all/conandata.yml index 2b81d53f9b8e13..f3b143bd6541bd 100644 --- a/recipes/lzip/all/conandata.yml +++ b/recipes/lzip/all/conandata.yml @@ -1,20 +1,23 @@ sources: + "1.23": + url: + - "http://download.savannah.gnu.org/releases/lzip/lzip-1.23.tar.gz" + - "https://download-mirror.savannah.gnu.org/releases/lzip/lzip-1.23.tar.gz" + sha256: "4792c047ddf15ef29d55ba8e68a1a21e0cb7692d87ecdf7204419864582f280d" "1.22": - url: [ - "http://download.savannah.gnu.org/releases/lzip/lzip-1.22.tar.gz", - "https://download-mirror.savannah.gnu.org/releases/lzip/lzip-1.22.tar.gz", - ] + url: + - "http://download.savannah.gnu.org/releases/lzip/lzip-1.22.tar.gz" + - "https://download-mirror.savannah.gnu.org/releases/lzip/lzip-1.22.tar.gz" sha256: "c3342d42e67139c165b8b128d033b5c96893a13ac5f25933190315214e87a948" "1.21": - url: [ - "http://download.savannah.gnu.org/releases/lzip/lzip-1.21.tar.gz", - "https://download-mirror.savannah.gnu.org/releases/lzip/lzip-1.21.tar.gz", - ] + url: + - "http://download.savannah.gnu.org/releases/lzip/lzip-1.21.tar.gz" + - "https://download-mirror.savannah.gnu.org/releases/lzip/lzip-1.21.tar.gz" sha256: "e48b5039d3164d670791f9c5dbaa832bf2df080cb1fbb4f33aa7b3300b670d8b" patches: + "1.23": + - patch_file: "patches/1.23-0001-any-compiler.patch" "1.22": - - base_path: "source_subfolder" - patch_file: "patches/1.22-0001-any-compiler.patch" + - patch_file: "patches/1.22-0001-any-compiler.patch" "1.21": - - base_path: "source_subfolder" - patch_file: "patches/1.21-0001-any-compiler.patch" + - patch_file: "patches/1.21-0001-any-compiler.patch" diff --git a/recipes/lzip/all/conanfile.py b/recipes/lzip/all/conanfile.py index 96c8fbac3cb58f..3a29086521b1e0 100644 --- a/recipes/lzip/all/conanfile.py +++ b/recipes/lzip/all/conanfile.py @@ -1,102 +1,59 @@ -from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import contextlib +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.files import copy, get, replace_in_file, rmdir, patch, apply_conandata_patches, export_conandata_patches +from conan.tools.layout import basic_layout import os -import textwrap -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class LzipConan(ConanFile): name = "lzip" description = "Lzip is a lossless data compressor with a user interface similar to the one of gzip or bzip2" - topics = ("lzip", "compressor", "lzma") license = "GPL-v2-or-later" - homepage = "https://www.nongnu.org/lzip/" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.nongnu.org/lzip/" + topics = ("compressor", "lzma") + package_type = "application" settings = "os", "arch", "compiler", "build_type" - exports_sources = "patches/**" - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + def export_sources(self): + export_conandata_patches(self) - def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("Visual Studio is not supported") + if self.settings.os == "Windows" and self.settings.compiler != "gcc": + raise ConanInvalidConfiguration("Only gcc supported for windows builds") def package_id(self): del self.info.settings.compiler - - def _detect_compilers(self): - tools.rmdir("detectdir") - tools.mkdir("detectdir") - with tools.chdir("detectdir"): - tools.save("CMakeLists.txt", textwrap.dedent("""\ - cmake_minimum_required(VERSION 2.8) - project(test C CXX) - message(STATUS "CC=${CMAKE_C_COMPILER}") - message(STATUS "CXX=${CMAKE_CXX_COMPILER}") - file(WRITE cc.txt "${CMAKE_C_COMPILER}") - file(WRITE cxx.txt "${CMAKE_CXX_COMPILER}") - """)) - CMake(self).configure(source_folder="detectdir", build_folder="detectdir") - cc = tools.load("cc.txt").strip() - cxx = tools.load("cxx.txt").strip() - return cc, cxx + del self.info.settings.build_type def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @contextlib.contextmanager - def _build_context(self): - env = {} - cc, cxx = self._detect_compilers() - if not tools.get_env("CC"): - env["CC"] = cc - if not tools.get_env("CXX"): - env["CXX"] = cxx - with tools.environment_append(env): - yield + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - conf_args = [ - ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() 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() - autotools.make() + apply_conandata_patches(self) - def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - with tools.environment_append({"CONAN_CPU_COUNT": "1"}): - autotools.install() + autotools = Autotools(self) + autotools.configure() + autotools.make() - tools.rmdir(os.path.join(self.package_folder, "share")) + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install(target="install-bin") def package_info(self): - 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) + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + bindir = os.path.join(self.package_folder, "bin") + self.runenv_info.prepend_path("PATH", bindir) diff --git a/recipes/lzip/all/patches/1.21-0001-any-compiler.patch b/recipes/lzip/all/patches/1.21-0001-any-compiler.patch index 68dcb6f524644e..594395a65c8c36 100644 --- a/recipes/lzip/all/patches/1.21-0001-any-compiler.patch +++ b/recipes/lzip/all/patches/1.21-0001-any-compiler.patch @@ -1,25 +1,66 @@ ---- configure -+++ configure -@@ -21,7 +21,7 @@ +--- configure 2018-12-31 23:47:09.000000000 +0100 ++++ configure 2023-08-20 17:40:14.170994800 +0200 +@@ -9,6 +9,7 @@ + pkgversion=1.21 + progname=lzip + srctrigger=doc/${pkgname}.texi ++extension= + + # clear some things potentially inherited from environment. + LC_ALL=C +@@ -20,7 +21,7 @@ + datarootdir='$(prefix)/share' infodir='$(datarootdir)/info' mandir='$(datarootdir)/man' -CXX=g++ --CPPFLAGS= --CXXFLAGS='-Wall -W -O2' --LDFLAGS= -+#CXX=g++ -+#CPPFLAGS= -+#CXXFLAGS='-Wall -W -O2' -+#LDFLAGS= ++CXX="${CXX:-g++}" + CPPFLAGS= + CXXFLAGS='-Wall -W -O2' + LDFLAGS= +@@ -118,6 +119,19 @@ + fi + done + ++rm -f dummy* ++cat << EOT > dummy.c ++int main(int argc, char ** argv) { ++ return 0; ++} ++EOT ++ ++${CXX} -o dummy dummy.c ++ ++if [ -f dummy.exe ] ; then ++ extension=".exe" ++fi ++ + # Find the source files, if location was not specified. + srcdirtext= + if [ -z "${srcdir}" ] ; then +@@ -158,6 +172,7 @@ + echo "creating Makefile" + echo "VPATH = ${srcdir}" + echo "prefix = ${prefix}" ++echo "executable extension = ${extension}" + echo "exec_prefix = ${exec_prefix}" + echo "bindir = ${bindir}" + echo "datarootdir = ${datarootdir}" +@@ -179,6 +194,7 @@ + pkgname = ${pkgname} + pkgversion = ${pkgversion} + progname = ${progname} ++extension = ${extension} + VPATH = ${srcdir} + prefix = ${prefix} + exec_prefix = ${exec_prefix} +--- Makefile.in 2018-03-21 13:21:16.000000000 +0100 ++++ Makefile.in 2023-08-20 17:32:44.011055100 +0200 +@@ -64,7 +64,7 @@ -@@ -28,8 +28,8 @@ - # checking whether we are using GNU C++. - /bin/sh -c "${CXX} --version" > /dev/null 2>&1 || - { -- CXX=c++ -- CXXFLAGS=-O2 -+ echo "hello" # CXX=c++ -+ echo "hello" # CXXFLAGS=-O2 - } + install-bin : all + if [ ! -d "$(DESTDIR)$(bindir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(bindir)" ; fi +- $(INSTALL_PROGRAM) ./$(progname) "$(DESTDIR)$(bindir)/$(progname)" ++ $(INSTALL_PROGRAM) ./$(progname)$(extension) "$(DESTDIR)$(bindir)/$(progname)$(extension)" - # Loop over all args + install-bin-strip : all + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install-bin diff --git a/recipes/lzip/all/patches/1.22-0001-any-compiler.patch b/recipes/lzip/all/patches/1.22-0001-any-compiler.patch index 50311f5627b8cb..9388ec1d5dc3da 100644 --- a/recipes/lzip/all/patches/1.22-0001-any-compiler.patch +++ b/recipes/lzip/all/patches/1.22-0001-any-compiler.patch @@ -1,18 +1,78 @@ ---- configure -+++ configure -@@ -24,7 +24,7 @@ +--- configure 2021-01-01 14:06:33.000000000 +0100 ++++ configure 2023-08-20 17:48:10.569541300 +0200 +@@ -9,6 +9,7 @@ + pkgversion=1.22 + progname=lzip + srctrigger=doc/${pkgname}.texi ++extension= + + # clear some things potentially inherited from environment. + LC_ALL=C +@@ -23,7 +24,7 @@ + build=no check=no installdir= -CXX=g++ --CPPFLAGS= --CXXFLAGS='-Wall -W -O2' --LDFLAGS= -+#CXX=g++ -+#CPPFLAGS= -+#CXXFLAGS='-Wall -W -O2' -+#LDFLAGS= ++CXX="${CXX:-g++}" + CPPFLAGS= + CXXFLAGS='-Wall -W -O2' + LDFLAGS= +@@ -125,6 +126,19 @@ + fi + done + ++rm -f dummy* ++cat << EOT > dummy.c ++int main(int argc, char ** argv) { ++ return 0; ++} ++EOT ++ ++${CXX} -o dummy dummy.c ++ ++if [ -f dummy.exe ] ; then ++ extension=".exe" ++fi ++ + # Find the source files, if location was not specified. + srcdirtext= + if [ -z "${srcdir}" ] ; then +@@ -161,9 +175,9 @@ + "${srcdir}/testsuite/check.sh" "${srcdir}/testsuite" ${pkgversion} || exit 1 + fi + if [ -n "${installdir}" ] ; then +- echo "installing ${progname} in ${installdir}" ++ echo "installing ${progname}${extension} in ${installdir}" + [ -d "${installdir}" ] || mkdir -p "${installdir}" || exit 1 +- cp -fp ${progname} "${installdir}/${progname}" || exit 1 ++ cp -fp "${progname}${extension}" "${installdir}/${progname}${extension}" || exit 1 + fi + exit 0 + fi +@@ -188,6 +202,7 @@ + echo "creating Makefile" + echo "VPATH = ${srcdir}" + echo "prefix = ${prefix}" ++echo "executable extension = ${extension}" + echo "exec_prefix = ${exec_prefix}" + echo "bindir = ${bindir}" + echo "datarootdir = ${datarootdir}" +@@ -209,6 +224,7 @@ + pkgname = ${pkgname} + pkgversion = ${pkgversion} + progname = ${progname} ++extension = ${extension} + VPATH = ${srcdir} + prefix = ${prefix} + exec_prefix = ${exec_prefix} +--- Makefile.in 2020-05-02 00:06:48.000000000 +0200 ++++ Makefile.in 2023-08-20 17:46:52.265608300 +0200 +@@ -64,7 +64,7 @@ + + install-bin : all + if [ ! -d "$(DESTDIR)$(bindir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(bindir)" ; fi +- $(INSTALL_PROGRAM) ./$(progname) "$(DESTDIR)$(bindir)/$(progname)" ++ $(INSTALL_PROGRAM) ./$(progname)$(extension) "$(DESTDIR)$(bindir)/$(progname)$(extension)" -@@ -31,2 +31,2 @@ - # checking whether we are using GNU C++. --/bin/sh -c "${CXX} --version" > /dev/null 2>&1 || { CXX=c++ ; CXXFLAGS=-O2 ; } -+# /bin/sh -c "${CXX} --version" > /dev/null 2>&1 || { CXX=c++ ; CXXFLAGS=-O2 ; } + install-bin-strip : all + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install-bin diff --git a/recipes/lzip/all/patches/1.23-0001-any-compiler.patch b/recipes/lzip/all/patches/1.23-0001-any-compiler.patch new file mode 100644 index 00000000000000..ad4c3f5cc843d1 --- /dev/null +++ b/recipes/lzip/all/patches/1.23-0001-any-compiler.patch @@ -0,0 +1,78 @@ +--- configure 2022-01-22 01:11:01.000000000 +0100 ++++ configure 2023-08-20 17:51:18.537172800 +0200 +@@ -9,6 +9,7 @@ + pkgversion=1.23 + progname=lzip + srctrigger=doc/${pkgname}.texi ++extension= + + # clear some things potentially inherited from environment. + LC_ALL=C +@@ -23,7 +24,7 @@ + build=no + check=no + installdir= +-CXX=g++ ++CXX="${CXX:-g++}" + CPPFLAGS= + CXXFLAGS='-Wall -W -O2' + LDFLAGS= +@@ -125,6 +126,19 @@ + fi + done + ++rm -f dummy* ++cat << EOT > dummy.c ++int main(int argc, char ** argv) { ++ return 0; ++} ++EOT ++ ++${CXX} -o dummy dummy.c ++ ++if [ -f dummy.exe ] ; then ++ extension=".exe" ++fi ++ + # Find the source files, if location was not specified. + srcdirtext= + if [ -z "${srcdir}" ] ; then +@@ -161,9 +175,9 @@ + "${srcdir}/testsuite/check.sh" "${srcdir}/testsuite" ${pkgversion} || exit 1 + fi + if [ -n "${installdir}" ] ; then +- echo "installing ${progname} in ${installdir}" ++ echo "installing ${progname}${extension} in ${installdir}" + [ -d "${installdir}" ] || mkdir -p "${installdir}" || exit 1 +- cp -fp ${progname} "${installdir}/${progname}" || exit 1 ++ cp -fp "${progname}${extension}" "${installdir}/${progname}${extension}" || exit 1 + fi + exit 0 + fi +@@ -188,6 +202,7 @@ + echo "creating Makefile" + echo "VPATH = ${srcdir}" + echo "prefix = ${prefix}" ++echo "executable extension = ${extension}" + echo "exec_prefix = ${exec_prefix}" + echo "bindir = ${bindir}" + echo "datarootdir = ${datarootdir}" +@@ -209,6 +224,7 @@ + pkgname = ${pkgname} + pkgversion = ${pkgversion} + progname = ${progname} ++extension = ${extension} + VPATH = ${srcdir} + prefix = ${prefix} + exec_prefix = ${exec_prefix} +--- Makefile.in 2021-10-07 01:01:07.000000000 +0200 ++++ Makefile.in 2023-08-20 17:18:35.382705100 +0200 +@@ -64,7 +64,7 @@ + + install-bin : all + if [ ! -d "$(DESTDIR)$(bindir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(bindir)" ; fi +- $(INSTALL_PROGRAM) ./$(progname) "$(DESTDIR)$(bindir)/$(progname)" ++ $(INSTALL_PROGRAM) ./$(progname)$(extension) "$(DESTDIR)$(bindir)/$(progname)$(extension)" + + install-bin-strip : all + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install-bin diff --git a/recipes/lzip/all/test_package/conanfile.py b/recipes/lzip/all/test_package/conanfile.py index 84ae9d8826de5c..16e19ad7002bc9 100644 --- a/recipes/lzip/all/test_package/conanfile.py +++ b/recipes/lzip/all/test_package/conanfile.py @@ -1,27 +1,53 @@ -from conans import ConanFile, tools -from conans.errors import ConanException +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.build import can_run +from conan.tools.files import rm, save, check_sha256 import os -import shutil - +from io import StringIO class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - lzip = os.path.join(self.deps_cpp_info["lzip"].bin_paths[0], "lzip") - self.run("{} --version".format(lzip)) - - shutil.copy(os.path.join(self.source_folder, "conanfile.py"), - "conanfile.py") - - sha256_original = tools.sha256sum("conanfile.py") - self.run("{} conanfile.py".format(lzip), run_environment=True) - if not os.path.exists("conanfile.py.lz"): - raise ConanException("conanfile.py.lz does not exist") - if os.path.exists("conanfile.py"): - raise ConanException("copied conanfile.py should not exist anymore") - - self.run("{} -d conanfile.py.lz".format(lzip), run_environment=True) - if tools.sha256sum("conanfile.py") != sha256_original: - raise ConanException("sha256 from extracted conanfile.py does not match original") + if not can_run(self): + return + + cmd_output = StringIO() + self.run(f"lzip --version", cmd_output, env="conanrun") + + #Create input test file + input_file_sha256 = "6a7ef9d581b577bbe8415d69ccc2549287eb99b5d856a213df742f8b89986a6a" + input_file = "input.txt" + if os.path.exists(input_file): + rm(self, input_file, ".") + + save(self, input_file, "Klaus is king!") + + #Ensure output test file does not exist + output_file = input_file + ".lz" + if os.path.exists(output_file): + rm(self, output_file, ".") + + #Zip the input file + self.run(f"lzip {input_file}", env="conanrun") + if not os.path.exists(f"{output_file}"): + raise ConanException(f"{output_file} does not exist") + + if os.path.exists(f"{input_file}"): + raise ConanException(f"{input_file} does exist") + + #Unzip the input file + self.run(f"lzip -d {output_file}", env="conanrun") + if os.path.exists(f"{output_file}"): + raise ConanException(f"{output_file} does not exist") + + if not os.path.exists(f"{input_file}"): + raise ConanException(f"{input_file} does exist") + + #Compare checksum of unzipped file with expected value + check_sha256(self, input_file, input_file_sha256) diff --git a/recipes/lzip/config.yml b/recipes/lzip/config.yml index e027a6bc18156f..fe52638d1ec863 100644 --- a/recipes/lzip/config.yml +++ b/recipes/lzip/config.yml @@ -1,4 +1,6 @@ versions: + "1.23": + folder: "all" "1.22": folder: "all" "1.21": diff --git a/recipes/m4/all/conandata.yml b/recipes/m4/all/conandata.yml index 3b25f4d23294d8..6dc3bb1b5c347a 100644 --- a/recipes/m4/all/conandata.yml +++ b/recipes/m4/all/conandata.yml @@ -1,14 +1,14 @@ sources: "1.4.19": url: - - "https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.gz" - - "https://ftpmirror.gnu.org/gnu/m4/m4-1.4.19.tar.gz" - sha256: "3be4a26d825ffdfda52a56fc43246456989a3630093cced3fbddf4771ee58a70" + - "https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.xz" + - "https://ftpmirror.gnu.org/gnu/m4/m4-1.4.19.tar.xz" + sha256: "63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96" "1.4.18": url: - - "https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz" - - "https://ftpmirror.gnu.org/gnu/m4/m4-1.4.18.tar.gz" - sha256: "ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab" + - "https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz" + - "https://ftpmirror.gnu.org/gnu/m4/m4-1.4.18.tar.xz" + sha256: "f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07" patches: "1.4.19": - patch_file: "patches/1.4.19-0001-open-files-in-binary-mode.patch" diff --git a/recipes/m4/all/conanfile.py b/recipes/m4/all/conanfile.py index 881f4c539d77d5..dadcf2b1794c25 100644 --- a/recipes/m4/all/conanfile.py +++ b/recipes/m4/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.build import cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save from conan.tools.gnu import Autotools, AutotoolsToolchain @@ -67,6 +68,19 @@ def generate(self): "-rtlib=compiler-rt", "-Wno-unused-command-line-argument", ]) + if cross_building(self) and is_msvc(self): + triplet_arch_windows = {"x86_64": "x86_64", "x86": "i686", "armv8": "aarch64"} + + host_arch = triplet_arch_windows.get(str(self.settings.arch)) + build_arch = triplet_arch_windows.get(str(self._settings_build.arch)) + + if host_arch and build_arch: + host = f"{host_arch}-w64-mingw32" + build = f"{build_arch}-w64-mingw32" + tc.configure_args.extend([ + f"--host={host}", + f"--build={build}", + ]) if self.settings.os == "Windows": tc.configure_args.append("ac_cv_func__set_invalid_parameter_handler=yes") env = tc.environment() @@ -117,7 +131,5 @@ def package_info(self): self.buildenv_info.define_path("M4", m4_bin) # 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) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) self.env_info.M4 = m4_bin diff --git a/recipes/m4/all/patches/1.4.18-0003-secure_snprintf.patch b/recipes/m4/all/patches/1.4.18-0003-secure_snprintf.patch deleted file mode 100644 index 0afa4da0a47d0e..00000000000000 --- a/recipes/m4/all/patches/1.4.18-0003-secure_snprintf.patch +++ /dev/null @@ -1,16 +0,0 @@ -patch taken from https://github.com/macports/macports-ports/blob/master/devel/m4/files/secure_snprintf.patch -to fix invalid instruction error on OSX when running m4 - -diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c -index 246831f..ae47ebf 100644 ---- a/lib/vasnprintf.c -+++ b/lib/vasnprintf.c -@@ -4858,7 +4858,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, - #endif - *fbp = dp->conversion; - #if USE_SNPRINTF --# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) -+#if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) - fbp[1] = '%'; - fbp[2] = 'n'; - fbp[3] = '\0'; diff --git a/recipes/m4/all/test_package/conanfile.py b/recipes/m4/all/test_package/conanfile.py index b665b86aad8f3a..4a294edf870e77 100644 --- a/recipes/m4/all/test_package/conanfile.py +++ b/recipes/m4/all/test_package/conanfile.py @@ -26,11 +26,12 @@ def build(self): """)) def test(self): - self.run("m4 --version") - self.run(f"m4 -P {self._m4_input_path}") + extension = ".exe" if self.settings.os == "Windows" else "" + self.run(f"m4{extension} --version") + self.run(f"m4{extension} -P {self._m4_input_path}") - self.run(f"m4 -R {self.source_folder}/frozen.m4f {self.source_folder}/test.m4") + self.run(f"m4{extension} -R {self.source_folder}/frozen.m4f {self.source_folder}/test.m4") output = StringIO() - self.run(f"m4 -P {self._m4_input_path}", output) + self.run(f"m4{extension} -P {self._m4_input_path}", output) assert "Harry, Jr. met Sally" in output.getvalue() diff --git a/recipes/m4/all/test_v1_package/conanfile.py b/recipes/m4/all/test_v1_package/conanfile.py index 23409570c2d3dd..fdefc9766275fb 100644 --- a/recipes/m4/all/test_v1_package/conanfile.py +++ b/recipes/m4/all/test_v1_package/conanfile.py @@ -30,12 +30,13 @@ def test(self): raise ConanException("M4 environment variable not set") if not tools.cross_building(self, skip_x64_x86=True): - self.run("{} --version".format(m4_bin), run_environment=True) - self.run("{} -P {}".format(m4_bin, self._m4_input_path)) + self.run(f"{m4_bin} --version", run_environment=True) + self.run(f"{m4_bin} -P {self._m4_input_path}") - self.run("m4 -R {0}/frozen.m4f {0}/test.m4".format(os.path.join(self.source_folder, os.pardir, "test_package"), run_environment=True)) + test_package_dir = os.path.join(self.source_folder, os.pardir, "test_package") + self.run(f"{m4_bin} -R {test_package_dir}/frozen.m4f {test_package_dir}/test.m4", run_environment=True) output = StringIO() - self.run("{} -P {}".format(m4_bin, self._m4_input_path), output=output) + self.run(f"{m4_bin} -P {self._m4_input_path}", output=output) assert "Harry, Jr. met Sally" in output.getvalue() diff --git a/recipes/maddy/all/conandata.yml b/recipes/maddy/all/conandata.yml index 91359378f20723..b4bf9474c36c13 100644 --- a/recipes/maddy/all/conandata.yml +++ b/recipes/maddy/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.3.0": + url: "https://github.com/progsource/maddy/archive/refs/tags/1.3.0.tar.gz" + sha256: "561681f8c8d2b998c153cda734107a0bc1dea4bb0df69fd813922da63fa9f3e7" + "1.2.1": + url: "https://github.com/progsource/maddy/archive/refs/tags/1.2.1.tar.gz" + sha256: "b6058bce7ca32506969633ee7a4042e75b07464489f1c44be00913543cd687ef" "1.1.2": - sha256: ce66e1ee63bda3a6ab9c814edc0ed818abecca1c2218307ff87fb9ec1fc970fc - url: https://github.com/progsource/maddy/archive/refs/tags/1.1.2.tar.gz + url: "https://github.com/progsource/maddy/archive/refs/tags/1.1.2.tar.gz" + sha256: "ce66e1ee63bda3a6ab9c814edc0ed818abecca1c2218307ff87fb9ec1fc970fc" diff --git a/recipes/maddy/all/conanfile.py b/recipes/maddy/all/conanfile.py index 7bcdd1cec24d52..b023f2456bef00 100644 --- a/recipes/maddy/all/conanfile.py +++ b/recipes/maddy/all/conanfile.py @@ -1,47 +1,63 @@ -from conans import ConanFile, tools 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 MaddyConan(ConanFile): name = "maddy" + description = "open-source, maddy is a C++ Markdown to HTML header-only parser library." + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/progsource/maddy" - description = ( - "open-source, maddy is a C++ Markdown to HTML header-only parser library." - ) - topics = ("maddy", "markdown", "header-only") - license = "MIT" + topics = ("markdown", "header-only") + + 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 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) + 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], - destination=self._source_subfolder, - strip_root=True - ) - - def package_id(self): - self.info.header_only() + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy( - "LICENSE", - src=os.path.join(self.source_folder, self._source_subfolder), - dst="licenses", - ) - self.copy( - pattern="maddy/*.h", - src=os.path.join(self.source_folder, self._source_subfolder, "include"), - dst="include", - ) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="maddy/*.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/maddy/all/test_package/CMakeLists.txt b/recipes/maddy/all/test_package/CMakeLists.txt index b85bbd55815731..9b4b9a74cb47a8 100755 --- a/recipes/maddy/all/test_package/CMakeLists.txt +++ b/recipes/maddy/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.5) -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(maddy REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE maddy::maddy) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED - ON) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/maddy/all/test_package/conanfile.py b/recipes/maddy/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100755 --- a/recipes/maddy/all/test_package/conanfile.py +++ b/recipes/maddy/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/maddy/all/test_package/example.cpp b/recipes/maddy/all/test_package/example.cpp old mode 100755 new mode 100644 diff --git a/recipes/maddy/all/test_v1_package/CMakeLists.txt b/recipes/maddy/all/test_v1_package/CMakeLists.txt new file mode 100755 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/maddy/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/maddy/all/test_v1_package/conanfile.py b/recipes/maddy/all/test_v1_package/conanfile.py new file mode 100755 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/maddy/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/maddy/config.yml b/recipes/maddy/config.yml index 8d13aefb6b4fbd..90c91d00495ebf 100644 --- a/recipes/maddy/config.yml +++ b/recipes/maddy/config.yml @@ -1,3 +1,7 @@ versions: + "1.3.0": + folder: all + "1.2.1": + folder: all "1.1.2": folder: all 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/make/all/conandata.yml b/recipes/make/all/conandata.yml index fb6e6264363e76..d11432dff72945 100644 --- a/recipes/make/all/conandata.yml +++ b/recipes/make/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.4": + url: "http://ftpmirror.gnu.org/gnu/make/make-4.4.tar.gz" + sha256: "581f4d4e872da74b3941c874215898a7d35802f03732bdccee1d4a7979105d18" "4.3": url: "http://ftpmirror.gnu.org/gnu/make/make-4.3.tar.gz" sha256: "e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19" @@ -6,6 +9,8 @@ sources: url: "http://ftpmirror.gnu.org/gnu/make/make-4.2.1.tar.bz2" sha256: "d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589" patches: + "4.4": + - patch_file: "patches/4.3-0001-clang.patch" "4.3": - patch_file: "patches/4.3-0001-clang.patch" "4.2.1": diff --git a/recipes/make/config.yml b/recipes/make/config.yml index 0260fd9e5313f6..34673d1418b178 100644 --- a/recipes/make/config.yml +++ b/recipes/make/config.yml @@ -1,4 +1,6 @@ versions: + "4.4": + folder: all "4.3": folder: all "4.2.1": diff --git a/recipes/mapbox-geometry/all/conanfile.py b/recipes/mapbox-geometry/all/conanfile.py index 9edf42d2b8db16..38350b712a5145 100644 --- a/recipes/mapbox-geometry/all/conanfile.py +++ b/recipes/mapbox-geometry/all/conanfile.py @@ -13,10 +13,11 @@ class MapboxGeometryConan(ConanFile): "Provides header-only, generic C++ interfaces for geometry types, " "geometry collections, and features." ) - topics = ("geometry") + topics = ("geometry",) license = "ISC" homepage = "https://github.com/mapbox/geometry.hpp" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -24,7 +25,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("mapbox-variant/1.2.0", transitive_headers=True) + self.requires("mapbox-variant/1.2.0") def package_id(self): self.info.clear() @@ -34,8 +35,7 @@ def validate(self): check_min_cppstd(self, 14) 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 diff --git a/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt b/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt index e4046b86f92324..b21cc49efde95c 100644 --- a/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt +++ b/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(mapbox-geometry REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE mapbox-geometry::mapbox-geometry) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mapbox-variant/all/conanfile.py b/recipes/mapbox-variant/all/conanfile.py index dd51a969a8f23f..e84afc03290426 100644 --- a/recipes/mapbox-variant/all/conanfile.py +++ b/recipes/mapbox-variant/all/conanfile.py @@ -10,13 +10,17 @@ class MapboxVariantConan(ConanFile): name = "mapbox-variant" description = "An header-only alternative to boost::variant for C++11 and C++14" - topics = ("variant") + topics = ("variant",) license = "BSD-3-Clause" homepage = "https://github.com/mapbox/variant" url = "https://github.com/conan-io/conan-center-index" + 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() @@ -24,12 +28,8 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -40,6 +40,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/mapbox-variant/all/test_package/conanfile.py b/recipes/mapbox-variant/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/mapbox-variant/all/test_package/conanfile.py +++ b/recipes/mapbox-variant/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt b/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt index 5f12dfeb0954a3..b21cc49efde95c 100644 --- a/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt +++ b/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(mapbox-variant REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE mapbox-variant::mapbox-variant) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) 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 13b1525cfce346..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" @@ -54,13 +55,16 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.get_safe("with_iconv"): self.requires("libiconv/1.17") if self.options.with_curl: - self.requires("libcurl/8.0.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/marisa/all/CMakeLists.txt b/recipes/marisa/all/CMakeLists.txt deleted file mode 100644 index 84887fbda2ddf1..00000000000000 --- a/recipes/marisa/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/marisa/all/conandata.yml b/recipes/marisa/all/conandata.yml index 087e45138b4998..6f5b0ae3b7c45c 100644 --- a/recipes/marisa/all/conandata.yml +++ b/recipes/marisa/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "0.2.6": - patch_file: "patches/0001-add-cmake.patch" - base_path: "source_subfolder" diff --git a/recipes/marisa/all/conanfile.py b/recipes/marisa/all/conanfile.py index 13b534d613bd93..05b8f1775310a9 100644 --- a/recipes/marisa/all/conanfile.py +++ b/recipes/marisa/all/conanfile.py @@ -1,20 +1,22 @@ import os -from conan import ConanFile, tools -from conan.tools.files import apply_conandata_patches -from conans import CMake -required_conan_version = ">=1.45.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 + +required_conan_version = ">=1.53.0" class MarisaConan(ConanFile): name = "marisa" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/s-yata/marisa-trie" description = "Matching Algorithm with Recursively Implemented StorAge " license = ("BSD-2-Clause", "LGPL-2.1") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/s-yata/marisa-trie" topics = ("algorithm", "dictionary", "marisa") - exports_sources = "patches/**", "CMakeLists.txt" - settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -26,16 +28,8 @@ class MarisaConan(ConanFile): "tools": 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): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -43,45 +37,42 @@ 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 source(self): - tools.files.get(**self.conan_data["sources"][self.version], - conanfile=self, destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def layout(self): + cmake_layout(self, src_folder="src") - self._cmake.definitions["BUILD_TOOLS"] = self.options.tools + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TOOLS"] = self.options.tools + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): apply_conandata_patches(self) - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="COPYING.md", dst="licenses", - src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="COPYING.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.files.rmdir(self, os.path.join( - self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "marisa" - self.cpp_info.names["cmake_find_package_multi"] = "marisa" - self.cpp_info.names["pkgconfig"] = "marisa" + self.cpp_info.set_property("pkg_config_name", "marisa") self.cpp_info.libs = ["marisa"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] + # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") self.output.info(f"Appending PATH env var with : '{bin_path}'") self.env_info.PATH.append(bin_path) diff --git a/recipes/marisa/all/test_package/CMakeLists.txt b/recipes/marisa/all/test_package/CMakeLists.txt index 9bae1c0958b767..8f42c91d450eeb 100644 --- a/recipes/marisa/all/test_package/CMakeLists.txt +++ b/recipes/marisa/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(marisa REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/marisa/all/test_package/conanfile.py b/recipes/marisa/all/test_package/conanfile.py index 251bf8ae3e3ddc..fae501d0afb9e4 100644 --- a/recipes/marisa/all/test_package/conanfile.py +++ b/recipes/marisa/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 CMake, ConanFile, tools -from conan.tools.build import cross_building class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + 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/marisa/all/test_package/test_package.cpp b/recipes/marisa/all/test_package/test_package.cpp index ba90951dd5e1b0..5180045c1a180a 100644 --- a/recipes/marisa/all/test_package/test_package.cpp +++ b/recipes/marisa/all/test_package/test_package.cpp @@ -1,6 +1,6 @@ -#include #include "marisa.h" +#include int main() { int x = 100; diff --git a/recipes/marisa/all/test_v1_package/CMakeLists.txt b/recipes/marisa/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/marisa/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/marisa/all/test_v1_package/conanfile.py b/recipes/marisa/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..251bf8ae3e3ddc --- /dev/null +++ b/recipes/marisa/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os +from conans import CMake, ConanFile, 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/mathfu/all/conanfile.py b/recipes/mathfu/all/conanfile.py index 1b35d3c154c774..ec12916dc298be 100644 --- a/recipes/mathfu/all/conanfile.py +++ b/recipes/mathfu/all/conanfile.py @@ -13,6 +13,7 @@ class MathfuConan(ConanFile): license = "Apache-2.0" homepage = "https://github.com/google/mathfu" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -20,14 +21,13 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("vectorial/cci.20190628", transitive_headers=True, transitive_libs=True) + self.requires("vectorial/cci.20190628") 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 diff --git a/recipes/matio/all/CMakeLists.txt b/recipes/matio/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb93..00000000000000 --- a/recipes/matio/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/matio/all/conandata.yml b/recipes/matio/all/conandata.yml index 8a659653f91f9b..0850bf3d72ee4b 100644 --- a/recipes/matio/all/conandata.yml +++ b/recipes/matio/all/conandata.yml @@ -11,32 +11,26 @@ sources: "1.5.23": url: "https://downloads.sourceforge.net/project/matio/matio/1.5.23/matio-1.5.23.tar.gz" sha256: "9f91eae661df46ea53c311a1b2dcff72051095b023c612d7cbfc09406c9f4d6e" + "1.5.24": + url: "https://downloads.sourceforge.net/project/matio/matio/1.5.24/matio-1.5.24.tar.gz" + sha256: "5106ebed5b40d02a2bb968b57bef8876701c566e039e6ebe134bab779c436f7c" patches: "1.5.18": - patch_file: "patches/require-cmake-3.10.patch" - base_path: "source_subfolder" - patch_file: "patches/disable-hdf5-target.patch" - base_path: "source_subfolder" - patch_file: "patches/patch-apple-no-undefined.patch" - base_path: "source_subfolder" - patch_file: "patches/cmake-install-bundle.patch" - base_path: "source_subfolder" "1.5.19": - patch_file: "patches/require-cmake-3.10.patch" - base_path: "source_subfolder" - patch_file: "patches/patch-apple-no-undefined.patch" - base_path: "source_subfolder" - patch_file: "patches/cmake-install-bundle.patch" - base_path: "source_subfolder" "1.5.21": - patch_file: "patches/require-cmake-3.10.patch" - base_path: "source_subfolder" - patch_file: "patches/patch-apple-no-undefined.patch" - base_path: "source_subfolder" - patch_file: "patches/cmake-install-bundle.patch" - base_path: "source_subfolder" "1.5.23": - patch_file: "patches/require-cmake-3.10.patch" - base_path: "source_subfolder" - patch_file: "patches/cmake-install-bundle.patch" - base_path: "source_subfolder" + "1.5.24": + - patch_file: "patches/require-cmake-3.10.patch" + - patch_file: "patches/cmake-install-bundle.patch" diff --git a/recipes/matio/all/conanfile.py b/recipes/matio/all/conanfile.py index 213dcdf0eba5bd..199bb98823415b 100644 --- a/recipes/matio/all/conanfile.py +++ b/recipes/matio/all/conanfile.py @@ -1,42 +1,43 @@ -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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class MatioConan(ConanFile): name = "matio" + description = "Matio is a C library for reading and writing binary MATLAB MAT files." license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://sourceforge.net/projects/matio/" - description = "Matio is a C library for reading and writing binary MATLAB MAT files." - topics = ("conan", "matlab", "mat-file", "file-format", "hdf5") - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - exports_sources = "CMakeLists.txt", "patches/*" + topics = ("matlab", "mat-file", "file-format", "hdf5") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], - "extended_sparse": [True, False], "fPIC": [True, False], + "extended_sparse": [True, False], "mat73": [True, False], "with_hdf5": [True, False], "with_zlib": [True, False], } default_options = { "shared": False, - "extended_sparse": True, "fPIC": True, + "extended_sparse": True, "mat73": True, "with_hdf5": True, "with_zlib": True, } - _cmake = None - - @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": @@ -44,61 +45,64 @@ 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_hdf5: - self.requires("hdf5/1.12.1") + self.requires("hdf5/1.14.1") if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if not self.options.with_hdf5 and self.options.mat73: raise ConanInvalidConfiguration("Support of version 7.3 MAT files requires HDF5") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["MATIO_EXTENDED_SPARSE"] = self.options.extended_sparse - self._cmake.definitions["MATIO_PIC"] = self.options.get_safe("fPIC", True) - self._cmake.definitions["MATIO_SHARED"] = self.options.shared - self._cmake.definitions["MATIO_MAT73"] = self.options.mat73 - self._cmake.definitions["MATIO_WITH_HDF5"] = self.options.with_hdf5 - self._cmake.definitions["MATIO_WITH_ZLIB"] = self.options.with_zlib - self._cmake.definitions["HDF5_USE_STATIC_LIBRARIES"] = self.options.with_hdf5 and not self.options["hdf5"].shared - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MATIO_EXTENDED_SPARSE"] = self.options.extended_sparse + tc.variables["MATIO_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["MATIO_SHARED"] = self.options.shared + tc.variables["MATIO_MAT73"] = self.options.mat73 + tc.variables["MATIO_WITH_HDF5"] = self.options.with_hdf5 + tc.variables["MATIO_WITH_ZLIB"] = self.options.with_zlib + tc.variables["HDF5_USE_STATIC_LIBRARIES"] = ( + self.options.with_hdf5 and not self.dependencies["hdf5"].options.shared + ) + tc.generate() + + tc = CMakeDeps(self) + tc.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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() def package_info(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self.cpp_info.libs = ["libmatio"] else: self.cpp_info.libs = ["matio"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] + # TODO: remove in conan v2 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/matio/all/test_package/CMakeLists.txt b/recipes/matio/all/test_package/CMakeLists.txt index f8b971e2db3772..e5b668ec221781 100644 --- a/recipes/matio/all/test_package/CMakeLists.txt +++ b/recipes/matio/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(matio REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE matio::matio) diff --git a/recipes/matio/all/test_package/conanfile.py b/recipes/matio/all/test_package/conanfile.py index f96969845ae240..fae501d0afb9e4 100644 --- a/recipes/matio/all/test_package/conanfile.py +++ b/recipes/matio/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools -import os.path +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os -class MatioTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + 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/matio/all/test_v1_package/CMakeLists.txt b/recipes/matio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/matio/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/matio/all/test_v1_package/conanfile.py b/recipes/matio/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..3053c8502b32d6 --- /dev/null +++ b/recipes/matio/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os.path + + +class MatioTestConan(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/matio/config.yml b/recipes/matio/config.yml index 5ec8ba010e8ecf..32213bb4d952d6 100644 --- a/recipes/matio/config.yml +++ b/recipes/matio/config.yml @@ -7,3 +7,5 @@ versions: folder: all "1.5.23": folder: all + "1.5.24": + folder: all diff --git a/recipes/maven/all/conandata.yml b/recipes/maven/all/conandata.yml index 7cdcaeb46d6b1b..a0978eddc0d68f 100644 --- a/recipes/maven/all/conandata.yml +++ b/recipes/maven/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "3.9.4": + url: + - "https://dlcdn.apache.org/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.tar.gz" + - "https://archive.apache.org/dist/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.tar.gz" + sha256: "ff66b70c830a38d331d44f6c25a37b582471def9a161c93902bac7bea3098319" "3.9.2": - url: "https://dlcdn.apache.org/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.tar.gz" + url: "https://archive.apache.org/dist/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.tar.gz" sha256: "809ef3220c6d179195c06c324cb9a6d34d8ecba566c5cfd8eb83167bc034117d" diff --git a/recipes/maven/all/conanfile.py b/recipes/maven/all/conanfile.py index f1f95efee4fb1c..31d963f2df4c14 100644 --- a/recipes/maven/all/conanfile.py +++ b/recipes/maven/all/conanfile.py @@ -18,7 +18,7 @@ def layout(self): pass def requirements(self): - self.requires("zulu-openjdk/11.0.15") + self.requires("zulu-openjdk/11.0.19") def package_id(self): del self.info.settings.arch diff --git a/recipes/maven/config.yml b/recipes/maven/config.yml index 2f82b90ebcf020..95a41cd441c27b 100644 --- a/recipes/maven/config.yml +++ b/recipes/maven/config.yml @@ -1,3 +1,5 @@ versions: + "3.9.4": + folder: all "3.9.2": folder: all diff --git a/recipes/mbedtls/all/CMakeLists.txt b/recipes/mbedtls/all/CMakeLists.txt deleted file mode 100644 index 3d32ee21cb1d7a..00000000000000 --- a/recipes/mbedtls/all/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -if(MSVC) - if(MSVC_VERSION LESS 1900) - add_definitions(-DMBEDTLS_PLATFORM_SNPRINTF_MACRO=MBEDTLS_PLATFORM_STD_SNPRINTF) - else() - add_definitions(-DMBEDTLS_PLATFORM_SNPRINTF_MACRO=snprintf) - endif() - if(BUILD_SHARED_LIBS) - add_definitions(-DX509_BUILD_SHARED) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - endif() -endif() - -add_subdirectory(src) diff --git a/recipes/mbedtls/all/conandata.yml b/recipes/mbedtls/all/conandata.yml index 2e2a89aefe3118..ea482e12f5ff12 100644 --- a/recipes/mbedtls/all/conandata.yml +++ b/recipes/mbedtls/all/conandata.yml @@ -1,19 +1,31 @@ sources: + "3.5.0": + url: "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.5.0.tar.gz" + sha256: "bdee0e3e45bbf360541306cac0cc27e00402c7a46b9bdf2d24787d5107f008f2" + "3.4.1": + url: "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.4.1.tar.gz" + sha256: "a420fcf7103e54e775c383e3751729b8fb2dcd087f6165befd13f28315f754f5" "3.2.1": - url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-3.2.1.tar.gz" + url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.2.1.tar.gz" sha256: "5850089672560eeaca03dc36678ee8573bb48ef6e38c94f5ce349af60c16da33" "3.1.0": - url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-3.1.0.tar.gz" + url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.1.0.tar.gz" sha256: "64d01a3b22b91cf3a25630257f268f11bc7bfa37981ae6d397802dd4ccec4690" "3.0.0": - url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-3.0.0.tar.gz" + url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.0.0.tar.gz" sha256: "377d376919be19f07c7e7adeeded088a525be40353f6d938a78e4f986bce2ae0" + "2.28.4": + url: "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v2.28.4.tar.gz" + sha256: "578c4dcd15bbff3f5cd56aa07cd4f850fc733634e3d5947be4f7157d5bfd81ac" "2.25.0": url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.25.0.tar.gz" sha256: "ea2049c2dd4868693998d5a9780e198194be5aea1706ff4a9d4f882f18c0a101" "2.24.0": - url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.24.0.tar.gz" + url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-2.24.0.tar.gz" sha256: "b5a779b5f36d5fc4cba55faa410685f89128702423ad07b36c5665441a06a5f3" "2.23.0": - url: "https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.23.0.tar.gz" + url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-2.23.0.tar.gz" sha256: "5c8998217402aa1fc734f4afaeac38fad2421470fac4b3abc112bd46391054fe" + "2.16.12": + url: "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/mbedtls-2.16.12.tar.gz" + sha256: "0afb4a4ce5b771f2fb86daee786362fbe48285f05b73cd205f46a224ec031783" diff --git a/recipes/mbedtls/all/conanfile.py b/recipes/mbedtls/all/conanfile.py index 84a6a1f32ace2d..b5af5483b03f42 100644 --- a/recipes/mbedtls/all/conanfile.py +++ b/recipes/mbedtls/all/conanfile.py @@ -1,7 +1,8 @@ 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, CMakeDeps, cmake_layout from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc, check_min_vs from conan.tools.scm import Version import os @@ -32,8 +33,6 @@ class MBedTLSConan(ConanFile): "with_zlib": True, } - exports_sources = "CMakeLists.txt" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -52,7 +51,7 @@ def layout(self): def requirements(self): if self.options.get_safe("with_zlib"): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.settings.os == "Windows" and self.options.shared: @@ -65,10 +64,13 @@ def validate(self): ) def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root = True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) + if self.options.shared: + tc.preprocessor_definitions["X509_BUILD_SHARED"] = "1" + tc.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.variables["USE_SHARED_MBEDTLS_LIBRARY"] = self.options.shared tc.variables["USE_STATIC_MBEDTLS_LIBRARY"] = not self.options.shared if Version(self.version) < "3.0.0": @@ -79,6 +81,13 @@ def generate(self): if Version(self.version) < "3.0.0": # relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if is_msvc(self): + if check_min_vs(self, 190, raise_invalid=False): + tc.preprocessor_definitions["MBEDTLS_PLATFORM_SNPRINTF_MACRO"] = "snprintf" + else: + tc.preprocessor_definitions["MBEDTLS_PLATFORM_SNPRINTF_MACRO"] = "MBEDTLS_PLATFORM_STD_SNPRINTF" + tc.generate() + tc = CMakeDeps(self) tc.generate() def build(self): @@ -90,6 +99,7 @@ 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")) rmdir(self, os.path.join(self.package_folder, "cmake")) def package_info(self): diff --git a/recipes/mbedtls/all/test_package/CMakeLists.txt b/recipes/mbedtls/all/test_package/CMakeLists.txt index 708448e53f1705..5fa9b94ca1217c 100644 --- a/recipes/mbedtls/all/test_package/CMakeLists.txt +++ b/recipes/mbedtls/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(MbedTLS REQUIRED CONFIG) diff --git a/recipes/mbedtls/all/test_v1_package/CMakeLists.txt b/recipes/mbedtls/all/test_v1_package/CMakeLists.txt index 0d20897301b68b..b21cc49efde95c 100644 --- a/recipes/mbedtls/all/test_v1_package/CMakeLists.txt +++ b/recipes/mbedtls/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) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/mbedtls/config.yml b/recipes/mbedtls/config.yml index 114a3e62d619dc..004f51becf1f56 100644 --- a/recipes/mbedtls/config.yml +++ b/recipes/mbedtls/config.yml @@ -1,13 +1,21 @@ versions: + "3.5.0": + folder: all + "3.4.1": + folder: all "3.2.1": folder: all "3.1.0": folder: all "3.0.0": folder: all + "2.28.4": + folder: all "2.25.0": folder: all "2.24.0": folder: all "2.23.0": folder: all + "2.16.12": + folder: all diff --git a/recipes/mbits-diags/all/conanfile.py b/recipes/mbits-diags/all/conanfile.py index f6c4c3381f0e0e..204bf4ed9c3fae 100644 --- a/recipes/mbits-diags/all/conanfile.py +++ b/recipes/mbits-diags/all/conanfile.py @@ -51,7 +51,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/9.1.0") + self.requires("fmt/10.1.0") self.requires("mbits-semver/0.1.1") def validate(self): diff --git a/recipes/mbits-lngs/all/conandata.yml b/recipes/mbits-lngs/all/conandata.yml new file mode 100644 index 00000000000000..a85ddd2561b528 --- /dev/null +++ b/recipes/mbits-lngs/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.6": + url: "https://github.com/mbits-os/lngs/archive/v0.7.6.tar.gz" + sha256: "85c9fd3afd5b6d5446a294f4de11221ae7fa160a62d1115a7ea0c1af17633a0b" diff --git a/recipes/mbits-lngs/all/conanfile.py b/recipes/mbits-lngs/all/conanfile.py new file mode 100644 index 00000000000000..49f97626d1e47d --- /dev/null +++ b/recipes/mbits-lngs/all/conanfile.py @@ -0,0 +1,142 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import get, copy, save, rmdir +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os +import textwrap + + +required_conan_version = ">=1.53.0" + + +class MBitsLngsConan(ConanFile): + name = "mbits-lngs" + description = "Language strings support" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mbits-os/lngs" + topics = ("gettext", "locale",) + settings = "os", "arch", "compiler", "build_type" + package_type = "static-library" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "11.0.3", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("fmt/10.1.0") + self.requires("mbits-utfconv/1.0.3") + self.requires("mbits-diags/0.9.6") + self.requires("mbits-mstch/1.0.4") + self.requires("mbits-args/0.12.3") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + 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) + + @property + def _settings_build(self): + return self.settings_build if hasattr(self, "settings_build") else self.settings + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LNGS_TESTING"] = False + tc.variables["LNGS_LITE"] = False + tc.variables["LNGS_LINKED_RESOURCES"] = True + tc.variables["LNGS_NO_PKG_CONFIG"] = True + if cross_building(self) and hasattr(self, "settings_build"): + tc.variables["LNGS_REBUILD_RESOURCES"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _cmake_install_base_path(self): + return os.path.join("lib", "cmake") + + @property + def _cmake_targets_module_file(self): + return os.path.join(self._cmake_install_base_path, "mbits-lngs-targets.cmake") + + def package(self): + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, self._cmake_install_base_path)) + + + # Provide relocatable mbits::lngs target and Mbitslngs_LNGS_EXECUTABLE cache variable + # TODO: some of the following logic might be disabled when conan will + # allow to create executable imported targets in package_info() + module_folder_depth = len(os.path.normpath(self._cmake_install_base_path).split(os.path.sep)) + lngs_rel_path = "{}bin/{}".format("".join(["../"] * module_folder_depth), "lngs") + save(self, os.path.join(self.package_folder, self._cmake_targets_module_file), + textwrap.dedent( + f"""\ + if(NOT TARGET mbits::lngs) + if(CMAKE_CROSSCOMPILING) + find_program(LNGS_PROGRAM lngs PATHS ENV PATH NO_DEFAULT_PATH) + endif() + if(NOT LNGS_PROGRAM) + set(LNGS_PROGRAM "${{CMAKE_CURRENT_LIST_DIR}}/{lngs_rel_path}") + endif() + get_filename_component(LNGS_PROGRAM "${{LNGS_PROGRAM}}" ABSOLUTE) + set(Mbitslngs_LNGS_EXECUTABLE ${{LNGS_PROGRAM}} CACHE FILEPATH "The lngs tool") + add_executable(mbits::lngs IMPORTED) + set_property(TARGET mbits::lngs PROPERTY IMPORTED_LOCATION ${{Mbitslngs_LNGS_EXECUTABLE}}) + endif() + """) + ) + + def package_info(self): + self.cpp_info.builddirs = [self._cmake_install_base_path ] + self.cpp_info.set_property("cmake_build_modules", [self._cmake_targets_module_file]) + self.cpp_info.set_property("cmake_file_name", "mbits-lngs") + + comp = self.cpp_info.components["liblngs"] + comp.set_property("cmake_target_name", "mbits::liblngs") + comp.libs = ["lngs"] diff --git a/recipes/mbits-lngs/all/test_package/CMakeLists.txt b/recipes/mbits-lngs/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..de4330a77c2a63 --- /dev/null +++ b/recipes/mbits-lngs/all/test_package/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(mbits-lngs REQUIRED CONFIG) + +set(IDL ${CMAKE_CURRENT_SOURCE_DIR}/translations.idl) +set(CPP ${CMAKE_CURRENT_BINARY_DIR}/translations.cpp) +set(HPP ${CMAKE_CURRENT_BINARY_DIR}/translations.hpp) + +add_custom_target( + make_lngs + COMMAND mbits::lngs res ${IDL} -o ${CPP} --include "translations.hpp" + COMMAND mbits::lngs enums -r ${IDL} -o ${HPP} + BYPRODUCTS ${CPP} ${HPP} + DEPENDS ${IDL} +) + +add_executable(${PROJECT_NAME} test_package.cpp ${CPP} ${HPP}) +target_link_libraries(${PROJECT_NAME} PRIVATE mbits::liblngs) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +add_dependencies(${PROJECT_NAME} make_lngs) diff --git a/recipes/mbits-lngs/all/test_package/conanfile.py b/recipes/mbits-lngs/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e3b64136d43e7b --- /dev/null +++ b/recipes/mbits-lngs/all/test_package/conanfile.py @@ -0,0 +1,43 @@ +from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualRunEnv, VirtualBuildEnv +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + if cross_building(self) and hasattr(self, "settings_build"): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = VirtualRunEnv(self) + tc.generate() + tc = VirtualBuildEnv(self) + if cross_building(self) and hasattr(self, "settings_build"): + tc.generate() + else: + tc.generate(scope="build") + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + 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/mbits-lngs/all/test_package/test_package.cpp b/recipes/mbits-lngs/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..54cfa70731d8d9 --- /dev/null +++ b/recipes/mbits-lngs/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include "translations.hpp" +#include + +int main() { + lngs::test::Strings tr{}; + tr.init_builtin(); + tr.path_manager(".", "example"); + + std::cout << tr(lngs::test::lng::MESSAGE) << '\n'; +} diff --git a/recipes/mbits-lngs/all/test_package/translations.idl b/recipes/mbits-lngs/all/test_package/translations.idl new file mode 100644 index 00000000000000..52b142116a7003 --- /dev/null +++ b/recipes/mbits-lngs/all/test_package/translations.idl @@ -0,0 +1,9 @@ +[ + project("lngs-test"), + namespace("lngs::test"), + version("0.1"), + serial(1) +] strings { + [help("Hello world string"), id(1001)] + MESSAGE = "Hello, world!"; +} diff --git a/recipes/mbits-lngs/config.yml b/recipes/mbits-lngs/config.yml new file mode 100644 index 00000000000000..1d3599e3efc2ee --- /dev/null +++ b/recipes/mbits-lngs/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7.6": + folder: all diff --git a/recipes/mbits-mstch/all/conanfile.py b/recipes/mbits-mstch/all/conanfile.py index a06f83e964b39b..a8cfe1d7dd5a71 100644 --- a/recipes/mbits-mstch/all/conanfile.py +++ b/recipes/mbits-mstch/all/conanfile.py @@ -33,7 +33,7 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "gcc": "11", + "gcc": "10", "clang": "12", "msvc": "192", "apple-clang": "11.0.3", diff --git a/recipes/mcap/all/conandata.yml b/recipes/mcap/all/conandata.yml index 4d475c04d971cc..4ede1237bc36ce 100644 --- a/recipes/mcap/all/conandata.yml +++ b/recipes/mcap/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.3.0": + url: "https://github.com/foxglove/mcap/archive/releases/cpp/v1.3.0.tar.gz" + sha256: "41acf6e85d75556c64407f077e05492d31db1f099e07242ef04364bb2939acf1" + "1.2.1": + url: "https://github.com/foxglove/mcap/archive/releases/cpp/v1.2.1.tar.gz" + sha256: "fdc0c351bbcf8883fec0047ff84fed74da88446859083beb6624a584e2cde669" + 1.2.0: + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.2.0/main.tar.gz" + sha256: "11a6badecac2b10e9687e912648a6e9679ef8731e4ab9570346ae9845ae64a65" + 1.1.0: + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.1.0/main.tar.gz" + sha256: "1cb2ae9f2e910eeb2e93b3ab722744d1805b9da45764e4fd88703b669413350d" 1.0.0: url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.0.0/main.tar.gz" sha256: "e36169e46a67a9431f73df335f67488461817bc423f9af63ac0af7f29e0bd696" diff --git a/recipes/mcap/all/conanfile.py b/recipes/mcap/all/conanfile.py index 0ea0db2622ab8f..1089c7a6c48f9b 100644 --- a/recipes/mcap/all/conanfile.py +++ b/recipes/mcap/all/conanfile.py @@ -19,6 +19,7 @@ class McapConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/foxglove/mcap" topics = ("serialization", "deserialization", "recording", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @property @@ -48,7 +49,7 @@ def layout(self): def requirements(self): self.requires("lz4/1.9.4") - self.requires("zstd/1.5.4") + self.requires("zstd/1.5.5") if Version(self.version) < "0.1.1": self.requires("fmt/9.1.0") diff --git a/recipes/mcap/all/test_package/conanfile.py b/recipes/mcap/all/test_package/conanfile.py index 14c16cdc02a92e..8749556609d862 100644 --- a/recipes/mcap/all/test_package/conanfile.py +++ b/recipes/mcap/all/test_package/conanfile.py @@ -7,10 +7,14 @@ 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() diff --git a/recipes/mcap/config.yml b/recipes/mcap/config.yml index 8d906d6516e977..fb6aa455469ead 100644 --- a/recipes/mcap/config.yml +++ b/recipes/mcap/config.yml @@ -1,4 +1,12 @@ versions: + "1.3.0": + folder: all + "1.2.1": + folder: all + 1.2.0: + folder: all + 1.1.0: + folder: all 1.0.0: folder: all 0.9.0: diff --git a/recipes/md4qt/all/conandata.yml b/recipes/md4qt/all/conandata.yml index 876c188b63e354..8c1a73b11f3c44 100644 --- a/recipes/md4qt/all/conandata.yml +++ b/recipes/md4qt/all/conandata.yml @@ -1,4 +1,64 @@ sources: + "2.3.4": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.4.tar.gz" + sha256: "7f356658316da4f4eaf7bde43dd43027a602c49640d297357b12e22a1a842a68" + "2.3.3": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.3.tar.gz" + sha256: "89584d77d7e338d858e2198b20cd091cc713aef74880ef1fccc6c1e9d8b74acd" + "2.3.2": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.2.tar.gz" + sha256: "0a89854d639a3710ab89611333fd1a1047cd5edc87ba767fbefdc37e701ae671" + "2.3.1": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.1.tar.gz" + sha256: "7126ecc34f9808943b76b05106ebd42ef01b7b812416efc2382de68a13804d01" + "2.3.0": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.0.tar.gz" + sha256: "e8a37c80f1823bbac9cbfd6bbd662ee14e8ff0ac9e97966aa34cb2d0eed18e72" + "2.2.3": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.2.3.tar.gz" + sha256: "31f6de553700b25e4ed8517bcde24bd43b18c3fda1260f968aa5c393a7491783" + "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" + "2.1.0": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.1.0.tar.gz" + sha256: "cfbf515adecd798a3f1a4f2e007021b4b31742dd0b36805c273b3b8316fd820d" + "2.0.18": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.18.tar.gz" + sha256: "4fe70a63eb78cdf0355f6a6b292c40c8cc8ed4a62bcbec17afefa713b19c28b1" + "2.0.16": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.16.tar.gz" + sha256: "9da7cd02883c2f4d4a2371cda4c195ebc02f57bb673ef948b88a256f3db55724" + "2.0.15": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.15.tar.gz" + sha256: "53c4a65bb178afde91ae2360072f65a44ae7572a25912a3fe96aeaa6ac86ef27" + "2.0.14": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.14.tar.gz" + sha256: "b230f1a99a2a5f4f1f32748d52062276294b34d8254d4128193632e3a8ffaa4e" + "2.0.13": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.13.tar.gz" + sha256: "4e6cdcd54c5ce1e1ed9a97bd18ac5aeb7c15bb303193b4261058aef724fe9a41" + "2.0.12": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.12.tar.gz" + sha256: "07c89e37c624da036008acac88115b5aee6440f9e9f326139f256f34022f9a20" + "2.0.11": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.11.tar.gz" + sha256: "990979474bcbb924efb1c046581589e11889d502e5ad24b9779c131c4f3d9941" + "2.0.10": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.10.tar.gz" + sha256: "efcb7c97999ce2d78aba67041a61dda45feb54113e5b21851b0532fdcbc460a8" + "2.0.9": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.9.tar.gz" + sha256: "5b00c997eb33e877ca54468a101345e3a9986ce1b61b0919fa8632efabc51b6d" "2.0.8": url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.8.tar.gz" sha256: "50a47d407acf1ca6a5b96af0386da74f7cfb66322ec7453cbb543f4f66251683" diff --git a/recipes/md4qt/all/conanfile.py b/recipes/md4qt/all/conanfile.py index ce75e30212e5ee..90fcedd907a99c 100644 --- a/recipes/md4qt/all/conanfile.py +++ b/recipes/md4qt/all/conanfile.py @@ -16,6 +16,7 @@ class Md4QtConan(ConanFile): license = "MIT" description = "Header-only C++ library for parsing Markdown." topics = ("markdown", "gfm", "parser", "icu", "ast", "commonmark", "md", "qt6", "stl", "cpp17") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -33,13 +34,16 @@ def _compilers_minimum_version(self): "apple-clang": "14", } - def package_id(self): - self.info.clear() + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("icu/72.1") + self.requires("icu/74.1") self.requires("uriparser/0.9.7") + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) @@ -49,12 +53,8 @@ def validate(self): f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", ) - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -67,6 +67,4 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "md4qt") self.cpp_info.set_property("cmake_target_name", "md4qt::md4qt") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/md4qt/all/test_package/conanfile.py b/recipes/md4qt/all/test_package/conanfile.py index c78095722f7aa3..b5553413c7eed7 100644 --- a/recipes/md4qt/all/test_package/conanfile.py +++ b/recipes/md4qt/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() @@ -23,4 +24,4 @@ def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") md_path = os.path.join(self.source_folder, "test.md") - self.run("{} \"{}\"".format(bin_path, md_path), env="conanrun") + self.run(f"{bin_path} \"{md_path}\"", env="conanrun") diff --git a/recipes/md4qt/all/test_v1_package/CMakeLists.txt b/recipes/md4qt/all/test_v1_package/CMakeLists.txt index b24e1b03fbf834..b21cc49efde95c 100644 --- a/recipes/md4qt/all/test_v1_package/CMakeLists.txt +++ b/recipes/md4qt/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(md4qt REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE md4qt::md4qt) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/md4qt/all/test_v1_package/conanfile.py b/recipes/md4qt/all/test_v1_package/conanfile.py index df702b6f48d7c4..e62a3cb2d74400 100644 --- a/recipes/md4qt/all/test_v1_package/conanfile.py +++ b/recipes/md4qt/all/test_v1_package/conanfile.py @@ -15,4 +15,4 @@ def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") md_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.md") - self.run("{} \"{}\"".format(bin_path, md_path), run_environment=True) + self.run(f"{bin_path} \"{md_path}\"", run_environment=True) diff --git a/recipes/md4qt/config.yml b/recipes/md4qt/config.yml index 9e06767160daf1..396ecace7699b0 100644 --- a/recipes/md4qt/config.yml +++ b/recipes/md4qt/config.yml @@ -1,4 +1,44 @@ versions: + "2.3.4": + folder: all + "2.3.3": + folder: all + "2.3.2": + folder: all + "2.3.1": + folder: all + "2.3.0": + folder: all + "2.2.3": + folder: all + "2.2.2": + folder: all + "2.2.1": + folder: all + "2.2.0": + folder: all + "2.1.1": + folder: all + "2.1.0": + folder: all + "2.0.18": + folder: all + "2.0.16": + folder: all + "2.0.15": + folder: all + "2.0.14": + folder: all + "2.0.13": + folder: all + "2.0.12": + folder: all + "2.0.11": + folder: all + "2.0.10": + folder: all + "2.0.9": + folder: all "2.0.8": folder: all "2.0.7": diff --git a/recipes/mdns/all/conandata.yml b/recipes/mdns/all/conandata.yml index ef0896308dfb2b..67326bafe7dd96 100644 --- a/recipes/mdns/all/conandata.yml +++ b/recipes/mdns/all/conandata.yml @@ -1,22 +1,13 @@ sources: - "1.0": - sha256: e06ed954b4705f0e48f3e6bd44b75c115ee03f745c62394ee615f466e44e9373 - url: https://github.com/mjansson/mdns/archive/1.0.tar.gz - "1.1": - sha256: a0d170bc88151235b9f2dea10a9ffd1d538e4ce3b098426893fd45890efcbffb - url: https://github.com/mjansson/mdns/archive/1.1.tar.gz - "1.2": - sha256: 1919f8fd01b2b7e1128e51d51e4bd9e48fd4f2ef4ade88c152970a35d2084bae - url: https://github.com/mjansson/mdns/archive/1.2.tar.gz - "1.3": - url: "https://github.com/mjansson/mdns/archive/1.3.tar.gz" - sha256: "d3bfd684ef07beadca71c426586be88a10a92026fe6fe5355609d9e805ff5f85" - "1.4": - url: "https://github.com/mjansson/mdns/archive/1.4.tar.gz" - sha256: "413af72a6ce655dc96d35584dd0134f4ba87534ff78471b5b578e175b9f58dd5" - "1.4.1": - url: "https://github.com/mjansson/mdns/archive/1.4.1.tar.gz" - sha256: "decaf007376c62389712dda67c0eaa8ffb682e7be32ece816b1646119f061be3" + "1.4.3": + url: "https://github.com/mjansson/mdns/archive/1.4.3.tar.gz" + sha256: "be1fd8e35599cb7de179decbd0633c121d11a2dcb9cc193ff5c590bd0d480483" "1.4.2": url: "https://github.com/mjansson/mdns/archive/1.4.2.tar.gz" sha256: "c69cfdebe28a489c85f33744f7811c40572a9769a81cd57ecc09ef95802347f2" + "1.3": + url: "https://github.com/mjansson/mdns/archive/1.3.tar.gz" + sha256: "d3bfd684ef07beadca71c426586be88a10a92026fe6fe5355609d9e805ff5f85" + "1.2": + url: "https://github.com/mjansson/mdns/archive/1.2.tar.gz" + sha256: "1919f8fd01b2b7e1128e51d51e4bd9e48fd4f2ef4ade88c152970a35d2084bae" diff --git a/recipes/mdns/all/conanfile.py b/recipes/mdns/all/conanfile.py index aa012f43092fcf..6842da5a578476 100644 --- a/recipes/mdns/all/conanfile.py +++ b/recipes/mdns/all/conanfile.py @@ -1,38 +1,45 @@ import os -from conans import CMake, ConanFile, tools -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class MdnsConan(ConanFile): name = "mdns" + description = "Public domain mDNS/DNS-SD library in C" license = "Unlicense" - homepage = "https://github.com/mjansson/mdns" url = "https://github.com/conan-io/conan-center-index" - description = "Public domain mDNS/DNS-SD library in C" - topics = ("mdns", "dns", "dns-sd", "multicast discovery", "discovery") - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/mjansson/mdns" + topics = ("dns", "dns-sd", "multicast discovery", "discovery", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() 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", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.h", dst="include", src=self._source_subfolder) + 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=self.source_folder) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os == "Windows": self.cpp_info.system_libs = ["iphlpapi", "ws2_32"] - if str(self.settings.os) in ["Linux", "Android"]: - self.cpp_info.system_libs.append('pthread') + if str(self.settings.os) in ["Linux", "FreeBSD", "Android"]: + self.cpp_info.system_libs.append("pthread") self.cpp_info.set_property("cmake_file_name", "mdns") self.cpp_info.set_property("cmake_target_name", "mdns::mdns") diff --git a/recipes/mdns/all/test_package/CMakeLists.txt b/recipes/mdns/all/test_package/CMakeLists.txt index c7366be61abf1d..351413082436ff 100644 --- a/recipes/mdns/all/test_package/CMakeLists.txt +++ b/recipes/mdns/all/test_package/CMakeLists.txt @@ -1,9 +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() +find_package(mdns REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE mdns::mdns) set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 99) diff --git a/recipes/mdns/all/test_package/conanfile.py b/recipes/mdns/all/test_package/conanfile.py index 6c0a50e0f76789..ef5d7042163ecc 100644 --- a/recipes/mdns/all/test_package/conanfile.py +++ b/recipes/mdns/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 TestConan(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) @@ -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") - 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/mdns/all/test_package/test_package.c b/recipes/mdns/all/test_package/test_package.c index b27d9acd4f04bb..57ae843c7e0c01 100644 --- a/recipes/mdns/all/test_package/test_package.c +++ b/recipes/mdns/all/test_package/test_package.c @@ -15,8 +15,7 @@ # include #endif -int -main(int argc, const char* const* argv) { +int test() { #ifdef _WIN32 WORD versionWanted = MAKEWORD(1, 1); WSADATA wsaData; @@ -26,8 +25,7 @@ main(int argc, const char* const* argv) { } #endif - int port = 0; - int sock = mdns_socket_open_ipv4(port); + int sock = mdns_socket_open_ipv4(NULL); if (sock < 0) { printf("Failed to open socket: %s\n", strerror(errno)); return -1; @@ -35,9 +33,15 @@ main(int argc, const char* const* argv) { printf("socket cleanup\n"); mdns_socket_close(sock); + #ifdef _WIN32 WSACleanup(); #endif +} + +int main() { + // Do not run test() to not open a socket unnecessarily. + // Verifying that the function compiles is sufficient. return 0; } diff --git a/recipes/mdns/all/test_v1_package/CMakeLists.txt b/recipes/mdns/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/mdns/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/mdns/all/test_v1_package/conanfile.py b/recipes/mdns/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6dffe66394a26e --- /dev/null +++ b/recipes/mdns/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) + 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) diff --git a/recipes/mdns/config.yml b/recipes/mdns/config.yml index cdb4b7bded43e5..59538424539ead 100644 --- a/recipes/mdns/config.yml +++ b/recipes/mdns/config.yml @@ -1,15 +1,9 @@ versions: - "1.0": + "1.4.3": folder: "all" - "1.1": - folder: "all" - "1.2": + "1.4.2": folder: "all" "1.3": folder: "all" - "1.4": - folder: "all" - "1.4.1": - folder: "all" - "1.4.2": + "1.2": folder: "all" 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/meson/all/conandata.yml b/recipes/meson/all/conandata.yml index df69b3c1b2cb9e..581541e8b30e4d 100644 --- a/recipes/meson/all/conandata.yml +++ b/recipes/meson/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.3.0": + url: "https://github.com/mesonbuild/meson/releases/download/1.3.0/meson-1.3.0.tar.gz" + sha256: "4ba253ef60e454e23234696119cbafa082a0aead0bd3bbf6991295054795f5dc" + "1.2.3": + url: "https://github.com/mesonbuild/meson/releases/download/1.2.3/meson-1.2.3.tar.gz" + sha256: "4533a43c34548edd1f63a276a42690fce15bde9409bcf20c4b8fa3d7e4d7cac1" + "1.2.2": + url: "https://github.com/mesonbuild/meson/releases/download/1.2.2/meson-1.2.2.tar.gz" + sha256: "4a0f04de331fbc7af3b802a844fc8838f4ccd1ded1e792ba4f8f2faf8c5fe4d6" + "1.2.1": + url: "https://github.com/mesonbuild/meson/releases/download/1.2.1/meson-1.2.1.tar.gz" + sha256: "b1db3a153087549497ee52b1c938d2134e0338214fe14f7efd16fecd57b639f5" "1.2.0": url: "https://github.com/mesonbuild/meson/archive/1.2.0.tar.gz" sha256: "603489f0aaa6305f806c6cc4a4455a965f22290fc74f65871f589b002110c790" diff --git a/recipes/meson/config.yml b/recipes/meson/config.yml index b926152e71ae8f..04538c604ee463 100644 --- a/recipes/meson/config.yml +++ b/recipes/meson/config.yml @@ -1,4 +1,12 @@ versions: + "1.3.0": + folder: all + "1.2.3": + folder: all + "1.2.2": + folder: all + "1.2.1": + folder: all "1.2.0": folder: all "1.1.1": diff --git a/recipes/metall/all/conandata.yml b/recipes/metall/all/conandata.yml index 788ef5da15507e..023411b883cb5a 100644 --- a/recipes/metall/all/conandata.yml +++ b/recipes/metall/all/conandata.yml @@ -1,10 +1,22 @@ sources: + "0.27": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.27.tar.gz" + sha256: "6e6f17a760778f9162def939701f9381a75e5275fd1eb1b2af4b2e89e86e1c58" + "0.26": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.26.tar.gz" + sha256: "7453c87d99708be8542e354e582cbeefac1e5ba65e609cd85d7126c5b25a6d7b" + "0.25": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.25.tar.gz" + sha256: "223cb54543b62a62fdbbe6274b02ddcc14b29806e344ee7e2fd3f055c2374295" + "0.24": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.24.tar.gz" + sha256: "872de2a1b76d44e6876c0b672c0cc518c6f334959e4a229f2f18cc7e01edf477" + "0.23.1": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.23.1.tar.gz" + sha256: "25e8fbc424e66d09e0faf60029288e4612685675bfd947cc142bd9d6d0645ac4" "0.21": url: "https://github.com/LLNL/metall/archive/refs/tags/v0.21.tar.gz" sha256: "feaff7a935f98d3cc1e2b21f6eae40edc674a5bd0133306afd3851148aaed026" "0.20": url: "https://github.com/LLNL/metall/archive/refs/tags/v0.20.tar.gz" sha256: "cafe54c682004a66a059f54e2d7128ea7622e9941ea492297d04c260675e9af4" - "0.23.1": - url: "https://github.com/LLNL/metall/archive/refs/tags/v0.23.1.tar.gz" - sha256: "25e8fbc424e66d09e0faf60029288e4612685675bfd947cc142bd9d6d0645ac4" diff --git a/recipes/metall/all/conanfile.py b/recipes/metall/all/conanfile.py index 957ba5421027f1..b13166986c15d4 100644 --- a/recipes/metall/all/conanfile.py +++ b/recipes/metall/all/conanfile.py @@ -16,6 +16,7 @@ class MetallConan(ConanFile): description = "Meta allocator for persistent memory" license = "MIT", "Apache-2.0" topics = "cpp", "allocator", "memory-allocator", "persistent-memory", "ecp", "exascale-computing" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -26,8 +27,11 @@ def _compilers_minimum_version(self): "clang": "9", } + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): - self.requires("boost/1.79.0") + self.requires("boost/1.81.0") def package_id(self): self.info.clear() @@ -52,12 +56,8 @@ def lazy_lt_semver(v1, v2): raise ConanInvalidConfiguration( "{} {} requires C++17, which your compiler does not support.".format(self.name, self.version)) - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -75,9 +75,7 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "Metall" 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("pthread") diff --git a/recipes/metall/all/test_package/conanfile.py b/recipes/metall/all/test_package/conanfile.py index 3a8c6c5442b33b..0a6bc68712d901 100644 --- a/recipes/metall/all/test_package/conanfile.py +++ b/recipes/metall/all/test_package/conanfile.py @@ -1,5 +1,5 @@ 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 import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(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/metall/all/test_v1_package/CMakeLists.txt b/recipes/metall/all/test_v1_package/CMakeLists.txt index 90ab90a88d549b..b21cc49efde95c 100644 --- a/recipes/metall/all/test_v1_package/CMakeLists.txt +++ b/recipes/metall/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Metall REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE Metall::Metall) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/metall/config.yml b/recipes/metall/config.yml index e3fb6e5067c490..1d869b27d64817 100644 --- a/recipes/metall/config.yml +++ b/recipes/metall/config.yml @@ -1,7 +1,15 @@ versions: - "0.21": + "0.27": folder: all - "0.20": + "0.26": + folder: all + "0.25": + folder: all + "0.24": folder: all "0.23.1": folder: all + "0.21": + folder: all + "0.20": + folder: all diff --git a/recipes/mfast/all/conanfile.py b/recipes/mfast/all/conanfile.py index 41c45b6db58d81..dbdf62474df2da 100644 --- a/recipes/mfast/all/conanfile.py +++ b/recipes/mfast/all/conanfile.py @@ -15,16 +15,16 @@ class mFASTConan(ConanFile): name = "mfast" - license = "LGPL-3.0" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://objectcomputing.com/" description = ( "mFAST is a high performance C++ encoding/decoding library for FAST " "(FIX Adapted for STreaming) protocol" ) + license = "LGPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://objectcomputing.github.io/mFAST/" topics = ("fast", "fix", "fix-adapted-for-streaming", "financial-information-exchange", "libraries", "cpp") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,7 +36,6 @@ class mFASTConan(ConanFile): "fPIC": True, "with_sqlite3": False, } - short_paths = True @property @@ -71,10 +70,11 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.75.0") + # transitive_headers=True because mfast/mfast_export.h includes boost/config.hpp + self.requires("boost/1.75.0", transitive_headers=True) self.requires("tinyxml2/9.0.0") if self.options.with_sqlite3: - self.requires("sqlite3/3.40.1") + self.requires("sqlite3/3.43.1") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -169,18 +169,28 @@ def _prepend_exec_target_in_fasttypegentarget(self): fast_type_filename = "fast_type_gen" + extension module_folder_depth = len(os.path.normpath(self._new_mfast_config_dir).split(os.path.sep)) fast_type_rel_path = "{}bin/{}".format("".join(["../"] * module_folder_depth), fast_type_filename) - exec_target_content = textwrap.dedent("""\ + exec_target_content = textwrap.dedent(f"""\ if(NOT TARGET fast_type_gen) + # Locate fast_type_gen executable + ## Workaround for legacy "cmake" generator in case of cross-build if(CMAKE_CROSSCOMPILING) - find_program(MFAST_EXECUTABLE fast_type_gen PATHS ENV PATH NO_DEFAULT_PATH) + find_program(MFAST_EXECUTABLE NAMES fast_type_gen PATHS ENV PATH NO_DEFAULT_PATH) + endif() + ## And here this will work fine with "CMakeToolchain" (for native & cross-build) + ## and legacy "cmake" generator in case of native build + if(NOT MFAST_EXECUTABLE) + find_program(MFAST_EXECUTABLE NAMES fast_type_gen) endif() + ## Last resort: we search in package folder directly if(NOT MFAST_EXECUTABLE) get_filename_component(MFAST_EXECUTABLE "${{CMAKE_CURRENT_LIST_DIR}}/{fast_type_rel_path}" ABSOLUTE) endif() + + # Create executable imported target fast_type_gen add_executable(fast_type_gen IMPORTED) set_property(TARGET fast_type_gen PROPERTY IMPORTED_LOCATION ${{MFAST_EXECUTABLE}}) endif() - """.format(fast_type_rel_path=fast_type_rel_path)) + """) module_abs_path = os.path.join(self.package_folder, self._fast_type_gen_target_file) old_content = load(self, module_abs_path) new_content = exec_target_content + old_content diff --git a/recipes/mfast/all/test_package/conanfile.py b/recipes/mfast/all/test_package/conanfile.py index fecd6e83f0b2f8..6f661e72969a0b 100644 --- a/recipes/mfast/all/test_package/conanfile.py +++ b/recipes/mfast/all/test_package/conanfile.py @@ -1,13 +1,12 @@ from conan import ConanFile -from conan.tools.build import can_run, cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeToolchain", "CMakeDeps" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" test_type = "explicit" def layout(self): @@ -17,15 +16,7 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - if hasattr(self, "settings_build") and cross_building(self): - self.tool_requires(self.tested_reference_str) - - def generate(self): - VirtualRunEnv(self).generate() - if hasattr(self, "settings_build") and cross_building(self): - VirtualBuildEnv(self).generate() - else: - VirtualRunEnv(self).generate(scope="build") + self.tool_requires(self.tested_reference_str) def build(self): cmake = CMake(self) diff --git a/recipes/microprofile/all/CMakeLists.txt b/recipes/microprofile/all/CMakeLists.txt index ff45b79a8420c1..c54dc9657fda81 100644 --- a/recipes/microprofile/all/CMakeLists.txt +++ b/recipes/microprofile/all/CMakeLists.txt @@ -1,7 +1,63 @@ -cmake_minimum_required(VERSION 3.10) -project(cmake_wrapper) +cmake_minimum_required(VERSION 3.4) +project(microprofile) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +option(MICROPROFILE_USE_CONFIG_FILE "Use user provided configuration in microprofile.config.h file." ON) -add_subdirectory("source_subfolder") +set(MICROPROFILE_EXPORT_FILENAME microprofile.export.h) +set(MICROPROFILE_CONFIG_HEADER ${PROJECT_SOURCE_DIR}/microprofile.config.h) +set(MICROPROFILE_PUBLIC_HEADERS + ${PROJECT_SOURCE_DIR}/microprofile.h + ${CMAKE_CURRENT_BINARY_DIR}/${MICROPROFILE_EXPORT_FILENAME} +) + +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) + +add_library(${PROJECT_NAME} microprofile.h microprofile.cpp) + +include(GenerateExportHeader) +generate_export_header(${PROJECT_NAME} + EXPORT_MACRO_NAME MICROPROFILE_API + EXPORT_FILE_NAME ${MICROPROFILE_EXPORT_FILENAME} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ + $ +) + +if (MICROPROFILE_USE_CONFIG_FILE) + target_compile_definitions(${PROJECT_NAME} PUBLIC MICROPROFILE_USE_CONFIG) +endif() + +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) + +target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads) + +if (WIN32) + target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32) +endif() + +if (MP_MINIZ) + find_package(miniz REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PRIVATE miniz::miniz) +endif() + +if (MP_GPU_TIMERS_VULKAN) + find_package(Vulkan REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE Vulkan::Vulkan) +endif() + +set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${MICROPROFILE_PUBLIC_HEADERS}") + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} +) +if (MICROPROFILE_USE_CONFIG_FILE) + install(FILES ${MICROPROFILE_CONFIG_HEADER} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ + ) +endif() diff --git a/recipes/microprofile/all/conandata.yml b/recipes/microprofile/all/conandata.yml index 6715d7fabbe052..144d6e5120836b 100644 --- a/recipes/microprofile/all/conandata.yml +++ b/recipes/microprofile/all/conandata.yml @@ -2,11 +2,6 @@ sources: "3.1": - url: "https://github.com/jonasmr/microprofile/archive/refs/tags/v3.1.tar.gz" sha256: "300e1d0d21e4c13ad1de72c5309ba02fbdb3bcbbe26e5ad9ff8b798380781527" - - url: "https://unlicense.org/UNLICENSE" - sha256: "7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c" patches: "3.1": - patch_file: "patches/sources_fix.patch" - base_path: "source_subfolder" - - patch_file: "patches/cmake.patch" - base_path: "source_subfolder" diff --git a/recipes/microprofile/all/conanfile.py b/recipes/microprofile/all/conanfile.py index 9f23e3872db580..3779e90691c298 100644 --- a/recipes/microprofile/all/conanfile.py +++ b/recipes/microprofile/all/conanfile.py @@ -1,54 +1,59 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os +from collections import OrderedDict -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, collect_libs, copy, download, export_conandata_patches, get, save, load + +required_conan_version = ">=1.53.0" class MicroprofileConan(ConanFile): name = "microprofile" - license = "Unlicense" + license = "DocumentRef-README.md:LicenseRef-Unlicense" + description = "Microprofile is a embeddable profiler in a few files, written in C++" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jonasmr/microprofile" - description = "Microprofile is a embeddable profiler in a few files, written in C++" topics = ("profiler", "embedded", "timer") - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "microprofile_enabled": [True, False], "with_miniz": [True, False], - "thread_buffer_size": "ANY", - "thread_gpu_buffer_size": "ANY", - "max_frame_history": "ANY", - "webserver_port": "ANY", - "webserver_maxframes": "ANY", - "webserver_socket_buffer_size": "ANY", - "gpu_frame_delay": "ANY", - "name_max_length": "ANY", - "max_timers": "ANY", - "max_threads": "ANY", - "max_string_length": "ANY", - "timeline_max_tokens": "ANY", - "thread_log_frames_reuse": "ANY", - "max_groups": "ANY", + "thread_buffer_size": ["ANY"], + "thread_gpu_buffer_size": ["ANY"], + "max_frame_history": ["ANY"], + "webserver_port": ["ANY"], + "webserver_maxframes": ["ANY"], + "webserver_socket_buffer_size": ["ANY"], + "gpu_frame_delay": ["ANY"], + "name_max_length": ["ANY"], + "max_timers": ["ANY"], + "max_threads": ["ANY"], + "max_string_length": ["ANY"], + "timeline_max_tokens": ["ANY"], + "thread_log_frames_reuse": ["ANY"], + "max_groups": ["ANY"], "use_big_endian": [True, False], "enable_gpu_timer_callbacks": [True, False], - "enable_timer": [None, "gl", "d3d11", "d3d12", "vulkan"] + "enable_timer": [None, "gl", "d3d11", "d3d12", "vulkan"], } default_options = { "shared": False, "fPIC": True, "microprofile_enabled": True, "with_miniz": False, - "thread_buffer_size": 2048 << 10, - "thread_gpu_buffer_size": 128 << 10, + "thread_buffer_size": 2097152, + "thread_gpu_buffer_size": 131072, "max_frame_history": 512, "webserver_port": 1338, "webserver_maxframes": 30, - "webserver_socket_buffer_size": 16 << 10, + "webserver_socket_buffer_size": 16384, "gpu_frame_delay": 5, "name_max_length": 64, "max_timers": 1024, @@ -59,23 +64,35 @@ class MicroprofileConan(ConanFile): "max_groups": 128, "use_big_endian": False, "enable_gpu_timer_callbacks": False, - "enable_timer": None + "enable_timer": None, } - _cmake = None + def export_sources(self): + export_conandata_patches(self) + copy(self, "CMakeLists.txt", + src=self.recipe_folder, + dst=os.path.join(self.export_sources_folder, "src")) - @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: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_miniz: + self.requires("miniz/3.0.2") + if self.options.enable_timer == "gl": + self.requires("opengl/system") + if self.options.enable_timer == "vulkan": + self.requires("vulkan-loader/1.3.243.0") + def _validate_int_options(self): positive_int_options = [ "thread_buffer_size", @@ -91,19 +108,19 @@ def _validate_int_options(self): "max_string_length", "timeline_max_tokens", "thread_log_frames_reuse", - "max_groups" + "max_groups", ] for opt in positive_int_options: try: - value = int(getattr(self.options, opt)) + value = int(self.options.get_safe(opt)) if value < 0: raise ValueError except ValueError: - raise ConanInvalidConfiguration("microprofile:{} must be a positive integer".format(opt)) + raise ConanInvalidConfiguration(f"microprofile:{opt} must be a positive integer") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) if self.settings.os != "Windows" and self.options.enable_timer in ["d3d11", "d3d12"]: raise ConanInvalidConfiguration("DirectX timers can only be used in Windows.") if self.options.enable_timer and self.options.enable_gpu_timer_callbacks: @@ -113,91 +130,81 @@ def validate(self): if int(self.options.max_groups) % 32 != 0: raise ConanInvalidConfiguration("microprofile:max_groups must be multiple of 32.") - if int(self.options.webserver_port) > 2 ** 16 - 1: + if int(self.options.webserver_port) > 2**16 - 1: raise ConanInvalidConfiguration("microprofile:webserver_port must be between 0 and 65535.") - def configure(self): - if self.options.shared: - del self.options.fPIC - - def requirements(self): - if self.options.with_miniz: - self.requires("miniz/2.2.0") - if self.options.enable_timer == "gl": - self.requires("opengl/system") - if self.options.enable_timer == "vulkan": - self.requires("vulkan-loader/1.2.182") - def source(self): - tools.get(**self.conan_data["sources"][self.version][0], strip_root=True, destination=self._source_subfolder) - tools.download(filename="LICENSE", **self.conan_data["sources"][self.version][1]) + get(self, **self.conan_data["sources"][self.version][0], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MP_MINIZ"] = self.options.with_miniz + tc.variables["MP_GPU_TIMERS_VULKAN"] = self.options.enable_timer == "vulkan" + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - self._create_defines_file(os.path.join(self._source_subfolder, "microprofile.config.h")) - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + self._create_defines_file(os.path.join(self.source_folder, "microprofile.config.h")) + 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.definitions["MP_MINIZ"] = self.options.with_miniz - self._cmake.definitions["MP_GPU_TIMERS_VULKAN"] = self.options.enable_timer == "vulkan" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def _extract_license(self): + readme = load(self, os.path.join(self.source_folder, "README.md"),) + return readme[readme.find("# License"):] def package(self): - self.copy("LICENSE", dst="licenses") - cmake = self._configure_cmake() + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) cmake.install() def _create_defines(self): - return [ - "MICROPROFILE_EXPORT", - ("MICROPROFILE_ENABLED", ("1" if self.options.microprofile_enabled else "0")), - ("MICROPROFILE_DEBUG", ("1" if self.settings.build_type == "Debug" else "0")), - ("MICROPROFILE_MINIZ", ("1" if self.options.with_miniz else "0")), - ("MICROPROFILE_BIG_ENDIAN", ("1" if self.options.use_big_endian else "0")), - ("MICROPROFILE_GPU_TIMERS", ("1" if self.options.enable_timer else "0")), - ("MICROPROFILE_GPU_TIMER_CALLBACKS", ("1" if self.options.enable_gpu_timer_callbacks else "0")), - ("MICROPROFILE_GPU_TIMERS_GL", ("1" if self.options.enable_timer == "gl" else "0")), - ("MICROPROFILE_GPU_TIMERS_D3D11", ("1" if self.options.enable_timer == "d3d11" else "0")), - ("MICROPROFILE_GPU_TIMERS_D3D12", ("1" if self.options.enable_timer == "d3d12" else "0")), - ("MICROPROFILE_GPU_TIMERS_VULKAN", ("1" if self.options.enable_timer == "vulkan" else "0")), - ("MICROPROFILE_PER_THREAD_BUFFER_SIZE", str(self.options.thread_buffer_size)), - ("MICROPROFILE_PER_THREAD_GPU_BUFFER_SIZE", str(self.options.thread_gpu_buffer_size)), - ("MICROPROFILE_MAX_FRAME_HISTORY", str(self.options.max_frame_history)), - ("MICROPROFILE_WEBSERVER_PORT", str(self.options.webserver_port)), - ("MICROPROFILE_WEBSERVER_MAXFRAMES", str(self.options.webserver_maxframes)), - ("MICROPROFILE_WEBSERVER_SOCKET_BUFFER_SIZE", str(self.options.webserver_socket_buffer_size)), - ("MICROPROFILE_GPU_FRAME_DELAY", str(self.options.gpu_frame_delay)), - ("MICROPROFILE_NAME_MAX_LEN", str(self.options.name_max_length)), - ("MICROPROFILE_MAX_TIMERS", str(self.options.max_timers)), - ("MICROPROFILE_MAX_THREADS", str(self.options.max_threads)), - ("MICROPROFILE_MAX_STRING", str(self.options.max_string_length)), - ("MICROPROFILE_TIMELINE_MAX_TOKENS", str(self.options.timeline_max_tokens)), - ("MICROPROFILE_THREAD_LOG_FRAMES_REUSE", str(self.options.thread_log_frames_reuse)), - ("MICROPROFILE_MAX_GROUPS", str(self.options.max_groups)) - ] + defines = OrderedDict() + defines["MICROPROFILE_EXPORT"] = None + defines["MICROPROFILE_ENABLED"] = bool(self.options.microprofile_enabled) + defines["MICROPROFILE_DEBUG"] = bool(self.settings.build_type == "Debug") + defines["MICROPROFILE_MINIZ"] = bool(self.options.with_miniz) + defines["MICROPROFILE_BIG_ENDIAN"] = bool(self.options.use_big_endian) + defines["MICROPROFILE_GPU_TIMERS"] = bool(self.options.enable_timer) + defines["MICROPROFILE_GPU_TIMER_CALLBACKS"] = bool(self.options.enable_gpu_timer_callbacks) + defines["MICROPROFILE_GPU_TIMERS_GL"] = bool(self.options.enable_timer == "gl") + defines["MICROPROFILE_GPU_TIMERS_D3D11"] = bool(self.options.enable_timer == "d3d11") + defines["MICROPROFILE_GPU_TIMERS_D3D12"] = bool(self.options.enable_timer == "d3d12") + defines["MICROPROFILE_GPU_TIMERS_VULKAN"] = bool(self.options.enable_timer == "vulkan") + defines["MICROPROFILE_PER_THREAD_BUFFER_SIZE"] = self.options.thread_buffer_size + defines["MICROPROFILE_PER_THREAD_GPU_BUFFER_SIZE"] = self.options.thread_gpu_buffer_size + defines["MICROPROFILE_MAX_FRAME_HISTORY"] = self.options.max_frame_history + defines["MICROPROFILE_WEBSERVER_PORT"] = self.options.webserver_port + defines["MICROPROFILE_WEBSERVER_MAXFRAMES"] = self.options.webserver_maxframes + defines["MICROPROFILE_WEBSERVER_SOCKET_BUFFER_SIZE"] = self.options.webserver_socket_buffer_size + defines["MICROPROFILE_GPU_FRAME_DELAY"] = self.options.gpu_frame_delay + defines["MICROPROFILE_NAME_MAX_LEN"] = self.options.name_max_length + defines["MICROPROFILE_MAX_TIMERS"] = self.options.max_timers + defines["MICROPROFILE_MAX_THREADS"] = self.options.max_threads + defines["MICROPROFILE_MAX_STRING"] = self.options.max_string_length + defines["MICROPROFILE_TIMELINE_MAX_TOKENS"] = self.options.timeline_max_tokens + defines["MICROPROFILE_THREAD_LOG_FRAMES_REUSE"] = self.options.thread_log_frames_reuse + defines["MICROPROFILE_MAX_GROUPS"] = self.options.max_groups + return defines def _create_defines_file(self, filename): defines = self._create_defines() defines_list = ["#pragma once\n"] - for define in defines: - if isinstance(define, tuple) or isinstance(define, list): - defines_list.append("#define {} {}\n".format(define[0], define[1])) + for define, value in defines.items(): + if value is None or value == "": + defines_list.append(f"#define {define}\n") + elif value in [True, False]: + defines_list.append(f"#define {define} {'1' if value else '0'}\n") else: - defines_list.append("#define {}\n".format(define)) - tools.save(filename, "".join(defines_list)) + defines_list.append(f"#define {define} {value}\n") + save(self, filename, "".join(defines_list)) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) - self.cpp_info.names["cmake_find_package"] = self.name - self.cpp_info.names["cmake_find_package_multi"] = self.name + self.cpp_info.libs = collect_libs(self) if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] - elif self.settings.os == "Linux": - self.cpp_info.system_libs = ["pthread"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m"] self.cpp_info.defines.append("MICROPROFILE_USE_CONFIG") diff --git a/recipes/microprofile/all/patches/cmake.patch b/recipes/microprofile/all/patches/cmake.patch deleted file mode 100644 index b92ba025b0a43b..00000000000000 --- a/recipes/microprofile/all/patches/cmake.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- /dev/null -+++ b/CMakeLists.txt -@@ -0,0 +1,64 @@ -+cmake_minimum_required(VERSION 3.4) -+project(microprofile) -+ -+option(MICROPROFILE_USE_CONFIG_FILE "Use user provided configuration in microprofile.config.h file." ON) -+ -+set(MICROPROFILE_EXPORT_FILENAME microprofile.export.h) -+set(MICROPROFILE_CONFIG_HEADER ${PROJECT_SOURCE_DIR}/microprofile.config.h) -+set(MICROPROFILE_PUBLIC_HEADERS -+ ${PROJECT_SOURCE_DIR}/microprofile.h -+ ${CMAKE_CURRENT_BINARY_DIR}/${MICROPROFILE_EXPORT_FILENAME} -+) -+ -+set(THREADS_PREFER_PTHREAD_FLAG ON) -+find_package(Threads REQUIRED) -+ -+add_library(${PROJECT_NAME} microprofile.h microprofile.cpp) -+ -+include(GenerateExportHeader) -+generate_export_header(${PROJECT_NAME} -+ EXPORT_MACRO_NAME MICROPROFILE_API -+ EXPORT_FILE_NAME ${MICROPROFILE_EXPORT_FILENAME} -+) -+ -+target_include_directories(${PROJECT_NAME} PUBLIC -+ $ -+ $ -+ $ -+) -+ -+if (MICROPROFILE_USE_CONFIG_FILE) -+ target_compile_definitions(${PROJECT_NAME} PUBLIC MICROPROFILE_USE_CONFIG) -+endif() -+ -+target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) -+ -+target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads) -+ -+if (WIN32) -+ target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32) -+endif() -+ -+if (MP_MINIZ) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::miniz) -+endif() -+ -+if (MP_GPU_TIMERS_VULKAN) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::vulkan-loader) -+endif() -+ -+set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${MICROPROFILE_PUBLIC_HEADERS}") -+ -+include(GNUInstallDirs) -+install(TARGETS ${PROJECT_NAME} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} -+) -+if (MICROPROFILE_USE_CONFIG_FILE) -+ install(FILES ${MICROPROFILE_CONFIG_HEADER} -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} -+ PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ -+ ) -+endif() diff --git a/recipes/microprofile/all/test_package/CMakeLists.txt b/recipes/microprofile/all/test_package/CMakeLists.txt index ed091dc6c1aeed..34366c2d4346f2 100644 --- a/recipes/microprofile/all/test_package/CMakeLists.txt +++ b/recipes/microprofile/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(microprofile REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/microprofile/all/test_package/conanfile.py b/recipes/microprofile/all/test_package/conanfile.py index 30f8c8cfb09756..ef5d7042163ecc 100644 --- a/recipes/microprofile/all/test_package/conanfile.py +++ b/recipes/microprofile/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 MicroprofileTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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/microprofile/all/test_v1_package/CMakeLists.txt b/recipes/microprofile/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/microprofile/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/microprofile/all/test_v1_package/conanfile.py b/recipes/microprofile/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..30f8c8cfb09756 --- /dev/null +++ b/recipes/microprofile/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class MicroprofileTestConan(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/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/mikelankamp-fpm/all/conanfile.py b/recipes/mikelankamp-fpm/all/conanfile.py index 4f1037ea6348fd..d62613b7151931 100644 --- a/recipes/mikelankamp-fpm/all/conanfile.py +++ b/recipes/mikelankamp-fpm/all/conanfile.py @@ -4,7 +4,8 @@ from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.50.0" + class MikeLankampFpmConan(ConanFile): name = "mikelankamp-fpm" @@ -13,6 +14,7 @@ class MikeLankampFpmConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/MikeLankamp/fpm" topics = ("fixed-point", "math", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/mikelankamp-fpm/all/test_package/conanfile.py b/recipes/mikelankamp-fpm/all/test_package/conanfile.py index 48499fa0989d9c..e845ae751a3017 100644 --- a/recipes/mikelankamp-fpm/all/test_package/conanfile.py +++ b/recipes/mikelankamp-fpm/all/test_package/conanfile.py @@ -4,7 +4,6 @@ import os -# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" diff --git a/recipes/mimalloc/all/conanfile.py b/recipes/mimalloc/all/conanfile.py index af2bccdab3572f..eaa8e6193ea4e1 100644 --- a/recipes/mimalloc/all/conanfile.py +++ b/recipes/mimalloc/all/conanfile.py @@ -1,6 +1,5 @@ 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 apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file, save, collect_libs from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, VCVars @@ -38,20 +37,6 @@ class MimallocConan(ConanFile): "single_object": False, } - @property - def _min_cppstd(self): - return 17 - - @property - def _compilers_minimum_version(self): - return { - "gcc": "7", - "Visual Studio": "15", - "msvc": "191", - "clang": "5", - "apple-clang": "10", - } - def export_sources(self): export_conandata_patches(self) @@ -109,14 +94,6 @@ def validate(self): self.options.get_safe("inject"): raise ConanInvalidConfiguration("Single object is incompatible with library injection") - 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 does not support." - ) - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/miniaudio/all/conandata.yml b/recipes/miniaudio/all/conandata.yml index f2557191152c72..061502ec47da0a 100644 --- a/recipes/miniaudio/all/conandata.yml +++ b/recipes/miniaudio/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.11.21": + url: "https://github.com/mackron/miniaudio/archive/0.11.21.tar.gz" + sha256: "6afb5c231613d2fab4f1c668b7243ff9a7d6d78a7f5a2692c133f026fe508506" + "0.11.18": + url: "https://github.com/mackron/miniaudio/archive/0.11.18.tar.gz" + sha256: "85ca916266d809b39902e180a6d16f82caea9c2ea1cea6d374413641b7ba48c3" "0.11.17": url: "https://github.com/mackron/miniaudio/archive/0.11.17.tar.gz" sha256: "4b139065f7068588b73d507d24e865060e942eb731f988ee5a8f1828155b9480" diff --git a/recipes/miniaudio/config.yml b/recipes/miniaudio/config.yml index b40e9165e25a04..4db3fb9d24db29 100644 --- a/recipes/miniaudio/config.yml +++ b/recipes/miniaudio/config.yml @@ -1,4 +1,8 @@ versions: + "0.11.21": + folder: all + "0.11.18": + folder: all "0.11.17": folder: all "0.11.16": diff --git a/recipes/minisat/all/conanfile.py b/recipes/minisat/all/conanfile.py index 6dccb7f8528034..fdfbb6316a9635 100644 --- a/recipes/minisat/all/conanfile.py +++ b/recipes/minisat/all/conanfile.py @@ -41,7 +41,7 @@ def layout(self): def requirements(self): # https://github.com/niklasso/minisat/blob/37dc6c67e2af26379d88ce349eb9c4c6160e8543/minisat/utils/ParseUtils.h#L27 - self.requires("zlib/1.2.13", transitive_headers=True, transitive_libs=True) + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/minitrace/all/conandata.yml b/recipes/minitrace/all/conandata.yml index f0c32e1045bb89..04665f845d5e31 100644 --- a/recipes/minitrace/all/conandata.yml +++ b/recipes/minitrace/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230905": + url: "https://github.com/hrydgard/minitrace/archive/bc377c921f8c7da38f2beab355245222a01efc1a.tar.gz" + sha256: "f77633c9244834229ffbcbdf2b87c0893055e42ed0721f4b5dc1753738bdb547" "cci.20210321": url: "https://github.com/hrydgard/minitrace/archive/020f42b189e8d6ad50e4d8f45d69edee0a6b3f23.tar.gz" sha256: "314bcab4dc069c61f2eb813c9bd649efb2bd1fd75f91205a269a4c5abcd3d66b" diff --git a/recipes/minitrace/all/conanfile.py b/recipes/minitrace/all/conanfile.py index af8d398e935c10..731c80a714d09b 100644 --- a/recipes/minitrace/all/conanfile.py +++ b/recipes/minitrace/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir import os required_conan_version = ">=1.53.0" @@ -57,6 +57,7 @@ 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, "share")) def package_info(self): self.cpp_info.libs = ["minitrace"] diff --git a/recipes/minitrace/config.yml b/recipes/minitrace/config.yml index 384492f581d344..fcb3fb2b98f246 100644 --- a/recipes/minitrace/config.yml +++ b/recipes/minitrace/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20230905": + folder: all "cci.20210321": folder: all diff --git a/recipes/minizip-ng/all/conandata.yml b/recipes/minizip-ng/all/conandata.yml index 352a0f4b634fe5..3d2b61dbae6973 100644 --- a/recipes/minizip-ng/all/conandata.yml +++ b/recipes/minizip-ng/all/conandata.yml @@ -1,4 +1,13 @@ 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" + "4.0.1": + url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.1.tar.gz" + sha256: "63e47a2b4dbac0da501f43f4da74f118dfb3ef0dee0ffbbe89428271002260f8" "4.0.0": url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.0.tar.gz" sha256: "f9062e576de026fd5026d65597de3b05263cd4d91400cacdbbe36dfa8a642fff" @@ -20,15 +29,6 @@ sources: "3.0.4": url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.4.tar.gz" sha256: "2ab219f651901a337a7d3c268128711b80330a99ea36bdc528c76b591a624c3c" - "3.0.3": - url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.3.tar.gz" - sha256: "5f1dd0d38adbe9785cb9c4e6e47738c109d73a0afa86e58c4025ce3e2cc504ed" - "3.0.2": - url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.2.tar.gz" - sha256: "6ba4b6629c107c27ab526e517bdb105612232f0965a6747f60150e5a04c2fe5a" - "3.0.1": - url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.1.tar.gz" - sha256: "96c95b274dd535984ce0e87691691388f2b976106e8cf8d527b15da552ac94e4" patches: "3.0.9": - patch_file: "patches/3.0.9-0001-fix-cmake-project.patch" @@ -70,27 +70,3 @@ patches: patch_description: "CMake: inject libdir of lzma" patch_type: "conan" patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" - "3.0.3": - - patch_file: "patches/3.0.3-0001-fix-cmake-project.patch" - patch_description: "CMake: declare project() sooner" - patch_type: "conan" - - patch_file: "patches/3.0.1-0002-fix-lzma-libdir.patch" - patch_description: "CMake: inject libdir of lzma" - patch_type: "conan" - patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" - "3.0.2": - - patch_file: "patches/3.0.2-0001-fix-cmake-project.patch" - patch_description: "CMake: declare project() sooner" - patch_type: "conan" - - patch_file: "patches/3.0.1-0002-fix-lzma-libdir.patch" - patch_description: "CMake: inject libdir of lzma" - patch_type: "conan" - patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" - "3.0.1": - - patch_file: "patches/3.0.1-0001-fix-cmake-project.patch" - patch_description: "CMake: declare project() sooner" - patch_type: "conan" - - patch_file: "patches/3.0.1-0002-fix-lzma-libdir.patch" - patch_description: "CMake: inject libdir of lzma" - patch_type: "conan" - patch_source: "https://github.com/zlib-ng/minizip-ng/pull/658" diff --git a/recipes/minizip-ng/all/conanfile.py b/recipes/minizip-ng/all/conanfile.py index 01bda6f608ccb9..01cfddc75128c6 100644 --- a/recipes/minizip-ng/all/conanfile.py +++ b/recipes/minizip-ng/all/conanfile.py @@ -14,12 +14,10 @@ class MinizipNgConan(ConanFile): name = "minizip-ng" description = "Fork of the popular zip manipulation library found in the zlib distribution." - topics = ("compression", "zip") - package_type = "library" + license = "Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/zlib-ng/minizip-ng" - license = "Zlib" - + topics = ("compression", "zip") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -81,11 +79,11 @@ def layout(self): def requirements(self): if self.options.get_safe("with_zlib"): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_lzma: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.5") if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.with_openssl: @@ -96,7 +94,7 @@ def requirements(self): def build_requirements(self): if self._needs_pkg_config: - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.0.3") if Version(self.version) >= "4.0.0": self.tool_requires("cmake/[>=3.19 <4]") @@ -140,7 +138,7 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE 1)", "") - else: + elif Version(self.version) == "4.0.0": replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set_target_properties(${MINIZIP_TARGET} PROPERTIES POSITION_INDEPENDENT_CODE 1)", "") diff --git a/recipes/minizip-ng/all/patches/3.0.1-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.1-0001-fix-cmake-project.patch deleted file mode 100644 index c44b1784ce620d..00000000000000 --- a/recipes/minizip-ng/all/patches/3.0.1-0001-fix-cmake-project.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -63,10 +63,10 @@ endif() - # BZIP2_ROOT - Parent directory of BZip2 installation - # OPENSSL_ROOT - Parent directory of OpenSSL installation - --enable_language(C) - - # Library version - set(VERSION "3.0.1") -+project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) - - # API version - set(SOVERSION "3.0") -@@ -677,7 +677,6 @@ endif() - list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) - - # Create minizip library --project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION}) - - if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") - message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.2-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.2-0001-fix-cmake-project.patch deleted file mode 100644 index 8cfa267f8cff7e..00000000000000 --- a/recipes/minizip-ng/all/patches/3.0.2-0001-fix-cmake-project.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -63,10 +63,10 @@ endif() - # BZIP2_ROOT - Parent directory of BZip2 installation - # OPENSSL_ROOT - Parent directory of OpenSSL installation - --enable_language(C) - - # Library version - set(VERSION "3.0.2") -+project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) - - # API version - set(SOVERSION "3.0") -@@ -681,7 +681,6 @@ endif() - list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) - - # Create minizip library --project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION}) - - if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") - message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/all/patches/3.0.3-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.3-0001-fix-cmake-project.patch deleted file mode 100644 index 484eb23a916710..00000000000000 --- a/recipes/minizip-ng/all/patches/3.0.3-0001-fix-cmake-project.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -63,10 +63,10 @@ endif() - # BZIP2_ROOT - Parent directory of BZip2 installation - # OPENSSL_ROOT - Parent directory of OpenSSL installation - --enable_language(C) - - # Library version - set(VERSION "3.0.3") -+project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) - - # API version - set(SOVERSION "3") -@@ -681,7 +681,6 @@ endif() - list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) - - # Create minizip library --project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION}) - - if(NOT ${MZ_PROJECT_SUFFIX} STREQUAL "") - message(STATUS "Project configured as ${PROJECT_NAME}") diff --git a/recipes/minizip-ng/config.yml b/recipes/minizip-ng/config.yml index 85231c75362684..30253cff927d41 100644 --- a/recipes/minizip-ng/config.yml +++ b/recipes/minizip-ng/config.yml @@ -1,4 +1,10 @@ versions: + "4.0.3": + folder: all + "4.0.2": + folder: all + "4.0.1": + folder: all "4.0.0": folder: all "3.0.9": @@ -13,9 +19,3 @@ versions: folder: all "3.0.4": folder: all - "3.0.3": - folder: all - "3.0.2": - folder: all - "3.0.1": - folder: all diff --git a/recipes/minizip/all/conanfile.py b/recipes/minizip/all/conanfile.py index e4316426a6e9c0..cec7c823f04293 100644 --- a/recipes/minizip/all/conanfile.py +++ b/recipes/minizip/all/conanfile.py @@ -13,7 +13,7 @@ class MinizipConan(ConanFile): license = "Zlib" description = "An experimental package to read and write files in .zip format, written on top of zlib" topics = ("zip", "compression", "inflate") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -46,7 +46,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13", transitive_headers=True) + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True) if self.options.bzip2: self.requires("bzip2/1.0.8", transitive_headers=True) diff --git a/recipes/mio/all/conandata.yml b/recipes/mio/all/conandata.yml index fdad8f55da4137..6e7bb1d7116912 100644 --- a/recipes/mio/all/conandata.yml +++ b/recipes/mio/all/conandata.yml @@ -1,11 +1,13 @@ sources: + "cci.20230303": + url: "https://github.com/mandreyel/mio/archive/8b6b7d878c89e81614d05edca7936de41ccdd2da.tar.gz" + sha256: "86248113bb2f1484f9cd44a260fe09beaa911307073c6f21fa9e765588d54b4b" "cci.20201220": url: "https://github.com/mandreyel/mio/archive/3f86a95c0784d73ce6815237ec33ed25f233b643.tar.gz" sha256: "056ae59d63c5d7f34dd90510adf2996ef1c4c17ec2b26ba9c9cb9974025b2c2c" - "cci.20230303": - url: "https://github.com/mandreyel/mio/archive/8b6b7d878c89e81614d05edca7936de41ccdd2da.tar.gz" - sha256: "86248113BB2F1484F9CD44A260FE09BEAA911307073C6F21FA9E765588D54B4B" patches: "cci.20201220": - patch_file: "patches/0001-fix-include-windows.patch" + patch_description: "Add missing includes for Windows" + patch_type: "portability" patch_source: "https://github.com/mandreyel/mio/pull/73" diff --git a/recipes/mio/all/conanfile.py b/recipes/mio/all/conanfile.py index 469a34156ae796..a91c01d248f09e 100644 --- a/recipes/mio/all/conanfile.py +++ b/recipes/mio/all/conanfile.py @@ -1,24 +1,27 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd -from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class MioConan(ConanFile): name = "mio" description = "Cross-platform C++11 header-only library for memory mapped file IO." license = "MIT" - topics = ("mio", "mmap", "memory-mapping", "fileviewer") + topics = ("mmap", "memory-mapping", "fileviewer") homepage = "https://github.com/mandreyel/mio" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" 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 layout(self): + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() @@ -27,12 +30,8 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - def layout(self): - basic_layout(self, src_folder="src") - 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) @@ -45,26 +44,18 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "mio") self.cpp_info.set_property("cmake_target_name", "mio::mio") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] self.cpp_info.components["mio-headers"].set_property("cmake_target_name", "mio::mio-headers") self.cpp_info.components["mio-headers"].bindirs = [] - self.cpp_info.components["mio-headers"].frameworkdirs = [] self.cpp_info.components["mio-headers"].libdirs = [] - self.cpp_info.components["mio-headers"].resdirs = [] if self.settings.os == "Windows": self.cpp_info.components["mio_full_winapi"].set_property("cmake_target_name", "mio::mio_full_winapi") self.cpp_info.components["mio_full_winapi"].bindirs = [] - self.cpp_info.components["mio_full_winapi"].frameworkdirs = [] self.cpp_info.components["mio_full_winapi"].libdirs = [] - self.cpp_info.components["mio_full_winapi"].resdirs = [] self.cpp_info.components["mio_min_winapi"].set_property("cmake_target_name", "mio::mio_min_winapi") self.cpp_info.components["mio_min_winapi"].defines = ["WIN32_LEAN_AND_MEAN", "NOMINMAX"] self.cpp_info.components["mio_min_winapi"].bindirs = [] - self.cpp_info.components["mio_min_winapi"].frameworkdirs = [] self.cpp_info.components["mio_min_winapi"].libdirs = [] - self.cpp_info.components["mio_min_winapi"].resdirs = [] diff --git a/recipes/mio/all/test_package/conanfile.py b/recipes/mio/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/mio/all/test_package/conanfile.py +++ b/recipes/mio/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/mio/all/test_v1_package/CMakeLists.txt b/recipes/mio/all/test_v1_package/CMakeLists.txt index 84deeaa812c31b..b21cc49efde95c 100644 --- a/recipes/mio/all/test_v1_package/CMakeLists.txt +++ b/recipes/mio/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(mio REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE mio::mio) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mio/config.yml b/recipes/mio/config.yml index ce9e92b9275c86..023d02b706f662 100644 --- a/recipes/mio/config.yml +++ b/recipes/mio/config.yml @@ -1,5 +1,5 @@ versions: - "cci.20201220": - folder: all "cci.20230303": folder: all + "cci.20201220": + folder: all diff --git a/recipes/mm_file/all/conandata.yml b/recipes/mm_file/all/conandata.yml new file mode 100644 index 00000000000000..2e4260fa45c64e --- /dev/null +++ b/recipes/mm_file/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/jermp/mm_file/archive/refs/tags/v1.0.0.tar.gz" + sha256: "1bb1b057ea1f1b06366513a198c39277740f743b59a0e5669f2694698f52018b" diff --git a/recipes/mm_file/all/conanfile.py b/recipes/mm_file/all/conanfile.py new file mode 100644 index 00000000000000..781246e7dfea49 --- /dev/null +++ b/recipes/mm_file/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class MMFileConan(ConanFile): + name = "mm_file" + description = "A self-contained, header-only, implementation of memory-mapped files in C++ for fast integration into larger projects." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jermp/mm_file" + topics = ("memory-mapped-file", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Windows") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.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.libdirs = [] diff --git a/recipes/mm_file/all/test_package/CMakeLists.txt b/recipes/mm_file/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..5c2d17e17789e2 --- /dev/null +++ b/recipes/mm_file/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mm_file REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mm_file::mm_file) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mm_file/all/test_package/conanfile.py b/recipes/mm_file/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/mm_file/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/mm_file/all/test_package/test_package.cpp b/recipes/mm_file/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..708d34f560ee35 --- /dev/null +++ b/recipes/mm_file/all/test_package/test_package.cpp @@ -0,0 +1,31 @@ +#include +#include + +#include "mm_file/mm_file.hpp" + +int main() { + std::string filename("tmp.bin"); + static const size_t n = 13; + + { + // write n uint32_t integers + mm::file_sink fout(filename, n); + std::cout << "mapped " << fout.bytes() << " bytes " + << "for " << fout.size() << " integers" << std::endl; + + auto *data = fout.data(); + for (uint32_t i = 0; i != fout.size(); ++i) { + data[i] = i; + std::cout << "written " << data[i] << std::endl; + } + + // test iterator + for (auto x : fout) { + std::cout << "written " << x << std::endl; + } + + fout.close(); + } + + return 0; +} diff --git a/recipes/mm_file/config.yml b/recipes/mm_file/config.yml new file mode 100644 index 00000000000000..40341aa3db6cd3 --- /dev/null +++ b/recipes/mm_file/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/modern-cpp-kafka/all/conanfile.py b/recipes/modern-cpp-kafka/all/conanfile.py index a89b6dfd7b4a56..404038dfda2d57 100644 --- a/recipes/modern-cpp-kafka/all/conanfile.py +++ b/recipes/modern-cpp-kafka/all/conanfile.py @@ -4,7 +4,6 @@ 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 check_min_vs, is_msvc import os required_conan_version = ">=1.52.0" @@ -16,6 +15,7 @@ class ModernCppKafkaConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/morganstanley/modern-cpp-kafka" topics = ("kafka", "librdkafka", "kafkaproducer", "kafkaconsumer", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -29,13 +29,15 @@ def _compilers_minimum_version(self): "gcc": "8", "clang": "7", "apple-clang": "12", + "msvc": "192", + "Visual Studio": "16", } def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("librdkafka/2.0.2") + self.requires("librdkafka/2.3.0") def package_id(self): self.info.clear() @@ -43,17 +45,15 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - check_min_vs(self, 192) - 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], destination=self.source_folder, strip_root=True) + 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 package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) @@ -65,11 +65,7 @@ def package(self): ) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "ModernCppKafka") - self.cpp_info.set_property("cmake_target_name", "ModernCppKafka::ModernCppKafka") - - self.cpp_info.names["cmake_find_package"] = "ModernCppKafka" - self.cpp_info.names["cmake_find_package_multi"] = "ModernCppKafka" - - if self.settings.os in ["Linux", "Macos"]: + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") diff --git a/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt b/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt index e00b58eaa47439..2b86f2fbd7132f 100644 --- a/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt +++ b/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -find_package(ModernCppKafka REQUIRED CONFIG) +find_package(modern-cpp-kafka REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE ModernCppKafka::ModernCppKafka) +target_link_libraries(${PROJECT_NAME} PRIVATE modern-cpp-kafka::modern-cpp-kafka) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt b/recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt index 925ecbe19e448d..91630d79f4abb3 100644 --- a/recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt +++ b/recipes/modern-cpp-kafka/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) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) 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 132186858b019f..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.12") - 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-c-driver/all/conandata.yml b/recipes/mongo-c-driver/all/conandata.yml index eefdc63f632606..5e5abc368ffced 100644 --- a/recipes/mongo-c-driver/all/conandata.yml +++ b/recipes/mongo-c-driver/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.24.3": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.24.3/mongo-c-driver-1.24.3.tar.gz" + sha256: "cc0ad1006447ded21bbefecf57d6fef61afe6f0d56a4e28da73805d50fdb81b5" "1.24.1": url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.24.1/mongo-c-driver-1.24.1.tar.gz" sha256: "f9bdf71f24c6621c12535bad07f4654a218d84f16b85a68aca3abf6cd36d1859" @@ -21,6 +24,16 @@ sources: url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.6/mongo-c-driver-1.17.6.tar.gz" sha256: "8644deec7ae585e8d12566978f2017181e883f303a028b5b3ccb83c91248b150" patches: + "1.24.3": + - patch_file: "patches/1.24.1-0001-disable-shared-when-static.patch" + patch_description: "separate static and shared builds" + patch_type: "conan" + - patch_file: "patches/1.24.1-0002-fix-uninitialized-warning.patch" + patch_description: "fix uninitialized variable warning" + patch_type: "portability" + - patch_file: "patches/1.22.0-0003-disable-warning-errors.patch" + patch_description: "disable compiler flags to make warnings into errors" + patch_type: "conan" "1.24.1": - patch_file: "patches/1.24.1-0001-disable-shared-when-static.patch" patch_description: "separate static and shared builds" diff --git a/recipes/mongo-c-driver/all/conanfile.py b/recipes/mongo-c-driver/all/conanfile.py index c67766ae04dd2f..abc21a11a2f2bc 100644 --- a/recipes/mongo-c-driver/all/conanfile.py +++ b/recipes/mongo-c-driver/all/conanfile.py @@ -74,7 +74,7 @@ def requirements(self): if self.options.with_snappy: self.requires("snappy/1.1.10") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.with_icu: @@ -91,7 +91,7 @@ def validate(self): def build_requirements(self): if self.options.with_ssl == "libressl" or self.options.with_zstd: 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/mongo-c-driver/config.yml b/recipes/mongo-c-driver/config.yml index 20b511f9ecd13c..c20e8c0d078475 100644 --- a/recipes/mongo-c-driver/config.yml +++ b/recipes/mongo-c-driver/config.yml @@ -1,4 +1,6 @@ versions: + "1.24.3": + folder: all "1.24.1": folder: all "1.23.5": diff --git a/recipes/mongo-cxx-driver/all/conandata.yml b/recipes/mongo-cxx-driver/all/conandata.yml index 5f674bff2da011..58272018f40217 100644 --- a/recipes/mongo-cxx-driver/all/conandata.yml +++ b/recipes/mongo-cxx-driver/all/conandata.yml @@ -1,4 +1,10 @@ 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" "3.7.2": url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.2/mongo-cxx-driver-r3.7.2.tar.gz" sha256: "bc0f5193a8184db47a75685b58acd484b0e489eb0476b4d931d1bf4f5fc2186e" @@ -18,6 +24,20 @@ 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" + 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.7.2": - patch_file: "patches/3.7.2-0001-dirs.patch" patch_description: "disable documentation features, fix directories" diff --git a/recipes/mongo-cxx-driver/all/conanfile.py b/recipes/mongo-cxx-driver/all/conanfile.py index 557880613c87cd..26e997f666df15 100644 --- a/recipes/mongo-cxx-driver/all/conanfile.py +++ b/recipes/mongo-cxx-driver/all/conanfile.py @@ -47,7 +47,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("mongo-c-driver/1.23.5") + self.requires("mongo-c-driver/1.24.3") if self.options.polyfill == "boost": self.requires("boost/1.82.0", transitive_headers=True) diff --git a/recipes/mongo-cxx-driver/all/patches/3.8.0-0001-dirs.patch b/recipes/mongo-cxx-driver/all/patches/3.8.0-0001-dirs.patch new file mode 100644 index 00000000000000..e057a4548d890e --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.8.0-0001-dirs.patch @@ -0,0 +1,82 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 20254fa..98add65 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,6 +206,7 @@ set (BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR}) + + include (MakeDistFiles) + ++if(FALSE) + add_custom_target(hugo_dir + COMMAND ${CMAKE_COMMAND} -E make_directory hugo + ) +@@ -261,6 +262,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) + +@@ -270,6 +272,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) +@@ -281,6 +286,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) +@@ -381,4 +387,4 @@ endif () + 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 f30aea8..09e907c 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,8 +95,9 @@ 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}") + if(NOT BSONCXX_LINK_WITH_STATIC_MONGOC) +diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt +index 45fd3ad..3248655 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/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 454f3110a5ccaf..dfc6d8b54584e4 100644 --- a/recipes/mongo-cxx-driver/config.yml +++ b/recipes/mongo-cxx-driver/config.yml @@ -1,4 +1,8 @@ versions: + "3.8.1": + folder: all + "3.8.0": + folder: all "3.7.2": folder: all "3.7.0": diff --git a/recipes/mosquitto/1.x/conanfile.py b/recipes/mosquitto/1.x/conanfile.py index c9cd7eb5586db7..030bc9686278b0 100644 --- a/recipes/mosquitto/1.x/conanfile.py +++ b/recipes/mosquitto/1.x/conanfile.py @@ -45,7 +45,8 @@ def layout(self): def requirements(self): if self.options.with_tls: - self.requires("openssl/1.1.1s") + # uses deprecated functions in openssl/3.0.0 + self.requires("openssl/1.1.1w") if self.options.with_websockets: self.requires("libwebsockets/4.3.2") diff --git a/recipes/mosquitto/2.x/conandata.yml b/recipes/mosquitto/2.x/conandata.yml index 622f72a77af8bc..8200a378ca1b54 100644 --- a/recipes/mosquitto/2.x/conandata.yml +++ b/recipes/mosquitto/2.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.18": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.18.tar.gz" + sha256: "25499231664bc5338f9f05eb1815f4d5878f0c6c97e03afb3463a7b139a7e775" "2.0.15": url: "https://github.com/eclipse/mosquitto/archive/v2.0.15.tar.gz" sha256: "26dc3f1758b00c1725a0e4dd32f40c61f374375717f09b6af2bac62c5b44f1eb" diff --git a/recipes/mosquitto/2.x/conanfile.py b/recipes/mosquitto/2.x/conanfile.py index 6af30191cdf130..c221f41ff8ca87 100644 --- a/recipes/mosquitto/2.x/conanfile.py +++ b/recipes/mosquitto/2.x/conanfile.py @@ -12,11 +12,12 @@ class Mosquitto(ConanFile): name = "mosquitto" + description = """Eclipse Mosquitto MQTT library, broker and more""" license = "EPL-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://mosquitto.org" - description = """Eclipse Mosquitto MQTT library, broker and more""" topics = ("MQTT", "IoT", "eclipse") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -66,9 +67,9 @@ def requirements(self): if self.options.ssl: self.requires("openssl/[>=1.1 <4]") if self.options.get_safe("cjson"): - self.requires("cjson/1.7.14") + self.requires("cjson/1.7.16") if self.options.get_safe("websockets"): - self.requires("libwebsockets/4.2.0") + self.requires("libwebsockets/4.3.2") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/mosquitto/config.yml b/recipes/mosquitto/config.yml index 7627743e2625f0..0e19ca6c8d04b4 100644 --- a/recipes/mosquitto/config.yml +++ b/recipes/mosquitto/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.18": + folder: "2.x" "2.0.15": folder: "2.x" "2.0.14": diff --git a/recipes/mozjpeg/all/conandata.yml b/recipes/mozjpeg/all/conandata.yml index b3cb941ad21ebc..16c60131167b14 100644 --- a/recipes/mozjpeg/all/conandata.yml +++ b/recipes/mozjpeg/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.1.5": + url: "https://github.com/mozilla/mozjpeg/archive/v4.1.5.tar.gz" + sha256: "9fcbb7171f6ac383f5b391175d6fb3acde5e64c4c4727274eade84ed0998fcc1" + "4.1.3": + url: "https://github.com/mozilla/mozjpeg/archive/v4.1.3.tar.gz" + sha256: "f6ce89f616b30c498d1fb3b0f0940914557d8393a79c9e7aafff72032446bca0" "4.1.1": url: "https://github.com/mozilla/mozjpeg/archive/v4.1.1.tar.gz" sha256: "66b1b8d6b55d263f35f27f55acaaa3234df2a401232de99b6d099e2bb0a9d196" @@ -9,6 +15,14 @@ sources: url: "https://github.com/mozilla/mozjpeg/archive/v3.3.1.tar.gz" sha256: "aebbea60ea038a84a2d1ed3de38fdbca34027e2e54ee2b7d08a97578be72599d" patches: + "4.1.5": + - patch_file: "patches/4.1.5-0001-cmake-fixes.patch" + patch_description: "fix install folder and disable /NODEFAULT in MSVC" + patch_type: "conan" + "4.1.3": + - patch_file: "patches/4.1.3-0001-cmake-fixes.patch" + patch_description: "fix install folder and disable /NODEFAULT in MSVC" + patch_type: "conan" "4.1.1": - patch_file: "patches/4.1.1-0001-cmake-fixes.patch" patch_description: "fix install folder and disable /NODEFAULT in MSVC" 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/mozjpeg/all/patches/4.1.3-0001-cmake-fixes.patch b/recipes/mozjpeg/all/patches/4.1.3-0001-cmake-fixes.patch new file mode 100644 index 00000000000000..b9d6dd16f33f32 --- /dev/null +++ b/recipes/mozjpeg/all/patches/4.1.3-0001-cmake-fixes.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 82ce902..bde4aba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1492,7 +1492,7 @@ if(WITH_TURBOJPEG) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/tjbench-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) + endif() + endif() +@@ -1510,16 +1510,16 @@ if(ENABLE_STATIC) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/cjpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE}) +- install(PROGRAMS ${DIR}/djpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) +- install(PROGRAMS ${DIR}/jpegtran-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) + endif() + endif() + +-install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++install(TARGETS rdjpgcom wrjpgcom DESTINATION ${CMAKE_INSTALL_BINDIR}) + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt diff --git a/recipes/mozjpeg/all/patches/4.1.5-0001-cmake-fixes.patch b/recipes/mozjpeg/all/patches/4.1.5-0001-cmake-fixes.patch new file mode 100644 index 00000000000000..d3dd3fde8807b1 --- /dev/null +++ b/recipes/mozjpeg/all/patches/4.1.5-0001-cmake-fixes.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 939625d..c234c44 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1518,7 +1518,7 @@ if(WITH_TURBOJPEG) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/tjbench-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) + endif() + endif() +@@ -1536,16 +1536,16 @@ if(ENABLE_STATIC) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/cjpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE}) +- install(PROGRAMS ${DIR}/djpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) +- install(PROGRAMS ${DIR}/jpegtran-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) + endif() + endif() + +-install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++install(TARGETS rdjpgcom wrjpgcom DESTINATION ${CMAKE_INSTALL_BINDIR}) + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt diff --git a/recipes/mozjpeg/config.yml b/recipes/mozjpeg/config.yml index c5a4dbb215dd32..ae34a5e9040b33 100644 --- a/recipes/mozjpeg/config.yml +++ b/recipes/mozjpeg/config.yml @@ -1,4 +1,8 @@ versions: + "4.1.5": + folder: all + "4.1.3": + folder: all "4.1.1": folder: all "4.0.0": diff --git a/recipes/mp-units/0.8.0/conanfile.py b/recipes/mp-units/0.8.0/conanfile.py index b662aae02b390f..c44e1496f2a039 100644 --- a/recipes/mp-units/0.8.0/conanfile.py +++ b/recipes/mp-units/0.8.0/conanfile.py @@ -12,8 +12,8 @@ class MPUnitsConan(ConanFile): name = "mp-units" - homepage = "https://github.com/mpusz/units" - description = "Physical Quantities and Units library for C++" + homepage = "https://github.com/mpusz/mp-units" + description = "A Physical Quantities and Units library for C++" topics = ( "units", "dimensions", @@ -59,9 +59,9 @@ def _use_range_v3(self): def requirements(self): self.requires("gsl-lite/0.40.0") if self._use_libfmt: - self.requires("fmt/8.1.1") + self.requires("fmt/10.1.0") if self._use_range_v3: - self.requires("range-v3/0.11.0") + self.requires("range-v3/0.12.0") def validate(self): if self.settings.get_safe("compiler.cppstd"): diff --git a/recipes/mp-units/2.0.0/conandata.yml b/recipes/mp-units/2.0.0/conandata.yml new file mode 100644 index 00000000000000..79322cc88147b5 --- /dev/null +++ b/recipes/mp-units/2.0.0/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.0": + url: https://github.com/mpusz/units/archive/v2.0.0.tar.gz + sha256: c04cda9fdaeca3ae42886552658e8bde3b608a24a4a921a621a5db41ec416e0e diff --git a/recipes/mp-units/2.0.0/conanfile.py b/recipes/mp-units/2.0.0/conanfile.py new file mode 100644 index 00000000000000..e7312a805414c6 --- /dev/null +++ b/recipes/mp-units/2.0.0/conanfile.py @@ -0,0 +1,165 @@ +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 +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.59.0" + + +class MPUnitsConan(ConanFile): + name = "mp-units" + homepage = "https://github.com/mpusz/mp-units" + description = "A Physical Quantities and Units library for C++" + topics = ( + "units", + "dimensions", + "quantities", + "dimensional-analysis", + "physical-quantities", + "physical-units", + "system-of-units", + "system-of-quantities", + "isq", + "si", + "library", + "quantity-manipulation", + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + tool_requires = "cmake/[>=3.19 <4]" + package_type = "header-library" + no_copy_source = True + + @property + def _min_cppstd(self): + return "20" + + @property + def _minimum_compilers_version(self): + # Note that apple-clang and msvc are disabled for now, their C++ 20 implementations are not up to speed + return {"gcc": "11", "clang": "16"} + + @property + def _use_libfmt(self): + compiler = self.settings.compiler + version = Version(self.settings.compiler.version) + std_support = compiler == "msvc" and version >= 193 and compiler.cppstd == 23 + return not std_support + + @property + def _use_range_v3(self): + compiler = self.settings.compiler + version = Version(self.settings.compiler.version) + return "clang" in compiler and compiler.libcxx == "libc++" and version < 14 + + def requirements(self): + self.requires("gsl-lite/0.40.0") + if self._use_libfmt: + self.requires("fmt/10.1.0") + if self._use_range_v3: + self.requires("range-v3/0.11.0") + + def validate(self): + if self.settings.get_safe("compiler.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] + + compiler = self.settings.compiler + min_version = self._minimum_compilers_version.get(str(compiler)) + if min_version and loose_lt_semver(str(compiler.version), min_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires at least {compiler} {min_version} ({compiler.version} in use)" + ) + + # Note that apple-clang and msvc are disabled for now, their C++ 20 implementations are not up to speed + # Re-enable once newer versions with better support come out + if is_msvc(self) or compiler == "apple-clang": + raise ConanInvalidConfiguration(f"{self.ref} disabled for {compiler} as their C++20 implementation is not up to speed yet") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MP_UNITS_USE_LIBFMT"] = self._use_libfmt + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder="src") + cmake.build() + + def package_id(self): + self.info.clear() + + def package(self): + copy( + self, + "LICENSE.md", + 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")) + + def package_info(self): + compiler = self.settings.compiler + + # core + self.cpp_info.components["core"].requires = ["gsl-lite::gsl-lite"] + if compiler == "msvc": + self.cpp_info.components["core"].cxxflags = ["/utf-8"] + if self._use_range_v3: + self.cpp_info.components["core"].requires.append("range-v3::range-v3") + + # rest + self.cpp_info.components["core-io"].requires = ["core"] + self.cpp_info.components["core-fmt"].requires = ["core"] + if self._use_libfmt: + self.cpp_info.components["core-fmt"].requires.append("fmt::fmt") + self.cpp_info.components["utility"].requires = ["core", "isq", "si", "angular"] + self.cpp_info.components["isq"].requires = ["core"] + self.cpp_info.components["angular"].requires = ["isq"] + self.cpp_info.components["isq_angular"].requires = ["isq", "angular"] + self.cpp_info.components["natural"].requires = ["isq"] + self.cpp_info.components["si"].requires = ["isq"] + self.cpp_info.components["cgs"].requires = ["si"] + self.cpp_info.components["hep"].requires = ["si"] + self.cpp_info.components["iau"].requires = ["si"] + self.cpp_info.components["imperial"].requires = ["si"] + self.cpp_info.components["international"].requires = ["si"] + self.cpp_info.components["typographic"].requires = ["usc"] + self.cpp_info.components["usc"].requires = ["international"] + self.cpp_info.components["iec80000"].requires = ["isq", "si"] + self.cpp_info.components["systems"].requires = [ + "isq", + "angular", + "isq_angular", + "natural", + "si", + "cgs", + "hep", + "iau", + "imperial", + "international", + "typographic", + "usc", + "iec80000", + ] diff --git a/recipes/mp-units/2.0.0/test_package/CMakeLists.txt b/recipes/mp-units/2.0.0/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..07f3e7cd91e8a7 --- /dev/null +++ b/recipes/mp-units/2.0.0/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package + LANGUAGES CXX +) + +find_package(mp-units CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE mp-units::mp-units) +target_compile_features(test_package PUBLIC cxx_std_20) diff --git a/recipes/mp-units/2.0.0/test_package/conanfile.py b/recipes/mp-units/2.0.0/test_package/conanfile.py new file mode 100644 index 00000000000000..e418ee7701960b --- /dev/null +++ b/recipes/mp-units/2.0.0/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +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/mp-units/2.0.0/test_package/test_package.cpp b/recipes/mp-units/2.0.0/test_package/test_package.cpp new file mode 100644 index 00000000000000..f7a82eba1d2def --- /dev/null +++ b/recipes/mp-units/2.0.0/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include + +using namespace mp_units; + +constexpr auto avg_speed(QuantityOf auto d, QuantityOf auto t) +{ + return d / t; +} + +int main() +{ + using namespace mp_units::si::unit_symbols; + std::cout << "Average speed = " << avg_speed(240 * km, 2 * h) << '\n'; +} diff --git a/recipes/mp-units/2.0.0/test_v1_package/CMakeLists.txt b/recipes/mp-units/2.0.0/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..07f3e7cd91e8a7 --- /dev/null +++ b/recipes/mp-units/2.0.0/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package + LANGUAGES CXX +) + +find_package(mp-units CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE mp-units::mp-units) +target_compile_features(test_package PUBLIC cxx_std_20) diff --git a/recipes/mp-units/2.0.0/test_v1_package/conanfile.py b/recipes/mp-units/2.0.0/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..048e0f9557d476 --- /dev/null +++ b/recipes/mp-units/2.0.0/test_v1_package/conanfile.py @@ -0,0 +1,25 @@ +from conans import ConanFile, CMake, tools +from conans.tools import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package_multi" + + # TODO remove when https://github.com/conan-io/conan/issues/7680 is solved (or VS2019 is updated to at least 16.9) + def _skip_check(self): + return self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) <= "16" + + def build(self): + if self._skip_check(): + return + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if self._skip_check(): + return + if not tools.cross_building(self.settings): + self.run("test_package", run_environment=True) diff --git a/recipes/mp-units/2.0.0/test_v1_package/test_package.cpp b/recipes/mp-units/2.0.0/test_v1_package/test_package.cpp new file mode 100644 index 00000000000000..f7a82eba1d2def --- /dev/null +++ b/recipes/mp-units/2.0.0/test_v1_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include + +using namespace mp_units; + +constexpr auto avg_speed(QuantityOf auto d, QuantityOf auto t) +{ + return d / t; +} + +int main() +{ + using namespace mp_units::si::unit_symbols; + std::cout << "Average speed = " << avg_speed(240 * km, 2 * h) << '\n'; +} diff --git a/recipes/mp-units/config.yml b/recipes/mp-units/config.yml index 384108bf7c63a2..80a7d8dff9ed14 100644 --- a/recipes/mp-units/config.yml +++ b/recipes/mp-units/config.yml @@ -1,3 +1,5 @@ versions: "0.8.0": folder: 0.8.0 + "2.0.0": + folder: 2.0.0 diff --git a/recipes/mpark-variant/all/conanfile.py b/recipes/mpark-variant/all/conanfile.py index e015db951bf2da..1796ef9e9cc744 100644 --- a/recipes/mpark-variant/all/conanfile.py +++ b/recipes/mpark-variant/all/conanfile.py @@ -15,6 +15,7 @@ class MparkVariantConan(ConanFile): description = "C++17 std::variant for C++11/14/17" license = "BSL-1.0" topics = ("variant", "mpark-variant") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -29,8 +30,7 @@ def validate(self): check_min_cppstd(self, "11") 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 diff --git a/recipes/mpc/all/conandata.yml b/recipes/mpc/all/conandata.yml index cd8f83a739d7d6..8f24801eccbac3 100644 --- a/recipes/mpc/all/conandata.yml +++ b/recipes/mpc/all/conandata.yml @@ -1,10 +1,13 @@ sources: + "1.3.1": + url: "https://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz" + sha256: "ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8" "1.2.0": - url: https://ftp.gnu.org/gnu/mpc/mpc-1.2.0.tar.gz - sha256: e90f2d99553a9c19911abdb4305bf8217106a957e3994436428572c8dfe8fda6 + url: "https://ftp.gnu.org/gnu/mpc/mpc-1.2.0.tar.gz" + sha256: "e90f2d99553a9c19911abdb4305bf8217106a957e3994436428572c8dfe8fda6" "1.1.0": - url: https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz - sha256: 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e + url: "https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz" + sha256: "6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e" patches: "1.2.0": - patch_file: "patches/1.2.0-0001-asin-missing-limits.patch" diff --git a/recipes/mpc/all/conanfile.py b/recipes/mpc/all/conanfile.py index f996155628e5c3..820b8fd1588b87 100644 --- a/recipes/mpc/all/conanfile.py +++ b/recipes/mpc/all/conanfile.py @@ -14,16 +14,22 @@ class MpcConan(ConanFile): name = "mpc" - package_type = "library" description = "GNU MPC is a C library for the arithmetic of complex numbers with arbitrarily high precision " \ "and correct rounding of the result" - topics = ("conan", "mpc", "multiprecision", "math", "mathematics") - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://www.multiprecision.org/mpc/home.html" license = "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.multiprecision.org/" + topics = ("multiprecision", "math", "mathematics") settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def export_sources(self): export_conandata_patches(self) @@ -38,14 +44,17 @@ 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): - self.requires("gmp/6.2.1", transitive_headers=True) - self.requires("mpfr/4.1.0", transitive_headers=True) + self.requires("gmp/6.3.0", transitive_headers=True) + self.requires("mpfr/4.2.0", transitive_headers=True) def validate(self): # FIXME: add msvc support, upstream has a makefile.vc if is_msvc(self): - raise ConanInvalidConfiguration("mpc can be built with msvc, but it's not supported yet in this recipe.") + raise ConanInvalidConfiguration(f"{self.ref} can be built with msvc, but it's not supported yet in this recipe.") @property def _settings_build(self): @@ -57,12 +66,8 @@ def build_requirements(self): if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") - def layout(self): - basic_layout(self, src_folder="src") - 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): env = VirtualBuildEnv(self) diff --git a/recipes/mpc/all/test_package/CMakeLists.txt b/recipes/mpc/all/test_package/CMakeLists.txt index 5167a095daebe6..3a407d4714c495 100644 --- a/recipes/mpc/all/test_package/CMakeLists.txt +++ b/recipes/mpc/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) find_package(mpc REQUIRED CONFIG) diff --git a/recipes/mpc/all/test_package/conanfile.py b/recipes/mpc/all/test_package/conanfile.py index da190011b6b6d2..45240bc8742292 100644 --- a/recipes/mpc/all/test_package/conanfile.py +++ b/recipes/mpc/all/test_package/conanfile.py @@ -5,8 +5,9 @@ class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def layout(self): cmake_layout(self) diff --git a/recipes/mpc/config.yml b/recipes/mpc/config.yml index d07c95e5966190..ad477c94d0d7aa 100644 --- a/recipes/mpc/config.yml +++ b/recipes/mpc/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.1": + folder: all "1.2.0": folder: all "1.1.0": diff --git a/recipes/mpfr/all/conandata.yml b/recipes/mpfr/all/conandata.yml index dd4e8f905e5f9a..afd84455cac46a 100644 --- a/recipes/mpfr/all/conandata.yml +++ b/recipes/mpfr/all/conandata.yml @@ -1,11 +1,25 @@ sources: + "4.2.1": + url: "https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.xz" + sha256: "277807353a6726978996945af13e52829e3abd7a9a5b7fb2793894e18f1fcbb2" + "4.2.0": + url: "https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.0.tar.xz" + sha256: "06a378df13501248c1b2db5aa977a2c8126ae849a9d9b7be2546fb4a9c26d993" "4.1.0": - sha256: 3127fe813218f3a1f0adf4e8899de23df33b4cf4b4b3831a5314f78e65ffa2d6 - url: https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.gz + url: "https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz" + sha256: "0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f" "4.0.2": - sha256: ae26cace63a498f07047a784cd3b0e4d010b44d2b193bab82af693de57a19a78 - url: https://ftp.gnu.org/gnu/mpfr/mpfr-4.0.2.tar.gz + url: "https://ftp.gnu.org/gnu/mpfr/mpfr-4.0.2.tar.xz" + sha256: "1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a" patches: + "4.2.1": + - patch_file: "patches/4.2.0-0002-windows-header-dll.patch" + patch_description: "Windows header DLL" + patch_type: "portability" + "4.2.0": + - patch_file: "patches/4.2.0-0002-windows-header-dll.patch" + patch_description: "Windows header DLL" + patch_type: "portability" "4.1.0": - patch_file: "patches/4.1.0-0002-windows-header-dll.patch" patch_description: "Windows header DLL" diff --git a/recipes/mpfr/all/conanfile.py b/recipes/mpfr/all/conanfile.py index 03acd9af8c0815..77727bc0de6380 100644 --- a/recipes/mpfr/all/conanfile.py +++ b/recipes/mpfr/all/conanfile.py @@ -1,32 +1,38 @@ +import os +import re +import shlex + from conan import ConanFile -from conan.tools.files import save, load, copy, get, rmdir, replace_in_file, apply_conandata_patches -from conan.tools.layout import basic_layout +from conan.errors import ConanException +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import ( + apply_conandata_patches, copy, export_conandata_patches, get, load, + replace_in_file, rm, rmdir, save +) from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, check_min_vs, unix_path -from conan.tools.apple import fix_apple_shared_install_name -from conan.errors import ConanException -import os -import re -import shlex required_conan_version = ">=1.58.0" class MpfrConan(ConanFile): name = "mpfr" - package_type = "library" description = "The MPFR library is a C library for multiple-precision floating-point computations with " \ "correct rounding" - topics = ("mpfr", "multiprecision", "math", "mathematics") + license = "LGPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.mpfr.org/" - license = "LGPL-3.0-or-later" + topics = ("multiprecision", "math", "mathematics") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "exact_int": ["mpir", "gmp",], + "exact_int": ["mpir", "gmp"], } default_options = { "shared": False, @@ -34,12 +40,14 @@ class MpfrConan(ConanFile): "exact_int": "gmp", } - exports_sources = "CMakeLists.txt.in", "patches/**" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def export_sources(self): + copy(self, "CMakeLists.txt.in", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") @@ -50,9 +58,15 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + def requirements(self): if self.options.exact_int == "gmp": - self.requires("gmp/6.2.1", transitive_headers=True) + self.requires("gmp/6.3.0", transitive_headers=True) elif self.options.exact_int == "mpir": self.requires("mpir/3.0.0") @@ -62,17 +76,15 @@ def build_requirements(self): if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") - def layout(self): - if self.settings.os == "Windows": - cmake_layout(self, src_folder="src") - else: - basic_layout(self, src_folder="src") - 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): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") if self.settings.os == "Windows": if is_msvc(self) and not check_min_vs(self, 193, raise_invalid=False) and \ not self.conf.get("tools.cmake.cmaketoolchain:generator", check_type=str): @@ -101,7 +113,7 @@ def generate(self): if self.options.exact_int == "mpir": tc.extra_cflags.append(f"-I{self.build_folder}") - if is_msvc(self): + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): tc.extra_cflags.append("-FS") env = tc.environment() @@ -126,9 +138,8 @@ def _extract_mpfr_autotools_variables(self): defs = self._extract_makefile_variable(makefile, "DEFS") return sources, headers, defs - def build(self): + def _patch_sources(self): apply_conandata_patches(self) - if self.settings.os == "Windows": # Allow mixed shared and static libs replace_in_file(self, os.path.join(self.source_folder, "configure"), 'as_fn_error $? "libgmp isn\'t provided as a DLL: use --enable-static --disable-shared" "$LINENO" 5', @@ -144,6 +155,8 @@ def build(self): "", "") save(self, "gmp.h", "#pragma once\n#include \n") + def build(self): + self._patch_sources() autotools = Autotools(self) autotools.configure() # Need to generate Makefile to extract variables for CMake below @@ -164,19 +177,20 @@ def build(self): autotools.make(args=["V=0"]) def package(self): - copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "COPYING.LESSER", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if self.settings.os == "Windows": cmake = CMake(self) cmake.install() else: autotools = Autotools(self) autotools.install() - fix_apple_shared_install_name(self) - os.unlink(os.path.join(self.package_folder, "lib", "libmpfr.la")) rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) def package_info(self): + self.cpp_info.set_property("pkg_config_name", "mpfr") self.cpp_info.libs = ["mpfr"] if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines = ["MPFR_DLL"] diff --git a/recipes/mpfr/all/patches/4.0.2-0001-configure.ac-fixes.patch b/recipes/mpfr/all/patches/4.0.2-0001-configure.ac-fixes.patch deleted file mode 100644 index c6b67dbae98b23..00000000000000 --- a/recipes/mpfr/all/patches/4.0.2-0001-configure.ac-fixes.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- configure.ac -+++ configure.ac -@@ -27,6 +27,7 @@ - - dnl Add check-news when it checks for more than 15 lines - AC_INIT([MPFR],[4.0.2]) -+AC_CANONICAL_TARGET - - dnl Older Automake versions than 1.13 may still be supported, but no longer - dnl tested, and many things have changed in 1.13. Moreover the INSTALL file - ---- acinclude.m4 -+++ acinclude.m4 -@@ -41,7 +41,6 @@ - AC_REQUIRE([AC_OBJEXT]) - AC_REQUIRE([MPFR_CHECK_LIBM]) - AC_REQUIRE([MPFR_CHECK_LIBQUADMATH]) --AC_REQUIRE([AC_HEADER_TIME]) - AC_REQUIRE([AC_CANONICAL_HOST]) - - dnl Features for the MPFR shared cache. This needs to be done diff --git a/recipes/mpfr/all/patches/4.1.0-0001-configure.ac-fixes.patch b/recipes/mpfr/all/patches/4.1.0-0001-configure.ac-fixes.patch deleted file mode 100644 index 888d7d12deb823..00000000000000 --- a/recipes/mpfr/all/patches/4.1.0-0001-configure.ac-fixes.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- configure.ac -+++ configure.ac -@@ -27,6 +27,7 @@ - - dnl Add check-news when it checks for more than 15 lines - AC_INIT([MPFR],[4.1.0]) -+AC_CANONICAL_TARGET - - dnl Older Automake versions than 1.13 may still be supported, but no longer - dnl tested, and many things have changed in 1.13. Moreover the INSTALL file - ---- acinclude.m4 -+++ acinclude.m4 -@@ -40,7 +40,6 @@ - AC_REQUIRE([AC_OBJEXT]) - AC_REQUIRE([MPFR_CHECK_LIBM]) - AC_REQUIRE([MPFR_CHECK_LIBQUADMATH]) --AC_REQUIRE([AC_HEADER_TIME]) - AC_REQUIRE([AC_CANONICAL_HOST]) - - dnl Features for the MPFR shared cache. This needs to be done - diff --git a/recipes/mpfr/all/patches/4.2.0-0002-windows-header-dll.patch b/recipes/mpfr/all/patches/4.2.0-0002-windows-header-dll.patch new file mode 100644 index 00000000000000..8bd309400c5a6a --- /dev/null +++ b/recipes/mpfr/all/patches/4.2.0-0002-windows-header-dll.patch @@ -0,0 +1,27 @@ +--- src/mpfr.h ++++ src/mpfr.h +@@ -319,16 +319,15 @@ + # endif + #endif + +-/* Support for WINDOWS Dll: +- Check if we are inside a MPFR build, and if so export the functions. +- Otherwise does the same thing as GMP */ +-#if defined(__MPFR_WITHIN_MPFR) && __GMP_LIBGMP_DLL +-# define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT +-#else +-# ifndef __GMP_DECLSPEC +-# define __GMP_DECLSPEC ++/* Support for WINDOWS Dll */ ++#if defined(MPFR_DLL) ++# if defined(__MPFR_WITHIN_MPFR) ++# define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT ++# else ++# define __MPFR_DECLSPEC __GMP_DECLSPEC_IMPORT + # endif +-# define __MPFR_DECLSPEC __GMP_DECLSPEC ++#else ++# define __MPFR_DECLSPEC + #endif + + /* Use MPFR_DEPRECATED to mark MPFR functions, types or variables as diff --git a/recipes/mpfr/all/test_package/CMakeLists.txt b/recipes/mpfr/all/test_package/CMakeLists.txt index f4253e8466cb9d..734c455f60d093 100644 --- a/recipes/mpfr/all/test_package/CMakeLists.txt +++ b/recipes/mpfr/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -find_package(mpfr REQUIRED) +find_package(mpfr REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE mpfr::mpfr) diff --git a/recipes/mpfr/all/test_package/conanfile.py b/recipes/mpfr/all/test_package/conanfile.py index c56e8a6249e69a..862d248f1946f8 100644 --- a/recipes/mpfr/all/test_package/conanfile.py +++ b/recipes/mpfr/all/test_package/conanfile.py @@ -1,12 +1,13 @@ from conan import ConanFile +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout -from conan.tools.build import cross_building import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def layout(self): cmake_layout(self) @@ -20,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(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/mpfr/all/test_v1_package/CMakeLists.txt b/recipes/mpfr/all/test_v1_package/CMakeLists.txt index 222d09629eb12c..0d20897301b68b 100644 --- a/recipes/mpfr/all/test_v1_package/CMakeLists.txt +++ b/recipes/mpfr/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.3.0) -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(mpfr CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} mpfr::mpfr) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mpfr/config.yml b/recipes/mpfr/config.yml index 72132855c0cf86..f3d9d2b90378db 100644 --- a/recipes/mpfr/config.yml +++ b/recipes/mpfr/config.yml @@ -1,4 +1,8 @@ versions: + "4.2.1": + folder: all + "4.2.0": + folder: all "4.1.0": folder: all "4.0.2": diff --git a/recipes/mpg123/all/conanfile.py b/recipes/mpg123/all/conanfile.py index 5ff9754f83253b..a4d19cd12463a2 100644 --- a/recipes/mpg123/all/conanfile.py +++ b/recipes/mpg123/all/conanfile.py @@ -83,7 +83,7 @@ def layout(self): def requirements(self): if self.options.module == "libalsa": - self.requires("libalsa/1.2.7.2") + self.requires("libalsa/1.2.10") if self.options.module == "tinyalsa": self.requires("tinyalsa/2.0.0") @@ -96,7 +96,7 @@ def validate(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.3") + self.tool_requires("pkgconf/2.0.3") if self.settings.arch in ["x86", "x86_64"]: self.tool_requires("yasm/1.3.0") if self._settings_build.os == "Windows": @@ -153,7 +153,10 @@ def generate(self): ]) if is_apple_os(self): # Needed for fix_apple_shared_install_name invocation in package method - tc.extra_cflags = ["-headerpad_max_install_names"] + tc.extra_cflags += ["-headerpad_max_install_names"] + # The finite-math-only optimization has no effect and will cause linking errors + # when linked against glibc >= 2.31 + tc.extra_cflags += ["-fno-finite-math-only"] tc.generate() tc = AutotoolsDeps(self) tc.generate() diff --git a/recipes/mpmcqueue/all/conanfile.py b/recipes/mpmcqueue/all/conanfile.py index f31d795bc0cc28..956244df074864 100644 --- a/recipes/mpmcqueue/all/conanfile.py +++ b/recipes/mpmcqueue/all/conanfile.py @@ -13,12 +13,16 @@ class MpmcqueueConan(ConanFile): name = "mpmcqueue" description = "A bounded multi-producer multi-consumer concurrent queue written in C++11." license = "MIT" - topics = ("mpmcqueue", "queue", "concurrency") + topics = ("queue", "concurrency") homepage = "https://github.com/rigtorp/MPMCQueue" url = "https://github.com/conan-io/conan-center-index" + 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() @@ -28,12 +32,8 @@ def validate(self): if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration("gcc < 5 not supported") - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -46,9 +46,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "MPMCQueue") self.cpp_info.set_property("cmake_target_name", "MPMCQueue::MPMCQueue") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "MPMCQueue" diff --git a/recipes/mpmcqueue/all/test_package/conanfile.py b/recipes/mpmcqueue/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/mpmcqueue/all/test_package/conanfile.py +++ b/recipes/mpmcqueue/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt b/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt index e299736630b608..b21cc49efde95c 100644 --- a/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt +++ b/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(MPMCQueue REQUIRED CONFIG) -find_package(Threads REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE MPMCQueue::MPMCQueue Threads::Threads) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mppp/all/conandata.yml b/recipes/mppp/all/conandata.yml index 9c91fb1f269aa4..9dd5ca329ab04d 100644 --- a/recipes/mppp/all/conandata.yml +++ b/recipes/mppp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.0": + url: "https://github.com/bluescarni/mppp/archive/v1.0.0.tar.gz" + sha256: "e58b1a5fb8bdf095261eeb0861c3f46f96c71c4b043d19700e73ce3e4e639268" "0.27": url: "https://github.com/bluescarni/mppp/archive/v0.27.tar.gz" sha256: "a1e04f6605b3242d4361742159cf5ab273162fd7c105c2743a9bebcf44c846c3" @@ -6,6 +9,14 @@ sources: url: "https://github.com/bluescarni/mppp/archive/v0.26.tar.gz" sha256: "4dbfa68802d9a1365eda884f085418afc147d01b7a928e8333e4dcc1c3b3ce9e" patches: + "1.0.0": + - patch_file: "patches/1.0.0-0001-disable-warning-error.patch" + patch_description: "disable the flag for treats warning as errors" + patch_type: "portability" + - patch_file: "patches/1.0.0-0002-remove-fmt-version.patch" + # https://github.com/conan-io/conan/issues/14172 + patch_description: "remove fmt version number from find_package" + patch_type: "conan" "0.27": - patch_file: "patches/0.27-0001-disable-warning-error.patch" patch_description: "disable the flag for treats warning as errors" diff --git a/recipes/mppp/all/conanfile.py b/recipes/mppp/all/conanfile.py index bf3dbe732b8b17..42fab736847a00 100644 --- a/recipes/mppp/all/conanfile.py +++ b/recipes/mppp/all/conanfile.py @@ -61,15 +61,15 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("gmp/6.2.1", transitive_headers=True) + self.requires("gmp/6.3.0", transitive_headers=True) if self.options.with_mpfr: - self.requires("mpfr/4.1.0") + self.requires("mpfr/4.2.0") if self.options.with_mpc: self.requires("mpc/1.2.0") if self.options.with_boost: - self.requires("boost/1.82.0") + self.requires("boost/1.83.0") if self.options.get_safe("with_fmt"): - self.requires("fmt/10.0.0", transitive_headers=True) + self.requires("fmt/10.1.1", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/mppp/all/patches/1.0.0-0001-disable-warning-error.patch b/recipes/mppp/all/patches/1.0.0-0001-disable-warning-error.patch new file mode 100644 index 00000000000000..20284714ba410b --- /dev/null +++ b/recipes/mppp/all/patches/1.0.0-0001-disable-warning-error.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/yacma/YACMACompilerLinkerSettings.cmake b/cmake/yacma/YACMACompilerLinkerSettings.cmake +index edafe6d..218dc1c 100644 +--- a/cmake/yacma/YACMACompilerLinkerSettings.cmake ++++ b/cmake/yacma/YACMACompilerLinkerSettings.cmake +@@ -95,7 +95,7 @@ if(NOT _YACMACompilerLinkerSettingsRun) + # NOTE: enable unconditionally, as it seems like the CMake + # machinery for detecting this fails. Perhaps the source code + # used for checking the flag emits warnings? +- list(APPEND _YACMA_CXX_FLAGS_DEBUG "-Werror") ++# list(APPEND _YACMA_CXX_FLAGS_DEBUG "-Werror") + # New warnings in clang 8. + # NOTE: a few issues with macros here, let's disable for now. + # _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wextra-semi-stmt) +@@ -191,7 +191,7 @@ if(NOT _YACMACompilerLinkerSettingsRun) + # Enable higher warning level than usual. + _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4) + # Treat warnings as errors. +- _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX) ++# _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX) + endif() + + # Set the cache variables. diff --git a/recipes/mppp/all/patches/1.0.0-0002-remove-fmt-version.patch b/recipes/mppp/all/patches/1.0.0-0002-remove-fmt-version.patch new file mode 100644 index 00000000000000..b05a5e6c9a4422 --- /dev/null +++ b/recipes/mppp/all/patches/1.0.0-0002-remove-fmt-version.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5cea04c..81337b2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -419,7 +419,7 @@ endif() + # to print 128-bit integers. + set(_MPPP_MIN_FMT_VERSION "6.2") + if(MPPP_WITH_FMT) +- find_package(fmt ${_MPPP_MIN_FMT_VERSION} REQUIRED CONFIG) ++ find_package(fmt REQUIRED CONFIG) + message(STATUS "fmt version: ${fmt_VERSION}") + target_link_libraries(mp++ PUBLIC fmt::fmt) + endif() diff --git a/recipes/mppp/config.yml b/recipes/mppp/config.yml index d4d8ae20a50d8d..02775a2352146c 100644 --- a/recipes/mppp/config.yml +++ b/recipes/mppp/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.0": + folder: all "0.27": folder: all "0.26": diff --git a/recipes/ms-gsl/all/conanfile.py b/recipes/ms-gsl/all/conanfile.py index 1f2447a4480af3..22f61968c9ba8a 100644 --- a/recipes/ms-gsl/all/conanfile.py +++ b/recipes/ms-gsl/all/conanfile.py @@ -5,7 +5,6 @@ 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 check_min_vs, is_msvc from conan.tools.scm import Version required_conan_version = ">=1.50.0" @@ -19,6 +18,7 @@ class MicrosoftGslConan(ConanFile): license = "MIT" topics = ("gsl", "guidelines", "core", "span") no_copy_source = True + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "on_contract_violation": ["terminate", "throw", "unenforced"] @@ -45,6 +45,8 @@ def _compilers_minimum_version(self): "gcc": "5", "clang": "3.4", "apple-clang": "3.4", + "msvc": "190", + "Visual Studio": "14", } def config_options(self): @@ -58,24 +60,17 @@ def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._minimum_cpp_standard) - check_min_vs(self, "190") - - if not is_msvc(self): - 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( - f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not fully support.") - else: - self.output.warn(f"{self.ref} requires C++{self._minimum_cpp_standard}. " - "Your compiler is unknown. Assuming it supports C++{self._minimum_cpp_standard}.") + 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._minimum_cpp_standard}, which your compiler does not fully support." + ) def layout(self): basic_layout(self, src_folder="src") 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): pass @@ -90,16 +85,21 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "Microsoft.GSL") self.cpp_info.set_property("cmake_target_name", "Microsoft.GSL::GSL") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: back to global scope once support for legacy generators dropped + if Version(self.version) < "3.0.0": + self.cpp_info.components["_ms-gsl"].defines = [ + self._contract_map[str(self.options.on_contract_violation)] + ] - self.cpp_info.filenames["cmake_find_package"] = "Microsoft.GSL" - self.cpp_info.filenames["cmake_find_package_multi"] = "Microsoft.GSL" + # TODO: to remove once support for legacy generators dropped self.cpp_info.names["cmake_find_package"] = "Microsoft.GSL" self.cpp_info.names["cmake_find_package_multi"] = "Microsoft.GSL" self.cpp_info.components["_ms-gsl"].names["cmake_find_package"] = "GSL" self.cpp_info.components["_ms-gsl"].names["cmake_find_package_multi"] = "GSL" - - if Version(self.version) < "3.0.0": - self.cpp_info.components["_ms-gsl"].defines = [ - self._contract_map[str(self.options.on_contract_violation)] - ] + self.cpp_info.components["_ms-gsl"].set_property("cmake_target_name", "Microsoft.GSL::GSL") + self.cpp_info.components["_ms-gsl"].bindirs = [] + self.cpp_info.components["_ms-gsl"].libdirs = [] diff --git a/recipes/msgpack-c/all/conandata.yml b/recipes/msgpack-c/all/conandata.yml index dc158b2bf02e6a..0062926e73ac99 100644 --- a/recipes/msgpack-c/all/conandata.yml +++ b/recipes/msgpack-c/all/conandata.yml @@ -8,3 +8,6 @@ sources: "4.0.0": url: "https://github.com/msgpack/msgpack-c/releases/download/c-4.0.0/msgpack-c-4.0.0.tar.gz" sha256: "420fe35e7572f2a168d17e660ef981a589c9cbe77faa25eb34a520e1fcc032c8" + "3.3.0": + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-3.3.0/msgpack-3.3.0.tar.gz" + sha256: "6e114d12a5ddb8cb11f669f83f32246e484a8addd0ce93f274996f1941c1f07b" diff --git a/recipes/msgpack-c/config.yml b/recipes/msgpack-c/config.yml index c43afaf0f726ab..08e152a5c47d06 100644 --- a/recipes/msgpack-c/config.yml +++ b/recipes/msgpack-c/config.yml @@ -5,3 +5,5 @@ versions: folder: all "4.0.0": folder: all + "3.3.0": + folder: all diff --git a/recipes/msgpack-cxx/all/conandata.yml b/recipes/msgpack-cxx/all/conandata.yml index 64a5e6f43e3e63..6af577efebddf0 100644 --- a/recipes/msgpack-cxx/all/conandata.yml +++ b/recipes/msgpack-cxx/all/conandata.yml @@ -1,22 +1,25 @@ sources: + "6.1.0": + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-6.1.0/msgpack-cxx-6.1.0.tar.gz" + sha256: "23ede7e93c8efee343ad8c6514c28f3708207e5106af3b3e4969b3a9ed7039e7" "6.0.0": - url: "https://github.com/msgpack/msgpack-c/archive/cpp-6.0.0.tar.gz" - sha256: "d02f7ffd28b1d38ab9f5f758c4744fadfae92150461fb8154c98ac49226cff90" + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-6.0.0/msgpack-cxx-6.0.0.tar.gz" + sha256: "0948d2db98245fb97b9721cfbc3e44c1b832e3ce3b8cfd7485adc368dc084d14" "5.0.0": - url: "https://github.com/msgpack/msgpack-c/archive/cpp-5.0.0.tar.gz" - sha256: "bd6b8e255f0a62cf8f50f1d292f979ac8ea9a4aa121938679d6f419d6df70ea3" + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-5.0.0/msgpack-cxx-5.0.0.tar.gz" + sha256: "80f997575acff12b1b64158ef9dbad4cff32595f985532e16c6ea67e317452d5" "4.1.3": - url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.3.tar.gz" - sha256: "fd0a685656f11b8aa09ed33bcbdcad3105d25d0034ca3dba9fe957623a42d253" + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-4.1.3/msgpack-cxx-4.1.3.tar.gz" + sha256: "2539075ea2f35c15cab5c50ecba00d76fc4cbdcd485840257f15ebb04e8e3e1a" "4.1.2": - url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.2.tar.gz" - sha256: "7460ad43552c9d9b56a75f20e1f4fedf18fff1c48715d6cfa91d779b26ca3795" + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-4.1.2/msgpack-cxx-4.1.2.tar.gz" + sha256: "eeddd7faeacbc12e10052bd1e3ec78bd26c69bfbbea9f9264c7ffce9b1ede7b1" "4.1.1": - url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.1.tar.gz" - sha256: "221cc539e77f5ca02f4f0bbb1edafa9ca8c08de7ba8072d7baf2139930d99182" + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-4.1.1/msgpack-cxx-4.1.1.tar.gz" + sha256: "8115c5edcf20bc1408c798a6bdaec16c1e52b1c34859d4982a0fb03300438f0b" "4.1.0": - url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.0.tar.gz" - sha256: "634762502a192026bd5db773f9e18d900ad04cfc312b52faee350a5c76e5ccfb" + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-4.1.0/msgpack-cxx-4.1.0.tar.gz" + sha256: "11e042ffdafda6fc4ebdc5f4f63b352229b89796c2f8aa3e813116ec1dd8377d" "4.0.3": - url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.0.3.tar.gz" - sha256: "23d737b1e959dfb6ca420564563f098e758adacc0b18003c56abf1b945bd1d4a" + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-4.0.3/msgpack-cxx-4.0.3.tar.gz" + sha256: "9b3c1803b9855b7b023d7f181f66ebb0d6941275ba41d692037e0aa27736443f" diff --git a/recipes/msgpack-cxx/all/conanfile.py b/recipes/msgpack-cxx/all/conanfile.py index 2bcaa82b381e69..8d22fa5798373b 100644 --- a/recipes/msgpack-cxx/all/conanfile.py +++ b/recipes/msgpack-cxx/all/conanfile.py @@ -34,7 +34,7 @@ def layout(self): def requirements(self): if self.options.get_safe("use_boost", True): - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") def package_id(self): self.info.clear() @@ -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/msgpack-cxx/config.yml b/recipes/msgpack-cxx/config.yml index 1c632d41b23dd6..934a0432a27c72 100644 --- a/recipes/msgpack-cxx/config.yml +++ b/recipes/msgpack-cxx/config.yml @@ -1,4 +1,6 @@ versions: + "6.1.0": + folder: all "6.0.0": folder: all "5.0.0": 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/mtdev/all/conandata.yml b/recipes/mtdev/all/conandata.yml new file mode 100644 index 00000000000000..62fe05ee3b5180 --- /dev/null +++ b/recipes/mtdev/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.6": + url: "https://bitmath.org/code/mtdev/mtdev-1.1.6.tar.gz" + sha256: "1325f389a2f25cd5f5a8ea4d29aad24aa7c3ec30401d679400dd79eb9c0a8dbb" diff --git a/recipes/mtdev/all/conanfile.py b/recipes/mtdev/all/conanfile.py new file mode 100644 index 00000000000000..530c1ccfb8d105 --- /dev/null +++ b/recipes/mtdev/all/conanfile.py @@ -0,0 +1,70 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.54.0" + + +class MtdevConan(ConanFile): + name = "mtdev" + description = "The mtdev library transforms all variants of kernel MT events to the slotted type B protocol." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://bitmath.org/code/mtdev/" + topics = ("device", "freedesktop", "input", "mt", "multitouch", "touch") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + 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 build_requirements(self): + self.tool_requires("libtool/2.4.7") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + + def build(self): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["mtdev"] diff --git a/recipes/mtdev/all/test_package/CMakeLists.txt b/recipes/mtdev/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..bfa4f8ba62c05c --- /dev/null +++ b/recipes/mtdev/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(mtdev REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mtdev::mtdev) diff --git a/recipes/mtdev/all/test_package/conanfile.py b/recipes/mtdev/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/mtdev/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/mtdev/all/test_package/test_package.c b/recipes/mtdev/all/test_package/test_package.c new file mode 100644 index 00000000000000..8cce2788bfac4a --- /dev/null +++ b/recipes/mtdev/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include "mtdev.h" + + +int main(void) { + mtdev_close(NULL); + return EXIT_SUCCESS; +} diff --git a/recipes/mtdev/config.yml b/recipes/mtdev/config.yml new file mode 100644 index 00000000000000..42b92d9f27e7f9 --- /dev/null +++ b/recipes/mtdev/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.6": + folder: all diff --git a/recipes/namedtype/all/conanfile.py b/recipes/namedtype/all/conanfile.py index ff8826be0c227e..14c646bee4f479 100644 --- a/recipes/namedtype/all/conanfile.py +++ b/recipes/namedtype/all/conanfile.py @@ -1,13 +1,14 @@ 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 copy, get from conan.tools.layout import basic_layout from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.50.0" + class NamedTypeConan(ConanFile): name = "namedtype" @@ -17,7 +18,7 @@ class NamedTypeConan(ConanFile): description = "Implementation of strong types in C++" topics = ("strong types", "header-only") package_type = "header-library" - settings = "compiler" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property @@ -28,15 +29,12 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "Visual Studio": "15", - "msvc": "14.1", + "msvc": "191", "gcc": "5", "clang": "3.4", "apple-clang": "5.1", } - def export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") @@ -55,9 +53,6 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - apply_conandata_patches(self) - def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if self.version == "20190324": @@ -76,5 +71,7 @@ def package(self): ) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] if self.version == "20190324": self.cpp_info.includedirs.append(os.path.join("include", "NamedType")) diff --git a/recipes/namedtype/all/test_package/CMakeLists.txt b/recipes/namedtype/all/test_package/CMakeLists.txt index a56821d0dc1a63..c88bbff306fb55 100644 --- a/recipes/namedtype/all/test_package/CMakeLists.txt +++ b/recipes/namedtype/all/test_package/CMakeLists.txt @@ -3,6 +3,6 @@ project(test_package LANGUAGES CXX) find_package(namedtype REQUIRED CONFIG) -add_executable(${PROJECT_NAME} main.cpp) +add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE namedtype::namedtype) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/namedtype/all/test_package/main.cpp b/recipes/namedtype/all/test_package/test_package.cpp similarity index 100% rename from recipes/namedtype/all/test_package/main.cpp rename to recipes/namedtype/all/test_package/test_package.cpp diff --git a/recipes/nanobench/all/conanfile.py b/recipes/nanobench/all/conanfile.py index 67a58bc871cff0..7697075d83fd11 100644 --- a/recipes/nanobench/all/conanfile.py +++ b/recipes/nanobench/all/conanfile.py @@ -14,6 +14,7 @@ class NanobenchConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinus/nanobench" topics = ("benchmark", "microbenchmark", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @property diff --git a/recipes/nanodbc/all/conandata.yml b/recipes/nanodbc/all/conandata.yml index 7a0d0542f3be6a..c6835a8c270b4b 100644 --- a/recipes/nanodbc/all/conandata.yml +++ b/recipes/nanodbc/all/conandata.yml @@ -1,24 +1,18 @@ sources: - "cci.20200807": - url: "https://github.com/nanodbc/nanodbc/archive/ab8d176262f92d5f75aa2d441bfce27041032201.zip" - sha256: "9de057ae6e8d0b9192df1d16ccc70ce7525ca9fe52e56fa8d13cfae9206f8286" - "2.13.0": - url: "https://github.com/nanodbc/nanodbc/archive/v2.13.0.zip" - sha256: "1287869b6ca82728cb6cc53c54f836c72cde15370c16f32d81c9ef6c257f7e43" "2.14.0": url: "https://github.com/nanodbc/nanodbc/archive/v2.14.0.tar.gz" sha256: "56228372042b689beccd96b0ac3476643ea85b3f57b3f23fb11ca4314e68b9a5" + "2.13.0": + url: "https://github.com/nanodbc/nanodbc/archive/v2.13.0.zip" + sha256: "1287869b6ca82728cb6cc53c54f836c72cde15370c16f32d81c9ef6c257f7e43" patches: - "cci.20200807": + "2.14.0": - patch_file: "patches/0001-odbc-from-cci.patch" patch_description: "Allow compilation on CI with ODBC library" patch_type: "portability" - patch_file: "patches/0002-allow-windows-shared.patch" patch_description: "Allow windows to compile shared libraries" patch_type: "portability" - - patch_file: "patches/0003-add-missing-include.patch" - patch_description: "Add missing include to fix compilation for v2.13 and v20200807" - patch_type: "portability" "2.13.0": - patch_file: "patches/0001-odbc-from-cci.patch" patch_description: "Allow compilation on CI with ODBC library" @@ -27,12 +21,5 @@ patches: patch_description: "Allow windows to compile shared libraries" patch_type: "portability" - patch_file: "patches/0003-add-missing-include.patch" - patch_description: "Add missing include to fix compilation for v2.13 and v20200807" - patch_type: "portability" - "2.14.0": - - patch_file: "patches/0001-odbc-from-cci.patch" - patch_description: "Allow compilation on CI with ODBC library" - patch_type: "portability" - - patch_file: "patches/0002-allow-windows-shared.patch" - patch_description: "Allow windows to compile shared libraries" + patch_description: "Add missing include to fix compilation" patch_type: "portability" diff --git a/recipes/nanodbc/all/conanfile.py b/recipes/nanodbc/all/conanfile.py index e2bd806901885d..c0ece807489787 100644 --- a/recipes/nanodbc/all/conanfile.py +++ b/recipes/nanodbc/all/conanfile.py @@ -2,18 +2,21 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout -from conan.tools.files import get, apply_conandata_patches, export_conandata_patches, rmdir, copy +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir from conan.tools.scm import Version import os +required_conan_version = ">=1.53.0" + + class NanodbcConan(ConanFile): name = "nanodbc" description = "A small C++ wrapper for the native C ODBC API" - topics = ("conan", "nanodbc", "odbc", "database") + topics = ("odbc", "database") license = "MIT" homepage = "https://github.com/nanodbc/nanodbc/" - package_type = "library" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,25 +33,24 @@ class NanodbcConan(ConanFile): "with_boost": False, } + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - def export_sources(self): - export_conandata_patches(self) - - def layout(self): - cmake_layout(self, src_folder="src") - def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def layout(self): + cmake_layout(self, src_folder="src") + @property def _min_cppstd(self): return 14 - + @property def _compilers_minimum_version(self): return { @@ -59,6 +61,12 @@ def _compilers_minimum_version(self): "apple-clang": "9.1", # FIXME: this is a guess } + def requirements(self): + if self.options.with_boost: + self.requires("boost/1.83.0") + if self.settings.os != "Windows": + self.requires("odbc/2.3.11") + def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, 14) @@ -69,18 +77,12 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) - if self.settings.compiler == "apple-clang" and Version(self.version) != "2.14.0": + if self.settings.compiler == "apple-clang" and Version(self.version) < "2.14.0": raise ConanInvalidConfiguration(""" `apple-clang` compilation is supported only for version 2.14.0 and up. See https://github.com/nanodbc/nanodbc/issues/274 for more details. """) - def requirements(self): - if self.options.with_boost: - self.requires("boost/1.76.0") - if self.settings.os != "Windows": - self.requires("odbc/2.3.9") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -95,13 +97,17 @@ def generate(self): tc.cache_variables["NANODBC_DISABLE_TESTS"] = True tc.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() - + deps = CMakeDeps(self) deps.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + # No warnings as errors + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-Werror", "") + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -116,6 +122,8 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "nanodbc") + self.cpp_info.set_property("cmake_target_name", "nanodbc::nanodbc") self.cpp_info.libs = ["nanodbc"] if not self.options.shared and self.settings.os == "Windows": diff --git a/recipes/nanodbc/all/test_package/CMakeLists.txt b/recipes/nanodbc/all/test_package/CMakeLists.txt index 2b2d9256562615..0f37b02603638f 100644 --- a/recipes/nanodbc/all/test_package/CMakeLists.txt +++ b/recipes/nanodbc/all/test_package/CMakeLists.txt @@ -5,4 +5,4 @@ find_package(nanodbc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE nanodbc::nanodbc) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/nanodbc/all/test_package/conanfile.py b/recipes/nanodbc/all/test_package/conanfile.py index c1e9a5dd84db0a..9153dc938c4846 100644 --- a/recipes/nanodbc/all/test_package/conanfile.py +++ b/recipes/nanodbc/all/test_package/conanfile.py @@ -6,6 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def layout(self): cmake_layout(self) diff --git a/recipes/nanodbc/config.yml b/recipes/nanodbc/config.yml index 35d045402c05f1..ccdd596aaff35a 100644 --- a/recipes/nanodbc/config.yml +++ b/recipes/nanodbc/config.yml @@ -1,7 +1,5 @@ versions: - "cci.20200807": + "2.14.0": folder: "all" "2.13.0": folder: "all" - "2.14.0": - folder: "all" diff --git a/recipes/nanoflann/all/conandata.yml b/recipes/nanoflann/all/conandata.yml index b6d2b6c2d459bc..f8c576a4749fe4 100644 --- a/recipes/nanoflann/all/conandata.yml +++ b/recipes/nanoflann/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.2": + url: "https://github.com/jlblancoc/nanoflann/archive/v1.5.2.tar.gz" + sha256: "2adcea7821445119a7a4f83c27abd56dba963e1e9c05a3f58bdb2273ae1b4698" "1.5.0": url: "https://github.com/jlblancoc/nanoflann/archive/v1.5.0.tar.gz" sha256: "89aecfef1a956ccba7e40f24561846d064f309bc547cc184af7f4426e42f8e65" diff --git a/recipes/nanoflann/all/conanfile.py b/recipes/nanoflann/all/conanfile.py index 5e499d9aae48d0..47bfe18256ddd5 100644 --- a/recipes/nanoflann/all/conanfile.py +++ b/recipes/nanoflann/all/conanfile.py @@ -13,13 +13,17 @@ class NanoflannConan(ConanFile): of datasets with different topologies: R2, R3 (point clouds), SO(2) and SO(3) (2D and 3D rotation groups). """ - topics = ("nanoflann", "nearest-neighbor", "kd-trees") + topics = ("flann", "nearest-neighbor", "kd-trees") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jlblancoc/nanoflann" license = "BSD-2-Clause" + 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() @@ -27,12 +31,8 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -47,6 +47,4 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "nanoflann::nanoflann") self.cpp_info.set_property("pkg_config_name", "nanoflann") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/nanoflann/all/test_package/conanfile.py b/recipes/nanoflann/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/nanoflann/all/test_package/conanfile.py +++ b/recipes/nanoflann/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/nanoflann/config.yml b/recipes/nanoflann/config.yml index 6332b5bdd94938..42431fc83ed1ec 100644 --- a/recipes/nanoflann/config.yml +++ b/recipes/nanoflann/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.2": + folder: "all" "1.5.0": folder: "all" "1.4.3": 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/nas/all/conanfile.py b/recipes/nas/all/conanfile.py index a6ece9857a5b29..5a3dcf12eeb770 100644 --- a/recipes/nas/all/conanfile.py +++ b/recipes/nas/all/conanfile.py @@ -3,7 +3,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.layout import basic_layout from conan.tools.env import VirtualBuildEnv -from conan.tools.files import chdir, get, download, export_conandata_patches, apply_conandata_patches, rm, copy +from conan.tools.files import chdir, get, export_conandata_patches, apply_conandata_patches, rm, copy, load, save from conan.tools.gnu import AutotoolsToolchain, Autotools, AutotoolsDeps import os @@ -17,7 +17,7 @@ class NasRecipe(ConanFile): topics = ("audio", "sound") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.radscan.com/nas.html" - license = "Unlicense" + license = "DocumentRef-wave.h:LicenseRef-MIT-advertising" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -61,8 +61,6 @@ def build_requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version][0], strip_root=True) - # This library does not come with a License file by itself, package it from an external source - download(self, filename="LICENSE", **self.conan_data["sources"][self.version][1]) @property def _user_info_build(self): @@ -107,8 +105,16 @@ def build(self): # j1 avoids some errors while trying to run this target autotools.make(target="World", args=["-j1"] + self._imake_make_args) + def _extract_license(self): + header = "Copyright 1995" + footer = "Translation: You can do whatever you want with this software!" + nas_audio = load(self, os.path.join(self.source_folder, "README")) + begin = nas_audio.find(header) + end = nas_audio.find(footer, begin) + return nas_audio[begin:end] + def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) tmp_install = os.path.join(self.build_folder, "prefix") self.output.warning(tmp_install) diff --git a/recipes/nasm/all/conanfile.py b/recipes/nasm/all/conanfile.py index 25d5fec8b82ba4..f570e673ace4db 100644 --- a/recipes/nasm/all/conanfile.py +++ b/recipes/nasm/all/conanfile.py @@ -17,7 +17,7 @@ class NASMConan(ConanFile): homepage = "http://www.nasm.us" description = "The Netwide Assembler, NASM, is an 80x86 and x86-64 assembler" license = "BSD-2-Clause" - topics = ("nasm", "installer", "assembler") + topics = ("asm", "installer", "assembler",) settings = "os", "arch", "compiler", "build_type" @@ -25,6 +25,20 @@ class NASMConan(ConanFile): def _settings_build(self): return getattr(self, "settings_build", self.settings) + @property + def _nasm(self): + suffix = "w.exe" if is_msvc(self) else "" + return os.path.join(self.package_folder, "bin", f"nasm{suffix}") + + @property + def _ndisasm(self): + suffix = "w.exe" if is_msvc(self) else "" + return os.path.join(self.package_folder, "bin", f"ndisasm{suffix}") + + def _chmod_plus_x(self, filename): + if os.name == "posix": + os.chmod(filename, os.stat(filename).st_mode | 0o111) + def export_sources(self): export_conandata_patches(self) @@ -94,10 +108,21 @@ def package(self): autotools = Autotools(self) autotools.install() rmdir(self, os.path.join(self.package_folder, "share")) + self._chmod_plus_x(self._nasm) + self._chmod_plus_x(self._ndisasm) def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] + compiler_executables = {"asm": self._nasm} + self.conf_info.update("tools.build:compiler_executables", compiler_executables) + self.buildenv_info.define_path("NASM", self._nasm) + self.buildenv_info.define_path("NDISASM", self._ndisasm) + self.buildenv_info.define_path("AS", self._nasm) + # TODO: Legacy, to be removed on Conan 2.0 self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.NASM = self._nasm + self.env_info.NDISASM = self._ndisasm + self.env_info.AS = self._nasm diff --git a/recipes/ncurses/all/cmake/conan-official-ncurses-targets.cmake b/recipes/ncurses/all/cmake/conan-official-ncurses-targets.cmake new file mode 100644 index 00000000000000..c890b5d0ddfab5 --- /dev/null +++ b/recipes/ncurses/all/cmake/conan-official-ncurses-targets.cmake @@ -0,0 +1,36 @@ +# Reproduces the variables set by https://cmake.org/cmake/help/latest/module/FindCurses.html +set(CURSES_FOUND ON) +set(CURSES_INCLUDE_DIRS ${Curses_INCLUDE_DIRS}) +set(CURSES_CFLAGS ${Curses_DEFINITIONS} ${Curses_COMPILE_OPTIONS_C}) +set(CURSES_HAVE_CURSES_H OFF) +set(CURSES_HAVE_NCURSES_H OFF) +if(CURSES_NEED_NCURSES) + set(CURSES_HAVE_NCURSES_CURSES_H ON) + set(CURSES_HAVE_NCURSES_NCURSES_H ON) +endif() + +# For backward compatibility with Conan v1 +string(TOUPPER "${CMAKE_BUILD_TYPE}" _CONFIG) +set(CURSES_INCLUDE_DIRS ${CURSES_INCLUDE_DIRS} + ${ncurses_INCLUDE_DIRS_${_CONFIG}} + ${Curses_INCLUDE_DIRS_${_CONFIG}} +) +set(CURSES_CFLAGS ${CURSES_CFLAGS} + ${ncurses_DEFINITIONS_${_CONFIG}} ${ncurses_COMPILE_OPTIONS_C_${_CONFIG}} + ${Curses_DEFINITIONS_${_CONFIG}} ${Curses_COMPILE_OPTIONS_C_${_CONFIG}} +) + +# CURSES_LIBRARIES output from CMake uses absolute paths for the libraries +list (GET CURSES_INCLUDE_DIRS 0 _first_include_dir) +get_filename_component(CURSES_LIB_DIRS "${_first_include_dir}/../lib" ABSOLUTE) +foreach(_LIB ${Curses_LIBRARIES} ${ncurses_LIBRARIES_${_CONFIG}} ${Curses_LIBRARIES_${_CONFIG}}) + if(TARGET ${_LIB} OR IS_ABSOLUTE ${_LIB}) + list(APPEND CURSES_LIBRARIES ${_LIB}) + else() + find_library(_LIB ${_LIB} PATHS ${CURSES_LIB_DIRS}) + list(APPEND CURSES_LIBRARIES ${_LIB}) + endif() +endforeach() + +set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_DIRS}) +set(CURSES_LIBRARY ${CURSES_LIBRARIES}) diff --git a/recipes/ncurses/all/conanfile.py b/recipes/ncurses/all/conanfile.py index 3adc44c41e54ca..0e692c25e72498 100644 --- a/recipes/ncurses/all/conanfile.py +++ b/recipes/ncurses/all/conanfile.py @@ -1,21 +1,29 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import contextlib -import functools import os -import textwrap -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 cross_building, stdcpp_library +from conan.tools.env import Environment +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, unix_path +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class NCursesConan(ConanFile): name = "ncurses" description = "The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0 (SVr4), and more" - topics = ("ncurses", "terminal", "screen", "tui") + license = "X11" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.gnu.org/software/ncurses" - license = "X11" - settings = "os", "compiler", "build_type", "arch" + topics = ("terminal", "screen", "tui") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -41,90 +49,85 @@ class NCursesConan(ConanFile): "with_pcre2": False, } - generators = "pkg_config" - exports_sources = "patches/*" - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @property - def _with_ticlib(self): - if self.options.with_ticlib == "auto": - return self.settings.os != "Windows" - else: - return self.options.with_ticlib + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" - @property - def _with_tinfo(self): - if self.options.with_tinfo == "auto": - return self.settings.os != "Windows" - else: - return self.options.with_tinfo + def export_sources(self): + export_conandata_patches(self) + copy(self, "*.cmake", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + # Set the default value based on OS + self.options.with_ticlib = self.settings.os != "Windows" + self.options.with_tinfo = self.settings.os != "Windows" def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.with_cxx: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") if not self.options.with_widec: - del self.options.with_extended_colors + self.options.rm_safe("with_extended_colors") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_pcre2: - self.requires("pcre2/10.37") - if self.settings.compiler == "Visual Studio": + self.requires("pcre2/10.42") + if is_msvc(self): self.requires("getopt-for-visual-studio/20200201") - self.requires("dirent/1.23.2") - if self.options.get_safe("with_extended_colors", False): + self.requires("dirent/1.24") + if self.options.get_safe("with_extended_colors"): self.requires("naive-tsearch/0.1.1") - def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - def validate(self): - if any("arm" in arch for arch in (self.settings.arch, self._settings_build.arch)) and tools.cross_building(self): + if cross_building(self) and ("arm" in str(self.settings.arch) or "arm" in str(self._settings_build.arch)): # FIXME: Cannot build ncurses from x86_64 to armv8 (Apple M1). Cross building from Linux/x86_64 to Mingw/x86_64 works flawless. # FIXME: Need access to environment of build profile to set build compiler (BUILD_CC/CC_FOR_BUILD) raise ConanInvalidConfiguration("Cross building to/from arm is (currently) not supported") - if self.options.shared and self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime: + if self.options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Cannot build shared libraries with static (MT) runtime") if self.settings.os == "Windows": - if self._with_tinfo: + if self.options.with_tinfo: raise ConanInvalidConfiguration("terminfo cannot be built on Windows because it requires a term driver") - if self.options.shared and self._with_ticlib: + if self.options.shared and self.options.with_ticlib: raise ConanInvalidConfiguration("ticlib cannot be built separately as a shared library on Windows") + def build_requirements(self): + 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") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + 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_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + def generate(self): + tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" - conf_args = [ + tc.configure_args += [ "--with-shared={}".format(yes_no(self.options.shared)), "--with-cxx-shared={}".format(yes_no(self.options.shared)), "--with-normal={}".format(yes_no(not self.options.shared)), "--enable-widec={}".format(yes_no(self.options.with_widec)), - "--enable-ext-colors={}".format(yes_no(self.options.get_safe("with_extended_colors", False))), + "--enable-ext-colors={}".format(yes_no(self.options.get_safe("with_extended_colors"))), "--enable-reentrant={}".format(yes_no(self.options.with_reentrant)), "--with-pcre2={}".format(yes_no(self.options.with_pcre2)), "--with-cxx-binding={}".format(yes_no(self.options.with_cxx)), "--with-progs={}".format(yes_no(self.options.with_progs)), - "--with-termlib={}".format(yes_no(self._with_tinfo)), - "--with-ticlib={}".format(yes_no(self._with_ticlib)), + "--with-termlib={}".format(yes_no(self.options.with_tinfo)), + "--with-ticlib={}".format(yes_no(self.options.with_ticlib)), "--without-libtool", "--without-ada", "--without-manpages", @@ -134,108 +137,118 @@ def _configure_autotools(self): "--without-profile", "--with-sp-funcs", "--disable-rpath", - "--datarootdir={}".format(tools.unix_path(os.path.join(self.package_folder, "res"))), "--disable-pc-files", + "--datarootdir=${prefix}/res", ] build = None host = None if self.settings.os == "Windows": - conf_args.extend([ + tc.configure_args += [ "--disable-macros", "--disable-termcap", "--enable-database", "--enable-sp-funcs", "--enable-term-driver", "--enable-interop", - ]) - if self.settings.compiler == "Visual Studio": - build = host = "{}-w64-mingw32-msvc".format(self.settings.arch) - conf_args.extend([ + ] + if is_msvc(self): + build = host = f"{self.settings.arch}-w64-mingw32-msvc" + tc.configure_args += [ "ac_cv_func_getopt=yes", "ac_cv_func_setvbuf_reversed=no", - ]) - autotools.cxx_flags.append("-EHsc") - if tools.Version(self.settings.compiler.version) >= 12: - autotools.flags.append("-FS") - if (self.settings.os, self.settings.compiler) == ("Windows", "gcc"): + ] + # The env vars below are used by ./configure, but not during make + tc.make_args += [ + "CC=cl -nologo", + "CPP=cl -nologo -E", + ] + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.extra_cxxflags.append("-EHsc") + if self.options.get_safe("with_extended_colors"): + tc.extra_cflags.append(" ".join(f"-I{dir}" for dir in self.dependencies["naive-tsearch"].cpp_info.includedirs)) + tc.extra_ldflags.append(" ".join(f"-l{lib}" for lib in self.dependencies["naive-tsearch"].cpp_info.libs)) + if self._is_mingw: # add libssp (gcc support library) for some missing symbols (e.g. __strcpy_chk) - autotools.libs.extend(["mingwex", "ssp"]) + tc.extra_ldflags.extend(["-lmingwex", "-lssp"]) if build: - conf_args.append(f"ac_cv_build={build}") + tc.configure_args.append(f"ac_cv_build={build}") if host: - conf_args.append(f"ac_cv_host={host}") - conf_args.append(f"ac_cv_target={host}") - autotools.configure(args=conf_args, configure_dir=self._source_subfolder, host=host, build=build) - return autotools - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "cl -nologo", - "CXX": "cl -nologo", - "LD": "link -nologo", - "LDFLAGS": "", - "NM": "dumpbin -symbols", - "STRIP": ":", - "AR": "lib -nologo", - "RANLIB": ":", - } - with tools.environment_append(env): - yield - else: - yield + tc.configure_args.append(f"ac_cv_host={host}") + tc.configure_args.append(f"ac_cv_target={host}") + # Allow ncurses to set the include dir with an appropriate subdir + tc.configure_args.remove("--includedir=${prefix}/include") + tc.generate() + + if is_msvc(self): + env = Environment() + env.define("CC", "cl -nologo -FS") + env.define("CXX", "cl -nologo -FS") + env.define("LD", "link") + env.define("AR", "lib") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") + + if is_msvc(self): + # Custom AutotoolsDeps for cl like compilers + # workaround for https://github.com/conan-io/conan/issues/12784 + includedirs = [] + defines = [] + libs = [] + libdirs = [] + linkflags = [] + cxxflags = [] + cflags = [] + for dependency in self.dependencies.values(): + deps_cpp_info = dependency.cpp_info.aggregated_components() + includedirs.extend(deps_cpp_info.includedirs) + defines.extend(deps_cpp_info.defines) + libs.extend(deps_cpp_info.libs + deps_cpp_info.system_libs) + libdirs.extend(deps_cpp_info.libdirs) + linkflags.extend(deps_cpp_info.sharedlinkflags + deps_cpp_info.exelinkflags) + cxxflags.extend(deps_cpp_info.cxxflags) + cflags.extend(deps_cpp_info.cflags) + env = Environment() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in includedirs] + [f"-D{d}" for d in defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in libs]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in libdirs] + linkflags) + env.append("CXXFLAGS", cxxflags) + env.append("CFLAGS", cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + + deps = PkgConfigDeps(self) + deps.generate() def build(self): - self._patch_sources() - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() @property def _major_version(self): - return tools.Version(self.version).major - - @staticmethod - def _create_cmake_module_alias_targets(module_file): - tools.save(module_file, textwrap.dedent("""\ - set(CURSES_FOUND ON) - set(CURSES_INCLUDE_DIRS ${ncurses_libcurses_INCLUDE_DIRS}) - set(CURSES_LIBRARIES ${ncurses_libcurses_LINK_LIBS}) - set(CURSES_CFLAGS ${ncurses_DEFINITIONS} ${ncurses_COMPILE_OPTIONS_C}) - set(CURSES_HAVE_CURSES_H OFF) - set(CURSES_HAVE_NCURSES_H OFF) - if(CURSES_NEED_NCURSES) - set(CURSES_HAVE_NCURSES_CURSES_H ON) - set(CURSES_HAVE_NCURSES_NCURSES_H ON) - endif() - - # Backward Compatibility - set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_DIRS}) - set(CURSES_LIBRARY ${CURSES_LIBRARIES}) - """)) + return Version(self.version).major def package(self): - # return - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.install() - - os.unlink(os.path.join(self.package_folder, "bin", "ncurses{}{}-config".format(self._suffix, self._major_version))) - - self._create_cmake_module_alias_targets(os.path.join(self.package_folder, self._module_subfolder, self._module_file)) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + os.unlink(os.path.join(self.package_folder, "bin", f"ncurses{self._suffix}{self._major_version}-config")) + copy(self, "*.cmake", + src=os.path.join(self.export_sources_folder, "cmake"), + dst=os.path.join(self.package_folder, self._module_subfolder)) + fix_apple_shared_install_name(self) @property def _suffix(self): res = "" + # https://github.com/mirror/ncurses/blob/v6.4/configure.in#L1393 if self.options.with_reentrant: res += "t" + # https://github.com/mirror/ncurses/blob/v6.4/configure.in#L959 if self.options.with_widec: res += "w" return res @@ -248,80 +261,80 @@ def _lib_suffix(self): res += ".dll" return res - def package_id(self): - self.info.options.with_ticlib = self._with_ticlib - self.info.options.with_tinfo = self._with_tinfo - @property def _module_subfolder(self): return os.path.join("lib", "cmake") @property def _module_file(self): - return "conan-official-{}-targets.cmake".format(self.name) + return f"conan-official-{self.name}-targets.cmake" def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "Curses" - self.cpp_info.filenames["cmake_find_package_multi"] = "Curses" - if self._with_tinfo: - self.cpp_info.components["tinfo"].libs = ["tinfo" + self._lib_suffix] - self.cpp_info.components["tinfo"].names["pkg_config"] = "tinfo" + self._lib_suffix - self.cpp_info.components["tinfo"].includedirs.append(os.path.join("include", "ncurses" + self._suffix)) - - self.cpp_info.components["libcurses"].libs = ["ncurses" + self._lib_suffix] - self.cpp_info.components["libcurses"].names["pkg_config"] = "ncurses" + self._lib_suffix - self.cpp_info.components["libcurses"].includedirs.append(os.path.join("include", "ncurses" + self._suffix)) - if not self.options.shared: - self.cpp_info.components["libcurses"].defines = ["NCURSES_STATIC"] - if self.settings.os == "Linux": - self.cpp_info.components["libcurses"].system_libs = ["dl", "m"] - if self._with_tinfo: - self.cpp_info.components["libcurses"].requires.append("tinfo") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Curses") - if self.settings.compiler == "Visual Studio": - self.cpp_info.components["libcurses"].requires.extend([ - "getopt-for-visual-studio::getopt-for-visual-studio", - "dirent::dirent", - ]) - if self.options.get_safe("with_extended_colors", False): - self.cpp_info.components["libcurses"].requires.append("naive-tsearch::naive-tsearch") + # CMake's standard FindCurses module does not define a target. + # Adding one nevertheless for consistency with other packages. + # https://gitlab.kitware.com/cmake/cmake/-/issues/23051 + self.cpp_info.set_property("cmake_target_name", "Curses::Curses") - module_rel_path = os.path.join(self._module_subfolder, self._module_file) - self.cpp_info.components["libcurses"].builddirs.append(self._module_subfolder) - self.cpp_info.components["libcurses"].build_modules["cmake_find_package"] = [module_rel_path] - self.cpp_info.components["libcurses"].build_modules["cmake_find_package_multi"] = [module_rel_path] + def _add_component(name, lib_name=None, requires=None): + lib_name = lib_name or name + self.cpp_info.components[name].libs = [lib_name + self._lib_suffix] + self.cpp_info.components[name].set_property("pkg_config_name", lib_name + self._lib_suffix) + self.cpp_info.components[name].includedirs.append(os.path.join("include", "ncurses" + self._suffix)) + self.cpp_info.components[name].requires = requires if requires else [] - self.cpp_info.components["panel"].libs = ["panel" + self._lib_suffix] - self.cpp_info.components["panel"].names["pkg_config"] = "panel" + self._lib_suffix - self.cpp_info.components["panel"].requires = ["libcurses"] + _add_component("libcurses", lib_name="ncurses") + _add_component("panel", requires=["libcurses"]) + _add_component("menu", requires=["libcurses"]) + _add_component("form", requires=["libcurses"]) - self.cpp_info.components["menu"].libs = ["menu" + self._lib_suffix] - self.cpp_info.components["menu"].names["pkg_config"] = "menu" + self._lib_suffix - self.cpp_info.components["menu"].requires = ["libcurses"] + if self.options.with_tinfo: + _add_component("tinfo") + self.cpp_info.components["libcurses"].requires += ["tinfo"] - self.cpp_info.components["form"].libs = ["form" + self._lib_suffix] - self.cpp_info.components["form"].names["pkg_config"] = "form" + self._lib_suffix - self.cpp_info.components["form"].requires = ["libcurses"] - if self.options.with_pcre2: - self.cpp_info.components["form"].requires.append("pcre2::pcre2") + if self.options.with_ticlib: + _add_component("ticlib", lib_name="tic", requires=["libcurses"]) if self.options.with_cxx: - self.cpp_info.components["curses++"].libs = ["ncurses++" + self._lib_suffix] - self.cpp_info.components["curses++"].names["pkg_config"] = "ncurses++" + self._lib_suffix - self.cpp_info.components["curses++"].requires = ["libcurses"] + _add_component("curses++", lib_name="ncurses++", requires=["libcurses"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libcurses++"].system_libs.append("util") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["libcurses++"].system_libs.append(libcxx) + + if is_msvc(self): + self.cpp_info.components["libcurses"].requires += [ + "getopt-for-visual-studio::getopt-for-visual-studio", + "dirent::dirent", + ] + if self.options.get_safe("with_extended_colors"): + self.cpp_info.components["libcurses"].requires += [ + "naive-tsearch::naive-tsearch" + ] + if self.options.with_pcre2: + self.cpp_info.components["form"].requires.append("pcre2::pcre2") - if self._with_ticlib: - self.cpp_info.components["ticlib"].libs = ["tic" + self._lib_suffix] - self.cpp_info.components["ticlib"].names["pkg_config"] = "tic" + self._lib_suffix - self.cpp_info.components["ticlib"].requires = ["libcurses"] + if not self.options.shared: + self.cpp_info.components["libcurses"].defines = ["NCURSES_STATIC"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libcurses"].system_libs = ["dl", "m"] - if self.options.with_progs: - 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) + module_rel_path = os.path.join(self._module_subfolder, self._module_file) + self.cpp_info.components["libcurses"].builddirs.append(self._module_subfolder) + self.cpp_info.set_property("cmake_build_modules", [module_rel_path]) terminfo = os.path.join(self.package_folder, "res", "terminfo") - self.output.info("Setting TERMINFO environment variable: {}".format(terminfo)) - self.env_info.TERMINFO = terminfo + self.buildenv_info.define_path("TERMINFO", terminfo) + self.runenv_info.define_path("TERMINFO", terminfo) + self.conf_info.define("user.ncurses:lib_suffix", self._lib_suffix) + # TODO: Legacy, to be removed on Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "Curses" + self.cpp_info.names["cmake_find_package_multi"] = "Curses" + self.cpp_info.components["libcurses"].build_modules["cmake_find_package"] = [module_rel_path] + self.cpp_info.components["libcurses"].build_modules["cmake_find_package_multi"] = [module_rel_path] + self.env_info.TERMINFO = terminfo self.user_info.lib_suffix = self._lib_suffix diff --git a/recipes/ncurses/all/test_package/CMakeLists.txt b/recipes/ncurses/all/test_package/CMakeLists.txt index 6742c96b11c210..98c789fb359ec8 100644 --- a/recipes/ncurses/all/test_package/CMakeLists.txt +++ b/recipes/ncurses/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.0) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) set(CURSES_NEED_NCURSES TRUE) -find_package(Curses REQUIRED) +find_package(Curses CONFIG REQUIRED) if(NOT CURSES_HAVE_NCURSES_NCURSES_H) message(FATAL_ERROR "ncurses/ncurses.h is not available (CURSES_HAVE_NCURSES_NCURSES_H)") diff --git a/recipes/ncurses/all/test_package/conanfile.py b/recipes/ncurses/all/test_package/conanfile.py index 430a3b6ec8e187..d78cda6c6388d1 100644 --- a/recipes/ncurses/all/test_package/conanfile.py +++ b/recipes/ncurses/all/test_package/conanfile.py @@ -1,10 +1,26 @@ -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 Environment + 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 generate(self): + env = Environment() + env.define("TERM", "dumb") + env.vars(self, scope="run").save_script("conanrun_term") def build(self): cmake = CMake(self) @@ -12,6 +28,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - with tools.environment_append({"TERM": "dumb"}): - 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/neargye-semver/all/conanfile.py b/recipes/neargye-semver/all/conanfile.py index 53652835d3593f..4c81f48ec928fc 100644 --- a/recipes/neargye-semver/all/conanfile.py +++ b/recipes/neargye-semver/all/conanfile.py @@ -1,63 +1,72 @@ -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 NeargyeSemverConan(ConanFile): name = "neargye-semver" description = "Semantic Versioning for modern C++" - topics = ("conan", "semver", "semantic", "versioning") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Neargye/semver" - license = "MIT" - generators = "cmake", "cmake_find_package_multi" - settings = "compiler", "build_type" + topics = ("semver", "semantic", "versioning", "header-only") + + 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 - def configure(self): - compiler = str(self.settings.compiler) - compiler_version = tools.Version(self.settings.compiler.version) - - min_req_cppstd = "17" - 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)) - - minimal_version = { + @property + def _compilers_minimum_version(self): + return { "Visual Studio": "16", + "msvc": "192", "gcc": "7.3", "clang": "6.0", "apple-clang": "10.0", } - # Exclude compilers not supported - 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]: + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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( - "%s requires a compiler that supports at least C++%s. %s %s is not supported." % - (self.name, min_req_cppstd, compiler, tools.Version(self.settings.compiler.version.value))) + 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("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + 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.names["pkg_config"] = "semver" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("pkg_config_name", "semver") + self.cpp_info.set_property("cmake_file_name", "semver") + self.cpp_info.set_property("cmake_target_name", "semver::semver") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "semver" self.cpp_info.names["cmake_find_package_multi"] = "semver" - - def package_id(self): - self.info.header_only() diff --git a/recipes/neargye-semver/all/test_package/CMakeLists.txt b/recipes/neargye-semver/all/test_package/CMakeLists.txt index 4b4849803c2563..6915cbdbd4166e 100644 --- a/recipes/neargye-semver/all/test_package/CMakeLists.txt +++ b/recipes/neargye-semver/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -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(TARGETS) - -find_package(semver CONFIG REQUIRED) +find_package(semver REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} semver::semver) diff --git a/recipes/neargye-semver/all/test_package/conanfile.py b/recipes/neargye-semver/all/test_package/conanfile.py index 49a3a66ea5bad4..ef5d7042163ecc 100644 --- a/recipes/neargye-semver/all/test_package/conanfile.py +++ b/recipes/neargye-semver/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,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/neargye-semver/all/test_v1_package/CMakeLists.txt b/recipes/neargye-semver/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/neargye-semver/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/neargye-semver/all/test_v1_package/conanfile.py b/recipes/neargye-semver/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/neargye-semver/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/netcdf/all/conanfile.py b/recipes/netcdf/all/conanfile.py index 5e71e1ec032be4..44608e3405cb8a 100644 --- a/recipes/netcdf/all/conanfile.py +++ b/recipes/netcdf/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class NetcdfConan(ConanFile): @@ -17,7 +17,7 @@ class NetcdfConan(ConanFile): license = "BSD-3-Clause" homepage = "https://github.com/Unidata/netcdf-c" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -68,13 +68,13 @@ def requirements(self): # So we will require the older hdf5 to keep the older behaviour. self.requires("hdf5/1.12.0") else: - self.requires("hdf5/1.14.0") + self.requires("hdf5/1.14.1") if self.options.dap or self.options.byterange: - self.requires("libcurl/7.88.1") + self.requires("libcurl/[>=7.78.0 <9]") 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) @@ -89,10 +89,6 @@ def generate(self): tc.variables["ENABLE_BYTERANGE"] = self.options.byterange tc.variables["USE_HDF5"] = self.options.with_hdf5 tc.variables["NC_FIND_SHARED_LIBS"] = self.options.with_hdf5 and self.dependencies["hdf5"].options.shared - - # 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() tc = CMakeDeps(self) @@ -127,8 +123,6 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", "netcdf") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed self.cpp_info.components["libnetcdf"].libs = ["netcdf"] - self.cpp_info.components["libnetcdf"].libdirs = ["lib"] - self.cpp_info.components["libnetcdf"].includedirs = ["include"] if self._with_hdf5: self.cpp_info.components["libnetcdf"].requires.append("hdf5::hdf5") if self.options.dap or self.options.byterange: diff --git a/recipes/nettle/all/conanfile.py b/recipes/nettle/all/conanfile.py index e09965067d8d49..e24910f2f61b51 100644 --- a/recipes/nettle/all/conanfile.py +++ b/recipes/nettle/all/conanfile.py @@ -59,7 +59,7 @@ def layout(self): def requirements(self): if self.options.public_key: - self.requires("gmp/6.2.1") + self.requires("gmp/6.3.0") def validate(self): if is_msvc(self): @@ -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/newmat/all/CMakeLists.txt b/recipes/newmat/all/CMakeLists.txt new file mode 100644 index 00000000000000..768502b8f6a7f8 --- /dev/null +++ b/recipes/newmat/all/CMakeLists.txt @@ -0,0 +1,92 @@ +cmake_minimum_required(VERSION 3.0) + +project( + "newmat" + DESCRIPTION + "The package is intended for scientists and engineers who need to \ + manipulate a variety of types of matrices using standard matrix \ + operations. Emphasis is on the kind of operations needed in statistical \ + calculations such as least squares, linear equation solve and eigenvalues." + HOMEPAGE_URL "http://www.robertnz.net/nm11.htm" + LANGUAGES CXX) + +option(SETUP_C_SUBSCRIPTS "Activate SETUP_C_SUBSCRIPTS if you want to use traditional C style element access" OFF) +if (SETUP_C_SUBSCRIPTS) + add_compile_definitions(SETUP_C_SUBSCRIPTS) +endif() +message("Build with C style element access ${SETUP_C_SUBSCRIPTS}") + +# ------------- +# target +# ------------- +set(source_subfolder_ "src") +set(lib_name ${PROJECT_NAME}) +add_library(${lib_name}) + +target_sources( + ${lib_name} + PRIVATE + ${source_subfolder_}/bandmat.cpp + ${source_subfolder_}/jacobi.cpp + ${source_subfolder_}/newmat3.cpp + ${source_subfolder_}/newmat8.cpp + ${source_subfolder_}/nm_misc.cpp + ${source_subfolder_}/cholesky.cpp + ${source_subfolder_}/myexcept.cpp + ${source_subfolder_}/newmat4.cpp + ${source_subfolder_}/newmat9.cpp + ${source_subfolder_}/solution.cpp + ${source_subfolder_}/evalue.cpp + ${source_subfolder_}/newfft.cpp + ${source_subfolder_}/newmat5.cpp + ${source_subfolder_}/newmatex.cpp + ${source_subfolder_}/sort.cpp + ${source_subfolder_}/fft.cpp + ${source_subfolder_}/newmat1.cpp + ${source_subfolder_}/newmat6.cpp + ${source_subfolder_}/newmatnl.cpp + ${source_subfolder_}/submat.cpp + ${source_subfolder_}/hholder.cpp + ${source_subfolder_}/newmat2.cpp + ${source_subfolder_}/newmat7.cpp + ${source_subfolder_}/newmatrm.cpp + ${source_subfolder_}/svd.cpp +) + +set(include_dir ${PROJECT_SOURCE_DIR}/${source_subfolder_}) + +target_include_directories( + ${lib_name} PUBLIC $) +target_include_directories( + ${lib_name} INTERFACE $) + +# code has throwing desctructors, thus try to compile with c++98 +set_property(TARGET ${lib_name} PROPERTY CXX_STANDARD 98) + +# ------------- +# installation +# ------------- +include(GNUInstallDirs) +install( + FILES + ${include_dir}/controlw.h + ${include_dir}/include.h + ${include_dir}/myexcept.h + ${include_dir}/newmatap.h + ${include_dir}/newmat.h + ${include_dir}/newmatio.h + ${include_dir}/newmatnl.h + ${include_dir}/newmatrc.h + ${include_dir}/newmatrm.h + ${include_dir}/precisio.h + ${include_dir}/solution.h + DESTINATION + include/newmat +) +install( + TARGETS ${lib_name} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/recipes/newmat/all/conandata.yml b/recipes/newmat/all/conandata.yml new file mode 100644 index 00000000000000..e5211d2f682950 --- /dev/null +++ b/recipes/newmat/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "11.0.1": + url: "http://www.robertnz.net/ftp/newmat11.tar.gz" + sha256: "daf313a4db0db14dfcce236ad3cdc514d449e62ddd4f1b07cc31179b0787db6f" +patches: + "11.0.1": + - patch_file: "patches/11.0.1/newmat6.cpp.patch" + patch_type: portability + patch_description: "Fix comparison of pointer and int for new compilers" diff --git a/recipes/newmat/all/conanfile.py b/recipes/newmat/all/conanfile.py new file mode 100644 index 00000000000000..e73dffca97d70d --- /dev/null +++ b/recipes/newmat/all/conanfile.py @@ -0,0 +1,87 @@ +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, export_conandata_patches, copy, get, rmdir, save, load +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class NewmatConan(ConanFile): + name = "newmat" + description = "Manipulate a variety of types of matrices using standard matrix operations." + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.robertnz.net/nm11.htm" + topics = ("matrix") + license = "LicenseRef-newmat" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_c_subscripts": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_c_subscripts": False, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + 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 validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support dynamic library with msvc.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SETUP_C_SUBSCRIPTS"] = self.options.with_c_subscripts + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def _extract_license(self): + header = load(self, os.path.join(self.source_folder, "nm11.htm")) + return header[header.find("I place no restrictions", 1) : header.find("report bugs to me.", 1) + 18] + + def package(self): + cmake = CMake(self) + cmake.install() + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + rmdir(self, os.path.join(self.package_folder, "cmake")) + if self.settings.os == "Windows": + rmdir(self, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["newmat"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + + self.cpp_info.includedirs.append(os.path.join("include", "newmat")) + if self.options.with_c_subscripts: + self.cpp_info.defines.append("SETUP_C_SUBSCRIPTS") + diff --git a/recipes/newmat/all/patches/11.0.1/newmat6.cpp.patch b/recipes/newmat/all/patches/11.0.1/newmat6.cpp.patch new file mode 100644 index 00000000000000..2cbfaaa6c4648f --- /dev/null +++ b/recipes/newmat/all/patches/11.0.1/newmat6.cpp.patch @@ -0,0 +1,12 @@ +@@ -1,11 +0,0 @@ +--- newmat6.cpp ++++ newmat6.cpp +@@ -428,7 +428,7 @@ + { + if (&gm == this) { REPORT tag_val = -1; return; } + REPORT +- if (indx > 0) { delete [] indx; indx = 0; } ++ if (indx != 0) { delete [] indx; indx = 0; } + ((CroutMatrix&)gm).get_aux(*this); + Eq(gm); + } diff --git a/recipes/newmat/all/test_package/CMakeLists.txt b/recipes/newmat/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..b7da1c805dfbd3 --- /dev/null +++ b/recipes/newmat/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +find_package(newmat REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE newmat::newmat) diff --git a/recipes/newmat/all/test_package/conanfile.py b/recipes/newmat/all/test_package/conanfile.py new file mode 100644 index 00000000000000..0a6bc68712d901 --- /dev/null +++ b/recipes/newmat/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, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/newmat/all/test_package/test_package.cpp b/recipes/newmat/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..bd314f10d88fc9 --- /dev/null +++ b/recipes/newmat/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include "newmatap.h" + +int main() +{ + Matrix matrix(4,4); + + matrix + << 1 << 2 << 3 << 4 + << 21 << 22 << 23 << 24 + << 31 << 32 << 33 << 34 + << 41 << 42 << 43 << 44 + ; + + return 0; +} diff --git a/recipes/newmat/config.yml b/recipes/newmat/config.yml new file mode 100644 index 00000000000000..d7fc56a2cf1b3f --- /dev/null +++ b/recipes/newmat/config.yml @@ -0,0 +1,3 @@ +versions: + "11.0.1": + folder: all diff --git a/recipes/nfrechette-acl/all/conandata.yml b/recipes/nfrechette-acl/all/conandata.yml index 0c2e8a5978fd09..dca5b638ad1dc2 100644 --- a/recipes/nfrechette-acl/all/conandata.yml +++ b/recipes/nfrechette-acl/all/conandata.yml @@ -2,18 +2,6 @@ sources: "1.3.5": url: "https://github.com/nfrechette/acl/archive/v1.3.5.tar.gz" sha256: "06112ad5dc6b586124cc7b22ff6979ea1de9b69abefcd94d43556e20617355a1" - "2.0.0": - url: "https://github.com/nfrechette/acl/archive/v2.0.0.tar.gz" - sha256: "c5b44c063efbee6fb5753d0070e37215162d5d47f047fa033024750d9dbb6cdc" - "2.0.1": - url: "https://github.com/nfrechette/acl/archive/v2.0.1.tar.gz" - sha256: "aeab843b03ba15edd886472d96cdbe06e7c7142a0d54f0bf08a4f30693b9dad7" - "2.0.2": - url: "https://github.com/nfrechette/acl/archive/v2.0.2.tar.gz" - sha256: "d91c7942b4cbc6e8123a9964c1a68eec2778c75dc741c10ea9fede382d831649" - "2.0.3": - url: "https://github.com/nfrechette/acl/archive/v2.0.3.tar.gz" - sha256: "2cc0a6fd8f74ba7fee9177f6b7794bfdc22a27f5b00aa684ba52d60f0f8b3460" "2.0.5": url: "https://github.com/nfrechette/acl/archive/v2.0.5.tar.gz" sha256: "edd255a3ffcdb102b960922069d1ec9ae5fed561bca3bb6ee73224562f76fa36" diff --git a/recipes/nfrechette-acl/all/conanfile.py b/recipes/nfrechette-acl/all/conanfile.py index 23d68bbd569f4d..4a590b12eb34ec 100644 --- a/recipes/nfrechette-acl/all/conanfile.py +++ b/recipes/nfrechette-acl/all/conanfile.py @@ -1,44 +1,59 @@ import os + from conan import ConanFile -from conan.tools.files import rename, get -from conans import tools -from conans.errors import ConanInvalidConfiguration +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 AclConan(ConanFile): name = "nfrechette-acl" description = "Animation Compression Library" - topics = ("animation", "compression") license = "MIT" - homepage = "https://github.com/nfrechette/acl" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nfrechette/acl" + topics = ("animation", "compression", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = "compiler" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 - def requirements(self): - self.requires("rtm/2.1.4") + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - def configure(self): - minimal_cpp_standard = "11" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration( + f"acl can't be compiled by {self.settings.compiler} {self.settings.compiler.version}") - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("acl can't be compiled by {0} {1}".format(self.settings.compiler, - self.settings.compiler.version)) + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("rtm/2.1.5") + + def package_id(self): + self.info.clear() def source(self): - get(self, **self.conan_data["sources"][self.version]) - extracted_dir = "acl-" + self.version - rename(self, extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "includes")) - - def package_id(self): - self.info.header_only() + 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, "includes")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/nfrechette-acl/all/test_package/CMakeLists.txt b/recipes/nfrechette-acl/all/test_package/CMakeLists.txt index 33ae887aa6aea3..da2314ef0ec2be 100644 --- a/recipes/nfrechette-acl/all/test_package/CMakeLists.txt +++ b/recipes/nfrechette-acl/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(nfrechette-acl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE nfrechette-acl::nfrechette-acl) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/nfrechette-acl/all/test_package/conanfile.py b/recipes/nfrechette-acl/all/test_package/conanfile.py index efea4352797165..ef5d7042163ecc 100644 --- a/recipes/nfrechette-acl/all/test_package/conanfile.py +++ b/recipes/nfrechette-acl/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -import os from conan import ConanFile -from conans import CMake, tools +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 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/nfrechette-acl/all/test_v1_package/CMakeLists.txt b/recipes/nfrechette-acl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/nfrechette-acl/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/nfrechette-acl/all/test_v1_package/conanfile.py b/recipes/nfrechette-acl/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49ba777923b404 --- /dev/null +++ b/recipes/nfrechette-acl/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os +from conan import ConanFile +from conans import 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") + self.run(bin_path, run_environment=True) diff --git a/recipes/nfrechette-acl/config.yml b/recipes/nfrechette-acl/config.yml index cf68d13e1c6982..00fcf380290718 100644 --- a/recipes/nfrechette-acl/config.yml +++ b/recipes/nfrechette-acl/config.yml @@ -1,14 +1,6 @@ versions: "1.3.5": folder: "all" - "2.0.0": - folder: "all" - "2.0.1": - folder: "all" - "2.0.2": - folder: "all" - "2.0.3": - folder: "all" "2.0.5": folder: "all" "2.0.6": diff --git a/recipes/nghttp3/all/conandata.yml b/recipes/nghttp3/all/conandata.yml new file mode 100644 index 00000000000000..3d19ff221c51bc --- /dev/null +++ b/recipes/nghttp3/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.1.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.1.0/nghttp3-1.1.0.tar.bz2" + sha256: "5a203bf6e3129a9c23b06207c0fa3b05b26066ea28c037a62c9fea8cffecd85f" + "1.0.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.0.0/nghttp3-1.0.0.tar.bz2" + sha256: "c4aa8a38056e3b286a4102612d690e0c21f584784364f04215100e74efc95a61" + "0.15.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v0.15.0/nghttp3-0.15.0.tar.gz" + sha256: "3c56d9fa6f1b58b37bd7b1b53eaf16cd71118bc2d5cadbc904f09d6f6466b42f" diff --git a/recipes/nghttp3/all/conanfile.py b/recipes/nghttp3/all/conanfile.py new file mode 100644 index 00000000000000..618ddcb3adf328 --- /dev/null +++ b/recipes/nghttp3/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import get, rmdir, copy +from conan.tools.microsoft import is_msvc +import os + + +required_conan_version = ">=1.53.0" + + +class Nghttp3Conan(ConanFile): + name = "nghttp3" + description = "HTTP/3 library written in C" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://nghttp2.org/nghttp3/" + topics = ("http", "http3", "quic", "qpack") + 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.20 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_SHARED_LIB"] = self.options.shared + tc.variables["ENABLE_STATIC_LIB"] = not self.options.shared + tc.variables["ENABLE_LIB_ONLY"] = True + if is_apple_os(self): + # workaround for: install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable + tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["nghttp3"] + if is_msvc(self) and not self.options.shared: + self.cpp_info.defines.append("NGHTTP3_STATICLIB") + + self.cpp_info.set_property("pkg_config_name", "nghttp3") diff --git a/recipes/nghttp3/all/test_package/CMakeLists.txt b/recipes/nghttp3/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..c52d61a995b330 --- /dev/null +++ b/recipes/nghttp3/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(nghttp3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE nghttp3::nghttp3) diff --git a/recipes/nghttp3/all/test_package/conanfile.py b/recipes/nghttp3/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/nghttp3/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nghttp3/all/test_package/test_package.c b/recipes/nghttp3/all/test_package/test_package.c new file mode 100644 index 00000000000000..f093072babb721 --- /dev/null +++ b/recipes/nghttp3/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#if defined(_MSC_VER) +/* nghttp3 defaults to int */ +typedef int ssize_t; +#endif +#include +#include + +int main() +{ + const nghttp3_info* info = nghttp3_version(NGHTTP3_VERSION_NUM); + if (info) { + printf("nghttp3 ver=%d version=%s\n", info->version_num, info->version_str); + } else { + printf("nghttp3: cannot get version\n"); + } + return 0; +} diff --git a/recipes/nghttp3/config.yml b/recipes/nghttp3/config.yml new file mode 100644 index 00000000000000..f581e0802958e4 --- /dev/null +++ b/recipes/nghttp3/config.yml @@ -0,0 +1,7 @@ +versions: + "1.1.0": + folder: all + "1.0.0": + folder: all + "0.15.0": + folder: all diff --git a/recipes/nlohmann_json/all/conandata.yml b/recipes/nlohmann_json/all/conandata.yml index 3da3e0aae2e97b..971d0191590f9c 100644 --- a/recipes/nlohmann_json/all/conandata.yml +++ b/recipes/nlohmann_json/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.11.3": + url: "https://github.com/nlohmann/json/archive/v3.11.3.tar.gz" + sha256: "0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406" "3.11.2": url: "https://github.com/nlohmann/json/archive/v3.11.2.tar.gz" sha256: "d69f9deb6a75e2580465c6c4c5111b89c4dc2fa94e3a85fcd2ffcd9a143d9273" diff --git a/recipes/nlohmann_json/all/conanfile.py b/recipes/nlohmann_json/all/conanfile.py index 83bc77059e036f..98eaf15380fff6 100644 --- a/recipes/nlohmann_json/all/conanfile.py +++ b/recipes/nlohmann_json/all/conanfile.py @@ -14,6 +14,7 @@ class NlohmannJsonConan(ConanFile): topics = "json", "header-only" url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -32,8 +33,7 @@ def validate(self): check_min_cppstd(self, self._minimum_cpp_standard) 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): pass diff --git a/recipes/nlohmann_json/config.yml b/recipes/nlohmann_json/config.yml index e38fadbe1b4de9..ad526c439b84bc 100644 --- a/recipes/nlohmann_json/config.yml +++ b/recipes/nlohmann_json/config.yml @@ -1,4 +1,6 @@ versions: + "3.11.3": + folder: all "3.11.2": folder: all "3.11.1": diff --git a/recipes/nmea/all/CMakeLists.txt b/recipes/nmea/all/CMakeLists.txt new file mode 100644 index 00000000000000..75b13231e08aef --- /dev/null +++ b/recipes/nmea/all/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required(VERSION 3.15) + +project(nmea LANGUAGES C) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_library(${PROJECT_NAME}) + +set(NMEA_INCLUDE_DIR ${NMEA_ROOT_DIR}/include) +set(NMEA_SRC_DIR ${NMEA_ROOT_DIR}/src) + +target_sources( + ${PROJECT_NAME} + PRIVATE + ${NMEA_SRC_DIR}/context.c + ${NMEA_SRC_DIR}/generate.c + ${NMEA_SRC_DIR}/generator.c + ${NMEA_SRC_DIR}/gmath.c + ${NMEA_SRC_DIR}/info.c + ${NMEA_SRC_DIR}/parse.c + ${NMEA_SRC_DIR}/parser.c + ${NMEA_SRC_DIR}/sentence.c + ${NMEA_SRC_DIR}/time.c + ${NMEA_SRC_DIR}/tok.c +) + +target_include_directories( + ${PROJECT_NAME} + PUBLIC + ${NMEA_INCLUDE_DIR} +) + +set( + NMEA_HEADERS + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/config.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/context.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/generate.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/generator.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/gmath.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/info.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/nmea.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/parse.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/parser.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/sentence.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/time.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/tok.h + ${NMEA_INCLUDE_DIR}/${PROJECT_NAME}/units.h +) + +set_target_properties( + ${PROJECT_NAME} + PROPERTIES + PUBLIC_HEADER "${NMEA_HEADERS}" + C_EXTENSIONS OFF +) + +find_library(LIBM m) +target_link_libraries(${PROJECT_NAME} PRIVATE $<$:${LIBM}>) + +include(GNUInstallDirs) +install( + TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} +) diff --git a/recipes/nmea/all/conandata.yml b/recipes/nmea/all/conandata.yml new file mode 100644 index 00000000000000..11255f314caf53 --- /dev/null +++ b/recipes/nmea/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.5.3": + url: "http://downloads.sourceforge.net/nmea/nmealib-0.5.3.zip" + sha256: "41e9fbb8fd5cb1836ff727355b3debe98662b39beb7493af9b78bc4bd4a2ad7d" diff --git a/recipes/nmea/all/conanfile.py b/recipes/nmea/all/conanfile.py new file mode 100644 index 00000000000000..17706f598b4563 --- /dev/null +++ b/recipes/nmea/all/conanfile.py @@ -0,0 +1,67 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class NmeaConan(ConanFile): + name = "nmea" + description = "Library to work with NMEA protocol" + license = "LGPL-2.1-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://nmea.sourceforge.net/" + topics = ("nmea", "geospatial", "gnss", "gps", "navigation") + 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): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + 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): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["NMEA_ROOT_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.TXT", 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.append(self.name) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/nmea/all/test_package/CMakeLists.txt b/recipes/nmea/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..0fc5503253f05c --- /dev/null +++ b/recipes/nmea/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package C) + +find_package(nmea REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE nmea::nmea) diff --git a/recipes/nmea/all/test_package/conanfile.py b/recipes/nmea/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/nmea/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/nmea/all/test_package/test_package.c b/recipes/nmea/all/test_package/test_package.c new file mode 100644 index 00000000000000..2c83a9e9a35fb8 --- /dev/null +++ b/recipes/nmea/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +#include + +int main() +{ + printf("%f", nmea_degree2radian(180.0)); + return 0; +} diff --git a/recipes/nmea/config.yml b/recipes/nmea/config.yml new file mode 100644 index 00000000000000..2a0554e18df806 --- /dev/null +++ b/recipes/nmea/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.3": + folder: all 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/CMakeLists.txt b/recipes/nmslib/all/CMakeLists.txt deleted file mode 100644 index c8e560d40aa56d..00000000000000 --- a/recipes/nmslib/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(source_subfolder/similarity_search) diff --git a/recipes/nmslib/all/conandata.yml b/recipes/nmslib/all/conandata.yml index bc747087c62bd3..a76e6327ac2f8d 100644 --- a/recipes/nmslib/all/conandata.yml +++ b/recipes/nmslib/all/conandata.yml @@ -4,11 +4,7 @@ sources: sha256: d1f5c60a62e0e61e14c92b37d6f1420ed4bb3c6fd19ced67c84b7e0e0e3f07c5 patches: "2.1.1": - - base_path: source_subfolder - patch_file: patches/0001-cmake-disable-app-build.patch - - base_path: source_subfolder - patch_file: patches/0002-cmake-fix-install.patch - - base_path: source_subfolder - patch_file: patches/0003-cmake-fix-flags.patch - - base_path: source_subfolder - patch_file: patches/0004-missing-utils-header.patch + - patch_file: patches/0001-cmake-disable-app-build.patch + - patch_file: patches/0002-cmake-fix-install.patch + - patch_file: patches/0003-cmake-fix-flags.patch + - patch_file: patches/0004-missing-utils-header.patch diff --git a/recipes/nmslib/all/conanfile.py b/recipes/nmslib/all/conanfile.py index 637febf0d43bb8..339645c6797631 100644 --- a/recipes/nmslib/all/conanfile.py +++ b/recipes/nmslib/all/conanfile.py @@ -1,66 +1,111 @@ import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 + +required_conan_version = ">=1.53.0" class Nmslib(ConanFile): name = "nmslib" + description = ( + "Non-Metric Space Library (NMSLIB): An efficient similarity search library " + "and a toolkit for evaluation of k-NN methods for generic non-metric spaces." + ) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nmslib/nmslib" - description = "Non-Metric Space Library (NMSLIB): An efficient similarity search library and a toolkit for evaluation of k-NN methods for generic non-metric spaces." topics = ("knn-search", "non-metric", "neighborhood-graphs", "neighborhood-graphs", "vp-tree") - license = "Apache-2.0" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - exports_sources = "CMakeLists.txt", "patches/**" - generators = "cmake" + 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.", + } - _cmake = None + def export_sources(self): + export_conandata_patches(self) - def validate(self): - if self.settings.compiler == "Visual Studio": - if self.settings.compiler.version == "14": - raise ConanInvalidConfiguration("Visual Studio 14 builds are not supported") # TODO: add reason in message - if self.options.shared: - raise ConanInvalidConfiguration("Visual Studio shared builds are not supported (.lib artifacts missing)") + 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: - del self.options.fPIC + self.options.rm_safe("fPIC") - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + 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") - @property - def _source_subfolder(self): - return "source_subfolder" + def validate(self): + check_min_vs(self, 190) # TODO: add reason in message + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration( + "Visual Studio shared builds are not supported (.lib artifacts missing)" + ) 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.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 _configure_cmake(self): - if self._cmake is None: - cmake = CMake(self) - cmake.definitions["WITHOUT_TESTS"] = True - cmake.configure() - self._cmake = cmake - return self._cmake + 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"), + "-Ofast", "-Ofast -fno-finite-math-only") 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(build_script_folder=os.path.join(self.source_folder, "similarity_search")) 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 = ["NonMetricSpaceLib"] - if self.settings.os == "Linux": - self.cpp_info.system_libs = ["pthread"] + if self.settings.os in ["Linux", "FreeBSD"]: + 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/nmslib/all/test_package/CMakeLists.txt b/recipes/nmslib/all/test_package/CMakeLists.txt index 7b52b104457446..a7336347af2da7 100644 --- a/recipes/nmslib/all/test_package/CMakeLists.txt +++ b/recipes/nmslib/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(nmslib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/nmslib/all/test_package/conanfile.py b/recipes/nmslib/all/test_package/conanfile.py index abcaeed3f89b67..ef5d7042163ecc 100644 --- a/recipes/nmslib/all/test_package/conanfile.py +++ b/recipes/nmslib/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", "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,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/nmslib/all/test_v1_package/CMakeLists.txt b/recipes/nmslib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/nmslib/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/nmslib/all/test_v1_package/conanfile.py b/recipes/nmslib/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..abcaeed3f89b67 --- /dev/null +++ b/recipes/nmslib/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/nng/all/conandata.yml b/recipes/nng/all/conandata.yml index 7f6a9a4f236eee..821ab71934ba1a 100644 --- a/recipes/nng/all/conandata.yml +++ b/recipes/nng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.0": + url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.6.0.tar.gz" + sha256: "f639e77911ef935a13e9779d4a18d45490433ba744f89752a15b84c929ce2725" "1.5.2": url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.5.2.tar.gz" sha256: "f8b25ab86738864b1f2e3128e8badab581510fa8085ff5ca9bb980d317334c46" @@ -17,9 +20,21 @@ sources: patches: "1.5.1": - patch_file: patches/0001-fix-ios-tvos-watchos-1.5.1.patch + patch_description: "add support iOS, tvOS and watchOS" + patch_type: "portability" + patch_source: "https://github.com/nanomsg/nng/pull/1474" "1.3.2": - patch_file: patches/0001-fix-ios-tvos-watchos-1.3.1.patch + patch_description: "add support iOS, tvOS and watchOS" + patch_type: "portability" + patch_source: "https://github.com/nanomsg/nng/pull/1474" "1.3.1": - patch_file: patches/0001-fix-ios-tvos-watchos-1.3.1.patch + patch_description: "add support iOS, tvOS and watchOS" + patch_type: "portability" + patch_source: "https://github.com/nanomsg/nng/pull/1474" "1.3.0": - patch_file: patches/0001-fix-ios-tvos-watchos-1.3.0.patch + patch_description: "add support iOS, tvOS and watchOS" + patch_type: "portability" + patch_source: "https://github.com/nanomsg/nng/pull/1474" diff --git a/recipes/nng/all/conanfile.py b/recipes/nng/all/conanfile.py index 38c580aa2cc03f..184a8d520a4c26 100644 --- a/recipes/nng/all/conanfile.py +++ b/recipes/nng/all/conanfile.py @@ -11,11 +11,11 @@ class NngConan(ConanFile): name = "nng" description = "nanomsg-next-generation: light-weight brokerless messaging" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nanomsg/nng" - license = "MIT" topics = ("nanomsg", "communication", "messaging", "protocols") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,7 +23,8 @@ class NngConan(ConanFile): "nngcat": [True, False], "http": [True, False], "tls": [True, False], - "max_taskq_threads": ["ANY"] + "max_taskq_threads": ["ANY"], + "max_expire_threads": ["ANY"], } default_options = { "shared": False, @@ -31,7 +32,8 @@ class NngConan(ConanFile): "nngcat": False, "http": True, "tls": False, - "max_taskq_threads": "16" + "max_taskq_threads": "16", + "max_expire_threads": "8", } def export_sources(self): @@ -40,6 +42,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "1.6.0": + del self.options.max_expire_threads def configure(self): if self.options.shared: @@ -55,7 +59,7 @@ def requirements(self): if Version(self.version) < "1.5.2": self.requires("mbedtls/2.25.0") else: - self.requires("mbedtls/3.0.0") + self.requires("mbedtls/3.5.0") def validate(self): compiler_minimum_version = { @@ -69,6 +73,8 @@ def validate(self): ) if not self.options.max_taskq_threads.value.isdigit(): raise ConanInvalidConfiguration("max_taskq_threads must be an integral number") + if "max_expire_threads" in self.options and not self.options.max_expire_threads.value.isdigit(): + raise ConanInvalidConfiguration("max_expire_threads must be an integral number") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -80,6 +86,8 @@ def generate(self): tc.variables["NNG_ENABLE_NNGCAT"] = self.options.nngcat tc.variables["NNG_ENABLE_HTTP"] = self.options.http tc.variables["NNG_MAX_TASKQ_THREADS"] = self.options.max_taskq_threads + if "max_expire_threads" in self.options: + tc.variables["NNG_MAX_EXPIRE_THREADS"] = self.options.max_expire_threads tc.generate() def build(self): diff --git a/recipes/nng/all/test_package/CMakeLists.txt b/recipes/nng/all/test_package/CMakeLists.txt index 6c83380e0106e9..7a60c8282db347 100644 --- a/recipes/nng/all/test_package/CMakeLists.txt +++ b/recipes/nng/all/test_package/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) -project(test_package C) - find_package(nng REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/nng/config.yml b/recipes/nng/config.yml index ba169426f19deb..07341cd03187da 100644 --- a/recipes/nng/config.yml +++ b/recipes/nng/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.0": + folder: all "1.5.2": folder: all "1.5.1": diff --git a/recipes/nodejs/all/conandata.yml b/recipes/nodejs/all/conandata.yml index 0681cc81e538a7..56a1be535ef41d 100644 --- a/recipes/nodejs/all/conandata.yml +++ b/recipes/nodejs/all/conandata.yml @@ -47,6 +47,28 @@ sources: "armv8": url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-darwin-arm64.tar.gz" sha256: "aeac294dbe54a4dfd222eedfbae704b185c40702254810e2c5917f6dbc80e017" + "16.20.2": + Windows: + "x86_64": + url: "https://nodejs.org/dist/v16.20.2/node-v16.20.2-win-x64.zip" + sha256: "f8bb35f6c08dc7bf14ac753509c06ed1a7ebf5b390cd3fbdc8f8c1aedd020ec3" + Linux: + "x86_64": + url: "https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.xz" + sha256: "874463523f26ed528634580247f403d200ba17a31adf2de98a7b124c6eb33d87" + "armv7": + url: "https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-armv7l.tar.xz" + sha256: "5f2a2a34d2f19931b8ef39416bde96933e6666f91a2d1a2b92af30627a8e8429" + "armv8": + url: "https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-arm64.tar.xz" + sha256: "e88d86154d1ce53dc52fd74d79d4bfdf0b05f58c0bb2639adfa36e9378b770c4" + Macos: + "x86_64": + url: "https://nodejs.org/dist/v16.20.2/node-v16.20.2-darwin-x64.tar.gz" + sha256: "d7a46eaf2b57ffddeda16ece0d887feb2e31a91ad33f8774da553da0249dc4a6" + "armv8": + url: "https://nodejs.org/dist/v16.20.2/node-v16.20.2-darwin-arm64.tar.gz" + sha256: "6a5c4108475871362d742b988566f3fe307f6a67ce14634eb3fbceb4f9eea88c" "18.15.0": Windows: "x86_64": diff --git a/recipes/nodejs/all/conanfile.py b/recipes/nodejs/all/conanfile.py index d08325293889af..c098d4eea47052 100644 --- a/recipes/nodejs/all/conanfile.py +++ b/recipes/nodejs/all/conanfile.py @@ -16,6 +16,7 @@ class NodejsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://nodejs.org" license = "MIT" + package_type = "application" settings = "os", "arch", "compiler" no_copy_source = True short_paths = True @@ -40,6 +41,9 @@ def _glibc_version(self): self.run(cmd, buff) return str(re.search(r'GLIBC (\d{1,3}.\d{1,3})', buff.getvalue()).group(1)) + def package_id(self): + del self.info.settings.compiler + def validate(self): if not self.version in self.conan_data["sources"] or \ not str(self.settings.os) in self.conan_data["sources"][self.version] or \ diff --git a/recipes/nodejs/config.yml b/recipes/nodejs/config.yml index e973a099243f74..78cc638a90e4df 100644 --- a/recipes/nodejs/config.yml +++ b/recipes/nodejs/config.yml @@ -5,5 +5,7 @@ versions: folder: all "16.3.0": folder: all + "16.20.2": + folder: all "18.15.0": folder: all diff --git a/recipes/nodesoup/all/CMakeLists.txt b/recipes/nodesoup/all/CMakeLists.txt deleted file mode 100644 index 881b1cb39250b4..00000000000000 --- a/recipes/nodesoup/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/nodesoup/all/conandata.yml b/recipes/nodesoup/all/conandata.yml index bf507c033f50b6..633f6755af50c8 100644 --- a/recipes/nodesoup/all/conandata.yml +++ b/recipes/nodesoup/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "cci.20200905": - patch_file: "patches/0001-install-shared-windows.patch" - base_path: "source_subfolder" diff --git a/recipes/nodesoup/all/conanfile.py b/recipes/nodesoup/all/conanfile.py index 19ef9ea3f19236..86e6f75fa66160 100644 --- a/recipes/nodesoup/all/conanfile.py +++ b/recipes/nodesoup/all/conanfile.py @@ -1,9 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, get, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" - class NodesoupConan(ConanFile): name = "nodesoup" @@ -13,6 +15,7 @@ class NodesoupConan(ConanFile): homepage = "https://github.com/olvb/nodesoup" url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,18 +25,8 @@ class NodesoupConan(ConanFile): "fPIC": True, } - generators = "cmake" - exports_sources = "CMakeLists.txt", "patches/*" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") def config_options(self): if self.settings.os == "Windows": @@ -41,38 +34,44 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + @property + def _min_cppstd(self): + return 14 def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, self._min_cppstd) if self.settings.compiler == "clang": - if tools.Version(self.settings.compiler.version) < "5.0" and self.settings.compiler.libcxx in ("libstdc++", "libstdc++11"): + if Version(self.settings.compiler.version) < "5.0" and self.settings.compiler.libcxx in ("libstdc++", "libstdc++11"): raise ConanInvalidConfiguration("The version of libstdc++(11) of the current compiler does not support building nodesoup") + def export_sources(self): + export_conandata_patches(self) + 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.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_DEMO"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.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(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.includedirs.append(os.path.join("include", "nodesoup")) diff --git a/recipes/nodesoup/all/test_package/CMakeLists.txt b/recipes/nodesoup/all/test_package/CMakeLists.txt index 027a67d403fb19..881aec891e1d02 100644 --- a/recipes/nodesoup/all/test_package/CMakeLists.txt +++ b/recipes/nodesoup/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(nodesoup REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) diff --git a/recipes/nodesoup/all/test_package/conanfile.py b/recipes/nodesoup/all/test_package/conanfile.py index 49a3a66ea5bad4..8a5bb47f50c4ce 100644 --- a/recipes/nodesoup/all/test_package/conanfile.py +++ b/recipes/nodesoup/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/norm/all/conanfile.py b/recipes/norm/all/conanfile.py index 0a0ac61c170c3e..d900ba9bfd4b99 100644 --- a/recipes/norm/all/conanfile.py +++ b/recipes/norm/all/conanfile.py @@ -39,7 +39,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.10.4") # dependency of protolib actually + self.requires("libxml2/2.11.4") # dependency of protolib actually def source(self): get(self, **self.conan_data["sources"][self.version]) diff --git a/recipes/npcap/all/test_package/conanfile.py b/recipes/npcap/all/test_package/conanfile.py index 88fb844b5824b7..3f5bd28111ec18 100644 --- a/recipes/npcap/all/test_package/conanfile.py +++ b/recipes/npcap/all/test_package/conanfile.py @@ -2,7 +2,6 @@ from conan.tools import files from conan.tools.build import can_run from conan.tools.cmake import cmake_layout, CMake -from io import StringIO import os @@ -24,6 +23,9 @@ def configure(self): def layout(self): cmake_layout(self) + def generate(self): + files.save(self, os.path.join(self.build_folder, "libpcap_bin_path"), self.dependencies["libpcap"].cpp_info.bindirs[0]) + def build(self): cmake = CMake(self) cmake.configure() @@ -31,17 +33,13 @@ def build(self): def test(self): if can_run(self): - bindir = self.cpp.build.bindirs[0] + bindir = self.cpp.build.bindir # Use libpcap DLL as a replacement for npcap DLL # It will not provide all the functions # but it will cover enough to check that what we compiled is correct files.rm(self, "wpcap.dll", bindir) - files.copy(self, "pcap.dll", src=self.deps_cpp_info['libpcap'].bin_paths[0], dst=bindir) + libpcap_bin_path = files.load(self, os.path.join(self.build_folder, "libpcap_bin_path")) + files.copy(self, "pcap.dll", src=libpcap_bin_path, dst=os.path.join(str(self.build_path), bindir)) files.rename(self, os.path.join(bindir, "pcap.dll"), os.path.join(bindir, "wpcap.dll")) - bin_path = os.path.join(bindir, "test_package") - output = StringIO() - self.run(bin_path, env="conanrun", output=output) - test_output = output.getvalue() - print(test_output) - assert "libpcap version 1.10.1" in test_output + self.run(os.path.join(bindir, "test_package"), env="conanrun") diff --git a/recipes/nsimd/2.x/CMakeLists.txt b/recipes/nsimd/2.x/CMakeLists.txt deleted file mode 100644 index c986d294c75479..00000000000000 --- a/recipes/nsimd/2.x/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/nsimd/2.x/conanfile.py b/recipes/nsimd/2.x/conanfile.py index 517dd7d55ea046..714275e3c3205b 100644 --- a/recipes/nsimd/2.x/conanfile.py +++ b/recipes/nsimd/2.x/conanfile.py @@ -1,5 +1,7 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, replace_in_file required_conan_version = ">=1.33.0" @@ -11,8 +13,6 @@ class NsimdConan(ConanFile): topics = ("hpc", "neon", "cuda", "avx", "simd", "avx2", "sse2", "aarch64", "avx512", "sse42", "rocm", "sve", "neon128") url = "https://github.com/conan-io/conan-center-index" license = "MIT" - exports_sources = ["CMakeLists.txt", "patches/*"] - generators = "cmake" settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], @@ -27,63 +27,57 @@ class NsimdConan(ConanFile): "simd": None } - _cmake = None - - @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") # Most of the library is header only. # cpp files do not use STL. - del self.settings.compiler.libcxx + 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], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def generate(self): + tc = CMakeToolchain(self) if self.options.simd: - self._cmake.definitions["simd"] = self.options.simd + tc.variables["simd"] = self.options.simd if self.settings.arch == "armv7hf": - self._cmake.definitions["NSIMD_ARM32_IS_ARMEL"] = False - self._cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["NSIMD_ARM32_IS_ARMEL"] = False + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.generate() def _patch_sources(self): - cmakefile_path = os.path.join(self._source_subfolder, "CMakeLists.txt") - tools.replace_in_file(cmakefile_path, - " SHARED ", - " ") - tools.replace_in_file(cmakefile_path, - "RUNTIME DESTINATION lib", - "RUNTIME DESTINATION bin") - tools.replace_in_file(cmakefile_path, - "set_property(TARGET ${o} PROPERTY POSITION_INDEPENDENT_CODE ON)", - "") + cmakefile_path = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakefile_path, + " SHARED ", + " ") + replace_in_file(self, cmakefile_path, + "RUNTIME DESTINATION lib", + "RUNTIME DESTINATION bin") + replace_in_file(self, cmakefile_path, + "set_property(TARGET ${o} PROPERTY POSITION_INDEPENDENT_CODE ON)", + "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + 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", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) diff --git a/recipes/nsimd/2.x/test_package/CMakeLists.txt b/recipes/nsimd/2.x/test_package/CMakeLists.txt index aac673c26f6fe1..6f3111e50d3efc 100644 --- a/recipes/nsimd/2.x/test_package/CMakeLists.txt +++ b/recipes/nsimd/2.x/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(nsimd CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/nsimd/2.x/test_package/conanfile.py b/recipes/nsimd/2.x/test_package/conanfile.py index 0937dd58a343bd..22e1a75b926d7b 100644 --- a/recipes/nsimd/2.x/test_package/conanfile.py +++ b/recipes/nsimd/2.x/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, cmake_layout import os -from conans import ConanFile, CMake, tools - class NsimdTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "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) @@ -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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nsimd/2.x/test_v1_package/CMakeLists.txt b/recipes/nsimd/2.x/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..ed8a6b4ca24f67 --- /dev/null +++ b/recipes/nsimd/2.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(nsimd CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} nsimd::nsimd) diff --git a/recipes/nsimd/2.x/test_v1_package/conanfile.py b/recipes/nsimd/2.x/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..0937dd58a343bd --- /dev/null +++ b/recipes/nsimd/2.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class NsimdTestConan(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/nspr/all/conanfile.py b/recipes/nspr/all/conanfile.py index b0ce8c9099e1bb..fe56b4bbdf4f7d 100644 --- a/recipes/nspr/all/conanfile.py +++ b/recipes/nspr/all/conanfile.py @@ -1,24 +1,30 @@ -from conan.tools.microsoft import msvc_runtime_flag -from conan.tools.files import rename, get, rmdir, chdir, replace_in_file -from conan.tools.scm import Version +import os +import shutil + from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conans import tools, AutoToolsBuildEnvironment -import contextlib -import functools -import os +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import Environment +from conan.tools.files import chdir, copy, get, rename, replace_in_file, rmdir, mkdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag, unix_path_package_info_legacy +from conan.tools.scm import Version -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.57.0" class NsprConan(ConanFile): name = "nspr" - homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR" - description = "Netscape Portable Runtime (NSPR) provides a platform-neutral API for system level and libc-like functions." - topics = ("nspr", "libc") - url = "https://github.com/conan-io/conan-center-index" + description = ("Netscape Portable Runtime (NSPR) provides a platform-neutral API" + " for system level and libc-like functions.") license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR" + topics = ("libc",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -33,14 +39,6 @@ class NsprConan(ConanFile): "win32_target": "winnt", } - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -49,128 +47,129 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC else: - del self.options.win32_target + self.options.rm_safe("win32_target") def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + 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 validate(self): # https://bugzilla.mozilla.org/show_bug.cgi?id=1658671 if Version(self.version) < "4.29": - if self.settings.os == "Macos" and self.settings.arch == "armv8": + if is_apple_os(self) and self.settings.arch == "armv8": raise ConanInvalidConfiguration("NSPR does not support mac M1 before 4.29") + if cross_building(self): + raise ConanInvalidConfiguration("Cross-building is not supported") def build_requirements(self): if self._settings_build.os == "Windows": - self.build_requires("mozilla-build/3.3") - if not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("mozilla-build/3.3") + 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): - get(self, **self.conan_data["sources"][self.version], - destination="tmp", strip_root=True) - rename(self, os.path.join("tmp", "nspr"), self._source_subfolder) - rmdir(self, "tmp") - - @contextlib.contextmanager - def _build_context(self): - if self._is_msvc: - with tools.vcvars(self): - with tools.environment_append({"CC": "cl", "CXX": "cl", "LD": "link"}): - yield - else: - yield + with chdir(self, self.export_sources_folder): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + rmdir(self, self.source_folder) + rename(self, "nspr", self.source_folder) - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + def generate(self): + tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" - conf_args = [ + tc.configure_args += [ "--with-mozilla={}".format(yes_no(self.options.with_mozilla)), "--enable-64bit={}".format(yes_no(self.settings.arch in ("armv8", "x86_64", "mips64", "ppc64", "ppc64le"))), "--enable-strip={}".format(yes_no(self.settings.build_type not in ("Debug", "RelWithDebInfo"))), "--enable-debug={}".format(yes_no(self.settings.build_type == "Debug")), - "--datarootdir={}".format(tools.unix_path(os.path.join(self.package_folder, "res"))), + "--datarootdir=${prefix}/res", "--disable-cplus", ] - if self._is_msvc: - conf_args.extend([ + if is_msvc(self): + tc.configure_args += [ "{}-pc-mingw32".format("x86_64" if self.settings.arch == "x86_64" else "x86"), - "--enable-static-rtl={}".format(yes_no("MT" in msvc_runtime_flag(self))), + "--enable-static-rtl={}".format(yes_no(is_msvc_static_runtime(self))), "--enable-debug-rtl={}".format(yes_no("d" in msvc_runtime_flag(self))), - ]) + ] elif self.settings.os == "Android": - conf_args.extend([ - "--with-android-ndk={}".format(tools.get_env(["NDK_ROOT"])), + tc.configure_args += [ + "--with-android-ndk={}".format(os.environ.get("NDK_ROOT", "")), "--with-android-version={}".format(self.settings.os.api_level), - "--with-android-platform={}".format(tools.get_env("ANDROID_PLATFORM")), - "--with-android-toolchain={}".format(tools.get_env("ANDROID_TOOLCHAIN")), - ]) + "--with-android-platform={}".format(os.environ.get("ANDROID_PLATFORM")), + "--with-android-toolchain={}".format(os.environ.get("ANDROID_TOOLCHAIN")), + ] elif self.settings.os == "Windows": - conf_args.append("--enable-win32-target={}".format(self.options.win32_target)) - env = autotools.vars - if self.settings.os == "Macos": - if self.settings.arch == "armv8": - # conan adds `-arch`, which conflicts with nspr's apple silicon support - env["CFLAGS"] = env["CFLAGS"].replace("-arch arm64", "") - env["CXXFLAGS"] = env["CXXFLAGS"].replace("-arch arm64", "") - - autotools.configure(args=conf_args, vars=env) - return autotools + tc.configure_args.append("--enable-win32-target={}".format(self.options.win32_target)) + if is_apple_os(self) and self.settings.arch == "armv8": + # conan adds `-arch`, which conflicts with nspr's apple silicon support + tc.cflags.remove("-arch arm64") + tc.cxxflags.remove("-arch arm64") + tc.generate() + + if is_msvc(self): + env = Environment() + env.define("CC", "cl") + env.define("CXX", "cl") + env.define("LD", "link") + env.vars(self).save_script("conanbuild_msvc") def build(self): - with chdir(self, self._source_subfolder): + with chdir(self, self.source_folder): # relocatable shared libs on macOS - replace_in_file(self, - "configure", - "-install_name @executable_path/", - "-install_name @rpath/" - ) - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + replace_in_file(self, "configure", "-install_name @executable_path/", "-install_name @rpath/") + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - with chdir(self, self._source_subfolder): - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() rmdir(self, os.path.join(self.package_folder, "bin")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) + if os.path.exists(os.path.join(self.package_folder, "include", "nspr.h")): + with chdir(self, self.package_folder): + rename(self, "include", "nspr") + mkdir(self, "include") + shutil.move("nspr", "include") if self.settings.os == "Windows": if self.options.shared: os.mkdir(os.path.join(self.package_folder, "bin")) for lib in self._library_names: - libsuffix = "lib" if self._is_msvc else "a" - libprefix = "" if self._is_msvc else "lib" + libsuffix = "lib" if is_msvc(self) else "a" + libprefix = "" if is_msvc(self) else "lib" if self.options.shared: os.unlink(os.path.join(self.package_folder, "lib", f"{libprefix}{lib}_s.{libsuffix}")) - rename(self, os.path.join(self.package_folder, "lib", f"{lib}.dll"), - os.path.join(self.package_folder, "bin", f"{lib}.dll")) + rename(self, + os.path.join(self.package_folder, "lib", f"{lib}.dll"), + os.path.join(self.package_folder, "bin", f"{lib}.dll")) else: os.unlink(os.path.join(self.package_folder, "lib", f"{libprefix}{lib}.{libsuffix}")) os.unlink(os.path.join(self.package_folder, "lib", f"{lib}.dll")) if not self.options.shared: replace_in_file(self, os.path.join(self.package_folder, "include", "nspr", "prtypes.h"), - "#define NSPR_API(__type) PR_IMPORT(__type)", - "#define NSPR_API(__type) extern __type") + "#define NSPR_API(__type) PR_IMPORT(__type)", + "#define NSPR_API(__type) extern __type") replace_in_file(self, os.path.join(self.package_folder, "include", "nspr", "prtypes.h"), - "#define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type)", - "#define NSPR_DATA_API(__type) extern __type") + "#define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type)", + "#define NSPR_DATA_API(__type) extern __type") else: - shared_ext = "dylib" if self.settings.os == "Macos" else "so" + shared_ext = "dylib" if is_apple_os(self) else "so" for lib in self._library_names: if self.options.shared: os.unlink(os.path.join(self.package_folder, "lib", f"lib{lib}.a")) else: os.unlink(os.path.join(self.package_folder, "lib", f"lib{lib}.{shared_ext}")) - if self._is_msvc: + if is_msvc(self): if self.settings.build_type == "Debug": for lib in self._library_names: os.unlink(os.path.join(self.package_folder, "lib", f"{lib}.pdb")) @@ -200,8 +199,9 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["winmm", "ws2_32"]) - aclocal = tools.unix_path(os.path.join(self.package_folder, "res", "aclocal")) + self.cpp_info.resdirs = ["res"] + + # TODO: the following can be removed when the recipe supports Conan >= 2.0 only + aclocal = unix_path_package_info_legacy(self, os.path.join(self.package_folder, "res", "aclocal")) self.output.info(f"Appending AUTOMAKE_CONAN_INCLUDES environment variable: {aclocal}") self.env_info.AUTOMAKE_CONAN_INCLUDES.append(aclocal) - - self.cpp_info.resdirs = ["res"] diff --git a/recipes/nspr/all/test_package/CMakeLists.txt b/recipes/nspr/all/test_package/CMakeLists.txt index e8bb34d55a6376..898448a11de583 100644 --- a/recipes/nspr/all/test_package/CMakeLists.txt +++ b/recipes/nspr/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(nspr REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/nspr/all/test_package/conanfile.py b/recipes/nspr/all/test_package/conanfile.py index ab912e4e61df1a..d6a48b7c16ccf6 100644 --- a/recipes/nspr/all/test_package/conanfile.py +++ b/recipes/nspr/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", "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 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.0") + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -21,6 +31,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/nspr/all/test_v1_package/CMakeLists.txt b/recipes/nspr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/nspr/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/nspr/all/test_v1_package/conanfile.py b/recipes/nspr/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..9f6cd40d88fedb --- /dev/null +++ b/recipes/nspr/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +from conan.tools.apple import is_apple_os +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_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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/nss/all/conandata.yml b/recipes/nss/all/conandata.yml index 254439032f6472..f10905ebbaa04d 100644 --- a/recipes/nss/all/conandata.yml +++ b/recipes/nss/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.93": + url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_93_RTM/src/nss-3.93.tar.gz" + sha256: "15f54bb72048eb105f8c0e936a04b899e74c3db9a19bbc1e00acee2af9476a8a" + "3.92": + url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_92_RTM/src/nss-3.92.tar.gz" + sha256: "3db192d6e882039af02ae7eaf3217ed114bb7ad83414c646772ab8021e24a254" "3.91": url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_91_RTM/src/nss-3.91.tar.gz" sha256: "84bd46376df17118c55f6d73d30fd93a0af21296c66e7690471547e5898fc4b3" diff --git a/recipes/nss/config.yml b/recipes/nss/config.yml index 741d3aab48e70f..82fff1e6a41ec5 100644 --- a/recipes/nss/config.yml +++ b/recipes/nss/config.yml @@ -1,4 +1,8 @@ versions: + "3.93": + folder: all + "3.92": + folder: all "3.91": folder: all "3.89": diff --git a/recipes/nudb/all/conanfile.py b/recipes/nudb/all/conanfile.py index f02496ac2b32a7..bd9db41da603fc 100644 --- a/recipes/nudb/all/conanfile.py +++ b/recipes/nudb/all/conanfile.py @@ -28,7 +28,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.82.0") + self.requires("boost/1.83.0") def package_id(self): self.info.clear() diff --git a/recipes/nuklear/all/conandata.yml b/recipes/nuklear/all/conandata.yml index 2bff2ae899a2a9..d11d172a2e7ff1 100644 --- a/recipes/nuklear/all/conandata.yml +++ b/recipes/nuklear/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.10.6": + url: "https://github.com/Immediate-Mode-UI/Nuklear/archive/4.10.6.tar.gz" + sha256: "1baa1c9603ef20e6410a931de65d3fe07def5266fa7a61cdf1ffd241b3109a99" "4.10.1": url: "https://github.com/Immediate-Mode-UI/Nuklear/archive/refs/tags/4.10.1.tar.gz" sha256: "a7bd28477e00be6768e9b8cc3a406bc67b2d32d3a023b1e44868e8c566a7eb2f" diff --git a/recipes/nuklear/all/conanfile.py b/recipes/nuklear/all/conanfile.py index 6e91081b7e51f2..b3be73bced4e22 100644 --- a/recipes/nuklear/all/conanfile.py +++ b/recipes/nuklear/all/conanfile.py @@ -10,21 +10,21 @@ class NuklearConan(ConanFile): name = "nuklear" description = "A single-header ANSI C immediate mode cross-platform GUI library." license = ["MIT", "Unlicense"] - topics = ("nuklear", "gui", "header-only") + topics = ("gui", "header-only") homepage = "https://github.com/Immediate-Mode-UI/Nuklear" url = "https://github.com/conan-io/conan-center-index" + 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 @@ -35,8 +35,6 @@ def package(self): 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("m") diff --git a/recipes/nuklear/all/test_package/conanfile.py b/recipes/nuklear/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/nuklear/all/test_package/conanfile.py +++ b/recipes/nuklear/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/nuklear/all/test_v1_package/CMakeLists.txt b/recipes/nuklear/all/test_v1_package/CMakeLists.txt index 9898e4868ff3c7..b21cc49efde95c 100644 --- a/recipes/nuklear/all/test_v1_package/CMakeLists.txt +++ b/recipes/nuklear/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(nuklear REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE nuklear::nuklear) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/nuklear/config.yml b/recipes/nuklear/config.yml index 7f21ae0ba74181..96278eaa477be1 100644 --- a/recipes/nuklear/config.yml +++ b/recipes/nuklear/config.yml @@ -1,4 +1,6 @@ versions: + "4.10.6": + folder: all "4.10.1": folder: all "4.06.1": diff --git a/recipes/numcpp/all/conandata.yml b/recipes/numcpp/all/conandata.yml index 2dd7a89a189620..bc13c5f8f97d87 100644 --- a/recipes/numcpp/all/conandata.yml +++ b/recipes/numcpp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.12.1": + url: "https://github.com/dpilger26/NumCpp/archive/Version_2.12.1.tar.gz" + sha256: "f462ecd27126e6057b31fa38f1f72cef2c4223c9d848515412970714a5bb6d16" + "2.12.0": + url: "https://github.com/dpilger26/NumCpp/archive/Version_2.12.0.tar.gz" + sha256: "4c7266d405c8058f87467732129362b5a5c810d36df91e8655defa4d93fc141b" "2.11.0": url: "https://github.com/dpilger26/NumCpp/archive/Version_2.11.0.tar.gz" sha256: "ea675775c3535589f268224efa31ae6003a68e95a465e92c99496a0c9366bdc2" diff --git a/recipes/numcpp/all/conanfile.py b/recipes/numcpp/all/conanfile.py index 9f1e7ec1b42e93..d8dc35d2e05482 100644 --- a/recipes/numcpp/all/conanfile.py +++ b/recipes/numcpp/all/conanfile.py @@ -12,11 +12,10 @@ class NumCppConan(ConanFile): name = "numcpp" description = "A Templatized Header Only C++ Implementation of the Python NumPy Library" - topics = ("python", "numpy", "numeric") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/dpilger26/NumCpp" - license = "MIT" - + topics = ("python", "numpy", "numeric", "header-library") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { @@ -27,8 +26,8 @@ class NumCppConan(ConanFile): "with_boost" : True, "threads" : False, } - no_copy_source = True + short_paths = True @property def _min_cppstd(self): @@ -62,7 +61,7 @@ def layout(self): def requirements(self): if self.options.get_safe("with_boost", True): - self.requires("boost/1.82.0", transitive_headers=True) + self.requires("boost/1.83.0", transitive_headers=True) def package_id(self): self.info.clear() @@ -84,6 +83,13 @@ def validate(self): f"{self.ref} doesn't support clang<12 with libstdc++11 due to filesystem library.", ) + # since 2.12.0, numcpp uses TRUE/FALSE symbol which are defined by macOSX SDK + # https://github.com/dpilger26/NumCpp/issues/204 + if Version(self.version) == "2.12.0" and self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration( + f"{self.ref} doesn't support apple-clang by defining TRUE/FALSE symbols", + ) + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/numcpp/config.yml b/recipes/numcpp/config.yml index f550cd05e46c57..a222baacafc0a5 100644 --- a/recipes/numcpp/config.yml +++ b/recipes/numcpp/config.yml @@ -1,4 +1,8 @@ versions: + "2.12.1": + folder: "all" + "2.12.0": + folder: "all" "2.11.0": folder: "all" "2.10.1": diff --git a/recipes/nv-codec-headers/all/conandata.yml b/recipes/nv-codec-headers/all/conandata.yml index 708ee808ccc1d0..df731f0997f31a 100644 --- a/recipes/nv-codec-headers/all/conandata.yml +++ b/recipes/nv-codec-headers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "12.0.16.0": + url: "https://github.com/FFmpeg/nv-codec-headers/archive/n12.0.16.0.tar.gz" + sha256: "2a1533b65f55f9da52956faf0627ed3b74868ac0c7f269990edd21369113b48f" "11.1.5.1": url: "https://github.com/FFmpeg/nv-codec-headers/archive/n11.1.5.1.tar.gz" sha256: "d095fbd56aa93772471a323be0ebe65504a0f43f06c76a30b6d25da77b06ae9c" diff --git a/recipes/nv-codec-headers/config.yml b/recipes/nv-codec-headers/config.yml index 993edd5a104227..018eb4087b8928 100644 --- a/recipes/nv-codec-headers/config.yml +++ b/recipes/nv-codec-headers/config.yml @@ -1,4 +1,6 @@ versions: + "12.0.16.0": + folder: all "11.1.5.1": folder: all "9.1.23.2": diff --git a/recipes/nvtx/all/conandata.yml b/recipes/nvtx/all/conandata.yml index 7d5d894d503538..48340be192d8ea 100644 --- a/recipes/nvtx/all/conandata.yml +++ b/recipes/nvtx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.0": + url: "https://github.com/NVIDIA/NVTX/archive/v3.1.0.tar.gz" + sha256: "dc4e4a227d04d3da46ad920dfee5f7599ac8d6b2ee1809c9067110fb1cc71ced" "3.0.1": url: "https://github.com/NVIDIA/NVTX/archive/refs/tags/v3.0.1.tar.gz" sha256: "bb8d1536aad708ec807bc675e12e5838c2f84481dec4005cd7a9bbd49e326ba1" diff --git a/recipes/nvtx/all/conanfile.py b/recipes/nvtx/all/conanfile.py index fbe722ba0c892e..049e362302672e 100644 --- a/recipes/nvtx/all/conanfile.py +++ b/recipes/nvtx/all/conanfile.py @@ -16,6 +16,7 @@ class NVTXConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" topics = ("profiler", "nvidia", "nsight") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -26,8 +27,7 @@ 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 diff --git a/recipes/nvtx/config.yml b/recipes/nvtx/config.yml index f1eca9cdf76de8..188be115336dd1 100644 --- a/recipes/nvtx/config.yml +++ b/recipes/nvtx/config.yml @@ -1,3 +1,5 @@ versions: + "3.1.0": + folder: all "3.0.1": folder: all 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/objectbox-generator/all/conanfile.py b/recipes/objectbox-generator/all/conanfile.py index 5493b25252fde2..b6b2defa46e0e0 100644 --- a/recipes/objectbox-generator/all/conanfile.py +++ b/recipes/objectbox-generator/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import CMake, 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.files import copy, download, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.47.0" + class PackageConan(ConanFile): name = "objectbox-generator" @@ -10,39 +14,45 @@ class PackageConan(ConanFile): license = "GPL-3.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/objectbox/objectbox-generator" - topics = ("database", "code-generator", "objectbox") + topics = ("database", "code-generator", "objectbox", "pre-built") + + package_type = "application" settings = "os", "arch", "compiler", "build_type" - @property - def _source_subfolder(self): - return "source_subfolder" - - def validate(self): - if self.settings.os not in ["Linux", "Windows", "Macos"] or self.settings.arch != "x86_64": - raise ConanInvalidConfiguration("{} doesn't support current environment".format(self.name)) + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): del self.info.settings.compiler del self.info.settings.build_type - def source(self): - tools.get(**self.conan_data["sources"][self.version][str(self.settings.os)], - destination=self.source_folder) - tools.download(**self.conan_data["sources"][self.version]["License"], filename="LICENSE.txt") + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD", "Windows", "Macos"] or self.settings.arch != "x86_64": + raise ConanInvalidConfiguration(f"{self.name} doesn't support current environment") + + def build(self): + get(self, **self.conan_data["sources"][self.version][str(self.info.settings.os)]) + download(self, **self.conan_data["sources"][self.version]["License"], filename="LICENSE.txt") def package(self): if self.settings.os != "Windows": - bin_path = os.path.join(self.source_folder, "objectbox-generator") + bin_path = os.path.join(self.build_folder, "objectbox-generator") os.chmod(bin_path, os.stat(bin_path).st_mode | 0o111) - self.copy("objectbox-generator*", src=self.source_folder, dst="bin", keep_path=False) - self.copy("LICENSE.txt", dst="licenses", src=self.source_folder) + copy(self, "objectbox-generator*", + src=self.build_folder, + dst=os.path.join(self.package_folder, "bin"), + keep_path=False) + copy(self, "LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.build_folder) def package_info(self): - binpath = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var: {}".format(binpath)) - self.env_info.PATH.append(binpath) - self.cpp_info.includedirs = [] self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] self.cpp_info.resdirs = [] + + # TODO: Legacy, to be removed on Conan 2.0 + binpath = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var: {binpath}") + self.env_info.PATH.append(binpath) diff --git a/recipes/objectbox-generator/all/test_package/conanfile.py b/recipes/objectbox-generator/all/test_package/conanfile.py index c605339e388af3..42f9cfb1d7ca26 100644 --- a/recipes/objectbox-generator/all/test_package/conanfile.py +++ b/recipes/objectbox-generator/all/test_package/conanfile.py @@ -1,11 +1,15 @@ -from conans import ConanFile, CMake, tools -import os +from conan import ConanFile +from conan.tools.build import can_run 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): - if not tools.cross_building(self): - bin_path = os.path.join(self.deps_cpp_info["objectbox-generator"].rootpath, "bin", "objectbox-generator") - self.run(bin_path + " -help", run_environment=True) + if can_run(self): + self.run("objectbox-generator -help") diff --git a/recipes/objectbox-generator/all/test_v1_package/conanfile.py b/recipes/objectbox-generator/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c605339e388af3 --- /dev/null +++ b/recipes/objectbox-generator/all/test_v1_package/conanfile.py @@ -0,0 +1,11 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join(self.deps_cpp_info["objectbox-generator"].rootpath, "bin", "objectbox-generator") + self.run(bin_path + " -help", run_environment=True) diff --git a/recipes/objectbox/all/conandata.yml b/recipes/objectbox/all/conandata.yml index af3abbeb889483..6a064833981c31 100644 --- a/recipes/objectbox/all/conandata.yml +++ b/recipes/objectbox/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.19.0": + url: "https://github.com/objectbox/objectbox-c/archive/v0.19.0.tar.gz" + sha256: "372520a744e9ae135a309ee834e4e936058abb0630fafd70a400546109089a89" "0.18.1": url: "https://github.com/objectbox/objectbox-c/archive/v0.18.1.tar.gz" sha256: "108ac7fac843f2962374a12b361bb57b4d114013d16f7716cfedbc7df52feb2e" @@ -8,8 +11,11 @@ sources: "0.17.0": url: "https://github.com/objectbox/objectbox-c/archive/refs/tags/v0.17.0.tar.gz" sha256: "3b936b3352ae0c8ea3706cc0a1790d2714a415cdce16007c2caca367ead5af8d" - patches: + "0.19.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "add sync option, disable tests/examples, support max length of windows path" + patch_type: "conan" "0.18.1": - patch_file: "patches/0001-fix-cmake.patch" patch_description: "add sync option, disable tests/examples, support max length of windows path" diff --git a/recipes/objectbox/all/conanfile.py b/recipes/objectbox/all/conanfile.py index c5710cc60873cd..ffcc6e09fb17f7 100644 --- a/recipes/objectbox/all/conanfile.py +++ b/recipes/objectbox/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.scm import Version @@ -14,12 +15,14 @@ class ObjectboxCConan(ConanFile): homepage = "https://github.com/objectbox/objectbox-c" topics = ("performance", "database", "flatbuffers") settings = "os", "arch", "compiler", "build_type" + package_type = "shared-library" options = { "with_sync": [True, False], } default_options = { "with_sync": False, } + upload_policy="skip" def export_sources(self): export_conandata_patches(self) @@ -27,6 +30,11 @@ def export_sources(self): def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + if Version(self.version) >= "0.19.0" and \ + self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC 6 or higher") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/objectbox/all/test_package/CMakeLists.txt b/recipes/objectbox/all/test_package/CMakeLists.txt index 8ef573610ef449..daba6910bb48a9 100644 --- a/recipes/objectbox/all/test_package/CMakeLists.txt +++ b/recipes/objectbox/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) find_package(objectbox REQUIRED CONFIG) diff --git a/recipes/objectbox/config.yml b/recipes/objectbox/config.yml index f2cc4d23dcbd0c..e6304cf62bb40c 100644 --- a/recipes/objectbox/config.yml +++ b/recipes/objectbox/config.yml @@ -1,4 +1,6 @@ versions: + "0.19.0": + folder: all "0.18.1": folder: all "0.18.0": diff --git a/recipes/oboe/all/conanfile.py b/recipes/oboe/all/conanfile.py index a70215ca04760d..ee8b970e7d9a35 100644 --- a/recipes/oboe/all/conanfile.py +++ b/recipes/oboe/all/conanfile.py @@ -15,7 +15,7 @@ class OboeConan(ConanFile): topics = ("android", "audio") homepage = "https://github.com/google/oboe" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type", options = { "shared": [True, False], @@ -33,15 +33,15 @@ 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.os != "Android": raise ConanInvalidConfiguration("oboe supports Android only") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 17) - def layout(self): - cmake_layout(self, src_folder="src") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/observer-ptr-lite/all/conanfile.py b/recipes/observer-ptr-lite/all/conanfile.py index 3d66f15a4c9aff..6e4898b3c5824c 100644 --- a/recipes/observer-ptr-lite/all/conanfile.py +++ b/recipes/observer-ptr-lite/all/conanfile.py @@ -14,18 +14,18 @@ class ObserverPtrLiteConan(ConanFile): std::experimental::observer_ptr for C++98 and later.") topics = ("cpp98", "cpp11", "cpp14", "cpp17") license = "BSL-1.0" + 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 @@ -38,9 +38,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "observer-ptr-lite") self.cpp_info.set_property("cmake_target_name", "nonstd::observer-ptr-lite") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "observer-ptr-lite" @@ -51,6 +49,4 @@ def package_info(self): self.cpp_info.components["observerptrlite"].names["cmake_find_package_multi"] = "observer-ptr-lite" self.cpp_info.components["observerptrlite"].set_property("cmake_target_name", "nonstd::observer-ptr-lite") self.cpp_info.components["observerptrlite"].bindirs = [] - self.cpp_info.components["observerptrlite"].frameworkdirs = [] self.cpp_info.components["observerptrlite"].libdirs = [] - self.cpp_info.components["observerptrlite"].resdirs = [] diff --git a/recipes/observer-ptr-lite/all/test_package/conanfile.py b/recipes/observer-ptr-lite/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/observer-ptr-lite/all/test_package/conanfile.py +++ b/recipes/observer-ptr-lite/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/observer-ptr-lite/all/test_v1_package/CMakeLists.txt b/recipes/observer-ptr-lite/all/test_v1_package/CMakeLists.txt index 20353a906da644..b21cc49efde95c 100644 --- a/recipes/observer-ptr-lite/all/test_v1_package/CMakeLists.txt +++ b/recipes/observer-ptr-lite/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(observer-ptr-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::observer-ptr-lite) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/octo-encryption-cpp/all/conandata.yml b/recipes/octo-encryption-cpp/all/conandata.yml index 1e42247500f04a..d2c6c293649c60 100644 --- a/recipes/octo-encryption-cpp/all/conandata.yml +++ b/recipes/octo-encryption-cpp/all/conandata.yml @@ -1,4 +1,4 @@ sources: "1.1.0": - sha256: f595eb6c44187e8f5f047fc7bd6747ba0d50ad99f526fe87c16fdba9c77b513d - url: https://github.com/ofiriluz/octo-encryption-cpp/archive/refs/tags/v1.1.0.tar.gz + url: "https://github.com/ofiriluz/octo-encryption-cpp/archive/refs/tags/v1.1.0.tar.gz" + sha256: "f595eb6c44187e8f5f047fc7bd6747ba0d50ad99f526fe87c16fdba9c77b513d" diff --git a/recipes/octo-encryption-cpp/all/conanfile.py b/recipes/octo-encryption-cpp/all/conanfile.py index 991faa27ffc844..263f2034b1a24b 100644 --- a/recipes/octo-encryption-cpp/all/conanfile.py +++ b/recipes/octo-encryption-cpp/all/conanfile.py @@ -4,19 +4,24 @@ from conan.tools.build import check_min_cppstd from conan.errors import ConanInvalidConfiguration from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc_static_runtime import os -required_conan_version = ">=1.50.0" - +required_conan_version = ">=1.53.0" class OctoEncryptionCPPConan(ConanFile): name = "octo-encryption-cpp" + description = "Octo encryption library" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ofiriluz/octo-encryption-cpp" - description = "Octo encryption library" topics = ("cryptography", "cpp") - settings = "os", "compiler", "build_type", "arch" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -25,45 +30,41 @@ def _compilers_minimum_version(self): "clang": "9", "apple-clang": "11", "Visual Studio": "16", - "msvc": "1923", + "msvc": "192", } - def generate(self): - tc = CMakeToolchain(self) - tc.variables["DISABLE_TESTS"] = True - tc.variables["DISABLE_EXAMPLES"] = True - tc.generate() - cd = CMakeDeps(self) - cd.generate() - def layout(self): cmake_layout(self, src_folder="src") - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, "17") + def requirements(self): + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - f"{self.name} requires C++17, which your compiler does not support." + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - else: - self.output.warn(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": raise ConanInvalidConfiguration(f"{self.name} does not support clang with libc++. Use libstdc++ instead.") - if self.settings.compiler == "Visual Studio" and self.settings.compiler.runtime in ["MTd", "MT"]: - raise ConanInvalidConfiguration(f"{self.name} does not support MSVC MT/MTd configurations, only MD/MDd is supported") + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC MT/MTd configurations, only MD/MDd is supported") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") - def requirements(self): - self.requires("openssl/1.1.1q") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build_requirements(self): - self.build_requires("cmake/3.24.0") + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DISABLE_TESTS"] = True + tc.variables["DISABLE_EXAMPLES"] = True + tc.generate() + cd = CMakeDeps(self) + cd.generate() def build(self): cmake = CMake(self) @@ -76,11 +77,14 @@ def package(self): cmake.install() def package_info(self): + self.cpp_info.libs = ["octo-encryption-cpp"] + self.cpp_info.set_property("cmake_file_name", "octo-encryption-cpp") self.cpp_info.set_property("cmake_target_name", "octo::octo-encryption-cpp") self.cpp_info.set_property("pkg_config_name", "octo-encryption-cpp") - self.cpp_info.libs = ["octo-encryption-cpp"] + self.cpp_info.requires = ["openssl::openssl"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "octo-encryption-cpp" self.cpp_info.names["cmake_find_package_multi"] = "octo-encryption-cpp" self.cpp_info.names["pkg_config"] = "octo-encryption-cpp" - self.cpp_info.requires = ["openssl::openssl"] diff --git a/recipes/octo-encryption-cpp/all/test_package/CMakeLists.txt b/recipes/octo-encryption-cpp/all/test_package/CMakeLists.txt index a07fac747020c3..bd49d24ed139e2 100644 --- a/recipes/octo-encryption-cpp/all/test_package/CMakeLists.txt +++ b/recipes/octo-encryption-cpp/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(octo-encryption-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} octo::octo-encryption-cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE octo::octo-encryption-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/octo-encryption-cpp/all/test_package/conanfile.py b/recipes/octo-encryption-cpp/all/test_package/conanfile.py index 62e07ce5add598..ef5d7042163ecc 100644 --- a/recipes/octo-encryption-cpp/all/test_package/conanfile.py +++ b/recipes/octo-encryption-cpp/all/test_package/conanfile.py @@ -1,19 +1,16 @@ -from conans import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain +from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout +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 = "CMakeDeps", "VirtualRunEnv" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" - def generate(self): - tc = CMakeToolchain(self) - tc.generate() + def requirements(self): + self.requires(self.tested_reference_str) def layout(self): cmake_layout(self) @@ -25,4 +22,5 @@ def build(self): def test(self): if can_run(self): - self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/octo-keygen-cpp/all/conandata.yml b/recipes/octo-keygen-cpp/all/conandata.yml index 1915a524b0e388..2fde3196d3682a 100644 --- a/recipes/octo-keygen-cpp/all/conandata.yml +++ b/recipes/octo-keygen-cpp/all/conandata.yml @@ -1,4 +1,4 @@ sources: "1.0.0": - sha256: c4c60b4defed781d164e8fcc002c98df6fef0166ac2a18c7919dbbda22accecf - url: https://github.com/ofiriluz/octo-keygen-cpp/archive/refs/tags/v1.0.0.tar.gz + url: "https://github.com/ofiriluz/octo-keygen-cpp/archive/refs/tags/v1.0.0.tar.gz" + sha256: "c4c60b4defed781d164e8fcc002c98df6fef0166ac2a18c7919dbbda22accecf" diff --git a/recipes/octo-keygen-cpp/all/conanfile.py b/recipes/octo-keygen-cpp/all/conanfile.py index 52e5634af7ecfe..b9e37112cb2f5f 100644 --- a/recipes/octo-keygen-cpp/all/conanfile.py +++ b/recipes/octo-keygen-cpp/all/conanfile.py @@ -2,8 +2,9 @@ from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import get, copy from conan.tools.build import check_min_cppstd -from conan.errors import ConanInvalidConfiguration from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc_static_runtime +from conan.errors import ConanInvalidConfiguration import os required_conan_version = ">=1.50.0" @@ -11,12 +12,17 @@ class OctoKeygenCPPConan(ConanFile): name = "octo-keygen-cpp" + description = "Key generation / certificate generation using openssl for CPP" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ofiriluz/octo-keygen-cpp" - description = "Octo keygen library" topics = ("pki", "keypair", "certificates", "cpp") - settings = "os", "compiler", "build_type", "arch" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -25,47 +31,43 @@ def _compilers_minimum_version(self): "clang": "9", "apple-clang": "11", "Visual Studio": "16", - "msvc": "1923", + "msvc": "192", } - def generate(self): - tc = CMakeToolchain(self) - tc.variables["DISABLE_TESTS"] = True - tc.generate() - cd = CMakeDeps(self) - cd.generate() - def layout(self): cmake_layout(self, src_folder="src") - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, "17") + def requirements(self): + self.requires("octo-logger-cpp/1.1.0", transitive_headers=True) + self.requires("octo-encryption-cpp/1.1.0", transitive_headers=True) + self.requires("fmt/10.1.1") + self.requires("openssl/[>=1.1 <4]") + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - f"{self.name} requires C++17, which your compiler does not support." + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - else: - self.output.warn(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": - raise ConanInvalidConfiguration(f"{self.name} does not support clang with libc++. Use libstdc++ instead.") - if self.settings.compiler == "Visual Studio" and self.settings.compiler.runtime in ["MTd", "MT"]: - raise ConanInvalidConfiguration(f"{self.name} does not support MSVC MT/MTd configurations, only MD/MDd is supported") + raise ConanInvalidConfiguration(f"{self.ref} does not support clang with libc++. Use libstdc++ instead.") + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC MT/MTd configurations, only MD/MDd is supported") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") - def requirements(self): - self.requires("octo-logger-cpp/1.1.0") - self.requires("octo-encryption-cpp/1.1.0") - self.requires("fmt/9.0.0") - self.requires("openssl/1.1.1q") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build_requirements(self): - self.tool_requires("cmake/3.24.0") + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DISABLE_TESTS"] = True + tc.generate() + cd = CMakeDeps(self) + cd.generate() def build(self): cmake = CMake(self) @@ -78,16 +80,18 @@ def package(self): cmake.install() def package_info(self): + self.cpp_info.libs = ["octo-keygen-cpp"] self.cpp_info.set_property("cmake_file_name", "octo-keygen-cpp") self.cpp_info.set_property("cmake_target_name", "octo::octo-keygen-cpp") self.cpp_info.set_property("pkg_config_name", "octo-keygen-cpp") - self.cpp_info.libs = ["octo-keygen-cpp"] - self.cpp_info.names["cmake_find_package"] = "octo-keygen-cpp" - self.cpp_info.names["cmake_find_package_multi"] = "octo-keygen-cpp" - self.cpp_info.names["pkg_config"] = "octo-keygen-cpp" self.cpp_info.requires = [ "fmt::fmt", "openssl::openssl", "octo-logger-cpp::octo-logger-cpp", "octo-encryption-cpp::octo-encryption-cpp" ] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "octo-keygen-cpp" + self.cpp_info.names["cmake_find_package_multi"] = "octo-keygen-cpp" + self.cpp_info.names["pkg_config"] = "octo-keygen-cpp" diff --git a/recipes/octo-keygen-cpp/all/test_package/CMakeLists.txt b/recipes/octo-keygen-cpp/all/test_package/CMakeLists.txt index 7a68c9f36c4bf5..ec355db2143f37 100644 --- a/recipes/octo-keygen-cpp/all/test_package/CMakeLists.txt +++ b/recipes/octo-keygen-cpp/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(octo-keygen-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} octo::octo-keygen-cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE octo::octo-keygen-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/octo-keygen-cpp/all/test_package/conanfile.py b/recipes/octo-keygen-cpp/all/test_package/conanfile.py index 6f1d3245dd7e80..bb7197d60a7c5d 100644 --- a/recipes/octo-keygen-cpp/all/test_package/conanfile.py +++ b/recipes/octo-keygen-cpp/all/test_package/conanfile.py @@ -7,11 +7,11 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "VirtualRunEnv" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" - def generate(self): - tc = CMakeToolchain(self) - tc.generate() + def requirements(self): + self.requires(self.tested_reference_str) def layout(self): cmake_layout(self) diff --git a/recipes/octo-keygen-cpp/all/test_package/test_package.cpp b/recipes/octo-keygen-cpp/all/test_package/test_package.cpp index 98222f149cce9a..418c7b3cdcaa5c 100644 --- a/recipes/octo-keygen-cpp/all/test_package/test_package.cpp +++ b/recipes/octo-keygen-cpp/all/test_package/test_package.cpp @@ -13,7 +13,6 @@ #include "octo-keygen-cpp/openssl/ssl-keypair.hpp" #include "octo-keygen-cpp/openssl/ssl-keypair-certificate-chain.hpp" #include "octo-keygen-cpp/openssl/ssl-keypair-certificate.hpp" -#include #include #include @@ -87,16 +86,6 @@ constexpr auto TARGET_CERT = "-----BEGIN CERTIFICATE-----\n" int main(int argc, char** argv) { - octo::logger::Logger logger("PSKeygen"); - std::shared_ptr config = - std::make_shared(); - octo::logger::SinkConfig console_writer_sink("Console", octo::logger::SinkConfig::SinkType::CONSOLE_SINK); - config->add_sink(console_writer_sink); - octo::logger::Manager::instance() - .editable_channel("PSKeygen") - .set_log_level(octo::logger::Log::LogLevel::DEBUG); - octo::logger::Manager::instance().configure(config); - auto ca = octo::keygen::ssl::SSLKeypairCertificateChain::load_certificate_chain( std::make_unique(ROOTCA) ); @@ -106,18 +95,11 @@ int main(int argc, char** argv) auto chain = octo::keygen::ssl::SSLKeypairCertificateChain::load_certificate_chain( std::make_unique(SUBCA) ); - logger.info() << "IS CA = " << ca->is_any_ca(); - logger.info() << "IS VALID CERT = " << ca->is_valid_chain(target.get(), - chain.get()); octo::keygen::KeygenPtr ssl_key_gen = std::make_shared(); octo::keygen::KeygenOptions ssl_opts; octo::keygen::KeypairPtr ssl_key_pair = ssl_key_gen->generate_keypair(ssl_opts); - logger.info() << "\n" << ssl_key_pair->private_key(); - logger.info() << "\n" << ssl_key_pair->public_key(); octo::keygen::KeygenOptions ssl_sign_opts; octo::keygen::KeypairCertificatePtr ssl_cert = ssl_key_gen->sign_key_pair(ssl_key_pair, ssl_sign_opts); - logger.info() << "\n" << ssl_cert->certificate(); - logger.info() << "\n" << ssl_cert->pretty_print_certificate_info(); } diff --git a/recipes/octo-logger-cpp/all/conandata.yml b/recipes/octo-logger-cpp/all/conandata.yml index 035fe6943e2027..92395bec9bd216 100644 --- a/recipes/octo-logger-cpp/all/conandata.yml +++ b/recipes/octo-logger-cpp/all/conandata.yml @@ -1,10 +1,13 @@ sources: - "1.1.0": - sha256: 69057ab2f0ba0754dc6dce1f27c6f1fd9ad1e97c828779a801273bb3e9123e4e - url: https://github.com/ofiriluz/octo-logger-cpp/archive/refs/tags/v1.1.0.tar.gz - "1.2.0": - sha256: 54381d6dbc80c6be6d8b9e087a4b55fae6ff5d07c3c2399bc7e1c94252260bf2 - url: https://github.com/ofiriluz/octo-logger-cpp/archive/refs/tags/v1.2.0.tar.gz + "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" + "1.2.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/refs/tags/v1.2.0.tar.gz" + sha256: "54381d6dbc80c6be6d8b9e087a4b55fae6ff5d07c3c2399bc7e1c94252260bf2" + "1.1.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/refs/tags/v1.1.0.tar.gz" + sha256: "69057ab2f0ba0754dc6dce1f27c6f1fd9ad1e97c828779a801273bb3e9123e4e" diff --git a/recipes/octo-logger-cpp/all/conanfile.py b/recipes/octo-logger-cpp/all/conanfile.py index cdb8df5c161d22..d8b77698e6f0db 100644 --- a/recipes/octo-logger-cpp/all/conanfile.py +++ b/recipes/octo-logger-cpp/all/conanfile.py @@ -1,8 +1,9 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import get, copy -from conan.tools.build import check_min_cppstd 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 +from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version import os @@ -11,19 +12,24 @@ class OctoLoggerCPPConan(ConanFile): name = "octo-logger-cpp" + description = "CPP Stream based logging library" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ofiriluz/octo-logger-cpp" - description = "Octo logger library" - topics = ("logging", "cpp") - settings = "os", "compiler", "build_type", "arch" + topics = ("logging", "stream", "syslog", "cloudwatch") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" options = { - "with_aws": [True, False] + "with_aws": [True, False], } default_options = { - "with_aws": False + "with_aws": False, } + @property + def _min_cppstd(self): + return 17 + @property def _compilers_minimum_version(self): return { @@ -31,7 +37,7 @@ def _compilers_minimum_version(self): "clang": "9", "apple-clang": "11", "Visual Studio": "16", - "msvc": "1923", + "msvc": "192", } @property @@ -42,51 +48,46 @@ def configure(self): if not self._aws_supported: del self.options.with_aws - def generate(self): - tc = CMakeToolchain(self) - tc.variables["DISABLE_TESTS"] = True - tc.variables["DISABLE_EXAMPLES"] = True - if self.options.get_safe("with_aws"): - tc.variables["WITH_AWS"] = True - tc.generate() - cd = CMakeDeps(self) - cd.generate() - def layout(self): cmake_layout(self, src_folder="src") - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, "17") + def requirements(self): + self.requires("fmt/10.1.1", transitive_headers=True) + if self.options.get_safe("with_aws"): + self.requires("nlohmann_json/3.11.2") + self.requires("aws-sdk-cpp/1.9.234") - minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) - if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + 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.name} requires C++17, which your compiler does not support." + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - else: - self.output.warn(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": - raise ConanInvalidConfiguration(f"{self.name} does not support clang with libc++. Use libstdc++ instead.") - if self.settings.compiler == "Visual Studio" and self.settings.compiler.runtime in ["MTd", "MT"]: - raise ConanInvalidConfiguration(f"{self.name} does not support MSVC MT/MTd configurations, only MD/MDd is supported") + raise ConanInvalidConfiguration(f"{self.ref} does not support clang with libc++. Use libstdc++ instead.") + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC static runtime. Use dynamic runtime instead.") if self.options.get_safe("with_aws"): if not self.dependencies["aws-sdk-cpp"].options.logs: - raise ConanInvalidConfiguration(f"{self.name} requires the option aws-sdk-cpp:logs=True") + raise ConanInvalidConfiguration(f"{self.ref} requires the option aws-sdk-cpp:logs=True") + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <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 requirements(self): - self.requires("fmt/9.0.0") + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DISABLE_TESTS"] = True + tc.variables["DISABLE_EXAMPLES"] = True if self.options.get_safe("with_aws"): - self.requires("nlohmann_json/3.11.2") - self.requires("aws-sdk-cpp/1.9.234") - - def build_requirements(self): - self.build_requires("cmake/3.24.0") + tc.variables["WITH_AWS"] = True + tc.generate() + cd = CMakeDeps(self) + cd.generate() def build(self): cmake = CMake(self) @@ -101,11 +102,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "octo-logger-cpp") self.cpp_info.set_property("cmake_target_name", "octo::octo-logger-cpp") - self.cpp_info.set_property("pkg_config_name", "octo-logger-cpp") self.cpp_info.libs = ["octo-logger-cpp"] - self.cpp_info.names["cmake_find_package"] = "octo-logger-cpp" - self.cpp_info.names["cmake_find_package_multi"] = "octo-logger-cpp" - self.cpp_info.names["pkg_config"] = "octo-logger-cpp" self.cpp_info.requires = ["fmt::fmt"] if self.options.get_safe("with_aws"): self.cpp_info.requires.extend([ diff --git a/recipes/octo-logger-cpp/all/test_package/CMakeLists.txt b/recipes/octo-logger-cpp/all/test_package/CMakeLists.txt index 4cdb390261544d..f7d178a90b8eed 100644 --- a/recipes/octo-logger-cpp/all/test_package/CMakeLists.txt +++ b/recipes/octo-logger-cpp/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(octo-logger-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} octo::octo-logger-cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE octo::octo-logger-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/octo-logger-cpp/all/test_package/conanfile.py b/recipes/octo-logger-cpp/all/test_package/conanfile.py index 696c343fa84f41..ef5d7042163ecc 100644 --- a/recipes/octo-logger-cpp/all/test_package/conanfile.py +++ b/recipes/octo-logger-cpp/all/test_package/conanfile.py @@ -1,17 +1,16 @@ -from conans import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +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 = "CMakeDeps", "VirtualRunEnv" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" - def generate(self): - tc = CMakeToolchain(self) - tc.generate() + def requirements(self): + self.requires(self.tested_reference_str) def layout(self): cmake_layout(self) @@ -23,4 +22,5 @@ def build(self): def test(self): if can_run(self): - self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/octo-logger-cpp/config.yml b/recipes/octo-logger-cpp/config.yml index 14adddf7ca35b4..76947dd2891c25 100644 --- a/recipes/octo-logger-cpp/config.yml +++ b/recipes/octo-logger-cpp/config.yml @@ -1,7 +1,9 @@ versions: - "1.1.0": + "1.5.0": + folder: "all" + "1.4.0": folder: "all" "1.2.0": folder: "all" - "1.4.0": + "1.1.0": folder: "all" diff --git a/recipes/octo-wildcardmatching-cpp/all/conanfile.py b/recipes/octo-wildcardmatching-cpp/all/conanfile.py index f22d6f51767b8a..c8622ee725469f 100644 --- a/recipes/octo-wildcardmatching-cpp/all/conanfile.py +++ b/recipes/octo-wildcardmatching-cpp/all/conanfile.py @@ -1,8 +1,9 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import get, copy -from conan.tools.build import check_min_cppstd 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 +from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version import os @@ -16,8 +17,13 @@ class OctoWildcardMatchingCPPConan(ConanFile): homepage = "https://github.com/ofiriluz/octo-wildcardmatching-cpp" description = "Octo wildcardmatching library" topics = ("wildcard", "regex", "patterns", "cpp") + package_type = "static-library" settings = "os", "compiler", "build_type", "arch" + @property + def _min_cppstd(self): + return "17" + @property def _compilers_minimum_version(self): return { @@ -25,42 +31,38 @@ def _compilers_minimum_version(self): "clang": "9", "apple-clang": "11", "Visual Studio": "16", - "msvc": "1923", + "msvc": "192", } - def generate(self): - tc = CMakeToolchain(self) - tc.variables["DISABLE_TESTS"] = True - tc.variables["DISABLE_EXAMPLES"] = True - tc.generate() - cd = CMakeDeps(self) - cd.generate() - def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, "17") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) - if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + 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.name} requires C++17, which your compiler does not support." + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - else: - self.output.warn(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": - raise ConanInvalidConfiguration(f"{self.name} does not support clang with libc++. Use libstdc++ instead.") - if self.settings.compiler == "Visual Studio" and self.settings.compiler.runtime in ["MTd", "MT"]: - raise ConanInvalidConfiguration(f"{self.name} does not support MSVC MT/MTd configurations, only MD/MDd is supported") + raise ConanInvalidConfiguration(f"{self.ref} does not support clang with libc++. Use libstdc++ instead.") + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC static runtime. Use dynamic runtime instead.") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <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 build_requirements(self): - self.build_requires("cmake/3.24.0") + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DISABLE_TESTS"] = True + tc.variables["DISABLE_EXAMPLES"] = True + tc.generate() def build(self): cmake = CMake(self) @@ -75,8 +77,4 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "octo-wildcardmatching-cpp") self.cpp_info.set_property("cmake_target_name", "octo::octo-wildcardmatching-cpp") - self.cpp_info.set_property("pkg_config_name", "octo-wildcardmatching-cpp") self.cpp_info.libs = ["octo-wildcardmatching-cpp"] - self.cpp_info.names["cmake_find_package"] = "octo-wildcardmatching-cpp" - self.cpp_info.names["cmake_find_package_multi"] = "octo-wildcardmatching-cpp" - self.cpp_info.names["pkg_config"] = "octo-wildcardmatching-cpp" diff --git a/recipes/octo-wildcardmatching-cpp/all/test_package/CMakeLists.txt b/recipes/octo-wildcardmatching-cpp/all/test_package/CMakeLists.txt index d02959b9b71e55..10219d5afbaa21 100644 --- a/recipes/octo-wildcardmatching-cpp/all/test_package/CMakeLists.txt +++ b/recipes/octo-wildcardmatching-cpp/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(octo-wildcardmatching-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} octo::octo-wildcardmatching-cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE octo::octo-wildcardmatching-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/octo-wildcardmatching-cpp/all/test_package/conanfile.py b/recipes/octo-wildcardmatching-cpp/all/test_package/conanfile.py index 62e07ce5add598..254feca1042876 100644 --- a/recipes/octo-wildcardmatching-cpp/all/test_package/conanfile.py +++ b/recipes/octo-wildcardmatching-cpp/all/test_package/conanfile.py @@ -1,23 +1,20 @@ -from conans import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain +from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout +from conan.tools.cmake import CMake, cmake_layout import os -required_conan_version = ">=1.43.0" - class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "VirtualRunEnv" - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() + 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() diff --git a/recipes/octomap/all/conandata.yml b/recipes/octomap/all/conandata.yml index badfa463524af4..4699a071746f81 100644 --- a/recipes/octomap/all/conandata.yml +++ b/recipes/octomap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.9.8": + url: "https://github.com/OctoMap/octomap/archive/v1.9.8.tar.gz" + sha256: "417af6da4e855e9a83b93458aa98b01a2c88f880088baad2b59d323ce162586e" "1.9.7": url: "https://github.com/OctoMap/octomap/archive/v1.9.7.tar.gz" sha256: "3e9ac020686ceb4e17e161bffc5a0dafd9cccab33adeb9adee59a61c418ea1c1" @@ -12,6 +15,14 @@ sources: url: "https://github.com/OctoMap/octomap/archive/v1.9.3.tar.gz" sha256: "8488de97ed2c8f4757bfbaf3225e82a9e36783dce1f573b3bde1cf968aa89696" patches: + "1.9.8": + - patch_file: "patches/1.9.5-0001-targets-outputname-collision.patch" + patch_description: "CMake: build either shared or static, and avoid name collision" + patch_type: "conan" + - patch_file: "patches/1.9.8-0001-cpp17-compat.patch" + patch_description: "Robust C++17 compatibility" + patch_type: "portability" + patch_source: "https://github.com/OctoMap/octomap/pull/394" "1.9.7": - patch_file: "patches/1.9.5-0001-targets-outputname-collision.patch" patch_description: "CMake: build either shared or static, and avoid name collision" diff --git a/recipes/octomap/all/patches/1.9.8-0001-cpp17-compat.patch b/recipes/octomap/all/patches/1.9.8-0001-cpp17-compat.patch new file mode 100644 index 00000000000000..5855cdf69fd95e --- /dev/null +++ b/recipes/octomap/all/patches/1.9.8-0001-cpp17-compat.patch @@ -0,0 +1,442 @@ +--- a/octomap/include/octomap/AbstractOcTree.h ++++ b/octomap/include/octomap/AbstractOcTree.h +@@ -51,7 +51,7 @@ + friend class StaticMapInit; + public: + AbstractOcTree(); +- virtual ~AbstractOcTree() {}; ++ virtual ~AbstractOcTree() {} + + /// virtual constructor: creates a new object of same type + virtual AbstractOcTree* create() const = 0; +--- a/octomap/include/octomap/AbstractOccupancyOcTree.h ++++ b/octomap/include/octomap/AbstractOccupancyOcTree.h +@@ -52,7 +52,7 @@ + class AbstractOccupancyOcTree : public AbstractOcTree { + public: + AbstractOccupancyOcTree(); +- virtual ~AbstractOccupancyOcTree() {}; ++ virtual ~AbstractOccupancyOcTree() {} + + //-- IO + +--- a/octomap/include/octomap/ColorOcTree.h ++++ b/octomap/include/octomap/ColorOcTree.h +@@ -192,7 +192,7 @@ + * StaticMemberInitializer, causing this tree failing to register. + * Needs to be called from the constructor of this octree. + */ +- void ensureLinking() {}; ++ void ensureLinking() {} + }; + /// static member to ensure static initialization (only once) + static StaticMemberInitializer colorOcTreeMemberInit; +--- a/octomap/include/octomap/CountingOcTree.h ++++ b/octomap/include/octomap/CountingOcTree.h +@@ -110,7 +110,7 @@ + * StaticMemberInitializer, causing this tree failing to register. + * Needs to be called from the constructor of this octree. + */ +- void ensureLinking() {}; ++ void ensureLinking() {} + }; + /// static member to ensure static initialization (only once) + static StaticMemberInitializer countingOcTreeMemberInit; +--- a/octomap/include/octomap/OcTree.h ++++ b/octomap/include/octomap/OcTree.h +@@ -59,7 +59,7 @@ + */ + OcTree(std::string _filename); + +- virtual ~OcTree(){}; ++ virtual ~OcTree(){} + + /// virtual constructor: creates a new object of same type + /// (Covariant return type requires an up-to-date compiler) +@@ -89,7 +89,7 @@ + * StaticMemberInitializer, causing this tree failing to register. + * Needs to be called from the constructor of this octree. + */ +- void ensureLinking() {}; ++ void ensureLinking() {} + }; + + /// to ensure static initialization (only once) +--- a/octomap/include/octomap/OcTreeBase.h ++++ b/octomap/include/octomap/OcTreeBase.h +@@ -43,7 +43,7 @@ + template + class OcTreeBase : public OcTreeBaseImpl { + public: +- OcTreeBase(double res) : OcTreeBaseImpl(res) {}; ++ OcTreeBase(double res) : OcTreeBaseImpl(res) {} + + /// virtual constructor: creates a new object of same type + /// (Covariant return type requires an up-to-date compiler) +--- a/octomap/include/octomap/OcTreeBaseImpl.h ++++ b/octomap/include/octomap/OcTreeBaseImpl.h +@@ -244,7 +244,7 @@ + virtual size_t memoryUsage() const; + + /// \return Memory usage of a single octree node +- virtual inline size_t memoryUsageNode() const {return sizeof(NODE); }; ++ virtual inline size_t memoryUsageNode() const {return sizeof(NODE); } + + /// \return Memory usage of a full grid of the same size as the OcTree in bytes (for comparison) + /// \note this can be larger than the adressable memory - size_t may not be enough to hold it! +@@ -324,12 +324,12 @@ + typedef leaf_iterator iterator; + + /// @return beginning of the tree as leaf iterator +- iterator begin(unsigned char maxDepth=0) const {return iterator(this, maxDepth);}; ++ iterator begin(unsigned char maxDepth=0) const {return iterator(this, maxDepth);} + /// @return end of the tree as leaf iterator +- const iterator end() const {return leaf_iterator_end;}; // TODO: RVE? ++ const iterator end() const {return leaf_iterator_end;} // TODO: RVE? + + /// @return beginning of the tree as leaf iterator +- leaf_iterator begin_leafs(unsigned char maxDepth=0) const {return leaf_iterator(this, maxDepth);}; ++ leaf_iterator begin_leafs(unsigned char maxDepth=0) const {return leaf_iterator(this, maxDepth);} + /// @return end of the tree as leaf iterator + const leaf_iterator end_leafs() const {return leaf_iterator_end;} + +--- a/octomap/include/octomap/OcTreeDataNode.h ++++ b/octomap/include/octomap/OcTreeDataNode.h +@@ -100,9 +100,9 @@ + OCTOMAP_DEPRECATED(bool hasChildren() const); + + /// @return value stored in the node +- T getValue() const{return value;}; ++ T getValue() const{return value;} + /// sets value to be stored in the node +- void setValue(T v) {value = v;}; ++ void setValue(T v) {value = v;} + + // file IO: + +--- a/octomap/include/octomap/OcTreeIterator.hxx ++++ b/octomap/include/octomap/OcTreeIterator.hxx +@@ -95,7 +95,7 @@ + maxDepth = other.maxDepth; + stack = other.stack; + return *this; +- }; ++ } + + /// Ptr operator will return the current node in the octree which the + /// iterator is referring to +@@ -213,7 +213,7 @@ + * @param ptree OcTreeBaseImpl on which the iterator is used on + * @param depth Maximum depth to traverse the tree. 0 (default): unlimited + */ +- tree_iterator(OcTreeBaseImpl const* ptree, uint8_t depth=0) : iterator_base(ptree, depth) {}; ++ tree_iterator(OcTreeBaseImpl const* ptree, uint8_t depth=0) : iterator_base(ptree, depth) {} + + /// postfix increment operator of iterator (it++) + tree_iterator operator++(int){ +@@ -280,7 +280,7 @@ + } + } + +- leaf_iterator(const leaf_iterator& other) : iterator_base(other) {}; ++ leaf_iterator(const leaf_iterator& other) : iterator_base(other) {} + + /// postfix increment operator of iterator (it++) + leaf_iterator operator++(int){ +@@ -334,7 +334,7 @@ + */ + class leaf_bbx_iterator : public iterator_base { + public: +- leaf_bbx_iterator() : iterator_base() {}; ++ leaf_bbx_iterator() : iterator_base() {} + /** + * Constructor of the iterator. The bounding box corners min and max are + * converted into an OcTreeKey first. +@@ -425,7 +425,7 @@ + + + return *this; +- }; ++ } + + protected: + +--- a/octomap/include/octomap/OcTreeStamped.h ++++ b/octomap/include/octomap/OcTreeStamped.h +@@ -116,7 +116,7 @@ + * StaticMemberInitializer, causing this tree failing to register. + * Needs to be called from the constructor of this octree. + */ +- void ensureLinking() {}; ++ void ensureLinking() {} + }; + /// to ensure static initialization (only once) + static StaticMemberInitializer ocTreeStampedMemberInit; +--- a/octomap/include/octomap/ScanGraph.h ++++ b/octomap/include/octomap/ScanGraph.h +@@ -115,7 +115,7 @@ + + public: + +- ScanGraph() {}; ++ ScanGraph() {} + ~ScanGraph(); + + /// Clears all nodes and edges, and will delete the corresponding objects +--- a/octomap/src/Pointcloud.cpp ++++ b/octomap/src/Pointcloud.cpp +@@ -38,7 +38,7 @@ + + #if defined(_MSC_VER) || defined(_LIBCPP_VERSION) + #include +- #if __cplusplus > 199711L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L) + #include + #endif + #else +@@ -213,7 +213,7 @@ + #if defined(_MSC_VER) || defined(_LIBCPP_VERSION) + samples.reserve(this->size()); + samples.insert(samples.end(), this->begin(), this->end()); +- #if __cplusplus > 199711L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L) + std::random_device r; + std::mt19937 urbg(r()); + std::shuffle(samples.begin(), samples.end(), urbg); +--- a/octomap/src/compare_octrees.cpp ++++ b/octomap/src/compare_octrees.cpp +@@ -132,7 +132,7 @@ + else + kld +=log(p1/p2)*p1 + log((1-p1)/(1-p2))*(1-p1); + +-#if __cplusplus >= 201103L ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L) + if (std::isnan(kld)){ + #else + if (isnan(kld)){ +--- a/octovis/include/octovis/OcTreeDrawer.h ++++ b/octovis/include/octovis/OcTreeDrawer.h +@@ -62,14 +62,14 @@ + void setAlternativeDrawing(bool flag){m_alternativeDrawing = flag;} + + void enableOcTree(bool enabled = true); +- void enableOcTreeCells(bool enabled = true) { m_update = true; m_drawOccupied = enabled; }; +- void enableFreespace(bool enabled = true) { m_update = true; m_drawFree = enabled; }; +- void enableSelection(bool enabled = true) { m_update = true; m_drawSelection = enabled; }; +- void setMax_tree_depth(unsigned int max_tree_depth) { m_update = true; m_max_tree_depth = max_tree_depth;}; ++ void enableOcTreeCells(bool enabled = true) { m_update = true; m_drawOccupied = enabled; } ++ void enableFreespace(bool enabled = true) { m_update = true; m_drawFree = enabled; } ++ void enableSelection(bool enabled = true) { m_update = true; m_drawSelection = enabled; } ++ void setMax_tree_depth(unsigned int max_tree_depth) { m_update = true; m_max_tree_depth = max_tree_depth;} + + // set new origin (move object) + void setOrigin(octomap::pose6d t); +- void enableAxes(bool enabled = true) { m_update = true; m_displayAxes = enabled; }; ++ void enableAxes(bool enabled = true) { m_update = true; m_displayAxes = enabled; } + + protected: + //void clearOcTree(); +--- a/octovis/include/octovis/SceneObject.h ++++ b/octovis/include/octovis/SceneObject.h +@@ -57,7 +57,7 @@ + + public: + SceneObject(); +- virtual ~SceneObject(){}; ++ virtual ~SceneObject(){} + + /** + * Actual draw function which will be called to visualize the object +@@ -67,7 +67,7 @@ + /** + * Clears the object's representation (will be called when it gets invalid) + */ +- virtual void clear(){}; ++ virtual void clear(){} + + public: + //! the color mode has to be set before calling OcTreDrawer::setMap() +@@ -95,8 +95,8 @@ + */ + class ScanGraphDrawer : public SceneObject { + public: +- ScanGraphDrawer(): SceneObject(){}; +- virtual ~ScanGraphDrawer(){}; ++ ScanGraphDrawer(): SceneObject(){} ++ virtual ~ScanGraphDrawer(){} + + /** + * Notifies drawer of a new or changed ScanGraph, so that the internal +--- a/octovis/include/octovis/ViewerSettings.h ++++ b/octovis/include/octovis/ViewerSettings.h +@@ -40,12 +40,12 @@ + public: + ViewerSettings(QWidget *parent = 0); + ~ViewerSettings(); +- double getResolution(){return ui.resolution->value(); }; +- void setResolution(double resolution){ui.resolution->setValue(resolution);}; +- unsigned int getLaserType(){return ui.laserType->currentIndex(); }; +- void setLaserType(int type){ui.laserType->setCurrentIndex(type); }; +- double getMaxRange(){return ui.maxRange->value(); }; +- void setMaxRange(double range){ui.maxRange->setValue(range); }; ++ double getResolution(){return ui.resolution->value(); } ++ void setResolution(double resolution){ui.resolution->setValue(resolution);} ++ unsigned int getLaserType(){return ui.laserType->currentIndex(); } ++ void setLaserType(int type){ui.laserType->setCurrentIndex(type); } ++ double getMaxRange(){return ui.maxRange->value(); } ++ void setMaxRange(double range){ui.maxRange->setValue(range); } + + private: + Ui::ViewerSettingsClass ui; +--- a/octovis/src/extern/QGLViewer/VRender/Exporter.h ++++ b/octovis/src/extern/QGLViewer/VRender/Exporter.h +@@ -60,7 +60,7 @@ + { + public: + Exporter() ; +- virtual ~Exporter() {}; ++ virtual ~Exporter() {} + + virtual void exportToFile(const QString& filename,const std::vector&,VRenderParams&) ; + +@@ -92,7 +92,7 @@ + { + public: + EPSExporter() ; +- virtual ~EPSExporter() {}; ++ virtual ~EPSExporter() {} + + protected: + virtual void spewPoint(const Point *, QTextStream& out) ; +@@ -120,7 +120,7 @@ + class PSExporter: public EPSExporter + { + public: +- virtual ~PSExporter() {}; ++ virtual ~PSExporter() {} + protected: + virtual void writeFooter(QTextStream& out) const ; + }; +@@ -129,7 +129,7 @@ + { + public: + FIGExporter() ; +- virtual ~FIGExporter() {}; ++ virtual ~FIGExporter() {} + + protected: + virtual void spewPoint(const Point *, QTextStream& out) ; +--- a/octovis/src/extern/QGLViewer/camera.cpp ++++ b/octovis/src/extern/QGLViewer/camera.cpp +@@ -199,8 +199,8 @@ + \code + class myCamera :: public qglviewer::Camera + { +- virtual qreal Camera::zNear() const { return 0.001; }; +- virtual qreal Camera::zFar() const { return 100.0; }; ++ virtual qreal Camera::zNear() const { return 0.001; } ++ virtual qreal Camera::zFar() const { return 100.0; } + } + \endcode + +--- a/octovis/src/extern/QGLViewer/constraint.h ++++ b/octovis/src/extern/QGLViewer/constraint.h +@@ -197,7 +197,7 @@ + case MyAxisPlaneConstraint::FREE: ... break; + case MyAxisPlaneConstraint::CUSTOM: ... break; + } +- }; ++ } + + MyAxisPlaneConstraint* c = new MyAxisPlaneConstraint(); + // Note the Type conversion +@@ -209,11 +209,11 @@ + /*! @name Translation constraint */ + //@{ + /*! Overloading of Constraint::constrainTranslation(). Empty */ +- virtual void constrainTranslation(Vec& translation, Frame* const frame) { Q_UNUSED(translation); Q_UNUSED(frame); }; ++ virtual void constrainTranslation(Vec& translation, Frame* const frame) { Q_UNUSED(translation); Q_UNUSED(frame); } + + void setTranslationConstraint(Type type, const Vec& direction); + /*! Sets the Type() of the translationConstraintType(). Default is AxisPlaneConstraint::FREE. */ +- void setTranslationConstraintType(Type type) { translationConstraintType_ = type; }; ++ void setTranslationConstraintType(Type type) { translationConstraintType_ = type; } + void setTranslationConstraintDirection(const Vec& direction); + + /*! Returns the translation constraint Type(). +@@ -225,7 +225,7 @@ + + Use Frame::setPosition() to define the position of the constrained Frame before it gets + constrained. */ +- Type translationConstraintType() const { return translationConstraintType_; }; ++ Type translationConstraintType() const { return translationConstraintType_; } + /*! Returns the direction used by the translation constraint. + + It represents the axis direction (AxisPlaneConstraint::AXIS) or the plane normal +@@ -235,20 +235,20 @@ + The AxisPlaneConstraint derived classes express this direction in different coordinate system + (camera for CameraConstraint, local for LocalConstraint, and world for WorldConstraint). This + value can be modified with setTranslationConstraintDirection(). */ +- Vec translationConstraintDirection() const { return translationConstraintDir_; }; ++ Vec translationConstraintDirection() const { return translationConstraintDir_; } + //@} + + /*! @name Rotation constraint */ + //@{ + /*! Overloading of Constraint::constrainRotation(). Empty. */ +- virtual void constrainRotation(Quaternion& rotation, Frame* const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); }; ++ virtual void constrainRotation(Quaternion& rotation, Frame* const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); } + + void setRotationConstraint(Type type, const Vec& direction); + void setRotationConstraintType(Type type); + void setRotationConstraintDirection(const Vec& direction); + + /*! Returns the rotation constraint Type(). */ +- Type rotationConstraintType() const { return rotationConstraintType_; }; ++ Type rotationConstraintType() const { return rotationConstraintType_; } + /*! Returns the axis direction used by the rotation constraint. + + This direction is defined only when rotationConstraintType() is AxisPlaneConstraint::AXIS. +@@ -256,7 +256,7 @@ + The AxisPlaneConstraint derived classes express this direction in different coordinate system + (camera for CameraConstraint, local for LocalConstraint, and world for WorldConstraint). This + value can be modified with setRotationConstraintDirection(). */ +- Vec rotationConstraintDirection() const { return rotationConstraintDir_; }; ++ Vec rotationConstraintDirection() const { return rotationConstraintDir_; } + //@} + + private: +@@ -280,7 +280,7 @@ + { + public: + /*! Virtual destructor. Empty. */ +- virtual ~LocalConstraint() {}; ++ virtual ~LocalConstraint() {} + + virtual void constrainTranslation(Vec& translation, Frame* const frame); + virtual void constrainRotation (Quaternion& rotation, Frame* const frame); +@@ -300,7 +300,7 @@ + { + public: + /*! Virtual destructor. Empty. */ +- virtual ~WorldConstraint() {}; ++ virtual ~WorldConstraint() {} + + virtual void constrainTranslation(Vec& translation, Frame* const frame); + virtual void constrainRotation (Quaternion& rotation, Frame* const frame); +@@ -321,13 +321,13 @@ + public: + explicit CameraConstraint(const Camera* const camera); + /*! Virtual destructor. Empty. */ +- virtual ~CameraConstraint() {}; ++ virtual ~CameraConstraint() {} + + virtual void constrainTranslation(Vec& translation, Frame* const frame); + virtual void constrainRotation (Quaternion& rotation, Frame* const frame); + + /*! Returns the associated Camera. Set using the CameraConstraint constructor. */ +- const Camera* camera() const { return camera_; }; ++ const Camera* camera() const { return camera_; } + + private: + const Camera* const camera_; diff --git a/recipes/octomap/config.yml b/recipes/octomap/config.yml index bbf53f61e28d4d..7b6ae3353a6fd9 100644 --- a/recipes/octomap/config.yml +++ b/recipes/octomap/config.yml @@ -1,4 +1,6 @@ versions: + "1.9.8": + folder: all "1.9.7": folder: all "1.9.6": diff --git a/recipes/ogdf/all/conandata.yml b/recipes/ogdf/all/conandata.yml index f4dd3d9efc6c31..c6c2b408e36ee5 100644 --- a/recipes/ogdf/all/conandata.yml +++ b/recipes/ogdf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2023.09": + url: "https://github.com/ogdf/ogdf/archive/refs/tags/elderberry-202309.tar.gz" + sha256: "3438205d3a6ff69d24c3a6db748d2a5a78688605baf3092456073901a2b623f3" "2022.02": url: "https://github.com/ogdf/ogdf/archive/refs/tags/dogwood-202202.tar.gz" sha256: "308cc2749c6a63520f7979bac86a04066dfea2fb9d3a5e89831318db404bfbf5" diff --git a/recipes/ogdf/all/conanfile.py b/recipes/ogdf/all/conanfile.py index e47d024478deba..cbdc4032988fcb 100644 --- a/recipes/ogdf/all/conanfile.py +++ b/recipes/ogdf/all/conanfile.py @@ -1,9 +1,7 @@ from conan import ConanFile from conan.tools.apple import fix_apple_shared_install_name from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.errors import ConanInvalidConfiguration from conan.tools.files import copy, get, replace_in_file, rmdir -from conan.tools.microsoft import is_msvc from os.path import join required_conan_version = ">=1.53.0" @@ -26,10 +24,6 @@ class OGDFConan(ConanFile): "fPIC": True, } - def validate(self): - if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -43,7 +37,7 @@ def configure(self): def requirements(self): self.requires("coin-clp/1.17.7") - self.requires("pugixml/1.13") + self.requires("pugixml/1.14") def layout(self): cmake_layout(self, src_folder="src") @@ -85,12 +79,13 @@ def package(self): copy(self, pattern="LICENSE*.txt", src=self.source_folder, dst=join(self.package_folder, "licenses")) copy(self, pattern="*.h", src=join(self.source_folder, "include"), dst=join(self.package_folder, "include")) copy(self, pattern="*.h", src=join(self.build_folder, "include"), dst=join(self.package_folder, "include")) + copy(self, pattern="*.lib", src=self.build_folder, dst=join(self.package_folder, "lib"), keep_path=False) if self.options.shared: copy(self, pattern="*.so*", src=self.build_folder, dst=join(self.package_folder, "lib")) copy(self, pattern="*.dylib*", src=self.build_folder, dst=join(self.package_folder, "lib")) + copy(self, pattern="*.dll", src=self.build_folder, dst=join(self.package_folder, "bin"), keep_path=False) else: copy(self, pattern="*.a", src=self.build_folder, dst=join(self.package_folder, "lib")) - copy(self, pattern="*.lib", src=self.build_folder, dst=join(self.package_folder, "lib"), keep_path=False) fix_apple_shared_install_name(self) def package_info(self): diff --git a/recipes/ogdf/config.yml b/recipes/ogdf/config.yml index 6ece5a73dbce4f..9860e459d4c286 100644 --- a/recipes/ogdf/config.yml +++ b/recipes/ogdf/config.yml @@ -1,3 +1,5 @@ versions: + "2023.09": + folder: all "2022.02": folder: all diff --git a/recipes/ohnet/all/conandata.yml b/recipes/ohnet/all/conandata.yml new file mode 100644 index 00000000000000..7e45066c8f0100 --- /dev/null +++ b/recipes/ohnet/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.36.5182": + url: "https://github.com/openhome/ohNet/archive/refs/tags/ohNet_1.36.5182.tar.gz" + sha256: "1489407b9bae13affa8f933a81fb5a43f16b29f5bf8048b68ea645afc0e53ced" +patches: + "1.36.5182": + - patch_file: "patches/0001-makefile-universal.patch" + patch_description: "Reduce gcc-centricity in Makefile" + patch_type: "conan" diff --git a/recipes/ohnet/all/conanfile.py b/recipes/ohnet/all/conanfile.py new file mode 100755 index 00000000000000..ad2031f5acf6bb --- /dev/null +++ b/recipes/ohnet/all/conanfile.py @@ -0,0 +1,149 @@ +from conan import ConanFile +from conan.tools.files import get, chdir, copy, mkdir, export_conandata_patches, apply_conandata_patches +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, NMakeToolchain +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class OhNetConan(ConanFile): + name = "ohnet" + description = "OpenHome Networking (ohNet) is a modern, cross platform, multi-language UPnP stack" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/openhome/ohNet" + topics = ("openhome", "ohnet", "upnp") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + short_paths = True + + def _get_openhome_architecture(self, args): + if is_apple_os(self): + if str(self.settings.arch).startswith("armv8"): + openhome_architecture = "arm64" + args.extend([f"openhome_architecture={openhome_architecture}", f"detected_openhome_architecture={openhome_architecture}"]) + return args + + 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 validate(self): + if is_msvc(self) and (self.options.shared or msvc_runtime_flag(self).startswith('MD')): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared builds with Visual Studio yet") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.make_args.append("-j1") + tc.generate() + + def build(self): + apply_conandata_patches(self) + targets = "ohNetDll TestsNative proxies devices" + additional_options="" + + with chdir(self, self.source_folder): + if is_msvc(self): + if self.settings.build_type == "Debug": + additional_options += " debug=1" + self.run(f"nmake /f OhNet.mak {targets} {additional_options}") + else: + args = [] + args = self._get_openhome_architecture(args) + args.append("rsync=no") + if str(self.settings.compiler.libcxx) == "libc++": + args.extend(["CPPFLAGS=-stdlib=libc++", "LDFLAGS=-stdlib=libc++"]) + autotools = Autotools(self) + autotools.make(args=args, target=targets) + + def package(self): + installlibdir = os.path.join(self.package_folder, "lib") + installincludedir = os.path.join(self.package_folder, "include") + additional_options="" + + copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + copy(self, "*", src=os.path.join(self.source_folder, "OpenHome", "Net", "ServiceGen"), dst=os.path.join(self.package_folder, "lib", "ServiceGen")) + mkdir(self, os.path.join(self.package_folder, "lib", "t4")) + + with chdir(self, self.source_folder): + if is_msvc(self): + if self.settings.build_type == "Debug": + additional_options += " debug=1" + self.run(f"nmake /f OhNet.mak install installdir={self.package_folder} installlibdir={installlibdir} installincludedir={installincludedir} {additional_options}") + else: + args = [f"prefix={self.package_folder}", f"installlibdir={installlibdir}", f"installincludedir={installincludedir}", "rsync=no"] + args = self._get_openhome_architecture(args) + autotools = Autotools(self) + autotools.make(args=args, target="install-libs install-includes") + if is_apple_os(self): + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.components["ohNet"].libs = ["ohNet"] + self.cpp_info.components["ohNet"].builddirs = [os.path.join("lib", "ServiceGen")] + self.cpp_info.components["ohNet"].set_property("cmake_target_name", "ohNet") + self.cpp_info.components["ohNet"].defines.extend(["DEFINE_LITTLE_ENDIAN"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ohNet"].system_libs.extend(["pthread", "m"]) + elif self.settings.os == "Windows": + self.cpp_info.components["ohNet"].system_libs.extend(["iphlpapi", "ws2_32", "dbghelp"]) + + self.cpp_info.components["ohNetCore"].libs = ["ohNetCore"] + self.cpp_info.components["ohNetCore"].builddirs = [os.path.join("lib", "ServiceGen")] + self.cpp_info.components["ohNetCore"].set_property("cmake_target_name", "ohNetCore") + self.cpp_info.components["ohNetCore"].defines.extend(["DEFINE_LITTLE_ENDIAN"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ohNetCore"].system_libs.extend(["pthread", "m"]) + elif self.settings.os == "Windows": + self.cpp_info.components["ohNetCore"].system_libs.extend(["iphlpapi", "ws2_32", "dbghelp"]) + elif self.settings.os == "Macos": + self.cpp_info.components["ohNetCore"].frameworks.extend(["CoreFoundation", "IOKit", "SystemConfiguration"]) + + self.cpp_info.components["ohNetDevices"].libs = ["ohNetDevices"] + self.cpp_info.components["ohNetDevices"].set_property("cmake_target_name", "ohNetDevices") + + self.cpp_info.components["ohNetProxies"].libs = ["ohNetProxies"] + self.cpp_info.components["ohNetProxies"].set_property("cmake_target_name", "ohNetProxies") + + self.cpp_info.components["TestFramework"].libs = ["TestFramework"] + self.cpp_info.components["TestFramework"].set_property("cmake_target_name", "TestFramework") + self.cpp_info.components["TestFramework"].requires = ["ohNetCore"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "ohNet" + self.cpp_info.names["cmake_find_package_multi"] = "ohNet" + self.cpp_info.names["pkg_config"] = "ohNet" + for component in ["ohNetCore", "OhNetDevices", "ohNetProxies", "TestFramework"]: + self.cpp_info.components[component].names["cmake_find_package"] = component + self.cpp_info.components[component].names["cmake_find_package_multi"] = component + self.cpp_info.components[component].set_property("cmake_target_name", component) diff --git a/recipes/ohnet/all/patches/0001-makefile-universal.patch b/recipes/ohnet/all/patches/0001-makefile-universal.patch new file mode 100644 index 00000000000000..487c6aa0a79e2e --- /dev/null +++ b/recipes/ohnet/all/patches/0001-makefile-universal.patch @@ -0,0 +1,220 @@ +diff --git a/Common.mak b/Common.mak +index a479b12a..82e5db60 100644 +--- a/Common.mak ++++ b/Common.mak +@@ -386,7 +386,7 @@ $(objdir)dnssd_clientshim.$(objext) : $(mDNSdir)/dnssd_clientshim.c $(headers) + $(objdir)dnssd_clientlib.$(objext) : $(mDNSdir)/dnssd_clientlib.c $(headers) + $(compiler)dnssd_clientlib.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/dnssd_clientlib.c + $(objdir)MdnsPlatform.$(objext) : OpenHome/Net/Device/Bonjour/MdnsPlatform.cpp $(headers) +- $(compiler)MdnsPlatform.$(objext) -c $(cflags_third_party) $(includes) OpenHome/Net/Device/Bonjour/MdnsPlatform.cpp ++ $(compiler)MdnsPlatform.$(objext) -c $(cppflags) $(cflags_third_party) $(includes) OpenHome/Net/Device/Bonjour/MdnsPlatform.cpp + $(objdir)MdnsProvider.$(objext) : OpenHome/Net/Device/Bonjour/MdnsProvider.cpp $(headers) + $(compiler)MdnsProvider.$(objext) -c $(cppflags) $(includes) OpenHome/Net/Device/Bonjour/MdnsProvider.cpp + $(objdir)Md5.$(objext) : OpenHome/md5.c $(headers) +diff --git a/Makefile b/Makefile +index 2f0cb07c..7b73494d 100644 +--- a/Makefile ++++ b/Makefile +@@ -6,7 +6,7 @@ rsync ?= yes + ifeq ($(rsync),yes) + cp = rsync -u + else +-cp = cp -u ++cp = cp + endif + + ifeq ($(debug),1) +@@ -27,11 +27,11 @@ endif + + # Figure out platform, openhome_system and openhome_architecture + +-gcc_machine = $(shell ${CROSS_COMPILE}gcc -dumpmachine) ++cc_machine = $(shell ${CROSS_COMPILE}$(CC) -dumpmachine) + MACHINE = $(shell uname -s) + + $(info CROSS_COMPILE: ${CROSS_COMPILE}) +-$(info Machine reported by compiler is: ${gcc_machine}) ++$(info Machine reported by compiler is: ${cc_machine}) + $(info Machine reported by uname is: ${MACHINE}) + $(info PLATFORM: ${PLATFORM}) + +@@ -57,7 +57,7 @@ ifeq ($(MACHINE),Darwin) + detected_openhome_architecture = x64 + endif + endif +-else ifneq (, $(findstring powerpc, $(gcc_machine))) ++else ifneq (, $(findstring powerpc, $(cc_machine))) + platform = Core-ppc32 + detected_openhome_system = Core + detected_openhome_architecture = ppc32 +@@ -69,11 +69,11 @@ else ifeq ($(freebsd), 1) + platform = FreeBSD + detected_openhome_system = FreeBSD + detected_openhome_architecture = x86 +- compiler = gcc -o $(objdir) +- link = ${CROSS_COMPILE}g++ $(platform_linkflags) ++ compiler = $(CC) -o $(objdir) ++ link = ${CROSS_COMPILE}$(CXX) $(platform_linkflags) + ar = ${CROSS_COMPILE}ar rc $(objdir) + else ifneq (,$(findstring Linux-x86,${PLATFORM})) +- ifneq (,$(findstring x86_64,$(gcc_machine))) ++ ifneq (,$(findstring x86_64,$(cc_machine))) + platform = Vanilla + detected_openhome_system = Linux + detected_openhome_architecture = x86 +@@ -85,11 +85,11 @@ else + platform ?= Vanilla + ifneq (,$(findstring Qnap,$(platform))) + detected_openhome_system = Qnap +- else ifneq (,$(findstring linux,$(gcc_machine))) ++ else ifneq (,$(findstring linux,$(cc_machine))) + detected_openhome_system = Linux + endif +- ifneq (,$(findstring arm,$(gcc_machine))) +- ifneq (,$(findstring linux-gnueabihf,$(gcc_machine))) ++ ifneq (,$(findstring arm,$(cc_machine))) ++ ifneq (,$(findstring linux-gnueabihf,$(cc_machine))) + detected_openhome_architecture = armhf + else ifeq (${detected_openhome_system},Qnap) + detected_openhome_architecture = x19 +@@ -97,34 +97,34 @@ else + detected_openhome_architecture = armel + endif + endif +- ifneq (,$(findstring i686,$(gcc_machine))) ++ ifneq (,$(findstring i686,$(cc_machine))) + detected_openhome_architecture = x86 + endif +- ifneq (,$(findstring i586,$(gcc_machine))) ++ ifneq (,$(findstring i586,$(cc_machine))) + detected_openhome_architecture = x86 + endif +- ifneq (,$(findstring i486,$(gcc_machine))) ++ ifneq (,$(findstring i486,$(cc_machine))) + detected_openhome_architecture = x86 + endif +- ifneq (,$(findstring i386,$(gcc_machine))) ++ ifneq (,$(findstring i386,$(cc_machine))) + detected_openhome_architecture = x86 + endif +- ifneq (,$(findstring amd64,$(gcc_machine))) ++ ifneq (,$(findstring amd64,$(cc_machine))) + detected_openhome_architecture = x64 + endif +- ifneq (,$(findstring x86_64,$(gcc_machine))) ++ ifneq (,$(findstring x86_64,$(cc_machine))) + detected_openhome_architecture = x64 + endif +- ifneq (,$(findstring mipsel,$(gcc_machine))) ++ ifneq (,$(findstring mipsel,$(cc_machine))) + detected_openhome_architecture = mipsel + endif +- ifneq (,$(findstring mips,$(gcc_machine))) ++ ifneq (,$(findstring mips,$(cc_machine))) + detected_openhome_architecture = mipsel + endif +- ifneq (,$(findstring aarch64,$(gcc_machine))) ++ ifneq (,$(findstring aarch64,$(cc_machine))) + detected_openhome_architecture = arm64 + endif +- ifneq (,$(findstring riscv64,$(gcc_machine))) ++ ifneq (,$(findstring riscv64,$(cc_machine))) + detected_openhome_architecture = riscv64 + endif + endif +@@ -215,7 +215,7 @@ ifeq ($(platform),Mac) + endif + + objdir = Build/Obj/$(osbuilddir)/$(build_dir)/ +- compiler = clang -fPIC -stdlib=libc++ -o $(objdir) ++ compiler = clang -fPIC -Qunused-arguments -stdlib=libc++ -o $(objdir) + link = clang++ -pthread -stdlib=libc++ $(platform_linkflags) + ar = ar rc $(objdir) + openhome_system = Mac +@@ -235,8 +235,8 @@ ifeq ($(platform), Core-ppc32) + osbuilddir = Core-ppc32 + objdir = Build/Obj/$(osbuilddir)/$(build_dir)/ + native_only = yes +- compiler = ${CROSS_COMPILE}gcc -o $(objdir) +- link = ${CROSS_COMPILE}g++ $(platform_linkflags) ++ compiler = ${CROSS_COMPILE}$(CC) -o $(objdir) ++ link = ${CROSS_COMPILE}$(CXX) $(platform_linkflags) + ar = ${CROSS_COMPILE}ar rc $(objdir) + endif + +@@ -252,8 +252,8 @@ ifeq ($(platform), Core-armv6) + osbuilddir = Core-armv6 + objdir = Build/Obj/$(osbuilddir)/$(build_dir)/ + native_only = yes +- compiler = ${CROSS_COMPILE}gcc -o $(objdir) +- link = ${CROSS_COMPILE}g++ $(platform_linkflags) ++ compiler = ${CROSS_COMPILE}$(CC) -o $(objdir) ++ link = ${CROSS_COMPILE}$(CXX) $(platform_linkflags) + ar = ${CROSS_COMPILE}ar rc $(objdir) + endif + +@@ -263,8 +263,14 @@ ifneq (,$(findstring $(platform),Vanilla Qnap-x86 Qnap-x19 Linux-ppc32)) + version_specific_cflags_third_party = -Wno-non-virtual-dtor + version_specific_java_cflags = -Wstrict-aliasing=0 + else +- gcc_min_ver = $(shell ${CROSS_COMPILE}gcc -dumpversion | cut -f2 -d'.') +- version_specific_cflags = $(shell if [ $(gcc_min_ver) -ge 6 ]; then echo '-Wno-psabi'; fi) ++ version_specific_cflags = ++ ifeq ($(CC), gcc) ++ gcc_min_ver = $(shell ${CROSS_COMPILE}gcc -dumpversion | cut -f2 -d'.') ++ gcc_ge_6 = $(shell if [ $(gcc_min_ver) -ge 6 ]; then echo 'yes'; fi) ++ ifeq ($(gcc_ge_6), yes) ++ version_specific_cflags = '-Wno-psabi' ++ endif ++ endif + version_specific_cflags += ${CROSS_COMPILE_CFLAGS} + version_specific_cflags_third_party = + version_specific_java_cflags = +@@ -276,8 +282,8 @@ ifneq (,$(findstring $(platform),Vanilla Qnap-x86 Qnap-x19 Linux-ppc32)) + + # Continuing with the non-Darwin settings... + objdir = Build/Obj/$(osdir)/$(build_dir)/ +- compiler = ${CROSS_COMPILE}gcc -o $(objdir) +- link = $(version_specific_library_path) ${CROSS_COMPILE}g++ $(platform_linkflags) ++ compiler = ${CROSS_COMPILE}$(CC) -o $(objdir) ++ link = $(version_specific_library_path) ${CROSS_COMPILE}$(CXX) $(platform_linkflags) + ar = $(version_specific_library_path) ${CROSS_COMPILE}ar rc $(objdir) + endif + +@@ -358,11 +364,11 @@ endian ?= LITTLE + cflags_base = $(CFLAGS) -fexceptions -Wall $(version_specific_cflags_third_party) -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_$(endian)_ENDIAN -DDEFINE_TRACE $(debug_specific_cflags) -fvisibility=hidden $(platform_cflags) + cflags_third_party = $(cflags_base) -Wno-int-to-pointer-cast + ifeq ($(nocpp11), yes) +- cppflags = $(cflags_base) -Werror ++ cppflags = $(CPPFLAGS) $(cflags_base) -Werror + else ifeq ($(platform),Mac) +- cppflags = $(cflags_base) -std=c++11 -Werror ++ cppflags = $(CPPFLAGS) $(cflags_base) -std=c++11 -Werror + else +- cppflags = $(cflags_base) -std=c++0x -Werror ++ cppflags = $(CPPFLAGS) $(cflags_base) -std=c++0x -Werror + endif + cflags = $(cflags_base) -Werror + inc_build = Build/Include +@@ -390,7 +396,7 @@ else ifeq ($(MACHINE), Darwin) + link_dll = $(version_specific_library_path) clang++ -pthread $(platform_linkflags) -shared -stdlib=libc++ + else + CROSS_COMPILE_LIBGCC ?= -shared-libgcc +- link_dll = $(version_specific_library_path) ${CROSS_COMPILE}g++ -pthread $(platform_linkflags) -shared ${CROSS_COMPILE_LIBGCC} ++ link_dll = $(version_specific_library_path) ${CROSS_COMPILE}$(CXX) -pthread $(platform_linkflags) -shared ${CROSS_COMPILE_LIBGCC} + endif + + csharp = mcs /nologo $(debug_csharp) +@@ -416,10 +422,10 @@ else + ifeq ($(platform), Linux-ppc32) + libjvm_dir ?= $(JAVA_HOME)/jre/lib/ppc/server + else +- ifneq (,$(findstring arm,$(gcc_machine))) ++ ifneq (,$(findstring arm,$(cc_machine))) + libjvm_dir ?= $(JAVA_HOME)/jre/lib/arm/server + else +- ifneq (,$(findstring x64,$(gcc_machine))) ++ ifneq (,$(findstring x64,$(cc_machine))) + libjvm_dir ?= $(JAVA_HOME)/jre/lib/amd64/server + else + libjvm_dir ?= $(JAVA_HOME)/jre/lib/i386/server diff --git a/recipes/ohnet/all/test_package/CMakeLists.txt b/recipes/ohnet/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..b864873d002820 --- /dev/null +++ b/recipes/ohnet/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(ohNet REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PUBLIC ohNetCore) diff --git a/recipes/ohnet/all/test_package/conanfile.py b/recipes/ohnet/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/ohnet/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ohnet/all/test_package/test_package.cpp b/recipes/ohnet/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..4d3ae89a2e2e05 --- /dev/null +++ b/recipes/ohnet/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +using namespace OpenHome::Net; + +int main() +{ + InitialisationParams* initParams = InitialisationParams::Create(); + UpnpLibrary::InitialiseMinimal(initParams); + delete initParams; + UpnpLibrary::Close(); +} diff --git a/recipes/ohnet/config.yml b/recipes/ohnet/config.yml new file mode 100644 index 00000000000000..f52e484dea6d6a --- /dev/null +++ b/recipes/ohnet/config.yml @@ -0,0 +1,3 @@ +versions: + "1.36.5182": + folder: all diff --git a/recipes/onetbb/2020.x/conandata.yml b/recipes/onetbb/2020.x/conandata.yml index de98a3aa2d71de..bca751ad9a8a8d 100644 --- a/recipes/onetbb/2020.x/conandata.yml +++ b/recipes/onetbb/2020.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "2020.3.3": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.3.3.tar.gz" + sha256: "494ac15f60e91d95ed7aec04f4e1d389b8a55bffc581d0fe9116b99336401963" "2020.3": url: "https://github.com/oneapi-src/oneTBB/archive/v2020.3.tar.gz" sha256: "ebc4f6aa47972daed1f7bf71d100ae5bf6931c2e3144cf299c8cc7d041dca2f3" diff --git a/recipes/onetbb/2020.x/conanfile.py b/recipes/onetbb/2020.x/conanfile.py index 0fd823e9ffd157..3975cf2c1c8b6b 100644 --- a/recipes/onetbb/2020.x/conanfile.py +++ b/recipes/onetbb/2020.x/conanfile.py @@ -1,27 +1,34 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration, ConanException -from conan.tools.files import get, replace_in_file, save, chdir, copy -from conan.tools.microsoft import msvc_runtime_flag, is_msvc -from conan.tools.scm import Version -from conans import tools as legacy_tools import os +import re import textwrap +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.files import chdir, copy, get, replace_in_file, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.intel import IntelCC +from conan.tools.layout import basic_layout +from conan.tools.microsoft import VCVars, msvs_toolset, msvc_runtime_flag, is_msvc +from conan.tools.scm import Version + required_conan_version = ">=1.53.0" class OneTBBConan(ConanFile): name = "onetbb" - license = "Apache-2.0" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/oneapi-src/oneTBB" description = ( "oneAPI Threading Building Blocks (oneTBB) lets you easily write parallel " "C++ programs that take full advantage of multicore performance, that " "are portable, composable and have future-proof scalability." ) + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/oneapi-src/oneTBB" topics = ("tbb", "threading", "parallelism", "tbbmalloc") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,18 +43,10 @@ class OneTBBConan(ConanFile): "tbbproxy": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - @property - def _is_clanglc(self): - return self.settings.os == "Windows" and self.settings.compiler == "clang" - @property def _base_compiler(self): base = self.settings.get_safe("compiler.base") @@ -55,6 +54,14 @@ def _base_compiler(self): return self.settings.compiler.base return self.settings.compiler + @property + def _is_msvc(self): + return str(self._base_compiler) in ["Visual Studio", "msvc"] + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -63,51 +70,42 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - def validate(self): - if self.settings.os == "Macos": - if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "8.0": - raise ConanInvalidConfiguration("%s %s couldn't be built by apple-clang < 8.0" % (self.name, self.version)) - if not self.options.shared: - self.output.warn("oneTBB strongly discourages usage of static linkage") - if self.options.tbbproxy and \ - (not self.options.shared or \ - not self.options.tbbmalloc): - raise ConanInvalidConfiguration("tbbproxy needs tbbmaloc and shared options") + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): del self.info.options.tbbmalloc del self.info.options.tbbproxy + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if is_apple_os(self): + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "8.0": + raise ConanInvalidConfiguration(f"{self.name} {self.version} couldn't be built by apple-clang < 8.0") + if not self.options.shared: + self.output.warning("oneTBB strongly discourages usage of static linkage") + if self.options.tbbproxy and (not self.options.shared or not self.options.tbbmalloc): + raise ConanInvalidConfiguration("tbbproxy needs tbbmaloc and shared options") + def build_requirements(self): if self._settings_build.os == "Windows": - if "CONAN_MAKE_PROGRAM" not in os.environ and not legacy_tools.which("make"): - self.tool_requires("make/4.2.1") + if not self.conf_info.get("tools.gnu:make_program", check_type=str): + self.tool_requires("make/4.3") def source(self): - get(self, **self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def build(self): - def add_flag(name, value): - if name in os.environ: - os.environ[name] += " " + value - else: - os.environ[name] = value - - # Get the version of the current compiler instead of gcc - linux_include = os.path.join(self._source_subfolder, "build", "linux.inc") - replace_in_file(self, linux_include, "shell gcc", "shell $(CC)") - replace_in_file(self, linux_include, "= gcc", "= $(CC)") - - if self.version != "2019_u9" and self.settings.build_type == "Debug": - replace_in_file(self, os.path.join(self._source_subfolder, "Makefile"), "release", "debug") - - if str(self._base_compiler) in ["Visual Studio", "msvc"]: - save(self, - os.path.join(self._source_subfolder, "build", "big_iron_msvc.inc"), + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + if self._is_msvc: + link_cmd = "xilib" if self.settings.compiler == "intel-cc" else "lib" + save( + self, + os.path.join(self.source_folder, "build", "big_iron_msvc.inc"), # copy of big_iron.inc adapted for MSVC - textwrap.dedent("""\ - LIB_LINK_CMD = {}.exe + textwrap.dedent(f"""\ + LIB_LINK_CMD = {link_cmd}.exe LIB_OUTPUT_KEY = /OUT: LIB_LINK_FLAGS = LIB_LINK_LIBS = @@ -128,39 +126,39 @@ def add_flag(name, value): MALLOC_NO_VERSION.DLL = MALLOCPROXY.DLL = MALLOCPROXY.DEF = - """.format("xilib" if self.settings.compiler == "intel" else "lib")) + """), ) - extra = "" if self.options.shared else "extra_inc=big_iron_msvc.inc" + if not self.options.shared: + tc.make_args.append("extra_inc=big_iron_msvc.inc") else: - extra = "" if self.options.shared else "extra_inc=big_iron.inc" + if not self.options.shared: + tc.make_args.append("extra_inc=big_iron.inc") arch = { "x86": "ia32", "x86_64": "intel64", "armv7": "armv7", - "armv8": "arm64" - if (self.settings.os == "iOS" or self.settings.os == "Macos") - else "aarch64", + "armv8": "arm64" if is_apple_os(self) else "aarch64", }[str(self.settings.arch)] - extra += " arch=%s" % arch + tc.make_args.append(f"arch={arch}") if self.settings.os == "iOS": - extra += " target=ios" + tc.make_args.append("target=ios") if str(self._base_compiler) in ("gcc", "clang", "apple-clang"): if str(self._base_compiler.libcxx) in ("libstdc++", "libstdc++11"): - extra += " stdlib=libstdc++" + tc.make_args.append("stdlib=libstdc++") elif str(self._base_compiler.libcxx) == "libc++": - extra += " stdlib=libc++" + tc.make_args.append("stdlib=libc++") - if str(self.settings.compiler) == "intel": - extra += " compiler=icc" + if str(self.settings.compiler) == "intel-cc": + tc.make_args.append("compiler=icc") elif str(self.settings.compiler) in ("clang", "apple-clang"): - extra += " compiler=clang" + tc.make_args.append("compiler=clang") else: - extra += " compiler=gcc" + tc.make_args.append("compiler=gcc") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: # runtime is supposed to track the version of the c++ stdlib, # the version of glibc, and the version of the linux kernel. # However, it isn't actually used anywhere other than for @@ -168,113 +166,123 @@ def add_flag(name, value): # TBB computes the value of this variable using gcc, which we # don't necessarily want to require when building this recipe. # Setting it to a dummy value prevents TBB from calling gcc. - extra += " runtime=gnu" - elif str(self._base_compiler) in ["Visual Studio", "msvc"]: + tc.make_args.append("runtime=gnu") + elif self._is_msvc: if "MT" in msvc_runtime_flag(self): runtime = "vc_mt" else: - if self.settings.compiler == "Visual Studio": - runtime = { - "8": "vc8", - "9": "vc9", - "10": "vc10", - "11": "vc11", - "12": "vc12", - "14": "vc14", - "15": "vc14.1", - "16": "vc14.2" - }.get(str(self._base_compiler.version), "vc14.2") + # Convert MSVC toolset to TBB runtime id + # v140 -> vc14, v141 -> vc14.1, etc + toolset = msvs_toolset(self) + m = re.fullmatch(r"v(\d+)(\d)", toolset) + if m: + runtime = f"vc{m[1]}" + (f".{m[2]}" if m[2] != "0" else "") else: - runtime = { - "190": "vc14", - "191": "vc14.1", - "192": "vc14.2" - }.get(str(self._base_compiler.version), "vc14.2") - extra += " runtime=%s" % runtime - - if self.settings.compiler == "intel": - extra += " compiler=icl" + self.output.warning(f"Unknown MSVC toolset: {toolset}") + runtime = "vc14.2" + tc.make_args.append(f"runtime={runtime}") + + if self.settings.compiler == "intel-cc": + tc.make_args.append("compiler=icl") else: - extra += " compiler=cl" - cxx_std_flag = legacy_tools.cppstd_flag(self.settings) - if cxx_std_flag: - cxx_std_value = ( - cxx_std_flag.split("=")[1] - if "=" in cxx_std_flag - else cxx_std_flag.split(":")[1] - if ":" in cxx_std_flag - else None - ) - if cxx_std_value: - extra += f" stdver={cxx_std_value}" - - make = legacy_tools.get_env("CONAN_MAKE_PROGRAM", legacy_tools.which("make") or legacy_tools.which("mingw32-make")) - if not make: - raise ConanException("This package needs 'make' in the path to build") - - with chdir(self, self._source_subfolder): - # intentionally not using AutoToolsBuildEnvironment for now - it's broken for clang-cl - if self._is_clanglc: - add_flag("CFLAGS", "-mrtm") - add_flag("CXXFLAGS", "-mrtm") - - targets = ["tbb", "tbbmalloc", "tbbproxy"] - context = legacy_tools.no_op() - if self.settings.compiler == "intel": - context = legacy_tools.intel_compilervars(self) - elif is_msvc(self): - # intentionally not using vcvars for clang-cl yet - context = legacy_tools.vcvars(self) - with context: - self.run("%s %s %s" % (make, extra, " ".join(targets))) + tc.make_args.append("compiler=cl") + elif self._is_clang_cl: + tc.extra_cflags.append("-mrtm") + tc.extra_cxxflags.append("-mrtm") + + tc.generate() + + if self.settings.compiler == "intel-cc": + intelcc = IntelCC(self) + intelcc.generate() + elif is_msvc(self): + # intentionally not using vcvars for clang-cl yet + vcvars = VCVars(self) + vcvars.generate() + + def _patch_sources(self): + # Fix LDFLAGS getting incorrectly applied to ar command + linux_include = os.path.join(self.source_folder, "build", "common_rules.inc") + replace_in_file(self, linux_include, "LIB_LINK_FLAGS += $(LDFLAGS)", "") + # Get the version of the current compiler instead of gcc + linux_include = os.path.join(self.source_folder, "build", "linux.inc") + replace_in_file(self, linux_include, "shell gcc", "shell $(CC)") + replace_in_file(self, linux_include, "= gcc", "= $(CC)") + if self.version != "2019_u9" and self.settings.build_type == "Debug": + replace_in_file(self, os.path.join(self.source_folder, "Makefile"), "release", "debug") + + def build(self): + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + for target in ["tbb", "tbbmalloc", "tbbproxy"]: + autotools.make(target) def package(self): - copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self._source_subfolder) - copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self._source_subfolder, "include")) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "include", "tbb", "compat"), src=os.path.join(self._source_subfolder, "include", "tbb", "compat")) - build_folder = os.path.join(self._source_subfolder, "build") + 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, "*", + dst=os.path.join(self.package_folder, "include", "tbb", "compat"), + src=os.path.join(self.source_folder, "include", "tbb", "compat")) + + build_folder = os.path.join(self.source_folder, "build") build_type = "debug" if self.settings.build_type == "Debug" else "release" - copy(self, pattern=f"*{build_type}*.lib", dst=os.path.join(self.package_folder, "lib"), src=build_folder, keep_path=False) - copy(self, pattern=f"*{build_type}*.a", dst=os.path.join(self.package_folder, "lib"), src=build_folder, keep_path=False) - copy(self, pattern=f"*{build_type}*.dll", dst=os.path.join(self.package_folder, "bin"), src=build_folder, keep_path=False) - copy(self, pattern=f"*{build_type}*.dylib", dst=os.path.join(self.package_folder, "lib"), src=build_folder, keep_path=False) + for extension in ["lib", "a", "dylib"]: + copy(self, f"*{build_type}*.{extension}", + dst=os.path.join(self.package_folder, "lib"), + src=build_folder, keep_path=False) + copy(self, f"*{build_type}*.dll", + dst=os.path.join(self.package_folder, "bin"), + src=build_folder, keep_path=False) + # Copy also .dlls to lib folder so consumers can link against them directly when using MinGW if self.settings.os == "Windows" and self.settings.compiler == "gcc": - copy(self, f"*{build_type}*.dll", dst=os.path.join(self.package_folder, "lib"), src=build_folder, keep_path=False) + copy(self, f"*{build_type}*.dll", + dst=os.path.join(self.package_folder, "lib"), + src=build_folder, keep_path=False) - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"] and self.options.shared: extension = "so" - if self.options.shared: - copy(self, f"*{build_type}*.{extension}.*", dst=os.path.join(self.package_folder, "lib"), src=build_folder, keep_path=False) - outputlibdir = os.path.join(self.package_folder, "lib") - with chdir(self, outputlibdir): - for fpath in os.listdir(outputlibdir): - filepath = fpath[0:fpath.rfind("." + extension) + len(extension) + 1] - self.run(f'ln -s "{fpath}" "{filepath}"', run_environment=True) + copy(self, f"*{build_type}*.{extension}.*", + dst=os.path.join(self.package_folder, "lib"), + src=build_folder, keep_path=False) + # Create libtbb.so.2 -> libtbb.so, etc symlinks + with chdir(self, os.path.join(self.package_folder, "lib")): + for fname in os.listdir("."): + fname_without_version = fname.split(f".{extension}", 1)[0] + f".{extension}" + self.run(f'ln -s "{fname}" "{fname_without_version}"') def package_info(self): self.cpp_info.set_property("cmake_file_name", "TBB") + self.cpp_info.set_property("cmake_target_name", "TBB::TBB") suffix = "_debug" if self.settings.build_type == "Debug" else "" # tbb self.cpp_info.components["libtbb"].set_property("cmake_target_name", "TBB::tbb") - self.cpp_info.components["libtbb"].libs = ["tbb{}".format(suffix)] + self.cpp_info.components["libtbb"].libs = [f"tbb{suffix}"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["libtbb"].system_libs = ["dl", "rt", "pthread"] + self.cpp_info.components["libtbb"].system_libs = ["m", "dl", "rt", "pthread"] # tbbmalloc if self.options.tbbmalloc: self.cpp_info.components["tbbmalloc"].set_property("cmake_target_name", "TBB::tbbmalloc") - self.cpp_info.components["tbbmalloc"].libs = ["tbbmalloc{}".format(suffix)] + self.cpp_info.components["tbbmalloc"].libs = [f"tbbmalloc{suffix}"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["tbbmalloc"].system_libs = ["dl", "pthread"] + self.cpp_info.components["tbbmalloc"].system_libs = ["m", "dl", "pthread"] # tbbmalloc_proxy if self.options.tbbproxy: self.cpp_info.components["tbbmalloc_proxy"].set_property("cmake_target_name", "TBB::tbbmalloc_proxy") - self.cpp_info.components["tbbmalloc_proxy"].libs = ["tbbmalloc_proxy{}".format(suffix)] + self.cpp_info.components["tbbmalloc_proxy"].libs = [f"tbbmalloc_proxy{suffix}"] self.cpp_info.components["tbbmalloc_proxy"].requires = ["tbbmalloc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["tbbmalloc_proxy"].system_libs = ["m"] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "TBB" diff --git a/recipes/onetbb/2020.x/test_package/CMakeLists.txt b/recipes/onetbb/2020.x/test_package/CMakeLists.txt index d5a40167452f4f..2dd759c70dd114 100644 --- a/recipes/onetbb/2020.x/test_package/CMakeLists.txt +++ b/recipes/onetbb/2020.x/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(TBB REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/onetbb/2020.x/test_package/conanfile.py b/recipes/onetbb/2020.x/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/onetbb/2020.x/test_package/conanfile.py +++ b/recipes/onetbb/2020.x/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/onetbb/2020.x/test_v1_package/CMakeLists.txt b/recipes/onetbb/2020.x/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/onetbb/2020.x/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/onetbb/2020.x/test_v1_package/conanfile.py b/recipes/onetbb/2020.x/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/onetbb/2020.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/onetbb/all/conandata.yml b/recipes/onetbb/all/conandata.yml index 9ccf39c2f9dca4..4839476518f75e 100644 --- a/recipes/onetbb/all/conandata.yml +++ b/recipes/onetbb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2021.10.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.10.0.tar.gz" + sha256: "487023a955e5a3cc6d3a0d5f89179f9b6c0ae7222613a7185b0227ba0c83700b" "2021.9.0": url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.9.0.tar.gz" sha256: "1ce48f34dada7837f510735ff1172f6e2c261b09460e3bf773b49791d247d24e" @@ -35,3 +38,9 @@ patches: patch_type: "portability" patch_source: "https://github.com/oneapi-src/oneTBB/pull/716.diff" patch_file: "patches/fix-overeager-stripping-of-compile-flag.diff" + - patch_description: "Use pkg_search_module with IMPORTED_TARGET" + patch_type: "portability" + patch_source: + - "https://github.com/oneapi-src/oneTBB/pull/448.diff" + - "https://github.com/oneapi-src/oneTBB/commit/df3096075a00942acbdd3ce9347f5298cc153fd6.diff" + patch_file: "patches/pkg-search-module-use-imported-target.diff" diff --git a/recipes/onetbb/all/conanfile.py b/recipes/onetbb/all/conanfile.py index 57b1bd6404c1ee..1651c9800e6fd9 100644 --- a/recipes/onetbb/all/conanfile.py +++ b/recipes/onetbb/all/conanfile.py @@ -1,7 +1,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, load, rmdir +from conan.tools.gnu import PkgConfigDeps from conan.tools.scm import Version import os import re @@ -19,68 +22,94 @@ 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 = "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 + return "2_5" if Version(self.version) >= "2021.4.0" else "2_4" + + @property + def _tbbbind_supported(self): + return Version(self.version) >= "2021.1.1" and not self.settings.os == "Macos" + + @property + def _tbbbind_build(self): + return self.options.get_safe("tbbbind", False) and self._tbbbind_supported + + @property + def _tbbbind_explicit_hwloc(self): + # during cross-compilation, oneTBB does not search for HWLOC and we need to specify it explicitly + # but then oneTBB creates an imported SHARED target from provided paths, so we have to set shared=True + return self._tbbbind_build and cross_building(self) + 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 - 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 def layout(self): cmake_layout(self, src_folder="src") - 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 requirements(self): + if self._tbbbind_build: + self.requires("hwloc/2.9.3") - def validate_build(self): + 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") + + # Old versions used to have shared option before hwloc dependency was moved to shared only + if self._tbbbind_explicit_hwloc and not self.dependencies["hwloc"].options.get_safe("shared", True): + raise ConanInvalidConfiguration(f"{self.ref} requires hwloc:shared=True to be built.") + + def build_requirements(self): + if self._tbbbind_build and not self._tbbbind_explicit_hwloc: + 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], strip_root=True) def generate(self): + env = VirtualBuildEnv(self) + env.generate() + toolchain = CMakeToolchain(self) toolchain.variables["TBB_TEST"] = False toolchain.variables["TBB_STRICT"] = False @@ -88,10 +117,25 @@ 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: + hwloc_package_folder = self.dependencies["hwloc"].package_folder + hwloc_lib_name = "hwloc.lib" if self.settings.os == "Windows" else "libhwloc.so" + toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_LIBRARY_PATH"] = \ + os.path.join(hwloc_package_folder, "lib", hwloc_lib_name).replace("\\", "/") + toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_INCLUDE_PATH"] = \ + os.path.join(hwloc_package_folder, "include").replace("\\", "/") + if self.settings.os == "Windows": + toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_DLL_PATH"] = \ + os.path.join(hwloc_package_folder, "bin", "hwloc.dll").replace("\\", "/") toolchain.generate() + if self._tbbbind_build and not self._tbbbind_explicit_hwloc: + deps = PkgConfigDeps(self) + deps.generate() + def build(self): apply_conandata_patches(self) cmake = CMake(self) @@ -109,6 +153,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "TBB") self.cpp_info.set_property("pkg_config_name", "tbb") + self.cpp_info.set_property("cmake_config_version_compat", "AnyNewerVersion") def lib_name(name): if self.settings.build_type == "Debug": @@ -136,7 +181,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") @@ -145,7 +190,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/onetbb/all/patches/pkg-search-module-use-imported-target.diff b/recipes/onetbb/all/patches/pkg-search-module-use-imported-target.diff new file mode 100644 index 00000000000000..e1a3505708cbad --- /dev/null +++ b/recipes/onetbb/all/patches/pkg-search-module-use-imported-target.diff @@ -0,0 +1,97 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 34a23d40..d569d57e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,6 +100,8 @@ option(TBB_NO_APPCONTAINER "Apply /APPCONTAINER:NO (for testing binaries for Win + option(TBB4PY_BUILD "Enable tbb4py build" OFF) + option(TBB_CPF "Enable preview features of the library" OFF) + option(TBB_FIND_PACKAGE "Enable search for external oneTBB using find_package instead of build from sources" OFF) ++option(TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH "Disable HWLOC automatic search by pkg-config tool" OFF) ++ + + if (NOT DEFINED BUILD_SHARED_LIBS) + set(BUILD_SHARED_LIBS ON) +@@ -194,7 +196,7 @@ else() + if (NOT "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips") + add_subdirectory(src/tbbmalloc) + add_subdirectory(src/tbbmalloc_proxy) +- if (APPLE) ++ if (APPLE OR NOT BUILD_SHARED_LIBS) + message(STATUS "TBBBind build target is disabled due to unsupported environment") + else() + add_subdirectory(src/tbbbind) +diff --git a/cmake/hwloc_detection.cmake b/cmake/hwloc_detection.cmake +index f1740662..e1806a0f 100644 +--- a/cmake/hwloc_detection.cmake ++++ b/cmake/hwloc_detection.cmake +@@ -45,11 +45,15 @@ endforeach() + + unset(HWLOC_TARGET_NAME) + +-if (NOT HWLOC_TARGET_EXPLICITLY_DEFINED) ++if (NOT HWLOC_TARGET_EXPLICITLY_DEFINED AND ++ # No hwloc auto detection for cross compilation ++ NOT CMAKE_CROSSCOMPILING AND ++ NOT TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH ++) + find_package(PkgConfig QUIET) +- if (PKG_CONFIG_FOUND) +- pkg_search_module(HWLOC hwloc) +- if (HWLOC_FOUND) ++ if (PKG_CONFIG_FOUND AND NOT CMAKE_VERSION VERSION_LESS 3.6) ++ pkg_search_module(HWLOC hwloc IMPORTED_TARGET) ++ if (TARGET PkgConfig::HWLOC) + if (HWLOC_VERSION VERSION_LESS 2) + set(TBBBIND_LIBRARY_NAME tbbbind) + elseif(HWLOC_VERSION VERSION_LESS 2.4) +@@ -60,4 +64,3 @@ if (NOT HWLOC_TARGET_EXPLICITLY_DEFINED) + endif() + endif() + endif() +- +diff --git a/src/tbbbind/CMakeLists.txt b/src/tbbbind/CMakeLists.txt +index da9dabfe..1a4c6ca0 100644 +--- a/src/tbbbind/CMakeLists.txt ++++ b/src/tbbbind/CMakeLists.txt +@@ -18,12 +18,13 @@ endif() + set(CMAKE_SKIP_BUILD_RPATH TRUE) + + function(tbbbind_build TBBBIND_NAME REQUIRED_HWLOC_TARGET) +- if (NOT TARGET ${REQUIRED_HWLOC_TARGET} AND NOT DEFINED HWLOC_LIBRARIES) ++ if (NOT TARGET ${REQUIRED_HWLOC_TARGET}) + message(STATUS "HWLOC target ${REQUIRED_HWLOC_TARGET} doesn't exist." + " The ${TBBBIND_NAME} target cannot be created") + return() + endif() + add_library(${TBBBIND_NAME} tbb_bind.cpp) ++ + add_library(TBB::${TBBBIND_NAME} ALIAS ${TBBBIND_NAME}) + + target_compile_definitions(${TBBBIND_NAME} +@@ -64,14 +65,12 @@ function(tbbbind_build TBBBIND_NAME REQUIRED_HWLOC_TARGET) + PRIVATE + ${TBB_LIB_LINK_FLAGS} + ${TBB_COMMON_LINK_FLAGS} +- ${HWLOC_LIBRARY_DIRS} # pkg-config defined + ) + else() + target_link_libraries(${TBBBIND_NAME} + PRIVATE + ${TBB_LIB_LINK_FLAGS} + ${TBB_COMMON_LINK_FLAGS} +- ${HWLOC_LIBRARY_DIRS} # pkg-config defined + ) + endif() + +@@ -90,9 +89,9 @@ function(tbbbind_build TBBBIND_NAME REQUIRED_HWLOC_TARGET) + endif() + endfunction() + +-if (NOT DEFINED HWLOC_TARGET_EXPLICITLY_DEFINED AND DEFINED HWLOC_LIBRARIES) ++if (NOT DEFINED HWLOC_TARGET_EXPLICITLY_DEFINED AND TARGET PkgConfig::HWLOC) + message(STATUS "The ${TBBBIND_LIBRARY_NAME} target will be configured using the HWLOC ${HWLOC_VERSION}") +- tbbbind_build(${TBBBIND_LIBRARY_NAME} ${HWLOC_LIBRARIES}) ++ tbbbind_build(${TBBBIND_LIBRARY_NAME} PkgConfig::HWLOC) + else() + tbbbind_build(tbbbind HWLOC::hwloc_1_11) + tbbbind_build(tbbbind_2_0 HWLOC::hwloc_2 ) diff --git a/recipes/onetbb/all/test_package/CMakeLists.txt b/recipes/onetbb/all/test_package/CMakeLists.txt index f510136a26a978..fbae62535650c2 100644 --- a/recipes/onetbb/all/test_package/CMakeLists.txt +++ b/recipes/onetbb/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(TBB REQUIRED CONFIG) diff --git a/recipes/onetbb/all/test_v1_package/CMakeLists.txt b/recipes/onetbb/all/test_v1_package/CMakeLists.txt index 0d20897301b68b..b21cc49efde95c 100644 --- a/recipes/onetbb/all/test_v1_package/CMakeLists.txt +++ b/recipes/onetbb/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) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/onetbb/config.yml b/recipes/onetbb/config.yml index 7995868f434adb..39b37264743028 100644 --- a/recipes/onetbb/config.yml +++ b/recipes/onetbb/config.yml @@ -1,4 +1,6 @@ versions: + "2021.10.0": + folder: all "2021.9.0": folder: all "2021.8.0": @@ -9,6 +11,8 @@ versions: folder: all "2021.3.0": folder: all + "2020.3.3": + folder: "2020.x" "2020.3": folder: "2020.x" "2020.2": diff --git a/recipes/oniguruma/all/conandata.yml b/recipes/oniguruma/all/conandata.yml index 1d4c5ee6c51923..d74493648d9a9c 100644 --- a/recipes/oniguruma/all/conandata.yml +++ b/recipes/oniguruma/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.9.9": + url: "https://github.com/kkos/oniguruma/releases/download/v6.9.9/onig-6.9.9.tar.gz" + sha256: "60162bd3b9fc6f4886d4c7a07925ffd374167732f55dce8c491bfd9cd818a6cf" "6.9.8": url: "https://github.com/kkos/oniguruma/releases/download/v6.9.8/onig-6.9.8.tar.gz" sha256: "28cd62c1464623c7910565fb1ccaaa0104b2fe8b12bcd646e81f73b47535213e" diff --git a/recipes/oniguruma/config.yml b/recipes/oniguruma/config.yml index 271aea57020658..9cf31a690977c1 100644 --- a/recipes/oniguruma/config.yml +++ b/recipes/oniguruma/config.yml @@ -1,4 +1,6 @@ versions: + "6.9.9": + folder: all "6.9.8": folder: all "6.9.7.1": diff --git a/recipes/onnx/all/conandata.yml b/recipes/onnx/all/conandata.yml index 7a261fa84daf5a..ccb0c203d72392 100644 --- a/recipes/onnx/all/conandata.yml +++ b/recipes/onnx/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.15.0": + url: "https://github.com/onnx/onnx/archive/v1.15.0.tar.gz" + sha256: "c757132e018dd0dd171499ef74fca88b74c5430a20781ec53da19eb7f937ef68" + "1.14.1": + url: "https://github.com/onnx/onnx/archive/v1.14.1.tar.gz" + sha256: "e296f8867951fa6e71417a18f2e550a730550f8829bd35e947b4df5e3e777aa1" "1.14.0": url: "https://github.com/onnx/onnx/archive/v1.14.0.tar.gz" sha256: "1b02ad523f79d83f9678c749d5a3f63f0bcd0934550d5e0d7b895f9a29320003" @@ -8,28 +14,6 @@ sources: "1.12.0": url: "https://github.com/onnx/onnx/archive/refs/tags/v1.12.0.tar.gz" sha256: "052ad3d5dad358a33606e0fc89483f8150bb0655c99b12a43aa58b5b7f0cc507" - "1.11.0": - url: "https://github.com/onnx/onnx/archive/refs/tags/v1.11.0.tar.gz" - sha256: "a20f2d9df805b16ac75ab4da0a230d3d1c304127d719e5c66a4e6df514e7f6c0" - "1.10.2": - url: "https://github.com/onnx/onnx/archive/refs/tags/v1.10.2.tar.gz" - sha256: "520b3aa34272cc215e2eb41385f58adf01750d88858d4722563edca8410c5dc9" - "1.9.0": - url: "https://github.com/onnx/onnx/archive/v1.9.0.tar.gz" - sha256: "61d459a5f30604cabec352574119a6685dfd43bfa757cfbff52be9471d5b8ea0" - "1.8.1": - url: "https://github.com/onnx/onnx/archive/v1.8.1.tar.gz" - sha256: "0054c7eeed97e8ee43921c3f944b0450782a081d910a14b3b6e662bc87065192" patches: "1.12.0": - patch_file: "patches/0001-fix-concurrent-proto3-remove-1.12.0.patch" - "1.11.0": - - patch_file: "patches/0001-fix-concurrent-proto3-remove-1.11.0.patch" - "1.10.2": - - patch_file: "patches/0001-fix-concurrent-proto3-remove-1.9.0.patch" - "1.9.0": - - patch_file: "patches/0001-fix-concurrent-proto3-remove-1.9.0.patch" - - patch_file: "patches/0002-msvc-no-warnings-as-errors-1.9.0.patch" - "1.8.1": - - patch_file: "patches/0001-fix-concurrent-proto3-remove-1.8.1.patch" - - patch_file: "patches/0002-msvc-no-warnings-as-errors-1.8.1.patch" diff --git a/recipes/onnx/all/conanfile.py b/recipes/onnx/all/conanfile.py index ddc3a6ff03194e..4c5cfb0ecfc0d6 100644 --- a/recipes/onnx/all/conanfile.py +++ b/recipes/onnx/all/conanfile.py @@ -1,16 +1,17 @@ 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, cross_building +from conan.tools.build import check_min_cppstd 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, copy, export_conandata_patches, get, rmdir, save 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.53.0" +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" class OnnxConan(ConanFile): @@ -34,16 +35,27 @@ class OnnxConan(ConanFile): "disable_static_registration": False, } + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + @property def _min_cppstd(self): + if Version(self.version) >= "1.15.0": + return 17 if Version(self.version) >= "1.13.0" and is_msvc(self): return 17 return 11 @property - def _protobuf_version(self): - # onnx < 1.9.0 doesn't support protobuf >= 3.18 - return "3.21.9" if Version(self.version) >= "1.9.0" else "3.17.1" + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } def export_sources(self): export_conandata_patches(self) @@ -51,28 +63,33 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) < "1.9.0": - del self.options.disable_static_registration 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): cmake_layout(self, src_folder="src") def requirements(self): - self.requires(f"protobuf/{self._protobuf_version}", run=not cross_building(self), transitive_headers=True, transitive_libs=True) + 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, self._min_cppstd) - if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration("onnx shared is broken with Visual Studio") + if self._min_cppstd > 11: + 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 build_requirements(self): - if hasattr(self, "settings_build") and cross_building(self): - self.tool_requires(f"protobuf/{self._protobuf_version}") + if not self._is_legacy_one_profile: + self.tool_requires("protobuf/") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -80,10 +97,13 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if not cross_building(self): + if self._is_legacy_one_profile: 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 @@ -91,7 +111,7 @@ def generate(self): tc.variables["ONNX_WERROR"] = False tc.variables["ONNX_COVERAGE"] = False tc.variables["ONNX_BUILD_TESTS"] = False - tc.variables["ONNX_USE_LITE_PROTO"] = False + tc.variables["ONNX_USE_LITE_PROTO"] = self.dependencies.host["protobuf"].options.lite tc.variables["ONNX_ML"] = True if Version(self.version) < "1.13.0": tc.variables["ONNXIFI_ENABLE_EXT"] = False @@ -99,8 +119,7 @@ def generate(self): tc.variables["ONNX_VERIFY_PROTO3"] = Version(self.dependencies.host["protobuf"].ref.version).major == "3" if is_msvc(self): tc.variables["ONNX_USE_MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) - if Version(self.version) >= "1.9.0": - tc.variables["ONNX_DISABLE_STATIC_REGISTRATION"] = self.options.get_safe('disable_static_registration') + tc.variables["ONNX_DISABLE_STATIC_REGISTRATION"] = self.options.get_safe('disable_static_registration') tc.generate() deps = CMakeDeps(self) deps.generate() @@ -177,8 +196,7 @@ def _onnx_components(self): } } ) - if Version(self.version) >= "1.11.0": - components["libonnx"]["defines"].append("__STDC_FORMAT_MACROS") + components["libonnx"]["defines"].append("__STDC_FORMAT_MACROS") return components def package_info(self): diff --git a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.11.0.patch b/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.11.0.patch deleted file mode 100644 index 5ecbd144c4919a..00000000000000 --- a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.11.0.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/onnx/gen_proto.py -+++ b/onnx/gen_proto.py -@@ -165,7 +165,7 @@ def convert(stem, package_name, output, do_onnx_ml=False, lite=False, protoc_pat - porto3_dir = os.path.dirname(proto3) - base_dir = os.path.dirname(porto3_dir) - gen_proto3_code(protoc_path, proto3, base_dir, base_dir, base_dir) -- pb3_files = glob.glob(os.path.join(porto3_dir, '*.proto3.*')) -+ pb3_files = glob.glob(os.path.join(porto3_dir, '{}.proto3.*'.format(proto_base))) - for pb3_file in pb3_files: - print("Removing {}".format(pb3_file)) - os.remove(pb3_file) diff --git a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.8.1.patch b/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.8.1.patch deleted file mode 100644 index 2d1317c302c936..00000000000000 --- a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.8.1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/onnx/gen_proto.py -+++ b/onnx/gen_proto.py -@@ -166,7 +166,7 @@ def convert(stem, package_name, output, do_onnx_ml=False, lite=False, protoc_pat - porto3_dir = os.path.dirname(proto3) - base_dir = os.path.dirname(porto3_dir) - gen_proto3_code(protoc_path, proto3, base_dir, base_dir, base_dir) -- pb3_files = glob.glob(os.path.join(porto3_dir, '*.proto3.*')) -+ pb3_files = glob.glob(os.path.join(porto3_dir, '{}.proto3.*'.format(proto_base))) - for pb3_file in pb3_files: - print("Removing {}".format(pb3_file)) - os.remove(pb3_file) diff --git a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.9.0.patch b/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.9.0.patch deleted file mode 100644 index 181c708c8d374e..00000000000000 --- a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.9.0.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/onnx/gen_proto.py -+++ b/onnx/gen_proto.py -@@ -169,7 +169,7 @@ def convert(stem, package_name, output, do_onnx_ml=False, lite=False, protoc_pat - porto3_dir = os.path.dirname(proto3) - base_dir = os.path.dirname(porto3_dir) - gen_proto3_code(protoc_path, proto3, base_dir, base_dir, base_dir) -- pb3_files = glob.glob(os.path.join(porto3_dir, '*.proto3.*')) -+ pb3_files = glob.glob(os.path.join(porto3_dir, '{}.proto3.*'.format(proto_base))) - for pb3_file in pb3_files: - print("Removing {}".format(pb3_file)) - os.remove(pb3_file) diff --git a/recipes/onnx/all/patches/0002-msvc-no-warnings-as-errors-1.8.1.patch b/recipes/onnx/all/patches/0002-msvc-no-warnings-as-errors-1.8.1.patch deleted file mode 100644 index b701fb66947d1c..00000000000000 --- a/recipes/onnx/all/patches/0002-msvc-no-warnings-as-errors-1.8.1.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -454,7 +454,6 @@ if(BUILD_ONNX_PYTHON) - target_link_libraries(onnx_cpp2py_export PRIVATE ${PYTHON_LIBRARIES}) - target_compile_options(onnx_cpp2py_export - PRIVATE /MP -- /WX - /wd4800 # disable warning type' : forcing - # value to bool 'true' or 'false' - # (performance warning) -@@ -514,7 +513,6 @@ endif() - if(MSVC) - target_compile_options(onnx_proto - PRIVATE /MP -- /WX - /wd4800 # disable warning type' : forcing value - # to bool 'true' or 'false' - # (performance warning) -@@ -532,7 +530,6 @@ if(MSVC) - ${EXTRA_FLAGS}) - target_compile_options(onnx - PRIVATE /MP -- /WX - /wd4800 # disable warning type' : forcing value - # to bool 'true' or 'false' - # (performance warning) diff --git a/recipes/onnx/all/patches/0002-msvc-no-warnings-as-errors-1.9.0.patch b/recipes/onnx/all/patches/0002-msvc-no-warnings-as-errors-1.9.0.patch deleted file mode 100644 index 1ff241f73aca7a..00000000000000 --- a/recipes/onnx/all/patches/0002-msvc-no-warnings-as-errors-1.9.0.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -485,7 +485,6 @@ if(BUILD_ONNX_PYTHON) - target_link_libraries(onnx_cpp2py_export PRIVATE ${PYTHON_LIBRARIES}) - target_compile_options(onnx_cpp2py_export - PRIVATE /MP -- /WX - /wd4800 # disable warning type' : forcing - # value to bool 'true' or 'false' - # (performance warning) -@@ -545,7 +544,6 @@ endif() - if(MSVC) - target_compile_options(onnx_proto - PRIVATE /MP -- /WX - /wd4800 # disable warning type' : forcing value - # to bool 'true' or 'false' - # (performance warning) -@@ -563,7 +561,6 @@ if(MSVC) - ${EXTRA_FLAGS}) - target_compile_options(onnx - PRIVATE /MP -- /WX - /wd4800 # disable warning type' : forcing value - # to bool 'true' or 'false' - # (performance warning) diff --git a/recipes/onnx/config.yml b/recipes/onnx/config.yml index 553b17a4b40e94..669807aa7c0eb3 100644 --- a/recipes/onnx/config.yml +++ b/recipes/onnx/config.yml @@ -1,15 +1,11 @@ versions: + "1.15.0": + folder: all + "1.14.1": + folder: all "1.14.0": folder: all "1.13.1": folder: all "1.12.0": folder: all - "1.11.0": - folder: all - "1.10.2": - folder: all - "1.9.0": - folder: all - "1.8.1": - folder: all diff --git a/recipes/onnxruntime/all/conandata.yml b/recipes/onnxruntime/all/conandata.yml index 4a029ad509a2be..b051b067686217 100644 --- a/recipes/onnxruntime/all/conandata.yml +++ b/recipes/onnxruntime/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.16.3": + url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.16.3.tar.gz" + sha256: "d26b8a7eed1df4440aa3d8eac5049980cbe585514ccedfda809712051a4b1721" + "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" + "1.16.0": + url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.16.0.tar.gz" + sha256: "3a4e57d454bce4349e11e2262fc47728a78b86ef1e0754514bbbc7d709e0a80d" "1.15.1": url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.15.1.tar.gz" sha256: "93a9b6f148639938ccbaa48d0f641d8f33312fdfcc69ee9466e11362b43917c4" @@ -6,6 +18,34 @@ sources: url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.14.1.tar.gz" sha256: "f998352b131bb89fa7dd1f1d87ddbafe647dfaddd11929b6b5168b3f4ef857de" patches: + "1.16.3": + - 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.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" + 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.0": + - 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.15.1": - patch_file: "patches/1.15.1-0001-cmake-dependencies.patch" patch_description: "CMake: ensure conan dependencies are used" @@ -28,3 +68,7 @@ patches: - 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" + - patch_file: "patches/1.14.1-0005-re2-compat.patch" + patch_description: "Ensures the forward compatibility with the newest versions of re2 library." + patch_type: "portability" + patch_source: "https://github.com/microsoft/onnxruntime/commit/126e7bf15fa4af8621814b82a3f7bd0d786f0239.patch" diff --git a/recipes/onnxruntime/all/conanfile.py b/recipes/onnxruntime/all/conanfile.py index 7d8bf9dd19bda8..8861b22e93f76b 100644 --- a/recipes/onnxruntime/all/conanfile.py +++ b/recipes/onnxruntime/all/conanfile.py @@ -41,10 +41,18 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): + if Version(self.version) < "1.16.0": + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } return { - "Visual Studio": "16", - "msvc": "192", - "gcc": "7", + "Visual Studio": "17", + "msvc": "193", + "gcc": "9", "clang": "5", "apple-clang": "10", } @@ -68,26 +76,27 @@ def _onnx_version(self): version = Version(self.version) return { "1.14": "1.13.1", - "1.15": "1.14.0", + "1.15": "1.14.1", + "1.16": "1.14.1", }[f"{version.major}.{version.minor}"] def requirements(self): - self.requires("abseil/20230125.2") - self.requires("protobuf/3.21.9") + self.requires("abseil/20230802.1") + self.requires("protobuf/3.21.12") self.requires("date/3.0.1") - self.requires("re2/20230301") + self.requires("re2/20230901") self.requires(f"onnx/{self._onnx_version}") self.requires("flatbuffers/1.12.0") - self.requires("boost/1.81.0", headers=True, libs=False, run=False) # for mp11, header only, no need for libraries to link/run + self.requires("boost/1.83.0", headers=True, libs=False, run=False) # for mp11, header only, no need for libraries to link/run self.requires("safeint/3.0.28") - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.3") self.requires("eigen/3.4.0") self.requires("ms-gsl/4.0.0") - self.requires("cpuinfo/cci.20220228") + self.requires("cpuinfo/cci.20220618") if self.settings.os != "Windows": - self.requires("nsync/1.25.0") + self.requires("nsync/1.26.0") else: - self.requires("wil/1.0.230202.1") + self.requires("wil/1.0.231028.1") if self.options.with_xnnpack: self.requires("xnnpack/cci.20220801") @@ -119,7 +128,8 @@ def generate(self): # disable downloading dependencies to ensure conan ones are used tc.variables["FETCHCONTENT_FULLY_DISCONNECTED"] = True if self.version >= Version("1.15.0") and self.options.shared: - tc.variables["Python_EXECUTABLE"] = sys.executable + # Need to replace windows path seperators with linux path seperators to keep CMake from crashing + tc.variables["Python_EXECUTABLE"] = sys.executable.replace("\\", "/") tc.variables["onnxruntime_BUILD_SHARED_LIB"] = self.options.shared tc.variables["onnxruntime_USE_FULL_PROTOBUF"] = not self.dependencies["protobuf"].options.lite @@ -248,7 +258,10 @@ def package_info(self): onnxruntime_libs.append("providers_xnnpack") self.cpp_info.libs = [f"onnxruntime_{lib}" for lib in onnxruntime_libs] - self.cpp_info.includedirs.append("include/onnxruntime/core/session") + if Version(self.version) < "1.16.0" or not self.options.shared: + self.cpp_info.includedirs.append("include/onnxruntime/core/session") + else: + self.cpp_info.includedirs.append("include/onnxruntime") if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: self.cpp_info.system_libs.append("m") @@ -258,5 +271,30 @@ 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") # https://github.com/microsoft/onnxruntime/blob/v1.14.1/cmake/CMakeLists.txt#L1584 self.cpp_info.set_property("pkg_config_name", "onnxruntime") diff --git a/recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch index 9d0a0f67636135..6dbbfc4af9df48 100644 --- a/recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch +++ b/recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch @@ -149,19 +149,6 @@ index 1fc2c6ccdc..a2c28957f9 100644 set(onnxruntime_EXTERNAL_LIBRARIES_XNNPACK XNNPACK pthreadpool) -diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake -index 0410d3361c..685df7a487 100644 ---- a/cmake/onnxruntime_common.cmake -+++ b/cmake/onnxruntime_common.cmake -@@ -195,7 +195,7 @@ if (ARM64 OR ARM OR X86 OR X64 OR X86_64) - # Its functionality in detecting x86 cpu features are lacking, so is support for Windows. - if (CPUINFO_SUPPORTED) - onnxruntime_add_include_to_target(onnxruntime_common cpuinfo::cpuinfo) -- list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo cpuinfo::clog) -+ list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo) - endif() - endif() - endif() diff --git a/cmake/onnxruntime_providers.cmake b/cmake/onnxruntime_providers.cmake index 7a99bac233..bbf1955494 100644 --- a/cmake/onnxruntime_providers.cmake diff --git a/recipes/onnxruntime/all/patches/1.14.1-0005-re2-compat.patch b/recipes/onnxruntime/all/patches/1.14.1-0005-re2-compat.patch new file mode 100644 index 00000000000000..c8e0cc9d9a48eb --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.14.1-0005-re2-compat.patch @@ -0,0 +1,41 @@ +From a3a443c80431c390cbf8855e9c7b2a95d413cd54 Mon Sep 17 00:00:00 2001 +From: Yuriy Chernyshov +Date: Thu, 8 Jun 2023 20:26:26 +0200 +Subject: [PATCH] Support re2 == 2023-06-02 (#16257) + +### Description + +google/re2 [was +switched](https://github.com/google/re2/commit/49d776b9d29d79b6e2876d5f091d2207d8123dfa) +to absl::string_view in version 2023-06-02. + +As `absl::string_view` is a drop-in replacement for `std::string_view` +it does not have `as_string()` method. +This PR ensures the forward compatibility with the newest versions of +re2 library. +--- + onnxruntime/contrib_ops/cpu/tokenizer.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/onnxruntime/contrib_ops/cpu/tokenizer.cc b/onnxruntime/contrib_ops/cpu/tokenizer.cc +index 45998b6d8310..1787fb9b3c4a 100644 +--- a/onnxruntime/contrib_ops/cpu/tokenizer.cc ++++ b/onnxruntime/contrib_ops/cpu/tokenizer.cc +@@ -242,7 +242,7 @@ Status Tokenizer::SeparatorExpressionTokenizer(OpKernelContext* ctx, + token_len, utf8_chars); + if (!valid) { + return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT, +- "Match contains invalid utf8 chars: " + submatch.as_string()); ++ "Match contains invalid utf8 chars: " + std::string{submatch}); + } + if (utf8_chars >= size_t(mincharnum_)) { + tokens.emplace_back(text.data() + start_pos, token_len); +@@ -384,7 +384,7 @@ Status Tokenizer::TokenExpression(OpKernelContext* ctx, + utf8_chars = 0; + if (!utf8_len(reinterpret_cast(submatch.data()), token_len, utf8_chars)) { + return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT, +- "Match contains invalid utf8 chars: " + submatch.as_string()); ++ "Match contains invalid utf8 chars: " + std::string{submatch}); + } + if (utf8_chars >= size_t(mincharnum_)) { + row.push_back(submatch); diff --git a/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch index 7da019aa807e9d..4ebc87b3a4ddce 100644 --- a/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch +++ b/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch @@ -30,15 +30,6 @@ diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onn index 9effd1a2db..a059c28e36 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake -@@ -152,7 +152,7 @@ FetchContent_Declare( - URL ${DEP_URL_protobuf} - URL_HASH SHA1=${DEP_SHA1_protobuf} - PATCH_COMMAND ${ONNXRUNTIME_PROTOBUF_PATCH_COMMAND} -- FIND_PACKAGE_ARGS 3.21.12 NAMES Protobuf -+ FIND_PACKAGE_ARGS NAMES Protobuf - ) - set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE) - if (CMAKE_SYSTEM_NAME STREQUAL "Android") @@ -173,6 +173,7 @@ FetchContent_Declare( date URL ${DEP_URL_date} @@ -142,19 +133,6 @@ index 1fc2c6ccdc..a2c28957f9 100644 set(onnxruntime_EXTERNAL_LIBRARIES_XNNPACK XNNPACK pthreadpool) -diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake -index 0410d3361c..685df7a487 100644 ---- a/cmake/onnxruntime_common.cmake -+++ b/cmake/onnxruntime_common.cmake -@@ -195,7 +195,7 @@ if (ARM64 OR ARM OR X86 OR X64 OR X86_64) - # Its functionality in detecting x86 cpu features are lacking, so is support for Windows. - if (CPUINFO_SUPPORTED) - onnxruntime_add_include_to_target(onnxruntime_common cpuinfo::cpuinfo) -- list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo cpuinfo::clog) -+ list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo) - endif() - endif() - endif() diff --git a/cmake/onnxruntime_providers.cmake b/cmake/onnxruntime_providers.cmake index 0daa1b8a3d..1f25467a8c 100644 --- a/cmake/onnxruntime_providers.cmake diff --git a/recipes/onnxruntime/all/patches/1.16.0-0001-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.16.0-0001-cmake-dependencies.patch new file mode 100644 index 00000000000000..dacb2b9b27a86e --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.16.0-0001-cmake-dependencies.patch @@ -0,0 +1,129 @@ +From a30759bc61768883302290d34efd6d0a5e09dc9f Mon Sep 17 00:00:00 2001 +From: mayeut +Date: Thu, 21 Sep 2023 23:20:46 +0200 +Subject: [PATCH] CMake: ensure conan dependencies are used + +--- + cmake/external/eigen.cmake | 5 +++-- + cmake/external/onnxruntime_external_deps.cmake | 15 ++++++++------- + cmake/external/xnnpack.cmake | 11 +++++++---- + cmake/onnxruntime_mlas.cmake | 2 +- + 4 files changed, 19 insertions(+), 14 deletions(-) + +diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake +index c0f7ddc50e..a47de64cbd 100644 +--- a/cmake/external/eigen.cmake ++++ b/cmake/external/eigen.cmake +@@ -16,8 +16,9 @@ else () + eigen + URL ${DEP_URL_eigen} + URL_HASH SHA1=${DEP_SHA1_eigen} ++ FIND_PACKAGE_ARGS REQUIRED CONFIG NAMES Eigen3 + ) + endif() +- FetchContent_Populate(eigen) +- set(eigen_INCLUDE_DIRS "${eigen_SOURCE_DIR}") ++ onnxruntime_fetchcontent_makeavailable(eigen) ++ get_target_property(eigen_INCLUDE_DIRS Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES) + endif() +diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake +index 8e412c7847..0e2482d7de 100644 +--- a/cmake/external/onnxruntime_external_deps.cmake ++++ b/cmake/external/onnxruntime_external_deps.cmake +@@ -187,6 +187,7 @@ FetchContent_Declare( + date + URL ${DEP_URL_date} + URL_HASH SHA1=${DEP_SHA1_date} ++ FIND_PACKAGE_ARGS NAMES date + ) + onnxruntime_fetchcontent_makeavailable(date) + +@@ -196,6 +197,7 @@ FetchContent_Declare( + mp11 + URL ${DEP_URL_mp11} + URL_HASH SHA1=${DEP_SHA1_mp11} ++ FIND_PACKAGE_ARGS NAMES Boost + ) + + set(JSON_BuildTests OFF CACHE INTERNAL "") +@@ -314,6 +316,7 @@ FetchContent_Declare( + safeint + URL ${DEP_URL_safeint} + URL_HASH SHA1=${DEP_SHA1_safeint} ++ FIND_PACKAGE_ARGS NAMES safeint + ) + + # The next line will generate an error message "fatal: not a git repository", but it is ok. It is from flatbuffers +@@ -410,6 +413,7 @@ FetchContent_Declare( + URL ${DEP_URL_onnx} + URL_HASH SHA1=${DEP_SHA1_onnx} + PATCH_COMMAND ${ONNXRUNTIME_ONNX_PATCH_COMMAND} ++ FIND_PACKAGE_ARGS NAMES ONNX + ) + + +@@ -437,9 +441,6 @@ endif() + set(GSL_TARGET "Microsoft.GSL::GSL") + set(GSL_INCLUDE_DIR "$") + +-add_library(safeint_interface INTERFACE) +-target_include_directories(safeint_interface INTERFACE ${safeint_SOURCE_DIR}) +- + # XNNPACK EP + if (onnxruntime_USE_XNNPACK) + if (onnxruntime_DISABLE_CONTRIB_OPS) +@@ -467,10 +468,10 @@ set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES_XNNPACK} ${W + # The other libs do not have the problem. All the sources are already there. We can compile them in any order. + set(onnxruntime_EXTERNAL_DEPENDENCIES onnx_proto flatbuffers::flatbuffers) + +-target_compile_definitions(onnx PUBLIC $ PRIVATE "__ONNX_DISABLE_STATIC_REGISTRATION") +-if (NOT onnxruntime_USE_FULL_PROTOBUF) +- target_compile_definitions(onnx PUBLIC "__ONNX_NO_DOC_STRINGS") +-endif() ++# target_compile_definitions(onnx PUBLIC $ PRIVATE "__ONNX_DISABLE_STATIC_REGISTRATION") ++# if (NOT onnxruntime_USE_FULL_PROTOBUF) ++# target_compile_definitions(onnx PUBLIC "__ONNX_NO_DOC_STRINGS") ++# endif() + + if (onnxruntime_RUN_ONNX_TESTS) + add_definitions(-DORT_RUN_EXTERNAL_ONNX_TESTS) +diff --git a/cmake/external/xnnpack.cmake b/cmake/external/xnnpack.cmake +index 7455584f1a..85d8177f45 100644 +--- a/cmake/external/xnnpack.cmake ++++ b/cmake/external/xnnpack.cmake +@@ -25,12 +25,15 @@ set(FXDIV_SOURCE_DIR ${fxdiv_SOURCE_DIR}) + + FetchContent_Declare(pthreadpool URL ${DEP_URL_pthreadpool} URL_HASH SHA1=${DEP_SHA1_pthreadpool}) + onnxruntime_fetchcontent_makeavailable(pthreadpool) +-FetchContent_Declare(googlexnnpack URL ${DEP_URL_googlexnnpack} URL_HASH SHA1=${DEP_SHA1_googlexnnpack} +-PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/xnnpack/AddEmscriptenAndIosSupport.patch) ++FetchContent_Declare( ++ googlexnnpack ++ URL ${DEP_URL_googlexnnpack} ++ URL_HASH SHA1=${DEP_SHA1_googlexnnpack} ++ PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/xnnpack/AddEmscriptenAndIosSupport.patch ++ FIND_PACKAGE_ARGS NAMES xnnpack ++) + + onnxruntime_fetchcontent_makeavailable(googlexnnpack) +-set(XNNPACK_DIR ${googlexnnpack_SOURCE_DIR}) +-set(XNNPACK_INCLUDE_DIR ${XNNPACK_DIR}/include) + + set(onnxruntime_EXTERNAL_LIBRARIES_XNNPACK XNNPACK pthreadpool) + +diff --git a/cmake/onnxruntime_mlas.cmake b/cmake/onnxruntime_mlas.cmake +index e0ccc504d7..819ffba884 100644 +--- a/cmake/onnxruntime_mlas.cmake ++++ b/cmake/onnxruntime_mlas.cmake +@@ -609,7 +609,7 @@ if (NOT onnxruntime_ORT_MINIMAL_BUILD) + + target_link_libraries(onnxruntime_mlas_q4dq PRIVATE ${ONNXRUNTIME_MLAS_LIBS} onnxruntime_common) + if (CPUINFO_SUPPORTED AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") +- target_link_libraries(onnxruntime_mlas_q4dq PRIVATE cpuinfo) ++ target_link_libraries(onnxruntime_mlas_q4dq PRIVATE cpuinfo::cpuinfo) + endif() + if(NOT WIN32) + target_link_libraries(onnxruntime_mlas_q4dq PRIVATE nsync::nsync_cpp ${CMAKE_DL_LIBS}) +-- +2.39.2 (Apple Git-143) + diff --git a/recipes/onnxruntime/config.yml b/recipes/onnxruntime/config.yml index 4b89de81e9882d..7dfea6fd99cd42 100644 --- a/recipes/onnxruntime/config.yml +++ b/recipes/onnxruntime/config.yml @@ -1,4 +1,12 @@ versions: + "1.16.3": + folder: all + "1.16.2": + folder: all + "1.16.1": + folder: all + "1.16.0": + folder: all "1.15.1": folder: all "1.14.1": 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/open62541/all/conandata.yml b/recipes/open62541/all/conandata.yml index d458e6add2e688..41d18d560523ad 100644 --- a/recipes/open62541/all/conandata.yml +++ b/recipes/open62541/all/conandata.yml @@ -1,64 +1,22 @@ sources: - "1.3.4": - url: "https://github.com/open62541/open62541/archive/v1.3.4.tar.gz" - sha256: "3489cfa2f98c52df252adc8e641a9e59cb675bdfd5ef413b0d947e667cddd16d" - "1.3.1": - url: "https://github.com/open62541/open62541/archive/v1.3.1.tar.gz" - sha256: "f54d10325fd08fc1505aea37d83daa085912a269521e6d018bfc41a744ba57aa" + "1.3.8": + url: "https://github.com/open62541/open62541/archive/v1.3.8.tar.gz" + sha256: "b6943b564787c4953b77ca8d7f987c4b896b3f3e91f45d9f13e9056b6148bc1d" "1.2.6": url: "https://github.com/open62541/open62541/archive/v1.2.6.tar.gz" sha256: "7470c1e2f97d0e7dad9632ced7b62f0add66a3c689532204ef85b0556d129106" - "1.2.4": - url: "https://github.com/open62541/open62541/archive/v1.2.4.tar.gz" - sha256: "b2d00b91e8315b61efaef6398f0902a0c9a8f357aa6d02f7f000a429048c97ae" - "1.2.2": - url: "https://github.com/open62541/open62541/archive/v1.2.2.tar.gz" - sha256: "9b5bfd811ee523be601f11abc514a93c67fe5c6e957cd6c36fe6ea4f28e009bb" "1.1.6": url: "https://github.com/open62541/open62541/archive/v1.1.6.tar.gz" sha256: "005bb336ba52f2c0add479bb46de8aa4216efa7f2bfd8b1c24a0271494edbd3f" - "1.1.5": - url: "https://github.com/open62541/open62541/archive/v1.1.5.tar.gz" - sha256: "a3e689216d75c3313bffdbb1cb7190d63b173410f392b8c558062fdd667635d7" - "1.1.3": - url: "https://github.com/open62541/open62541/archive/v1.1.3.tar.gz" - sha256: "12770bf9f5d9f44dedce0d1b34066dd14111d24c73a2f0153420e0a750e85d19" "1.0.6": url: "https://github.com/open62541/open62541/archive/v1.0.6.tar.gz" sha256: "299940025c14929533064abe0044d5805ea50d52b32d05ad9bc0e6996569c2a6" - "1.0.3": - url: "https://github.com/open62541/open62541/archive/v1.0.3.tar.gz" - sha256: "3e4c939d702d06d89f32a1cafe2b992c7f3d81c8f8579e093a972d4bc4fb3d50" patches: - "1.3.4": - - patch_file: "patches/0001-fix-cmake-find-deps-1_3_4.patch" - patch_description: "Use Cmake find_package(*) to resolve external dependencies" - patch_type: "portability" - "1.3.1": - - patch_file: "patches/0001-fix-cmake-find-deps-1_3_1.patch" - patch_description: "Use Cmake find_package(*) to resolve external dependencies" - patch_type: "portability" - "1.2.6": - - patch_file: "patches/0001-fix-cmake-find-deps-1_2_x.patch" - patch_description: "Use Cmake find_package(*) to resolve external dependencies" - patch_type: "portability" - - patch_file: "patches/0003-disable-sanitizers-1_2_x.patch" - patch_description: "Disable static code analysis" - patch_type: "conan" - - patch_file: "patches/0003-fix-use-usr-bin-env-python3.patch" - patch_description: "Use python3 instead of default python interpreter" - patch_type: "conan" - "1.2.4": - - patch_file: "patches/0001-fix-cmake-find-deps-1_2_x.patch" - patch_description: "Use Cmake find_package(*) to resolve external dependencies" - patch_type: "portability" - - patch_file: "patches/0003-disable-sanitizers-1_2_x.patch" + "1.3.8": + - patch_file: "patches/0001-disable-sanitizers-1_3_x.patch" patch_description: "Disable static code analysis" patch_type: "conan" - - patch_file: "patches/0003-fix-use-usr-bin-env-python3.patch" - patch_description: "Use python3 instead of default python interpreter" - patch_type: "conan" - "1.2.2": + "1.2.6": - patch_file: "patches/0001-fix-cmake-find-deps-1_2_x.patch" patch_description: "Use Cmake find_package(*) to resolve external dependencies" patch_type: "portability" @@ -75,25 +33,7 @@ patches: - patch_file: "patches/0003-disable-sanitizers-1_1_6.patch" patch_description: "Disable static code analysis" patch_type: "conan" - "1.1.5": - - patch_file: "patches/0001-fix-cmake-find-deps-1_1_x.patch" - patch_description: "Use Cmake find_package(*) to resolve external dependencies" - patch_type: "portability" - - patch_file: "patches/0002-disable-sanitizers-1_1_3-and-1_1_5.patch" - patch_description: "Disable static code analysis" - patch_type: "conan" - "1.1.3": - - patch_file: "patches/0001-fix-cmake-find-deps-1_1_x.patch" - patch_description: "Use Cmake find_package(*) to resolve external dependencies" - patch_type: "portability" - - patch_file: "patches/0002-disable-sanitizers-1_1_3-and-1_1_5.patch" - patch_description: "Disable static code analysis" - patch_type: "conan" "1.0.6": - patch_file: "patches/1_0_x.patch" patch_description: "Fix CMAKE_MODULE_PATH and PROJECT_VERSION variables, remove -Werror flag, disable static code analysis, use Cmake find_package(*) to resolve external dependencies, fix include paths" patch_type: "conan" - "1.0.3": - - patch_file: "patches/1_0_x.patch" - patch_description: "Fix CMAKE_MODULE_PATH and PROJECT_VERSION variables, remove -Werror flag, disable static code analysis, use Cmake find_package(*) to resolve external dependencies, fix include paths" - patch_type: "conan" diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 25dd98cf850ffc..2321b749989734 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps from conan.tools.scm import Version -from conan.tools.files import apply_conandata_patches, collect_libs, export_conandata_patches, rename, rm, rmdir, get +from conan.tools.files import apply_conandata_patches, collect_libs, export_conandata_patches, copy, rm, rmdir, get from conan.errors import ConanInvalidConfiguration import glob import os @@ -12,7 +12,7 @@ class Open62541Conan(ConanFile): name = "open62541" - license = "MPLv2" + license = ("MPL-2.0", "CC0-1.0") homepage = "https://open62541.org/" url = "https://github.com/conan-io/conan-center-index" description = "open62541 is an open source and free implementation of OPC UA " \ @@ -24,10 +24,11 @@ class Open62541Conan(ConanFile): "All platform-specific functionality is implemented via exchangeable " \ "plugins. Plugin implementations are provided for the major operating systems." topics = ( - "opc ua", "open62541", "sdk", "server/client", "c", "iec-62541", + "opc ua", "sdk", "server/client", "c", "iec-62541", "industrial automation", "tsn", "time sensitive networks", "publish-subscirbe", "pubsub" ) + package_type = "library" settings = "os", "compiler", "build_type", "arch" options = { "fPIC": [True, False], @@ -107,7 +108,7 @@ class Open62541Conan(ConanFile): # UA_COMPILE_AS_CXX=cpp_compatible "cpp_compatible": [True, False], # UA_ENABLE_STATUSCODE_DESCRIPTIONS=readable_statuscodes - "readable_statuscodes": [True, False] + "readable_statuscodes": [True, False], } default_options = { "fPIC": True, @@ -135,7 +136,7 @@ class Open62541Conan(ConanFile): "typenames": True, "hardening": True, "cpp_compatible": False, - "readable_statuscodes": True + "readable_statuscodes": True, } exports = "submoduledata.yml" @@ -181,7 +182,7 @@ def requirements(self): if self.options.encryption == "mbedtls": self.requires("mbedtls/2.25.0") elif self.options.encryption == "openssl": - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") if self.options.web_socket: self.requires("libwebsockets/4.3.2") if self.options.discovery == "With Multicast" or "multicast" in str(self.options.discovery): @@ -214,12 +215,10 @@ def validate(self): raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 are not cpp compatible due to -fpermisive flags") - # FIXME: correct clang versions condition - max_clang_version = "8" if Version( - self.version) < "1.1.0" else "9" - if self.settings.compiler == "clang" and Version(self.settings.compiler.version) > max_clang_version: + unsupported_clang_version = "8" if Version(self.version) < "1.1.0" else "9" + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) == unsupported_clang_version: raise ConanInvalidConfiguration( - "Open62541 supports Clang up to {} compiler version".format(max_clang_version)) + f"{self.ref} does not support Clang version {self.settings.compiler.version}") if self.settings.compiler == "clang": if Version(self.settings.compiler.version) < "5": @@ -244,19 +243,13 @@ def source(self): with open(submodule_filename, 'r') as submodule_stream: submodules_data = yaml.safe_load(submodule_stream) for path, submodule in submodules_data["submodules"][self.version].items(): - filename = os.path.basename(submodule["url"]) - archive_name = submodule["archive_pattern"].format( - version=os.path.splitext(filename.replace('v', ''))[0]) - - submodule_data = { - "url": submodule["url"], - "sha256": submodule["sha256"] - } - - get(self, **submodule_data) - submodule_source = os.path.join(self.source_folder, path) - rmdir(self, submodule_source) - rename(self, archive_name, submodule_source) + archive_name = os.path.splitext( + os.path.basename(submodule["url"]))[0] + get(self, url=submodule["url"], + sha256=submodule["sha256"], + destination=path, + filename=archive_name, + strip_root=True) def _get_log_level(self): return { @@ -356,7 +349,7 @@ def generate(self): tc.variables["UA_ENABLE_STATUSCODE_DESCRIPTIONS"] = self.options.readable_statuscodes tc.variables["UA_ENABLE_HARDENING"] = self.options.hardening - if self.settings.compiler == "Visual Studio" and self.options.shared == True: + if self.settings.compiler == "msvc" and self.options.shared == True: tc.variables["UA_MSVC_FORCE_STATIC_CRT"] = True tc.variables["UA_COMPILE_AS_CXX"] = self.options.cpp_compatible @@ -371,8 +364,7 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) if Version(self.version) >= "1.3.1": - os.unlink(os.path.join(self.source_folder, - "tools", "cmake", "FindPython3.cmake")) + os.unlink(os.path.join(self.source_folder, "tools", "cmake", "FindPython3.cmake")) def build(self): self._patch_sources() @@ -393,8 +385,9 @@ def _module_file_rel_path(self): return os.path.join(self._module_subfolder, "open62541Macros.cmake") def package(self): - self.copy("LICENSE", dst="licenses", src=self.source_folder) - self.copy("LICENSE-CC0", dst="licenses", src=self.source_folder) + licenses_dir = os.path.join(self.package_folder, "licenses") + copy(self, "LICENSE", src=self.source_folder, dst=licenses_dir) + copy(self, "LICENSE-CC0", src=self.source_folder, dst=licenses_dir) cmake = CMake(self) cmake.install() @@ -408,10 +401,9 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - self.copy("generate_*.py", src=self._tools_subfolder, - dst=os.path.join("res", "tools")) - self.copy("nodeset_compiler/*", src=self._tools_subfolder, - dst=os.path.join("res", "tools")) + tools_dir = os.path.join(self.package_folder, "res", "tools") + copy(self, "generate_*.py", src=self._tools_subfolder, dst=tools_dir) + copy(self, "nodeset_compiler/*", src=self._tools_subfolder, dst=tools_dir) @staticmethod def _chmod_plus_x(filename): @@ -423,10 +415,7 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "open62541" self.cpp_info.names["pkg_config"] = "open62541" self.cpp_info.libs = collect_libs(self) - self.cpp_info.includedirs = [ - "include", - os.path.join("include", "open62541", "plugin") - ] + self.cpp_info.includedirs = ["include"] # required for creating custom servers from ua-nodeset self.conf_info.define("user.open62541:tools_dir", os.path.join( @@ -439,14 +428,19 @@ def package_info(self): if self.options.single_header: self.cpp_info.defines.append("UA_ENABLE_AMALGAMATION") - if self.settings.os == "Windows": - self.cpp_info.system_libs.append("ws2_32") - self.cpp_info.includedirs.append( - os.path.join("include", "open62541", "win32")) else: self.cpp_info.includedirs.append( - os.path.join("include", "open62541", "posix")) - if self.settings.os in ("Linux", "FreeBSD"): + os.path.join("include", "open62541", "plugin")) + if self.settings.os == "Windows": + self.cpp_info.includedirs.append( + os.path.join("include", "open62541", "win32")) + else: + self.cpp_info.includedirs.append( + os.path.join("include", "open62541", "posix")) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + elif self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs.extend(["pthread", "m", "rt"]) self.cpp_info.builddirs.append(self._module_subfolder) @@ -457,3 +451,4 @@ def package_info(self): self._module_file_rel_path] self.cpp_info.set_property("cmake_build_modules", [ self._module_file_rel_path]) + diff --git a/recipes/open62541/all/patches/0001-disable-sanitizers-1_3_x.patch b/recipes/open62541/all/patches/0001-disable-sanitizers-1_3_x.patch new file mode 100644 index 00000000000000..a2c9d60322e4fc --- /dev/null +++ b/recipes/open62541/all/patches/0001-disable-sanitizers-1_3_x.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5300b12f6..9a80321da 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -749,19 +749,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST + # Linker + set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default + +- # Debug +- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX AND NOT UA_BUILD_OSS_FUZZ AND +- "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) +- # Add default sanitizer settings when using clang and Debug build. +- # This allows e.g. CLion to find memory locations for SegFaults +- message(STATUS "Sanitizer enabled") +- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=leak -fsanitize=undefined") +- if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) +- set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize-coverage=trace-pc-guard") +- endif() +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") +- endif() + + if(NOT MINGW AND UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) + check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) diff --git a/recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_3_1.patch b/recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_3_1.patch deleted file mode 100644 index 470202a51fce24..00000000000000 --- a/recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_3_1.patch +++ /dev/null @@ -1,200 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2a140ebd..bbca9b1f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -11,7 +11,7 @@ endif() - - string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) - --set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") -+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR};${PROJECT_SOURCE_DIR}/tools/cmake") - find_package(Python3 REQUIRED) - set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) - find_package(Git) -@@ -40,15 +40,12 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - # The current version information. On the master branch, we take the version - # number from the latest release plus the "-undefined" label. Will be - # overwritten with more detailed information if git is available. --set(OPEN62541_VER_MAJOR 1) --set(OPEN62541_VER_MINOR 2) --set(OPEN62541_VER_PATCH 2) --set(OPEN62541_VER_LABEL "-unknown") # like "-rc1" or "-g4538abcd" or "-g4538abcd-dirty" --set(OPEN62541_VER_COMMIT "undefined") - --# Overwrite the version information based on git if available --include(SetGitBasedVersion) --set_open62541_version() -+set(OPEN62541_VER_MINOR "0" CACHE STRING "Set the major version. Used by conan") -+set(OPEN62541_VER_MAJOR "0" CACHE STRING "Set the minor version. Used by conan") -+set(OPEN62541_VER_PATCH "0" CACHE STRING "Set the patch version. Used by conan") -+set(OPEN62541_VER_LABEL "") -+set(OPEN62541_VER_COMMIT "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") - - # Examples for the version string are: - # v1.2 -@@ -580,7 +577,7 @@ if(UA_ENABLE_ENCRYPTION_OPENSSL OR UA_ENABLE_MQTT_TLS_OPENSSL) - # use the OpenSSL encryption library - # https://cmake.org/cmake/help/v3.0/module/FindOpenSSL.html - find_package(OpenSSL REQUIRED) -- list(APPEND open62541_LIBRARIES ${OPENSSL_LIBRARIES}) -+ list(APPEND open62541_LIBRARIES ${OpenSSL_LIBRARIES}) - endif () - - if(UA_ENABLE_ENCRYPTION_LIBRESSL) -@@ -598,7 +595,7 @@ if(UA_ENABLE_ENCRYPTION_MBEDTLS OR UA_ENABLE_PUBSUB_ENCRYPTION) - # that is not possible, manually compile mbedTLS and set the cmake variables - # defined in /tools/cmake/FindMbedTLS.cmake. - find_package(MbedTLS REQUIRED) -- list(APPEND open62541_LIBRARIES ${MBEDTLS_LIBRARIES}) -+ list(APPEND open62541_LIBRARIES ${MbedTLS_LIBRARIES}) - endif() - - if(UA_ENABLE_TPM2_SECURITY) -@@ -609,8 +606,10 @@ if(UA_ENABLE_WEBSOCKET_SERVER) - # The recommended way is to install libwebsockets via the OS package manager. If - # that is not possible, manually compile libwebsockets and set the cmake variables - # defined in /tools/cmake/Findlibwebsockets.cmake -- find_package(libwebsockets REQUIRED) -- list(APPEND open62541_LIBRARIES ${LIBWEBSOCKETS_LIBRARIES}) -+ find_package(Libwebsockets REQUIRED) -+ list(APPEND open62541_LIBRARIES ${Libwebsockets_LIBRARIES}) -+ message(STATUS "Libwebsockets library: ${Libwebsockets_LIBRARIES}") -+ message(STATUS "Libwebsockets includes: ${Libwebsockets_INCLUDE_DIRS}") - - set(ua_architecture_directories_to_include ${ua_architecture_directories_to_include} - ${LIBWEBSOCKETS_INCLUDE_DIR}) -@@ -725,7 +724,7 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST - set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default - - # Debug -- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX AND NOT UA_BUILD_OSS_FUZZ AND -+ if(FALSE AND BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX AND NOT UA_BUILD_OSS_FUZZ AND - "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) - # Add default sanitizer settings when using clang and Debug build. - # This allows e.g. CLion to find memory locations for SegFaults -@@ -811,24 +810,7 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated - configure_file(tools/open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) - - if(UA_ENABLE_DISCOVERY_MULTICAST) -- include(GenerateExportHeader) -- set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) -- # create a "fake" empty library to generate the export header macros -- add_library(libmdnsd ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h) -- if (UA_FORCE_CPP) -- set_property(TARGET libmdnsd PROPERTY LINKER_LANGUAGE CXX) -- else() -- set_property(TARGET libmdnsd PROPERTY LINKER_LANGUAGE C) -- endif() -- set_property(TARGET libmdnsd PROPERTY DEFINE_SYMBOL "MDNSD_DYNAMIC_LINKING_EXPORT") -- configure_file("deps/mdnsd/libmdnsd/mdnsd_config_extra.in" -- "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config_extra") -- file(READ "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config_extra" MDNSD_CONFIG_EXTRA) -- generate_export_header(libmdnsd -- EXPORT_FILE_NAME "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h" -- BASE_NAME MDNSD -- DEFINE_NO_DEPRECATED -- CUSTOM_CONTENT_FROM_VARIABLE MDNSD_CONFIG_EXTRA) -+ find_package(mdnsd) - endif() - - set(exported_headers ${ua_architecture_headers_beginning}) -@@ -1133,18 +1115,7 @@ if(UA_DEBUG_DUMP_PKGS) - endif() - - if(UA_ENABLE_DISCOVERY_MULTICAST) -- # prepend in list, otherwise it complains that winsock2.h has to be included before windows.h -- set(internal_headers ${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.h -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.h -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.h -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h -- ${internal_headers} ) - set(lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_server_discovery_mdns.c -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.c -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.c -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.c -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.c - ${lib_sources}) - endif() - -@@ -1349,10 +1320,10 @@ if(UA_ENABLE_AMALGAMATION) - target_include_directories(open62541-object PRIVATE ${PROJECT_BINARY_DIR}) - target_include_directories(open62541-object PRIVATE "${ua_architecture_directories_to_include}") - if(UA_ENABLE_ENCRYPTION_MBEDTLS) -- target_include_directories(open62541-object PRIVATE ${MBEDTLS_INCLUDE_DIRS}) -+ target_include_directories(open62541-object PRIVATE ${MbedTLS_INCLUDE_DIRS}) - endif() - if(UA_ENABLE_ENCRYPTION_OPENSSL OR UA_ENABLE_MQTT_TLS_OPENSSL) -- target_include_directories(open62541-object PRIVATE ${OPENSSL_INCLUDE_DIR}) -+ target_include_directories(open62541-object PRIVATE ${OpenSSL_INCLUDE_DIR}) - endif() - if(UA_ENABLE_ENCRYPTION_LIBRESSL) - target_include_directories(open62541-object PRIVATE ${LIBRESSL_INCLUDE_DIR}) -@@ -1391,6 +1362,12 @@ else() - ) - - target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) -+ if(UA_ENABLE_DISCOVERY_MULTICAST) -+ target_include_directories(open62541-object PUBLIC ${mdnsd_INCLUDE_DIRS}) -+ endif() -+ if(UA_ENABLE_WEBSOCKET_SERVER) -+ target_include_directories(open62541-object PUBLIC ${Libwebsockets_INCLUDE_DIRS}) -+ endif() - - add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) - add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) -@@ -1404,6 +1381,13 @@ else() - set_target_properties(open62541-static PROPERTIES OUTPUT_NAME open62541) - endif() - add_library(open62541 $ $) -+ if(UA_ENABLE_DISCOVERY_MULTICAST) -+ list(APPEND open62541_LIBRARIES mdnsd::mdnsd) -+ endif() -+ -+ if(UA_ENABLE_WEBSOCKET_SERVER) -+ list(APPEND open62541_LIBRARIES Libwebsockets::Libwebsockets) -+ endif() - - if(UA_FORCE_CPP) - set_source_files_properties(${lib_sources} PROPERTIES LANGUAGE CXX) -@@ -1444,10 +1428,10 @@ else() - include_directories_private("${PROJECT_BINARY_DIR}") - - if(UA_ENABLE_ENCRYPTION_MBEDTLS) -- include_directories_private(${MBEDTLS_INCLUDE_DIRS}) -+ include_directories_private(${MbedTLS_INCLUDE_DIRS}) - endif() - if(UA_ENABLE_ENCRYPTION_OPENSSL OR UA_ENABLE_MQTT_TLS_OPENSSL) -- include_directories_private(${OPENSSL_INCLUDE_DIR}) -+ include_directories_private(${OpenSSL_INCLUDE_DIR}) - endif() - if(UA_ENABLE_ENCRYPTION_LIBRESSL) - include_directories_private(${LIBRESSL_INCLUDE_DIR}) -diff --git a/src/server/ua_discovery_manager.h b/src/server/ua_discovery_manager.h -index e0f48c0f..bae9bd65 100644 ---- a/src/server/ua_discovery_manager.h -+++ b/src/server/ua_discovery_manager.h -@@ -44,7 +44,7 @@ typedef struct periodicServerRegisterCallback_entry { - - #ifdef UA_ENABLE_DISCOVERY_MULTICAST - --#include "mdnsd/libmdnsd/mdnsd.h" -+#include "libmdnsd/mdnsd.h" - - /** - * TXT record: -diff --git a/src/server/ua_server_discovery_mdns.c b/src/server/ua_server_discovery_mdns.c -index fccb9c73..aa585b8f 100644 ---- a/src/server/ua_server_discovery_mdns.c -+++ b/src/server/ua_server_discovery_mdns.c -@@ -11,8 +11,8 @@ - #ifdef UA_ENABLE_DISCOVERY_MULTICAST - - #ifndef UA_ENABLE_AMALGAMATION --#include "mdnsd/libmdnsd/xht.h" --#include "mdnsd/libmdnsd/sdtxt.h" -+#include "libmdnsd/xht.h" -+#include "libmdnsd/sdtxt.h" - #endif - - #ifdef _WIN32 diff --git a/recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_3_4.patch b/recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_3_4.patch deleted file mode 100644 index c1c291956aa8ae..00000000000000 --- a/recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_3_4.patch +++ /dev/null @@ -1,196 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1934374e..199df369 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -11,7 +11,7 @@ endif() - - string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) - --set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") -+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR};${PROJECT_SOURCE_DIR}/tools/cmake") - find_package(Python3 REQUIRED) - set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) - find_package(Git) -@@ -41,11 +41,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - # The current version information. On the master branch, we take the version - # number from the latest release plus the "-undefined" label. Will be - # overwritten with more detailed information if git is available. --set(OPEN62541_VER_MAJOR 1) --set(OPEN62541_VER_MINOR 3) --set(OPEN62541_VER_PATCH 3) --set(OPEN62541_VER_LABEL "-undefined") # like "-rc1" or "-g4538abcd" or "-g4538abcd-dirty" --set(OPEN62541_VER_COMMIT "unknown-commit") -+set(OPEN62541_VER_MINOR "0" CACHE STRING "Set the major version. Used by conan") -+set(OPEN62541_VER_MAJOR "0" CACHE STRING "Set the minor version. Used by conan") -+set(OPEN62541_VER_PATCH "0" CACHE STRING "Set the patch version. Used by conan") -+set(OPEN62541_VER_LABEL "") -+set(OPEN62541_VER_COMMIT "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") - - # Overwrite the version information based on git if available - include(SetGitBasedVersion) -@@ -601,7 +601,7 @@ if(UA_ENABLE_ENCRYPTION_OPENSSL OR UA_ENABLE_MQTT_TLS_OPENSSL) - # use the OpenSSL encryption library - # https://cmake.org/cmake/help/v3.0/module/FindOpenSSL.html - find_package(OpenSSL REQUIRED) -- list(APPEND open62541_LIBRARIES ${OPENSSL_LIBRARIES}) -+ list(APPEND open62541_LIBRARIES ${OpenSSL_LIBRARIES}) - endif () - - if(UA_ENABLE_ENCRYPTION_LIBRESSL) -@@ -619,7 +619,7 @@ if(UA_ENABLE_ENCRYPTION_MBEDTLS OR UA_ENABLE_PUBSUB_ENCRYPTION) - # that is not possible, manually compile mbedTLS and set the cmake variables - # defined in /tools/cmake/FindMbedTLS.cmake. - find_package(MbedTLS REQUIRED) -- list(APPEND open62541_LIBRARIES ${MBEDTLS_LIBRARIES}) -+ list(APPEND open62541_LIBRARIES ${MbedTLS_LIBRARIES}) - endif() - - if(UA_ENABLE_TPM2_SECURITY) -@@ -630,8 +630,10 @@ if(UA_ENABLE_WEBSOCKET_SERVER) - # The recommended way is to install libwebsockets via the OS package manager. If - # that is not possible, manually compile libwebsockets and set the cmake variables - # defined in /tools/cmake/Findlibwebsockets.cmake -- find_package(libwebsockets REQUIRED) -- list(APPEND open62541_LIBRARIES ${LIBWEBSOCKETS_LIBRARIES}) -+ find_package(Libwebsockets REQUIRED) -+ list(APPEND open62541_LIBRARIES ${Libwebsockets_LIBRARIES}) -+ message(STATUS "Libwebsockets library: ${Libwebsockets_LIBRARIES}") -+ message(STATUS "Libwebsockets includes: ${Libwebsockets_INCLUDE_DIRS}") - - set(ua_architecture_directories_to_include ${ua_architecture_directories_to_include} - ${LIBWEBSOCKETS_INCLUDE_DIR}) -@@ -746,7 +748,7 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST - set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default - - # Debug -- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX AND NOT UA_BUILD_OSS_FUZZ AND -+ if(FALSE AND BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX AND NOT UA_BUILD_OSS_FUZZ AND - "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) - # Add default sanitizer settings when using clang and Debug build. - # This allows e.g. CLion to find memory locations for SegFaults -@@ -832,24 +834,7 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated - configure_file(tools/open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) - - if(UA_ENABLE_DISCOVERY_MULTICAST) -- include(GenerateExportHeader) -- set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) -- # create a "fake" empty library to generate the export header macros -- add_library(libmdnsd ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h) -- if (UA_FORCE_CPP) -- set_property(TARGET libmdnsd PROPERTY LINKER_LANGUAGE CXX) -- else() -- set_property(TARGET libmdnsd PROPERTY LINKER_LANGUAGE C) -- endif() -- set_property(TARGET libmdnsd PROPERTY DEFINE_SYMBOL "MDNSD_DYNAMIC_LINKING_EXPORT") -- configure_file("deps/mdnsd/libmdnsd/mdnsd_config_extra.in" -- "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config_extra") -- file(READ "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config_extra" MDNSD_CONFIG_EXTRA) -- generate_export_header(libmdnsd -- EXPORT_FILE_NAME "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h" -- BASE_NAME MDNSD -- DEFINE_NO_DEPRECATED -- CUSTOM_CONTENT_FROM_VARIABLE MDNSD_CONFIG_EXTRA) -+ find_package(mdnsd) - endif() - - set(exported_headers ${ua_architecture_headers_beginning}) -@@ -1154,18 +1139,7 @@ if(UA_DEBUG_DUMP_PKGS) - endif() - - if(UA_ENABLE_DISCOVERY_MULTICAST) -- # prepend in list, otherwise it complains that winsock2.h has to be included before windows.h -- set(internal_headers ${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.h -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.h -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.h -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h -- ${internal_headers} ) - set(lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_server_discovery_mdns.c -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.c -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.c -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.c -- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.c - ${lib_sources}) - endif() - -@@ -1370,10 +1344,10 @@ if(UA_ENABLE_AMALGAMATION) - target_include_directories(open62541-object PRIVATE ${PROJECT_BINARY_DIR}) - target_include_directories(open62541-object PRIVATE "${ua_architecture_directories_to_include}") - if(UA_ENABLE_ENCRYPTION_MBEDTLS) -- target_include_directories(open62541-object PRIVATE ${MBEDTLS_INCLUDE_DIRS}) -+ target_include_directories(open62541-object PRIVATE ${MbedTLS_INCLUDE_DIRS}) - endif() - if(UA_ENABLE_ENCRYPTION_OPENSSL OR UA_ENABLE_MQTT_TLS_OPENSSL) -- target_include_directories(open62541-object PRIVATE ${OPENSSL_INCLUDE_DIR}) -+ target_include_directories(open62541-object PRIVATE ${OpenSSL_INCLUDE_DIR}) - endif() - if(UA_ENABLE_ENCRYPTION_LIBRESSL) - target_include_directories(open62541-object PRIVATE ${LIBRESSL_INCLUDE_DIR}) -@@ -1412,6 +1386,12 @@ else() - ) - - target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) -+ if(UA_ENABLE_DISCOVERY_MULTICAST) -+ target_include_directories(open62541-object PUBLIC ${mdnsd_INCLUDE_DIRS}) -+ endif() -+ if(UA_ENABLE_WEBSOCKET_SERVER) -+ target_include_directories(open62541-object PUBLIC ${Libwebsockets_INCLUDE_DIRS}) -+ endif() - - add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) - add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) -@@ -1425,6 +1405,13 @@ else() - set_target_properties(open62541-static PROPERTIES OUTPUT_NAME open62541) - endif() - add_library(open62541 $ $) -+ if(UA_ENABLE_DISCOVERY_MULTICAST) -+ list(APPEND open62541_LIBRARIES mdnsd::mdnsd) -+ endif() -+ -+ if(UA_ENABLE_WEBSOCKET_SERVER) -+ list(APPEND open62541_LIBRARIES Libwebsockets::Libwebsockets) -+ endif() - - if(UA_FORCE_CPP) - set_source_files_properties(${lib_sources} PROPERTIES LANGUAGE CXX) -@@ -1465,10 +1452,10 @@ else() - include_directories_private("${PROJECT_BINARY_DIR}") - - if(UA_ENABLE_ENCRYPTION_MBEDTLS) -- include_directories_private(${MBEDTLS_INCLUDE_DIRS}) -+ include_directories_private(${MbedTLS_INCLUDE_DIRS}) - endif() - if(UA_ENABLE_ENCRYPTION_OPENSSL OR UA_ENABLE_MQTT_TLS_OPENSSL) -- include_directories_private(${OPENSSL_INCLUDE_DIR}) -+ include_directories_private(${OpenSSL_INCLUDE_DIR}) - endif() - if(UA_ENABLE_ENCRYPTION_LIBRESSL) - include_directories_private(${LIBRESSL_INCLUDE_DIR}) -diff --git a/src/server/ua_discovery_manager.h b/src/server/ua_discovery_manager.h -index e0f48c0f..bae9bd65 100644 ---- a/src/server/ua_discovery_manager.h -+++ b/src/server/ua_discovery_manager.h -@@ -44,7 +44,7 @@ typedef struct periodicServerRegisterCallback_entry { - - #ifdef UA_ENABLE_DISCOVERY_MULTICAST - --#include "mdnsd/libmdnsd/mdnsd.h" -+#include "libmdnsd/mdnsd.h" - - /** - * TXT record: -diff --git a/src/server/ua_server_discovery_mdns.c b/src/server/ua_server_discovery_mdns.c -index fccb9c73..aa585b8f 100644 ---- a/src/server/ua_server_discovery_mdns.c -+++ b/src/server/ua_server_discovery_mdns.c -@@ -11,8 +11,8 @@ - #ifdef UA_ENABLE_DISCOVERY_MULTICAST - - #ifndef UA_ENABLE_AMALGAMATION --#include "mdnsd/libmdnsd/xht.h" --#include "mdnsd/libmdnsd/sdtxt.h" -+#include "libmdnsd/xht.h" -+#include "libmdnsd/sdtxt.h" - #endif - - #ifdef _WIN32 diff --git a/recipes/open62541/all/patches/0002-disable-sanitizers-1_1_3-and-1_1_5.patch b/recipes/open62541/all/patches/0002-disable-sanitizers-1_1_3-and-1_1_5.patch deleted file mode 100644 index d8c1db13840da1..00000000000000 --- a/recipes/open62541/all/patches/0002-disable-sanitizers-1_1_3-and-1_1_5.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..cde6a08c 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -576,18 +576,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST - # Linker - set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default - -- # Debug -- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) -- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) -- # Add default sanitizer settings when using clang and Debug build. -- # This allows e.g. CLion to find memory locations for SegFaults -- message(STATUS "Sanitizer enabled") -- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") -- endif() -- endif() -- - if (NOT MINGW) - if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) - check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) diff --git a/recipes/open62541/all/submoduledata.yml b/recipes/open62541/all/submoduledata.yml index 19278804be7058..1de1304b65b1e4 100644 --- a/recipes/open62541/all/submoduledata.yml +++ b/recipes/open62541/all/submoduledata.yml @@ -1,51 +1,21 @@ submodules: - "1.0.3": - deps/ua-nodeset: - sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip - archive_pattern: "UA-Nodeset-{version}" "1.0.6": deps/ua-nodeset: sha256: c9c0228ce640bf4eead31b9c0b5b7190bc197a2d393a8e90328d14cb45805637 url: https://github.com/OPCFoundation/UA-Nodeset/archive/UA-1.04.8-2020-11-20.zip archive_pattern: "UA-Nodeset-{version}" - "1.1.3": - deps/ua-nodeset: - sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip - archive_pattern: "UA-Nodeset-{version}" - "1.1.5": - deps/ua-nodeset: - sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip - archive_pattern: "UA-Nodeset-{version}" "1.1.6": deps/ua-nodeset: sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip archive_pattern: "UA-Nodeset-{version}" - "1.2.2": - deps/ua-nodeset: - sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip - archive_pattern: "UA-Nodeset-{version}" - "1.2.4": - deps/ua-nodeset: - sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip - archive_pattern: "UA-Nodeset-{version}" "1.2.6": deps/ua-nodeset: sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip archive_pattern: "UA-Nodeset-{version}" - "1.3.1": + "1.3.8": deps/ua-nodeset: - sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip - archive_pattern: "UA-Nodeset-{version}" - "1.3.4": - deps/ua-nodeset: - sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip + sha256: 032c93e3f7c335bbb2d2d699804a804c9cdce2a2ecc3fe7cde552f2130982c26 + url: https://github.com/OPCFoundation/UA-Nodeset/archive/Glass=1.0.0-2022-01-01.zip archive_pattern: "UA-Nodeset-{version}" diff --git a/recipes/open62541/all/test_package/CMakeLists.txt b/recipes/open62541/all/test_package/CMakeLists.txt index 553baebf9bc49f..099ba922c11493 100644 --- a/recipes/open62541/all/test_package/CMakeLists.txt +++ b/recipes/open62541/all/test_package/CMakeLists.txt @@ -28,6 +28,7 @@ add_executable(${PROJECT_NAME} ${UA_TYPES_FOO_FLT_SOURCES} test_package.c ) + # Make sure the nodeset compiler is executed before compiling the main file add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-ns-foo_flt) target_link_libraries(${PROJECT_NAME} PRIVATE open62541::open62541) diff --git a/recipes/open62541/all/test_package/conanfile.py b/recipes/open62541/all/test_package/conanfile.py index 52782cf8480cf5..c1fe645c77cc34 100644 --- a/recipes/open62541/all/test_package/conanfile.py +++ b/recipes/open62541/all/test_package/conanfile.py @@ -7,7 +7,7 @@ # It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def requirements(self): @@ -19,8 +19,8 @@ def layout(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["open62541_NODESET_DIR"] = self.deps_user_info["ua-nodeset"].nodeset_dir.replace( - "\\", "/") # ua-nodeset path needs to be sanitized for windows systems + tc.variables["open62541_NODESET_DIR"] = self.dependencies["ua-nodeset"].conf_info.get( + "user.ua-nodeset:nodeset_dir").replace("\\", "/") # sanitize path for windows systems tc.variables["open62541_TOOLS_DIR"] = self.dependencies["open62541"].conf_info.get( "user.open62541:tools_dir") tc.generate() diff --git a/recipes/open62541/all/test_v1_package/CMakeLists.txt b/recipes/open62541/all/test_v1_package/CMakeLists.txt index bd17b291f8bc6b..8113fa1875eb6f 100644 --- a/recipes/open62541/all/test_v1_package/CMakeLists.txt +++ b/recipes/open62541/all/test_v1_package/CMakeLists.txt @@ -31,6 +31,7 @@ add_executable(${PROJECT_NAME} ${UA_TYPES_FOO_FLT_SOURCES} ../test_package/test_package.c ) + # Make sure the nodeset compiler is executed before compiling the main file add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-ns-foo_flt) target_link_libraries(${PROJECT_NAME} PRIVATE open62541::open62541) diff --git a/recipes/open62541/config.yml b/recipes/open62541/config.yml index 76c77487001109..6a69381fdd40fa 100644 --- a/recipes/open62541/config.yml +++ b/recipes/open62541/config.yml @@ -1,21 +1,9 @@ versions: - "1.3.4": - folder: all - "1.3.1": + "1.3.8": folder: all "1.2.6": folder: all - "1.2.4": - folder: all - "1.2.2": - folder: all "1.1.6": folder: all - "1.1.5": - folder: all - "1.1.3": - folder: all "1.0.6": folder: all - "1.0.3": - folder: all diff --git a/recipes/openal-soft/all/conanfile.py b/recipes/openal-soft/all/conanfile.py index 5401a9836e21a8..83f92f752bca9a 100644 --- a/recipes/openal-soft/all/conanfile.py +++ b/recipes/openal-soft/all/conanfile.py @@ -67,7 +67,7 @@ def layout(self): def requirements(self): if self.settings.os == "Linux": - self.requires("libalsa/1.2.7.2") + self.requires("libalsa/1.2.10") def validate(self): if self._openal_cxx_backend: diff --git a/recipes/openapi-generator/all/conandata.yml b/recipes/openapi-generator/all/conandata.yml index b429533e05e274..9624e0bf21d4b3 100644 --- a/recipes/openapi-generator/all/conandata.yml +++ b/recipes/openapi-generator/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.0.0": + url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar" + sha256: "80e8e9d71bdbdf513b8c65cf7d3fc2fe3d88aaeb4e39a2c6e20831f00032c775" "6.6.0": url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar" sha256: "9718ff7844e89462c75dcd9b20a35136f6db257bfe1b874db1e3002e99de4609" diff --git a/recipes/openapi-generator/config.yml b/recipes/openapi-generator/config.yml index 805a487d9c79bf..fc03893757ba99 100644 --- a/recipes/openapi-generator/config.yml +++ b/recipes/openapi-generator/config.yml @@ -1,4 +1,6 @@ versions: + "7.0.0": + folder: all "6.6.0": folder: all "6.5.0": diff --git a/recipes/openblas/all/conandata.yml b/recipes/openblas/all/conandata.yml index 33390fd9116e63..31efef8e95737e 100644 --- a/recipes/openblas/all/conandata.yml +++ b/recipes/openblas/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.3.24": + url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.24.tar.gz" + sha256: "ceadc5065da97bd92404cac7254da66cc6eb192679cf1002098688978d4d5132" "0.3.20": url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.20.tar.gz" sha256: "8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c" diff --git a/recipes/openblas/all/conanfile.py b/recipes/openblas/all/conanfile.py index d0b7d2c131bf86..d3f3b247af16a1 100644 --- a/recipes/openblas/all/conanfile.py +++ b/recipes/openblas/all/conanfile.py @@ -34,6 +34,14 @@ class OpenblasConan(ConanFile): "dynamic_arch": False, } short_paths = True + package_type = "library" + + @property + def _fortran_compiler(self): + comp_exe = self.conf.get("tools.build:compiler_executables") + if comp_exe and 'fortran' in comp_exe: + return comp_exe["fortran"] + return None def config_options(self): if self.settings.os == "Windows": @@ -75,9 +83,19 @@ def layout(self): def generate(self): tc = CMakeToolchain(self) - if self.options.build_lapack: - self.output.warning("Building with lapack support requires a Fortran compiler.") tc.cache_variables["NOFORTRAN"] = not self.options.build_lapack + # This checks explicit user-specified fortran compiler + if self.options.build_lapack: + if not self._fortran_compiler: + if Version(self.version) < "0.3.24": + self.output.warning( + "Building with LAPACK support requires a Fortran compiler.") + else: + tc.cache_variables["C_LAPACK"] = True + tc.cache_variables["NOFORTRAN"] = True + self.output.info( + "Building LAPACK without Fortran compiler") + tc.cache_variables["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack tc.cache_variables["DYNAMIC_ARCH"] = self.options.dynamic_arch tc.cache_variables["USE_THREAD"] = self.options.use_thread @@ -85,9 +103,8 @@ def generate(self): # Required for safe concurrent calls to OpenBLAS routines tc.cache_variables["USE_LOCKING"] = not self.options.use_thread - tc.cache_variables[ - "MSVC_STATIC_CRT" - ] = False # don't, may lie to consumer, /MD or /MT is managed by conan + # don't, may lie to consumer, /MD or /MT is managed by conan + tc.cache_variables["MSVC_STATIC_CRT"] = False # This is a workaround to add the libm dependency on linux, # which is required to successfully compile on older gcc versions. @@ -96,14 +113,15 @@ def generate(self): tc.generate() def build(self): - if Version(self.version) >= "0.3.12": - search = """message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")""" - replace = ( - """message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.")""" - ) - else: - search = "enable_language(Fortran)" - replace = """include(CheckLanguage) + if Version(self.version) < "0.3.21": + if Version(self.version) >= "0.3.12": + search = """message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")""" + replace = ( + """message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.")""" + ) + else: + search = "enable_language(Fortran)" + replace = """include(CheckLanguage) check_language(Fortran) if(CMAKE_Fortran_COMPILER) enable_language(Fortran) @@ -113,11 +131,12 @@ def build(self): set (NO_LAPACK 1) endif()""" - replace_in_file(self, - os.path.join(self.source_folder, self.source_folder, "cmake", "f_check.cmake"), - search, - replace, - ) + replace_in_file( + self, + os.path.join(self.source_folder, self.source_folder, "cmake", "f_check.cmake"), + search, + replace, + ) cmake = self._configure_cmake() cmake.build() @@ -125,6 +144,7 @@ def package(self): copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = self._configure_cmake() cmake.install() + 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")) fix_apple_shared_install_name(self) @@ -137,7 +157,9 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenBLAS") self.cpp_info.set_property("cmake_target_name", "OpenBLAS::OpenBLAS") self.cpp_info.set_property("pkg_config_name", "openblas") - cmake_component_name = "pthread" if self.options.use_thread else "serial" # TODO: ow to model this in CMakeDeps? + cmake_component_name = "pthread" if self.options.use_thread else "serial" # TODO: how to model this in CMakeDeps? + self.cpp_info.components["openblas_component"].set_property( + "cmake_target_name", "OpenBLAS::" + cmake_component_name) # 'pthread' causes issues without namespace self.cpp_info.components["openblas_component"].set_property("pkg_config_name", "openblas") self.cpp_info.components["openblas_component"].includedirs.append( os.path.join("include", "openblas") diff --git a/recipes/openblas/config.yml b/recipes/openblas/config.yml index 6d0851b7920c37..d12fbd6e7daea9 100644 --- a/recipes/openblas/config.yml +++ b/recipes/openblas/config.yml @@ -1,4 +1,6 @@ versions: + "0.3.24": + folder: all "0.3.20": folder: all "0.3.17": diff --git a/recipes/opencascade/all/conandata.yml b/recipes/opencascade/all/conandata.yml index 9973488d4454bf..fb18864cacb8a5 100644 --- a/recipes/opencascade/all/conandata.yml +++ b/recipes/opencascade/all/conandata.yml @@ -9,6 +9,34 @@ sources: url: "https://github.com/Open-Cascade-SAS/OCCT/archive/V7_5_0.tar.gz" sha256: "dbe1d62a9317ad1516bd4575293d9aab2dc20206ca7a60a7705c9a3b77dc59c9" patches: + "7.6.2": + - patch_file: "patches/7.5.0-0001-fix-compile-error-cxx17.patch" + patch_description: "Fix compilation error with C++17" + patch_source: "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=7021de2fe7a69d4c788ccf43b8b096dbcc8597c8" + patch_type: "portability" + - patch_file: "patches/7.5.0-0002-fix-compile-error-cxx20.patch" + patch_description: "Fix compilation error with C++20" + patch_source: "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=73035770f6fced4ec7dc7e6a0276ee894daa479a" + patch_type: "portability" + "7.6.0": + - patch_file: "patches/7.5.0-0001-fix-compile-error-cxx17.patch" + patch_description: "Fix compilation error with C++17" + patch_source: "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=7021de2fe7a69d4c788ccf43b8b096dbcc8597c8" + patch_type: "portability" + - patch_file: "patches/7.5.0-0002-fix-compile-error-cxx20.patch" + patch_description: "Fix compilation error with C++20" + patch_source: "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=73035770f6fced4ec7dc7e6a0276ee894daa479a" + patch_type: "portability" "7.5.0": - - patch_file: "patches/0001-undefined-ref-ncollection-lerp.patch" - base_path: "source_subfolder" + - patch_file: "patches/7.5.0-0001-fix-compile-error-cxx17.patch" + patch_description: "Fix compilation error with C++17" + patch_source: "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=7021de2fe7a69d4c788ccf43b8b096dbcc8597c8" + patch_type: "portability" + - patch_file: "patches/7.5.0-0002-fix-compile-error-cxx20.patch" + patch_description: "Fix compilation error with C++20" + patch_source: "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=73035770f6fced4ec7dc7e6a0276ee894daa479a" + patch_type: "portability" + - patch_file: "patches/7.5.0-0003-undefined-ref-ncollection-lerp.patch" + patch_description: "Fix undefined reference with Visual Studio 2015" + patch_source: "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=026aec186081397e553e492db1632ee606f01fad" + patch_type: "portability" diff --git a/recipes/opencascade/all/conanfile.py b/recipes/opencascade/all/conanfile.py index 4cf35d30dea34e..055db5ab3dbd90 100644 --- a/recipes/opencascade/all/conanfile.py +++ b/recipes/opencascade/all/conanfile.py @@ -1,13 +1,20 @@ -from conan.tools.files import rename -from conan.tools.microsoft import is_msvc -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools import json import os import textwrap -required_conan_version = ">=1.45.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, valid_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, + load, rename, replace_in_file, rmdir, save +) +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class OpenCascadeConan(ConanFile): @@ -17,8 +24,8 @@ class OpenCascadeConan(ConanFile): homepage = "https://dev.opencascade.org" url = "https://github.com/conan-io/conan-center-index" license = "LGPL-2.1-or-later" - topics = ("opencascade", "occt", "3d", "modeling", "cad") - + topics = ("occt", "3d", "modeling", "cad") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -48,11 +55,6 @@ class OpenCascadeConan(ConanFile): } short_paths = True - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" @property def _is_linux(self): @@ -60,41 +62,47 @@ def _is_linux(self): @property def _link_tk(self): - if tools.Version(self.version) >= "7.6.0": + if Version(self.version) >= "7.6.0": return self.options.with_tk else: return True @property def _link_opengl(self): - if tools.Version(self.version) >= "7.6.0": + if Version(self.version) >= "7.6.0": return self.options.with_opengl else: return True + @property + def _min_cppstd(self): + return "11" + 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 tools.Version(self.version) < "7.6.0": + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "7.6.0": del self.options.with_tk del self.options.with_draco del self.options.with_opengl - if self.settings.os == "Windows": - del self.options.fPIC if self.settings.build_type != "Debug": del self.options.extended_debug_messages 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("tcl/8.6.11") + self.requires("tcl/8.6.10") if self._link_tk: self.requires("tk/8.6.10") - self.requires("freetype/2.11.1") + self.requires("freetype/2.13.0") if self._link_opengl: self.requires("opengl/system") if self._is_linux: @@ -102,7 +110,7 @@ def requirements(self): self.requires("xorg/system") # TODO: add vtk support? if self.options.with_ffmpeg: - self.requires("ffmpeg/5.0") + self.requires("ffmpeg/6.0") if self.options.with_freeimage: self.requires("freeimage/3.18.0") if self.options.with_openvr: @@ -110,265 +118,342 @@ def requirements(self): if self.options.with_rapidjson: self.requires("rapidjson/1.1.0") if self.options.get_safe("with_draco"): - self.requires("draco/1.5.2") + self.requires("draco/1.5.6") if self.options.with_tbb: - self.requires("onetbb/2020.3") + self.requires("onetbb/2021.10.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) if self.settings.compiler == "clang" and self.settings.compiler.version == "6.0" and \ self.settings.build_type == "Release": - raise ConanInvalidConfiguration("OpenCASCADE {} doesn't support Clang 6.0 if Release build type".format(self.version)) + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Clang 6.0 if Release build type") 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) + + # Inject C++ standard from profile since we have removed hardcoded C++ standard from upstream build files + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + + tc.cache_variables["BUILD_LIBRARY_TYPE"] = "Shared" if self.options.shared else "Static" + tc.cache_variables["INSTALL_TEST_CASES"] = False + tc.cache_variables["BUILD_RESOURCES"] = False + tc.cache_variables["BUILD_RELEASE_DISABLE_EXCEPTIONS"] = True + if self.settings.build_type == "Debug": + tc.cache_variables["BUILD_WITH_DEBUG"] = self.options.extended_debug_messages + tc.cache_variables["BUILD_USE_PCH"] = False + tc.cache_variables["INSTALL_SAMPLES"] = False + + tc.cache_variables["INSTALL_DIR_LAYOUT"] = "Unix" + tc.cache_variables["INSTALL_DIR_BIN"] = "bin" + tc.cache_variables["INSTALL_DIR_LIB"] = "lib" + tc.cache_variables["INSTALL_DIR_INCLUDE"] = "include" + tc.cache_variables["INSTALL_DIR_RESOURCE"] = "res/resource" + tc.cache_variables["INSTALL_DIR_DATA"] = "res/data" + tc.cache_variables["INSTALL_DIR_SAMPLES"] = "res/samples" + tc.cache_variables["INSTALL_DIR_DOC"] = "res/doc" + + if is_msvc(self): + tc.cache_variables["BUILD_SAMPLES_MFC"] = False + tc.cache_variables["BUILD_SAMPLES_QT"] = False + tc.cache_variables["BUILD_Inspector"] = False + if is_apple_os(self): + tc.cache_variables["USE_GLX"] = False + if self.settings.os == "Windows": + tc.cache_variables["USE_D3D"] = False + tc.cache_variables["BUILD_ENABLE_FPE_SIGNAL_HANDLER"] = False + tc.cache_variables["BUILD_DOC_Overview"] = False + + tc.cache_variables["USE_FREEIMAGE"] = self.options.with_freeimage + tc.cache_variables["USE_OPENVR"] = self.options.with_openvr + tc.cache_variables["USE_FFMPEG"] = self.options.with_ffmpeg + tc.cache_variables["USE_TBB"] = self.options.with_tbb + tc.cache_variables["USE_RAPIDJSON"] = self.options.with_rapidjson + if Version(self.version) >= "7.6.0": + tc.cache_variables["USE_DRACO"] = self.options.with_draco + tc.cache_variables["USE_TK"] = self.options.with_tk + tc.cache_variables["USE_OPENGL"] = self.options.with_opengl + + # Relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") - cmakelists_tools = os.path.join(self._source_subfolder, "tools", "CMakeLists.txt") - occt_toolkit_cmake = os.path.join(self._source_subfolder, "adm", "cmake", "occt_toolkit.cmake") - occt_csf_cmake = os.path.join(self._source_subfolder, "adm", "cmake", "occt_csf.cmake") - occt_defs_flags_cmake = os.path.join(self._source_subfolder, "adm", "cmake", "occt_defs_flags.cmake") - - # Inject conanbuildinfo, upstream build files are not ready for a CMake wrapper (too much modifications required) - # Also inject compile flags - tools.replace_in_file( + apply_conandata_patches(self) + + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + cmakelists_tools = os.path.join(self.source_folder, "tools", "CMakeLists.txt") + occt_toolkit_cmake = os.path.join(self.source_folder, "adm", "cmake", "occt_toolkit.cmake") + occt_csf_cmake = os.path.join(self.source_folder, "adm", "cmake", "occt_csf.cmake") + occt_defs_flags_cmake = os.path.join(self.source_folder, "adm", "cmake", "occt_defs_flags.cmake") + + # Inject interface definitions of dependencies because opencascade + # does not always link to CMake imported targets + sorted_deps = [dep for dep in reversed(self.dependencies.host.topological_sort.values())] + deps_defines = " ".join([f"-D{d}" for dep in sorted_deps for d in dep.cpp_info.aggregated_components().defines]) + replace_in_file( + self, cmakelists, "project (OCCT)", - "project (OCCT)\n" - "include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\n" - "conan_basic_setup(TARGETS KEEP_RPATHS)\n" - "conan_global_flags()") + textwrap.dedent(f"""\ + project (OCCT) + add_definitions({deps_defines}) + """), + ) - # Avoid to add system include/libs directories - tools.replace_in_file(cmakelists, "3RDPARTY_INCLUDE_DIRS", "CONAN_INCLUDE_DIRS") - tools.replace_in_file(cmakelists, "3RDPARTY_LIBRARY_DIRS", "CONAN_LIB_DIRS") - tools.replace_in_file(cmakelists_tools, "3RDPARTY_INCLUDE_DIRS", "CONAN_INCLUDE_DIRS") - tools.replace_in_file(cmakelists_tools, "3RDPARTY_LIBRARY_DIRS", "CONAN_LIB_DIRS") + # Avoid to add system include/libs directories and inject directories + # from conan dependencies instead + for cmake_file in [cmakelists, cmakelists_tools]: + deps_includedirs = ";".join([p.replace("\\", "/") for dep in sorted_deps for p in dep.cpp_info.aggregated_components().includedirs]) + replace_in_file( + self, + cmake_file, + "if (3RDPARTY_INCLUDE_DIRS)", + f"set(3RDPARTY_INCLUDE_DIRS \"{deps_includedirs}\")\nif (3RDPARTY_INCLUDE_DIRS)", + ) + deps_libdirs = ";".join([p.replace("\\", "/") for dep in sorted_deps for p in dep.cpp_info.aggregated_components().libdirs]) + replace_in_file( + self, + cmake_file, + "if (3RDPARTY_LIBRARY_DIRS)", + f"set(3RDPARTY_LIBRARY_DIRS \"{deps_libdirs}\")\nif (3RDPARTY_LIBRARY_DIRS)", + ) # Do not fail due to "fragile" upstream logic to find dependencies - tools.replace_in_file(cmakelists, "if (3RDPARTY_NOT_INCLUDED)", "if(0)") - tools.replace_in_file(cmakelists, "if (3RDPARTY_NO_LIBS)", "if(0)") - tools.replace_in_file(cmakelists, "if (3RDPARTY_NO_DLLS)", "if(0)") + replace_in_file(self, cmakelists, "if (3RDPARTY_NOT_INCLUDED)", "if(0)") + replace_in_file(self, cmakelists, "if (3RDPARTY_NO_LIBS)", "if(0)") + replace_in_file(self, cmakelists, "if (3RDPARTY_NO_DLLS)", "if(0)") # Inject dependencies from conan, and avoid to rely on upstream custom CMake files - conan_targets = [] + deps_targets = [] ## freetype - conan_targets.append("CONAN_PKG::freetype") - tools.replace_in_file(cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/freetype\")", "") - tools.replace_in_file( + deps_targets.append("Freetype::Freetype") + replace_in_file( + self, + cmakelists, + "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/freetype\")", + "find_package(Freetype REQUIRED MODULE)", + ) + freetype_libs = " ".join(self.dependencies["freetype"].cpp_info.aggregated_components().libs) + replace_in_file( + self, occt_csf_cmake, "set (CSF_FREETYPE \"freetype\")", - "set (CSF_FREETYPE \"{}\")".format(" ".join(self.deps_cpp_info["freetype"].libs))) + f"set (CSF_FREETYPE \"{freetype_libs}\")", + ) ## tcl - conan_targets.append("CONAN_PKG::tcl") - tools.replace_in_file(cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/tcl\")", "") - csf_tcl_libs = "set (CSF_TclLibs \"{}\")".format(" ".join(self.deps_cpp_info["tcl"].libs)) - tools.replace_in_file(occt_csf_cmake, "set (CSF_TclLibs \"tcl86\")", csf_tcl_libs) - tools.replace_in_file(occt_csf_cmake, "set (CSF_TclLibs Tcl)", csf_tcl_libs) - if tools.Version(self.version) >= "7.6.0": - tools.replace_in_file(occt_csf_cmake, "set (CSF_TclLibs \"tcl8.6\")", csf_tcl_libs) + deps_targets.append("tcl::tcl") + replace_in_file(self, cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/tcl\")", "find_package(TCL REQUIRED)") + tcl_libs = " ".join(self.dependencies["tcl"].cpp_info.aggregated_components().libs) + csf_tcl_libs = f"set (CSF_TclLibs \"{tcl_libs}\")" + replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs \"tcl86\")", csf_tcl_libs) + replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs Tcl)", csf_tcl_libs) + if Version(self.version) >= "7.6.0": + replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs \"tcl8.6\")", csf_tcl_libs) else: - tools.replace_in_file(occt_csf_cmake, "set (CSF_TclLibs \"tcl8.6\")", csf_tcl_libs) + replace_in_file(self, occt_csf_cmake, "set (CSF_TclLibs \"tcl8.6\")", csf_tcl_libs) ## tk if self._link_tk: - conan_targets.append("CONAN_PKG::tk") - tools.replace_in_file(cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/tk\")", "") - csf_tk_libs = "set (CSF_TclTkLibs \"{}\")".format(" ".join(self.deps_cpp_info["tk"].libs)) - tools.replace_in_file(occt_csf_cmake, "set (CSF_TclTkLibs \"tk86\")", csf_tk_libs) - tools.replace_in_file(occt_csf_cmake, "set (CSF_TclTkLibs Tk)", csf_tk_libs) - if tools.Version(self.version) >= "7.6.0": - tools.replace_in_file(occt_csf_cmake, "set (CSF_TclTkLibs \"tk8.6\")", csf_tk_libs) + deps_targets.append("tk::tk") + replace_in_file(self, cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/tk\")", "find_package(tk REQUIRED)") + tk_libs = " ".join(self.dependencies["tk"].cpp_info.aggregated_components().libs) + csf_tk_libs = f"set (CSF_TclTkLibs \"{tk_libs}\")" + replace_in_file(self, occt_csf_cmake, "set (CSF_TclTkLibs \"tk86\")", csf_tk_libs) + replace_in_file(self, occt_csf_cmake, "set (CSF_TclTkLibs Tk)", csf_tk_libs) + if Version(self.version) >= "7.6.0": + replace_in_file(self, occt_csf_cmake, "set (CSF_TclTkLibs \"tk8.6\")", csf_tk_libs) else: - tools.replace_in_file(occt_csf_cmake, "set (CSF_TclTkLibs \"tk8.6\")", csf_tk_libs) + replace_in_file(self, occt_csf_cmake, "set (CSF_TclTkLibs \"tk8.6\")", csf_tk_libs) ## fontconfig if self._is_linux: - conan_targets.append("CONAN_PKG::fontconfig") - if tools.Version(self.version) >= "7.6.0": - tools.replace_in_file( + deps_targets.append("Fontconfig::Fontconfig") + fontconfig_libs = " ".join(self.dependencies["fontconfig"].cpp_info.aggregated_components().libs) + if Version(self.version) >= "7.6.0": + replace_in_file( + self, occt_csf_cmake, "set (CSF_fontconfig \"fontconfig\")", - "set (CSF_fontconfig \"{}\")".format(" ".join(self.deps_cpp_info["fontconfig"].libs))) + f"find_package(Fontconfig REQUIRED)\nset (CSF_fontconfig \"{fontconfig_libs}\")", + ) else: - tools.replace_in_file( + replace_in_file( + self, occt_csf_cmake, "set (CSF_fontconfig \"fontconfig\")", - "set (CSF_fontconfig \"{}\")".format(" ".join(self.deps_cpp_info["fontconfig"].libs))) + f"find_package(Fontconfig REQUIRED)\nset (CSF_fontconfig \"{fontconfig_libs}\")", + ) ## onetbb if self.options.with_tbb: - conan_targets.append("CONAN_PKG::onetbb") - tools.replace_in_file(cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/tbb\")", "") - tools.replace_in_file( + deps_targets.append("TBB::tbb") + replace_in_file( + self, + cmakelists, + "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/tbb\")", + "find_package(TBB REQUIRED)", + ) + tbb_libs = " ".join(self.dependencies["onetbb"].cpp_info.aggregated_components().libs) + replace_in_file( + self, occt_csf_cmake, "set (CSF_TBB \"tbb tbbmalloc\")", - "set (CSF_TBB \"{}\")".format(" ".join(self.deps_cpp_info["onetbb"].libs))) + f"set (CSF_TBB \"{tbb_libs}\")", + ) ## ffmpeg if self.options.with_ffmpeg: - conan_targets.append("CONAN_PKG::ffmpeg") - tools.replace_in_file(cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/ffmpeg\")", "") - tools.replace_in_file( + deps_targets.append("ffmpeg::ffmpeg") + replace_in_file( + self, + cmakelists, + "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/ffmpeg\")", + "find_package(ffmpeg REQUIRED)", + ) + ffmpeg_libs = " ".join(self.dependencies["ffmpeg"].cpp_info.aggregated_components().libs) + replace_in_file( + self, occt_csf_cmake, "set (CSF_FFmpeg \"avcodec avformat swscale avutil\")", - "set (CSF_FFmpeg \"{}\")".format(" ".join(self.deps_cpp_info["ffmpeg"].libs))) + f"set (CSF_FFmpeg \"{ffmpeg_libs}\")", + ) ## freeimage if self.options.with_freeimage: - conan_targets.append("CONAN_PKG::freeimage") - tools.replace_in_file(cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/freeimage\")", "") - tools.replace_in_file( + deps_targets.append("freeimage::freeimage") + replace_in_file( + self, cmakelists, + "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/freeimage\")", + "find_package(freeimage REQUIRED)", + ) + freeimage_libs = " ".join(self.dependencies["freeimage"].cpp_info.aggregated_components().libs) + replace_in_file( + self, occt_csf_cmake, "set (CSF_FreeImagePlus \"freeimage\")", - "set (CSF_FreeImagePlus \"{}\")".format(" ".join(self.deps_cpp_info["freeimage"].libs))) + f"set (CSF_FreeImagePlus \"{freeimage_libs}\")", + ) ## openvr if self.options.with_openvr: - conan_targets.append("CONAN_PKG::openvr") - tools.replace_in_file(cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/openvr\")", "") - tools.replace_in_file( + deps_targets.append("openvr::openvr") + replace_in_file( + self, + cmakelists, + "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/openvr\")", + "find_package(openvr REQUIRED)", + ) + openvr_libs = " ".join(self.dependencies["openvr"].cpp_info.aggregated_components().libs) + replace_in_file( + self, occt_csf_cmake, "set (CSF_OpenVR \"openvr_api\")", - "set (CSF_OpenVR \"{}\")".format(" ".join(self.deps_cpp_info["openvr"].libs))) + f"set (CSF_OpenVR \"{openvr_libs}\")", + ) ## rapidjson if self.options.with_rapidjson: - conan_targets.append("CONAN_PKG::rapidjson") - tools.replace_in_file(cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/rapidjson\")", "") + deps_targets.append("rapidjson") + replace_in_file( + self, + cmakelists, + "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/rapidjson\")", + "find_package(RapidJSON REQUIRED)", + ) ## draco if self.options.get_safe("with_draco"): - conan_targets.append("CONAN_PKG::draco") - tools.replace_in_file(cmakelists, "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/draco\")", "") + deps_targets.append("draco::draco") + replace_in_file( + self, + cmakelists, + "OCCT_INCLUDE_CMAKE_FILE (\"adm/cmake/draco\")", + "find_package(draco REQUIRED)", + ) ## opengl - tools.replace_in_file( + replace_in_file( + self, occt_csf_cmake, "set (CSF_OpenGlLibs ", - "# set (CSF_OpenGlLibs ") + "find_package(OpenGL)\n# set (CSF_OpenGlLibs ", + ) if self._link_opengl: - conan_targets.append("CONAN_PKG::opengl") + deps_targets.append("OpenGL::GL") - ## Inject conan targets - tools.replace_in_file( + ## Inject dependencies targets + replace_in_file( + self, occt_toolkit_cmake, "${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT}", - "${{USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT}} {}".format(" ".join(conan_targets))) + "${{USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT}} {}".format(" ".join(deps_targets)), + ) # Do not install pdb files - if tools.Version(self.version) >= "7.6.0": - tools.replace_in_file( + if Version(self.version) >= "7.6.0": + replace_in_file( + self, occt_toolkit_cmake, """ install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo DESTINATION "${INSTALL_DIR_BIN}\\${OCCT_INSTALL_BIN_LETTER}")""", - "") + "", + ) else: - tools.replace_in_file( + replace_in_file( + self, occt_toolkit_cmake, """ install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb CONFIGURATIONS Debug RelWithDebInfo DESTINATION "${INSTALL_DIR_BIN}\\${OCCT_INSTALL_BIN_LETTER}")""", - "") + "", + ) # Honor fPIC option, compiler.cppstd and compiler.libcxx - tools.replace_in_file(occt_defs_flags_cmake, "-fPIC", "") - tools.replace_in_file(occt_defs_flags_cmake, "-std=c++0x", "") - tools.replace_in_file(occt_defs_flags_cmake, "-std=gnu++0x", "") - tools.replace_in_file(occt_defs_flags_cmake, "-stdlib=libc++", "") - tools.replace_in_file(occt_csf_cmake, + replace_in_file(self, occt_defs_flags_cmake, "-fPIC", "") + replace_in_file(self, occt_defs_flags_cmake, "-std=c++0x", "") + replace_in_file(self, occt_defs_flags_cmake, "-std=gnu++0x", "") + replace_in_file(self, occt_defs_flags_cmake, "-stdlib=libc++", "") + replace_in_file(self, occt_csf_cmake, "set (CSF_ThreadLibs \"pthread rt stdc++\")", "set (CSF_ThreadLibs \"pthread rt\")") # No hardcoded link through #pragma - if tools.Version(self.version) < "7.6.0": - tools.replace_in_file( - os.path.join(self._source_subfolder, "src", "Font", "Font_FontMgr.cxx"), + if Version(self.version) < "7.6.0": + replace_in_file( + self, + os.path.join(self.source_folder, "src", "Font", "Font_FontMgr.cxx"), "#pragma comment (lib, \"freetype.lib\")", - "") - tools.replace_in_file( - os.path.join(self._source_subfolder, "src", "Draw", "Draw.cxx"), + "", + ) + replace_in_file( + self, + os.path.join(self.source_folder, "src", "Draw", "Draw.cxx"), """#pragma comment (lib, "tcl" STRINGIZE2(TCL_MAJOR_VERSION) STRINGIZE2(TCL_MINOR_VERSION) ".lib") #pragma comment (lib, "tk" STRINGIZE2(TCL_MAJOR_VERSION) STRINGIZE2(TCL_MINOR_VERSION) ".lib")""", "" ) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - - # Inject C++ standard from profile since we have removed hardcoded C++11 from upstream build files - if not tools.valid_min_cppstd(self, 11): - cmake.definitions["CMAKE_CXX_STANDARD"] = 11 - - # Generate a relocatable shared lib on Macos - cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - - cmake.definitions["BUILD_LIBRARY_TYPE"] = "Shared" if self.options.shared else "Static" - cmake.definitions["INSTALL_TEST_CASES"] = False - cmake.definitions["BUILD_RESOURCES"] = False - cmake.definitions["BUILD_RELEASE_DISABLE_EXCEPTIONS"] = True - if self.settings.build_type == "Debug": - cmake.definitions["BUILD_WITH_DEBUG"] = self.options.extended_debug_messages - cmake.definitions["BUILD_USE_PCH"] = False - cmake.definitions["INSTALL_SAMPLES"] = False - - cmake.definitions["INSTALL_DIR_LAYOUT"] = "Unix" - cmake.definitions["INSTALL_DIR_BIN"] = "bin" - cmake.definitions["INSTALL_DIR_LIB"] = "lib" - cmake.definitions["INSTALL_DIR_INCLUDE"] = "include" - cmake.definitions["INSTALL_DIR_RESOURCE"] = "res/resource" - cmake.definitions["INSTALL_DIR_DATA"] = "res/data" - cmake.definitions["INSTALL_DIR_SAMPLES"] = "res/samples" - cmake.definitions["INSTALL_DIR_DOC"] = "res/doc" - - if is_msvc(self): - cmake.definitions["BUILD_SAMPLES_MFC"] = False - cmake.definitions["BUILD_SAMPLES_QT"] = False - cmake.definitions["BUILD_Inspector"] = False - if tools.is_apple_os(self.settings.os): - cmake.definitions["USE_GLX"] = False - if self.settings.os == "Windows": - cmake.definitions["USE_D3D"] = False - cmake.definitions["BUILD_ENABLE_FPE_SIGNAL_HANDLER"] = False - cmake.definitions["BUILD_DOC_Overview"] = False - - cmake.definitions["USE_FREEIMAGE"] = self.options.with_freeimage - cmake.definitions["USE_OPENVR"] = self.options.with_openvr - cmake.definitions["USE_FFMPEG"] = self.options.with_ffmpeg - cmake.definitions["USE_TBB"] = self.options.with_tbb - cmake.definitions["USE_RAPIDJSON"] = self.options.with_rapidjson - if tools.Version(self.version) >= "7.6.0": - cmake.definitions["USE_DRACO"] = self.options.with_draco - cmake.definitions["USE_TK"] = self.options.with_tk - cmake.definitions["USE_OPENGL"] = self.options.with_opengl - - cmake.configure(source_folder=self._source_subfolder) - return cmake - def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def _replace_package_folder(self, source, target): if os.path.isdir(os.path.join(self.package_folder, source)): - tools.rmdir(os.path.join(self.package_folder, target)) + rmdir(self, os.path.join(self.package_folder, target)) rename(self, os.path.join(self.package_folder, source), os.path.join(self.package_folder, target)) def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy( - "LICENSE_LGPL_21.txt", - src=self._source_subfolder, - dst="licenses") - self.copy( - "OCCT_LGPL_EXCEPTION.txt", - src=self._source_subfolder, - dst="licenses") - tools.rmdir(os.path.join(self.package_folder, "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + for license_file in ["LICENSE_LGPL_21.txt", "OCCT_LGPL_EXCEPTION.txt"]: + copy(self, license_file, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) if self.settings.build_type == "Debug": self._replace_package_folder("libd", "lib") self._replace_package_folder("bind", "bin") @@ -382,24 +467,23 @@ def package(self): # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._cmake_module_file_rel_path), - {target: "OpenCASCADE::{}".format(target) for module in occt_modules.values() for target in module} + {target: f"opencascade::{target}" for module in occt_modules.values() for target in module}, ) - @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 _cmake_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 _get_modules_from_source_code(self): csf_to_conan_dependencies = { @@ -435,25 +519,24 @@ def _get_modules_from_source_code(self): "CSF_wsock32": {"system_libs": ["wsock32"] if self.settings.os == "Windows" else []}, "CSF_d3d9": {}, # Apple OS frameworks - "CSF_Appkit": {"frameworks": ["UIKit"] if self.settings.os == "iOS" else ["Appkit"] if tools.is_apple_os(self.settings.os) else []}, - "CSF_IOKit": {"frameworks": ["IOKit"] if tools.is_apple_os(self.settings.os) else []}, + "CSF_Appkit": {"frameworks": ["UIKit"] if self.settings.os == "iOS" else ["Appkit"] if is_apple_os(self) else []}, + "CSF_IOKit": {"frameworks": ["IOKit"] if is_apple_os(self) else []}, "CSF_objc": {}, } modules = {} - # MODULES file lists all modules and all possible components per module - modules_content = tools.load(os.path.join(self.build_folder, self._source_subfolder, "adm", "MODULES")) - packaged_libs_list = tools.collect_libs(self, "lib") + # MODULES: lists all modules and all possible components per module + modules_content = load(self, os.path.join(self.source_folder, "adm", "MODULES")) + packaged_libs_list = collect_libs(self, "lib") for module_line in modules_content.splitlines(): components = {} module_components = module_line.split() components_list = [component for component in module_components[1:] if component in packaged_libs_list] for component_name in components_list: component_deps = {} - # EXTERNLIB file stores dependencies of each component. External dependencies are prefixed with CSF_ - externlib_content = tools.load(os.path.join(self.build_folder, self._source_subfolder, - "src", component_name, "EXTERNLIB")) + # EXTERNLIB: stores dependencies of each component. External dependencies are prefixed with CSF_ + externlib_content = load(self, os.path.join(self.source_folder, "src", component_name, "EXTERNLIB")) for dependency in externlib_content.splitlines(): if dependency.startswith("TK") and dependency in packaged_libs_list: component_deps.setdefault("internals", []).append(dependency) @@ -468,7 +551,7 @@ def _get_modules_from_source_code(self): return modules def _create_modules_json_file(self, modules): - tools.save(self._modules_helper_filepath, json.dumps(modules, indent=4)) + save(self, self._modules_helper_filepath, json.dumps(modules, indent=4)) @property def _modules_helper_filepath(self): @@ -478,7 +561,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenCASCADE") def _to_qualified_name(target): - return "occt_{}".format(target.lower()) + return f"occt_{target.lower()}" def _register_components(modules_dict): for module, targets in modules_dict.items(): @@ -516,16 +599,12 @@ def _register_components(modules_dict): self.cpp_info.components[conan_component_module_name].names["cmake_find_package"] = module self.cpp_info.components[conan_component_module_name].names["cmake_find_package_multi"] = module - occt_modules_json_content = tools.load(self._modules_helper_filepath) + occt_modules_json_content = load(self, self._modules_helper_filepath) occt_modules = json.loads(occt_modules_json_content) _register_components(occt_modules) - # DRAWEXE executable is not created if static build - if self.options.shared: - 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.names["cmake_find_package"] = "OpenCASCADE" - self.cpp_info.names["cmake_find_package_multi"] = "OpenCASCADE" + self.cpp_info.filenames["cmake_find_package"] = "OpenCASCADE" + self.cpp_info.filenames["cmake_find_package_multi"] = "OpenCASCADE" + if self.options.shared: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/opencascade/all/patches/0001-undefined-ref-ncollection-lerp.patch b/recipes/opencascade/all/patches/0001-undefined-ref-ncollection-lerp.patch deleted file mode 100644 index ddfa9af0fec0a7..00000000000000 --- a/recipes/opencascade/all/patches/0001-undefined-ref-ncollection-lerp.patch +++ /dev/null @@ -1,119 +0,0 @@ -Fix undefined reference with Visual Studio 2015 -see https://tracker.dev.opencascade.org/view.php?id=31922 - ---- a/src/Graphic3d/Graphic3d_Camera.cxx -+++ b/src/Graphic3d/Graphic3d_Camera.cxx -@@ -1576,18 +1576,19 @@ bool Graphic3d_Camera::ZFitAll (const Standard_Real theScaleFactor, - //function : Interpolate - //purpose : - //============================================================================= --template<> --Standard_EXPORT void NCollection_Lerp::Interpolate (const double theT, -- Handle(Graphic3d_Camera)& theCamera) const -+void Graphic3d_Camera::Interpolate (const Handle(Graphic3d_Camera)& theStart, -+ const Handle(Graphic3d_Camera)& theEnd, -+ const double theT, -+ Handle(Graphic3d_Camera)& theCamera) - { - if (Abs (theT - 1.0) < Precision::Confusion()) - { - // just copy end-point transformation -- theCamera->Copy (myEnd); -+ theCamera->Copy (theEnd); - return; - } - -- theCamera->Copy (myStart); -+ theCamera->Copy (theStart); - if (Abs (theT - 0.0) < Precision::Confusion()) - { - return; -@@ -1595,8 +1596,8 @@ Standard_EXPORT void NCollection_Lerp::Interpolate (co - - // apply rotation - { -- gp_Ax3 aCamStart = cameraToAx3 (*myStart); -- gp_Ax3 aCamEnd = cameraToAx3 (*myEnd); -+ gp_Ax3 aCamStart = cameraToAx3 (*theStart); -+ gp_Ax3 aCamEnd = cameraToAx3 (*theEnd); - gp_Trsf aTrsfStart, aTrsfEnd; - aTrsfStart.SetTransformation (aCamStart, gp::XOY()); - aTrsfEnd .SetTransformation (aCamEnd, gp::XOY()); -@@ -1612,13 +1613,13 @@ Standard_EXPORT void NCollection_Lerp::Interpolate (co - - // apply translation - { -- gp_XYZ aCenter = NCollection_Lerp::Interpolate (myStart->Center().XYZ(), myEnd->Center().XYZ(), theT); -- gp_XYZ anEye = NCollection_Lerp::Interpolate (myStart->Eye().XYZ(), myEnd->Eye().XYZ(), theT); -+ gp_XYZ aCenter = NCollection_Lerp::Interpolate (theStart->Center().XYZ(), theEnd->Center().XYZ(), theT); -+ gp_XYZ anEye = NCollection_Lerp::Interpolate (theStart->Eye().XYZ(), theEnd->Eye().XYZ(), theT); - gp_XYZ anAnchor = aCenter; - Standard_Real aKc = 0.0; - -- const Standard_Real aDeltaCenter = myStart->Center().Distance (myEnd->Center()); -- const Standard_Real aDeltaEye = myStart->Eye() .Distance (myEnd->Eye()); -+ const Standard_Real aDeltaCenter = theStart->Center().Distance (theEnd->Center()); -+ const Standard_Real aDeltaEye = theStart->Eye() .Distance (theEnd->Eye()); - if (aDeltaEye <= gp::Resolution()) - { - anAnchor = anEye; -@@ -1628,14 +1629,14 @@ Standard_EXPORT void NCollection_Lerp::Interpolate (co - { - aKc = aDeltaCenter / (aDeltaCenter + aDeltaEye); - -- const gp_XYZ anAnchorStart = NCollection_Lerp::Interpolate (myStart->Center().XYZ(), myStart->Eye().XYZ(), aKc); -- const gp_XYZ anAnchorEnd = NCollection_Lerp::Interpolate (myEnd ->Center().XYZ(), myEnd ->Eye().XYZ(), aKc); -+ const gp_XYZ anAnchorStart = NCollection_Lerp::Interpolate (theStart->Center().XYZ(), theStart->Eye().XYZ(), aKc); -+ const gp_XYZ anAnchorEnd = NCollection_Lerp::Interpolate (theEnd ->Center().XYZ(), theEnd ->Eye().XYZ(), aKc); - anAnchor = NCollection_Lerp::Interpolate (anAnchorStart, anAnchorEnd, theT); - } - - const gp_Vec aDirEyeToCenter = theCamera->Direction(); -- const Standard_Real aDistEyeCenterStart = myStart->Eye().Distance (myStart->Center()); -- const Standard_Real aDistEyeCenterEnd = myEnd ->Eye().Distance (myEnd ->Center()); -+ const Standard_Real aDistEyeCenterStart = theStart->Eye().Distance (theStart->Center()); -+ const Standard_Real aDistEyeCenterEnd = theEnd ->Eye().Distance (theEnd ->Center()); - const Standard_Real aDistEyeCenter = NCollection_Lerp::Interpolate (aDistEyeCenterStart, aDistEyeCenterEnd, theT); - aCenter = anAnchor + aDirEyeToCenter.XYZ() * aDistEyeCenter * aKc; - anEye = anAnchor - aDirEyeToCenter.XYZ() * aDistEyeCenter * (1.0 - aKc); -@@ -1644,10 +1645,10 @@ Standard_EXPORT void NCollection_Lerp::Interpolate (co - } - - // apply scaling -- if (Abs(myStart->Scale() - myEnd->Scale()) > Precision::Confusion() -- && myStart->IsOrthographic()) -+ if (Abs(theStart->Scale() - theEnd->Scale()) > Precision::Confusion() -+ && theStart->IsOrthographic()) - { -- const Standard_Real aScale = NCollection_Lerp::Interpolate (myStart->Scale(), myEnd->Scale(), theT); -+ const Standard_Real aScale = NCollection_Lerp::Interpolate (theStart->Scale(), theEnd->Scale(), theT); - theCamera->SetScale (aScale); - } - } ---- a/src/Graphic3d/Graphic3d_Camera.hxx -+++ b/src/Graphic3d/Graphic3d_Camera.hxx -@@ -148,6 +148,10 @@ public: - }; - - public: -+ Standard_EXPORT static void Interpolate (const Handle(Graphic3d_Camera)& theStart, -+ const Handle(Graphic3d_Camera)& theEnd, -+ const double theT, -+ Handle(Graphic3d_Camera)& theCamera); - - //! Default constructor. - //! Initializes camera with the following properties: -@@ -852,8 +856,11 @@ DEFINE_STANDARD_HANDLE (Graphic3d_Camera, Standard_Transient) - //! In this case, application might define intermediate camera positions for interpolation - //! or implement own interpolation logic. - template<> --Standard_EXPORT void NCollection_Lerp::Interpolate (const double theT, -- Handle(Graphic3d_Camera)& theResult) const; -+inline void NCollection_Lerp::Interpolate (const double theT, -+ Handle(Graphic3d_Camera)& theResult) const -+{ -+ Graphic3d_Camera::Interpolate (myStart, myEnd, theT, theResult); -+} - typedef NCollection_Lerp Graphic3d_CameraLerp; - - #endif diff --git a/recipes/opencascade/all/patches/7.5.0-0001-fix-compile-error-cxx17.patch b/recipes/opencascade/all/patches/7.5.0-0001-fix-compile-error-cxx17.patch new file mode 100644 index 00000000000000..5084de84816a37 --- /dev/null +++ b/recipes/opencascade/all/patches/7.5.0-0001-fix-compile-error-cxx17.patch @@ -0,0 +1,83 @@ +--- a/src/QANCollection/QANCollection_Stl.cxx ++++ b/src/QANCollection/QANCollection_Stl.cxx +@@ -38,18 +38,11 @@ + #include + #include + #include ++#include + + //! Size of test data sets. + const int THE_TEST_SIZE = 5000; + +-namespace { +- // Auxiliary class to use in std::random_shuffle() +- struct RandomGenerator { +- RandomGenerator () { srand(1); } +- ptrdiff_t operator () (ptrdiff_t upper) const { return rand() % upper; } +- }; +-} +- + template + struct CollectionFiller + { +@@ -951,11 +944,13 @@ void TestPerformanceRandomIterator(Draw_Interpretor& di) + aTimer.Reset(); + aTimer.Start(); + { +- RandomGenerator aRandomGen; ++ std::random_device ran_dev; ++ std::mt19937 gen(ran_dev()); ++ gen.seed(0x03ac38f2); + for (Standard_Integer anIdx = 0; anIdx < 10; ++anIdx) + { +- std::sort (aVector->begin(), aVector->end()); +- std::random_shuffle (aVector->begin(), aVector->end(), aRandomGen); ++ std::sort (aVector->begin(), aVector->end()); ++ std::shuffle (aVector->begin(), aVector->end(), gen); + } + } + aTimer.Stop(); +@@ -965,11 +960,13 @@ void TestPerformanceRandomIterator(Draw_Interpretor& di) + aTimer.Reset(); + aTimer.Start(); + { +- RandomGenerator aRandomGen; ++ std::random_device ran_dev; ++ std::mt19937 gen(ran_dev()); ++ gen.seed(0x03ac38f2); + for (Standard_Integer anIdx = 0; anIdx < 10; ++anIdx) + { +- std::sort (aCollec->begin(), aCollec->end()); +- std::random_shuffle (aCollec->begin(), aCollec->end(), aRandomGen); ++ std::sort (aCollec->begin(), aCollec->end()); ++ std::shuffle (aCollec->begin(), aCollec->end(), gen); + } + } + aTimer.Stop(); +@@ -981,7 +978,7 @@ void TestPerformanceRandomIterator(Draw_Interpretor& di) + + // check that result is the same + if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) ) +- di << "Error: sequences are not the same at the end!\n"; ++ di << "Error: sequences are not the same at the end (random iterator)!\n"; + + delete aVector; + delete aCollec; +@@ -1033,7 +1030,7 @@ void TestPerformanceForwardIterator(Draw_Interpretor& di) + + // check that result is the same + if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) ) +- di << "Error: sequences are not the same at the end!\n"; ++ di << "Error: sequences are not the same at the end (forward iterator)!\n"; + + delete aVector; + delete aCollec; +@@ -1085,7 +1082,7 @@ void TestPerformanceBidirIterator(Draw_Interpretor& di) + + // check that result is the same + if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) ) +- di << "Error: sequences are not the same at the end!\n"; ++ di << "Error: sequences are not the same at the end (bidir iterator)!\n"; + + delete aVector; + delete aCollec; diff --git a/recipes/opencascade/all/patches/7.5.0-0002-fix-compile-error-cxx20.patch b/recipes/opencascade/all/patches/7.5.0-0002-fix-compile-error-cxx20.patch new file mode 100644 index 00000000000000..ebda62599bb8f4 --- /dev/null +++ b/recipes/opencascade/all/patches/7.5.0-0002-fix-compile-error-cxx20.patch @@ -0,0 +1,45 @@ +--- a/src/XSDRAW/XSDRAW.cxx ++++ b/src/XSDRAW/XSDRAW.cxx +@@ -40,7 +40,8 @@ + #include + #include + +-#include ++#include ++#include + //#include + static int deja = 0, dejald = 0; + //unused variable +@@ -245,16 +246,23 @@ void XSDRAW::LoadDraw (Draw_Interpretor& theCommands) + Handle(TColStd_HSequenceOfTransient) XSDRAW::GetList + (const Standard_CString first, const Standard_CString second) + { +- Handle(TColStd_HSequenceOfTransient) list; +- if (!first || first[0] == '\0') { +- char ligne[80]; ligne[0] = '\0'; char truc; +-// std::cin.clear(); std::cin.get (ligne,79,'\n'); +- std::cin >> ligne; Standard_Size ln = strlen(ligne); +- char *ff = &ligne[0], *ss = NULL; +- std::cin.get(truc); if (truc != '\n') { std::cin>>&ligne[ln+1]; ss = &ligne[ln+1]; } +- return XSDRAW::GetList (ff,ss); ++ if ( !first || first[0] == '\0' ) ++ { ++ std::string aLineFirst; ++ std::cin >> aLineFirst; ++ ++ char terminateSymbol = '\0'; ++ std::cin.get(terminateSymbol); ++ ++ if ( terminateSymbol == '\n' ) ++ return XSDRAW::GetList (aLineFirst.c_str(), nullptr); ++ else ++ { ++ std::string aLineSecond; ++ std::cin >> aLineSecond; ++ return XSDRAW::GetList (aLineFirst.c_str(), aLineSecond.c_str()); ++ } + } +-// return IFSelect_Functions::GiveList (Session(),first,second); + return IFSelect_Functions::GiveList (Session(),first,second); + } + diff --git a/recipes/opencascade/all/patches/7.5.0-0003-undefined-ref-ncollection-lerp.patch b/recipes/opencascade/all/patches/7.5.0-0003-undefined-ref-ncollection-lerp.patch new file mode 100644 index 00000000000000..8c42c0b9ae17f3 --- /dev/null +++ b/recipes/opencascade/all/patches/7.5.0-0003-undefined-ref-ncollection-lerp.patch @@ -0,0 +1,116 @@ +--- a/src/Graphic3d/Graphic3d_Camera.cxx ++++ b/src/Graphic3d/Graphic3d_Camera.cxx +@@ -1576,18 +1576,19 @@ bool Graphic3d_Camera::ZFitAll (const Standard_Real theScaleFactor, + //function : Interpolate + //purpose : + //============================================================================= +-template<> +-Standard_EXPORT void NCollection_Lerp::Interpolate (const double theT, +- Handle(Graphic3d_Camera)& theCamera) const ++void Graphic3d_Camera::Interpolate (const Handle(Graphic3d_Camera)& theStart, ++ const Handle(Graphic3d_Camera)& theEnd, ++ const double theT, ++ Handle(Graphic3d_Camera)& theCamera) + { + if (Abs (theT - 1.0) < Precision::Confusion()) + { + // just copy end-point transformation +- theCamera->Copy (myEnd); ++ theCamera->Copy (theEnd); + return; + } + +- theCamera->Copy (myStart); ++ theCamera->Copy (theStart); + if (Abs (theT - 0.0) < Precision::Confusion()) + { + return; +@@ -1595,8 +1596,8 @@ Standard_EXPORT void NCollection_Lerp::Interpolate (co + + // apply rotation + { +- gp_Ax3 aCamStart = cameraToAx3 (*myStart); +- gp_Ax3 aCamEnd = cameraToAx3 (*myEnd); ++ gp_Ax3 aCamStart = cameraToAx3 (*theStart); ++ gp_Ax3 aCamEnd = cameraToAx3 (*theEnd); + gp_Trsf aTrsfStart, aTrsfEnd; + aTrsfStart.SetTransformation (aCamStart, gp::XOY()); + aTrsfEnd .SetTransformation (aCamEnd, gp::XOY()); +@@ -1612,13 +1613,13 @@ Standard_EXPORT void NCollection_Lerp::Interpolate (co + + // apply translation + { +- gp_XYZ aCenter = NCollection_Lerp::Interpolate (myStart->Center().XYZ(), myEnd->Center().XYZ(), theT); +- gp_XYZ anEye = NCollection_Lerp::Interpolate (myStart->Eye().XYZ(), myEnd->Eye().XYZ(), theT); ++ gp_XYZ aCenter = NCollection_Lerp::Interpolate (theStart->Center().XYZ(), theEnd->Center().XYZ(), theT); ++ gp_XYZ anEye = NCollection_Lerp::Interpolate (theStart->Eye().XYZ(), theEnd->Eye().XYZ(), theT); + gp_XYZ anAnchor = aCenter; + Standard_Real aKc = 0.0; + +- const Standard_Real aDeltaCenter = myStart->Center().Distance (myEnd->Center()); +- const Standard_Real aDeltaEye = myStart->Eye() .Distance (myEnd->Eye()); ++ const Standard_Real aDeltaCenter = theStart->Center().Distance (theEnd->Center()); ++ const Standard_Real aDeltaEye = theStart->Eye() .Distance (theEnd->Eye()); + if (aDeltaEye <= gp::Resolution()) + { + anAnchor = anEye; +@@ -1628,14 +1629,14 @@ Standard_EXPORT void NCollection_Lerp::Interpolate (co + { + aKc = aDeltaCenter / (aDeltaCenter + aDeltaEye); + +- const gp_XYZ anAnchorStart = NCollection_Lerp::Interpolate (myStart->Center().XYZ(), myStart->Eye().XYZ(), aKc); +- const gp_XYZ anAnchorEnd = NCollection_Lerp::Interpolate (myEnd ->Center().XYZ(), myEnd ->Eye().XYZ(), aKc); ++ const gp_XYZ anAnchorStart = NCollection_Lerp::Interpolate (theStart->Center().XYZ(), theStart->Eye().XYZ(), aKc); ++ const gp_XYZ anAnchorEnd = NCollection_Lerp::Interpolate (theEnd ->Center().XYZ(), theEnd ->Eye().XYZ(), aKc); + anAnchor = NCollection_Lerp::Interpolate (anAnchorStart, anAnchorEnd, theT); + } + + const gp_Vec aDirEyeToCenter = theCamera->Direction(); +- const Standard_Real aDistEyeCenterStart = myStart->Eye().Distance (myStart->Center()); +- const Standard_Real aDistEyeCenterEnd = myEnd ->Eye().Distance (myEnd ->Center()); ++ const Standard_Real aDistEyeCenterStart = theStart->Eye().Distance (theStart->Center()); ++ const Standard_Real aDistEyeCenterEnd = theEnd ->Eye().Distance (theEnd ->Center()); + const Standard_Real aDistEyeCenter = NCollection_Lerp::Interpolate (aDistEyeCenterStart, aDistEyeCenterEnd, theT); + aCenter = anAnchor + aDirEyeToCenter.XYZ() * aDistEyeCenter * aKc; + anEye = anAnchor - aDirEyeToCenter.XYZ() * aDistEyeCenter * (1.0 - aKc); +@@ -1644,10 +1645,10 @@ Standard_EXPORT void NCollection_Lerp::Interpolate (co + } + + // apply scaling +- if (Abs(myStart->Scale() - myEnd->Scale()) > Precision::Confusion() +- && myStart->IsOrthographic()) ++ if (Abs(theStart->Scale() - theEnd->Scale()) > Precision::Confusion() ++ && theStart->IsOrthographic()) + { +- const Standard_Real aScale = NCollection_Lerp::Interpolate (myStart->Scale(), myEnd->Scale(), theT); ++ const Standard_Real aScale = NCollection_Lerp::Interpolate (theStart->Scale(), theEnd->Scale(), theT); + theCamera->SetScale (aScale); + } + } +--- a/src/Graphic3d/Graphic3d_Camera.hxx ++++ b/src/Graphic3d/Graphic3d_Camera.hxx +@@ -148,6 +148,10 @@ public: + }; + + public: ++ Standard_EXPORT static void Interpolate (const Handle(Graphic3d_Camera)& theStart, ++ const Handle(Graphic3d_Camera)& theEnd, ++ const double theT, ++ Handle(Graphic3d_Camera)& theCamera); + + //! Default constructor. + //! Initializes camera with the following properties: +@@ -852,8 +856,11 @@ DEFINE_STANDARD_HANDLE (Graphic3d_Camera, Standard_Transient) + //! In this case, application might define intermediate camera positions for interpolation + //! or implement own interpolation logic. + template<> +-Standard_EXPORT void NCollection_Lerp::Interpolate (const double theT, +- Handle(Graphic3d_Camera)& theResult) const; ++inline void NCollection_Lerp::Interpolate (const double theT, ++ Handle(Graphic3d_Camera)& theResult) const ++{ ++ Graphic3d_Camera::Interpolate (myStart, myEnd, theT, theResult); ++} + typedef NCollection_Lerp Graphic3d_CameraLerp; + + #endif diff --git a/recipes/opencascade/all/test_package/CMakeLists.txt b/recipes/opencascade/all/test_package/CMakeLists.txt index 21320b4482f5bb..3f52809e46906d 100644 --- a/recipes/opencascade/all/test_package/CMakeLists.txt +++ b/recipes/opencascade/all/test_package/CMakeLists.txt @@ -1,17 +1,14 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) # Test components -find_package(OpenCASCADE COMPONENTS FoundationClasses ModelingData ModelingAlgorithms CONFIG) +find_package(OpenCASCADE REQUIRED FoundationClasses ModelingData ModelingAlgorithms CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} TKMath TKGeomBase TKTopAlgo TKBRep) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE TKMath TKGeomBase TKTopAlgo TKBRep) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) # Test global conan target add_executable(${PROJECT_NAME}_global test_package.cpp) -target_link_libraries(${PROJECT_NAME}_global CONAN_PKG::opencascade) -set_property(TARGET ${PROJECT_NAME}_global PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME}_global PRIVATE opencascade::opencascade) +target_compile_features(${PROJECT_NAME}_global PRIVATE cxx_std_11) diff --git a/recipes/opencascade/all/test_package/conanfile.py b/recipes/opencascade/all/test_package/conanfile.py index 13290d598bb5ff..9283a22ebe1e08 100644 --- a/recipes/opencascade/all/test_package/conanfile.py +++ b/recipes/opencascade/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "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) @@ -12,8 +21,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) - bin_path_global = os.path.join("bin", "test_package_global") - self.run(bin_path_global, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + bin_path_global = os.path.join(self.cpp.build.bindirs[0], "test_package_global") + self.run(bin_path_global, env="conanrun") diff --git a/recipes/opencascade/all/test_v1_package/CMakeLists.txt b/recipes/opencascade/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..0d20897301b68b --- /dev/null +++ b/recipes/opencascade/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +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/opencascade/all/test_v1_package/conanfile.py b/recipes/opencascade/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..13290d598bb5ff --- /dev/null +++ b/recipes/opencascade/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) + bin_path_global = os.path.join("bin", "test_package_global") + self.run(bin_path_global, run_environment=True) diff --git a/recipes/opencl-clhpp-headers/all/conandata.yml b/recipes/opencl-clhpp-headers/all/conandata.yml index e4e17b97c1724a..8181b741f827c5 100644 --- a/recipes/opencl-clhpp-headers/all/conandata.yml +++ b/recipes/opencl-clhpp-headers/all/conandata.yml @@ -11,3 +11,21 @@ sources: "2022.05.18": url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2022.05.18.tar.gz" sha256: "d29affd740c5037b4499790613f5af0718ffc88c325e793b73cb35b7592fc0f7" + "2022.01.04": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2.0.16.tar.gz" + sha256: "869456032e60787eed9fceaeaf6c6cb4452bc0ff97e0f5a271510145a1c8f4d4" + "2021.06.30": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2.0.15.tar.gz" + sha256: "0175806508abc699586fc9a9387e01eb37bf812ca534e3b493ff3091ec2a9246" + "2021.04.29": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2.0.14.tar.gz" + sha256: "c8821a7638e57a2c4052631c941af720b581edda634db6ab0b59924c958d69b6" + "2020.12.18": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2.0.13.tar.gz" + sha256: "8ff0d0cd94d728edd30c876db546bf13e370ee7863629b4b9b5e2ef8e130d23c" + "2020.06.16": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2.0.12.tar.gz" + sha256: "20b28709ce74d3602f1a946d78a2024c1f6b0ef51358b9686612669897a58719" + "2020.03.13": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2.0.11.tar.gz" + sha256: "ffc2ca08cf4ae90ee55f14ea3735ccc388f454f4422b69498b2e9b93a1d45181" diff --git a/recipes/opencl-clhpp-headers/all/test_package/CMakeLists.txt b/recipes/opencl-clhpp-headers/all/test_package/CMakeLists.txt index 3a0c8417853f50..733d421e88716e 100644 --- a/recipes/opencl-clhpp-headers/all/test_package/CMakeLists.txt +++ b/recipes/opencl-clhpp-headers/all/test_package/CMakeLists.txt @@ -8,3 +8,7 @@ find_package(OpenCLHeadersCpp REQUIRED CONFIG) add_library(${PROJECT_NAME} OBJECT test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE OpenCL::HeadersCpp) + +if(OpenCLHeadersCpp_VERSION VERSION_GREATER 2020.06.16) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_OPENCL_HPP) +endif() diff --git a/recipes/opencl-clhpp-headers/all/test_package/test_package.cpp b/recipes/opencl-clhpp-headers/all/test_package/test_package.cpp index 24cf50fffbbe2a..a1e2c103aae1ac 100644 --- a/recipes/opencl-clhpp-headers/all/test_package/test_package.cpp +++ b/recipes/opencl-clhpp-headers/all/test_package/test_package.cpp @@ -1,7 +1,11 @@ #define CL_HPP_MINIMUM_OPENCL_VERSION 120 #define CL_HPP_TARGET_OPENCL_VERSION 120 +#ifdef USE_OPENCL_HPP #include +#else +#include +#endif #include #include diff --git a/recipes/opencl-clhpp-headers/config.yml b/recipes/opencl-clhpp-headers/config.yml index 691c70a050912e..2bf575fcc94516 100644 --- a/recipes/opencl-clhpp-headers/config.yml +++ b/recipes/opencl-clhpp-headers/config.yml @@ -7,3 +7,15 @@ versions: folder: all "2022.05.18": folder: all + "2022.01.04": + folder: all + "2021.06.30": + folder: all + "2021.04.29": + folder: all + "2020.12.18": + folder: all + "2020.06.16": + folder: all + "2020.03.13": + folder: all diff --git a/recipes/opencl-icd-loader/all/conanfile.py b/recipes/opencl-icd-loader/all/conanfile.py index b7187e1a134cc0..ae7aae3d17794f 100644 --- a/recipes/opencl-icd-loader/all/conanfile.py +++ b/recipes/opencl-icd-loader/all/conanfile.py @@ -48,6 +48,7 @@ def layout(self): def requirements(self): self.requires(f"opencl-headers/{self.version}", transitive_headers=True) + self.requires(f"opencl-clhpp-headers/{self.version}", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/opencl-icd-loader/all/test_package/test_package.c b/recipes/opencl-icd-loader/all/test_package/test_package.c index 4c923ce5886584..42b334ba331d45 100644 --- a/recipes/opencl-icd-loader/all/test_package/test_package.c +++ b/recipes/opencl-icd-loader/all/test_package/test_package.c @@ -1,3 +1,4 @@ +#define CL_TARGET_OPENCL_VERSION 120 #include int main() { 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..13719aad33361f 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.2.1") + 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.3") + 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/2.x/conanfile.py b/recipes/opencv/2.x/conanfile.py index 2dc9254ee3172c..a256803f127176 100644 --- a/recipes/opencv/2.x/conanfile.py +++ b/recipes/opencv/2.x/conanfile.py @@ -1,10 +1,12 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.build import valid_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, rm, rmdir, save from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import sys import os import textwrap @@ -44,7 +46,7 @@ class OpenCVConan(ConanFile): description = "OpenCV (Open Source Computer Vision Library)" url = "https://github.com/conan-io/conan-center-index" topics = ("computer-vision", "deep-learning", "image-processing") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -352,19 +354,19 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_eigen: self.requires("eigen/3.4.0") if self.options.with_tbb: # opencv 2.x doesn't support onetbb >= 2021 - self.requires("onetbb/2020.3") + self.requires("onetbb/2020.3.3") # highgui module options if self.options.get_safe("with_jpeg") == "libjpeg": self.requires("libjpeg/9e") elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.0") elif self.options.get_safe("with_jpeg") == "mozjpeg": - self.requires("mozjpeg/4.1.1") + self.requires("mozjpeg/4.1.3") if self.options.get_safe("with_png"): self.requires("libpng/1.6.40") if self.options.get_safe("with_jasper"): @@ -373,7 +375,7 @@ def requirements(self): # opencv 2.x doesn't support openexr >= 3 self.requires("openexr/2.5.7") if self.options.get_safe("with_tiff"): - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") if self.options.get_safe("with_gtk"): self.requires("gtk/system") @@ -409,6 +411,13 @@ def validate(self): raise ConanInvalidConfiguration( "viz module can't be enabled yet. It requires VTK which is not available in conan-center." ) + # FIXME: check_max_cppstd is only available for Conan 2.x. Remove it after dropping support for Conan 1.x + if conan_version.major == 2: + # FIXME: linter complains, but function is there + # https://docs.conan.io/2.0/reference/tools/build.html?highlight=check_min_cppstd#conan-tools-build-check-max-cppstd + check_max_cppstd = getattr(sys.modules['conan.tools.build'], 'check_max_cppstd') + # INFO: OpenCV 2.x uses std::random_shuffle and mem_fun_ref. Both removed in C++17. + check_max_cppstd(self, 14) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -525,15 +534,39 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "staticlib")) rm(self, "*.cmake", self.package_folder, recursive=True) + self._create_cmake_module_variables(os.path.join(self.package_folder, self._module_vars_rel_path)) + # TODO: to remove in conan v2 once cmake_find_package* generators removed targets_mapping = {self._cmake_target(k): f"opencv::{self._cmake_target(k)}" for k in self._opencv_modules.keys()} if self.options.world: targets_mapping.update({"opencv_world": "opencv::opencv_world"}) self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), + os.path.join(self.package_folder, self._module_target_rel_path), targets_mapping, ) + def _create_cmake_module_variables(self, module_file): + """ + Define several CMake variables from upstream CMake config file not defined by default by CMakeDeps. + See https://github.com/opencv/opencv/blob/2.4.13.7/cmake/templates/OpenCVConfig.cmake.in + """ + v = Version(self.version) + content = textwrap.dedent(f"""\ + if(NOT DEFINED OpenCV_LIBS) + set(OpenCV_LIBS opencv::opencv) + endif() + if(NOT DEFINED OpenCV_VERSION_MAJOR) + set(OpenCV_VERSION_MAJOR {v.major}) + endif() + if(NOT DEFINED OpenCV_VERSION_MINOR) + set(OpenCV_VERSION_MINOR {v.minor}) + endif() + if(NOT DEFINED OpenCV_VERSION_PATCH) + set(OpenCV_VERSION_PATCH {v.patch}) + endif() + """) + save(self, module_file, content) + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): @@ -546,7 +579,11 @@ def _create_cmake_module_alias_targets(self, module_file, targets): save(self, module_file, content) @property - def _module_file_rel_path(self): + def _module_vars_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + @property + def _module_target_rel_path(self): return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @staticmethod @@ -604,8 +641,8 @@ def add_components(components): # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.components[conan_component].names["cmake_find_package"] = cmake_target self.cpp_info.components[conan_component].names["cmake_find_package_multi"] = cmake_target - self.cpp_info.components[conan_component].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components[conan_component].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components[conan_component].build_modules["cmake_find_package"] = [self._module_vars_rel_path, self._module_target_rel_path] + self.cpp_info.components[conan_component].build_modules["cmake_find_package_multi"] = [self._module_vars_rel_path, self._module_target_rel_path] if module != cmake_target: conan_component_alias = conan_component + "_alias" self.cpp_info.components[conan_component_alias].names["cmake_find_package"] = module @@ -621,10 +658,11 @@ def add_components(components): self.cpp_info.components["opencv_world"].frameworks = list(world_frameworks) # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["opencv_world"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["opencv_world"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components["opencv_world"].build_modules["cmake_find_package"] = [self._module_vars_rel_path, self._module_target_rel_path] + self.cpp_info.components["opencv_world"].build_modules["cmake_find_package_multi"] = [self._module_vars_rel_path, self._module_target_rel_path] self.cpp_info.set_property("cmake_file_name", "OpenCV") + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path]) add_components(self._opencv_modules) diff --git a/recipes/opencv/3.x/conandata.yml b/recipes/opencv/3.x/conandata.yml index e0e79edab327a9..fb7fa44fa31ae1 100644 --- a/recipes/opencv/3.x/conandata.yml +++ b/recipes/opencv/3.x/conandata.yml @@ -4,17 +4,8 @@ sources: sha256: "1353eec67849aadb20df71d8bae18b83708e18fc5da080fe5efeabb1e99b2ee8" - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/3.4.17.tar.gz" sha256: "2b4d3e91a5767a1ae4f4e2a71b0a93c9ec744755763653a650e40ace8f7b9a1b" - "3.4.12": - - url: "https://github.com/opencv/opencv/archive/3.4.12.tar.gz" - sha256: "c8919dfb5ead6be67534bf794cb0925534311f1cd5c6680f8164ad1813c88d13" - - url: "https://github.com/opencv/opencv_contrib/archive/3.4.12.tar.gz" - sha256: "b207024589674dd2efc7c25740ef192ee4f3e0783e773e2d49a198c37e3e7570" patches: "3.4.17": - patch_file: "patches/3.4.17-0001-find-openexr.patch" patch_description: "Robust discovery & injection of OpenEXR" patch_type: "conan" - "3.4.12": - - patch_file: "patches/3.4.12-0001-find-openexr.patch" - patch_description: "Robust discovery & injection of OpenEXR" - patch_type: "conan" diff --git a/recipes/opencv/3.x/conanfile.py b/recipes/opencv/3.x/conanfile.py index 40d745d3074f7d..94f59dc50fb8e1 100644 --- a/recipes/opencv/3.x/conanfile.py +++ b/recipes/opencv/3.x/conanfile.py @@ -17,7 +17,7 @@ class OpenCVConan(ConanFile): description = "OpenCV (Open Source Computer Vision Library)" url = "https://github.com/conan-io/conan-center-index" topics = ("computer-vision", "deep-learning", "image-processing") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -76,13 +76,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") 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.1") + self.requires("mozjpeg/4.1.3") if self.options.with_png: self.requires("libpng/1.6.40") if self.options.with_jasper: @@ -91,17 +91,17 @@ def requirements(self): # opencv 3.x doesn't support openexr >= 3 self.requires("openexr/2.5.7") if self.options.with_tiff: - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") if self.options.with_eigen: self.requires("eigen/3.4.0") if self.options.parallel == "tbb": # opencv 3.x doesn't support onetbb >= 2021 - self.requires("onetbb/2020.3") + self.requires("onetbb/2020.3.3") if self.options.with_webp: - self.requires("libwebp/1.3.1") + self.requires("libwebp/1.3.2") if self.options.contrib: self.requires("freetype/2.13.0") - self.requires("harfbuzz/6.0.0") + self.requires("harfbuzz/8.2.2") self.requires("gflags/2.2.2") self.requires("glog/0.6.0") if self.options.get_safe("with_gtk"): @@ -134,26 +134,12 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "modules", "imgcodecs", "CMakeLists.txt"), "JASPER_", "Jasper_") # Cleanup RPATH - if Version(self.version) < "3.4.8": - install_layout_file = os.path.join(self.source_folder, "CMakeLists.txt") - else: - install_layout_file = os.path.join(self.source_folder, "cmake", "OpenCVInstallLayout.cmake") + install_layout_file = os.path.join(self.source_folder, "cmake", "OpenCVInstallLayout.cmake") replace_in_file(self, install_layout_file, "ocv_update(CMAKE_INSTALL_RPATH \"${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}\")", "") replace_in_file(self, install_layout_file, "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", "") - if self.options.contrib and Version(self.version) <= "3.4.12": - sfm_cmake = os.path.join(self._contrib_folder, "modules", "sfm", "CMakeLists.txt") - search = " find_package(Glog QUIET)\nendif()" - replace_in_file(self, sfm_cmake, search, f"""{search} - if(NOT GFLAGS_LIBRARIES AND TARGET gflags::gflags) - set(GFLAGS_LIBRARIES gflags::gflags) - endif() - if(NOT GLOG_LIBRARIES AND TARGET glog::glog) - set(GLOG_LIBRARIES glog::glog) - endif()""") - def generate(self): tc = CMakeToolchain(self) tc.variables["OPENCV_CONFIG_INSTALL_PATH"] = "cmake" @@ -287,12 +273,36 @@ def package(self): rename(self, os.path.join(self.package_folder, "setup_vars_opencv3.cmd"), os.path.join(self.package_folder, "res", "setup_vars_opencv3.cmd")) + self._create_cmake_module_variables(os.path.join(self.package_folder, self._module_vars_rel_path)) + # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), + os.path.join(self.package_folder, self._module_target_rel_path), {component["target"]:"opencv::{}".format(component["target"]) for component in self._opencv_components} ) + def _create_cmake_module_variables(self, module_file): + """ + Define several CMake variables from upstream CMake config file not defined by default by CMakeDeps. + See https://github.com/opencv/opencv/blob/3.4.20/cmake/templates/OpenCVConfig.cmake.in + """ + v = Version(self.version) + content = textwrap.dedent(f"""\ + if(NOT DEFINED OpenCV_LIBS) + set(OpenCV_LIBS opencv::opencv) + endif() + if(NOT DEFINED OpenCV_VERSION_MAJOR) + set(OpenCV_VERSION_MAJOR {v.major}) + endif() + if(NOT DEFINED OpenCV_VERSION_MINOR) + set(OpenCV_VERSION_MINOR {v.minor}) + endif() + if(NOT DEFINED OpenCV_VERSION_PATCH) + set(OpenCV_VERSION_PATCH {v.patch}) + endif() + """) + save(self, module_file, content) + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): @@ -305,7 +315,11 @@ def _create_cmake_module_alias_targets(self, module_file, targets): save(self, module_file, content) @property - def _module_file_rel_path(self): + def _module_vars_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + @property + def _module_target_rel_path(self): return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @property @@ -431,8 +445,8 @@ def add_components(components): # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.components[conan_component].names["cmake_find_package"] = cmake_target self.cpp_info.components[conan_component].names["cmake_find_package_multi"] = cmake_target - self.cpp_info.components[conan_component].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components[conan_component].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.components[conan_component].build_modules["cmake_find_package"] = [self._module_vars_rel_path, self._module_target_rel_path] + self.cpp_info.components[conan_component].build_modules["cmake_find_package_multi"] = [self._module_vars_rel_path, self._module_target_rel_path] if cmake_component != cmake_target: conan_component_alias = conan_component + "_alias" self.cpp_info.components[conan_component_alias].names["cmake_find_package"] = cmake_component @@ -443,6 +457,7 @@ def add_components(components): self.cpp_info.components[conan_component_alias].libdirs = [] self.cpp_info.set_property("cmake_file_name", "OpenCV") + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path]) add_components(self._opencv_components) diff --git a/recipes/opencv/3.x/patches/3.4.12-0001-find-openexr.patch b/recipes/opencv/3.x/patches/3.4.12-0001-find-openexr.patch deleted file mode 100644 index 757789eca25bb7..00000000000000 --- a/recipes/opencv/3.x/patches/3.4.12-0001-find-openexr.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/cmake/OpenCVFindOpenEXR.cmake -+++ b/cmake/OpenCVFindOpenEXR.cmake -@@ -8,6 +8,15 @@ - # OPENEXR_INCLUDE_PATHS = OpenEXR include directories. - # OPENEXR_LIBRARIES = libraries that are needed to use OpenEXR. - # -+find_package(OpenEXR REQUIRED) -+if(TARGET OpenEXR::OpenEXR) -+ set(OPENEXR_LIBRARIES OpenEXR::OpenEXR) -+else() -+ set(OPENEXR_LIBRARIES openexr::openexr) -+endif() -+set(OPENEXR_FOUND TRUE) -+set(OPENEXR_VERSION ${OpenEXR_VERSION}) -+return() - - SET(OPENEXR_LIBRARIES "") - SET(OPENEXR_LIBSEARCH_SUFFIXES "") diff --git a/recipes/opencv/4.x/conandata.yml b/recipes/opencv/4.x/conandata.yml index 3da12bba6234f6..867bde99de61c5 100644 --- a/recipes/opencv/4.x/conandata.yml +++ b/recipes/opencv/4.x/conandata.yml @@ -1,29 +1,77 @@ 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" - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.5.5.tar.gz" sha256: "a97c2eaecf7a23c6dbd119a609c6d7fae903e5f9ff5f1fe678933e01c67a6c11" "4.5.3": - - url: "https://github.com/opencv/opencv/archive/4.5.3.tar.gz" + - url: "https://github.com/opencv/opencv/archive/refs/tags/4.5.3.tar.gz" sha256: "77f616ae4bea416674d8c373984b20c8bd55e7db887fd38c6df73463a0647bab" - - url: "https://github.com/opencv/opencv_contrib/archive/4.5.3.tar.gz" + - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.5.3.tar.gz" sha256: "73da052fd10e73aaba2560eaff10cc5177e2dcc58b27f8aedf7c649e24c233bc" "4.1.2": - - url: "https://github.com/opencv/opencv/archive/4.1.2.tar.gz" + - url: "https://github.com/opencv/opencv/archive/refs/tags/4.1.2.tar.gz" sha256: "385dd0a9c25e67ef0dd60e022d2a2d7b17e2f36819cf3cb46aa8cdff5c5282c9" - - url: "https://github.com/opencv/opencv_contrib/archive/4.1.2.tar.gz" + - 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" patch_type: "conan" + - patch_file: "patches/4.5.5-0002-objdetect-without-dnn.patch" + patch_description: "Allow to build objdetect module without dnn" + patch_type: "portability" + patch_source: "https://github.com/opencv/opencv/pull/21369" + - patch_file: "patches/4.5.5-0003-find-quirc.patch" + patch_description: "Robust discovery & injection of quirc" + patch_type: "conan" + - patch_file: "patches/4.5.5-0004-link-qt-targets.patch" + patch_description: "Link to Qt through CMake targets" + patch_type: "conan" - patch_file: "patches/4.5.0-0002-find-ade.patch" patch_description: "Robust discovery & injection of ade" patch_type: "conan" - - patch_file: "patches/4.1.2-0003-find-quirc.patch" - patch_description: "Robust discovery & injection of quirc" + - 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.5.1-0002-alphamat-header.patch" + patch_description: "Add missing header in alphamat.hpp" + patch_type: "portability" + patch_source: "https://github.com/opencv/opencv_contrib/pull/3422" + - 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" @@ -35,18 +83,35 @@ patches: - patch_file: "patches/4.5.3-0001-find-openexr.patch" patch_description: "Robust discovery & injection of OpenEXR" patch_type: "conan" + - patch_file: "patches/4.5.3-0002-link-qt-targets.patch" + patch_description: "Link to Qt through CMake targets" + patch_type: "conan" - patch_file: "patches/4.5.0-0002-find-ade.patch" patch_description: "Robust discovery & injection of ade" patch_type: "conan" - patch_file: "patches/4.1.2-0003-find-quirc.patch" patch_description: "Robust discovery & injection of quirc" 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.5.1-0002-alphamat-header.patch" + patch_description: "Add missing header in alphamat.hpp" + patch_type: "portability" + patch_source: "https://github.com/opencv/opencv_contrib/pull/3422" + - 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.1.2-0010-compat-protobuf-ge-3.18.patch" + patch_description: "Compatibility with protobuf >= 3.18" + patch_type: "portability" + patch_source: "https://github.com/opencv/opencv/pull/20386" "4.1.2": - patch_file: "patches/4.1.2-0001-find-openexr.patch" patch_description: "Robust discovery & injection of OpenEXR" @@ -60,6 +125,26 @@ patches: - patch_file: "patches/4.1.2-0004-jasper.patch" patch_description: "Compatibility with recent jasper versions" patch_type: "portability" + - patch_file: "patches/4.1.2-0005-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.1.2-0007-android-install-layout.patch" patch_description: "Honor install layout from conan if Android" patch_type: "conan" + - patch_file: "patches/4.1.2-0008-link-qt-targets.patch" + patch_description: "Link to Qt through CMake targets" + patch_type: "conan" + - patch_file: "patches/4.1.2-0009-sfm-deps.patch" + patch_description: "Fix link to dependencies of sfm module" + patch_type: "conan" + - patch_file: "patches/4.1.2-0010-compat-protobuf-ge-3.18.patch" + patch_description: "Compatibility with protobuf >= 3.18" + patch_type: "portability" + patch_source: "https://github.com/opencv/opencv/pull/20386" + - patch_file: "patches/4.1.2-0011-compat-openexr3.patch" + patch_description: "Compatibility with OpenEXR 3.x" + patch_type: "portability" + patch_source: "https://github.com/opencv/opencv/pull/19970" diff --git a/recipes/opencv/4.x/conanfile.py b/recipes/opencv/4.x/conanfile.py index 895fee1eb01868..31a4382eaa7289 100644 --- a/recipes/opencv/4.x/conanfile.py +++ b/recipes/opencv/4.x/conanfile.py @@ -1,17 +1,94 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.build import cross_building +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, valid_min_cppstd 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 import re import textwrap -required_conan_version = ">=1.54.0" - +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" + + +OPENCV_MAIN_MODULES_OPTIONS = ( + "calib3d", + "dnn", + "features2d", + "flann", + "gapi", + "highgui", + "imgcodecs", + "imgproc", + "ml", + "objdetect", + "photo", + "stitching", + "video", + "videoio", +) + +OPENCV_EXTRA_MODULES_OPTIONS = ( + "alphamat", + "aruco", + "barcode", + "bgsegm", + "bioinspired", + "ccalib", + "cudaarithm", + "cudabgsegm", + "cudacodec", + "cudafeatures2d", + "cudafilters", + "cudaimgproc", + "cudalegacy", + "cudaobjdetect", + "cudaoptflow", + "cudastereo", + "cudawarping", + "cvv", + "datasets", + "dnn_objdetect", + "dnn_superres", + "dpm", + "face", + "freetype", + "fuzzy", + "hdf", + "hfs", + "img_hash", + "intensity_transform", + "line_descriptor", + "mcc", + "optflow", + "ovis", + "phase_unwrapping", + "plot", + "quality", + "rapid", + "reg", + "rgbd", + "saliency", + "sfm", + "shape", + "stereo", + "structured_light", + "superres", + "surface_matching", + "text", + "tracking", + "videostab", + "viz", + "wechat_qrcode", + "xfeatures2d", + "ximgproc", + "xobjdetect", + "xphoto", +) class OpenCVConan(ConanFile): name = "opencv" @@ -21,90 +98,144 @@ class OpenCVConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" topics = ("computer-vision", "deep-learning", "image-processing") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "contrib": [True, False], - "contrib_freetype": [True, False], - "contrib_sfm": [True, False], + # global options "parallel": [False, "tbb", "openmp"], "with_ipp": [False, "intel-ipp", "opencv-icv"], - "with_ade": [True, False], + "with_eigen": [True, False], + "neon": [True, False], + "with_opencl": [True, False], + "with_cuda": [True, False], + "with_cublas": [True, False], + "with_cufft": [True, False], + "with_cudnn": [True, False], + "cuda_arch_bin": [None, "ANY"], + "cpu_baseline": [None, "ANY"], + "cpu_dispatch": [None, "ANY"], + "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], "with_jpeg2000": [False, "jasper", "openjpeg"], "with_openexr": [True, False], - "with_eigen": [True, False], "with_webp": [True, False], - "with_gtk": [True, False], - "with_quirc": [True, False], - "with_cuda": [True, False], - "with_cublas": [True, False], - "with_cufft": [True, False], - "with_cudnn": [True, False], - "with_v4l": [True, False], - "with_ffmpeg": [True, False], + "with_gdal": [True, False], + "with_gdcm": [True, False], "with_imgcodec_hdr": [True, False], "with_imgcodec_pfm": [True, False], "with_imgcodec_pxm": [True, False], "with_imgcodec_sunraster": [True, False], "with_msmf": [True, False], "with_msmf_dxva": [True, False], - "neon": [True, False], - "dnn": [True, False], - "dnn_cuda": [True, False], - "cuda_arch_bin": [None, "ANY"], - "cpu_baseline": [None, "ANY"], - "cpu_dispatch": [None, "ANY"], - "nonfree": [True, False], + # objdetect module options + "with_quirc": [True, False], + # videoio module options + "with_ffmpeg": [True, False], + "with_v4l": [True, False], + # text module options + "with_tesseract": [True, False], + # TODO: deprecated options to remove in few months + "contrib": [True, False, "deprecated"], + "contrib_freetype": [True, False, "deprecated"], + "contrib_sfm": [True, False, "deprecated"], + "with_ade": [True, False, "deprecated"], } + options.update({_name: [True, False] for _name in OPENCV_MAIN_MODULES_OPTIONS}) + options.update({_name: [True, False] for _name in OPENCV_EXTRA_MODULES_OPTIONS}) + default_options = { "shared": False, "fPIC": True, + # global options "parallel": False, - "contrib": False, - "contrib_freetype": False, - "contrib_sfm": False, "with_ipp": False, - "with_ade": True, + "with_eigen": True, + "neon": True, + "with_opencl": False, + "with_cuda": False, + "with_cublas": False, + "with_cufft": False, + "with_cudnn": False, + "cuda_arch_bin": None, + "cpu_baseline": None, + "cpu_dispatch": None, + "world": False, + "nonfree": False, + # dnn module options + "with_flatbuffers": True, + "with_protobuf": True, + "with_vulkan": False, + "dnn_cuda": False, + # highgui module options + "with_gtk": False, + "with_qt": False, + "with_wayland": True, + # imgcodecs module options + "with_avif": False, "with_jpeg": "libjpeg", "with_png": True, "with_tiff": True, "with_jpeg2000": "jasper", "with_openexr": True, - "with_eigen": True, "with_webp": True, - "with_gtk": True, - "with_quirc": True, - "with_cuda": False, - "with_cublas": False, - "with_cufft": False, - "with_cudnn": False, - "with_v4l": False, - "with_ffmpeg": True, + "with_gdal": False, + "with_gdcm": False, "with_imgcodec_hdr": False, "with_imgcodec_pfm": False, "with_imgcodec_pxm": False, "with_imgcodec_sunraster": False, "with_msmf": True, "with_msmf_dxva": True, - "neon": True, - "dnn": True, - "dnn_cuda": False, - "cuda_arch_bin": None, - "cpu_baseline": None, - "cpu_dispatch": None, - "nonfree": False, + # objdetect module options + "with_quirc": True, + # videoio module options + "with_ffmpeg": True, + "with_v4l": False, + # text module options + "with_tesseract": True, + # TODO: deprecated options to remove in few months + "contrib": "deprecated", + "contrib_freetype": "deprecated", + "contrib_sfm": "deprecated", + "with_ade": "deprecated", } + default_options.update({_name: True for _name in OPENCV_MAIN_MODULES_OPTIONS}) + default_options.update({_name: False for _name in OPENCV_EXTRA_MODULES_OPTIONS}) 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") + @property 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" @@ -118,8 +249,44 @@ def _has_with_ffmpeg_option(self): return self.settings.os != "iOS" and self.settings.os != "WindowsStore" @property - def _protobuf_version(self): - return "3.17.1" + def _has_superres_option(self): + return self.settings.os != "iOS" + + @property + def _has_alphamat_option(self): + return Version(self.version) >= "4.3.0" + + @property + def _has_intensity_transform_option(self): + return Version(self.version) >= "4.3.0" + + @property + def _has_rapid_option(self): + return Version(self.version) >= "4.3.0" + + @property + def _has_mcc_option(self): + return Version(self.version) >= "4.5.0" + + @property + def _has_wechat_qrcode_option(self): + return Version(self.version) >= "4.5.2" + + @property + def _has_barcode_option(self): + 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) @@ -130,6 +297,8 @@ def config_options(self): if self.settings.os != "Linux": del self.options.with_gtk del self.options.with_v4l + if self.settings.os in ["iOS", "Android"]: + del self.options.with_opencl if self.settings.os != "Windows": del self.options.with_msmf del self.options.with_msmf_dxva @@ -148,101 +317,904 @@ def config_options(self): del self.options.with_jpeg2000 if not self._has_with_tiff_option: del self.options.with_tiff + if not self._has_superres_option: + del self.options.superres + if not self._has_alphamat_option: + del self.options.alphamat + if not self._has_intensity_transform_option: + del self.options.intensity_transform + if not self._has_rapid_option: + del self.options.rapid + if not self._has_mcc_option: + del self.options.mcc + if not self._has_wechat_qrcode_option: + 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"): + components.append("libpng::libpng") + if self.options.get_safe("with_jpeg") == "libjpeg": + components.append("libjpeg::libjpeg") + elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": + components.append("libjpeg-turbo::jpeg") + elif self.options.get_safe("with_jpeg") == "mozjpeg": + components.append("mozjpeg::libjpeg") + if self.options.get_safe("with_tiff"): + components.append("libtiff::libtiff") + if self.options.get_safe("with_openexr"): + components.append("openexr::openexr") + if self.options.get_safe("with_webp"): + components.append("libwebp::libwebp") + if self.options.get_safe("with_gdal"): + components.append("gdal::gdal") + if self.options.get_safe("with_gdcm"): + components.append("gdcm::gdcm") + return components + + def eigen(): + return ["eigen::eigen"] if self.options.with_eigen else [] + + def ffmpeg(): + components = [] + if self.options.get_safe("with_ffmpeg"): + components = ["ffmpeg::avcodec", "ffmpeg::avformat", "ffmpeg::avutil", "ffmpeg::swscale"] + return components + + def gtk(): + return ["gtk::gtk"] if self.options.get_safe("with_gtk") else [] + + def ipp(): + if self.options.with_ipp == "intel-ipp": + return ["intel-ipp::intel-ipp"] + elif self.options.with_ipp == "opencv-icv" and not self.options.shared: + return ["ippiw"] + return [] + + 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 [] + + def quirc(): + return ["quirc::quirc"] if self.options.get_safe("with_quirc") else [] + + def tesseract(): + return ["tesseract::tesseract"] if self.options.get_safe("with_tesseract") else [] + + 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 [] + + def opencv_cudaarithm(): + return ["opencv_cudaarithm"] if self.options.cudaarithm else [] + + def opencv_cudacodec(): + return ["opencv_cudacodec"] if self.options.cudacodec else [] + + def opencv_cudafeatures2d(): + return ["opencv_cudafeatures2d"] if self.options.cudafeatures2d else [] + + def opencv_cudafilters(): + return ["opencv_cudafilters"] if self.options.cudafilters else [] + + def opencv_cudaimgproc(): + return ["opencv_cudaimgproc"] if self.options.cudaimgproc else [] + + def opencv_cudalegacy(): + return ["opencv_cudalegacy"] if self.options.cudalegacy else [] + + def opencv_cudaoptflow(): + return ["opencv_cudaoptflow"] if self.options.cudaoptflow else [] + + def opencv_cudawarping(): + return ["opencv_cudawarping"] if self.options.cudawarping else [] + + def opencv_dnn(): + return ["opencv_dnn"] if self.options.dnn else [] + + def opencv_flann(): + return ["opencv_flann"] if self.options.flann else [] + + def opencv_imgcodecs(): + return ["opencv_imgcodecs"] if self.options.imgcodecs else [] + + def opencv_imgproc(): + return ["opencv_imgproc"] if self.options.imgproc else [] + + def opencv_objdetect(): + return ["opencv_objdetect"] if self.options.objdetect else [] + + def opencv_video(): + return ["opencv_video"] if self.options.video else [] + + def opencv_videoio(): + return ["opencv_videoio"] if self.options.videoio else [] + + def opencv_xfeatures2d(): + return ["opencv_xfeatures2d"] if self.options.xfeatures2d else [] + + opencv_modules = { + # Main modules + "calib3d": { + "is_built": self.options.calib3d, + "mandatory_options": ["features2d", "flann", "imgproc"], + "requires": ["opencv_core", "opencv_features2d", "opencv_flann", "opencv_imgproc"] + eigen() + ipp(), + }, + "core": { + "is_built": True, + "no_option": True, + "requires": ["zlib::zlib"] + parallel() + eigen() + ipp(), + "system_libs": [ + (self.settings.os == "Android", ["dl", "m", "log"]), + (self.settings.os == "FreeBSD", ["m", "pthread"]), + (self.settings.os == "Linux", ["dl", "m", "pthread", "rt"]), + ], + "frameworks": [ + (self.settings.os == "Macos" and self.options.get_safe("with_opencl"), ["OpenCL"]), + ], + }, + "dnn": { + "is_built": self.options.dnn, + "mandatory_options": ["imgproc"], + "requires": ["opencv_core", "opencv_imgproc"] + protobuf() + vulkan() + ipp(), + }, + "features2d": { + "is_built": self.options.features2d, + "mandatory_options": ["imgproc"], + "requires": ["opencv_imgproc"] + opencv_flann() + eigen() + ipp(), + }, + "flann": { + "is_built": self.options.flann, + "requires": ["opencv_core"] + ipp(), + }, + "gapi": { + "is_built": self.options.gapi, + "mandatory_options": ["imgproc"], + "requires": ["opencv_imgproc", "ade::ade"], + "system_libs": [ + (self.settings.os == "Windows", ["ws2_32", "wsock32"]), + ], + }, + "highgui": { + "is_built": self.options.highgui, + "mandatory_options": ["imgproc"], + "requires": ["opencv_core", "opencv_imgproc"] + opencv_imgcodecs() + + opencv_videoio() + gtk() + qt() + xkbcommon() + wayland() + ipp(), + "system_libs": [ + (self.settings.os == "Windows", ["comctl32", "gdi32", "ole32", "setupapi", "ws2_32", "vfw32"]), + ], + "frameworks": [ + (self.settings.os == "Macos", ["Cocoa"]), + ], + }, + "imgcodecs": { + "is_built": self.options.imgcodecs, + "mandatory_options": ["imgproc"], + "requires": ["opencv_imgproc", "zlib::zlib"] + imageformats_deps() + ipp(), + "frameworks": [ + (is_apple_os(self), ["CoreFoundation", "CoreGraphics"]), + (self.settings.os == "iOS", ["UIKit"]), + (self.settings.os == "Macos", ["AppKit"]), + ], + }, + "imgproc": { + "is_built": self.options.imgproc, + "requires": ["opencv_core"] + ipp(), + }, + "ml": { + "is_built": self.options.ml, + "requires": ["opencv_core"] + ipp(), + }, + "objdetect": { + "is_built": self.options.objdetect, + "mandatory_options": ["calib3d", "imgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgproc"] + quirc() + ipp(), + }, + "photo": { + "is_built": self.options.photo, + "mandatory_options": ["imgproc"], + "requires": ["opencv_imgproc"] + opencv_cudaarithm() + opencv_cudaimgproc() + ipp(), + }, + "stitching": { + "is_built": self.options.stitching, + "mandatory_options": ["calib3d", "features2d", "flann", "imgproc"], + "requires": ["opencv_calib3d", "opencv_features2d", "opencv_flann", "opencv_imgproc"] + + opencv_xfeatures2d() + opencv_cudaarithm() + opencv_cudawarping() + + opencv_cudafeatures2d() + opencv_cudalegacy() + opencv_cudaimgproc() + eigen() + ipp(), + }, + "video": { + "is_built": self.options.video, + "mandatory_options": ["imgproc"], + "requires": ["opencv_imgproc"] + opencv_calib3d() + ipp(), + }, + "videoio": { + "is_built": self.options.videoio, + "mandatory_options": ["imgcodecs", "imgproc"], + "requires": ["opencv_imgcodecs", "opencv_imgproc"] + ffmpeg() + ipp(), + "system_libs": [ + (self.settings.os == "Android" and int(str(self.settings.os.api_level)) > 20, ["mediandk"]), + ], + "frameworks": [ + (is_apple_os(self), ["Accelerate", "AVFoundation", "CoreGraphics", "CoreMedia", "CoreVideo", "QuartzCore"]), + (self.settings.os == "iOS", ["CoreImage", "UIKit"]), + (self.settings.os == "Macos", ["Cocoa"]), + ], + }, + # Extra modules + "alphamat": { + "is_built": self.options.get_safe("alphamat"), + "mandatory_options": ["with_eigen", "imgproc"], + "requires": ["opencv_core", "opencv_imgproc"] + ipp(), + }, + "aruco": { + "is_built": self.options.aruco, + "mandatory_options": ["calib3d", "imgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgproc"] + ipp(), + }, + "barcode": { + "is_built": self.options.get_safe("barcode"), + "mandatory_options": ["dnn", "imgproc"], + "requires": ["opencv_core", "opencv_dnn", "opencv_imgproc"] + ipp(), + }, + "bgsegm": { + "is_built": self.options.bgsegm, + "mandatory_options": ["calib3d", "imgproc", "video"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgproc", "opencv_video"] + ipp(), + }, + "bioinspired": { + "is_built": self.options.bioinspired, + "requires": ["opencv_core"] + ipp(), + }, + "ccalib": { + "is_built": self.options.ccalib, + "mandatory_options": ["calib3d", "features2d", "highgui", "imgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_features2d", "opencv_highgui", "opencv_imgproc"] + ipp(), + }, + "cudaarithm": { + "is_built": self.options.cudaarithm, + "mandatory_options": ["with_cuda"], + "requires": ["opencv_core", "opencv_cudev"] + ipp(), + }, + "cudabgsegm": { + "is_built": self.options.cudabgsegm, + "mandatory_options": ["with_cuda", "video"], + "requires": ["opencv_video"] + ipp(), + }, + "cudacodec": { + "is_built": self.options.cudacodec, + "mandatory_options": ["with_cuda", "videoio"], + "requires": ["opencv_core", "opencv_videoio"] + ipp(), + }, + "cudafeatures2d": { + "is_built": self.options.cudafeatures2d, + "mandatory_options": ["with_cuda", "features2d", "cudafilters", "cudawarping"], + "requires": ["opencv_features2d", "opencv_cudafilters", "opencv_cudawarping"] + ipp(), + }, + "cudafilters": { + "is_built": self.options.cudafilters, + "mandatory_options": ["with_cuda", "imgproc", "cudaarithm"], + "requires": ["opencv_imgproc", "opencv_cudaarithm"] + ipp(), + }, + "cudaimgproc": { + "is_built": self.options.cudaimgproc, + "mandatory_options": ["with_cuda", "imgproc"], + "requires": ["opencv_imgproc", "opencv_cudev"] + opencv_cudaarithm() + opencv_cudafilters() + ipp(), + }, + "cudalegacy": { + "is_built": self.options.cudalegacy, + "mandatory_options": ["with_cuda", "video"], + "requires": ["opencv_core", "opencv_video"] + opencv_calib3d() + opencv_imgproc() + opencv_objdetect() + + opencv_cudaarithm() + opencv_cudafilters() + opencv_cudaimgproc() + ipp(), + }, + "cudaobjdetect": { + "is_built": self.options.cudaobjdetect, + "mandatory_options": ["with_cuda", "objdetect", "cudaarithm", "cudawarping"], + "requires": ["opencv_objdetect", "opencv_cudaarithm", "opencv_cudawarping"] + opencv_cudalegacy() + ipp(), + }, + "cudaoptflow": { + "is_built": self.options.cudaoptflow, + "mandatory_options": ["with_cuda", "video", "cudaarithm", "cudaimgproc", "cudawarping", "optflow"], + "requires": ["opencv_video", "opencv_cudaarithm", "cudaimgproc", "opencv_cudawarping", + "opencv_optflow"] + opencv_cudalegacy() + ipp(), + }, + "cudastereo": { + "is_built": self.options.cudastereo, + "mandatory_options": ["with_cuda", "calib3d"], + "requires": ["opencv_calib3d", "opencv_cudev"] + ipp(), + }, + "cudawarping": { + "is_built": self.options.cudawarping, + "mandatory_options": ["with_cuda", "imgproc"], + "requires": ["opencv_core", "opencv_imgproc", "opencv_cudev"] + ipp(), + }, + "cudev": { + "is_built": self.options.with_cuda, + "no_option": True, + "requires": ipp(), + }, + "cvv": { + "is_built": self.options.cvv, + "mandatory_options": ["with_qt", "features2d", "imgproc"], + "requires": ["opencv_core", "opencv_features2d", "opencv_imgproc", "qt::qt"] + ipp(), + }, + "datasets": { + "is_built": self.options.datasets, + "mandatory_options": ["flann", "imgcodecs", "ml"], + "requires": ["opencv_core", "opencv_flann", "opencv_imgcodecs", "opencv_ml"] + ipp(), + }, + "dnn_objdetect": { + "is_built": self.options.dnn_objdetect, + "mandatory_options": ["dnn", "imgproc"], + "requires": ["opencv_core", "opencv_dnn", "opencv_imgproc"] + ipp(), + }, + "dnn_superres": { + "is_built": self.options.dnn_superres, + "mandatory_options": ["dnn", "imgproc"], + "requires": ["opencv_core", "opencv_dnn", "opencv_imgproc"] + ipp(), + }, + "dpm": { + "is_built": self.options.dpm, + "mandatory_options": ["imgproc", "objdetect"], + "requires": ["opencv_core", "opencv_imgproc", "opencv_objdetect"] + ipp(), + }, + "face": { + "is_built": self.options.face, + "mandatory_options": ["calib3d", "imgproc", "objdetect", "photo"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgproc", "opencv_objdetect", "opencv_photo"] + ipp(), + }, + "freetype": { + "is_built": self.options.freetype, + "mandatory_options": ["imgproc"], + "requires": ["opencv_core", "opencv_imgproc", "freetype::freetype", "harfbuzz::harfbuzz"] + ipp(), + }, + "fuzzy": { + "is_built": self.options.fuzzy, + "mandatory_options": ["imgproc"], + "requires": ["opencv_core", "opencv_imgproc"] + ipp(), + }, + "hdf": { + "is_built": self.options.hdf, + "requires": ["opencv_core", "hdf5::hdf5"] + ipp(), + }, + "hfs": { + "is_built": self.options.hfs, + "mandatory_options": ["imgproc"], + "requires": ["opencv_core", "opencv_imgproc"] + ipp(), + }, + "img_hash": { + "is_built": self.options.img_hash, + "is_part_of_world": False, + "mandatory_options": ["imgproc"], + "requires": ["opencv_core", "opencv_imgproc"] + ipp(), + }, + "intensity_transform": { + "is_built": self.options.get_safe("intensity_transform"), + "requires": ["opencv_core"] + ipp(), + }, + "line_descriptor": { + "is_built": self.options.line_descriptor, + "mandatory_options": ["imgproc"], + "requires": ["opencv_imgproc"] + ipp(), + }, + "mcc": { + "is_built": self.options.get_safe("mcc"), + "mandatory_options": ["calib3d", "dnn", "imgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_dnn", "opencv_imgproc"] + ipp(), + }, + "optflow": { + "is_built": self.options.optflow, + "mandatory_options": ["calib3d", "flann", "imgcodecs", "imgproc", "video", "ximgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_flann", "opencv_imgcodecs", "opencv_imgproc", + "opencv_video", "opencv_ximgproc"] + ipp(), + }, + "ovis": { + "is_built": self.options.ovis, + "mandatory_options": ["calib3d", "imgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgproc", "ogre::ogre"] + ipp(), + }, + "phase_unwrapping": { + "is_built": self.options.phase_unwrapping, + "mandatory_options": ["imgproc"], + "requires": ["opencv_core", "opencv_imgproc"] + ipp(), + }, + "plot": { + "is_built": self.options.plot, + "mandatory_options": ["imgproc"], + "requires": ["opencv_core", "opencv_imgproc"] + ipp(), + }, + "quality": { + "is_built": self.options.quality, + "mandatory_options": ["imgproc", "ml"], + "requires": ["opencv_core", "opencv_imgproc", "opencv_ml"] + ipp(), + }, + "rapid": { + "is_built": self.options.get_safe("rapid"), + "mandatory_options": ["calib3d", "imgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgproc"] + ipp(), + }, + "reg": { + "is_built": self.options.reg, + "mandatory_options": ["imgproc"], + "requires": ["opencv_core", "opencv_imgproc"] + ipp(), + }, + "rgbd": { + "is_built": self.options.rgbd, + "mandatory_options": ["calib3d", "imgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgproc"] + eigen() + ipp(), + }, + "saliency": { + "is_built": self.options.saliency, + "mandatory_options": ["features2d", "imgproc"], + "requires": ["opencv_features2d", "opencv_imgproc"] + ipp(), + }, + "sfm": { + "is_built": self.options.sfm, + "is_part_of_world": False, + "mandatory_options": ["with_eigen", "calib3d", "features2d", "imgcodecs", "xfeatures2d"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_features2d", "opencv_imgcodecs", "opencv_xfeatures2d", + "correspondence", "multiview", "numeric", "glog::glog", "gflags::gflags"] + eigen() + ipp(), + }, + "shape": { + "is_built": self.options.shape, + "mandatory_options": ["calib3d", "imgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgproc"] + ipp(), + }, + "stereo": { + "is_built": self.options.stereo, + "mandatory_options": ["features2d", "imgproc", "tracking"], + "requires": ["opencv_core", "opencv_features2d", "opencv_imgproc", "opencv_tracking"] + ipp(), + }, + "structured_light": { + "is_built": self.options.structured_light, + "mandatory_options": ["calib3d", "imgproc", "phase_unwrapping"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgproc", "opencv_phase_unwrapping"] + ipp(), + }, + "superres": { + "is_built": self.options.get_safe("superres"), + "mandatory_options": ["imgproc", "video", "optflow"], + "requires": ["opencv_imgproc", "opencv_video", "opencv_optflow"] + opencv_videoio() + ipp() + + opencv_cudaarithm() + opencv_cudafilters() + opencv_cudawarping() + opencv_cudaimgproc() + + opencv_cudaoptflow() + opencv_cudacodec(), + }, + "surface_matching": { + "is_built": self.options.surface_matching, + "mandatory_options": ["flann"], + "requires": ["opencv_core", "opencv_flann"] + ipp(), + }, + "text": { + "is_built": self.options.text, + "mandatory_options": ["dnn", "features2d", "imgproc", "ml"], + "requires": ["opencv_core", "opencv_dnn", "opencv_features2d", "opencv_imgproc", "opencv_ml"] + + tesseract() + ipp(), + }, + "tracking": { + "is_built": self.options.tracking, + "mandatory_options": ["imgproc", "video"], + "requires": ["opencv_core", "opencv_imgproc", "opencv_video"] + opencv_dnn() + ipp(), + }, + "videostab": { + "is_built": self.options.videostab, + "mandatory_options": ["calib3d", "features2d", "imgproc", "photo", "video"], + "requires": ["opencv_calib3d", "opencv_features2d", "opencv_imgproc", "opencv_photo", "opencv_video"] + + opencv_videoio() + ipp() + opencv_cudawarping() + opencv_cudaoptflow(), + }, + "viz": { + "is_built": self.options.viz, + "requires": ["opencv_core", "vtk::vtk"] + ipp(), + }, + "wechat_qrcode": { + "is_built": self.options.get_safe("wechat_qrcode"), + "mandatory_options": ["dnn", "imgproc"], + "requires": ["opencv_core", "opencv_dnn", "opencv_imgproc"] + ipp(), + }, + "xfeatures2d": { + "is_built": self.options.xfeatures2d, + "mandatory_options": ["calib3d", "features2d", "imgproc"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_features2d", "opencv_imgproc"] + ipp() + opencv_cudaarithm(), + }, + "ximgproc": { + "is_built": self.options.ximgproc, + "mandatory_options": ["calib3d", "imgcodecs", "imgproc", "video"], + "requires": ["opencv_core", "opencv_calib3d", "opencv_imgcodecs", "opencv_imgproc", "opencv_video"] + + eigen() + ipp(), + }, + "xobjdetect": { + "is_built": self.options.xobjdetect, + "mandatory_options": ["imgcodecs", "imgproc", "objdetect"], + "requires": ["opencv_core", "opencv_imgcodecs", "opencv_imgproc", "opencv_objdetect"] + ipp(), + }, + "xphoto": { + "is_built": self.options.xphoto, + "mandatory_options": ["imgproc", "photo"], + "requires": ["opencv_core", "opencv_imgproc", "opencv_photo"] + ipp(), + }, + # Extra targets (without prefix in their target & lib name) + "ippiw": { + "is_built": self.options.with_ipp == "opencv-icv" and not self.options.shared, + "is_part_of_world": False, + "no_option": True, + }, + "numeric": { + "is_built": self.options.sfm, + "is_part_of_world": False, + "no_option": True, + "requires": eigen() + ipp(), + }, + "correspondence": { + "is_built": self.options.sfm, + "is_part_of_world": False, + "no_option": True, + "requires": ["opencv_imgcodecs", "multiview", "glog::glog"] + eigen() + ipp(), + }, + "multiview": { + "is_built": self.options.sfm, + "is_part_of_world": False, + "no_option": True, + "requires": ["numeric", "glog::glog"] + eigen() + ipp(), + }, + } + + if Version(self.version) >= "4.3.0": + opencv_modules["gapi"].setdefault("requires", []).extend(opencv_video()) + if Version(self.version) >= "4.5.2": + opencv_modules["gapi"].setdefault("requires", []).extend(opencv_calib3d()) + if Version(self.version) >= "4.5.4": + opencv_modules["objdetect"].setdefault("requires", []).extend(opencv_dnn()) + if Version(self.version) >= "4.5.1": + opencv_modules["video"].setdefault("requires", []).extend(opencv_dnn()) + if Version(self.version) >= "4.4.0": + opencv_modules["intensity_transform"].setdefault("mandatory_options", []).append("imgproc") + opencv_modules["intensity_transform"].setdefault("requires", []).append("opencv_imgproc") + 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 + + def _get_mandatory_disabled_options(self, opencv_modules): + direct_options_to_enable = {} + transitive_options_to_enable = {} + + # Check which direct options have to be enabled + base_options = [option for option, values in opencv_modules.items() + if not values.get("no_option") and self.options.get_safe(option)] + for base_option in base_options: + for mandatory_option in opencv_modules.get(base_option, {}).get("mandatory_options", []): + if not self.options.get_safe(mandatory_option): + direct_options_to_enable.setdefault(mandatory_option, set()).add(base_option) + + # Now traverse the graph to check which transitive options have to be enabled + def collect_transitive_options(base_option, option): + for mandatory_option in opencv_modules.get(option, {}).get("mandatory_options", []): + if not self.options.get_safe(mandatory_option): + if mandatory_option not in transitive_options_to_enable: + transitive_options_to_enable[mandatory_option] = set() + collect_transitive_options(base_option, mandatory_option) + if base_option not in direct_options_to_enable.get(mandatory_option, set()): + transitive_options_to_enable[mandatory_option].add(base_option) + + for base_option in base_options: + collect_transitive_options(base_option, base_option) + + return { + "direct": direct_options_to_enable, + "transitive": transitive_options_to_enable, + } + + def _solve_internal_dependency_graph(self, opencv_modules): + disabled_options = self._get_mandatory_disabled_options(opencv_modules) + direct_options_to_enable = disabled_options["direct"] + transitive_options_to_enable = disabled_options["transitive"] + + # Enable mandatory options + all_options_to_enable = set(direct_options_to_enable.keys()) + all_options_to_enable.update(transitive_options_to_enable.keys()) + if all_options_to_enable: + message = ("Several opencv options which were disabled will be enabled because " + "they are required by modules you have explicitly requested:\n") + + for option_to_enable in all_options_to_enable: + 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, [])) + if direct: + direct_and_transitive.append(f"direct dependency of {direct}") + transitive = ", ".join(transitive_options_to_enable.get(option_to_enable, [])) + if transitive: + direct_and_transitive.append(f"transitive dependency of {transitive}") + message += f" - {option_to_enable}: {' / '.join(direct_and_transitive)}\n" + + self.output.warning(message) def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - if not self.options.contrib: - del self.options.contrib_freetype - del self.options.contrib_sfm + + # TODO: remove contrib option in few months + if self.options.contrib != "deprecated": + self.output.warning("contrib option is deprecated") + if self.options.contrib: + # During deprecation period, keep old behavior of contrib=True, which was to enable + # all available contribs. + ## Filter main module options + filtered_options = list(OPENCV_MAIN_MODULES_OPTIONS) + ## Filter extra modules not built previously with contrib=True + filtered_options.extend(["cvv", "freetype", "hdf", "ovis", "sfm", "viz"]) + ## Filter extra modules not built previously when some option was disabled + if not self.options.with_eigen: + filtered_options.append("alphamat") + if not self.options.with_cuda: + filtered_options.extend([ + "cudaarithm", "cudabgsegm", "cudacodec", "cudafeatures2d", "cudafilters", "cudaimgproc", + "cudalegacy", "cudaobjdetect", "cudaoptflow", "cudastereo", "cudawarping", + ]) + for option, values in self._opencv_modules.items(): + if option not in filtered_options and not values.get("no_option"): + try: + if hasattr(self.options, option): + setattr(self.options, option, True) + except ConanException: + continue + + # TODO: remove contrib_freetype option in few months + if self.options.contrib_freetype != "deprecated": + self.output.warning("contrib_freetype option is deprecated, use freetype option instead") + self.options.freetype = self.options.contrib_freetype + + # TODO: remove contrib_sfm option in few months + if self.options.contrib_sfm != "deprecated": + self.output.warning("contrib_sfm option is deprecated, use sfm option instead") + self.options.sfm = self.options.contrib_sfm + + # TODO: remove with_ade option in few months + if self.options.with_ade != "deprecated": + self.output.warning("with_ade option is deprecated, use gapi option instead") + self.options.gapi = self.options.with_ade + + # Call this first before any further manipulation of options based on other options + self._solve_internal_dependency_graph(self._opencv_modules) + if not self.options.dnn: - del self.options.dnn_cuda + 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") + self.options.rm_safe("with_png") + self.options.rm_safe("with_tiff") + self.options.rm_safe("with_webp") + self.options.rm_safe("with_gdal") + self.options.rm_safe("with_gdcm") + self.options.rm_safe("with_imgcodec_hdr") + self.options.rm_safe("with_imgcodec_pfm") + self.options.rm_safe("with_imgcodec_pxm") + self.options.rm_safe("with_imgcodec_sunraster") + self.options.rm_safe("with_msmf") + self.options.rm_safe("with_msmf_dxva") + if not self.options.objdetect: + self.options.rm_safe("with_quirc") + if not self.options.videoio: + self.options.rm_safe("with_ffmpeg") + self.options.rm_safe("with_v4l") if not self.options.with_cuda: - del self.options.with_cublas - del self.options.with_cudnn - del self.options.with_cufft - del self.options.dnn_cuda - del self.options.cuda_arch_bin - if bool(self.options.with_jpeg): + self.options.rm_safe("with_cublas") + self.options.rm_safe("with_cudnn") + self.options.rm_safe("with_cufft") + self.options.rm_safe("dnn_cuda") + self.options.rm_safe("cuda_arch_bin") + if not self.options.text: + self.options.rm_safe("with_tesseract") + + if bool(self.options.get_safe("with_jpeg", False)): if self.options.get_safe("with_jpeg2000") == "jasper": self.options["jasper"].with_libjpeg = self.options.with_jpeg if self.options.get_safe("with_tiff"): self.options["libtiff"].jpeg = self.options.with_jpeg - if self.settings.os == "Android": - self.options.with_openexr = False # disabled because this forces linkage to libc++_shared.so - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") - if self.options.with_jpeg == "libjpeg": + # core module dependencies + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_eigen: + self.requires("eigen/3.4.0") + if self.options.parallel == "tbb": + self.requires("onetbb/2021.10.0") + if self.options.with_ipp == "intel-ipp": + self.requires("intel-ipp/2020") + # dnn module dependencies + 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.268.0") + # gapi module dependencies + if self.options.gapi: + self.requires("ade/0.1.2d") + # highgui module dependencies + if self.options.get_safe("with_gtk"): + 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.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") - elif self.options.with_jpeg == "mozjpeg": - self.requires("mozjpeg/4.1.1") + elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": + self.requires("libjpeg-turbo/3.0.0") + elif self.options.get_safe("with_jpeg") == "mozjpeg": + self.requires("mozjpeg/4.1.3") if self.options.get_safe("with_jpeg2000") == "jasper": self.requires("jasper/4.0.0") elif self.options.get_safe("with_jpeg2000") == "openjpeg": self.requires("openjpeg/2.5.0") - if self.options.with_png: + if self.options.get_safe("with_png"): self.requires("libpng/1.6.40") - if self.options.with_openexr: - if Version(self.version) < "4.5.3": - # opencv < 4.5.3 doesn't support openexr >= 3 - self.requires("openexr/2.5.7") - else: - self.requires("openexr/3.1.9") + if self.options.get_safe("with_openexr"): + self.requires("openexr/3.2.1") if self.options.get_safe("with_tiff"): - self.requires("libtiff/4.5.1") - if self.options.with_eigen: - self.requires("eigen/3.4.0") + self.requires("libtiff/4.6.0") + if self.options.get_safe("with_webp"): + self.requires("libwebp/1.3.2") + if self.options.get_safe("with_gdal"): + self.requires("gdal/3.7.0") + if self.options.get_safe("with_gdcm"): + self.requires("gdcm/3.0.21") + # objdetect module dependencies + if self.options.get_safe("with_quirc"): + self.requires("quirc/1.2") + # videoio module dependencies if self.options.get_safe("with_ffmpeg"): # opencv doesn't support ffmpeg >= 5.0.0 for the moment (until 4.5.5 at least) - self.requires("ffmpeg/4.4.3") - if self.options.parallel == "tbb": - self.requires("onetbb/2021.9.0") - if self.options.with_ipp == "intel-ipp": - self.requires("intel-ipp/2020") - if self.options.with_webp: - self.requires("libwebp/1.3.1") - if self.options.get_safe("contrib_freetype"): + self.requires("ffmpeg/4.4.4") + # freetype module dependencies + if self.options.freetype: self.requires("freetype/2.13.0") - self.requires("harfbuzz/6.0.0") - if self.options.get_safe("contrib_sfm"): + self.requires("harfbuzz/8.2.2") + # hdf module dependencies + if self.options.hdf: + self.requires("hdf5/1.14.2") + # ovis module dependencies + if self.options.ovis: + self.requires("ogre/1.10.2") + # sfm module dependencies + if self.options.sfm: self.requires("gflags/2.2.2") self.requires("glog/0.6.0") - if self.options.with_quirc: - self.requires("quirc/1.1") - if self.options.get_safe("with_gtk"): - self.requires("gtk/system") - if self.options.dnn: - # Symbols are exposed https://github.com/conan-io/conan-center-index/pull/16678#issuecomment-1507811867 - self.requires(f"protobuf/{self._protobuf_version}", transitive_libs=True) - if self.options.with_ade: - self.requires("ade/0.1.2a") + # text module dependencies + if self.options.get_safe("with_tesseract"): + self.requires("tesseract/5.3.0") + + def package_id(self): + # deprecated options + del self.info.options.contrib + del self.info.options.contrib_freetype + del self.info.options.contrib_sfm + del self.info.options.with_ade + + def _check_mandatory_options(self, opencv_modules): + disabled_options = self._get_mandatory_disabled_options(opencv_modules) + direct_disabled_mandatory_options = disabled_options["direct"] + transitive_disabled_mandatory_options = disabled_options["transitive"] + + # check mandatory options + all_disabled_mandatory_options = set(direct_disabled_mandatory_options.keys()) + all_disabled_mandatory_options.update(transitive_disabled_mandatory_options.keys()) + if all_disabled_mandatory_options: + message = ("Several opencv options are disabled but are required by modules " + "you have explicitly requested:\n") + + for disabled_option in all_disabled_mandatory_options: + direct_and_transitive = [] + direct = ", ".join(direct_disabled_mandatory_options.get(disabled_option, [])) + if direct: + direct_and_transitive.append(f"direct dependency of {direct}") + transitive = ", ".join(transitive_disabled_mandatory_options.get(disabled_option, [])) + if transitive: + direct_and_transitive.append(f"transitive dependency of {transitive}") + message += f" - {disabled_option}: {' / '.join(direct_and_transitive)}\n" + + raise ConanInvalidConfiguration(message) def validate(self): + self._check_mandatory_options(self._opencv_modules) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Visual Studio with static runtime is not supported for shared library.") if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "4": raise ConanInvalidConfiguration("Clang 3.x can't build OpenCV 4.x due to an internal bug.") - if self.options.with_cuda and not self.options.contrib: - raise ConanInvalidConfiguration("contrib must be enabled for cuda") if self.options.get_safe("dnn_cuda") and \ - (not self.options.with_cuda or not self.options.contrib or not self.options.with_cublas or not self.options.with_cudnn): - raise ConanInvalidConfiguration("with_cublas, with_cudnn and contrib must be enabled for dnn_cuda") + (not self.options.with_cuda or not self.options.with_cublas or not self.options.with_cudnn): + raise ConanInvalidConfiguration("with_cublas and with_cudnn must be enabled for dnn_cuda") if self.options.with_ipp == "opencv-icv" and \ - (not str(self.settings.arch) in ["x86", "x86_64"] or \ - not str(self.settings.os) in ["Linux", "Macos", "Windows"]): + not (self.settings.arch in ["x86", "x86_64"] and self.settings.os in ["Linux", "Macos", "Windows"]): raise ConanInvalidConfiguration(f"opencv-icv is not available for {self.settings.os}/{self.settings.arch}") + if self.options.viz: + raise ConanInvalidConfiguration( + "viz module can't be enabled yet. It requires VTK which is not available in conan-center." + ) def build_requirements(self): - if self.options.dnn: - if hasattr(self, "settings_build") and cross_building(self): - self.tool_requires(f"protobuf/{self._protobuf_version}") + 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) @@ -252,18 +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: @@ -273,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, @@ -285,34 +1312,31 @@ def _patch_sources(self): 'if(TARGET "${Protobuf_LIBRARIES}")', 'if(FALSE) # patch: disable if(TARGET "${Protobuf_LIBRARIES}")') - if self.options.get_safe("contrib_freetype"): - freetype_cmake = os.path.join(self._contrib_folder, "modules", "freetype", "CMakeLists.txt") + # 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._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_") - replace_in_file(self, freetype_cmake, "ocv_check_modules(HARFBUZZ harfbuzz)", "find_package(harfbuzz REQUIRED)") + replace_in_file(self, freetype_cmake, "ocv_check_modules(HARFBUZZ harfbuzz)", "find_package(harfbuzz REQUIRED CONFIG)") replace_in_file(self, freetype_cmake, "HARFBUZZ_", "harfbuzz_") - if self.options.get_safe("contrib_sfm") and Version(self.version) <= "4.5.2": - sfm_cmake = os.path.join(self._contrib_folder, "modules", "sfm", "CMakeLists.txt") - ver = Version(self.version) - if ver <= "4.5.0": - search = " find_package(Glog QUIET)\nendif()" - else: - search = ' set(GLOG_INCLUDE_DIRS "${GLOG_INCLUDE_DIR}")\nendif()' - replace_in_file(self, sfm_cmake, search, f"""{search} - if(NOT GFLAGS_LIBRARIES AND TARGET gflags::gflags) - set(GFLAGS_LIBRARIES gflags::gflags) - endif() - if(NOT GLOG_LIBRARIES AND TARGET glog::glog) - set(GLOG_LIBRARIES glog::glog) - endif()""") - def generate(self): - if self.options.dnn: - if hasattr(self, "settings_build") and cross_building(self): - VirtualBuildEnv(self).generate() - else: + 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") tc = CMakeToolchain(self) @@ -323,11 +1347,13 @@ def generate(self): tc.variables["OPENCV_OTHER_INSTALL_PATH"] = "res" tc.variables["OPENCV_LICENSES_INSTALL_PATH"] = "licenses" + tc.variables["OPENCV_SKIP_CMAKE_CXX_STANDARD"] = valid_min_cppstd(self, 11) + tc.variables["BUILD_CUDA_STUBS"] = False tc.variables["BUILD_DOCS"] = False tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_FAT_JAVA_LIB"] = False - tc.variables["BUILD_IPP_IW"] = False + tc.variables["BUILD_IPP_IW"] = self.options.with_ipp == "opencv-icv" tc.variables["BUILD_ITT"] = False tc.variables["BUILD_JASPER"] = False tc.variables["BUILD_JAVA"] = False @@ -357,12 +1383,11 @@ def generate(self): tc.variables["BUILD_opencv_ts"] = False tc.variables["WITH_1394"] = False - tc.variables["WITH_ADE"] = False tc.variables["WITH_ARAVIS"] = False tc.variables["WITH_CLP"] = False tc.variables["WITH_NVCUVID"] = False - tc.variables["WITH_FFMPEG"] = self.options.get_safe("with_ffmpeg") + tc.variables["WITH_FFMPEG"] = self.options.get_safe("with_ffmpeg", False) if self.options.get_safe("with_ffmpeg"): tc.variables["OPENCV_FFMPEG_SKIP_BUILD_CHECK"] = True tc.variables["OPENCV_FFMPEG_SKIP_DOWNLOAD"] = True @@ -370,72 +1395,70 @@ def generate(self): # libavcodec;libavformat;libavutil;libswscale modules tc.variables["OPENCV_FFMPEG_USE_FIND_PACKAGE"] = "ffmpeg" tc.variables["OPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT"] = False - tc.variables["FFMPEG_LIBRARIES"] = "ffmpeg::avcodec;ffmpeg::avformat;ffmpeg::avutil;ffmpeg::swscale" - ffmpeg_cpp_info = self.dependencies["ffmpeg"].cpp_info - for component in ["avcodec", "avformat", "avutil", "swscale"]: - ffmpeg_component_version = ffmpeg_cpp_info.components[component].get_property("component_version") - tc.variables[f"FFMPEG_lib{component}_VERSION"] = ffmpeg_component_version + if Version(self.version) >= "4.7.0": + tc.variables["OPENCV_FFMPEG_ENABLE_LIBAVDEVICE"] = False + ffmpeg_libraries = [] + 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") + tc.variables[f"FFMPEG_lib{component}_VERSION"] = ffmpeg_component_version + tc.variables["FFMPEG_LIBRARIES"] = ";".join(ffmpeg_libraries) tc.variables["WITH_GSTREAMER"] = False tc.variables["WITH_HALIDE"] = False tc.variables["WITH_HPX"] = False - tc.variables["WITH_IMGCODEC_HDR"] = self.options.with_imgcodec_hdr - tc.variables["WITH_IMGCODEC_PFM"] = self.options.with_imgcodec_pfm - tc.variables["WITH_IMGCODEC_PXM"] = self.options.with_imgcodec_pxm - tc.variables["WITH_IMGCODEC_SUNRASTER"] = self.options.with_imgcodec_sunraster - tc.variables["WITH_INF_ENGINE"] = False - tc.variables["WITH_IPP"] = False - if self.options.with_ipp: - tc.variables["WITH_IPP"] = True - if self.options.with_ipp == "intel-ipp": - ipp_root = self.dependencies["intel-ipp"].package_folder.replace("\\", "/") - if self.settings.os == "Windows": - ipp_root = ipp_root.replace("\\", "/") - tc.variables["IPPROOT"] = ipp_root - tc.variables["IPPIWROOT"] = ipp_root - else: - tc.variables["BUILD_IPP_IW"] = True + tc.variables["WITH_IMGCODEC_HDR"] = self.options.get_safe("with_imgcodec_hdr", False) + 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_IPP"] = bool(self.options.with_ipp) + if self.options.with_ipp == "intel-ipp": + ipp_root = self.dependencies["intel-ipp"].package_folder.replace("\\", "/") + tc.variables["IPPROOT"] = ipp_root + tc.variables["IPPIWROOT"] = ipp_root tc.variables["WITH_ITT"] = False tc.variables["WITH_LIBREALSENSE"] = False tc.variables["WITH_MFX"] = False - tc.variables["WITH_NGRAPH"] = False - tc.variables["WITH_OPENCL"] = False + tc.variables["WITH_OPENCL"] = self.options.get_safe("with_opencl", False) tc.variables["WITH_OPENCLAMDBLAS"] = False tc.variables["WITH_OPENCLAMDFFT"] = False tc.variables["WITH_OPENCL_SVM"] = False tc.variables["WITH_OPENGL"] = False - tc.variables["WITH_OPENMP"] = False + tc.variables["WITH_TBB"] = self.options.parallel == "tbb" + tc.variables["WITH_OPENMP"] = self.options.parallel == "openmp" tc.variables["WITH_OPENNI"] = False tc.variables["WITH_OPENNI2"] = False tc.variables["WITH_OPENVX"] = False tc.variables["WITH_PLAIDML"] = False tc.variables["WITH_PVAPI"] = False - tc.variables["WITH_QT"] = False + tc.variables["WITH_QT"] = self.options.get_safe("with_qt", False) tc.variables["WITH_QUIRC"] = False tc.variables["WITH_V4L"] = self.options.get_safe("with_v4l", False) tc.variables["WITH_VA"] = False tc.variables["WITH_VA_INTEL"] = False - tc.variables["WITH_VTK"] = False - tc.variables["WITH_VULKAN"] = False + tc.variables["WITH_VTK"] = self.options.viz + tc.variables["WITH_VULKAN"] = self.options.get_safe("with_vulkan", False) + if self.options.get_safe("with_vulkan"): + tc.variables["VULKAN_INCLUDE_DIRS"] = os.path.join(self.dependencies["vulkan-headers"].package_folder, "include").replace("\\", "/") tc.variables["WITH_XIMEA"] = False tc.variables["WITH_XINE"] = False tc.variables["WITH_LAPACK"] = False tc.variables["WITH_GTK"] = self.options.get_safe("with_gtk", False) tc.variables["WITH_GTK_2_X"] = self._is_gtk_version2 - tc.variables["WITH_WEBP"] = self.options.with_webp - tc.variables["WITH_JPEG"] = bool(self.options.with_jpeg) - tc.variables["WITH_PNG"] = self.options.with_png + tc.variables["WITH_WEBP"] = self.options.get_safe("with_webp", False) + tc.variables["WITH_JPEG"] = bool(self.options.get_safe("with_jpeg", False)) + tc.variables["WITH_PNG"] = self.options.get_safe("with_png", False) if self._has_with_tiff_option: - tc.variables["WITH_TIFF"] = self.options.with_tiff + tc.variables["WITH_TIFF"] = self.options.get_safe("with_tiff", False) if self._has_with_jpeg2000_option: - tc.variables["WITH_JASPER"] = self.options.with_jpeg2000 == "jasper" - tc.variables["WITH_OPENJPEG"] = self.options.with_jpeg2000 == "openjpeg" - tc.variables["WITH_OPENEXR"] = self.options.with_openexr - if self.options.with_openexr: - tc.variables["CMAKE_CXX_STANDARD"] = 11 + tc.variables["WITH_JASPER"] = self.options.get_safe("with_jpeg2000") == "jasper" + tc.variables["WITH_OPENJPEG"] = self.options.get_safe("with_jpeg2000") == "openjpeg" + tc.variables["WITH_OPENEXR"] = self.options.get_safe("with_openexr", False) + tc.variables["WITH_GDAL"] = self.options.get_safe("with_gdal", False) + tc.variables["WITH_GDCM"] = self.options.get_safe("with_gdcm", False) tc.variables["WITH_EIGEN"] = self.options.with_eigen - tc.variables["HAVE_QUIRC"] = self.options.with_quirc # force usage of quirc requirement tc.variables["WITH_DSHOW"] = is_msvc(self) tc.variables["WITH_MSMF"] = self.options.get_safe("with_msmf", False) tc.variables["WITH_MSMF_DXVA"] = self.options.get_safe("with_msmf_dxva", False) @@ -448,31 +1471,61 @@ def generate(self): if self.options.cpu_dispatch or self.options.cpu_dispatch == "": tc.variables["CPU_DISPATCH"] = self.options.cpu_dispatch - if self.options.get_safe("neon") is not None: - tc.variables["ENABLE_NEON"] = self.options.get_safe("neon") + tc.variables["ENABLE_NEON"] = self.options.get_safe("neon", False) - tc.variables["WITH_PROTOBUF"] = self.options.dnn - if self.options.dnn: - tc.variables["PROTOBUF_UPDATE_FILES"] = True - tc.variables["BUILD_opencv_dnn"] = True tc.variables["OPENCV_DNN_CUDA"] = self.options.get_safe("dnn_cuda", False) - if self.options.contrib: - tc.variables["OPENCV_EXTRA_MODULES_PATH"] = os.path.join(self._contrib_folder, "modules").replace("\\", "/") - tc.variables["BUILD_opencv_freetype"] = self.options.get_safe("contrib_freetype", False) - tc.variables["BUILD_opencv_sfm"] = self.options.get_safe("contrib_sfm", 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 + + # Main modules + 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.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 + 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) + tc.variables["BUILD_opencv_cnn_3dobj"] = False + if Version(self.version) >= "4.4.0": + tc.variables["BUILD_opencv_julia"] = False + tc.variables["BUILD_opencv_matlab"] = False + if self.options.text: + tc.variables["WITH_TESSERACT"] = self.options.with_tesseract if self.options.get_safe("with_jpeg2000") == "openjpeg": openjpeg_version = Version(self.dependencies["openjpeg"].ref.version) tc.variables["OPENJPEG_MAJOR_VERSION"] = openjpeg_version.major tc.variables["OPENJPEG_MINOR_VERSION"] = openjpeg_version.minor tc.variables["OPENJPEG_BUILD_VERSION"] = openjpeg_version.patch - if self.options.parallel: - tc.variables["WITH_TBB"] = self.options.parallel == "tbb" - tc.variables["WITH_OPENMP"] = self.options.parallel == "openmp" tc.variables["WITH_CUDA"] = self.options.with_cuda - tc.variables["WITH_ADE"] = self.options.with_ade if self.options.with_cuda: # This allows compilation on older GCC/NVCC, otherwise build errors. tc.variables["CUDA_NVCC_FLAGS"] = "--expt-relaxed-constexpr" @@ -495,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) @@ -510,12 +1569,39 @@ def package(self): rename(self, os.path.join(self.package_folder, "setup_vars_opencv4.cmd"), os.path.join(self.package_folder, "res", "setup_vars_opencv4.cmd")) + self._create_cmake_module_variables(os.path.join(self.package_folder, self._module_vars_rel_path)) + # TODO: to remove in conan v2 once cmake_find_package* generators removed + targets_mapping = {self._cmake_target(k): f"opencv::{self._cmake_target(k)}" for k in self._opencv_modules.keys()} + if self.options.world: + targets_mapping.update({"opencv_world": "opencv::opencv_world"}) self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {component["target"]:"opencv::{}".format(component["target"]) for component in self._opencv_components} + os.path.join(self.package_folder, self._module_target_rel_path), + targets_mapping, ) + def _create_cmake_module_variables(self, module_file): + """ + Define several CMake variables from upstream CMake config file not defined by default by CMakeDeps. + See https://github.com/opencv/opencv/blob/4.8.1/cmake/templates/OpenCVConfig.cmake.in + """ + v = Version(self.version) + content = textwrap.dedent(f"""\ + if(NOT DEFINED OpenCV_LIBS) + set(OpenCV_LIBS opencv::opencv) + endif() + if(NOT DEFINED OpenCV_VERSION_MAJOR) + set(OpenCV_VERSION_MAJOR {v.major}) + endif() + if(NOT DEFINED OpenCV_VERSION_MINOR) + set(OpenCV_VERSION_MINOR {v.minor}) + endif() + if(NOT DEFINED OpenCV_VERSION_PATCH) + set(OpenCV_VERSION_PATCH {v.patch}) + endif() + """) + save(self, module_file, content) + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): @@ -528,7 +1614,11 @@ def _create_cmake_module_alias_targets(self, module_file, targets): save(self, module_file, content) @property - def _module_file_rel_path(self): + def _module_vars_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + @property + def _module_target_rel_path(self): return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") # returns true if GTK2 is selected. To do this, the version option @@ -544,245 +1634,105 @@ def _is_gtk_version2(self): else: return Version(gtk_version) < "3.0.0" - @property - def _opencv_components(self): - def imageformats_deps(): - components = [] - if self.options.get_safe("with_jpeg2000"): - components.append("{0}::{0}".format(self.options.with_jpeg2000)) - if self.options.with_png: - components.append("libpng::libpng") - if self.options.with_jpeg == "libjpeg": - components.append("libjpeg::libjpeg") - elif self.options.with_jpeg == "libjpeg-turbo": - components.append("libjpeg-turbo::jpeg") - elif self.options.with_jpeg == "mozjpeg": - components.append("mozjpeg::libjpeg") - if self.options.get_safe("with_tiff"): - components.append("libtiff::libtiff") - if self.options.with_openexr: - components.append("openexr::openexr") - if self.options.with_webp: - components.append("libwebp::libwebp") - return components - - def eigen(): - return ["eigen::eigen"] if self.options.with_eigen else [] - - def parallel(): - return ["onetbb::onetbb"] if self.options.parallel == "tbb" else [] - - def quirc(): - return ["quirc::quirc"] if self.options.with_quirc else [] - - def gtk(): - return ["gtk::gtk"] if self.options.get_safe("with_gtk") else [] - - def protobuf(): - return ["protobuf::protobuf"] if self.options.dnn else [] - - def freetype(): - return ["freetype::freetype"] if self.options.get_safe("contrib_freetype") else [] - - def xfeatures2d(): - return ["opencv_xfeatures2d"] if self.options.contrib else [] - - def ffmpeg(): - if self.options.get_safe("with_ffmpeg"): - return [ - "ffmpeg::avcodec", - "ffmpeg::avfilter", - "ffmpeg::avformat", - "ffmpeg::avutil", - "ffmpeg::swresample", - "ffmpeg::swscale" ] - else: - return [ ] - - def ipp(): - if self.options.with_ipp: - if self.options.with_ipp == "intel-ipp": - return ["intel-ipp::intel-ipp"] - elif self.options.with_ipp == "opencv-icv" and not self.options.shared: - return ["ippiw"] - else: - return [] - else: - return [] - - opencv_components = [ - {"target": "opencv_core", "lib": "core", "requires": ["zlib::zlib"] + parallel() + eigen() + ipp()}, - {"target": "opencv_flann", "lib": "flann", "requires": ["opencv_core"] + eigen() + ipp()}, - {"target": "opencv_imgproc", "lib": "imgproc", "requires": ["opencv_core"] + eigen() + ipp()}, - {"target": "opencv_ml", "lib": "ml", "requires": ["opencv_core"] + eigen() + ipp()}, - {"target": "opencv_photo", "lib": "photo", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_features2d", "lib": "features2d", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_imgcodecs", "lib": "imgcodecs", "requires": ["opencv_core", "opencv_imgproc", "zlib::zlib"] + eigen() + imageformats_deps() + ipp()}, - {"target": "opencv_videoio", "lib": "videoio", "requires": ( - ["opencv_core", "opencv_imgproc", "opencv_imgcodecs"] - + eigen() + ffmpeg() + ipp())}, - {"target": "opencv_calib3d", "lib": "calib3d", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d"]+ eigen() + ipp()}, - {"target": "opencv_highgui", "lib": "highgui", "requires": ["opencv_core", "opencv_imgproc", "opencv_imgcodecs", "opencv_videoio"] + freetype() + eigen() + gtk() + ipp()}, - {"target": "opencv_stitching", "lib": "stitching", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_calib3d"] + xfeatures2d() + eigen() + ipp()}, - {"target": "opencv_video", "lib": "video", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_calib3d"] + eigen() + ipp()}, - ] - if self.options.with_ipp == "opencv-icv" and not self.options.shared: - opencv_components.extend([ - {"target": "ippiw", "lib": "ippiw", "requires": []} - ]) - - if self.options.dnn: - opencv_components.extend([ - {"target": "opencv_dnn", "lib": "dnn", "requires": ["opencv_core", "opencv_imgproc"] + protobuf() + ipp()}, - {"target": "opencv_objdetect", "lib": "objdetect", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_calib3d"] + eigen() + quirc() + ipp()}, - - ]) - if self.options.contrib: - opencv_components.extend([ - {"target": "opencv_phase_unwrapping", "lib": "phase_unwrapping", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_plot", "lib": "plot", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_quality", "lib": "quality", "requires": ["opencv_core", "opencv_imgproc", "opencv_ml"] + eigen() + ipp()}, - {"target": "opencv_reg", "lib": "reg", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_surface_matching", "lib": "surface_matching", "requires": ["opencv_core", "opencv_flann"] + eigen() + ipp()}, - {"target": "opencv_xphoto", "lib": "xphoto", "requires": ["opencv_core", "opencv_imgproc", "opencv_photo"] + eigen() + ipp()}, - {"target": "opencv_fuzzy", "lib": "fuzzy", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_hfs", "lib": "hfs", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_img_hash", "lib": "img_hash", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_line_descriptor", "lib": "line_descriptor", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d"] + eigen() + ipp()}, - {"target": "opencv_saliency", "lib": "saliency", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d"] + eigen() + ipp()}, - {"target": "opencv_datasets", "lib": "datasets", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_ml", "opencv_imgcodecs"] + eigen() + ipp()}, - {"target": "opencv_rgbd", "lib": "rgbd", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_calib3d"] + eigen() + ipp()}, - {"target": "opencv_shape", "lib": "shape", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_calib3d"] + eigen() + ipp()}, - {"target": "opencv_structured_light", "lib": "structured_light", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_phase_unwrapping", "opencv_features2d", "opencv_calib3d"] + eigen() + ipp()}, - {"target": "opencv_videostab", "lib": "videostab", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_photo", "opencv_features2d", "opencv_imgcodecs", "opencv_videoio", "opencv_calib3d", "opencv_video"] + eigen() + ipp()}, - {"target": "opencv_xfeatures2d", "lib": "xfeatures2d", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_ml", "opencv_features2d", "opencv_calib3d", "opencv_shape", ] + eigen() + ipp()}, - {"target": "opencv_ximgproc", "lib": "ximgproc", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_imgcodecs", "opencv_calib3d", "opencv_video"] + eigen() + ipp()}, - {"target": "opencv_aruco", "lib": "aruco", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_imgcodecs", "opencv_calib3d"] + eigen() + ipp()}, - {"target": "opencv_bgsegm", "lib": "bgsegm", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_calib3d", "opencv_video"] + eigen() + ipp()}, - {"target": "opencv_bioinspired", "lib": "bioinspired", "requires": ["opencv_core", "opencv_imgproc", "opencv_imgcodecs", "opencv_videoio", "opencv_highgui"] + eigen() + ipp()}, - {"target": "opencv_ccalib", "lib": "ccalib", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_imgcodecs", "opencv_videoio", "opencv_calib3d", "opencv_highgui"] + eigen() + ipp()}, - {"target": "opencv_optflow", "lib": "optflow", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_video", "opencv_features2d", "opencv_imgcodecs", "opencv_calib3d", "opencv_video", "opencv_ximgproc"] + eigen() + ipp()}, - {"target": "opencv_superres", "lib": "superres", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_imgcodecs", "opencv_videoio", "opencv_calib3d", "opencv_video", "opencv_ximgproc", "opencv_optflow"] + eigen() + ipp()}, - {"target": "opencv_tracking", "lib": "tracking", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_ml", "opencv_plot", "opencv_features2d", "opencv_imgcodecs", "opencv_calib3d", "opencv_datasets", "opencv_video"] + eigen() + ipp()}, - {"target": "opencv_stereo", "lib": "stereo", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_ml", "opencv_plot", "opencv_features2d", "opencv_imgcodecs", "opencv_calib3d", "opencv_datasets", "opencv_video", "opencv_tracking"] + eigen() + ipp()}, - ]) - if self.options.dnn: - opencv_components.extend([ - {"target": "opencv_xobjdetect", "lib": "xobjdetect", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_imgcodecs", "opencv_calib3d", "opencv_objdetect"] + eigen() + ipp()}, - {"target": "opencv_dpm", "lib": "dpm", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_imgcodecs", "opencv_videoio", "opencv_calib3d", "opencv_highgui", "opencv_objdetect"] + eigen() + ipp()}, - {"target": "opencv_face", "lib": "face", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_photo", "opencv_features2d", "opencv_calib3d", "opencv_objdetect"] + eigen() + ipp()} - ]) - if self.version >= "4.3.0": - opencv_components.extend([ - {"target": "opencv_intensity_transform", "lib": "intensity_transform", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_alphamat", "lib": "alphamat", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_rapid", "lib": "rapid", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_features2d", "opencv_calib3d"] + eigen() + ipp()}, - ]) - - if self.options.get_safe("contrib_freetype"): - opencv_components.extend([ - {"target": "opencv_freetype", "lib": "freetype", "requires": ["opencv_core", "opencv_imgproc", "freetype::freetype", "harfbuzz::harfbuzz"] + eigen() + ipp()}, - ]) - - if self.options.get_safe("contrib_sfm"): - opencv_components.extend([ - {"target": "opencv_sfm", "lib": "sfm", "requires": ["opencv_core", "opencv_flann", "opencv_imgproc", "opencv_ml", "opencv_features2d", "opencv_imgcodecs", "opencv_calib3d", "opencv_shape", "opencv_xfeatures2d", "correspondence", "multiview", "numeric", "glog::glog", "gflags::gflags"] + eigen() + ipp()}, - {"target": "numeric", "lib": "numeric", "requires": eigen() + ipp()}, - {"target": "correspondence", "lib": "correspondence", "requires": ["multiview", "glog::glog"] + eigen() + ipp()}, - {"target": "multiview", "lib": "multiview", "requires": ["numeric", "gflags::gflags"] + eigen() + ipp()}, - ]) - - - if self.options.with_cuda: - opencv_components.extend([ - {"target": "opencv_cudaarithm", "lib": "cudaarithm", "requires": ["opencv_core"] + eigen() + ipp()}, - {"target": "opencv_cudabgsegm", "lib": "cudabgsegm", "requires": ["opencv_core", "opencv_video"] + eigen() + ipp()}, - {"target": "opencv_cudacodec", "lib": "cudacodec", "requires": ["opencv_core"] + eigen() + ipp()}, - {"target": "opencv_cudafeatures2d", "lib": "cudafeatures2d", "requires": ["opencv_core", "opencv_cudafilters"] + eigen() + ipp()}, - {"target": "opencv_cudafilters", "lib": "cudafilters", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_cudaimgproc", "lib": "cudaimgproc", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_cudalegacy", "lib": "cudalegacy", "requires": ["opencv_core", "opencv_video"] + eigen() + ipp()}, - {"target": "opencv_cudaobjdetect", "lib": "cudaobjdetect", "requires": ["opencv_core", "opencv_objdetect"] + eigen() + ipp()}, - {"target": "opencv_cudaoptflow", "lib": "cudaoptflow", "requires": ["opencv_core"] + eigen() + ipp()}, - {"target": "opencv_cudastereo", "lib": "cudastereo", "requires": ["opencv_core", "opencv_calib3d"] + eigen() + ipp()}, - {"target": "opencv_cudawarping", "lib": "cudawarping", "requires": ["opencv_core", "opencv_imgproc"] + eigen() + ipp()}, - {"target": "opencv_cudev", "lib": "cudev", "requires": [] + eigen() + ipp()}, - ]) - - if self.options.with_ade: - opencv_components.extend([ - {"target": "opencv_gapi", "lib": "gapi", "requires": ["opencv_imgproc", "opencv_calib3d", "opencv_video", "ade::ade"]}, - ]) - - return opencv_components + @staticmethod + def _cmake_target(module): + if module in ("ippiw", "correspondence", "multiview", "numeric"): + return module + return f"opencv_{module}" def package_info(self): version = self.version.split(".") version = "".join(version) if self.settings.os == "Windows" else "" debug = "d" if self.settings.build_type == "Debug" and self.settings.os == "Windows" else "" - def get_lib_name(module): + def get_libs(module): if module == "ippiw": - return f"{module}{debug}" + return [ + f"{module}{debug}", + "ippicvmt" if self.settings.os == "Windows" else "ippicv", + ] elif module in ("correspondence", "multiview", "numeric"): - return module + return [module] else: - return f"opencv_{module}{version}{debug}" - - def add_components(components): - for component in components: - conan_component = component["target"] - cmake_target = component["target"] - cmake_component = component["lib"] - lib_name = get_lib_name(component["lib"]) - requires = component["requires"] - # TODO: we should also define COMPONENTS names of each target for find_package() but not possible yet in CMakeDeps - # see https://github.com/conan-io/conan/issues/10258 + libs = [f"opencv_{module}{version}{debug}"] + if module in ["core", "world"] and not self.options.shared: + lib_exclude_filter = "(opencv_|ippi|correspondence|multiview|numeric).*" + libs += list(filter(lambda x: not re.match(lib_exclude_filter, x), collect_libs(self))) + return libs + + def add_components(modules): + if self.options.world: + self.cpp_info.components["opencv_world"].set_property("cmake_target_name", "opencv_world") + self.cpp_info.components["opencv_world"].libs = get_libs("world") + self.cpp_info.components["opencv_world"].resdirs = ["res"] + if self.settings.os != "Windows": + self.cpp_info.components["opencv_world"].includedirs.append(os.path.join("include", "opencv4")) + world_requires = set() + world_requires_exclude = set() + world_system_libs = set() + world_frameworks = set() + + for module, values in modules.items(): + if not values.get("is_built"): + continue + cmake_target = self._cmake_target(module) + conan_component = cmake_target + # TODO: we should also define COMPONENTS names of each target for find_package() but + # not possible yet in CMakeDeps. See https://github.com/conan-io/conan/issues/10258 self.cpp_info.components[conan_component].set_property("cmake_target_name", cmake_target) - self.cpp_info.components[conan_component].libs = [lib_name] - if lib_name.startswith("ippiw"): - self.cpp_info.components[conan_component].libs.append("ippicvmt" if self.settings.os == "Windows" else "ippicv") + self.cpp_info.components[conan_component].resdirs = ["res"] if self.settings.os != "Windows": self.cpp_info.components[conan_component].includedirs.append(os.path.join("include", "opencv4")) - self.cpp_info.components[conan_component].requires = requires - if self.settings.os == "Linux": - self.cpp_info.components[conan_component].system_libs = ["dl", "m", "pthread", "rt"] - - if self.settings.os == "Android": - self.cpp_info.components[conan_component].system_libs.append("log") - if int(str(self.settings.os.api_level)) > 20: - self.cpp_info.components[conan_component].system_libs.append("mediandk") - if conan_component == "opencv_core" and not self.options.shared: - lib_exclude_filter = "(opencv_|ippi|correspondence|multiview|numeric).*" - libs = list(filter(lambda x: not re.match(lib_exclude_filter, x), collect_libs(self))) - self.cpp_info.components[conan_component].libs += libs + module_requires = values.get("requires", []) + module_system_libs = [] + for _condition, _system_libs in values.get("system_libs", []): + if _condition: + module_system_libs.extend(_system_libs) + module_frameworks = [] + for _condition, _frameworks in values.get("frameworks", []): + if _condition: + module_frameworks.extend(_frameworks) + + if self.options.world and values.get("is_part_of_world", True): + self.cpp_info.components[conan_component].requires = ["opencv_world"] + world_requires.update(module_requires) + world_requires_exclude.add(conan_component) + world_system_libs.update(module_system_libs) + world_frameworks.update(module_frameworks) + else: + self.cpp_info.components[conan_component].libs = get_libs(module) + self.cpp_info.components[conan_component].requires = module_requires + self.cpp_info.components[conan_component].system_libs = module_system_libs + self.cpp_info.components[conan_component].frameworks = module_frameworks # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.components[conan_component].names["cmake_find_package"] = cmake_target self.cpp_info.components[conan_component].names["cmake_find_package_multi"] = cmake_target - self.cpp_info.components[conan_component].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components[conan_component].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - if cmake_component != cmake_target: + self.cpp_info.components[conan_component].build_modules["cmake_find_package"] = [self._module_vars_rel_path, self._module_target_rel_path] + self.cpp_info.components[conan_component].build_modules["cmake_find_package_multi"] = [self._module_vars_rel_path, self._module_target_rel_path] + if module != cmake_target: conan_component_alias = conan_component + "_alias" - self.cpp_info.components[conan_component_alias].names["cmake_find_package"] = cmake_component - self.cpp_info.components[conan_component_alias].names["cmake_find_package_multi"] = cmake_component + self.cpp_info.components[conan_component_alias].names["cmake_find_package"] = module + self.cpp_info.components[conan_component_alias].names["cmake_find_package_multi"] = module self.cpp_info.components[conan_component_alias].requires = [conan_component] self.cpp_info.components[conan_component_alias].bindirs = [] self.cpp_info.components[conan_component_alias].includedirs = [] self.cpp_info.components[conan_component_alias].libdirs = [] - self.cpp_info.set_property("cmake_file_name", "OpenCV") + if self.options.world: + self.cpp_info.components["opencv_world"].requires = list(world_requires - world_requires_exclude) + self.cpp_info.components["opencv_world"].system_libs = list(world_system_libs) + self.cpp_info.components["opencv_world"].frameworks = list(world_frameworks) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["opencv_world"].build_modules["cmake_find_package"] = [self._module_vars_rel_path, self._module_target_rel_path] + self.cpp_info.components["opencv_world"].build_modules["cmake_find_package_multi"] = [self._module_vars_rel_path, self._module_target_rel_path] - add_components(self._opencv_components) + self.cpp_info.set_property("cmake_file_name", "OpenCV") + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path]) - if self.settings.os == "Windows": - self.cpp_info.components["opencv_highgui"].system_libs = ["comctl32", "gdi32", "ole32", "setupapi", "ws2_32", "vfw32"] - elif self.settings.os == "Macos": - self.cpp_info.components["opencv_highgui"].frameworks = ["Cocoa"] - self.cpp_info.components["opencv_videoio"].frameworks = ["Cocoa", "Accelerate", "AVFoundation", "CoreGraphics", "CoreMedia", "CoreVideo", "QuartzCore"] - elif self.settings.os == "iOS": - self.cpp_info.components["opencv_videoio"].frameworks = ["AVFoundation", "QuartzCore"] + add_components(self._opencv_modules) # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "OpenCV" diff --git a/recipes/opencv/4.x/patches/4.1.2-0005-tracking-no-plot-deps.patch b/recipes/opencv/4.x/patches/4.1.2-0005-tracking-no-plot-deps.patch new file mode 100644 index 00000000000000..91130587911100 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.1.2-0005-tracking-no-plot-deps.patch @@ -0,0 +1,7 @@ +--- a/contrib/modules/tracking/CMakeLists.txt ++++ b/contrib/modules/tracking/CMakeLists.txt +@@ -1,3 +1,3 @@ + set(the_description "Tracking API") +-ocv_define_module(tracking opencv_imgproc opencv_core opencv_video opencv_plot OPTIONAL opencv_dnn opencv_datasets WRAP java python) ++ocv_define_module(tracking opencv_imgproc opencv_core opencv_video OPTIONAL opencv_plot opencv_dnn opencv_datasets WRAP java python) + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-shadow /wd4458) diff --git a/recipes/opencv/4.x/patches/4.1.2-0006-hdf.patch b/recipes/opencv/4.x/patches/4.1.2-0006-hdf.patch new file mode 100644 index 00000000000000..29f4b36e65dc27 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.1.2-0006-hdf.patch @@ -0,0 +1,21 @@ +--- a/contrib/modules/hdf/CMakeLists.txt ++++ b/contrib/modules/hdf/CMakeLists.txt +@@ -1,6 +1,4 @@ +-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}) +- +-if(WIN32) ++if(0) + # windows cmake internal lookups are broken for now + # will lookup for headers and shared libs given HDF_DIR env + find_path(HDF5_INCLUDE_DIRS hdf5.h HINTS "$ENV{HDF5_DIR}\\..\\include") +@@ -16,8 +14,8 @@ if(WIN32) + set(HDF5_FOUND "NO") + endif() + else() +- if(NOT CMAKE_CROSSCOMPILING) # iOS build should not reuse OSX package +- find_package(HDF5) ++ if(1) ++ find_package(HDF5 CONFIG) + endif() + endif() + diff --git a/recipes/opencv/4.x/patches/4.1.2-0008-link-qt-targets.patch b/recipes/opencv/4.x/patches/4.1.2-0008-link-qt-targets.patch new file mode 100644 index 00000000000000..b32a2916816cb7 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.1.2-0008-link-qt-targets.patch @@ -0,0 +1,29 @@ +--- a/contrib/modules/cvv/CMakeLists.txt ++++ b/contrib/modules/cvv/CMakeLists.txt +@@ -14,7 +14,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) + foreach(dt5_dep Core Gui Widgets) + add_definitions(${Qt5${dt5_dep}_DEFINITIONS}) + include_directories(${Qt5${dt5_dep}_INCLUDE_DIRS}) +- list(APPEND CVV_LIBRARIES ${Qt5${dt5_dep}_LIBRARIES}) ++ list(APPEND CVV_LIBRARIES Qt5::${dt5_dep}) + endforeach() + + ocv_glob_module_sources() +--- a/modules/highgui/CMakeLists.txt ++++ b/modules/highgui/CMakeLists.txt +@@ -58,13 +58,13 @@ if(HAVE_QT5) + foreach(dt5_dep Core Gui Widgets Test Concurrent) + add_definitions(${Qt5${dt5_dep}_DEFINITIONS}) + include_directories(${Qt5${dt5_dep}_INCLUDE_DIRS}) +- list(APPEND HIGHGUI_LIBRARIES ${Qt5${dt5_dep}_LIBRARIES}) ++ list(APPEND HIGHGUI_LIBRARIES Qt5::${dt5_dep}) + endforeach() + + if(HAVE_QT_OPENGL) + add_definitions(${Qt5OpenGL_DEFINITIONS}) + include_directories(${Qt5OpenGL_INCLUDE_DIRS}) +- list(APPEND HIGHGUI_LIBRARIES ${Qt5OpenGL_LIBRARIES}) ++ list(APPEND HIGHGUI_LIBRARIES Qt5::OpenGL) + endif() + + elseif(HAVE_QT) diff --git a/recipes/opencv/4.x/patches/4.1.2-0009-sfm-deps.patch b/recipes/opencv/4.x/patches/4.1.2-0009-sfm-deps.patch new file mode 100644 index 00000000000000..c4ff008107555d --- /dev/null +++ b/recipes/opencv/4.x/patches/4.1.2-0009-sfm-deps.patch @@ -0,0 +1,49 @@ +--- a/contrib/modules/sfm/CMakeLists.txt ++++ b/contrib/modules/sfm/CMakeLists.txt +@@ -9,8 +9,14 @@ find_package(Ceres QUIET) + if(NOT Ceres_FOUND) # Looks like Ceres find glog on the own, so separate search isn't necessary + find_package(Glog QUIET) + endif() ++if(NOT GFLAGS_LIBRARIES AND TARGET gflags::gflags) ++ set(GFLAGS_LIBRARIES gflags::gflags) ++endif() ++if(NOT GLOG_LIBRARIES AND TARGET glog::glog) ++ set(GLOG_LIBRARIES glog::glog) ++endif() + +-if((gflags_FOUND OR GFLAGS_FOUND OR GFLAGS_INCLUDE_DIRS) AND (glog_FOUND OR GLOG_FOUND OR GLOG_INCLUDE_DIRS)) ++if(0) + set(_fname "${CMAKE_CURRENT_BINARY_DIR}/test_sfm_deps.cpp") + file(WRITE "${_fname}" "#include \n#include \nint main() { (void)(0); return 0; }\n") + try_compile(SFM_DEPS_OK "${CMAKE_BINARY_DIR}" "${_fname}" +@@ -21,7 +27,7 @@ if((gflags_FOUND OR GFLAGS_FOUND OR GFLAGS_INCLUDE_DIRS) AND (glog_FOUND OR GLOG + file(REMOVE "${_fname}") + message(STATUS "Checking SFM deps... ${SFM_DEPS_OK}") + else() +- set(SFM_DEPS_OK FALSE) ++ set(SFM_DEPS_OK TRUE) + endif() + + if(NOT HAVE_EIGEN OR NOT SFM_DEPS_OK) +--- a/contrib/modules/sfm/src/libmv_light/libmv/correspondence/CMakeLists.txt ++++ b/contrib/modules/sfm/src/libmv_light/libmv/correspondence/CMakeLists.txt +@@ -8,7 +8,7 @@ FILE(GLOB CORRESPONDENCE_HDRS *.h) + + ADD_LIBRARY(correspondence STATIC ${CORRESPONDENCE_SRC} ${CORRESPONDENCE_HDRS}) + +-TARGET_LINK_LIBRARIES(correspondence LINK_PRIVATE ${GLOG_LIBRARY} multiview) ++TARGET_LINK_LIBRARIES(correspondence LINK_PRIVATE ${GLOG_LIBRARIES} multiview) + IF(TARGET Eigen3::Eigen) + TARGET_LINK_LIBRARIES(correspondence LINK_PUBLIC Eigen3::Eigen) + ENDIF() +--- a/contrib/modules/sfm/src/libmv_light/libmv/multiview/CMakeLists.txt ++++ b/contrib/modules/sfm/src/libmv_light/libmv/multiview/CMakeLists.txt +@@ -17,7 +17,7 @@ SET(MULTIVIEW_SRC conditioning.cc + FILE(GLOB MULTIVIEW_HDRS *.h) + + ADD_LIBRARY(multiview STATIC ${MULTIVIEW_SRC} ${MULTIVIEW_HDRS}) +-TARGET_LINK_LIBRARIES(multiview LINK_PRIVATE ${GLOG_LIBRARY} numeric) ++TARGET_LINK_LIBRARIES(multiview LINK_PRIVATE ${GLOG_LIBRARIES} numeric) + IF(TARGET Eigen3::Eigen) + TARGET_LINK_LIBRARIES(multiview LINK_PUBLIC Eigen3::Eigen) + ENDIF() diff --git a/recipes/opencv/4.x/patches/4.1.2-0010-compat-protobuf-ge-3.18.patch b/recipes/opencv/4.x/patches/4.1.2-0010-compat-protobuf-ge-3.18.patch new file mode 100644 index 00000000000000..5bd6bfd1b3816e --- /dev/null +++ b/recipes/opencv/4.x/patches/4.1.2-0010-compat-protobuf-ge-3.18.patch @@ -0,0 +1,22 @@ +--- a/modules/dnn/src/caffe/caffe_io.cpp ++++ b/modules/dnn/src/caffe/caffe_io.cpp +@@ -92,6 +92,7 @@ + #ifdef HAVE_PROTOBUF + #include + #include ++#include + #include + + #include +@@ -1111,7 +1112,11 @@ static const int kProtoReadBytesLimit = INT_MAX; // Max size of 2 GB minus 1 by + + bool ReadProtoFromBinary(ZeroCopyInputStream* input, Message *proto) { + CodedInputStream coded_input(input); ++#if GOOGLE_PROTOBUF_VERSION >= 3006000 ++ coded_input.SetTotalBytesLimit(kProtoReadBytesLimit); ++#else + coded_input.SetTotalBytesLimit(kProtoReadBytesLimit, 536870912); ++#endif + + return proto->ParseFromCodedStream(&coded_input); + } diff --git a/recipes/opencv/4.x/patches/4.1.2-0011-compat-openexr3.patch b/recipes/opencv/4.x/patches/4.1.2-0011-compat-openexr3.patch new file mode 100644 index 00000000000000..3854d36a913a06 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.1.2-0011-compat-openexr3.patch @@ -0,0 +1,10 @@ +--- a/modules/imgcodecs/src/grfmt_exr.cpp ++++ b/modules/imgcodecs/src/grfmt_exr.cpp +@@ -56,6 +56,7 @@ + #include + #include + ++#include + #include + #include + #include diff --git a/recipes/opencv/4.x/patches/4.5.1-0001-tracking-no-plot-deps.patch b/recipes/opencv/4.x/patches/4.5.1-0001-tracking-no-plot-deps.patch new file mode 100644 index 00000000000000..6e57a96b98355c --- /dev/null +++ b/recipes/opencv/4.x/patches/4.5.1-0001-tracking-no-plot-deps.patch @@ -0,0 +1,13 @@ +--- a/contrib/modules/tracking/CMakeLists.txt ++++ b/contrib/modules/tracking/CMakeLists.txt +@@ -9,9 +9,9 @@ ocv_define_module(tracking + opencv_imgproc + opencv_core + opencv_video +- opencv_plot # samples only + ${debug_modules} + OPTIONAL ++ opencv_plot + opencv_dnn + opencv_datasets + opencv_highgui diff --git a/recipes/opencv/4.x/patches/4.5.1-0002-alphamat-header.patch b/recipes/opencv/4.x/patches/4.5.1-0002-alphamat-header.patch new file mode 100644 index 00000000000000..847eeaa9e98695 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.5.1-0002-alphamat-header.patch @@ -0,0 +1,11 @@ +--- a/contrib/modules/alphamat/include/opencv2/alphamat.hpp ++++ b/contrib/modules/alphamat/include/opencv2/alphamat.hpp +@@ -7,6 +7,8 @@ + #ifndef _OPENCV_ALPHAMAT_HPP_ + #define _OPENCV_ALPHAMAT_HPP_ + ++#include ++ + /** + * @defgroup alphamat Alpha Matting + * Alpha matting is used to extract a foreground object with soft boundaries from a background image. diff --git a/recipes/opencv/4.x/patches/4.5.3-0002-link-qt-targets.patch b/recipes/opencv/4.x/patches/4.5.3-0002-link-qt-targets.patch new file mode 100644 index 00000000000000..b9b34a95156fe0 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.5.3-0002-link-qt-targets.patch @@ -0,0 +1,30 @@ +--- a/contrib/modules/cvv/CMakeLists.txt ++++ b/contrib/modules/cvv/CMakeLists.txt +@@ -14,7 +14,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) + foreach(dt5_dep Core Gui Widgets) + add_definitions(${Qt5${dt5_dep}_DEFINITIONS}) + include_directories(${Qt5${dt5_dep}_INCLUDE_DIRS}) +- list(APPEND CVV_LIBRARIES ${Qt5${dt5_dep}_LIBRARIES}) ++ list(APPEND CVV_LIBRARIES Qt5::${dt5_dep}) + endforeach() + + ocv_glob_module_sources() +--- a/modules/highgui/CMakeLists.txt ++++ b/modules/highgui/CMakeLists.txt +@@ -69,14 +69,14 @@ if(HAVE_QT5) + foreach(dt5_dep Core Gui Widgets Test Concurrent) + add_definitions(${Qt5${dt5_dep}_DEFINITIONS}) + include_directories(${Qt5${dt5_dep}_INCLUDE_DIRS}) +- list(APPEND HIGHGUI_LIBRARIES ${Qt5${dt5_dep}_LIBRARIES}) ++ list(APPEND HIGHGUI_LIBRARIES Qt5::${dt5_dep}) + endforeach() + + if(HAVE_QT_OPENGL) + add_definitions(-DHAVE_QT_OPENGL) + add_definitions(${Qt5OpenGL_DEFINITIONS}) + include_directories(${Qt5OpenGL_INCLUDE_DIRS}) +- list(APPEND HIGHGUI_LIBRARIES ${Qt5OpenGL_LIBRARIES}) ++ list(APPEND HIGHGUI_LIBRARIES Qt5::OpenGL) + endif() + elseif(HAVE_QT) + set(OPENCV_HIGHGUI_BUILTIN_BACKEND "QT4") diff --git a/recipes/opencv/4.x/patches/4.5.5-0002-objdetect-without-dnn.patch b/recipes/opencv/4.x/patches/4.5.5-0002-objdetect-without-dnn.patch new file mode 100644 index 00000000000000..5313e7b762001f --- /dev/null +++ b/recipes/opencv/4.x/patches/4.5.5-0002-objdetect-without-dnn.patch @@ -0,0 +1,97 @@ +--- a/modules/objdetect/CMakeLists.txt ++++ b/modules/objdetect/CMakeLists.txt +@@ -1,5 +1,16 @@ + set(the_description "Object Detection") +-ocv_define_module(objdetect opencv_core opencv_imgproc opencv_calib3d opencv_dnn WRAP java objc python js) ++ocv_define_module(objdetect ++ opencv_core ++ opencv_imgproc ++ opencv_calib3d ++ OPTIONAL ++ opencv_dnn ++ WRAP ++ python ++ java ++ objc ++ js ++) + + if(HAVE_QUIRC) + get_property(QUIRC_INCLUDE GLOBAL PROPERTY QUIRC_INCLUDE_DIR) +--- a/modules/objdetect/src/face_detect.cpp ++++ b/modules/objdetect/src/face_detect.cpp +@@ -6,13 +6,16 @@ + + #include "opencv2/imgproc.hpp" + #include "opencv2/core.hpp" ++#ifdef HAVE_OPENCV_DNN + #include "opencv2/dnn.hpp" ++#endif + + #include + + namespace cv + { + ++#ifdef HAVE_OPENCV_DNN + class FaceDetectorYNImpl : public FaceDetectorYN + { + public: +@@ -273,6 +276,7 @@ class FaceDetectorYNImpl : public FaceDetectorYN + + std::vector priors; + }; ++#endif + + Ptr FaceDetectorYN::create(const String& model, + const String& config, +@@ -283,7 +287,12 @@ Ptr FaceDetectorYN::create(const String& model, + const int backend_id, + const int target_id) + { ++#ifdef HAVE_OPENCV_DNN + return makePtr(model, config, input_size, score_threshold, nms_threshold, top_k, backend_id, target_id); ++#else ++ CV_UNUSED(model); CV_UNUSED(config); CV_UNUSED(input_size); CV_UNUSED(score_threshold); CV_UNUSED(nms_threshold); CV_UNUSED(top_k); CV_UNUSED(backend_id); CV_UNUSED(target_id); ++ CV_Error(cv::Error::StsNotImplemented, "cv::FaceDetectorYN requires enabled 'dnn' module."); ++#endif + } + + } // namespace cv +--- a/modules/objdetect/src/face_recognize.cpp ++++ b/modules/objdetect/src/face_recognize.cpp +@@ -4,13 +4,17 @@ + + #include "precomp.hpp" + ++#include "opencv2/core.hpp" ++#ifdef HAVE_OPENCV_DNN + #include "opencv2/dnn.hpp" ++#endif + + #include + + namespace cv + { + ++#ifdef HAVE_OPENCV_DNN + class FaceRecognizerSFImpl : public FaceRecognizerSF + { + public: +@@ -173,10 +177,16 @@ class FaceRecognizerSFImpl : public FaceRecognizerSF + private: + dnn::Net net; + }; ++#endif + + Ptr FaceRecognizerSF::create(const String& model, const String& config, int backend_id, int target_id) + { ++#ifdef HAVE_OPENCV_DNN + return makePtr(model, config, backend_id, target_id); ++#else ++ CV_UNUSED(model); CV_UNUSED(config); CV_UNUSED(backend_id); CV_UNUSED(target_id); ++ CV_Error(cv::Error::StsNotImplemented, "cv::FaceRecognizerSF requires enabled 'dnn' module"); ++#endif + } + + } // namespace cv diff --git a/recipes/opencv/4.x/patches/4.5.5-0003-find-quirc.patch b/recipes/opencv/4.x/patches/4.5.5-0003-find-quirc.patch new file mode 100644 index 00000000000000..e53df28368b3b1 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.5.5-0003-find-quirc.patch @@ -0,0 +1,12 @@ +--- a/modules/objdetect/CMakeLists.txt ++++ b/modules/objdetect/CMakeLists.txt +@@ -13,7 +13,6 @@ ocv_define_module(objdetect + ) + + if(HAVE_QUIRC) +- get_property(QUIRC_INCLUDE GLOBAL PROPERTY QUIRC_INCLUDE_DIR) +- ocv_include_directories(${QUIRC_INCLUDE}) +- ocv_target_link_libraries(${the_module} quirc) ++ find_package(quirc REQUIRED CONFIG) ++ ocv_target_link_libraries(${the_module} quirc::quirc) + endif() diff --git a/recipes/opencv/4.x/patches/4.5.5-0004-link-qt-targets.patch b/recipes/opencv/4.x/patches/4.5.5-0004-link-qt-targets.patch new file mode 100644 index 00000000000000..4c497271a4d6a6 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.5.5-0004-link-qt-targets.patch @@ -0,0 +1,22 @@ +--- a/contrib/modules/cvv/CMakeLists.txt ++++ b/contrib/modules/cvv/CMakeLists.txt +@@ -14,7 +14,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) + foreach(dt5_dep Core Gui Widgets) + add_definitions(${Qt5${dt5_dep}_DEFINITIONS}) + include_directories(${Qt5${dt5_dep}_INCLUDE_DIRS}) +- list(APPEND CVV_LIBRARIES ${Qt5${dt5_dep}_LIBRARIES}) ++ list(APPEND CVV_LIBRARIES Qt5::${dt5_dep}) + endforeach() + + ocv_glob_module_sources() +--- a/modules/highgui/CMakeLists.txt ++++ b/modules/highgui/CMakeLists.txt +@@ -89,7 +89,7 @@ if(HAVE_QT) + foreach(dt_dep ${qt_deps}) + add_definitions(${Qt${QT_VERSION_MAJOR}${dt_dep}_DEFINITIONS}) + include_directories(${Qt${QT_VERSION_MAJOR}${dt_dep}_INCLUDE_DIRS}) +- list(APPEND HIGHGUI_LIBRARIES ${Qt${QT_VERSION_MAJOR}${dt_dep}_LIBRARIES}) ++ list(APPEND HIGHGUI_LIBRARIES Qt${QT_VERSION_MAJOR}::${dt_dep}) + endforeach() + else() + ocv_assert(QT_VERSION_MAJOR EQUAL 4) 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/4.x/test_package/CMakeLists.txt b/recipes/opencv/4.x/test_package/CMakeLists.txt index e49280ad955c0b..5404f6ff239151 100644 --- a/recipes/opencv/4.x/test_package/CMakeLists.txt +++ b/recipes/opencv/4.x/test_package/CMakeLists.txt @@ -1,32 +1,33 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -option(built_dnn "Enabled if opencv is built dnn" OFF) -option(built_with_ade "Enabled if opencv is built with ade" OFF) -option(built_with_ffmpeg "Enabled if opencv is built with ffmpeg" OFF) -option(built_contrib_sfm "Enabled if opencv is built contrib sfm" OFF) +enable_testing() -find_package(OpenCV REQUIRED imgcodecs highgui objdetect CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE - opencv_imgcodecs - opencv_highgui - opencv_objdetect - $ - $ - $ +set(TESTED_MODULES + # Main modules + "calib3d" "core" "dnn" "features2d" "flann" "gapi" "highgui" "imgcodecs" + "imgproc" "ml" "objdetect" "photo" "stitching" "video" "videoio" + # Extra modules + "alphamat" "aruco" "bgsegm" "bioinspired" "ccalib" "datasets" "dnn_superres" + "face" "freetype" "fuzzy" "hdf" "hfs" "img_hash" "intensity_transform" + "line_descriptor" "mcc" "optflow" "phase_unwrapping" "plot" "quality" "reg" + "rgbd" "saliency" "sfm" "shape" "structured_light" "superres" + "surface_matching" "text" "tracking" "wechat_qrcode" "xfeatures2d" + "ximgproc" "xobjdetect" "xphoto" ) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -if(built_dnn) - target_link_libraries(${PROJECT_NAME} PRIVATE opencv_dnn) -endif() -if(built_with_ade) - target_compile_definitions(${PROJECT_NAME} PRIVATE BUILT_WITH_ADE) -endif() -if(built_with_ffmpeg) - target_compile_definitions(${PROJECT_NAME} PRIVATE BUILT_WITH_FFMPEG) -endif() -if(built_contrib_sfm) - target_compile_definitions(${PROJECT_NAME} PRIVATE BUILT_CONTRIB_SFM) -endif() + +find_package(OpenCV REQUIRED core CONFIG) + +foreach(_module ${TESTED_MODULES}) + string(TOUPPER ${_module} _module_upper) + if(OPENCV_WITH_${_module_upper}) + set(_test_target test_${_module}) + set(_module_target opencv_${_module}) + add_executable(${_test_target} ${_test_target}.cpp) + target_link_libraries(${_test_target} PRIVATE ${_module_target}) + target_compile_features(${_test_target} PRIVATE cxx_std_11) + if(NOT ${_module} STREQUAL "highgui") + add_test(NAME ${_test_target} COMMAND ${_test_target}) + endif() + endif() +endforeach() diff --git a/recipes/opencv/4.x/test_package/conanfile.py b/recipes/opencv/4.x/test_package/conanfile.py index 5d9136c00ec0e7..e5b25fb84dd4bf 100644 --- a/recipes/opencv/4.x/test_package/conanfile.py +++ b/recipes/opencv/4.x/test_package/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile -from conan.tools.build import can_run +from conan.tools.build import build_jobs, can_run from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -import os +from conan.tools.files import chdir class TestPackageConan(ConanFile): @@ -9,6 +9,21 @@ class TestPackageConan(ConanFile): generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" + @property + def _tested_modules(self): + return [ + # Main modules + "calib3d", "core", "dnn", "features2d", "flann", "gapi", "highgui", "imgcodecs", + "imgproc", "ml", "objdetect", "photo", "stitching", "video", "videoio", + # Extra modules + "alphamat", "aruco", "bgsegm", "bioinspired", "ccalib", "datasets", "dnn_superres", + "face", "freetype", "fuzzy", "hdf", "hfs", "img_hash", "intensity_transform", + "line_descriptor", "mcc", "optflow", "phase_unwrapping", "plot", "quality", "reg", + "rgbd", "saliency", "sfm", "shape", "structured_light", "superres", + "surface_matching", "text", "tracking", "wechat_qrcode", "xfeatures2d", + "ximgproc", "xobjdetect", "xphoto", + ] + def layout(self): cmake_layout(self) @@ -17,10 +32,16 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["built_dnn"] = self.dependencies["opencv"].options.dnn - tc.variables["built_with_ade"] = self.dependencies["opencv"].options.with_ade - tc.variables["built_with_ffmpeg"] = self.dependencies["opencv"].options.with_ffmpeg - tc.variables["built_contrib_sfm"] = self.dependencies["opencv"].options.contrib and self.dependencies["opencv"].options.contrib_sfm + for module in self._tested_modules: + cmake_option = f"OPENCV_WITH_{module.upper()}" + if module == "core": + tc.variables[cmake_option] = True + elif module == "imgcodecs": + tc.variables[cmake_option] = self.dependencies["opencv"].options.imgcodecs and self.dependencies["opencv"].options.with_png + elif module == "videoio": + tc.variables[cmake_option] = self.dependencies["opencv"].options.videoio and self.dependencies["opencv"].options.with_ffmpeg + else: + tc.variables[cmake_option] = self.dependencies["opencv"].options.get_safe(module, False) tc.generate() def build(self): @@ -30,5 +51,5 @@ def build(self): 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") + with chdir(self, self.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/opencv/4.x/test_package/test_alphamat.cpp b/recipes/opencv/4.x/test_package/test_alphamat.cpp new file mode 100644 index 00000000000000..af8ea966d97159 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_alphamat.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() { + cv::Mat image = cv::Mat::ones(400, 400, CV_8UC3) * 50; + cv::Mat tmap = cv::Mat::ones(400, 400, CV_8U) * 120; + cv::Mat result; + cv::alphamat::infoFlow(image, tmap, result); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_aruco.cpp b/recipes/opencv/4.x/test_package/test_aruco.cpp new file mode 100644 index 00000000000000..bc510aeaf4b180 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_aruco.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() { + cv::Mat markerImage; + auto dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_6X6_250); + cv::aruco::drawMarker(dictionary, 23, 200, markerImage, 1); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_bgsegm.cpp b/recipes/opencv/4.x/test_package/test_bgsegm.cpp new file mode 100644 index 00000000000000..ba01af2fd18619 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_bgsegm.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto bkg_subtractor = cv::bgsegm::createBackgroundSubtractorCNT(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_bioinspired.cpp b/recipes/opencv/4.x/test_package/test_bioinspired.cpp new file mode 100644 index 00000000000000..219fc935596f3e --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_bioinspired.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto retina_tone_mapping = cv::bioinspired::RetinaFastToneMapping::create(cv::Size(10, 10)); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_calib3d.cpp b/recipes/opencv/4.x/test_package/test_calib3d.cpp new file mode 100644 index 00000000000000..ce5c7e8b7c8214 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_calib3d.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +int main() { + const int point_count = 100; + std::vector points1; + points1.reserve(point_count); + std::vector points2; + points2.reserve(point_count); + for (int i = 0; i < point_count; ++i) { + points1.emplace_back( + cv::Point2f(static_cast(100 + 30 * std::cos(i * CV_PI * 2 / 5)), + static_cast(100 - 30 * std::sin(i * CV_PI * 2 / 5))) + ); + points2.emplace_back( + cv::Point2f(static_cast(100 + 30 * std::sin(i * CV_PI * 2 / 5)), + static_cast(100 - 30 * std::cos(i * CV_PI * 2 / 5))) + ); + } + auto fundamental_matrix = cv::findFundamentalMat(points1, points2, cv::FM_RANSAC, 3, 0.99); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_ccalib.cpp b/recipes/opencv/4.x/test_package/test_ccalib.cpp new file mode 100644 index 00000000000000..079bcb7ba21ce6 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_ccalib.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + cv::randpattern::RandomPatternGenerator generator(50, 50); + generator.generatePattern(); + auto pattern = generator.getPattern(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_core.cpp b/recipes/opencv/4.x/test_package/test_core.cpp new file mode 100644 index 00000000000000..b9635e35d0fc8a --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_core.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + cv::Mat m = cv::Mat::zeros(400, 400, CV_8UC3); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_datasets.cpp b/recipes/opencv/4.x/test_package/test_datasets.cpp new file mode 100644 index 00000000000000..16c5eca1c92055 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_datasets.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto dataset = cv::datasets::AR_hmdb::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_dnn.cpp b/recipes/opencv/4.x/test_package/test_dnn.cpp new file mode 100644 index 00000000000000..3d8474fcdd230e --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_dnn.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto backends = cv::dnn::getAvailableBackends(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_dnn_superres.cpp b/recipes/opencv/4.x/test_package/test_dnn_superres.cpp new file mode 100644 index 00000000000000..bbe3442b46dc42 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_dnn_superres.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + cv::dnn_superres::DnnSuperResImpl dnn_superres_impl; + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_face.cpp b/recipes/opencv/4.x/test_package/test_face.cpp new file mode 100644 index 00000000000000..9e3953a255cc0f --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_face.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto face_recognizer = cv::face::FisherFaceRecognizer::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_features2d.cpp b/recipes/opencv/4.x/test_package/test_features2d.cpp new file mode 100644 index 00000000000000..2154a2126ebb1d --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_features2d.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto matcher = cv::DescriptorMatcher::create(cv::DescriptorMatcher::BRUTEFORCE); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_flann.cpp b/recipes/opencv/4.x/test_package/test_flann.cpp new file mode 100644 index 00000000000000..0461a2651192b4 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_flann.cpp @@ -0,0 +1,28 @@ +#include +#include + +#include +#include + +int main() { + const int point_count = 100; + std::vector points; + points.reserve(point_count); + for (int i = 0; i < point_count; ++i) { + points.emplace_back( + cv::Point2f(static_cast(100 + 30 * std::cos(i * CV_PI * 2 / 5)), + static_cast(100 - 30 * std::sin(i * CV_PI * 2 / 5))) + ); + } + + cv::flann::KDTreeIndexParams indexParams; + cv::flann::Index kdtree(cv::Mat(points).reshape(1), indexParams); + + std::vector query{110, 98}; + + std::vector indices; + std::vector dists; + kdtree.knnSearch(query, indices, dists, 3); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_freetype.cpp b/recipes/opencv/4.x/test_package/test_freetype.cpp new file mode 100644 index 00000000000000..49ee14c10ed6ab --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_freetype.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto ft2 = cv::freetype::createFreeType2(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_fuzzy.cpp b/recipes/opencv/4.x/test_package/test_fuzzy.cpp new file mode 100644 index 00000000000000..ad4485785acc47 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_fuzzy.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() { + cv::Mat image = cv::Mat::zeros(400, 400, CV_8UC3); + cv::Mat output; + cv::ft::FT02D_FL_process(image, 10, output); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_gapi.cpp b/recipes/opencv/4.x/test_package/test_gapi.cpp new file mode 100644 index 00000000000000..1894733df9580a --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_gapi.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +int main() { + // derived from https://docs.opencv.org/4.5.0/d0/d1e/gapi.html + cv::GMat in; + cv::GMat vga = cv::gapi::resize(in, cv::Size(), 0.5, 0.5); + cv::GMat gray = cv::gapi::BGR2Gray(vga); + cv::GMat blurred = cv::gapi::blur(gray, cv::Size(5,5)); + cv::GMat edges = cv::gapi::Canny(blurred, 32, 128, 3); + cv::GMat b,g,r; + std::tie(b,g,r) = cv::gapi::split3(vga); + cv::GMat out = cv::gapi::merge3(b, g | edges, r); + cv::GComputation ac(in, out); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_hdf.cpp b/recipes/opencv/4.x/test_package/test_hdf.cpp new file mode 100644 index 00000000000000..94d3e97ba46b4b --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_hdf.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto hdf5 = cv::hdf::open("test_package_hdf.h5"); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_hfs.cpp b/recipes/opencv/4.x/test_package/test_hfs.cpp new file mode 100644 index 00000000000000..8d5391b6b1421b --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_hfs.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto hfs_segment = cv::hfs::HfsSegment::create(100, 100); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_highgui.cpp b/recipes/opencv/4.x/test_package/test_highgui.cpp new file mode 100644 index 00000000000000..69025d66e0e23b --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_highgui.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() { + cv::Mat image = cv::Mat::zeros(400, 400, CV_8UC3); + cv::imshow("test highgui", image); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_img_hash.cpp b/recipes/opencv/4.x/test_package/test_img_hash.cpp new file mode 100644 index 00000000000000..73ca6849810923 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_img_hash.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() { + cv::Mat image = cv::Mat::zeros(400, 400, CV_8UC3); + auto func = cv::img_hash::AverageHash::create(); + cv::Mat hash; + func->compute(image, hash); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_imgcodecs.cpp b/recipes/opencv/4.x/test_package/test_imgcodecs.cpp new file mode 100644 index 00000000000000..909d28ae9465da --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_imgcodecs.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() { + cv::Mat img = cv::Mat::zeros(400, 400, CV_8UC3); + cv::imwrite("test_imgcodecs.png", img); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_imgproc.cpp b/recipes/opencv/4.x/test_package/test_imgproc.cpp new file mode 100644 index 00000000000000..23784d8f0a1b60 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_imgproc.cpp @@ -0,0 +1,14 @@ +#include +#include + +int main() { + const int width = 400; + cv::Mat image = cv::Mat::zeros(width, width, CV_8UC3); + + cv::ellipse( + image, cv::Point(width / 2, width / 2), cv::Size(width / 4, width / 16), + 90, 0, 360, cv::Scalar(255, 0, 0), 2, 8 + ); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_intensity_transform.cpp b/recipes/opencv/4.x/test_package/test_intensity_transform.cpp new file mode 100644 index 00000000000000..dce55e2e9e3a7a --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_intensity_transform.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() { + cv::Mat src_image = cv::Mat::zeros(400, 400, CV_8UC3); + cv::Mat dst_image; + cv::intensity_transform::autoscaling(src_image, dst_image); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_line_descriptor.cpp b/recipes/opencv/4.x/test_package/test_line_descriptor.cpp new file mode 100644 index 00000000000000..a9c8f66bb0d01e --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_line_descriptor.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto descriptor = cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_mcc.cpp b/recipes/opencv/4.x/test_package/test_mcc.cpp new file mode 100644 index 00000000000000..7b2647b223c4d0 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_mcc.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto checker_detector = cv::mcc::CCheckerDetector::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_ml.cpp b/recipes/opencv/4.x/test_package/test_ml.cpp new file mode 100644 index 00000000000000..e53dbd4cf97eec --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_ml.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto dtrees = cv::ml::DTrees::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_objdetect.cpp b/recipes/opencv/4.x/test_package/test_objdetect.cpp new file mode 100644 index 00000000000000..2533cbb506d597 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_objdetect.cpp @@ -0,0 +1,17 @@ +#include +#include + +#include + +int main() { + std::vector rectangles; + rectangles.reserve(100); + for (int i = 0; i < 10; ++i) { + for (int j = 0; j < 10; ++j) { + rectangles.emplace_back(cv::Rect(10 * i, 5 * (i + j), 2, 3)); + } + } + cv::groupRectangles(rectangles, 2); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_optflow.cpp b/recipes/opencv/4.x/test_package/test_optflow.cpp new file mode 100644 index 00000000000000..f7ef8c92b736e2 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_optflow.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + auto tree = cv::optflow::GPCTree::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_package.cpp b/recipes/opencv/4.x/test_package/test_package.cpp deleted file mode 100644 index 220a68d7c84b1b..00000000000000 --- a/recipes/opencv/4.x/test_package/test_package.cpp +++ /dev/null @@ -1,235 +0,0 @@ -// Test file borrowed from OpenCV tutorial: https://docs.opencv.org/master/d3/d96/tutorial_basic_geometric_drawing.html - -/** - * @file Drawing_1.cpp - * @brief Simple geometric drawing - * @author OpenCV team - */ -#include -#include -#ifdef BUILT_WITH_ADE -#include -#include -#include -#endif -#ifdef BUILT_WITH_FFMPEG -#include -#include -#endif -#ifdef BUILT_CONTRIB_SFM -#include -#endif - -#define w 400 - -using namespace cv; - -/// Function headers -void MyEllipse( Mat img, double angle ); -void MyFilledCircle( Mat img, Point center ); -void MyPolygon( Mat img ); -void MyLine( Mat img, Point start, Point end ); -// to test `with_ade` option -void TestGAPI(); -void TestVideo(); -void TestSFM(); - -/** - * @function main - * @brief Main function - */ -int main( void ){ - - //![create_images] - /// Windows names - char atom_window[] = "Drawing 1: Atom"; - char rook_window[] = "Drawing 2: Rook"; - - /// Create black empty images - Mat atom_image = Mat::zeros( w, w, CV_8UC3 ); - Mat rook_image = Mat::zeros( w, w, CV_8UC3 ); - //![create_images] - - /// 1. Draw a simple atom: - /// ----------------------- - - //![draw_atom] - /// 1.a. Creating ellipses - MyEllipse( atom_image, 90 ); - MyEllipse( atom_image, 0 ); - MyEllipse( atom_image, 45 ); - MyEllipse( atom_image, -45 ); - - /// 1.b. Creating circles - MyFilledCircle( atom_image, Point( w/2, w/2) ); - //![draw_atom] - - /// 2. Draw a rook - /// ------------------ - - //![draw_rook] - /// 2.a. Create a convex polygon - MyPolygon( rook_image ); - - //![rectangle] - /// 2.b. Creating rectangles - rectangle( rook_image, - Point( 0, 7*w/8 ), - Point( w, w), - Scalar( 0, 255, 255 ), - FILLED, - LINE_8 ); - //![rectangle] - - /// 2.c. Create a few lines - MyLine( rook_image, Point( 0, 15*w/16 ), Point( w, 15*w/16 ) ); - MyLine( rook_image, Point( w/4, 7*w/8 ), Point( w/4, w ) ); - MyLine( rook_image, Point( w/2, 7*w/8 ), Point( w/2, w ) ); - MyLine( rook_image, Point( 3*w/4, 7*w/8 ), Point( 3*w/4, w ) ); - //![draw_rook] - TestGAPI(); - TestVideo(); - TestSFM(); - - return(0); -} - -/// Function Declaration - -/** - * @function MyEllipse - * @brief Draw a fixed-size ellipse with different angles - */ -//![my_ellipse] -void MyEllipse( Mat img, double angle ) -{ - int thickness = 2; - int lineType = 8; - - ellipse( img, - Point( w/2, w/2 ), - Size( w/4, w/16 ), - angle, - 0, - 360, - Scalar( 255, 0, 0 ), - thickness, - lineType ); -} -//![my_ellipse] - -/** - * @function MyFilledCircle - * @brief Draw a fixed-size filled circle - */ -//![my_filled_circle] -void MyFilledCircle( Mat img, Point center ) -{ - circle( img, - center, - w/32, - Scalar( 0, 0, 255 ), - FILLED, - LINE_8 ); -} -//![my_filled_circle] - -/** - * @function MyPolygon - * @brief Draw a simple concave polygon (rook) - */ -//![my_polygon] -void MyPolygon( Mat img ) -{ - int lineType = LINE_8; - - /** Create some points */ - Point rook_points[1][20]; - rook_points[0][0] = Point( w/4, 7*w/8 ); - rook_points[0][1] = Point( 3*w/4, 7*w/8 ); - rook_points[0][2] = Point( 3*w/4, 13*w/16 ); - rook_points[0][3] = Point( 11*w/16, 13*w/16 ); - rook_points[0][4] = Point( 19*w/32, 3*w/8 ); - rook_points[0][5] = Point( 3*w/4, 3*w/8 ); - rook_points[0][6] = Point( 3*w/4, w/8 ); - rook_points[0][7] = Point( 26*w/40, w/8 ); - rook_points[0][8] = Point( 26*w/40, w/4 ); - rook_points[0][9] = Point( 22*w/40, w/4 ); - rook_points[0][10] = Point( 22*w/40, w/8 ); - rook_points[0][11] = Point( 18*w/40, w/8 ); - rook_points[0][12] = Point( 18*w/40, w/4 ); - rook_points[0][13] = Point( 14*w/40, w/4 ); - rook_points[0][14] = Point( 14*w/40, w/8 ); - rook_points[0][15] = Point( w/4, w/8 ); - rook_points[0][16] = Point( w/4, 3*w/8 ); - rook_points[0][17] = Point( 13*w/32, 3*w/8 ); - rook_points[0][18] = Point( 5*w/16, 13*w/16 ); - rook_points[0][19] = Point( w/4, 13*w/16 ); - - const Point* ppt[1] = { rook_points[0] }; - int npt[] = { 20 }; - - fillPoly( img, - ppt, - npt, - 1, - Scalar( 255, 255, 255 ), - lineType ); -} -//![my_polygon] - -/** - * @function MyLine - * @brief Draw a simple line - */ -//![my_line] -void MyLine( Mat img, Point start, Point end ) -{ - int thickness = 2; - int lineType = LINE_8; - - line( img, - start, - end, - Scalar( 0, 0, 0 ), - thickness, - lineType ); -} -//![my_line] - -/** - * @function TestGAPI - @brief to test `with_ade` - derived from https://docs.opencv.org/4.5.0/d0/d1e/gapi.html -*/ -void TestGAPI() -{ -#ifdef BUILT_WITH_ADE - cv::GMat in; - cv::GMat vga = cv::gapi::resize(in, cv::Size(), 0.5, 0.5); - cv::GMat gray = cv::gapi::BGR2Gray(vga); - cv::GMat blurred = cv::gapi::blur(gray, cv::Size(5,5)); - cv::GMat edges = cv::gapi::Canny(blurred, 32, 128, 3); - cv::GMat b,g,r; - std::tie(b,g,r) = cv::gapi::split3(vga); - cv::GMat out = cv::gapi::merge3(b, g | edges, r); - cv::GComputation ac(in, out); -#endif -} - -void TestVideo() -{ -#ifdef BUILT_WITH_FFMPEG - if (!videoio_registry::hasBackend(CAP_FFMPEG)) - throw std::runtime_error("FFmpeg backend was not found"); -#endif -} - -void TestSFM() -{ -#ifdef BUILT_CONTRIB_SFM - Vec3f a; - a << 1,2,3; - Matx33f ax = sfm::skew(a); -#endif -} diff --git a/recipes/opencv/4.x/test_package/test_phase_unwrapping.cpp b/recipes/opencv/4.x/test_package/test_phase_unwrapping.cpp new file mode 100644 index 00000000000000..d8863b429ecd49 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_phase_unwrapping.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto histogram_phase_unwrapping = cv::phase_unwrapping::HistogramPhaseUnwrapping::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_photo.cpp b/recipes/opencv/4.x/test_package/test_photo.cpp new file mode 100644 index 00000000000000..4a94f1b4c0c8fc --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_photo.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() { + auto src_image = cv::Mat::zeros(400, 400, CV_8UC3); + cv::Mat dst_image; + cv::fastNlMeansDenoising(src_image, dst_image); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_plot.cpp b/recipes/opencv/4.x/test_package/test_plot.cpp new file mode 100644 index 00000000000000..40dc21023a5fca --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_plot.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main() { + cv::Mat xData; + xData.create(1, 100, CV_64F); + for (int i = 0; i < 100; ++i) { + xData.at(i) = i / 10.0; + } + auto plot = cv::plot::Plot2d::create(xData); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_quality.cpp b/recipes/opencv/4.x/test_package/test_quality.cpp new file mode 100644 index 00000000000000..75faaa7e15666b --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_quality.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() { + cv::Mat image = cv::Mat::ones(10, 10, CV_8UC3) * 40; + auto quality_mse = cv::quality::QualityMSE::create(image); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_reg.cpp b/recipes/opencv/4.x/test_package/test_reg.cpp new file mode 100644 index 00000000000000..26957e3fa333bf --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_reg.cpp @@ -0,0 +1,9 @@ +#include + +int main() { + cv::reg::MapProjec map; + map.scale(5.5); + map.inverseMap(); + map.normalize(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_rgbd.cpp b/recipes/opencv/4.x/test_package/test_rgbd.cpp new file mode 100644 index 00000000000000..f4c2a3c31ec3bb --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_rgbd.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + auto depth_cleaner = cv::rgbd::DepthCleaner::create(5); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_saliency.cpp b/recipes/opencv/4.x/test_package/test_saliency.cpp new file mode 100644 index 00000000000000..c3938011335b0b --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_saliency.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto objectness_bing = cv::saliency::ObjectnessBING::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_sfm.cpp b/recipes/opencv/4.x/test_package/test_sfm.cpp new file mode 100644 index 00000000000000..e4b4bacb2a25a0 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_sfm.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() { + cv::Vec3f a; + a << 1,2,3; + cv::Matx33f ax = cv::sfm::skew(a); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_shape.cpp b/recipes/opencv/4.x/test_package/test_shape.cpp new file mode 100644 index 00000000000000..ef5e9500abe479 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_shape.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto extractor = cv::createChiHistogramCostExtractor(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_stitching.cpp b/recipes/opencv/4.x/test_package/test_stitching.cpp new file mode 100644 index 00000000000000..8a445823efb350 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_stitching.cpp @@ -0,0 +1,13 @@ +#include +#include + +int main() { + cv::Rect roi; + bool overlap = cv::detail::overlapRoi( + cv::Point2f(2, 3), cv::Point2f(4, -3), + cv::Size(10, 10), cv::Size(3, 4), + roi + ); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_structured_light.cpp b/recipes/opencv/4.x/test_package/test_structured_light.cpp new file mode 100644 index 00000000000000..d6f0b0661cdba5 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_structured_light.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto pattern = cv::structured_light::GrayCodePattern::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_superres.cpp b/recipes/opencv/4.x/test_package/test_superres.cpp new file mode 100644 index 00000000000000..70097500036ec7 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_superres.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto frame_source = cv::superres::createFrameSource_Empty(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_surface_matching.cpp b/recipes/opencv/4.x/test_package/test_surface_matching.cpp new file mode 100644 index 00000000000000..3a215084288be3 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_surface_matching.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + cv::ppf_match_3d::PPF3DDetector detector(0.03, 0.05); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_text.cpp b/recipes/opencv/4.x/test_package/test_text.cpp new file mode 100644 index 00000000000000..1c8dbed4b8ea28 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_text.cpp @@ -0,0 +1,11 @@ +#include +#include + +#include + +int main() { + cv::Mat image = cv::Mat::zeros(10, 10, CV_8UC3); + std::vector channels; + cv::text::computeNMChannels(image, channels); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_tracking.cpp b/recipes/opencv/4.x/test_package/test_tracking.cpp new file mode 100644 index 00000000000000..69efe349df2226 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_tracking.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto kcf_tracker = cv::TrackerKCF::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_video.cpp b/recipes/opencv/4.x/test_package/test_video.cpp new file mode 100644 index 00000000000000..09a4342add1a12 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_video.cpp @@ -0,0 +1,7 @@ +#include + +int main() { + auto bkg_subtractor_knn = cv::createBackgroundSubtractorKNN(); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_videoio.cpp b/recipes/opencv/4.x/test_package/test_videoio.cpp new file mode 100644 index 00000000000000..7b0955e888a065 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_videoio.cpp @@ -0,0 +1,11 @@ +#include +#include + +#include + +int main() { + if (!cv::videoio_registry::hasBackend(cv::CAP_FFMPEG)) + throw std::runtime_error("FFmpeg backend was not found"); + + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_wechat_qrcode.cpp b/recipes/opencv/4.x/test_package/test_wechat_qrcode.cpp new file mode 100644 index 00000000000000..6dce15eeb7b403 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_wechat_qrcode.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() { + cv::Mat image = cv::Mat::ones(100, 100, CV_8UC3) * 50; + cv::wechat_qrcode::WeChatQRCode wechat_qrcode; + auto decoded_strings = wechat_qrcode.detectAndDecode(image); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_xfeatures2d.cpp b/recipes/opencv/4.x/test_package/test_xfeatures2d.cpp new file mode 100644 index 00000000000000..673b9737b4fddc --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_xfeatures2d.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto vgg = cv::xfeatures2d::VGG::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_ximgproc.cpp b/recipes/opencv/4.x/test_package/test_ximgproc.cpp new file mode 100644 index 00000000000000..b4804362da9b29 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_ximgproc.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto feature_getter = cv::ximgproc::createRFFeatureGetter(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_xobjdetect.cpp b/recipes/opencv/4.x/test_package/test_xobjdetect.cpp new file mode 100644 index 00000000000000..15cecaff5b8ef9 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_xobjdetect.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto detector = cv::xobjdetect::WBDetector::create(); + return 0; +} diff --git a/recipes/opencv/4.x/test_package/test_xphoto.cpp b/recipes/opencv/4.x/test_package/test_xphoto.cpp new file mode 100644 index 00000000000000..5c0eb661f221c5 --- /dev/null +++ b/recipes/opencv/4.x/test_package/test_xphoto.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + auto grayworld_wb = cv::xphoto::createGrayworldWB(); + return 0; +} diff --git a/recipes/opencv/4.x/test_v1_package/CMakeLists.txt b/recipes/opencv/4.x/test_v1_package/CMakeLists.txt index 0d20897301b68b..c23ed5cfe6d983 100644 --- a/recipes/opencv/4.x/test_v1_package/CMakeLists.txt +++ b/recipes/opencv/4.x/test_v1_package/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_v1_package) + +enable_testing() include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) diff --git a/recipes/opencv/4.x/test_v1_package/conanfile.py b/recipes/opencv/4.x/test_v1_package/conanfile.py index dc9799aa32b63e..9aa234fbd88b8a 100644 --- a/recipes/opencv/4.x/test_v1_package/conanfile.py +++ b/recipes/opencv/4.x/test_v1_package/conanfile.py @@ -1,21 +1,47 @@ from conans import ConanFile, CMake, tools -import os +from conans.errors import ConanException class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" + @property + def _tested_modules(self): + return [ + # Main modules + "calib3d", "core", "dnn", "features2d", "flann", "gapi", "highgui", "imgcodecs", + "imgproc", "ml", "objdetect", "photo", "stitching", "video", "videoio", + # Extra modules + "alphamat", "aruco", "bgsegm", "bioinspired", "ccalib", "datasets", "dnn_superres", + "face", "freetype", "fuzzy", "hdf", "hfs", "img_hash", "intensity_transform", + "line_descriptor", "mcc", "optflow", "phase_unwrapping", "plot", "quality", "reg", + "rgbd", "saliency", "sfm", "shape", "structured_light", "superres", + "surface_matching", "text", "tracking", "wechat_qrcode", "xfeatures2d", + "ximgproc", "xobjdetect", "xphoto", + ] + + def _opencv_option(self, name, default): + try: + return getattr(self.options["opencv"], name, default) + except (AttributeError, ConanException): + return default + def build(self): cmake = CMake(self) - cmake.definitions["built_dnn"] = self.options["opencv"].dnn - cmake.definitions["built_with_ade"] = self.options["opencv"].with_ade - cmake.definitions["built_with_ffmpeg"] = self.options["opencv"].with_ffmpeg - cmake.definitions["built_contrib_sfm"] = self.options["opencv"].contrib and self.options["opencv"].contrib_sfm + for module in self._tested_modules: + cmake_option = f"OPENCV_WITH_{module.upper()}" + if module == "core": + cmake.definitions[cmake_option] = True + elif module == "imgcodecs": + cmake.definitions[cmake_option] = self.options["opencv"].imgcodecs and self.options["opencv"].with_png + elif module == "videoio": + cmake.definitions[cmake_option] = self.options["opencv"].videoio and self.options["opencv"].with_ffmpeg + else: + cmake.definitions[cmake_option] = self._opencv_option(module, False) 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(f"ctest --output-on-failure -C {self.settings.build_type} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/opencv/config.yml b/recipes/opencv/config.yml index 9eaf5dfd20e1b8..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": @@ -7,7 +9,5 @@ versions: folder: "4.x" "3.4.17": folder: "3.x" - "3.4.12": - folder: "3.x" "2.4.13.7": folder: "2.x" diff --git a/recipes/openddl-parser/all/conandata.yml b/recipes/openddl-parser/all/conandata.yml index aff9aad9e373bf..367951b808907b 100644 --- a/recipes/openddl-parser/all/conandata.yml +++ b/recipes/openddl-parser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.1": + url: "https://github.com/kimkulling/openddl-parser/archive/v0.5.1.tar.gz" + sha256: "511146377636f56a8a3bd6daace5ac2ed9672f4be28fc2c90597f4e88e069ffc" "0.5.0": url: "https://github.com/kimkulling/openddl-parser/archive/refs/tags/v0.5.0.tar.gz" sha256: "0ad1a95462932da247a21fc3bb4560c3d9b134e15464f6a518c9e01becc14b60" diff --git a/recipes/openddl-parser/config.yml b/recipes/openddl-parser/config.yml index c4cc95f34a3b67..c45ff0b2916ff5 100644 --- a/recipes/openddl-parser/config.yml +++ b/recipes/openddl-parser/config.yml @@ -1,4 +1,6 @@ versions: + "0.5.1": + folder: "all" "0.5.0": folder: "all" "cci.20211217": 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 a68e5d8d7ad882..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 @@ -38,7 +41,7 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if Version(self.version) < "2.5.0" and hasattr(self, "settings_build") and cross_building(self): @@ -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 34ca44936ccbea..71838c85f0a045 100644 --- a/recipes/openexr/3.x/conanfile.py +++ b/recipes/openexr/3.x/conanfile.py @@ -12,11 +12,11 @@ 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 = { "shared": [True, False], @@ -27,6 +27,10 @@ class OpenEXRConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 11 + def export_sources(self): export_conandata_patches(self) @@ -38,17 +42,17 @@ 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("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") # Note: OpenEXR and Imath are versioned independently. self.requires("imath/3.1.9", transitive_headers=True) def validate(self): - if self.settings.compiler.cppstd: - check_min_cppstd(self, 11) - - def layout(self): - cmake_layout(self, src_folder="src") + 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/openfst/all/conandata.yml b/recipes/openfst/all/conandata.yml index ef54f290e00776..aed678082ff26c 100644 --- a/recipes/openfst/all/conandata.yml +++ b/recipes/openfst/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "1.8.2": - patch_file: "patches/1.8.2-allocate-hint.patch" - base_path: "source_subfolder" diff --git a/recipes/openfst/all/conanfile.py b/recipes/openfst/all/conanfile.py index ef0a6f1a558d2a..350f5171a2fd11 100644 --- a/recipes/openfst/all/conanfile.py +++ b/recipes/openfst/all/conanfile.py @@ -1,20 +1,26 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration -import functools -from itertools import product import os +from itertools import product + +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, copy, export_conandata_patches, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.scm import Version -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class OpenFstConan(ConanFile): name = "openfst" description = "A library for constructing, combining, optimizing and searching weighted finite-state-transducers (FSTs)." - topics = ("asr", "fst", "wfst", "openfst") + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.openfst.org/twiki/bin/view/FST/WebHome" - license = "Apache-2.0" + topics = ("asr", "fst", "wfst", "openfst") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -49,26 +55,27 @@ class OpenFstConan(ConanFile): "enable_special": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + 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: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration( - "OpenFst is only supported on linux") + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("OpenFst is only supported on linux") compilers = { "gcc": "8", @@ -76,33 +83,36 @@ def validate(self): } if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, 17) minimum_compiler = compilers.get(str(self.settings.compiler)) if minimum_compiler: - if tools.Version(self.settings.compiler.version) < minimum_compiler: - raise ConanInvalidConfiguration(f"{self.name} requires c++17, which your compiler does not support.") + if Version(self.settings.compiler.version) < minimum_compiler: + raise ConanInvalidConfiguration( + f"{self.name} requires c++17, which your compiler does not support." + ) else: - self.output.warn(f"{self.name} requires c++17, but this compiler is unknown to this recipe. Assuming your compiler supports c++17.") + self.output.warning( + f"{self.name} requires c++17, but this compiler is unknown to this recipe." + f" Assuming your compiler supports c++17." + ) # Check stdlib ABI compatibility if self.settings.compiler == "gcc" and self.settings.compiler.libcxx != "libstdc++11": - raise ConanInvalidConfiguration('Using %s with GCC requires "compiler.libcxx=libstdc++11"' % self.name) + raise ConanInvalidConfiguration( + f'Using {self.name} with GCC requires "compiler.libcxx=libstdc++11"' + ) elif self.settings.compiler == "clang" and self.settings.compiler.libcxx not in ["libstdc++11", "libc++"]: - raise ConanInvalidConfiguration('Using %s with Clang requires either "compiler.libcxx=libstdc++11"' - ' or "compiler.libcxx=libc++"' % self.name) + raise ConanInvalidConfiguration( + f'Using {self.name} with Clang requires either "compiler.libcxx=libstdc++11" or "compiler.libcxx=libc++"' + ) 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_autotools(self): - autotools = AutoToolsBuildEnvironment(self) + def generate(self): + tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" - args = [ - "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))), - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), + tc.configure_args += [ "--enable-bin={}".format(yes_no(self.options.enable_bin)), "--enable-compact-fsts={}".format(yes_no(self.options.enable_compact_fsts)), "--enable-compress={}".format(yes_no(self.options.enable_compress)), @@ -115,47 +125,51 @@ def _configure_autotools(self): "--enable-ngram-fsts={}".format(yes_no(self.options.enable_ngram_fsts)), "--enable-pdt={}".format(yes_no(self.options.enable_pdt)), "--enable-special={}".format(yes_no(self.options.enable_special)), - "LIBS=-lpthread", ] - autotools.configure(args=args, configure_dir=self._source_subfolder) - return autotools - - def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + tc.extra_cflags.append("-pthread") + tc.extra_cxxflags.append("-pthread") + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) def build(self): self._patch_sources() - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + + autotools = Autotools(self) autotools.install() lib_dir = os.path.join(self.package_folder, "lib") lib_subdir = os.path.join(self.package_folder, "lib", "fst") if os.path.exists(lib_subdir): for fn in os.listdir(lib_subdir): - tools.rename(os.path.join(lib_subdir, fn), os.path.join(lib_dir, "lib{}".format(fn))) - tools.rmdir(lib_subdir) + rename(self, + os.path.join(lib_subdir, fn), + os.path.join(lib_dir, f"lib{fn}")) + rmdir(self, lib_subdir) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(lib_dir, "*.la") + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", lib_dir, recursive=True) @property def _get_const_fsts_libs(self): - return ["const{}-fst".format(n) for n in [8, 16, 64]] + return [f"const{n}-fst" for n in [8, 16, 64]] @property def _get_compact_fsts_libs(self): - return ["compact{}_{}-fst".format(n, fst) - for n, fst in product([8, 16, 64], ["acceptor", "string", "unweighted_acceptor", "unweighted", "weighted_string"])] + return [f"compact{n}_{fst}-fst" + for n, fst in product( + [8, 16, 64], + ["acceptor", "string", "unweighted_acceptor", "unweighted", "weighted_string"] + )] def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenFst") @@ -196,8 +210,9 @@ def package_info(self): if self.options.enable_pdt or self.options.enable_grm: self.cpp_info.libs.append("fstpdtscript") - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment var: {}".format(bindir)) - self.env_info.PATH.append(bindir) - self.cpp_info.system_libs = ["pthread", "dl", "m"] + + # TODO: Legacy, to be removed on Conan 2.0 + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment var: {bindir}") + self.env_info.PATH.append(bindir) diff --git a/recipes/openfst/all/test_package/CMakeLists.txt b/recipes/openfst/all/test_package/CMakeLists.txt index cdd919fc9ae03e..71588be2b8f7ec 100644 --- a/recipes/openfst/all/test_package/CMakeLists.txt +++ b/recipes/openfst/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) set(CMAKE_CXX_STANDARD 17) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(OpenFst REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/openfst/all/test_package/conanfile.py b/recipes/openfst/all/test_package/conanfile.py index 90eb89e3f2f46b..ef5d7042163ecc 100644 --- a/recipes/openfst/all/test_package/conanfile.py +++ b/recipes/openfst/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", "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,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/openfst/all/test_v1_package/CMakeLists.txt b/recipes/openfst/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/openfst/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/openfst/all/test_v1_package/conanfile.py b/recipes/openfst/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..90eb89e3f2f46b --- /dev/null +++ b/recipes/openfst/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") + self.run(bin_path, run_environment=True) diff --git a/recipes/openfx/all/CMakeLists.txt b/recipes/openfx/all/CMakeLists.txt index 5232e354a73eef..1a7641b6f3019b 100644 --- a/recipes/openfx/all/CMakeLists.txt +++ b/recipes/openfx/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.12) project(openfx VERSION 1.4.0 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -6,18 +6,18 @@ add_definitions(-D_HAS_AUTO_PTR_ETC) # Flags if(MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWINDOWS -DNOMINMAX") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWINDOWS -DNOMINMAX -D_WIN32") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations") + add_definitions(-Dlinux) endif() # Conan -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) -find_package(EXPAT REQUIRED) +find_package(expat REQUIRED) +find_package(OpenGL REQUIRED) # Macros -set(SOURCE_SUBFOLDER ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) +set(SOURCE_SUBFOLDER ${CMAKE_CURRENT_LIST_DIR}/src) # Sources set(OFX_HEADER_DIR "${SOURCE_SUBFOLDER}/include") @@ -50,7 +50,7 @@ add_library(OfxHost ${OFX_HOSTSUPPORT_HEADER_FILES} ${OFX_HOSTSUPPORT_LIBRARY_FILES}) -target_link_libraries(OfxHost PUBLIC EXPAT::EXPAT) +target_link_libraries(OfxHost PUBLIC expat::expat OpenGL::GL) target_include_directories(OfxHost PUBLIC ${OFX_HEADER_DIR} @@ -68,7 +68,5 @@ install(FILES ${OFX_HOSTSUPPORT_HEADER_FILES} DESTINATION "include") -install(TARGETS OfxSupport OfxHost - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) +include(GNUInstallDirs) +install(TARGETS OfxSupport OfxHost) diff --git a/recipes/openfx/all/conanfile.py b/recipes/openfx/all/conanfile.py index 6f5bee8600958e..935c3113a9393d 100644 --- a/recipes/openfx/all/conanfile.py +++ b/recipes/openfx/all/conanfile.py @@ -1,54 +1,73 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +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 openfx(ConanFile): name = "openfx" + description = "OpenFX image processing plug-in standard." license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "http://openeffects.org" - description = "OpenFX image processing plug-in standard." topics = ("image-processing", "standard") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { - "fPIC": [True, False], "shared": [True, False], + "fPIC": [True, False], } default_options = { - "fPIC": True, "shared": False, + "fPIC": True, } - requires = ("opengl/system", "expat/2.4.8") - exports_sources = "CMakeLists.txt", "cmake/*", "symbols/*" - generators = "cmake", "cmake_find_package" - _cmake = None + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "*", + src=os.path.join(self.recipe_folder, "cmake"), + dst=os.path.join(self.export_sources_folder, "cmake")) + copy(self, "*", + src=os.path.join(self.recipe_folder, "symbols"), + dst=os.path.join(self.export_sources_folder, "symbols")) - def source(self): - tools.get( - **self.conan_data["sources"][self.version], - destination="source_subfolder", - strip_root=True - ) + 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 config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("opengl/system") + self.requires("expat/2.5.0") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + 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): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() @property @@ -56,26 +75,25 @@ def _build_modules(self): return [os.path.join("lib", "cmake", "OpenFX.cmake")] def package(self): - cmake = self._configure_cmake() - - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - + cmake = CMake(self) cmake.install() - - self.copy("*.symbols", src="symbols", dst="lib/symbols") - self.copy("*.cmake", src="cmake", dst="lib/cmake") - self.copy("LICENSE", src="source_subfolder/Support", dst="licenses") - self.copy("readme.md") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, "*.symbols", + src=os.path.join(self.export_sources_folder, "symbols"), + dst=os.path.join(self.package_folder, "lib", "symbols")) + copy(self, "*.cmake", + src=os.path.join(self.export_sources_folder, "cmake"), + dst=os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "LICENSE", + src=os.path.join(self.source_folder, "Support"), + dst=os.path.join(self.package_folder, "licenses")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "openfx" - self.cpp_info.names["cmake_find_package_multi"] = "openfx" - + self.cpp_info.set_property("cmake_file_name", "openfx") + self.cpp_info.set_property("cmake_target_name", "openfx::openfx") self.cpp_info.set_property("cmake_build_modules", self._build_modules) self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) - self.cpp_info.build_modules["cmake_find_package"] = self._build_modules - self.cpp_info.build_modules["cmake_find_package_multi"] = self._build_modules if self.options.shared: self.cpp_info.libs = ["OfxSupport"] @@ -84,5 +102,11 @@ def package_info(self): if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs.extend(["GL"]) - if self.settings.os == "Macos": + if is_apple_os(self): self.cpp_info.frameworks = ["CoreFoundation", "OpenGL"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "openfx" + self.cpp_info.names["cmake_find_package_multi"] = "openfx" + self.cpp_info.build_modules["cmake_find_package"] = self._build_modules + self.cpp_info.build_modules["cmake_find_package_multi"] = self._build_modules diff --git a/recipes/openfx/all/test_package/CMakeLists.txt b/recipes/openfx/all/test_package/CMakeLists.txt index c80f526f36b854..130ac63e132fe5 100644 --- a/recipes/openfx/all/test_package/CMakeLists.txt +++ b/recipes/openfx/all/test_package/CMakeLists.txt @@ -1,12 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_definitions(-D_HAS_AUTO_PTR_ETC) # Conan -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) find_package(openfx REQUIRED CONFIG) # Flags diff --git a/recipes/openfx/all/test_package/conanfile.py b/recipes/openfx/all/test_package/conanfile.py index 884a3017a3bd60..93275299d1c47d 100644 --- a/recipes/openfx/all/test_package/conanfile.py +++ b/recipes/openfx/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("%s --help" % bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} --help", env="conanrun") diff --git a/recipes/openfx/all/test_v1_package/CMakeLists.txt b/recipes/openfx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/openfx/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/openfx/all/test_v1_package/conanfile.py b/recipes/openfx/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..884a3017a3bd60 --- /dev/null +++ b/recipes/openfx/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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("%s --help" % bin_path, run_environment=True) diff --git a/recipes/opengl-registry/all/conanfile.py b/recipes/opengl-registry/all/conanfile.py index 46486aec2fc829..5e0a3df3920960 100644 --- a/recipes/opengl-registry/all/conanfile.py +++ b/recipes/opengl-registry/all/conanfile.py @@ -13,6 +13,7 @@ class OpenGLRegistryConan(ConanFile): topics = ("opengl-registry", "opengl") homepage = "https://github.com/KhronosGroup/OpenGL-Registry" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -26,8 +27,7 @@ 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 @@ -46,3 +46,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] diff --git a/recipes/openjdk/all/conandata.yml b/recipes/openjdk/all/conandata.yml index 55fa3138ee966b..bb0f8bea50c9bb 100644 --- a/recipes/openjdk/all/conandata.yml +++ b/recipes/openjdk/all/conandata.yml @@ -1,11 +1,30 @@ sources: + "21.0.1": + Windows: + url: "https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_windows-x64_bin.zip" + sha256: "77ea464f4fa7cbcbffe0124af44707e8e5ad8c1ce2373f1d94a64d9b20ba0c69" + Linux_x86_64: + url: "https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_linux-x64_bin.tar.gz" + sha256: "7e80146b2c3f719bf7f56992eb268ad466f8854d5d6ae11805784608e458343f" + Linux_armv8: + url: "https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_linux-aarch64_bin.tar.gz" + sha256: "f5e4e4622756fafe05ac0105a8efefa1152c8aad085a2bbb9466df0721bf2ba4" + Macos_x86_64: + url: "https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_macos-x64_bin.tar.gz" + sha256: "1ca6db9e6c09752f842eee6b86a2f7e51b76ae38e007e936b9382b4c3134e9ea" + Macos_armv8: + url: "https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_macos-aarch64_bin.tar.gz" + sha256: "9760eaa019b6d214a06bd44a304f3700ac057d025000bdfb9739b61080969a96" "19.0.2": Windows: url: "https://download.java.net/java/GA/jdk19.0.2/fdb695a9d9064ad6b064dc6df578380c/7/GPL/openjdk-19.0.2_windows-x64_bin.zip" sha256: "9f70eba3f2631674a2d7d3aa01150d697f68be16ad76662ff948d7fe1b4985d8" - Linux: + Linux_x86_64: url: "https://download.java.net/java/GA/jdk19.0.2/fdb695a9d9064ad6b064dc6df578380c/7/GPL/openjdk-19.0.2_linux-x64_bin.tar.gz" sha256: "34cf8d095cc071e9e10165f5c45023f96ec68397fdaabf6c64bfec1ffeee6198" + Linux_armv8: + url: "https://download.java.net/java/GA/jdk19.0.2/fdb695a9d9064ad6b064dc6df578380c/7/GPL/openjdk-19.0.2_linux-aarch64_bin.tar.gz" + sha256: "95728187b4b5607c49de751a209ecda6e04d9ed7cee603cf36f454239106527b" Macos_x86_64: url: "https://download.java.net/java/GA/jdk19.0.2/fdb695a9d9064ad6b064dc6df578380c/7/GPL/openjdk-19.0.2_macos-x64_bin.tar.gz" sha256: "c57c7c511706738fff6540945e0159e97b8b328777e6460977dd64e00f4c2c0b" @@ -16,7 +35,7 @@ sources: Windows: url: "https://download.java.net/java/GA/jdk16.0.1/7147401fd7354114ac51ef3e1328291f/9/GPL/openjdk-16.0.1_windows-x64_bin.zip" sha256: "733b45b09463c97133d70c2368f1b9505da58e88f2c8a84358dd4accfd06a7a4" - Linux: + Linux_x86_64: url: "https://download.java.net/java/GA/jdk16.0.1/7147401fd7354114ac51ef3e1328291f/9/GPL/openjdk-16.0.1_linux-x64_bin.tar.gz" sha256: "b1198ffffb7d26a3fdedc0fa599f60a0d12aa60da1714b56c1defbce95d8b235" Macos_x86_64: diff --git a/recipes/openjdk/all/conanfile.py b/recipes/openjdk/all/conanfile.py index f6296d73d515da..becd2ce7c641cd 100644 --- a/recipes/openjdk/all/conanfile.py +++ b/recipes/openjdk/all/conanfile.py @@ -13,7 +13,7 @@ class OpenJDK(ConanFile): url = "https://github.com/conan-io/conan-center-index/" description = "Java Development Kit builds, from Oracle" homepage = "https://jdk.java.net" - license = "GPL-2.0-with-classpath-exception" + license = "GPL-2.0-only WITH Classpath-exception-2.0", "GPL-2.0-only WITH OpenJDK-assembly-exception-1.0" topics = ("java", "jdk", "openjdk") settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -30,7 +30,7 @@ def validate(self): def build(self): key = self.settings.os - if self.settings.os == "Macos": + if self.settings.os in ["Macos", "Linux"]: key = f"{self.settings.os}_{self.settings.arch}" get(self, **self.conan_data["sources"][self.version][str(key)], destination=self.source_folder, strip_root=True) diff --git a/recipes/openjdk/config.yml b/recipes/openjdk/config.yml index 71fa68c00fc9a5..1e9a2a92440d26 100644 --- a/recipes/openjdk/config.yml +++ b/recipes/openjdk/config.yml @@ -1,4 +1,6 @@ versions: + "21.0.1": + folder: all "19.0.2": folder: all "16.0.1": diff --git a/recipes/openjpeg/all/conanfile.py b/recipes/openjpeg/all/conanfile.py index d4b1a9482f6b76..5b1cc6a995945e 100644 --- a/recipes/openjpeg/all/conanfile.py +++ b/recipes/openjpeg/all/conanfile.py @@ -1,6 +1,6 @@ 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, save +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save, replace_in_file from conan.tools.scm import Version import os import textwrap @@ -14,7 +14,7 @@ class OpenjpegConan(ConanFile): description = "OpenJPEG is an open-source JPEG 2000 codec written in C language." topics = ("jpeg2000", "jp2", "openjpeg", "image", "multimedia", "format", "graphics") homepage = "https://github.com/uclouvain/openjpeg" - license = "BSD 2-Clause" + license = "BSD-2-Clause" package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -71,8 +71,15 @@ def generate(self): tc.variables["OPJ_USE_THREAD"] = True tc.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + # 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, "CMakeLists.txt"), + "-ffast-math", "-ffast-math;-fno-finite-math-only") + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -82,13 +89,31 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", self._openjpeg_subdir)) - + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_vars_rel_path) + ) # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), + os.path.join(self.package_folder, self._module_target_rel_path), {"openjp2": "OpenJPEG::OpenJPEG"} ) + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(OPENJPEG_FOUND TRUE) + if(DEFINED OpenJPEG_INCLUDE_DIRS) + set(OPENJPEG_INCLUDE_DIRS ${{OpenJPEG_INCLUDE_DIRS}}) + endif() + if(DEFINED OpenJPEG_LIBRARIES) + set(OPENJPEG_LIBRARIES ${{OpenJPEG_LIBRARIES}}) + endif() + set(OPENJPEG_MAJOR_VERSION "{Version(self.version).major}") + set(OPENJPEG_MINOR_VERSION "{Version(self.version).minor}") + set(OPENJPEG_BUILD_VERSION "{Version(self.version).patch}") + set(OPENJPEG_BUILD_SHARED_LIBS {"TRUE" if self.options.shared else "FALSE"}) + """) + save(self, module_file, content) + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): @@ -101,7 +126,11 @@ def _create_cmake_module_alias_targets(self, module_file, targets): save(self, module_file, content) @property - def _module_file_rel_path(self): + def _module_vars_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + @property + def _module_target_rel_path(self): return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @property @@ -112,8 +141,10 @@ def _openjpeg_subdir(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenJPEG") self.cpp_info.set_property("cmake_target_name", "openjp2") + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path]) self.cpp_info.set_property("pkg_config_name", "libopenjp2") self.cpp_info.includedirs.append(os.path.join("include", self._openjpeg_subdir)) + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) self.cpp_info.libs = ["openjp2"] if self.settings.os == "Windows" and not self.options.shared: self.cpp_info.defines.append("OPJ_STATIC") @@ -125,6 +156,6 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "OpenJPEG" self.cpp_info.names["cmake_find_package_multi"] = "OpenJPEG" - 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] + self.cpp_info.build_modules["cmake_find_package"] = [self._module_target_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_target_rel_path] self.cpp_info.names["pkg_config"] = "libopenjp2" diff --git a/recipes/openjpeg/all/test_package/CMakeLists.txt b/recipes/openjpeg/all/test_package/CMakeLists.txt index eccda132e4efef..08c910c90a70d5 100644 --- a/recipes/openjpeg/all/test_package/CMakeLists.txt +++ b/recipes/openjpeg/all/test_package/CMakeLists.txt @@ -5,3 +5,21 @@ find_package(OpenJPEG REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE openjp2) + +# Test whether variables from https://github.com/uclouvain/openjpeg/blob/master/cmake/OpenJPEGConfig.cmake.in are properly defined +set(_custom_vars + OPENJPEG_FOUND + OPENJPEG_INCLUDE_DIRS + OPENJPEG_LIBRARIES + OPENJPEG_MAJOR_VERSION + OPENJPEG_MINOR_VERSION + OPENJPEG_BUILD_VERSION + OPENJPEG_BUILD_SHARED_LIBS +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/openmvg/all/conanfile.py b/recipes/openmvg/all/conanfile.py index b320aba511407c..6774e8b893191b 100644 --- a/recipes/openmvg/all/conanfile.py +++ b/recipes/openmvg/all/conanfile.py @@ -30,6 +30,7 @@ class Openmvgconan(ConanFile): "with_openmp": [True, False], "with_avx": [False, "avx", "avx2"], "programs": [True, False], + "with_jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg"] } default_options = { "shared": False, @@ -37,6 +38,7 @@ class Openmvgconan(ConanFile): "with_openmp": False, "with_avx": False, "programs": True, + "with_jpeg": "libjpeg" } short_paths = True @@ -66,7 +68,12 @@ def requirements(self): self.requires("coin-utils/2.11.6") self.requires("eigen/3.4.0", transitive_headers=True) self.requires("flann/1.9.2", transitive_headers=True, transitive_libs=True) - self.requires("libjpeg/9e") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/3.0.0") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") self.requires("libpng/1.6.40") self.requires("libtiff/4.5.1") @@ -108,6 +115,12 @@ def generate(self): # see https://github.com/conan-io/conan/issues/10281 if Version(self.dependencies["ceres-solver"].ref.version) >= "2.0.0" and not valid_min_cppstd(self, "14"): tc.variables["CMAKE_CXX_STANDARD"] = "14" + + if self.settings.os == "Linux": + # Workaround for: https://github.com/conan-io/conan/issues/13560 + libdirs_host = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs] + tc.variables["CMAKE_BUILD_RPATH"] = ";".join(libdirs_host) + tc.generate() deps = CMakeDeps(self) @@ -131,6 +144,14 @@ def package(self): @property def _openmvg_components(self): + def jpeg(): + if self.options.with_jpeg == "libjpeg": + return ["libjpeg::libjpeg"] + elif self.options.with_jpeg == "libjpeg-turbo": + return ["libjpeg-turbo::jpeg"] + elif self.options.with_jpeg == "mozjpeg": + return ["mozjpeg::libjpeg"] + return { "openmvg_camera": { "target": "openMVG_camera", @@ -162,7 +183,7 @@ def _openmvg_components(self): "openmvg_image": { "target": "openMVG_image", "libs": ["openMVG_image"], - "requires": ["openmvg_numeric", "libjpeg::libjpeg", "libpng::libpng", "libtiff::libtiff"], + "requires": ["openmvg_numeric", "libpng::libpng", "libtiff::libtiff"] + jpeg(), }, "openmvg_linearprogramming": { "target": "openMVG_linearProgramming", diff --git a/recipes/openpam/all/conandata.yml b/recipes/openpam/all/conandata.yml new file mode 100644 index 00000000000000..06219b641cc818 --- /dev/null +++ b/recipes/openpam/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "20190224": + url: "https://sourceforge.net/projects/openpam/files/openpam/Tabebuia/openpam-20190224.tar.gz" + sha256: "31f871f16b6868aef9c849f39aff6c52227977e09eee22b00fb8b7435ddf7105" diff --git a/recipes/openpam/all/conanfile.py b/recipes/openpam/all/conanfile.py new file mode 100644 index 00000000000000..b8d2328964b483 --- /dev/null +++ b/recipes/openpam/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, rmdir, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.54.0" + +class PackageConan(ConanFile): + name = "openpam" + description = "OpenPAM library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://openpam.org/" + topics = ("pam") + 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 validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + if self.settings.os not in ["Linux", "FreeBSD", "Neutrino"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, filename=f"openpam-{self.version}.tar.gz") + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), ignore_case=True) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["pam"] + self.cpp_info.system_libs = ["dl"] diff --git a/recipes/openpam/all/test_package/CMakeLists.txt b/recipes/openpam/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d03b89e820ddd3 --- /dev/null +++ b/recipes/openpam/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(openpam REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE openpam::openpam) diff --git a/recipes/openpam/all/test_package/conanfile.py b/recipes/openpam/all/test_package/conanfile.py new file mode 100644 index 00000000000000..0a808db45f2453 --- /dev/null +++ b/recipes/openpam/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 + + +# It will become the standard on Conan 2.x +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/openpam/all/test_package/test_package.c b/recipes/openpam/all/test_package/test_package.c new file mode 100644 index 00000000000000..50dff63a6c03a1 --- /dev/null +++ b/recipes/openpam/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include +#include +#include + + +int main(void) { + pam_handle_t* pamh; + struct pam_conv pamc; + const char *user; + + int rv = pam_start("yes", user, &pamc, &pamh); + + if(rv == PAM_SUCCESS) { + pam_end(pamh, PAM_SUCCESS); + } + + return EXIT_SUCCESS; +} + diff --git a/recipes/openpam/config.yml b/recipes/openpam/config.yml new file mode 100644 index 00000000000000..1dd1dcdfcdd6f9 --- /dev/null +++ b/recipes/openpam/config.yml @@ -0,0 +1,3 @@ +versions: + "20190224": + folder: all diff --git a/recipes/openssl/1.x.x/conandata.yml b/recipes/openssl/1.x.x/conandata.yml index e9abce013a402a..22aae5e08d56cc 100644 --- a/recipes/openssl/1.x.x/conandata.yml +++ b/recipes/openssl/1.x.x/conandata.yml @@ -1,55 +1,12 @@ sources: - 1.0.2u: - sha256: ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16 + 1.1.1w: + sha256: cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 url: - - "https://www.openssl.org/source/openssl-1.0.2u.tar.gz" - - "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz" - 1.1.0l: - sha256: 74a2f756c64fd7386a29184dc0344f4831192d61dc2481a93a4c5dd727f41148 - url: - - "https://www.openssl.org/source/openssl-1.1.0l.tar.gz" - - "https://www.openssl.org/source/old/1.1.0/openssl-1.1.0l.tar.gz" - 1.1.1q: - sha256: d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca - url: - - "https://www.openssl.org/source/openssl-1.1.1q.tar.gz" - - "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1q.tar.gz" - 1.1.1s: - sha256: c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa - url: - - "https://www.openssl.org/source/openssl-1.1.1s.tar.gz" - - "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1s.tar.gz" - - "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1s/openssl-1.1.1s.tar.gz" - 1.1.1t: - sha256: 8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b - url: - - "https://www.openssl.org/source/openssl-1.1.1t.tar.gz" - - "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1t.tar.gz" - - "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1t/openssl-1.1.1t.tar.gz" - 1.1.1u: - sha256: e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6 - url: - - "https://www.openssl.org/source/openssl-1.1.1u.tar.gz" - - "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1u.tar.gz" - - "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1u/openssl-1.1.1u.tar.gz" + - "https://www.openssl.org/source/openssl-1.1.1w.tar.gz" + - "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1w.tar.gz" + - "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz" patches: - 1.0.2u: - - patch_file: patches/1.0.2u-darwin-arm64.patch - patch_description: "Darwin ARM64 support" - patch_type: "portability" - 1.1.1q: - - patch_file: patches/1.1.1-tvos-watchos.patch - patch_description: "TVOS and WatchOS don't like fork()" - patch_type: "portability" - 1.1.1s: - - patch_file: patches/1.1.1-tvos-watchos.patch - patch_description: "TVOS and WatchOS don't like fork()" - patch_type: "portability" - 1.1.1t: - - patch_file: patches/1.1.1-tvos-watchos.patch - patch_description: "TVOS and WatchOS don't like fork()" - patch_type: "portability" - 1.1.1u: + 1.1.1w: - patch_file: patches/1.1.1-tvos-watchos.patch patch_description: "TVOS and WatchOS don't like fork()" patch_type: "portability" diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index d7807c3f39ee09..073a01dcd3cdc1 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -12,7 +12,6 @@ from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path from conan.tools.scm import Version from contextlib import contextmanager -from functools import total_ordering import fnmatch import json import os @@ -20,58 +19,6 @@ required_conan_version = ">=1.53.0" -@total_ordering -class OpenSSLVersion: - def __init__(self, version): - self._pre = "" - version_str = str(version) - - tokens = version_str.split("-") - if len(tokens) > 1: - self._pre = tokens[1] - version_str = tokens[0] - - tokens = version_str.split(".") - self._major = int(tokens[0]) - self._minor = 0 - self._patch = 0 - self._build = "" - if len(tokens) > 1: - self._minor = int(tokens[1]) - if len(tokens) > 2: - self._patch = tokens[2] - if self._patch[-1].isalpha(): - self._build = self._patch[-1] - self._patch = self._patch[:1] - self._patch = int(self._patch) - - @property - def base(self): - return "%s.%s.%s" % (self._major, self._minor, self._patch) - - @property - def as_list(self): - return [self._major, self._minor, self._patch, self._build, self._pre] - - def __eq__(self, other): - return self.compare(other) == 0 - - def __lt__(self, other): - return self.compare(other) == -1 - - def __hash__(self): - return hash(self.as_list) - - def compare(self, other): - if not isinstance(other, OpenSSLVersion): - other = OpenSSLVersion(other) - if self.as_list == other.as_list: - return 0 - if self.as_list < other.as_list: - return -1 - else: - return 1 - class OpenSSLConan(ConanFile): name = "openssl" @@ -85,7 +32,6 @@ class OpenSSLConan(ConanFile): settings = "os", "arch", "compiler", "build_type" options = { "no_threads": [True, False], - "no_zlib": [True, False], "shared": [True, False], "fPIC": [True, False], "no_asm": [True, False], @@ -100,12 +46,9 @@ class OpenSSLConan(ConanFile): "no_dh": [True, False], "no_dsa": [True, False], "no_hmac": [True, False], - "no_md2": [True, False], "no_md5": [True, False], "no_mdc2": [True, False], "no_rc2": [True, False], - "no_rc4": [True, False], - "no_rc5": [True, False], "no_rsa": [True, False], "no_sha": [True, False], "no_async": [True, False], @@ -145,16 +88,16 @@ class OpenSSLConan(ConanFile): "no_tls1": [True, False], "capieng_dialog": [True, False], "enable_capieng": [True, False], - "openssldir": ["ANY", None] + "openssldir": [None, "ANY"], } default_options = {key: False for key in options.keys()} default_options["fPIC"] = True - default_options["no_md2"] = True 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): @@ -162,54 +105,21 @@ 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): return getattr(self, "settings_build", self.settings) - @property - def _full_version(self): - return OpenSSLVersion(self.version) - def export_sources(self): export_conandata_patches(self) def config_options(self): - if self._full_version >= "1.1.0": - del self.options.no_md2 - del self.options.no_rc4 - del self.options.no_rc5 - del self.options.no_zlib - - if self._full_version < "1.1.0": - del self.options.no_camellia - del self.options.no_cast - del self.options.no_cms - del self.options.no_comp - del self.options.no_dgram - del self.options.no_engine - del self.options.no_idea - del self.options.no_md4 - del self.options.no_ocsp - del self.options.no_seed - del self.options.no_sock - del self.options.no_srp - del self.options.no_ts - del self.options.no_whirlpool - - if self._full_version < "1.1.1": - del self.options.no_aria - del self.options.no_pinshared - del self.options.no_sm2 - del self.options.no_sm3 - del self.options.no_sm4 - - if self.settings.os != "Windows": + if self.settings.os == "Windows": + del self.options.fPIC + else: del self.options.capieng_dialog del self.options.enable_capieng - else: - del self.options.fPIC if self.settings.os == "Emscripten": self.options.no_asm = True @@ -226,10 +136,6 @@ def configure(self): def layout(self): basic_layout(self, src_folder="src") - def requirements(self): - if self._full_version < "1.1.0" and not self.options.get_safe("no_zlib"): - self.requires("zlib/1.2.13") - def validate(self): if self.settings.os == "Emscripten": if not all((self.options.no_asm, self.options.no_threads, self.options.no_stdio, self.options.no_tests)): @@ -247,20 +153,12 @@ def build_requirements(self): self.tool_requires("msys2/cci.latest") 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): VirtualBuildEnv(self).generate() tc = AutotoolsToolchain(self) - # workaround for random error: size too large (archive member extends past the end of the file) - # /Library/Developer/CommandLineTools/usr/bin/ar: internal ranlib command failed - if self.settings.os == "Macos" and self._full_version < "1.1.0": - tc.make_args = ["-j1"] - # 1.1.0 era Makefiles don't do well with parallel installs - if not self._use_nmake and self._full_version >= "1.1.0" and self._full_version < "1.1.1": - tc.make_args = ["-j1"] if self.settings.os == "Macos" and not cross_building(self): tc.extra_cflags = [f"-isysroot {XCRun(self).sdk_path}"] tc.extra_cxxflags = [f"-isysroot {XCRun(self).sdk_path}"] @@ -273,23 +171,10 @@ def generate(self): gen_info["CXXFLAGS"] = tc.cxxflags gen_info["DEFINES"] = tc.defines gen_info["LDFLAGS"] = tc.ldflags - if self._full_version < "1.1.0" and not self.options.get_safe("no_zlib"): - zlib_cpp_info = self.dependencies["zlib"].cpp_info.aggregated_components() - gen_info["zlib_include_path"] = zlib_cpp_info.includedirs[0] - if self.settings.os == "Windows": - gen_info["zlib_lib_path"] = f"{zlib_cpp_info.libdirs[0]}/{zlib_cpp_info.libs[0]}.lib" - else: - gen_info["zlib_lib_path"] = zlib_cpp_info.libdirs[0] # Just path, linux will find the right file save(self, "gen_info.conf", json.dumps(gen_info)) tc = AutotoolsDeps(self) tc.generate() - @property - def _target_prefix(self): - if self._full_version < "1.1.0" and self.settings.build_type == "Debug": - return "debug-" - return "" - @property def _target(self): target = "conan-%s-%s-%s-%s-%s" % (self.settings.build_type, @@ -324,48 +209,14 @@ def _perlasm_scheme(self): "x86_64": "elf"}.get(the_arch, None) return None - @property - def _asm_target(self): - # FIXME This function is broken since https://github.com/conan-io/conan-center-index/pull/791 - # either it returns None (because the_os is not a key of the map below), or it does not return - the_os = str(self.settings.os) - if the_os in ["Android", "iOS", "watchOS", "tvOS"]: - return { - "x86": "x86_asm" if the_os == "Android" else None, - "x86_64": "x86_64_asm" if the_os == "Android" else None, - "armv5el": "armv4_asm", - "armv5hf": "armv4_asm", - "armv6": "armv4_asm", - "armv7": "armv4_asm", - "armv7hf": "armv4_asm", - "armv7s": "armv4_asm", - "armv7k": "armv4_asm", - "armv8": "aarch64_asm", - "armv8_32": "aarch64_asm", - "armv8.3": "aarch64_asm", - "mips": "mips32_asm", - "mips64": "mips64_asm", - "sparc": "sparcv8_asm", - "sparcv9": "sparcv9_asm", - "ia64": "ia64_asm", - "ppc32be": "ppc32_asm", - "ppc32": "ppc32_asm", - "ppc64le": "ppc64_asm", - "ppc64": "ppc64_asm", - "s390": "s390x_asm", - "s390x": "s390x_asm" - }.get(the_os, None) - @property def _targets(self): is_cygwin = self.settings.get_safe("os.subsystem") == "cygwin" - is_1_0 = self._full_version < "1.1.0" - has_darwin_arm = self._full_version >= "1.1.1i" or is_1_0 return { - "Linux-x86-clang": ("%slinux-generic32" % self._target_prefix) if is_1_0 else "linux-x86-clang", - "Linux-x86_64-clang": ("%slinux-x86_64" % self._target_prefix) if is_1_0 else "linux-x86_64-clang", - "Linux-x86-*": ("%slinux-generic32" % self._target_prefix) if is_1_0 else "linux-x86", - "Linux-x86_64-*": "%slinux-x86_64" % self._target_prefix, + "Linux-x86-clang": "linux-x86-clang", + "Linux-x86_64-clang": "linux-x86_64-clang", + "Linux-x86-*": "linux-x86", + "Linux-x86_64-*": "linux-x86_64", "Linux-armv4-*": "linux-armv4", "Linux-armv4i-*": "linux-armv4", "Linux-armv5el-*": "linux-armv4", @@ -391,13 +242,13 @@ def _targets(self): "Linux-sparc-*": "linux-sparcv8", "Linux-sparcv9-*": "linux64-sparcv9", "Linux-*-*": "linux-generic32", - "Macos-x86-*": "%sdarwin-i386-cc" % self._target_prefix, - "Macos-x86_64-*": "%sdarwin64-x86_64-cc" % self._target_prefix, - "Macos-ppc32-*": "%sdarwin-ppc-cc" % self._target_prefix, - "Macos-ppc32be-*": "%sdarwin-ppc-cc" % self._target_prefix, + "Macos-x86-*": "darwin-i386-cc", + "Macos-x86_64-*": "darwin64-x86_64-cc", + "Macos-ppc32-*": "darwin-ppc-cc", + "Macos-ppc32be-*": "darwin-ppc-cc", "Macos-ppc64-*": "darwin64-ppc-cc", "Macos-ppc64be-*": "darwin64-ppc-cc", - "Macos-armv8-*": "darwin64-arm64-cc" if has_darwin_arm else "darwin-common", + "Macos-armv8-*": "darwin64-arm64-cc", "Macos-*-*": "darwin-common", "iOS-x86_64-*": "darwin64-x86_64-cc", "iOS-*-*": "iphoneos-cross", @@ -415,15 +266,15 @@ def _targets(self): "Windows-x86-gcc": "Cygwin-x86" if is_cygwin else "mingw", "Windows-x86_64-gcc": "Cygwin-x86_64" if is_cygwin else "mingw64", "Windows-*-gcc": "Cygwin-common" if is_cygwin else "mingw-common", - "Windows-ia64-Visual Studio": "%sVC-WIN64I" % self._target_prefix, # Itanium - "Windows-x86-Visual Studio": "%sVC-WIN32" % self._target_prefix, - "Windows-x86_64-Visual Studio": "%sVC-WIN64A" % self._target_prefix, + "Windows-ia64-Visual Studio": "VC-WIN64I", # Itanium + "Windows-x86-Visual Studio": "VC-WIN32", + "Windows-x86_64-Visual Studio": "VC-WIN64A", "Windows-armv7-Visual Studio": "VC-WIN32-ARM", "Windows-armv8-Visual Studio": "VC-WIN64-ARM", "Windows-*-Visual Studio": "VC-noCE-common", - "Windows-ia64-clang": "%sVC-WIN64I" % self._target_prefix, # Itanium - "Windows-x86-clang": "%sVC-WIN32" % self._target_prefix, - "Windows-x86_64-clang": "%sVC-WIN64A" % self._target_prefix, + "Windows-ia64-clang": "VC-WIN64I", # Itanium + "Windows-x86-clang": "VC-WIN32", + "Windows-x86_64-clang": "VC-WIN64A", "Windows-armv7-clang": "VC-WIN32-ARM", "Windows-armv8-clang": "VC-WIN64-ARM", "Windows-*-clang": "VC-noCE-common", @@ -433,13 +284,13 @@ def _targets(self): "WindowsStore-armv8-*": "VC-WIN64-ARM-UWP", "WindowsStore-*-*": "VC-WIN32-ONECORE", "WindowsCE-*-*": "VC-CE", - "SunOS-x86-gcc": "%ssolaris-x86-gcc" % self._target_prefix, - "SunOS-x86_64-gcc": "%ssolaris64-x86_64-gcc" % self._target_prefix, - "SunOS-sparc-gcc": "%ssolaris-sparcv8-gcc" % self._target_prefix, + "SunOS-x86-gcc": "solaris-x86-gcc", + "SunOS-x86_64-gcc": "solaris64-x86_64-gcc", + "SunOS-sparc-gcc": "solaris-sparcv8-gcc", "SunOS-sparcv9-gcc": "solaris64-sparcv9-gcc", - "SunOS-x86-suncc": "%ssolaris-x86-cc" % self._target_prefix, - "SunOS-x86_64-suncc": "%ssolaris64-x86_64-cc" % self._target_prefix, - "SunOS-sparc-suncc": "%ssolaris-sparcv8-cc" % self._target_prefix, + "SunOS-x86-suncc": "solaris-x86-cc", + "SunOS-x86_64-suncc": "solaris64-x86_64-cc", + "SunOS-sparc-suncc": "solaris-sparcv8-cc", "SunOS-sparcv9-suncc": "solaris64-sparcv9-cc", "SunOS-*-*": "solaris-common", "*BSD-x86-*": "BSD-x86", @@ -484,37 +335,8 @@ def _tool(self, env_name, apple_name): return getattr(XCRun(self), apple_name) return None - def _patch_configure(self): - # since _patch_makefile_org will replace binutils variables - # use a more restricted regular expresion to prevent that Configure script trying to do it again - configure = os.path.join(self.source_folder, "Configure") - replace_in_file(self, configure, r"s/^AR=\s*ar/AR= $ar/;", r"s/^AR=\s*ar\b/AR= $ar/;",encoding="latin_1") - - def _adjust_path(self, path): - return path.replace("\\", "/") if self._settings_build.os == "Windows" else path - - def _patch_makefile_org(self): - # https://wiki.openssl.org/index.php/Compilation_and_Installation#Modifying_Build_Settings - # its often easier to modify Configure and Makefile.org rather than trying to add targets to the configure scripts - makefile_org = os.path.join(self.source_folder, "Makefile.org") - if not "CROSS_COMPILE" in os.environ: - cc = os.environ.get("CC", "cc") - gen_info = json.loads(load(self, os.path.join(self.generators_folder, "gen_info.conf"))) - replace_in_file(self, makefile_org, "CC= cc\n", "CC= %s %s\n" % (self._adjust_path(cc), gen_info["CFLAGS"])) - if "AR" in os.environ: - replace_in_file(self, makefile_org, "AR=ar $(ARFLAGS) r\n", "AR=%s $(ARFLAGS) r\n" % self._adjust_path(os.environ["AR"])) - if "RANLIB" in os.environ: - replace_in_file(self, makefile_org, "RANLIB= ranlib\n", "RANLIB= %s\n" % self._adjust_path(os.environ["RANLIB"])) - rc = os.environ.get("WINDRES", os.environ.get("RC")) - if rc: - replace_in_file(self, makefile_org, "RC= windres\n", "RC= %s\n" % self._adjust_path(rc)) - if "NM" in os.environ: - replace_in_file(self, makefile_org, "NM= nm\n", "NM= %s\n" % self._adjust_path(os.environ["NM"])) - if "AS" in os.environ: - replace_in_file(self, makefile_org, "AS=$(CC) -c\n", "AS=%s\n" % self._adjust_path(os.environ["AS"])) - def _get_default_openssl_dir(self): - if self.settings.os == "Linux" and self._full_version >= "1.1.0": + if self.settings.os == "Linux": return "/etc/ssl" return "res" @@ -523,21 +345,17 @@ def _configure_args(self): openssldir = self.options.openssldir or self._get_default_openssl_dir() openssldir = unix_path(self, openssldir) if self.win_bash else openssldir args = [ - '"%s"' % (self._target if self._full_version >= "1.1.0" else self._ancestor_target), - "shared" if self.options.shared else "no-shared", - "--prefix=/", - "--openssldir=\"%s\"" % openssldir, - "no-unit-test", - "no-threads" if self.options.no_threads else "threads" + f'"{self._target}"', + "shared" if self.options.shared else "no-shared", + "--prefix=/", + f"--openssldir=\"{openssldir}\"", + "no-unit-test", + "no-threads" if self.options.no_threads else "threads", + f"PERL={self._perl}", + "no-tests", + "--debug" if self.settings.build_type == "Debug" else "--release", + "--libdir=lib", # See https://github.com/openssl/openssl/blob/master/INSTALL.md#libdir ] - if self._full_version >= "1.1.1": - args.append("PERL=%s" % self._perl) - if self._full_version < "1.1.0" or self._full_version >= "1.1.1": - args.append("no-tests") - if self._full_version >= "1.1.0": - args.append("--debug" if self.settings.build_type == "Debug" else "--release") - - args.append("--libdir=lib") # See https://github.com/openssl/openssl/blob/master/INSTALL.md#libdir if self.settings.os in ["tvOS", "watchOS"]: args.append(" -DNO_FORK") # fork is not available on tvOS and watchOS @@ -553,31 +371,13 @@ def _configure_args(self): else: args.append("-fPIC" if self.options.get_safe("fPIC", True) else "no-pic") - args.append("no-md2" if self.options.get_safe("no_md2", True) else "enable-md2") + args.append("no-md2") 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__") - if self._full_version < "1.1.0": - if self.options.get_safe("no_zlib"): - args.append("no-zlib") - else: - gen_info = json.loads(load(self, os.path.join(self.generators_folder, "gen_info.conf"))) - include_path = gen_info["zlib_include_path"] - lib_path = gen_info["zlib_lib_path"] - # clang-cl doesn't like backslashes in #define CFLAGS (builldinf.h -> cversion.c) - include_path = self._adjust_path(include_path) - lib_path = self._adjust_path(lib_path) - - if self.dependencies["zlib"].options.shared: - args.append("zlib-dynamic") - else: - args.append("zlib") - - args.extend(['--with-zlib-include="%s"' % include_path, - '--with-zlib-lib="%s"' % lib_path]) if Version(conan_version).major < 2: possible_values = self.options.values.fields @@ -585,7 +385,7 @@ def _configure_args(self): possible_values = self.options.possible_values for option_name in possible_values: activated = self.options.get_safe(option_name) - if activated and option_name not in ["fPIC", "openssldir", "capieng_dialog", "enable_capieng", "no_md2"]: + if activated and option_name not in ["fPIC", "openssldir", "capieng_dialog", "enable_capieng"]: self.output.info("activated option: %s" % option_name) args.append(option_name.replace("_", "-")) return args @@ -632,13 +432,10 @@ def _create_targets(self): defines = ", ".join(f'"{d}"' for d in gen_info["DEFINES"]) defines = 'defines => add([%s]),' % defines if defines else "" ranlib = 'ranlib => "%s",' % ranlib if ranlib else "" - targets = "my %targets" if self._full_version >= "1.1.1" else "%targets" + targets = "my %targets" includes = "" - if self._asm_target: - ancestor = '[ "%s", asm("%s") ]' % (self._ancestor_target, self._asm_target) - else: - ancestor = '[ "%s" ]' % self._ancestor_target + ancestor = f'[ "{self._ancestor_target}" ]' shared_cflag = '' shared_extension = '' shared_target = '' @@ -652,7 +449,7 @@ def _create_targets(self): if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.conf.get("tools.apple:enable_bitcode", check_type=bool): cflags.append("-fembed-bitcode") cxxflags.append("-fembed-bitcode") - + config = config_template.format(targets=targets, target=self._target, ancestor=ancestor, @@ -680,10 +477,6 @@ def _perl(self): return self.dependencies.build["strawberryperl"].conf_info.get("user.strawberryperl:perl", check_type=str) return "perl" - @property - def _nmake_makefile(self): - return r"ms\ntdll.mak" if self.options.shared else r"ms\nt.mak" - @contextmanager def _make_context(self): if self._use_nmake: @@ -704,61 +497,35 @@ def sanitize_env_var(var): def build(self): apply_conandata_patches(self) autotools = Autotools(self) - if self._full_version >= "1.1.0": - self._create_targets() - else: - self._patch_configure() - self._patch_makefile_org() + self._create_targets() 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) - if self._use_nmake and self._full_version >= "1.1.0": + if self._use_nmake: self._replace_runtime_in_file(os.path.join("Configurations", "10-main.conf")) self.run(f'{self._perl} ./Configure {args}') self._patch_install_name() - if not self._use_nmake: - autotools.make() + if self._use_nmake: + self.run("nmake /F Makefile") else: - if self._full_version >= "1.1.0": - self.run('nmake /F Makefile') - else: # nmake 1.0.2 support - # Note: 1.0.2 should not be used according to the OpenSSL Project - # See https://www.openssl.org/source/ - - if not self.options.no_asm and self.settings.arch == "x86": - self.run(r"ms\do_nasm") - else: - self.run(r"ms\do_ms" if self.settings.arch == "x86" else r"ms\do_win64a") - - self._replace_runtime_in_file(os.path.join("ms", "nt.mak")) - self._replace_runtime_in_file(os.path.join("ms", "ntdll.mak")) - if self.settings.arch == "x86": - replace_in_file(self, os.path.join("ms", "nt.mak"), "-WX", "") - replace_in_file(self, os.path.join("ms", "ntdll.mak"), "-WX", "") - - # NMAKE interprets trailing backslash as line continuation - replace_in_file(self, self._nmake_makefile, 'INSTALLTOP=\\', 'INSTALLTOP=/') - - self.run(f'nmake /F {self._nmake_makefile}') + autotools.make() def _patch_install_name(self): if is_apple_os(self) and self.options.shared: old_str = '-install_name $(INSTALLTOP)/$(LIBDIR)/' new_str = '-install_name @rpath/' - makefile = "Makefile" if self._full_version >= "1.1.1" else "Makefile.shared" - replace_in_file(self, makefile, old_str, new_str) + replace_in_file(self, "Makefile", old_str, new_str) if self._use_nmake: # NMAKE interprets trailing backslash as line continuation - if self._full_version >= "1.1.0": - replace_in_file(self, "Makefile", 'INSTALLTOP_dir=\\', 'INSTALLTOP_dir=/') + replace_in_file(self, "Makefile", 'INSTALLTOP_dir=\\', 'INSTALLTOP_dir=/') def _replace_runtime_in_file(self, filename): runtime = msvc_runtime_flag(self) @@ -769,44 +536,18 @@ def _replace_runtime_in_file(self, filename): def package(self): copy(self, "*LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"), keep_path=False) if self._use_nmake: - args = [] - if self._full_version >= "1.1.0": - target = "install_sw" - args.append(f"DESTDIR={self.package_folder}") - else: # 1.0.2 support - target = "install" - args.append(f"INSTALLTOP={self.package_folder}") - openssldir = self.options.openssldir or self._get_default_openssl_dir() - args.append(f"OPENSSLDIR={os.path.join(self.package_folder, openssldir)}") - with chdir(self, self.source_folder): - if self._full_version >= "1.1.0": - self.run(f'nmake -f Makefile {target} {" ".join(args)}') - else: # 1.0.2 support - self.run(f'nmake -f {self._nmake_makefile} {target} {" ".join(args)}') + self.run(f"nmake -f Makefile install_sw DESTDIR={self.package_folder}") rm(self, "*.pdb", self.package_folder, recursive=True) - if self.settings.build_type == "Debug" and self._full_version >= "1.1.0": + if self.settings.build_type == "Debug": with chdir(self, os.path.join(self.package_folder, "lib")): rename(self, "libssl.lib", "libssld.lib") rename(self, "libcrypto.lib", "libcryptod.lib") else: autotools = Autotools(self) - args = [] - target = "install_sw" - if self._full_version >= "1.1.0": - args.append(f"DESTDIR={unix_path(self, self.package_folder)}") - else: # 1.0.2 support - args.append(f"INSTALL_PREFIX={unix_path(self, self.package_folder)}") - with chdir(self, self.source_folder): - autotools.make(target=target, args=args) - - # Old OpenSSL version family has issues with permissions. - # See https://github.com/conan-io/conan/issues/5831 - if self._full_version < "1.1.0" and self.options.shared and self.settings.os in ("Android", "FreeBSD", "Linux"): - with chdir(self, os.path.join(self.package_folder, "lib")): - os.chmod("libssl.so.1.0.0", 0o755) - os.chmod("libcrypto.so.1.0.0", 0o755) + args = [f"DESTDIR={unix_path(self, self.package_folder)}"] + autotools.make(target="install_sw", args=args) if self.options.shared: libdir = os.path.join(self.package_folder, "lib") @@ -879,21 +620,14 @@ def package_info(self): self.cpp_info.components["ssl"].set_property("pkg_config_name", "libssl") if self._use_nmake: libsuffix = "d" if self.settings.build_type == "Debug" else "" - if self._full_version < "1.1.0": - self.cpp_info.components["ssl"].libs = ["ssleay32"] - self.cpp_info.components["crypto"].libs = ["libeay32"] - else: - self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix] - self.cpp_info.components["crypto"].libs = ["libcrypto" + libsuffix] + self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix] + self.cpp_info.components["crypto"].libs = ["libcrypto" + libsuffix] else: self.cpp_info.components["ssl"].libs = ["ssl"] self.cpp_info.components["crypto"].libs = ["crypto"] self.cpp_info.components["ssl"].requires = ["crypto"] - if self._full_version < "1.1.0" and not self.options.get_safe("no_zlib"): - self.cpp_info.components["crypto"].requires = ["zlib::zlib"] - if self.settings.os == "Windows": self.cpp_info.components["crypto"].system_libs.extend(["crypt32", "ws2_32", "advapi32", "user32", "bcrypt"]) elif self.settings.os in ["Linux", "FreeBSD"]: @@ -905,6 +639,8 @@ def package_info(self): elif self.settings.os == "Neutrino": self.cpp_info.components["crypto"].system_libs.append("atomic") self.cpp_info.components["ssl"].system_libs.append("atomic") + self.cpp_info.components["crypto"].system_libs.append("socket") + self.cpp_info.components["ssl"].system_libs.append("socket") # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "OpenSSL" diff --git a/recipes/openssl/1.x.x/patches/1.0.2u-darwin-arm64.patch b/recipes/openssl/1.x.x/patches/1.0.2u-darwin-arm64.patch deleted file mode 100644 index f04fd91d793b27..00000000000000 --- a/recipes/openssl/1.x.x/patches/1.0.2u-darwin-arm64.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- Configure 2019-12-20 14:02:41.000000000 +0100 -+++ Configure 2020-11-22 16:23:13.000000000 +0100 -@@ -650,7 +650,9 @@ - "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", - "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", - "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", -+"darwin64-arm64-cc","cc:-arch arm64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch arm64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", - "debug-darwin64-x86_64-cc","cc:-arch x86_64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", -+"debug-darwin64-arm64-cc","cc:-arch arm64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch arm64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", - "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", - # iPhoneOS/iOS - "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", diff --git a/recipes/openssl/3.x.x/conandata.yml b/recipes/openssl/3.x.x/conandata.yml index d51b393f65f34c..ca3f66a360ac38 100644 --- a/recipes/openssl/3.x.x/conandata.yml +++ b/recipes/openssl/3.x.x/conandata.yml @@ -1,30 +1,42 @@ sources: + 3.2.0: + url: + - "https://www.openssl.org/source/openssl-3.2.0.tar.gz" + - "https://github.com/openssl/openssl/releases/download/openssl-3.2.0/openssl-3.2.0.tar.gz" + sha256: 14c826f07c7e433706fb5c69fa9e25dab95684844b4c962a2cf1bf183eb4690e + 3.1.4: + url: + - "https://www.openssl.org/source/openssl-3.1.4.tar.gz" + - "https://github.com/openssl/openssl/releases/download/openssl-3.1.4/openssl-3.1.4.tar.gz" + sha256: 840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3 + 3.1.3: + url: + - "https://www.openssl.org/source/openssl-3.1.3.tar.gz" + - "https://github.com/openssl/openssl/releases/download/openssl-3.1.3/openssl-3.1.3.tar.gz" + sha256: f0316a2ebd89e7f2352976445458689f80302093788c466692fb2a188b2eacf6 + 3.1.2: + url: + - "https://www.openssl.org/source/openssl-3.1.2.tar.gz" + - "https://github.com/openssl/openssl/releases/download/openssl-3.1.2/openssl-3.1.2.tar.gz" + sha256: a0ce69b8b97ea6a35b96875235aa453b966ba3cba8af2de23657d8b6767d6539 3.1.1: url: - "https://www.openssl.org/source/openssl-3.1.1.tar.gz" - "https://github.com/openssl/openssl/releases/download/openssl-3.1.1/openssl-3.1.1.tar.gz" sha256: b3aa61334233b852b63ddb048df181177c2c659eb9d4376008118f9c08d07674 - 3.1.0: - url: - - "https://www.openssl.org/source/openssl-3.1.0.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.1.0/openssl-3.1.0.tar.gz" - sha256: aaa925ad9828745c4cad9d9efeb273deca820f2cdcf2c3ac7d7c1212b7c497b4 - 3.0.9: - url: - - "https://www.openssl.org/source/openssl-3.0.9.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.0.9/openssl-3.0.9.tar.gz" - sha256: eb1ab04781474360f77c318ab89d8c5a03abc38e63d65a603cabbf1b00a1dc90 - 3.0.8: - url: - - "https://www.openssl.org/source/openssl-3.0.8.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.0.8/openssl-3.0.8.tar.gz" - sha256: 6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e - 3.0.7: + 3.0.12: url: - - "https://www.openssl.org/source/openssl-3.0.7.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.0.7/openssl-3.0.7.tar.gz" - sha256: 83049d042a260e696f62406ac5c08bf706fd84383f945cf21bd61e9ed95c396e - 3.0.5: + - "https://www.openssl.org/source/openssl-3.0.12.tar.gz" + - "https://github.com/openssl/openssl/releases/download/openssl-3.0.12/openssl-3.0.12.tar.gz" + sha256: f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61 + 3.0.11: url: - - "https://www.openssl.org/source/openssl-3.0.5.tar.gz" - sha256: aa7d8d9bef71ad6525c55ba11e5f4397889ce49c2c9349dcea6d3e4f0b024a7a + - "https://www.openssl.org/source/openssl-3.0.11.tar.gz" + - "https://github.com/openssl/openssl/releases/download/openssl-3.0.11/openssl-3.0.11.tar.gz" + sha256: b3425d3bb4a2218d0697eb41f7fc0cdede016ed19ca49d168b78e8d947887f55 +patches: + 3.2.0: + - patch_file: "patches/3.2.0-fix-winsock2.patch" + patch_description: "Only include winsock2.h for struct timeval if needed" + patch_type: "bugfix" + patch_source: "https://github.com/openssl/openssl/commit/ba58e9f1e22dd9ee2e37078640dcbe9f520a555d" diff --git a/recipes/openssl/3.x.x/conanfile.py b/recipes/openssl/3.x.x/conanfile.py index 59da5e3bc24344..0aebce72e25fa2 100644 --- a/recipes/openssl/3.x.x/conanfile.py +++ b/recipes/openssl/3.x.x/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name, is_apple_os, XCRun from conan.tools.build import build_jobs -from conan.tools.files import chdir, copy, get, rename, replace_in_file, rmdir, save +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, replace_in_file, rmdir, save from conan.tools.gnu import AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path @@ -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], @@ -30,6 +31,7 @@ class OpenSSLConan(ConanFile): "capieng_dialog": [True, False], "enable_capieng": [True, False], "no_aria": [True, False], + "no_autoload_config": [True, False], "no_asm": [True, False], "no_async": [True, False], "no_blake2": [True, False], @@ -89,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) @@ -111,9 +126,23 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): if not self.options.no_zlib: - self.requires("zlib/1.2.13") + 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": @@ -126,32 +155,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): @@ -338,6 +343,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() @@ -374,17 +384,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") @@ -392,8 +398,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(): @@ -401,7 +407,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() @@ -438,9 +444,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) @@ -481,7 +484,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: - command.append(f"DESTDIR={self.package_folder}") + command.append(f"DESTDIR={self._adjust_path(self.package_folder)}") if targets: command.extend(targets) if not self._use_nmake: @@ -497,7 +500,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) @@ -516,8 +519,10 @@ def _make_install(self): self._run_make(targets=["install_sw"], parallel=False, install=True) def build(self): + apply_conandata_patches(self) self._make() - self.run(f"{self._perl} {self.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): @@ -657,6 +662,8 @@ def package_info(self): elif self.settings.os == "Neutrino": self.cpp_info.components["crypto"].system_libs.append("atomic") self.cpp_info.components["ssl"].system_libs.append("atomic") + self.cpp_info.components["crypto"].system_libs.append("socket") + self.cpp_info.components["ssl"].system_libs.append("socket") self.cpp_info.components["crypto"].set_property("cmake_target_name", "OpenSSL::Crypto") self.cpp_info.components["crypto"].set_property("pkg_config_name", "libcrypto") @@ -672,4 +679,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/openssl/3.x.x/patches/3.2.0-fix-winsock2.patch b/recipes/openssl/3.x.x/patches/3.2.0-fix-winsock2.patch new file mode 100644 index 00000000000000..6e91678b02dd73 --- /dev/null +++ b/recipes/openssl/3.x.x/patches/3.2.0-fix-winsock2.patch @@ -0,0 +1,36 @@ +From ba58e9f1e22dd9ee2e37078640dcbe9f520a555d Mon Sep 17 00:00:00 2001 +From: Hugo Landau +Date: Fri, 24 Nov 2023 10:03:30 +0000 +Subject: [PATCH] Only include winsock2.h for struct timeval if needed + +Fixes #22811 + +Reviewed-by: Tomas Mraz +Reviewed-by: Matt Caswell +Reviewed-by: Matthias St. Pierre +(Merged from https://github.com/openssl/openssl/pull/22813) +--- + include/openssl/e_ostime.h | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/include/openssl/e_ostime.h b/include/openssl/e_ostime.h +index 8a7cc9880fa79..0e17487504992 100644 +--- a/include/openssl/e_ostime.h ++++ b/include/openssl/e_ostime.h +@@ -22,7 +22,15 @@ + */ + + # if defined(OPENSSL_SYS_WINDOWS) +-# include ++# if !defined(_WINSOCKAPI_) ++ /* ++ * winsock2.h defines _WINSOCK2API_ and both winsock2.h and winsock.h define ++ * _WINSOCKAPI_. Both of these provide struct timeval. Don't include ++ * winsock2.h if either header has been included to avoid breakage with ++ * applications that prefer to use over . ++ */ ++# include ++# endif + # else + # include + # endif diff --git a/recipes/openssl/config.yml b/recipes/openssl/config.yml index baf4bcb4f9215d..816020f3de15ee 100644 --- a/recipes/openssl/config.yml +++ b/recipes/openssl/config.yml @@ -1,31 +1,21 @@ versions: + # 3.2.x releases + 3.2.0: + folder: "3.x.x" # 3.1.x releases - 3.1.1: + 3.1.4: folder: "3.x.x" - 3.1.0: + 3.1.3: folder: "3.x.x" - # 3.0.x releases - 3.0.9: + 3.1.2: folder: "3.x.x" - 3.0.8: + 3.1.1: folder: "3.x.x" - 3.0.7: + # 3.0.x releases + 3.0.12: folder: "3.x.x" - 3.0.5: + 3.0.11: folder: "3.x.x" - # 1.1.1x releases - 1.1.1u: - folder: "1.x.x" - 1.1.1t: - folder: "1.x.x" - 1.1.1s: - folder: "1.x.x" - 1.1.1q: - folder: "1.x.x" - # 1.1.0x releases - 1.1.0l: - folder: "1.x.x" - # 1.0.2x releases - 1.0.2u: + 1.1.1w: folder: "1.x.x" diff --git a/recipes/opensubdiv/all/conandata.yml b/recipes/opensubdiv/all/conandata.yml index 8e41ab1d1bb93e..803deaf9df19e9 100644 --- a/recipes/opensubdiv/all/conandata.yml +++ b/recipes/opensubdiv/all/conandata.yml @@ -1,11 +1,18 @@ sources: + "3.6.0": + url: "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/refs/tags/v3_6_0.tar.gz" + sha256: "bebfd61ab6657a4f4ff27845fb66a167d00395783bfbd253254d87447ed1d879" "3.5.0": - url: "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v3_5_0.zip" - sha256: "1b2916d57173ac523acd334fb6e25623ddfed3c342f3c2aadfe4d1d0be6e7657" + url: "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/refs/tags/v3_5_0.tar.gz" + sha256: "8f5044f453b94162755131f77c08069004f25306fd6dc2192b6d49889efb8095" "3.4.4": - url: "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v3_4_4.zip" - sha256: "04b52a67e90a56b18d9ddd0384630f43b5263a8fdee1afae081e32d7b23cd5ec" + url: "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/refs/tags/v3_4_4.tar.gz" + sha256: "20d49f80a2b778ad4d01f091ad88d8c2f91cf6c7363940c6213241ce6f1048fb" patches: + "3.6.0": + - patch_file: "patches/3.6.0-0002-cmake-no-rpath.patch" + patch_description: "CMake: do not populate rpath with absolute paths" + patch_type: "conan" "3.5.0": - patch_file: "patches/3.4.4-0002-cmake-no-rpath.patch" patch_description: "CMake: do not populate rpath with absolute paths" diff --git a/recipes/opensubdiv/all/conanfile.py b/recipes/opensubdiv/all/conanfile.py index 1522234dcfaac8..6f46f7d0625fe9 100644 --- a/recipes/opensubdiv/all/conanfile.py +++ b/recipes/opensubdiv/all/conanfile.py @@ -81,7 +81,12 @@ def layout(self): def requirements(self): if self.options.with_tbb: - self.requires("onetbb/2021.8.0") + # OpenSubdiv < 3.6.0 support only onettbb/2020.x.x + # https://github.com/PixarAnimationStudios/OpenSubdiv/pull/1317 + if Version(self.version) < "3.6.0": + self.requires("onetbb/2020.3.3", transitive_headers=True) + else: + self.requires("onetbb/2021.10.0", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/opensubdiv/all/patches/3.6.0-0002-cmake-no-rpath.patch b/recipes/opensubdiv/all/patches/3.6.0-0002-cmake-no-rpath.patch new file mode 100644 index 00000000000000..e8cb72fb5398d4 --- /dev/null +++ b/recipes/opensubdiv/all/patches/3.6.0-0002-cmake-no-rpath.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8620cf3..aba7a90 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -157,12 +157,12 @@ if (NOT CMAKE_COMPILER_IS_ICC) + # sequences of ':' that this command causes. The consequence is that examples + # built and installed using icc will not have an rpath pointing to the built + # OSD library which they depend on and will have to set LD_LIBRARY_PATH instead. +- list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") ++# list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + endif() + + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH +-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) ++#SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # ensure that ARC is shown as enabled in the Xcode UI + if(CMAKE_GENERATOR STREQUAL "Xcode") diff --git a/recipes/opensubdiv/config.yml b/recipes/opensubdiv/config.yml index 6ef9c2e0ceacc9..fde3364b74fa38 100644 --- a/recipes/opensubdiv/config.yml +++ b/recipes/opensubdiv/config.yml @@ -1,4 +1,6 @@ versions: + "3.6.0": + folder: all "3.5.0": folder: all "3.4.4": diff --git a/recipes/opentdf-client/all/CMakeLists.txt b/recipes/opentdf-client/all/CMakeLists.txt deleted file mode 100644 index 93dc9e86f93f9e..00000000000000 --- a/recipes/opentdf-client/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(opentdf-client) - -set(CMAKE_CXX_STANDARD 17) - -include(${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/opentdf-client/all/conan_cmake_project_include.cmake b/recipes/opentdf-client/all/conan_cmake_project_include.cmake new file mode 100644 index 00000000000000..795904b844ae40 --- /dev/null +++ b/recipes/opentdf-client/all/conan_cmake_project_include.cmake @@ -0,0 +1,11 @@ +find_package(Boost REQUIRED) +find_package(OpenSSL REQUIRED) +find_package(Microsoft.GSL REQUIRED) +find_package(nlohmann_json REQUIRED) +find_package(libxml2 REQUIRED) +find_package(jwt-cpp REQUIRED) +find_package(ZLIB REQUIRED) +if(opentdf_VERSION VERSION_GREATER_EQUAL "1.4.0") + find_package(magic_enum REQUIRED) +endif() +link_libraries(Boost::boost OpenSSL::SSL Microsoft.GSL::GSL nlohmann_json::nlohmann_json LibXml2::LibXml2 jwt-cpp::jwt-cpp $ ZLIB::ZLIB) diff --git a/recipes/opentdf-client/all/conandata.yml b/recipes/opentdf-client/all/conandata.yml index 17500dcbe918bd..9d4618fc288dc9 100644 --- a/recipes/opentdf-client/all/conandata.yml +++ b/recipes/opentdf-client/all/conandata.yml @@ -1,37 +1,32 @@ sources: + "1.5.6": + url: "https://github.com/opentdf/client-cpp/archive/1.5.6.tar.gz" + sha256: "3f46d9a175ce67fc2814faf34a42bc6ff9519d9a80ae7dbdd8d34317231a404a" + "1.5.4": + url: "https://github.com/opentdf/client-cpp/archive/1.5.4.tar.gz" + sha256: "7902d3f09b632ac3827f3c9c8fd1a1f7c8fdff82eeed2157385278b91a7f515f" + "1.5.3": + url: "https://github.com/opentdf/client-cpp/archive/1.5.3.tar.gz" + sha256: "43812a99b8942cd8f600f7ea284118e8af7d000705b2602991f889fe49dd3455" + "1.5.0": + url: "https://github.com/opentdf/client-cpp/archive/1.5.0.tar.gz" + sha256: "0d6134634c0c6fde5e8457361332242259e1ef238e5254ccbed2f94549998c48" + "1.4.0": + url: "https://github.com/opentdf/client-cpp/archive/1.4.0.tar.gz" + sha256: "0ef9cdf5e49f83a8ddcde10d64cdf9108652e781396cfab000f50cc067e6f795" "1.3.10": url: "https://github.com/opentdf/client-cpp/archive/1.3.10.tar.gz" sha256: "539bd5e64bceb86f63b3f7db75de470d5ea1d52ae6436a6a2d6789f7d0710dd4" - "1.3.9": - url: "https://github.com/opentdf/client-cpp/archive/1.3.9.tar.gz" - sha256: "8fdd88d90afe865ca86261c26abd1ca5e9895261490252199b7f9d4910ca0b49" - "1.3.8": - url: "https://github.com/opentdf/client-cpp/archive/1.3.8.tar.gz" - sha256: "0d73bd17f6d211c04136239e1db630e1ab320a6e41bd5c18533c44381519842c" - "1.3.6": - url: "https://github.com/opentdf/client-cpp/archive/1.3.6.tar.gz" - sha256: "e0d4cf1d0b1824d903a2b0ec1da528acb42623e32f3ca36aa28b2e950c3cc7a0" - "1.3.4": - url: "https://github.com/opentdf/client-cpp/archive/1.3.4.tar.gz" - sha256: "4b9836bff368249b709fc40e67c3a8664fed85a5d8247475ca1f741486210409" - "1.3.3": - url: "https://github.com/opentdf/client-cpp/archive/1.3.3.tar.gz" - sha256: "7949e662dc55a425771e5ecf2d96e25295d1e2394e805608aed72d1131896948" - "1.3.2": - url: "https://github.com/opentdf/client-cpp/archive/1.3.2.tar.gz" - sha256: "d9a38d3aa6114159c90e0c254c78ddda921e2d520851e4def57f3cd26c564b16" - "1.2.0": - url: "https://github.com/opentdf/client-cpp/archive/1.2.0.tar.gz" - sha256: "15828038809ed291ff7881206a675abc5162e1175c8b515363b9c584aebb08f7" - "1.1.6": - url: "https://github.com/opentdf/client-cpp/archive/1.1.6.tar.gz" - sha256: "83992c37c9a58ae2152660a4ffbf1784fe63d7a9e7b8466d10ca1074697b3d3a" - "1.1.5": - url: "https://github.com/opentdf/client-cpp/archive/1.1.5.tar.gz" - sha256: "8fd5b22b36b19cd58a18f63cbffe3d538263ef3aecde4802059951c4eb5ce044" - "1.1.3": - url: "https://github.com/opentdf/client-cpp/archive/1.1.3.tar.gz" - sha256: "67855999010f9c1496e170ad885f73b854f91eb1539e3c20d74b162295d5c732" - "1.1.2": - url: "https://github.com/opentdf/client-cpp/archive/1.1.2.tar.gz" - sha256: "4e41a18ef9d47aa9f964beffa78fdd4290a5f50336c6e4dc3c9bf2dd4b075d10" +patches: + "1.5.0": + - patch_file: "patches/1.3.10-0001-cmake-fixes.patch" + patch_description: "CMake build fixes for Conan 2.0-compatible recipe" + patch_type: "conan" + "1.4.0": + - patch_file: "patches/1.3.10-0001-cmake-fixes.patch" + patch_description: "CMake build fixes for Conan 2.0-compatible recipe" + patch_type: "conan" + "1.3.10": + - patch_file: "patches/1.3.10-0001-cmake-fixes.patch" + patch_description: "CMake build fixes for Conan 2.0-compatible recipe" + patch_type: "conan" diff --git a/recipes/opentdf-client/all/conanfile.py b/recipes/opentdf-client/all/conanfile.py index 06337331572114..8d420a25df14ff 100644 --- a/recipes/opentdf-client/all/conanfile.py +++ b/recipes/opentdf-client/all/conanfile.py @@ -1,35 +1,38 @@ -from conans import CMake +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy, patch 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.files import apply_conandata_patches, export_conandata_patches, replace_in_file, get, copy from conan.tools.microsoft import is_msvc_static_runtime -import functools -import os +from conan.tools.scm import Version -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.53.0" class OpenTDFConan(ConanFile): name = "opentdf-client" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://www.virtru.com" - topics = ("opentdf", "opentdf-client", "tdf", "virtru") description = "openTDF core c++ client library for creating and accessing TDF protected data" license = "BSD-3-Clause-Clear" - generators = "cmake", "cmake_find_package" - settings = "os", "arch", "compiler", "build_type" - options = {"fPIC": [True, False]} - default_options = {"fPIC": True} + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.virtru.com" + topics = ("opentdf", "tdf", "virtru") - @property - def _source_subfolder(self): - return "source_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 _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + export_conandata_patches(self) @property def _minimum_cpp_standard(self): @@ -40,84 +43,122 @@ def _minimum_compilers_version(self): return { "Visual Studio": "17" if Version(self.version) < "1.1.5" else "15", "msvc": "193" if Version(self.version) < "1.1.5" else "191", - "gcc": "7.5.0", + "gcc": "7.5", "clang": "12", - "apple-clang": "12.0.0", + "apple-clang": "12", } - def export_sources(self): - self.copy("CMakeLists.txt") - for data in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(data["patch_file"]) + 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): + # Uses openssl 3.x for 1.5.0 and newer + if Version(self.version) >= "1.5.0": + self.requires("openssl/[>=3.1 <4]") + else: + self.requires("openssl/1.1.1w") + # Uses magic_enum for 1.4.0 and newer + if Version(self.version) >= "1.4.0": + self.requires("magic_enum/0.8.2") + self.requires("ms-gsl/2.1.0") + self.requires("nlohmann_json/3.11.2") + self.requires("jwt-cpp/0.4.0") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("boost/1.83.0") + self.requires("libxml2/2.11.4") def validate(self): - # check minimum cpp standard supported by compiler if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) # check minimum version of compiler min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) if not min_version: - self.output.warn(f'{self.name} recipe lacks information about the {self.settings.compiler} compiler support.') + self.output.warning( + f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support." + ) else: if Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration(f'{self.name} requires {self.settings.compiler} {self.settings.compiler.version} but found {min_version}') + raise ConanInvalidConfiguration( + f"{self.name} requires {self.settings.compiler} {self.settings.compiler.version} " + f"but found {min_version}" + ) # Disallow MT and MTd if is_msvc_static_runtime(self): - raise ConanInvalidConfiguration(f'{self.name} can not be built with MT or MTd at this time') + raise ConanInvalidConfiguration(f"{self.name} can not be built with MT or MTd at this time") - def requirements(self): - self.requires("openssl/1.1.1q") - self.requires("ms-gsl/2.1.0") - self.requires("nlohmann_json/3.11.1") - self.requires("jwt-cpp/0.4.0") - # Use newer boost+libxml2 after 1.3.6 - if Version(self.version) <= "1.3.6": - self.requires("boost/1.79.0") - self.requires("libxml2/2.9.14") - else: - self.requires("boost/1.81.0") - self.requires("libxml2/2.10.3") - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.name} does not currently support shared library on Windows") def source(self): - get(self, **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): - for data in self.conan_data.get("patches", {}).get(self.version, []): - patch(self, **data) + def generate(self): + tc = CMakeToolchain(self) + if not self.settings.get_safe("compiler.cppstd"): + tc.variables["CMAKE_CXX_STANDARD"] = 17 + tc.cache_variables["CMAKE_PROJECT_opentdf_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") + tc.generate() + tc = CMakeDeps(self) + tc.generate() - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure(build_folder=self._build_subfolder) - return cmake + def _patch_sources(self): + apply_conandata_patches(self) 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() - copy(self, "*", dst=os.path.join(self.package_folder, "lib"), src=os.path.join(os.path.join(self._source_subfolder,"tdf-lib-cpp"), "lib"), keep_path=False) - copy(self, "*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(os.path.join(self._source_subfolder,"tdf-lib-cpp"), "include"), keep_path=False) - copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self._source_subfolder, ignore_case=True, keep_path=False) + copy(self, "*", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(os.path.join(self.source_folder, "tdf-lib-cpp"), "lib"), + keep_path=False) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(os.path.join(self.source_folder, "tdf-lib-cpp"), "include"), + keep_path=False) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ignore_case=True, + keep_path=False) - # TODO - this only advertises the static lib, add dynamic lib also def package_info(self): self.cpp_info.set_property("cmake_file_name", "opentdf-client") self.cpp_info.set_property("cmake_target_name", "opentdf-client::opentdf-client") self.cpp_info.set_property("pkg_config_name", "opentdf-client") - self.cpp_info.components["libopentdf"].libs = ["opentdf_static"] + self.cpp_info.components["libopentdf"].libs = ["opentdf_static"] if not self.options.shared else ["opentdf"] self.cpp_info.components["libopentdf"].set_property("cmake_target_name", "copentdf-client::opentdf-client") self.cpp_info.components["libopentdf"].names["cmake_find_package"] = "opentdf-client" self.cpp_info.components["libopentdf"].names["cmake_find_package_multi"] = "opentdf-client" - self.cpp_info.components["libopentdf"].names["pkg_config"] = "opentdf-client" - self.cpp_info.components["libopentdf"].requires = ["openssl::openssl", "boost::boost", "ms-gsl::ms-gsl", "libxml2::libxml2", "jwt-cpp::jwt-cpp", "nlohmann_json::nlohmann_json"] + self.cpp_info.components["libopentdf"].requires = [ + "openssl::openssl", + "boost::boost", + "ms-gsl::ms-gsl", + "libxml2::libxml2", + "jwt-cpp::jwt-cpp", + "nlohmann_json::nlohmann_json", + "zlib::zlib" + ] + if Version(self.version) >= "1.4.0": + self.cpp_info.components["libopentdf"].requires.append("magic_enum::magic_enum") if Version(self.version) < "1.1.0": self.cpp_info.components["libopentdf"].requires.append("libarchive::libarchive") + if Version(self.version) >= "1.4.0": + self.cpp_info.components["libopentdf"].requires.append("magic_enum::magic_enum") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/opentdf-client/all/patches/1.3.10-0001-cmake-fixes.patch b/recipes/opentdf-client/all/patches/1.3.10-0001-cmake-fixes.patch new file mode 100644 index 00000000000000..9901f248faf037 --- /dev/null +++ b/recipes/opentdf-client/all/patches/1.3.10-0001-cmake-fixes.patch @@ -0,0 +1,51 @@ +diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt +index d7e1dc1..aeb3b2c 100644 +--- a/src/lib/CMakeLists.txt ++++ b/src/lib/CMakeLists.txt +@@ -99,7 +99,9 @@ set(TDF_COMBINED_LIB_FULL_PATH ${TDF_LIB_DIR}/${TDF_COMBINED_LIB_FILENAME}) + message(STATUS "Combined full path: ${TDF_COMBINED_LIB_FULL_PATH}") + + #TODO: Also need to handle iOS and Android(arm64). +-if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ++if(TRUE) ++ message(STATUS "Skipping generation of combined static library") ++elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + + FOREACH (LDIR ${CONAN_LIB_DIRS}) + set(V_COMBINED_LIB_DIRS ${V_COMBINED_LIB_DIRS} -L${LDIR}) +@@ -155,8 +157,6 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") + lib -out:${TDF_LIB_DIR}/${TDF_COMBINED_LIB_FILENAME} ${TDF_LIB_DIR}/${TDF_STATIC_LIB_FILENAME} ${V_COMBINED_LIB_DIRS} ${V_COMBINED_LIB_NAMES} + ) + ) +-else() +- message(STATUS "${CMAKE_SYSTEM_NAME} - unknown system FIXME........") + endif() + + # generate the shared library from the library sources +@@ -187,16 +187,19 @@ install(DIRECTORY DESTINATION ${TDF_LIB_INSTALL_LOCATION}) + # move the headers(to include) and tdf(to lib) directory under tdf-lib-cpp + install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ + DESTINATION ${TDF_LIB_INSTALL_LOCATION}/include) +- +-install(FILES ${TDF_STATIC_LIB_FULL_PATH} +- DESTINATION ${TDF_LIB_INSTALL_LOCATION}/lib) + +-install(FILES ${TDF_COMBINED_LIB_FULL_PATH} +- DESTINATION ${TDF_LIB_INSTALL_LOCATION}/lib) ++if(NOT BUILD_SHARED_LIBS) ++ install(FILES $ ++ DESTINATION ${TDF_LIB_INSTALL_LOCATION}/lib) ++endif() ++ ++# Skip combined static library for Conan Center Index package ++# install(FILES ${TDF_COMBINED_LIB_FULL_PATH} ++# DESTINATION ${TDF_LIB_INSTALL_LOCATION}/lib) + + if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + message(STATUS "Skipping shared lib on windows") +-else() +- install(FILES ${TDF_SHARED_LIB_FULL_PATH} ++elseif(BUILD_SHARED_LIBS) ++ install(FILES $ + DESTINATION ${TDF_LIB_INSTALL_LOCATION}/lib) + endif() diff --git a/recipes/opentdf-client/all/test_package/CMakeLists.txt b/recipes/opentdf-client/all/test_package/CMakeLists.txt index 90a74a2912fcb2..d73e39aaa8604c 100644 --- a/recipes/opentdf-client/all/test_package/CMakeLists.txt +++ b/recipes/opentdf-client/all/test_package/CMakeLists.txt @@ -1,12 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(opentdf-client CONFIG REQUIRED) +find_package(opentdf-client REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} opentdf-client::opentdf-client) diff --git a/recipes/opentdf-client/all/test_package/conanfile.py b/recipes/opentdf-client/all/test_package/conanfile.py index cffa32351d9695..ef5d7042163ecc 100644 --- a/recipes/opentdf-client/all/test_package/conanfile.py +++ b/recipes/opentdf-client/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -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_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) @@ -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/opentdf-client/config.yml b/recipes/opentdf-client/config.yml index 6747766ab2d490..e621751db7c3c7 100644 --- a/recipes/opentdf-client/config.yml +++ b/recipes/opentdf-client/config.yml @@ -1,25 +1,13 @@ versions: - "1.3.10": - folder: all - "1.3.9": - folder: all - "1.3.8": - folder: all - "1.3.6": + "1.5.6": folder: all - "1.3.4": + "1.5.4": folder: all - "1.3.3": + "1.5.3": folder: all - "1.3.2": + "1.5.0": folder: all - "1.2.0": + "1.4.0": folder: all - "1.1.6": - folder: all - "1.1.5": - folder: all - "1.1.3": - folder: all - "1.1.2": + "1.3.10": folder: all diff --git a/recipes/opentelemetry-proto/all/conandata.yml b/recipes/opentelemetry-proto/all/conandata.yml index 88d8d71b3c37a9..94ffeec1c78316 100644 --- a/recipes/opentelemetry-proto/all/conandata.yml +++ b/recipes/opentelemetry-proto/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.0.0.tar.gz" + sha256: "a13a1a7b76a1f22a0ca2e6c293e176ffef031413ab8ba653a82a1dbc286a3a33" "0.20.0": url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v0.20.0.tar.gz" sha256: "6ab267cf82832ed60ad075d574c78da736193eecb9693e8a8d02f65d6d3f3520" diff --git a/recipes/opentelemetry-proto/all/conanfile.py b/recipes/opentelemetry-proto/all/conanfile.py index 05dc5d3a1f5cce..b24f1a700e4468 100644 --- a/recipes/opentelemetry-proto/all/conanfile.py +++ b/recipes/opentelemetry-proto/all/conanfile.py @@ -1,19 +1,22 @@ +import os + from conan import ConanFile -from conan.tools.files import get, copy, save +from conan.tools.files import get, copy from conan.tools.layout import basic_layout -import os required_conan_version = ">=1.52.0" + class OpenTelemetryProtoConan(ConanFile): name = "opentelemetry-proto" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/open-telemetry/opentelemetry-proto" description = "Protobuf definitions for the OpenTelemetry protocol (OTLP)" - topics = ("opentelemetry", "telemetry", "otlp") + topics = ("opentelemetry", "telemetry", "otlp", "pre-built") + + package_type = "build-scripts" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True def layout(self): basic_layout(self, src_folder="src") @@ -21,23 +24,22 @@ def layout(self): def package_id(self): self.info.clear() - def source(self): + def build(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - copy( - self, - pattern="*.proto", - dst=os.path.join(self.package_folder, "res"), - src=self.source_folder, - ) - # satisfy KB-H014 (header_only recipes require headers) - save(self, os.path.join(self.package_folder, "include", "dummy_header.h"), "\n") + copy(self, pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), src=self.build_folder) + copy(self, pattern="*.proto", + dst=os.path.join(self.package_folder, "res"), src=self.build_folder) def package_info(self): - self.conf_info.define("user.opentelemetry-proto:proto_root", os.path.join(self.package_folder, "res")) + self.conf_info.define("user.opentelemetry-proto:proto_root", + os.path.join(self.package_folder, "res")) + self.cpp_info.resdirs = ["res"] + self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] + # TODO: to remove in conan v2 self.user_info.proto_root = os.path.join(self.package_folder, "res") diff --git a/recipes/opentelemetry-proto/all/test_package/conanfile.py b/recipes/opentelemetry-proto/all/test_package/conanfile.py index 468f9bc6b74335..43eb202cc1d231 100644 --- a/recipes/opentelemetry-proto/all/test_package/conanfile.py +++ b/recipes/opentelemetry-proto/all/test_package/conanfile.py @@ -1,15 +1,14 @@ +import os + from conan import ConanFile -from conan.tools.cmake import CMakeDeps, CMakeToolchain -from conan.tools.env import VirtualBuildEnv +from conan.tools.files import save, load from conan.tools.layout import basic_layout -import os + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" test_type = "explicit" - _res_folder = "" - def layout(self): basic_layout(self, src_folder="src") @@ -17,18 +16,9 @@ def requirements(self): self.requires(self.tested_reference_str) def generate(self): - tc = CMakeToolchain(self) - tc.generate() - tc = CMakeDeps(self) - tc.generate() - tc = VirtualBuildEnv(self) - tc.generate(scope="build") - - self._res_folder = self.dependencies["opentelemetry-proto"].conf_info.get("user.opentelemetry-proto:proto_root") + save(self, os.path.join(self.build_folder, "proto_root"), self.dependencies["opentelemetry-proto"].conf_info.get("user.opentelemetry-proto:proto_root")) def test(self): - # TODO: to remove in conan v2 - if self._res_folder == "": - self._res_folder = self.deps_user_info["opentelemetry-proto"].proto_root - - assert os.path.isfile(os.path.join(self._res_folder, "opentelemetry", "proto", "common", "v1", "common.proto")) + res_folder = load(self, os.path.join(self.build_folder, "proto_root")) + proto_path = os.path.join(res_folder, "opentelemetry", "proto", "common", "v1", "common.proto") + assert os.path.isfile(proto_path) diff --git a/recipes/opentelemetry-proto/config.yml b/recipes/opentelemetry-proto/config.yml index f4d1c284073401..64c1fc73aecec0 100644 --- a/recipes/opentelemetry-proto/config.yml +++ b/recipes/opentelemetry-proto/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.0": + folder: all "0.20.0": folder: all "0.19.0": diff --git a/recipes/opentracing-cpp/all/CMakeLists.txt b/recipes/opentracing-cpp/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb93..00000000000000 --- a/recipes/opentracing-cpp/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/opentracing-cpp/all/conandata.yml b/recipes/opentracing-cpp/all/conandata.yml index 97fc5249ab98a2..98d819b31175b6 100644 --- a/recipes/opentracing-cpp/all/conandata.yml +++ b/recipes/opentracing-cpp/all/conandata.yml @@ -4,5 +4,4 @@ sources: sha256: 5b170042da4d1c4c231df6594da120875429d5231e9baa5179822ee8d1054ac3 patches: "1.6.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-Set-default-installation-folders.patch" + - patch_file: "patches/0001-Set-default-installation-folders.patch" diff --git a/recipes/opentracing-cpp/all/conanfile.py b/recipes/opentracing-cpp/all/conanfile.py index 16f16b80280d27..bd664e12782243 100644 --- a/recipes/opentracing-cpp/all/conanfile.py +++ b/recipes/opentracing-cpp/all/conanfile.py @@ -1,17 +1,21 @@ import os -from conans import ConanFile, CMake, tools +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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir + +required_conan_version = ">=1.53.0" class OpenTracingConan(ConanFile): name = "opentracing-cpp" description = "C++ implementation of the OpenTracing API http://opentracing.io" license = "Apache-2.0" - topics = ("conan", "opentracing") - homepage = "https://github.com/opentracing/opentracing-cpp" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/*.patch"] - generators = "cmake" + homepage = "https://github.com/opentracing/opentracing-cpp" + topics = "opentracing" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,15 +30,8 @@ class OpenTracingConan(ConanFile): "enable_dynamic_load": False, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @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": @@ -42,78 +39,70 @@ 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 source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_MOCKTRACER"] = self.options.enable_mocktracer + tc.variables["BUILD_DYNAMIC_LOADING"] = self.options.enable_dynamic_load + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_TESTING"] = False + tc.variables["ENABLE_LINTING"] = False + tc.generate() def build(self): - for patch in self.conan_data["patches"][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.definitions["BUILD_MOCKTRACER"] = self.options.enable_mocktracer - self._cmake.definitions[ - "BUILD_DYNAMIC_LOADING" - ] = self.options.enable_dynamic_load - self._cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared - self._cmake.definitions["BUILD_STATIC_LIBS"] = not self.options.shared - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["ENABLE_LINTING"] = False - 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() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "OpenTracing" - self.cpp_info.names["cmake_find_package_multi"] = "OpenTracing" + self.cpp_info.set_property("cmake_file_name", "OpenTracing") + self.cpp_info.set_property("cmake_target_name", "OpenTracing::OpenTracing") target_suffix = "" if self.options.shared else "-static" - lib_suffix = ( - "" if self.options.shared or self.settings.os != "Windows" else "-static" - ) + lib_suffix = "" if self.options.shared or self.settings.os != "Windows" else "-static" + # opentracing - self.cpp_info.components["opentracing"].names["cmake_find_package"] = ( - "opentracing" + target_suffix - ) - self.cpp_info.components["opentracing"].names["cmake_find_package_multi"] = ( - "opentracing" + target_suffix - ) - self.cpp_info.components["opentracing"].libs = ["opentracing" + lib_suffix] + opentracing = self.cpp_info.components["opentracing"] + opentracing.set_property("cmake_target_name", "OpenTracing::opentracing" + target_suffix) + opentracing.names["cmake_find_package"] = "opentracing" + target_suffix + opentracing.names["cmake_find_package_multi"] = "opentracing" + target_suffix + opentracing.libs = ["opentracing" + lib_suffix] if not self.options.shared: - self.cpp_info.components["opentracing"].defines.append("OPENTRACING_STATIC") + opentracing.defines.append("OPENTRACING_STATIC") if self.options.enable_dynamic_load and self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.components["opentracing"].system_libs.append("dl") + opentracing.system_libs.append("dl") # opentracing_mocktracer if self.options.enable_mocktracer: - self.cpp_info.components["opentracing_mocktracer"].names[ - "cmake_find_package" - ] = ("opentracing_mocktracer" + target_suffix) - self.cpp_info.components["opentracing_mocktracer"].names[ - "cmake_find_package_multi" - ] = ("opentracing_mocktracer" + target_suffix) - self.cpp_info.components["opentracing_mocktracer"].libs = [ - "opentracing_mocktracer" + lib_suffix - ] - self.cpp_info.components["opentracing_mocktracer"].requires = [ - "opentracing" - ] + opentracing_mocktracer = self.cpp_info.components["opentracing_mocktracer"] + opentracing_mocktracer.set_property("cmake_target_name", "OpenTracing::opentracing_mocktracer" + target_suffix) + opentracing_mocktracer.names["cmake_find_package"] = "opentracing_mocktracer" + target_suffix + opentracing_mocktracer.names["cmake_find_package_multi"] = "opentracing_mocktracer" + target_suffix + opentracing_mocktracer.libs = ["opentracing_mocktracer" + lib_suffix] + opentracing_mocktracer.requires = ["opentracing"] if not self.options.shared: - self.cpp_info.components["opentracing_mocktracer"].defines.append( - "OPENTRACING_MOCK_TRACER_STATIC" - ) + opentracing_mocktracer.defines.append("OPENTRACING_MOCK_TRACER_STATIC") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "OpenTracing" + self.cpp_info.names["cmake_find_package_multi"] = "OpenTracing" diff --git a/recipes/opentracing-cpp/all/test_package/CMakeLists.txt b/recipes/opentracing-cpp/all/test_package/CMakeLists.txt index 124ca7e918838c..e9ddbfa9df1836 100644 --- a/recipes/opentracing-cpp/all/test_package/CMakeLists.txt +++ b/recipes/opentracing-cpp/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(OpenTracing REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/opentracing-cpp/all/test_package/conanfile.py b/recipes/opentracing-cpp/all/test_package/conanfile.py index abcaeed3f89b67..ef5d7042163ecc 100644 --- a/recipes/opentracing-cpp/all/test_package/conanfile.py +++ b/recipes/opentracing-cpp/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", "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,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/opentracing-cpp/all/test_package/test_package.cpp b/recipes/opentracing-cpp/all/test_package/test_package.cpp index ca88714cbdbf78..85d21515825726 100644 --- a/recipes/opentracing-cpp/all/test_package/test_package.cpp +++ b/recipes/opentracing-cpp/all/test_package/test_package.cpp @@ -7,6 +7,6 @@ int main() { auto tracer = MakeNoopTracer(); auto span1 = tracer->StartSpan("a"); - + return 0; } diff --git a/recipes/opentracing-cpp/all/test_v1_package/CMakeLists.txt b/recipes/opentracing-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/opentracing-cpp/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/opentracing-cpp/all/test_v1_package/conanfile.py b/recipes/opentracing-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..abcaeed3f89b67 --- /dev/null +++ b/recipes/opentracing-cpp/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/openvdb/all/conanfile.py b/recipes/openvdb/all/conanfile.py index f36eb55cee0f23..10e73dc4150e40 100644 --- a/recipes/openvdb/all/conanfile.py +++ b/recipes/openvdb/all/conanfile.py @@ -79,7 +79,7 @@ def requirements(self): self.requires("onetbb/2020.3") self.requires("openexr/2.5.7") # required for IlmBase::Half if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_exr: # Not necessary now. Required for IlmBase::IlmImf self.requires("openexr/2.5.7") diff --git a/recipes/openvino/all/conandata.yml b/recipes/openvino/all/conandata.yml new file mode 100644 index 00000000000000..c1fa2ac395507d --- /dev/null +++ b/recipes/openvino/all/conandata.yml @@ -0,0 +1,76 @@ +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" + sha256: "ff88596b342440185874ddbe22874b47ad7b923f14671921af760b15c98aacd6" + "arm_compute": + url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.02.1.tar.gz" + sha256: "c3a443e26539f866969242e690cf0651ef629149741ee18732f954c734da6763" + "onednn_cpu": + url: "https://github.com/openvinotoolkit/oneDNN/archive/ae825539bd850d1ad5c83d4bb0d56c65d46d5842.tar.gz" + sha256: "1204df17785c8603f9dfa1f4f91e91e5ffd4391bf7680d2b256de2513490ebee" + "mlas": + url: "https://github.com/openvinotoolkit/mlas/archive/c7c8a631315000f17c650af34431009d2f22129c.tar.gz" + sha256: "7b790dfeef8e1dd612f920c85186c52ad3a3e2245e2a2afd6cc91ce4b1dc64a9" + "onednn_gpu": + 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" + patch_type: "portability" + patch_source: "https://github.com/openvinotoolkit/openvino/pull/19628" + - patch_file: "patches/2023.1.0/0002-core-compilation-c++17.patch" + patch_description: "Fixed OpenVINO Core compilation with C++17" + patch_type: "portability" + patch_source: "https://github.com/openvinotoolkit/openvino/pull/19707" + - patch_file: "patches/2023.1.0/0003-fixed-gpu-with-onednn-build.patch" + patch_description: "Fixed Intel GPU plugin with oneDNN" + patch_type: "portability" + # severals PR are merged into a single patch including: + # https://github.com/openvinotoolkit/openvino/pull/19668, + # https://github.com/openvinotoolkit/openvino/pull/19715, + # https://github.com/openvinotoolkit/openvino/pull/19716, + # https://github.com/openvinotoolkit/openvino/pull/19762 and + patch_source: "https://github.com/openvinotoolkit/openvino/pull/19811" + - patch_file: "patches/2023.1.0/0004-fixed-gpu-plugin-with-clang.patch" + patch_description: "Fixed order of initialization of static variables in GPU plugin compiled with clang" + patch_type: "portability" + patch_source: "https://github.com/openvinotoolkit/openvino/pull/19768" + - patch_file: "patches/2023.1.0/0005-dynamic-protobuf.patch" + patch_description: "Added a workaround for OpenVINO to work with dynamic protobuf" + patch_type: "portability" + # severals PR are merged into a single patch including: + # https://github.com/openvinotoolkit/openvino/pull/19599, + # https://github.com/openvinotoolkit/openvino/pull/19758 and + patch_source: "https://github.com/openvinotoolkit/openvino/pull/20612" + - patch_file: "patches/2023.1.0/0006-macos-14.patch" + 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/conanfile.py b/recipes/openvino/all/conanfile.py new file mode 100644 index 00000000000000..b1cfc1fd2fe867 --- /dev/null +++ b/recipes/openvino/all/conanfile.py @@ -0,0 +1,395 @@ +from conan import ConanFile +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +import functools +import os +import yaml + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.8" + +class OpenvinoConan(ConanFile): + name = "openvino" + + # Optional metadata + license = "Apache-2.0" + homepage = "https://github.com/openvinotoolkit/openvino" + url = "https://github.com/conan-io/conan-center-index" + description = "Open Visual Inference And Optimization toolkit for AI inference" + topics = ("nlp", "natural-language-processing", "ai", "computer-vision", "deep-learning", "transformers", "inference", + "speech-recognition", "yolo", "performance-boost", "diffusion-models", "recommendation-system", "stable-diffusion", + "generative-ai", "llm-inference", "optimize-ai", "deploy-ai") + package_id_non_embed_mode = "patch_mode" + package_type = "library" + short_paths = True + no_copy_source = True + + # Binary configuration + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + # HW plugins + "enable_cpu": [True, False], + "enable_gpu": [True, False], + # SW plugins + "enable_auto": [True, False], + "enable_hetero": [True, False], + "enable_auto_batch": [True, False], + # Frontends + "enable_ir_frontend": [True, False], + "enable_onnx_frontend": [True, False], + "enable_tf_frontend": [True, False], + "enable_tf_lite_frontend": [True, False], + "enable_paddle_frontend": [True, False], + "enable_pytorch_frontend": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + # HW plugins + "enable_cpu": True, + "enable_gpu": True, + # SW plugins + "enable_auto": True, + "enable_hetero": True, + "enable_auto_batch": True, + # Frontends + "enable_ir_frontend": True, + "enable_onnx_frontend": True, + "enable_tf_frontend": True, + "enable_tf_lite_frontend": True, + "enable_paddle_frontend": True, + "enable_pytorch_frontend": True + } + + @property + def _dependencies_filename(self): + return f"dependencies-{self.version}.yml" + + @property + @functools.lru_cache(1) + def _dependencies_versions(self): + dependencies_filepath = os.path.join(self.recipe_folder, "dependencies", self._dependencies_filename) + if not os.path.isfile(dependencies_filepath): + raise ConanException(f"Cannot find {dependencies_filepath}") + cached_dependencies = yaml.safe_load(open(dependencies_filepath, encoding='UTF-8')) + return cached_dependencies + + def _require(self, dependency): + if dependency not in self._dependencies_versions: + raise ConanException(f"{dependency} is missing in {self._dependencies_filename}") + return f"{dependency}/{self._dependencies_versions[dependency]}" + + @property + def _protobuf_required(self): + return self.options.enable_tf_frontend or self.options.enable_onnx_frontend or self.options.enable_paddle_frontend + + @property + def _target_arm(self): + return "arm" in self.settings.arch + + @property + def _target_x86_64(self): + return self.settings.arch == "x86_64" + + @property + def _gna_option_available(self): + return self.settings.os in ["Linux", "Windows"] and self._target_x86_64 and Version(self.version) < "2024.0.0" + + @property + def _gpu_option_available(self): + return self.settings.os != "Macos" and self._target_x86_64 + + @property + def _preprocessing_available(self): + return "ade" in self._dependencies_versions + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "9", + "apple-clang": "11", + "Visual Studio": "16", + "msvc": "192", + } + + def source(self): + get(self, **self.conan_data["sources"][self.version]["openvino"], strip_root=True) + get(self, **self.conan_data["sources"][self.version]["onednn_cpu"], strip_root=True, + destination=f"{self.source_folder}/src/plugins/intel_cpu/thirdparty/onednn") + get(self, **self.conan_data["sources"][self.version]["mlas"], strip_root=True, + destination=f"{self.source_folder}/src/plugins/intel_cpu/thirdparty/mlas") + get(self, **self.conan_data["sources"][self.version]["arm_compute"], strip_root=True, + destination=f"{self.source_folder}/src/plugins/intel_cpu/thirdparty/ComputeLibrary") + get(self, **self.conan_data["sources"][self.version]["onednn_gpu"], strip_root=True, + destination=f"{self.source_folder}/src/plugins/intel_gpu/thirdparty/onednn_gpu") + rmdir(self, f"{self.source_folder}/src/plugins/intel_gpu/thirdparty/rapidjson") + apply_conandata_patches(self) + + def export(self): + copy(self, f"dependencies/{self._dependencies_filename}", self.recipe_folder, self.export_folder) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._gpu_option_available: + del self.options.enable_gpu + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self._protobuf_required: + # even though OpenVINO can work with dynamic protobuf, it's still recommended to use static + self.options["protobuf"].shared = False + + def build_requirements(self): + if self._target_arm: + self.tool_requires("scons/4.3.0") + if cross_building(self): + if self._protobuf_required: + self.tool_requires("protobuf/") + if self.options.enable_tf_lite_frontend: + self.tool_requires("flatbuffers/") + if not self.options.shared: + self.tool_requires("cmake/[>=3.18 <4]") + + def requirements(self): + self.requires("onetbb/2021.10.0") + self.requires("pugixml/1.14") + if self._target_x86_64: + self.requires("xbyak/6.73") + if self.options.get_safe("enable_gpu"): + self.requires("opencl-icd-loader/2023.04.17") + self.requires("rapidjson/cci.20220822") + if self._protobuf_required: + self.requires("protobuf/3.21.12") + if self.options.enable_tf_frontend: + self.requires("snappy/1.1.10") + if self.options.enable_onnx_frontend: + self.requires(self._require("onnx")) + if self.options.enable_tf_lite_frontend: + self.requires("flatbuffers/23.5.26") + if self._preprocessing_available: + self.requires(self._require("ade")) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + toolchain = CMakeToolchain(self) + # HW plugins + toolchain.cache_variables["ENABLE_INTEL_CPU"] = self.options.enable_cpu + if self._gpu_option_available: + toolchain.cache_variables["ENABLE_INTEL_GPU"] = self.options.enable_gpu + toolchain.cache_variables["ENABLE_ONEDNN_FOR_GPU"] = self.options.shared or not self.options.enable_cpu + if self._gna_option_available: + toolchain.cache_variables["ENABLE_INTEL_GNA"] = False + # SW plugins + toolchain.cache_variables["ENABLE_AUTO"] = self.options.enable_auto + toolchain.cache_variables["ENABLE_MULTI"] = self.options.enable_auto + toolchain.cache_variables["ENABLE_AUTO_BATCH"] = self.options.enable_auto_batch + toolchain.cache_variables["ENABLE_HETERO"] = self.options.enable_hetero + # Frontends + toolchain.cache_variables["ENABLE_OV_IR_FRONTEND"] = self.options.enable_ir_frontend + toolchain.cache_variables["ENABLE_OV_PADDLE_FRONTEND"] = self.options.enable_paddle_frontend + toolchain.cache_variables["ENABLE_OV_TF_FRONTEND"] = self.options.enable_tf_frontend + toolchain.cache_variables["ENABLE_OV_TF_LITE_FRONTEND"] = self.options.enable_tf_lite_frontend + toolchain.cache_variables["ENABLE_OV_ONNX_FRONTEND"] = self.options.enable_onnx_frontend + toolchain.cache_variables["ENABLE_OV_PYTORCH_FRONTEND"] = self.options.enable_pytorch_frontend + # Dependencies + toolchain.cache_variables["ENABLE_SYSTEM_TBB"] = True + toolchain.cache_variables["ENABLE_TBBBIND_2_5"] = False + toolchain.cache_variables["ENABLE_SYSTEM_PUGIXML"] = True + if self._protobuf_required: + toolchain.cache_variables["ENABLE_SYSTEM_PROTOBUF"] = True + if self.options.enable_tf_frontend: + toolchain.cache_variables["ENABLE_SYSTEM_SNAPPY"] = True + if self.options.enable_tf_lite_frontend: + toolchain.cache_variables["ENABLE_SYSTEM_FLATBUFFERS"] = True + if self.options.get_safe("enable_gpu"): + toolchain.cache_variables["ENABLE_SYSTEM_OPENCL"] = True + # misc + if self._preprocessing_available: + toolchain.cache_variables["ENABLE_GAPI_PREPROCESSING"] = True + toolchain.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + toolchain.cache_variables["CPACK_GENERATOR"] = "CONAN" + toolchain.cache_variables["ENABLE_PROFILING_ITT"] = False + toolchain.cache_variables["ENABLE_PYTHON"] = False + toolchain.cache_variables["ENABLE_PROXY"] = False + toolchain.cache_variables["ENABLE_WHEEL"] = False + toolchain.cache_variables["ENABLE_CPPLINT"] = False + toolchain.cache_variables["ENABLE_NCC_STYLE"] = False + toolchain.cache_variables["ENABLE_SAMPLES"] = False + toolchain.cache_variables["ENABLE_TEMPLATE"] = False + toolchain.generate() + + def validate_build(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + compiler_version = Version(self.settings.compiler.version) + if minimum_version and compiler_version < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires {self.settings.compiler} ver. {minimum_version}, provided ver. {compiler_version}.", + ) + + # OpenVINO has unresolved symbols, when clang is used with libc++ + if self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": + raise ConanInvalidConfiguration( + f"{self.ref} cannot be built with clang and libc++ due to unresolved symbols. " + f"Please, use libstdc++ instead." + ) + + if self.settings.os == "Emscripten": + raise ConanInvalidConfiguration(f"{self.ref} does not support Emscripten") + + # TODO: resolve it later, since it is not critical for now + # Conan Center CI fails with our of memory error when building OpenVINO + if self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.ref} does not support Debug build type") + + def validate(self): + if self.options.get_safe("enable_gpu") and not self.options.shared and self.options.enable_cpu: + # GPU and CPU plugins cannot be simultaneously built statically, because they use different oneDNN versions + self.output.warning(f"{self.name} recipe builds GPU plugin without oneDNN (dGPU) support during static build, " + "because CPU plugin compiled with different oneDNN version may cause ODR violation. " + "To enable oneDNN support for GPU plugin, please, either use shared build configuration " + "or disable CPU plugin by setting 'enable_cpu' option to False.") + + def build(self): + cmake = CMake(self) + cmake.configure() + for target in ["ov_frontends", "ov_plugins", "openvino_c"]: + cmake.build(target=target) + + def package(self): + cmake = CMake(self) + cmake.install() + # remove cmake and .pc files, since they will be generated later by Conan itself in package_info() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "config") + self.cpp_info.set_property("cmake_file_name", "OpenVINO") + self.cpp_info.set_property("pkg_config_name", "openvino") + + openvino_runtime = self.cpp_info.components["Runtime"] + openvino_runtime.set_property("cmake_target_name", "openvino::runtime") + openvino_runtime.requires = ["onetbb::libtbb", "pugixml::pugixml"] + openvino_runtime.libs = ["openvino"] + if self._preprocessing_available: + openvino_runtime.requires.append("ade::ade") + if self._target_x86_64: + openvino_runtime.requires.append("xbyak::xbyak") + if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: + openvino_runtime.system_libs = ["m", "dl", "pthread"] + if self.settings.os == "Windows": + openvino_runtime.system_libs.append("shlwapi") + if self._preprocessing_available: + openvino_runtime.system_libs.extend(["wsock32", "ws2_32"]) + + # Have to expose all internal libraries for static libraries case + if not self.options.shared: + # HW plugins + if self.options.enable_cpu: + openvino_runtime.libs.append("openvino_arm_cpu_plugin" if self._target_arm else \ + "openvino_intel_cpu_plugin") + openvino_runtime.libs.extend(["openvino_onednn_cpu", "openvino_snippets", "mlas"]) + if self._target_arm: + openvino_runtime.libs.append("arm_compute-static") + if self.options.get_safe("enable_gpu"): + openvino_runtime.libs.extend(["openvino_intel_gpu_plugin", "openvino_intel_gpu_graph", + "openvino_intel_gpu_runtime", "openvino_intel_gpu_kernels"]) + if not self.options.enable_cpu: + openvino_runtime.libs.append("openvino_onednn_gpu") + # SW plugins + if self.options.enable_auto: + openvino_runtime.libs.append("openvino_auto_plugin") + if self.options.enable_hetero: + openvino_runtime.libs.append("openvino_hetero_plugin") + if self.options.enable_auto_batch: + openvino_runtime.libs.append("openvino_auto_batch_plugin") + # Preprocessing should come after plugins, because plugins depend on it + if self._preprocessing_available: + openvino_runtime.libs.extend(["openvino_gapi_preproc", "fluid"]) + # Frontends + if self.options.enable_ir_frontend: + openvino_runtime.libs.append("openvino_ir_frontend") + if self.options.enable_onnx_frontend: + openvino_runtime.libs.extend(["openvino_onnx_frontend", "openvino_onnx_common"]) + openvino_runtime.requires.extend(["protobuf::libprotobuf", "onnx::onnx"]) + if self.options.enable_tf_frontend: + openvino_runtime.libs.extend(["openvino_tensorflow_frontend", "openvino_tensorflow_common"]) + openvino_runtime.requires.extend(["protobuf::libprotobuf", "snappy::snappy"]) + if self.options.enable_tf_lite_frontend: + openvino_runtime.libs.extend(["openvino_tensorflow_lite_frontend", "openvino_tensorflow_common"]) + openvino_runtime.requires.extend(["flatbuffers::flatbuffers"]) + if self.options.enable_paddle_frontend: + openvino_runtime.libs.append("openvino_paddle_frontend") + openvino_runtime.requires.append("protobuf::libprotobuf") + if self.options.enable_pytorch_frontend: + openvino_runtime.libs.append("openvino_pytorch_frontend") + # Common private dependencies should go last, because they satisfy dependencies for all other libraries + openvino_runtime.libs.extend(["openvino_reference", "openvino_builders", + "openvino_shape_inference", "openvino_itt", + # utils goes last since all others depend on it + "openvino_util"]) + # set 'openvino' once again for transformations objects files (cyclic dependency) + # openvino_runtime.libs.append("openvino") + full_openvino_lib_path = os.path.join(self.package_folder, "lib", "openvino.lib").replace("\\", "/") if self.settings.os == "Windows" else \ + os.path.join(self.package_folder, "lib", "libopenvino.a") + openvino_runtime.system_libs.insert(0, full_openvino_lib_path) + # Add definition to prevent symbols importing + openvino_runtime.defines = ["OPENVINO_STATIC_LIBRARY"] + + if self.options.get_safe("enable_gpu"): + openvino_runtime.requires.extend(["opencl-icd-loader::opencl-icd-loader", "rapidjson::rapidjson"]) + if self.settings.os == "Windows": + openvino_runtime.system_libs.append("setupapi") + + openvino_runtime_c = self.cpp_info.components["Runtime_C"] + openvino_runtime_c.set_property("cmake_target_name", "openvino::runtime::c") + openvino_runtime_c.libs = ["openvino_c"] + openvino_runtime_c.requires = ["Runtime"] + + if self.options.enable_onnx_frontend: + openvino_onnx = self.cpp_info.components["ONNX"] + openvino_onnx.set_property("cmake_target_name", "openvino::frontend::onnx") + openvino_onnx.libs = ["openvino_onnx_frontend"] + openvino_onnx.requires = ["Runtime", "onnx::onnx", "protobuf::libprotobuf"] + + if self.options.enable_paddle_frontend: + openvino_paddle = self.cpp_info.components["Paddle"] + openvino_paddle.set_property("cmake_target_name", "openvino::frontend::paddle") + openvino_paddle.libs = ["openvino_paddle_frontend"] + openvino_paddle.requires = ["Runtime", "protobuf::libprotobuf"] + + if self.options.enable_tf_frontend: + openvino_tensorflow = self.cpp_info.components["TensorFlow"] + openvino_tensorflow.set_property("cmake_target_name", "openvino::frontend::tensorflow") + openvino_tensorflow.libs = ["openvino_tensorflow_frontend"] + openvino_tensorflow.requires = ["Runtime", "protobuf::libprotobuf", "snappy::snappy"] + + if self.options.enable_pytorch_frontend: + openvino_pytorch = self.cpp_info.components["PyTorch"] + openvino_pytorch.set_property("cmake_target_name", "openvino::frontend::pytorch") + openvino_pytorch.libs = ["openvino_pytorch_frontend"] + openvino_pytorch.requires = ["Runtime"] + + if self.options.enable_tf_lite_frontend: + openvino_tensorflow_lite = self.cpp_info.components["TensorFlowLite"] + openvino_tensorflow_lite.set_property("cmake_target_name", "openvino::frontend::tensorflow_lite") + openvino_tensorflow_lite.libs = ["openvino_tensorflow_lite_frontend"] + openvino_tensorflow_lite.requires = ["Runtime", "flatbuffers::flatbuffers"] diff --git a/recipes/openvino/all/dependencies/dependencies-2023.1.0.yml b/recipes/openvino/all/dependencies/dependencies-2023.1.0.yml new file mode 100644 index 00000000000000..fd126ded2ddeea --- /dev/null +++ b/recipes/openvino/all/dependencies/dependencies-2023.1.0.yml @@ -0,0 +1,2 @@ +onnx: "1.13.1" +ade: "0.1.2d" 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/0001-cpu-plugin-compilation-c++17.patch b/recipes/openvino/all/patches/2023.1.0/0001-cpu-plugin-compilation-c++17.patch new file mode 100644 index 00000000000000..da6548b7c91159 --- /dev/null +++ b/recipes/openvino/all/patches/2023.1.0/0001-cpu-plugin-compilation-c++17.patch @@ -0,0 +1,16 @@ +diff --git a/src/plugins/intel_cpu/src/cpu_tensor.cpp b/src/plugins/intel_cpu/src/cpu_tensor.cpp +index 48d8fdd4be..815edd9309 100644 +--- a/src/plugins/intel_cpu/src/cpu_tensor.cpp ++++ b/src/plugins/intel_cpu/src/cpu_tensor.cpp +@@ -68,8 +68,9 @@ void Tensor::update_strides() const { + OPENVINO_ASSERT(blocked_desc, "not a valid blocked memory descriptor."); + auto& strides = blocked_desc->getStrides(); + m_strides.resize(strides.size()); +- std::transform(strides.cbegin(), strides.cend(), m_strides.begin(), +- std::bind1st(std::multiplies(), m_element_type.size())); ++ std::transform(strides.cbegin(), strides.cend(), m_strides.begin(), [this] (const size_t stride) { ++ return stride * m_element_type.size(); ++ }); + } + + void* Tensor::data(const element::Type& element_type) const { diff --git a/recipes/openvino/all/patches/2023.1.0/0002-core-compilation-c++17.patch b/recipes/openvino/all/patches/2023.1.0/0002-core-compilation-c++17.patch new file mode 100644 index 00000000000000..2df86d8ed0ec68 --- /dev/null +++ b/recipes/openvino/all/patches/2023.1.0/0002-core-compilation-c++17.patch @@ -0,0 +1,46 @@ +diff --git a/src/frontends/common/src/utils.cpp b/src/frontends/common/src/utils.cpp +index 8ef7481551..3a0db585fd 100644 +--- a/src/frontends/common/src/utils.cpp ++++ b/src/frontends/common/src/utils.cpp +@@ -12,10 +12,6 @@ + # include + # include + # include +-# ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT +-# include +-# include +-# endif + #else + # if defined(WINAPI_FAMILY) && !WINAPI_PARTITION_DESKTOP + # error "Only WINAPI_PARTITION_DESKTOP is supported, because of GetModuleHandleEx[A|W]" +diff --git a/src/frontends/paddle/src/input_model.cpp b/src/frontends/paddle/src/input_model.cpp +index 6987b3285e..287fa5e54a 100644 +--- a/src/frontends/paddle/src/input_model.cpp ++++ b/src/frontends/paddle/src/input_model.cpp +@@ -13,14 +13,10 @@ + #include "openvino/frontend/paddle/node_context.hpp" + #include "openvino/opsets/opset7.hpp" + #include "openvino/util/common_util.hpp" ++#include "openvino/util/file_util.hpp" + #include "paddle_utils.hpp" + #include "place.hpp" + +-#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +-# include +-# include +-#endif +- + namespace ov { + namespace frontend { + namespace paddle { +@@ -169,9 +165,7 @@ std::basic_string get_const_path(const std::basic_string& folder_with_weig + #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) + template <> + std::basic_string get_const_path(const std::basic_string& folder, const std::string& name) { +- std::wstring_convert> converter; +- std::wstring _name = converter.from_bytes(name); +- return folder + paddle::get_path_sep() + _name; ++ return folder + paddle::get_path_sep() + ov::util::string_to_wstring(name); + } + #endif + diff --git a/recipes/openvino/all/patches/2023.1.0/0003-fixed-gpu-with-onednn-build.patch b/recipes/openvino/all/patches/2023.1.0/0003-fixed-gpu-with-onednn-build.patch new file mode 100644 index 00000000000000..e5791b37c7a7ac --- /dev/null +++ b/recipes/openvino/all/patches/2023.1.0/0003-fixed-gpu-with-onednn-build.patch @@ -0,0 +1,684 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 461f1a209c..0b552b3da3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,6 +47,7 @@ message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR}) + message (STATUS "CPACK_GENERATOR ....................... " ${CPACK_GENERATOR}) + message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID}) + message (STATUS "CMAKE_CXX_COMPILER_ID ................. " ${CMAKE_CXX_COMPILER_ID}) ++message (STATUS "CMAKE_CXX_STANDARD .................... " ${CMAKE_CXX_STANDARD}) + if(OV_GENERATOR_MULTI_CONFIG) + string(REPLACE ";" " " config_types "${CMAKE_CONFIGURATION_TYPES}") + message (STATUS "CMAKE_CONFIGURATION_TYPES ............. " ${config_types}) +diff --git a/cmake/developer_package/plugins/plugins.cmake b/cmake/developer_package/plugins/plugins.cmake +index 436685355a..ea187411d1 100644 +--- a/cmake/developer_package/plugins/plugins.cmake ++++ b/cmake/developer_package/plugins/plugins.cmake +@@ -117,6 +117,10 @@ function(ov_add_plugin) + # install rules + if(NOT OV_PLUGIN_SKIP_INSTALL OR NOT BUILD_SHARED_LIBS) + string(TOLOWER "${OV_PLUGIN_DEVICE_NAME}" install_component) ++ if(NOT BUILD_SHARED_LIBS) ++ # in case of static libs everything is installed to 'core' ++ set(install_component ${OV_CPACK_COMP_CORE}) ++ endif() + + if(OV_PLUGIN_PSEUDO_DEVICE) + set(plugin_hidden HIDDEN) +diff --git a/cmake/features.cmake b/cmake/features.cmake +index e4b60c89e0..7327b262a2 100644 +--- a/cmake/features.cmake ++++ b/cmake/features.cmake +@@ -23,7 +23,7 @@ endif() + + ie_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ${ENABLE_INTEL_GPU_DEFAULT} "X86_64 OR AARCH64;NOT APPLE;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF) + +-if (ANDROID OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) OR NOT BUILD_SHARED_LIBS) ++if (ANDROID OR MINGW OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) OR (NOT BUILD_SHARED_LIBS AND ENABLE_INTEL_CPU)) + # oneDNN doesn't support old compilers and android builds for now, so we'll build GPU plugin without oneDNN + # also, in case of static build CPU's and GPU's oneDNNs will conflict, so we are disabling GPU's one in this case + set(ENABLE_ONEDNN_FOR_GPU_DEFAULT OFF) +diff --git a/cmake/templates/OpenVINOConfig.cmake.in b/cmake/templates/OpenVINOConfig.cmake.in +index 9eb1cfdd35..7dda80d8a3 100644 +--- a/cmake/templates/OpenVINOConfig.cmake.in ++++ b/cmake/templates/OpenVINOConfig.cmake.in +@@ -223,6 +223,10 @@ macro(_ov_find_tbb) + PATHS ${_tbb_bind_dir} + NO_CMAKE_FIND_ROOT_PATH + NO_DEFAULT_PATH) ++ if(TARGET TBBbind::tbbbind_2_5) ++ # To solve https://cmake.org/cmake/help/latest/policy/CMP0111.html warnings ++ set_property(TARGET TBBbind::tbbbind_2_5 PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG) ++ endif() + unset(_tbb_bind_dir) + endif() + unset(install_tbbbind) +@@ -343,11 +347,15 @@ endmacro() + macro(_ov_find_intel_cpu_dependencies) + set(_OV_ENABLE_CPU_ACL "@DNNL_USE_ACL@") + if(_OV_ENABLE_CPU_ACL) +- set(_ov_in_install_tree "@PACKAGE_ARM_COMPUTE_LIB_DIR@") ++ set(_ov_in_install_tree "@PACKAGE_OPENVINO_LIB_DIR@") + if(_ov_in_install_tree) +- set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_ARM_COMPUTE_LIB_DIR@") ++ set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_OPENVINO_LIB_DIR@") + set(ACL_DIR "${CMAKE_CURRENT_LIST_DIR}") + else() ++ if(NOT TARGET arm_compute::arm_compute) ++ # for case when build tree is used separately, e.g. OpenVINODeveloperPackageConfig.cmake ++ set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_CMAKE_ARCHIVE_OUTPUT_DIRECTORY@") ++ endif() + set_and_check(ACL_DIR "@PACKAGE_FIND_ACL_PATH@") + endif() + +@@ -363,16 +371,50 @@ macro(_ov_find_intel_gpu_dependencies) + set(_OV_ENABLE_INTEL_GPU "@ENABLE_INTEL_GPU@") + set(_OV_ENABLE_SYSTEM_OPENCL "@ENABLE_SYSTEM_OPENCL@") + if(_OV_ENABLE_INTEL_GPU AND _OV_ENABLE_SYSTEM_OPENCL) +- set(_OV_OpenCLICDLoader_FOUND "@OpenCLICDLoader_FOUND@") +- if(_OV_OpenCLICDLoader_FOUND) +- _ov_find_dependency(OpenCLICDLoader) +- else() +- _ov_find_dependency(OpenCL) +- endif() +- unset(_OV_OpenCLICDLoader_FOUND) ++ _ov_find_dependency(OpenCL) + endif() + unset(_OV_ENABLE_INTEL_GPU) + unset(_OV_ENABLE_SYSTEM_OPENCL) ++ ++ set(_OV_ENABLE_ONEDNN_FOR_GPU "@ENABLE_ONEDNN_FOR_GPU@") ++ if(_OV_ENABLE_ONEDNN_FOR_GPU AND NOT TARGET onednn_gpu_tgt) ++ set(_OV_DNNL_GPU_LIBRARY_NAME "@DNNL_GPU_LIBRARY_NAME@") ++ ++ set(_ov_in_install_tree "@PACKAGE_OPENVINO_LIB_DIR@") ++ if(_ov_in_install_tree) ++ set(onednn_gpu_lib "${CMAKE_STATIC_LIBRARY_PREFIX}${_OV_DNNL_GPU_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ set_and_check(onednn_gpu_lib_root "@PACKAGE_OPENVINO_LIB_DIR@") ++ if(WIN32) ++ if(OV_GENERATOR_MULTI_CONFIG) ++ set(extra_args PATH_SUFFIXES ${CMAKE_CONFIGURATION_TYPES}) ++ else() ++ set(extra_args PATH_SUFFIXES ${CMAKE_BUILD_TYPE}) ++ endif() ++ endif() ++ ++ find_library(onednn_gpu_lib_path ++ NAMES ${_OV_DNNL_GPU_LIBRARY_NAME} ++ PATHS ${onednn_gpu_lib_root} ++ ${extra_args}) ++ ++ if(NOT onednn_gpu_lib_path) ++ message(FATAL_ERROR "Internal error: failed to find '${_OV_DNNL_GPU_LIBRARY_NAME}' in '${onednn_gpu_lib_root}'") ++ endif() ++ ++ unset(extra_args) ++ unset(onednn_gpu_lib) ++ else() ++ set_and_check(onednn_gpu_lib_path "@PACKAGE_ONEDNN_GPU_LIB_PATH@") ++ endif() ++ ++ set_target_properties(openvino::onednn_gpu_tgt PROPERTIES ++ INTERFACE_LINK_LIBRARIES "${onednn_gpu_lib_path}") ++ ++ unset(onednn_gpu_lib_path) ++ unset(_ov_in_install_tree) ++ unset(_OV_DNNL_GPU_LIBRARY_NAME) ++ endif() ++ unset(_OV_ENABLE_ONEDNN_FOR_GPU) + endmacro() + + macro(_ov_find_intel_gna_dependencies) +@@ -455,6 +497,7 @@ set(_OV_ENABLE_OPENVINO_BUILD_SHARED "@BUILD_SHARED_LIBS@") + + if(NOT TARGET openvino) + set(_ov_as_external_package ON) ++ include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake") + endif() + + if(NOT _OV_ENABLE_OPENVINO_BUILD_SHARED) +@@ -487,8 +530,6 @@ set(_ov_imported_libs openvino::runtime openvino::runtime::c + openvino::frontend::pytorch openvino::frontend::tensorflow_lite) + + if(_ov_as_external_package) +- include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake") +- + foreach(target IN LISTS _ov_imported_libs) + if(TARGET ${target}) + get_target_property(imported_configs ${target} IMPORTED_CONFIGURATIONS) +diff --git a/src/cmake/openvino.cmake b/src/cmake/openvino.cmake +index eb9a54354e..1d2996482b 100644 +--- a/src/cmake/openvino.cmake ++++ b/src/cmake/openvino.cmake +@@ -157,9 +157,12 @@ if(ENABLE_INTEL_GNA) + list(APPEND PATH_VARS "GNA_PATH") + endif() + if(DNNL_USE_ACL) +- list(APPEND BUILD_PATH_VARS "FIND_ACL_PATH") ++ list(APPEND BUILD_PATH_VARS "FIND_ACL_PATH;CMAKE_ARCHIVE_OUTPUT_DIRECTORY") + set(FIND_ACL_PATH "${intel_cpu_thirdparty_SOURCE_DIR}") + endif() ++if(ENABLE_ONEDNN_FOR_GPU) ++ list(APPEND BUILD_PATH_VARS "ONEDNN_GPU_LIB_PATH") ++endif() + + set(PUBLIC_HEADERS_DIR "${OpenVINO_SOURCE_DIR}/src/inference/include") + set(IE_INCLUDE_DIR "${PUBLIC_HEADERS_DIR}/ie") +@@ -177,12 +180,10 @@ configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINOCo + + # install tree + +-if(DNNL_USE_ACL) +- list(APPEND INSTALL_PATH_VARS "ARM_COMPUTE_LIB_DIR") +- # remove generator expression at the end, because searching in Release / Debug will be +- # done by ACLConfig.cmake itself +- string(REPLACE "$" "" ARM_COMPUTE_LIB_DIR "${OV_CPACK_LIBRARYDIR}") +-endif() ++list(APPEND INSTALL_PATH_VARS "OPENVINO_LIB_DIR") ++# remove generator expression at the end, because searching in Release / Debug ++# will be done by inside OpenVINOConfig.cmak / ACLConfig.cmake ++string(REPLACE "$" "" OPENVINO_LIB_DIR "${OV_CPACK_LIBRARYDIR}") + + set(IE_INCLUDE_DIR "${OV_CPACK_INCLUDEDIR}/ie") + set(IE_TBB_DIR "${IE_TBB_DIR_INSTALL}") +diff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt +index 98935a0792..7e8325acef 100644 +--- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt ++++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt +@@ -117,7 +117,7 @@ function(ov_add_onednn) + add_subdirectory(onednn EXCLUDE_FROM_ALL) + + # install static libraries +- ov_install_static_lib(dnnl cpu) ++ ov_install_static_lib(dnnl ${OV_CPACK_COMP_CORE}) + + if(DNNL_USE_ACL AND NOT BUILD_SHARED_LIBS) + # use ACLConfig.cmake in OpenVINOConfig.cmake in case of static build +@@ -125,16 +125,16 @@ function(ov_add_onednn) + # but for this we need to install library files + install(FILES $ + DESTINATION ${OV_CPACK_ARCHIVEDIR} +- COMPONENT cpu) ++ COMPONENT ${OV_CPACK_COMP_CORE}) + install(FILES "${intel_cpu_thirdparty_SOURCE_DIR}/ACLConfig.cmake" + DESTINATION ${OV_CPACK_OPENVINO_CMAKEDIR} +- COMPONENT core_dev) ++ COMPONENT ${OV_CPACK_COMP_CORE_DEV}) + endif() + endfunction() + + if(ENABLE_MLAS_FOR_CPU) + add_subdirectory(mlas) +- ov_install_static_lib(mlas cpu) ++ ov_install_static_lib(mlas ${OV_CPACK_COMP_CORE}) + endif() + + ov_add_onednn() +diff --git a/src/plugins/intel_gpu/CMakeLists.txt b/src/plugins/intel_gpu/CMakeLists.txt +index 1770b34b65..4e8a9d0e68 100644 +--- a/src/plugins/intel_gpu/CMakeLists.txt ++++ b/src/plugins/intel_gpu/CMakeLists.txt +@@ -35,6 +35,7 @@ set(MAIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + set(INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") + + add_subdirectory(thirdparty) ++include(thirdparty/cmake/rapidjson.cmake) + + if(CMAKE_COMPILER_IS_GNUCXX) + ie_add_compiler_flags(-Werror) +diff --git a/src/plugins/intel_gpu/src/graph/CMakeLists.txt b/src/plugins/intel_gpu/src/graph/CMakeLists.txt +index 0b2093d2a0..fac58ec0fa 100644 +--- a/src/plugins/intel_gpu/src/graph/CMakeLists.txt ++++ b/src/plugins/intel_gpu/src/graph/CMakeLists.txt +@@ -58,7 +58,7 @@ elseif((NOT ANDROID) AND (UNIX)) + target_link_libraries(${TARGET_NAME} PRIVATE pthread) + endif() + +-ov_install_static_lib(${TARGET_NAME} gpu) ++ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) + + if(ENABLE_SSE42) + ie_sse42_optimization_flags(sse4_2_flags) +diff --git a/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt b/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt +index b76d8ee732..99ebf5331a 100644 +--- a/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt ++++ b/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt +@@ -61,7 +61,8 @@ endif() + target_include_directories(${TARGET_NAME} PUBLIC $ + $ + $ +- $) ++ $ ++ PRIVATE $) + + target_compile_options(${TARGET_NAME} PRIVATE + $<$:$,/Os,-Os>>) +@@ -70,7 +71,7 @@ if(COMMAND add_cpplint_target) + add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}) + endif() + +-target_link_libraries(${TARGET_NAME} PUBLIC OpenCL::OpenCL rapidjson inference_engine_plugin_api) ++target_link_libraries(${TARGET_NAME} PUBLIC OpenCL::OpenCL inference_engine_plugin_api) + + set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) + +@@ -90,8 +91,16 @@ add_custom_command( + TARGET ${TARGET_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/cache/cache.json ${TUNING_CACHE_PATH}/cache.json) + ++if(BUILD_SHARED_LIBS) ++ set(CACHE_JSON_INSTALL_DIR ${OV_CPACK_PLUGINSDIR}) ++ set(CACHE_JSON_COMPONENT gpu) ++else() ++ set(CACHE_JSON_INSTALL_DIR ${OV_CPACK_ARCHIVEDIR}) ++ set(CACHE_JSON_COMPONENT ${OV_CPACK_COMP_CORE}) ++endif() ++ + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cache/cache.json +- DESTINATION ${OV_CPACK_PLUGINSDIR} +- COMPONENT gpu) ++ DESTINATION ${CACHE_JSON_INSTALL_DIR} ++ COMPONENT ${CACHE_JSON_COMPONENT}) + +-ov_install_static_lib(${TARGET_NAME} gpu) ++ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) +diff --git a/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.cpp b/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.cpp +index cfac486cdf..a5d0711f61 100644 +--- a/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.cpp ++++ b/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.cpp +@@ -3,18 +3,21 @@ + // + + #include "auto_tuner.h" ++ + #include + #include + #include + #include + #include +-#include "istreamwrapper.h" +-#include "stringbuffer.h" +-#include "prettywriter.h" + #include + #include + #include + ++#include "rapidjson/istreamwrapper.h" ++#include "rapidjson/stringbuffer.h" ++#include "rapidjson/prettywriter.h" ++#include "rapidjson/document.h" ++ + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN +@@ -35,32 +38,37 @@ + + namespace kernel_selector { + ++class TuningCache::Impl { ++public: ++ rapidjson::Document cache; ++}; ++ + TuningCache::TuningCache(const std::string& cacheFilePath) +- : cache() { ++ : impl(new Impl()) { + // Read cache file + std::ifstream tuningFile(cacheFilePath); + + if (tuningFile && tuningFile.good()) { + std::stringstream buffer; + buffer << tuningFile.rdbuf(); +- cache.Parse(buffer.str().c_str()); ++ impl->cache.Parse(buffer.str().c_str()); + } else { + throw std::runtime_error("Tuning file: " + cacheFilePath + " could not be read! Must provide a valid cache file in USE_CACHE mode."); + } + +- if (cache.IsNull()) { +- cache.SetObject(); +- } else if (!cache.IsObject()) { ++ if (impl->cache.IsNull()) { ++ impl->cache.SetObject(); ++ } else if (!impl->cache.IsObject()) { + throw std::runtime_error("Tuning file: " + cacheFilePath + " has incorrect format."); + } + +- auto cacheObj = cache.GetObject(); ++ auto cacheObj = impl->cache.GetObject(); + + // Update to new format with version markers + if (!cacheObj.HasMember(version2Marker)) { +- auto newName = rapidjson::Value(version2Marker, cache.GetAllocator()); ++ auto newName = rapidjson::Value(version2Marker, impl->cache.GetAllocator()); + auto newObj = rapidjson::Value(rapidjson::Type::kObjectType); +- cacheObj.AddMember(newName, newObj, cache.GetAllocator()); ++ cacheObj.AddMember(newName, newObj, impl->cache.GetAllocator()); + } + + bool needsV1 = false; +@@ -73,9 +81,9 @@ TuningCache::TuningCache(const std::string& cacheFilePath) + + if (needsV1) { + if (!cacheObj.HasMember(version1Marker)) { +- auto newName = rapidjson::Value(version1Marker, cache.GetAllocator()); ++ auto newName = rapidjson::Value(version1Marker, impl->cache.GetAllocator()); + auto newObj = rapidjson::Value(rapidjson::Type::kObjectType); +- cacheObj.AddMember(newName, newObj, cache.GetAllocator()); ++ cacheObj.AddMember(newName, newObj, impl->cache.GetAllocator()); + } + + for (auto it = cacheObj.begin(); it != cacheObj.end();) { +@@ -86,7 +94,7 @@ TuningCache::TuningCache(const std::string& cacheFilePath) + auto newValue = rapidjson::Value(rapidjson::Type::kObjectType); + newName.Swap(member.name); + newValue.Swap(member.value); +- cache[version1Marker].AddMember(newName, newValue, cache.GetAllocator()); ++ impl->cache[version1Marker].AddMember(newName, newValue, impl->cache.GetAllocator()); + it = cacheObj.EraseMember(it); + } else { + it++; +@@ -96,11 +104,11 @@ TuningCache::TuningCache(const std::string& cacheFilePath) + } + + TuningCache::TuningCache() +- : cache() { +- cache.SetObject(); +- auto v2Name = rapidjson::Value(version2Marker, cache.GetAllocator()); ++ : impl(new Impl()) { ++ impl->cache.SetObject(); ++ auto v2Name = rapidjson::Value(version2Marker, impl->cache.GetAllocator()); + auto v2Obj = rapidjson::Value(rapidjson::Type::kObjectType); +- cache.AddMember(v2Name, v2Obj, cache.GetAllocator()); ++ impl->cache.AddMember(v2Name, v2Obj, impl->cache.GetAllocator()); + } + + TuningCache::Entry TuningCache::LoadKernel(const Params& params) { +@@ -129,8 +137,8 @@ TuningCache::Entry TuningCache::LoadKernel_v1(const Params& params, uint32_t com + auto hashStr = std::to_string(create_hash(params.to_string())); + auto computeUnitsStr = std::to_string(computeUnitsCount); + +- auto v1It = cache.FindMember(version1Marker); +- if (v1It == cache.MemberEnd()) ++ auto v1It = impl->cache.FindMember(version1Marker); ++ if (v1It == impl->cache.MemberEnd()) + return result; + + auto computeUnitsIt = v1It->value.FindMember(computeUnitsStr.c_str()); +@@ -152,8 +160,8 @@ TuningCache::Entry TuningCache::LoadKernel_v2(const Params& params, uint32_t com + auto paramStr = params.to_cache_string_v2(); + auto computeUnitsStr = std::to_string(computeUnitsCount); + +- auto v2It = cache.FindMember(version2Marker); +- if (v2It == cache.MemberEnd()) ++ auto v2It = impl->cache.FindMember(version2Marker); ++ if (v2It == impl->cache.MemberEnd()) + return result; + + auto computeUnitsIt = v2It->value.FindMember(computeUnitsStr.c_str()); +diff --git a/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.h b/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.h +index 1a875b7d4d..8a9da81354 100644 +--- a/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.h ++++ b/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.h +@@ -8,12 +8,12 @@ + #include + #include + #include +-#include "kernel_selector_common.h" +-#include "kernel_selector_params.h" +-#include "document.h" + #include + #include + ++#include "kernel_selector_common.h" ++#include "kernel_selector_params.h" ++ + namespace kernel_selector { + + class TuningCache { +@@ -42,7 +42,8 @@ private: + Entry LoadKernel_v1(const Params& params, uint32_t computeUnitsCount); + Entry LoadKernel_v2(const Params& params, uint32_t computeUnitsCount); + +- rapidjson::Document cache; ++ class Impl; ++ std::shared_ptr impl; + + static constexpr const char* version1Marker = "version_1"; + static constexpr const char* version2Marker = "version_2"; +diff --git a/src/plugins/intel_gpu/src/kernel_selector/jitter.cpp b/src/plugins/intel_gpu/src/kernel_selector/jitter.cpp +index fe6ffe8008..106560f5f1 100644 +--- a/src/plugins/intel_gpu/src/kernel_selector/jitter.cpp ++++ b/src/plugins/intel_gpu/src/kernel_selector/jitter.cpp +@@ -1540,11 +1540,11 @@ JitConstants MakeActivationJitConstants(std::vector(SCHAR_MIN))); +- nl_n = toCodeString(std::min(params[i].n, static_cast(SCHAR_MAX))); ++ nl_m = toCodeString(std::max(params[i].m, std::numeric_limits::min())); ++ nl_n = toCodeString(std::min(params[i].n, std::numeric_limits::max())); + } else if (out_dt == Datatype::UINT8) { + nl_m = toCodeString(std::max(params[i].m, 0.0f)); +- nl_n = toCodeString(std::min(params[i].n, static_cast(UCHAR_MAX))); ++ nl_n = toCodeString(std::min(params[i].n, std::numeric_limits::max())); + } + } + auto jitConstants = JitConstants{MakeJitConstant("NL_M" + activation_suffix, nl_m), +@@ -1949,11 +1949,11 @@ JitConstants FusedOpsCodeGenerator::MakeOpJitConstants(const FusedOpsConfigurati + + if (activation_p.function == ActivationFunction::CLAMP) { + if (out_type == Datatype::INT8) { +- nl_m = toCodeString(std::max(activation_p.m, static_cast(SCHAR_MIN))); +- nl_n = toCodeString(std::min(activation_p.n, static_cast(SCHAR_MAX))); ++ nl_m = toCodeString(std::max(activation_p.m, std::numeric_limits::min())); ++ nl_n = toCodeString(std::min(activation_p.n, std::numeric_limits::max())); + } else if (out_type == Datatype::UINT8) { + nl_m = toCodeString(std::max(activation_p.m, 0.0f)); +- nl_n = toCodeString(std::min(activation_p.n, static_cast(UCHAR_MAX))); ++ nl_n = toCodeString(std::min(activation_p.n, std::numeric_limits::max())); + } + } + +diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_params.h b/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_params.h +index 5c71c907b7..76e84e558b 100644 +--- a/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_params.h ++++ b/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_params.h +@@ -10,7 +10,6 @@ + #include + #include "common_types.h" + #include "tensor_type.h" +-#include "document.h" + #include + #include + #include +diff --git a/src/plugins/intel_gpu/src/runtime/CMakeLists.txt b/src/plugins/intel_gpu/src/runtime/CMakeLists.txt +index c442f65575..321fc2f1b2 100644 +--- a/src/plugins/intel_gpu/src/runtime/CMakeLists.txt ++++ b/src/plugins/intel_gpu/src/runtime/CMakeLists.txt +@@ -64,4 +64,4 @@ elseif((NOT ANDROID) AND (UNIX)) + target_link_libraries(${TARGET_NAME} PRIVATE pthread) + endif() + +-ov_install_static_lib(${TARGET_NAME} gpu) ++ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) +diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt +index c7c616d0df..b7cc810a75 100644 +--- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt ++++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt +@@ -2,14 +2,6 @@ + # SPDX-License-Identifier: Apache-2.0 + # + +-add_library(rapidjson INTERFACE) +- +-set_target_properties(rapidjson PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES $ +-) +- +-ov_install_static_lib(rapidjson gpu) +- + # + # oneDNN for GPU plugin + # +@@ -17,11 +9,12 @@ ov_install_static_lib(rapidjson gpu) + if(ENABLE_ONEDNN_FOR_GPU) + function(build_onednn_gpu) + include(ExternalProject) +- set(ONEDNN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_build/") +- set(ONEDNN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_install/") ++ set(ONEDNN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_build") ++ set(ONEDNN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_install" CACHE PATH "Installation path for oneDNN GPU library") + set(ONEDNN_PREFIX_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_root") + set(ONEDNN_ENABLED_PRIMITIVES "CONCAT;CONVOLUTION;DECONVOLUTION;INNER_PRODUCT;MATMUL;REORDER;POOLING;REDUCTION") + set(ONEDNN_ENABLED_ISA "XEHP;XEHPG;XEHPC") ++ set(DNNL_GPU_LIBRARY_NAME "openvino_onednn_gpu" CACHE STRING "Name of oneDNN library for Intel GPU Plugin") + + if(X86_64) + set(ONEDNN_TARGET_ARCH "X64" CACHE STRING "" FORCE) +@@ -87,18 +80,16 @@ if(ENABLE_ONEDNN_FOR_GPU) + list(APPEND cmake_extra_args "-DOpenCL_INCLUDE_DIR=${OpenCL_INCLUDE_DIR}") + endif() + ++ set(onednn_gpu_lib "${CMAKE_STATIC_LIBRARY_PREFIX}${DNNL_GPU_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ set(ONEDNN_GPU_LIB_PATH ${ONEDNN_INSTALL_DIR}/lib/${onednn_gpu_lib} CACHE FILEPATH "Path to oneDNN GPU library") ++ + ExternalProject_Add(onednn_gpu_build ++ # Directory Options: ++ PREFIX "${ONEDNN_PREFIX_DIR}" + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/onednn_gpu" + BINARY_DIR "${ONEDNN_BUILD_DIR}" + INSTALL_DIR "${ONEDNN_INSTALL_DIR}" +- PREFIX "${ONEDNN_PREFIX_DIR}" +- EXCLUDE_FROM_ALL ON +- CMAKE_CACHE_ARGS +- # The arguments below requires list to be passed as argument +- # which doesn't work properly when passed to CMAKE_ARGS. +- # Thus we pass it via CMAKE_CACHE_ARGS +- "-DDNNL_ENABLE_PRIMITIVE:STRING=${ONEDNN_ENABLED_PRIMITIVES}" +- "-DDNNL_ENABLE_PRIMITIVE_GPU_ISA:STRING=${ONEDNN_ENABLED_ISA}" ++ # Configure Step Options: + CMAKE_ARGS + ${cmake_extra_args} + "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" +@@ -112,9 +103,8 @@ if(ENABLE_ONEDNN_FOR_GPU) + "-DDNNL_TARGET_ARCH=${ONEDNN_TARGET_ARCH}" + "-DDNNL_CPU_RUNTIME=NONE" + "-DDNNL_GPU_RUNTIME=OCL" +- "-DDNNL_LIBRARY_NAME=openvino_onednn_gpu" ++ "-DDNNL_LIBRARY_NAME=${DNNL_GPU_LIBRARY_NAME}" + "-DCMAKE_INSTALL_PREFIX=${ONEDNN_INSTALL_DIR}" +- "-DCMAKE_INSTALL_LIBDIR=lib/$" + "-DDNNL_ENABLE_CONCURRENT_EXEC=ON" + "-DDNNL_ENABLE_PRIMITIVE_CACHE=OFF" + "-DDNNL_ENABLE_WORKLOAD=INFERENCE" +@@ -129,16 +119,38 @@ if(ENABLE_ONEDNN_FOR_GPU) + # specifically for Conan, because it overrides CMAKE_PREFIX_PATH and oneDNN's FindOpenCL.cmake is ignored + # Conan's FindOpenCL.cmake module does not set OpenCL_INCLUDE_DIRS, so we need to set it manually + "-DOpenCL_INCLUDE_DIRS=$" ++ # Conan calls cmake with default value for CMP0091, so we have to bypass it to oneDNN build ++ # because we bypass conan_toolchain.cmake via CMAKE_TOOLCHAIN_FILE ++ "-DCMAKE_POLICY_DEFAULT_CMP0091=NEW" ++ CMAKE_CACHE_ARGS ++ # The arguments below requires list to be passed as argument ++ # which doesn't work properly when passed to CMAKE_ARGS. ++ # Thus we pass it via CMAKE_CACHE_ARGS ++ "-DDNNL_ENABLE_PRIMITIVE:STRING=${ONEDNN_ENABLED_PRIMITIVES}" ++ "-DDNNL_ENABLE_PRIMITIVE_GPU_ISA:STRING=${ONEDNN_ENABLED_ISA}" ++ # Build Step Options: ++ BUILD_BYPRODUCTS ${ONEDNN_GPU_LIB_PATH} ++ # Target Options: ++ EXCLUDE_FROM_ALL ON + ) ++ + add_library(onednn_gpu_tgt INTERFACE) + set_target_properties(onednn_gpu_tgt PROPERTIES +- INTERFACE_LINK_DIRECTORIES "${ONEDNN_INSTALL_DIR}/lib/$" +- INTERFACE_LINK_LIBRARIES "openvino_onednn_gpu" +- INTERFACE_INCLUDE_DIRECTORIES "${ONEDNN_INSTALL_DIR}/include" ++ INTERFACE_LINK_LIBRARIES $ ++ INTERFACE_INCLUDE_DIRECTORIES $ + INTERFACE_COMPILE_DEFINITIONS ENABLE_ONEDNN_FOR_GPU + ) + add_dependencies(onednn_gpu_tgt onednn_gpu_build) +- # TODO: install onednn_gpu in static builds ++ ++ if(NOT BUILD_SHARED_LIBS) ++ ov_install_static_lib(onednn_gpu_tgt ${OV_CPACK_COMP_CORE}) ++ ++ # we need to install library explicitly and set_target_properties in OpenVINOConfig.cmake for 'onednn_gpu_tgt' ++ # to point to installation location of this file ++ install(FILES "${ONEDNN_GPU_LIB_PATH}" ++ DESTINATION ${OV_CPACK_ARCHIVEDIR} ++ COMPONENT ${OV_CPACK_COMP_CORE}) ++ endif() + endfunction() + build_onednn_gpu() + endif() +diff --git a/src/plugins/intel_gpu/thirdparty/cmake/rapidjson.cmake b/src/plugins/intel_gpu/thirdparty/cmake/rapidjson.cmake +new file mode 100644 +index 0000000000..655224dbc1 +--- /dev/null ++++ b/src/plugins/intel_gpu/thirdparty/cmake/rapidjson.cmake +@@ -0,0 +1,22 @@ ++# Copyright (C) 2018-2023 Intel Corporation ++# SPDX-License-Identifier: Apache-2.0 ++# ++ ++find_package(RapidJSON QUIET) ++ ++if(NOT TARGET rapidjson) ++ # sometimes RapidJSONConfig.cmake defines only RAPIDJSON_INCLUDE_DIRS ++ add_library(rapidjson INTERFACE) ++ ++ if(RapidJSON_FOUND) ++ if(TARGET RapidJSON) ++ target_link_libraries(rapidjson INTERFACE RapidJSON) ++ elseif(DEFINED RAPIDJSON_INCLUDE_DIRS) ++ target_include_directories(rapidjson INTERFACE $) ++ else() ++ message(FATAL_ERROR "RapidJSON does not define RAPIDJSON_INCLUDE_DIRS nor RapidJSON / rapidjson targets") ++ endif() ++ else() ++ target_include_directories(rapidjson INTERFACE $) ++ endif() ++endif() +diff --git a/src/plugins/template/backend/CMakeLists.txt b/src/plugins/template/backend/CMakeLists.txt +index 7530dd1688..a451fea900 100644 +--- a/src/plugins/template/backend/CMakeLists.txt ++++ b/src/plugins/template/backend/CMakeLists.txt +@@ -52,4 +52,4 @@ openvino_developer_export_targets(COMPONENT core TARGETS interpreter_backend) + + # install + +-ov_install_static_lib(interpreter_backend template) ++ov_install_static_lib(interpreter_backend ${OV_CPACK_COMP_CORE}) +diff --git a/src/plugins/template/src/CMakeLists.txt b/src/plugins/template/src/CMakeLists.txt +index 2409bb10e0..f382f90d11 100644 +--- a/src/plugins/template/src/CMakeLists.txt ++++ b/src/plugins/template/src/CMakeLists.txt +@@ -28,7 +28,7 @@ target_include_directories(${TARGET_NAME} PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}" + "${TEMPLATE_PLUGIN_SOURCE_DIR}/include") + +-# link common Inference Engine libraries ++# link common OpenVINO Runtime libraries + target_link_libraries(${TARGET_NAME} PRIVATE + openvino::interpreter_backend + openvino::reference) +@@ -42,4 +42,4 @@ endif() + # [cmake:plugin] + + install(TARGETS ${TARGET_NAME} +- LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) ++ LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) +diff --git a/thirdparty/ocl/CMakeLists.txt b/thirdparty/ocl/CMakeLists.txt +index f31519467f..0ebe3fd6d1 100644 +--- a/thirdparty/ocl/CMakeLists.txt ++++ b/thirdparty/ocl/CMakeLists.txt +@@ -58,4 +58,4 @@ set(opencl_root_hints "${OpenCL_INCLUDE_DIR}" PARENT_SCOPE) + + # installation + +-ov_install_static_lib(OpenCL gpu) ++ov_install_static_lib(OpenCL ${OV_CPACK_COMP_CORE}) diff --git a/recipes/openvino/all/patches/2023.1.0/0004-fixed-gpu-plugin-with-clang.patch b/recipes/openvino/all/patches/2023.1.0/0004-fixed-gpu-plugin-with-clang.patch new file mode 100644 index 00000000000000..7659f10e22501b --- /dev/null +++ b/recipes/openvino/all/patches/2023.1.0/0004-fixed-gpu-plugin-with-clang.patch @@ -0,0 +1,2836 @@ +diff --git a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp +index 9386e52400..05972d7a97 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp +@@ -104,12 +104,10 @@ public: + + #define ASSIGN_TYPE_NAME(cls_name) \ + namespace cldnn { \ +- const std::string cls_name::type_for_serialization = #cls_name; \ + } + + #define BIND_BINARY_BUFFER_WITH_TYPE(cls_name) \ + namespace cldnn { \ +- const std::string cls_name::type_for_serialization = #cls_name; \ + BIND_TO_BUFFER(BinaryOutputBuffer, cls_name) \ + BIND_TO_BUFFER(BinaryInputBuffer, cls_name) \ + } +diff --git a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp +index 85ed3fa803..e2a673f0ba 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp +@@ -11,9 +11,12 @@ + #include "buffer.hpp" + #include "static_instance.hpp" + +-#define DECLARE_OBJECT_TYPE_SERIALIZATION \ +- static const std::string type_for_serialization; \ +- std::string get_type() const override { return type_for_serialization; } ++#define DECLARE_OBJECT_TYPE_SERIALIZATION(cls_name) \ ++ static const std::string& get_type_info_s() { \ ++ static const std::string type_name = #cls_name; \ ++ return type_name; \ ++ } \ ++ const std::string& get_type_info() const override { return get_type_info_s(); } + + #define BIND_TO_BUFFER(buffer, type) \ + template <> \ +@@ -101,7 +104,7 @@ public: + + private: + buffer_binder() { +- saver_storage::instance().set_save_function({T::type_for_serialization, save}); ++ saver_storage::instance().set_save_function({T::get_type_info_s(), save}); + } + + buffer_binder(const buffer_binder&) = delete; +@@ -130,7 +133,7 @@ public: + private: + buffer_binder() { + def::instance().set_load_function( +- {T::type_for_serialization, [](BufferType& buffer, std::unique_ptr>& result_ptr) { ++ {T::get_type_info_s(), [](BufferType& buffer, std::unique_ptr>& result_ptr) { + std::unique_ptr derived_ptr = std::unique_ptr(new T()); + derived_ptr->load(buffer); + result_ptr.reset(derived_ptr.release()); +@@ -153,7 +156,7 @@ public: + private: + buffer_binder() { + dif::instance().set_load_function( +- {T::type_for_serialization, [](BufferType& buffer, std::unique_ptr>& result_ptr, engine& engine) { ++ {T::get_type_info_s(), [](BufferType& buffer, std::unique_ptr>& result_ptr, engine& engine) { + std::unique_ptr derived_ptr = std::unique_ptr(new T(engine)); + derived_ptr->load(buffer); + result_ptr.reset(derived_ptr.release()); +diff --git a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp +index 023045b9bd..1792f5489c 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp +@@ -18,7 +18,7 @@ template + class Serializer, typename std::enable_if, BufferType>::value>::type> { + public: + static void save(BufferType& buffer, const std::unique_ptr& ptr) { +- const auto& type = ptr->get_type(); ++ const auto& type = ptr->get_type_info(); + buffer << type; + const auto save_func = saver_storage::instance().get_save_function(type); + save_func(buffer, ptr.get()); +@@ -51,7 +51,7 @@ template + class Serializer, typename std::enable_if, BufferType>::value>::type> { + public: + static void save(BufferType& buffer, const std::shared_ptr& ptr) { +- const std::string& type = ptr->get_type(); ++ const std::string& type = ptr->get_type_info(); + buffer << type; + if (type.compare("NONE") != 0) { + const auto save_func = saver_storage::instance().get_save_function(type); +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/activation.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/activation.hpp +index 09a3f96a98..771f1b9191 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/activation.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/activation.hpp +@@ -82,8 +82,6 @@ struct activation : public primitive_base { + activation_function(activation_func::none), + additional_params({0.f, 0.f}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs Relu primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/adaptive_pooling.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/adaptive_pooling.hpp +index e54b055312..f80d7b3c62 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/adaptive_pooling.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/adaptive_pooling.hpp +@@ -20,8 +20,6 @@ struct adaptive_pooling : public primitive_base { + mode{adaptive_pooling_mode::average}, + output_size{} {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs AdaptiveAvgPooling primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/arg_max_min.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/arg_max_min.hpp +index 16ca38e746..418f8df90d 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/arg_max_min.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/arg_max_min.hpp +@@ -27,8 +27,6 @@ struct arg_max_min : public primitive_base { + values_first(false), + stable(false) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs arg_max_min primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/assign.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/assign.hpp +index 1c4021a77d..4134614504 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/assign.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/assign.hpp +@@ -17,8 +17,6 @@ struct assign : public primitive_base { + + assign() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs Assign primitive. + /// @param id This primitive id + /// @param inputs Input parameters ids +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/batch_to_space.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/batch_to_space.hpp +index fab49940fb..246853a5f3 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/batch_to_space.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/batch_to_space.hpp +@@ -42,8 +42,6 @@ struct batch_to_space : public primitive_base { + + batch_to_space() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs batch_to_space primitive. + /// @param id This primitive id. + /// @param input Input data primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/binary_convolution.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/binary_convolution.hpp +index 268f78e73a..5ba028bda7 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/binary_convolution.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/binary_convolution.hpp +@@ -16,8 +16,6 @@ struct binary_convolution : public primitive_base { + + binary_convolution() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs binary_convolution primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/border.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/border.hpp +index def9b956ff..81ad97a196 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/border.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/border.hpp +@@ -26,8 +26,6 @@ struct border : public primitive_base { + + border() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief whether the input is const or not + enum PAD_NON_CONST_INPUT { + BEGIN = 0x1, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/broadcast.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/broadcast.hpp +index 3b210c7b94..d3b17919a4 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/broadcast.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/broadcast.hpp +@@ -56,8 +56,6 @@ struct broadcast : public primitive_base { + + broadcast() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs broadcast primitive / layer. + /// + /// @param id An identifier of new primitive. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/bucketize.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/bucketize.hpp +index 11e7f8752e..dd5b8f3d93 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/bucketize.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/bucketize.hpp +@@ -13,8 +13,6 @@ struct bucketize : primitive_base { + + bucketize() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs bucketize primitive. + /// @param id This primitive id. + /// @param inputs Input primitives ids. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/concatenation.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/concatenation.hpp +index 184dbf9ceb..5f187c7422 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/concatenation.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/concatenation.hpp +@@ -35,8 +35,6 @@ struct concatenation : public primitive_base { + + concatenation() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @li Constructs concatenation primitive. + /// @param id This primitive id. + /// @param input Vector of input primitives ids. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/convert_color.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/convert_color.hpp +index f1cd6e1934..f71e73310a 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/convert_color.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/convert_color.hpp +@@ -14,8 +14,6 @@ struct convert_color : public primitive_base { + + convert_color() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + enum color_format : uint32_t { + RGB, ///< RGB color format + BGR, ///< BGR color format, default in OpenVINO +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/convolution.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/convolution.hpp +index 01291816b1..0a15e6a146 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/convolution.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/convolution.hpp +@@ -15,8 +15,6 @@ struct convolution : public primitive_base { + + convolution() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs convolution primitive + /// @param id This primitive id. + /// @param input Input primitive id. +@@ -313,8 +311,6 @@ struct deformable_interp : public primitive_base { + + deformable_interp() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + deformable_interp(const primitive_id& id, + const std::vector& inputs, + uint32_t groups, +@@ -430,8 +426,6 @@ struct deformable_conv : public primitive_base { + + deformable_conv() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + deformable_conv(const primitive_id& id, + const input_info& input, + const std::vector& weights, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/crop.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/crop.hpp +index 5c944b75d1..b8935695b2 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/crop.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/crop.hpp +@@ -46,8 +46,6 @@ struct crop : public primitive_base { + + crop() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs crop primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_greedy_decoder.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_greedy_decoder.hpp +index 9c911243d5..2cf19ca58c 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_greedy_decoder.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_greedy_decoder.hpp +@@ -13,8 +13,6 @@ struct ctc_greedy_decoder : public primitive_base { + + ctc_greedy_decoder() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs ctc_greedy_decoder primitive. + /// @param id This primitive id. + /// @param input Input primitive id (input, sequence_indicators, second_output(optional)). +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_loss.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_loss.hpp +index 0d63027cf7..55cc934195 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_loss.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_loss.hpp +@@ -15,8 +15,6 @@ struct ctc_loss : primitive_base { + + ctc_loss() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs ctc_loss primitive. + /// @param id This primitive id. + /// @param inputs Input primitives ids. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/cum_sum.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/cum_sum.hpp +index 4a038714d7..11bd653d4c 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/cum_sum.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/cum_sum.hpp +@@ -6,15 +6,11 @@ + #include "primitive.hpp" + + namespace cldnn { +- +- + struct cum_sum : public primitive_base { + CLDNN_DECLARE_PRIMITIVE(cum_sum) + + cum_sum() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs cum_sum primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/custom_gpu_primitive.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/custom_gpu_primitive.hpp +index a938e2c0ff..62dafc4ce4 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/custom_gpu_primitive.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/custom_gpu_primitive.hpp +@@ -18,8 +18,6 @@ struct custom_gpu_primitive : public primitive_base { + + custom_gpu_primitive() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Custom primitive kernel argument type + enum arg_type { + arg_input, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp +index 8a89005102..177fbf99b7 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp +@@ -17,8 +17,6 @@ struct data : public primitive_base { + + data() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs data primitive. + /// @param id This primitive id. + /// @param mem @ref memory object which contains data. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/deconvolution.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/deconvolution.hpp +index b149539bb6..5c507a2360 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/deconvolution.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/deconvolution.hpp +@@ -20,8 +20,6 @@ struct deconvolution : public primitive_base { + + deconvolution() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs deconvolution primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/depth_to_space.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/depth_to_space.hpp +index 6d1c430d91..577be63765 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/depth_to_space.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/depth_to_space.hpp +@@ -22,8 +22,6 @@ struct depth_to_space : public primitive_base { + + depth_to_space() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs depth_to_space primitive. + /// @param id This primitive id. + /// @param input Input dictionary primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/detection_output.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/detection_output.hpp +index 7437106428..3c39a83963 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/detection_output.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/detection_output.hpp +@@ -42,8 +42,6 @@ struct detection_output : public primitive_base { + clip_after_nms(false), + objectness_score(0.0f) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs detection output primitive. + /// @param id This primitive id. + /// @param inputs Inputs for primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/dft.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/dft.hpp +index 45042ad94b..329794e088 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/dft.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/dft.hpp +@@ -29,8 +29,6 @@ struct dft : public primitive_base { + + dft() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs DFT primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/eltwise.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/eltwise.hpp +index de1e4138c3..b4b9e8932d 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/eltwise.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/eltwise.hpp +@@ -71,8 +71,6 @@ struct eltwise : public primitive_base { + + eltwise() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs eltwise primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/embedding_bag.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/embedding_bag.hpp +index c749c3b5e2..29b3259b50 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/embedding_bag.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/embedding_bag.hpp +@@ -14,8 +14,6 @@ struct embedding_bag : public primitive_base { + + embedding_bag() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Select type of embedding_bag operation + enum embedding_bag_type { + packed_sum, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_detection_output.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_detection_output.hpp +index cb47ec86f5..f87b161e48 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_detection_output.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_detection_output.hpp +@@ -16,8 +16,6 @@ struct experimental_detectron_detection_output : public primitive_base { +@@ -17,8 +15,6 @@ struct experimental_detectron_prior_grid_generator + + experimental_detectron_prior_grid_generator() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + experimental_detectron_prior_grid_generator(const primitive_id& id, + const std::vector& inputs, + bool flatten, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_roi_feature_extractor.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_roi_feature_extractor.hpp +index a9b27fd16f..3a1e229171 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_roi_feature_extractor.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_roi_feature_extractor.hpp +@@ -14,8 +14,6 @@ struct experimental_detectron_roi_feature_extractor : public primitive_base { +@@ -19,8 +17,6 @@ struct experimental_detectron_topk_rois : public primitive_base { + + extract_image_patches() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs select primitive. + /// @param id This primitive id. + /// @param input Input primitive id containing input 4-D tensor. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/eye.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/eye.hpp +index 4137aaa2ec..9cc2c9e083 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/eye.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/eye.hpp +@@ -14,8 +14,6 @@ struct eye : public primitive_base { + + eye() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs eye primitive. + /// @param id This primitive id. + /// @param inputs List of primitive ids. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/fully_connected.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/fully_connected.hpp +index d71afd76f1..ba05829539 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/fully_connected.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/fully_connected.hpp +@@ -35,8 +35,6 @@ struct fully_connected : public primitive_base { + + fully_connected() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs fully connected layer. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather.hpp +index f754d47667..2a7dad7fe4 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather.hpp +@@ -16,8 +16,6 @@ struct gather : public primitive_base { + + gather() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs gather primitive. + /// @param id This primitive id. + /// @param dict Input dictionary primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_elements.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_elements.hpp +index 0287a76877..455a40a9ea 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_elements.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_elements.hpp +@@ -14,8 +14,6 @@ struct gather_elements : public primitive_base { + + gather_elements() : primitive_base("", {}), output_format({}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs gather_elements primitive. + /// @param id This primitive id. + /// @param data Input data primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_nd.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_nd.hpp +index 932fe0b167..a2c26b0545 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_nd.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_nd.hpp +@@ -14,8 +14,6 @@ struct gather_nd : public primitive_base { + + gather_nd() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs gather_nd primitive. + /// + /// @param id This primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_tree.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_tree.hpp +index 5ec3339801..082b4113ab 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_tree.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_tree.hpp +@@ -15,8 +15,6 @@ struct gather_tree : public primitive_base { + + gather_tree() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs gather tree primitive / layer. + /// + /// @param id An identifier of new primitive. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gemm.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gemm.hpp +index 104b92571c..cef11bbb0b 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gemm.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gemm.hpp +@@ -27,8 +27,6 @@ struct gemm : public primitive_base { + + gemm() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs gemm layer. + /// @brief Primitive id containing first matrix + /// @brief Primitive id containing second matrix +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/generate_proposals.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/generate_proposals.hpp +index ab57e07d0d..3524c104fd 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/generate_proposals.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/generate_proposals.hpp +@@ -15,8 +15,6 @@ struct generate_proposals + + generate_proposals() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs generate_proposals primitive + /// @param id This primitive id + /// @param input_im_info image size info +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/grid_sample.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/grid_sample.hpp +index 700140c9d2..20e308e4aa 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/grid_sample.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/grid_sample.hpp +@@ -10,8 +10,6 @@ + #include "primitive.hpp" + + namespace cldnn { +- +- + using GridSampleOp = ov::op::v9::GridSample; + + /// @brief GridSample-9 primitive. +@@ -20,8 +18,6 @@ struct grid_sample : primitive_base { + + grid_sample() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs grid_sample primitive. + /// @param id This primitive id. + /// @param inputs Input primitives ids. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/grn.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/grn.hpp +index cda1ebe160..3b629bad91 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/grn.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/grn.hpp +@@ -13,8 +13,6 @@ struct grn : public primitive_base { + + grn() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs grn primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/input_layout.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/input_layout.hpp +index c13e89a3a5..5cbba06ca4 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/input_layout.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/input_layout.hpp +@@ -20,8 +20,6 @@ struct input_layout : public primitive_base { + + input_layout() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs input layout primitive. + /// @param id This primitive id. + /// @param layout Defines layout for the data will be passed to network. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/loop.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/loop.hpp +index 49af132862..c27a88e197 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/loop.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/loop.hpp +@@ -55,8 +55,6 @@ struct loop : public primitive_base { + loop() : primitive_base("", {}), + max_iteration(0) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + struct io_primitive_map { + /// @brief Constructs a mapping from external input/output primitive to input/output primitive in body topology + /// +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lrn.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lrn.hpp +index 28bcf69147..f8cc1672e7 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lrn.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lrn.hpp +@@ -6,8 +6,6 @@ + #include "primitive.hpp" + + namespace cldnn { +- +- + typedef enum { /*:int32_t*/ + lrn_norm_region_across_channel, + lrn_norm_region_within_channel +@@ -29,8 +27,6 @@ struct lrn : public primitive_base { + + lrn() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs LRN primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm.hpp +index 7c601158d8..71922acd21 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm.hpp +@@ -53,8 +53,6 @@ struct lstm : public primitive_base { + + lstm() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs lstm layer. + /// @param id This primitive id. + /// @param input Vector of primitive id. +@@ -230,8 +228,6 @@ struct lstm_gemm : public primitive_base { + lstm_gemm() : primitive_base("", {}), + direction(0) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs lstm layer. + /// @param id This primitive id. + /// @param input input primitive id. +@@ -319,8 +315,6 @@ struct lstm_elt : public primitive_base { + + lstm_elt() : primitive_base("", {}), clip(0), input_forget(0), offset_order(lstm_weights_order::iofz), direction(0) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + using vec_activation = std::vector; + using vec_activation_param = std::vector; + +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic.hpp +index fd7e7c4a26..d459754ebc 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic.hpp +@@ -22,8 +22,6 @@ struct lstm_dynamic : public primitive_base { + + lstm_dynamic() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs lstm_dynamic layer. + /// @param id This primitive id. + /// @param input Primitive id of input layer. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_input.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_input.hpp +index bf0ddb2d43..6a8e90d9a4 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_input.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_input.hpp +@@ -22,8 +22,6 @@ struct lstm_dynamic_input : public primitive_base { + + lstm_dynamic_input() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs lstm_dynamic layer. + /// @param id This primitive id. + /// @param input Primitive id of input layer. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_timeloop.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_timeloop.hpp +index e5b5ea7661..ef184707f9 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_timeloop.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_timeloop.hpp +@@ -23,8 +23,6 @@ struct lstm_dynamic_timeloop + + lstm_dynamic_timeloop() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs lstm_dynamic layer. + /// @param id This primitive id. + /// @param input Primitive id of input layer. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/matrix_nms.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/matrix_nms.hpp +index 72c95cae70..d4efea1d59 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/matrix_nms.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/matrix_nms.hpp +@@ -16,8 +16,6 @@ struct matrix_nms : public primitive_base { + + matrix_nms() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + enum decay_function { gaussian, linear }; + + enum sort_result_type { +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/multiclass_nms.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/multiclass_nms.hpp +index 5218488f1b..92ea0d371b 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/multiclass_nms.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/multiclass_nms.hpp +@@ -18,8 +18,6 @@ struct multiclass_nms : public primitive_base { + + multiclass_nms() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + enum class sort_result_type : int32_t { + classid, // sort selected boxes by class id (ascending) in each batch element + score, // sort selected boxes by score (descending) in each batch element +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/mutable_data.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/mutable_data.hpp +index 54c46bf785..105711b58d 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/mutable_data.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/mutable_data.hpp +@@ -18,8 +18,6 @@ struct mutable_data : public primitive_base { + + mutable_data() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Enum type to specify function for data filling. + enum filler_type { no_fill, zero, one, xavier }; + +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/mvn.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/mvn.hpp +index 72daa005b6..72e5cd67d9 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/mvn.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/mvn.hpp +@@ -14,8 +14,6 @@ struct mvn : public primitive_base { + + mvn() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs mvn primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/non_max_suppression.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/non_max_suppression.hpp +index b7aafffb55..b9614cd472 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/non_max_suppression.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/non_max_suppression.hpp +@@ -22,8 +22,6 @@ struct non_max_suppression : public primitive_base { + center_point_box(false), + sort_result_descending(false) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Creates non max suppression primitive. + /// @param id This primitive id. + /// @param boxes_positions Id of primitive with bounding boxes. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/non_zero.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/non_zero.hpp +index d243058bad..0fa4b35ff7 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/non_zero.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/non_zero.hpp +@@ -13,8 +13,6 @@ struct count_nonzero : public primitive_base { + + count_nonzero() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs count_nonzero primitive. + /// @param id This primitive id. + /// @param data Input data primitive id. +@@ -33,8 +31,6 @@ struct gather_nonzero : public primitive_base { + + gather_nonzero() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs gather_nonzero primitive. + /// @param id This primitive id. + /// @param data Input data primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/normalize.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/normalize.hpp +index b17c659d76..0f25272bce 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/normalize.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/normalize.hpp +@@ -29,8 +29,6 @@ struct normalize : public primitive_base { + + normalize() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs normalize primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/one_hot.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/one_hot.hpp +index 3a2958a0fb..b94e069fc2 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/one_hot.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/one_hot.hpp +@@ -35,8 +35,6 @@ struct one_hot : public primitive_base { + + one_hot() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs one-hot primitive layer. + /// @param id An identifier of new primitive. + /// @param input An identifier of primitive which is an input for newly created one-hot primitive. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/permute.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/permute.hpp +index 587427e6a8..91bc12df87 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/permute.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/permute.hpp +@@ -21,8 +21,6 @@ struct permute : public primitive_base { + + permute() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs permute primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/pooling.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/pooling.hpp +index 0db15d2278..df49ba46a9 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/pooling.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/pooling.hpp +@@ -34,8 +34,6 @@ struct pooling : public primitive_base { + + pooling() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs pooling primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp +index f68aa5f6c3..0bbf589b0d 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp +@@ -203,7 +203,7 @@ public: + + size_t num_outputs; + +- virtual std::string get_type() const { return "NONE"; } ++ virtual const std::string& get_type_info() const = 0; + virtual void save(BinaryOutputBuffer& ob) const { + ob << type_string(); + ob << id; +@@ -313,6 +313,7 @@ struct primitive_info { + } + + #define CLDNN_DECLARE_PRIMITIVE(PType) \ ++ DECLARE_OBJECT_TYPE_SERIALIZATION(PType) \ + CLDNN_DEFINE_TYPE_ID(PType) \ + CLDNN_DEFINE_TYPE_STRING(PType) + +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/prior_box.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/prior_box.hpp +index 959e6b14f0..3f78605f49 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/prior_box.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/prior_box.hpp +@@ -23,8 +23,6 @@ struct prior_box : public primitive_base { + + prior_box() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + using PriorBoxV0Op = ov::op::v0::PriorBox; + using PriorBoxV8Op = ov::op::v8::PriorBox; + using PriorBoxClusteredOp = ov::op::v0::PriorBoxClustered; +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/proposal.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/proposal.hpp +index 1278d4ff6f..a1e6768276 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/proposal.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/proposal.hpp +@@ -10,8 +10,6 @@ + #include "intel_gpu/graph/serialization/vector_serializer.hpp" + + namespace cldnn { +- +- + #define CLDNN_ROI_VECTOR_SIZE 5 + + struct proposal : public primitive_base { +@@ -37,8 +35,6 @@ struct proposal : public primitive_base { + shift_anchors(false), + normalize(false) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + proposal(const primitive_id& id, + const input_info& cls_scores, + const input_info& bbox_pred, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/pyramid_roi_align.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/pyramid_roi_align.hpp +index 6d9842227a..123faf83f2 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/pyramid_roi_align.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/pyramid_roi_align.hpp +@@ -26,8 +26,6 @@ struct pyramid_roi_align : public primitive_base { + + pyramid_roi_align() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @param id This primitive id. + /// @param rois Input RoI boxes as tuple [x1, y1, x2, y2] describing two opposite corners of the region. + /// @param P2 First level of the image pyramid. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/quantize.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/quantize.hpp +index bb5de80742..a2bb5ae3cf 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/quantize.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/quantize.hpp +@@ -38,8 +38,6 @@ struct quantize : public primitive_base { + + quantize() : primitive_base("", {}), levels(0) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief levels The number of quantization levels. + int levels; + +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/random_uniform.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/random_uniform.hpp +index 02c86cb80d..598d8171b5 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/random_uniform.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/random_uniform.hpp +@@ -10,8 +10,6 @@ + + namespace cldnn { + +- +- + /// @brief RandomUniform-8 primitive + /// @details + struct random_uniform : public primitive_base { +@@ -22,8 +20,6 @@ struct random_uniform : public primitive_base { + op_seed(0), + output_shape{} {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /** + * Construct Random Uniform privitive. + * @param id primitive id +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/range.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/range.hpp +index 005d74a6c8..3d68fd2815 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/range.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/range.hpp +@@ -12,8 +12,6 @@ struct range: public primitive_base { + + range() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs range primitive. + /// @param id This primitive id. + /// @param inputs Input primitive id vector. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/read_value.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/read_value.hpp +index 9523b416cd..095c845d07 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/read_value.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/read_value.hpp +@@ -17,8 +17,6 @@ struct read_value : public primitive_base { + + read_value() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs ReadValue primitive. + /// @param id This primitive id + /// @param inputs Input parameters ids +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reduce.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reduce.hpp +index 7af0ad1dd9..c1f687e48a 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reduce.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reduce.hpp +@@ -44,8 +44,6 @@ struct reduce : public primitive_base { + + reduce() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs reduce primitive + /// @param id This primitive id + /// @param input Input primitive id +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/region_yolo.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/region_yolo.hpp +index 7efddc3fb4..d9040d1dc2 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/region_yolo.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/region_yolo.hpp +@@ -16,8 +16,6 @@ struct region_yolo : public primitive_base { + + region_yolo() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs region_yolo primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reorder.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reorder.hpp +index 1c59eebe65..7b2ada5d77 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reorder.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reorder.hpp +@@ -69,8 +69,6 @@ struct reorder : public primitive_base { + output_format(format::any), + mean_mode(reorder_mean_mode::subtract) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief reorder memory types + enum class memory_type { + buffer, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reorg_yolo.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reorg_yolo.hpp +index b5d76e9353..96eff0012e 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reorg_yolo.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reorg_yolo.hpp +@@ -16,8 +16,6 @@ struct reorg_yolo : public primitive_base { + + reorg_yolo() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs region_yolo primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/resample.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/resample.hpp +index b95ce3c5e0..59f58c986b 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/resample.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/resample.hpp +@@ -17,8 +17,6 @@ struct resample : public primitive_base { + + resample() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + using InterpolateOp = ov::op::util::InterpolateBase; + + /// @brief Constructs Resample primitive. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reshape.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reshape.hpp +index 0f9869a2f7..00e8d9a093 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reshape.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reshape.hpp +@@ -17,8 +17,6 @@ struct reshape : public primitive_base { + + reshape() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + enum reshape_mode : uint32_t { + base, + squeeze, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse.hpp +index 0ecb598550..70864a9f1e 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse.hpp +@@ -15,8 +15,6 @@ struct reverse : public primitive_base { + + reverse() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs reverse primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse_sequence.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse_sequence.hpp +index 8058bd3a45..714e0f4a49 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse_sequence.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse_sequence.hpp +@@ -15,8 +15,6 @@ struct reverse_sequence : public primitive_base { + + reverse_sequence() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs reverse_sequence primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_align.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_align.hpp +index 14b031d87f..0813c960f0 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_align.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_align.hpp +@@ -15,8 +15,6 @@ struct roi_align : public primitive_base { + + roi_align() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Pooling mode for the @ref roi_align + enum PoolingMode { max, avg }; + +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_pooling.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_pooling.hpp +index ef7fc25664..2dd22e52d3 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_pooling.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_pooling.hpp +@@ -8,8 +8,6 @@ + #include + + namespace cldnn { +- +- + struct roi_pooling : public primitive_base { + CLDNN_DECLARE_PRIMITIVE(roi_pooling) + +@@ -27,8 +25,6 @@ struct roi_pooling : public primitive_base { + spatial_bins_x(1), + spatial_bins_y(1) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + roi_pooling(const primitive_id& id, + const input_info& input_data, + const input_info& input_rois, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/roll.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/roll.hpp +index 3ae8fc634e..3db154bf47 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/roll.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/roll.hpp +@@ -15,8 +15,6 @@ struct roll : primitive_base { + + roll() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs roll primitive. + /// @param id This primitive id. + /// @param input Input primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_elements_update.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_elements_update.hpp +index fa2cd6e07b..4b823a165c 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_elements_update.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_elements_update.hpp +@@ -14,8 +14,6 @@ struct scatter_elements_update : public primitive_base + + scatter_elements_update() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs scatter_elements_update primitive. + /// @param id This primitive id. + /// @param dict Input data primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_nd_update.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_nd_update.hpp +index f21691c3c7..1cc8746e9e 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_nd_update.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_nd_update.hpp +@@ -14,8 +14,6 @@ struct scatter_nd_update : public primitive_base { + + scatter_nd_update() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + /// @brief Constructs scatter_nd_update primitive. + /// @param id This primitive id. + /// @param dict Input data primitive id. +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_update.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_update.hpp +index 9563fe079e..17c09a8d8e 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_update.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_update.hpp +@@ -14,8 +14,6 @@ struct scatter_update : public primitive_base { + + scatter_update() : primitive_base("", {}) {} + +- DECLARE_OBJECT_TYPE_SERIALIZATION +- + enum scatter_update_axis { + along_b, + along_f, +diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/select.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/select.hpp +index 310c5ff2cb..0959fa2709 100644 +--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/select.hpp ++++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/select.hpp +@@ -22,8 +22,6 @@ struct select : public primitive_base { + using kernel_selector_t = kernel_selector::select_kernel_selector; + using kernel_params_t = std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::select_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp +index 02efeee00f..b2efd25f67 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp +@@ -17,7 +17,7 @@ struct shape_of_impl : typed_primitive_impl_ocl { + using kernel_selector_t = kernel_selector::shape_of_kernel_selector; + using kernel_params_t = std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::shape_of_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp +index 57ac2437f4..e40b1b99b8 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp +@@ -17,7 +17,7 @@ struct shuffle_channels_impl : typed_primitive_impl_ocl { + using kernel_selector_t = kernel_selector::shuffle_channels_kernel_selector; + using kernel_params_t = std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::shuffle_channels_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp +index 07ea912d06..d7f7f9ba74 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp +@@ -72,7 +72,7 @@ struct slice_impl : typed_primitive_impl_ocl { + kInputsNum + }; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::slice_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp +index b4029ac3b3..6ad4e1d087 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp +@@ -39,7 +39,7 @@ struct softmax_impl : typed_primitive_impl_ocl { + using kernel_selector_t = kernel_selector::softmax_kernel_selector; + using kernel_params_t = std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::softmax_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp +index 141116e04b..c9db851175 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp +@@ -16,7 +16,7 @@ struct space_to_batch_impl : typed_primitive_impl_ocl { + using kernel_selector_t = kernel_selector::space_to_batch_kernel_selector; + using kernel_params_t = std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::space_to_batch_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp +index ec87100f89..5b72a5572c 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp +@@ -16,7 +16,7 @@ struct space_to_depth_impl : typed_primitive_impl_ocl { + using kernel_selector_t = kernel_selector::space_to_depth_kernel_selector; + using kernel_params_t = std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::space_to_depth_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp +index f06ae1b72d..e64498f73f 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp +@@ -46,7 +46,7 @@ struct strided_slice_impl : typed_primitive_impl_ocl { + using kernel_selector_t = kernel_selector::strided_slice_kernel_selector; + using kernel_params_t = std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::strided_slice_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp +index 16d2dd91cb..bc95a18f54 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp +@@ -17,7 +17,7 @@ struct tile_impl : typed_primitive_impl_ocl { + using kernel_selector_t = kernel_selector::tile_kernel_selector; + using kernel_params_t = std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::tile_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/unique.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/unique.cpp +index 7018ae66a2..604619c30b 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/ocl/unique.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/ocl/unique.cpp +@@ -17,7 +17,7 @@ struct unique_count_impl : typed_primitive_impl_ocl { + using kernel_params_t = + std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::unique_count_impl) + + std::unique_ptr clone() const override { + return make_unique(*this); +@@ -88,7 +88,7 @@ struct unique_gather_impl : typed_primitive_impl_ocl { + using kernel_params_t = + std::pair; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::unique_gather) + + std::unique_ptr clone() const override { + return make_unique(*this); +diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp +index ed5565504f..325afd5f3c 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp +@@ -21,7 +21,7 @@ struct concatenation_onednn : typed_primitive_onednn_impl; + using parent::parent; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::concatenation_onednn) + + protected: + std::unique_ptr clone() const override { +diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp +index 1a27f3ae29..f1d1ab0a6c 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp +@@ -26,7 +26,7 @@ struct convolution_onednn : typed_primitive_onednn_impl { + using parent = typed_primitive_onednn_impl; + using parent::parent; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::convolution_onednn) + + protected: + std::unique_ptr clone() const override { +diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp +index 439b74feff..1702738598 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp +@@ -22,7 +22,7 @@ struct deconvolution_onednn : typed_primitive_onednn_impl { + using parent = typed_primitive_onednn_impl; + using parent::parent; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::deconvolution_onednn) + + protected: + std::unique_ptr clone() const override { +diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp +index 4aacb2ebd5..8ee6979dec 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp +@@ -19,7 +19,7 @@ struct fully_connected_onednn : typed_primitive_onednn_impl { + using parent = typed_primitive_onednn_impl; + using parent::parent; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::fully_connected_onednn) + + private: + static std::vector reshape_to_2d(const ov::PartialShape& shape, int64_t feature) { +diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp +index 7410f79961..87e7decb34 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp +@@ -19,7 +19,7 @@ struct gemm_onednn : typed_primitive_onednn_impl { + using parent = typed_primitive_onednn_impl; + using parent::parent; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::gemm_onednn) + + protected: + std::unique_ptr clone() const override { +diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp +index 52f0edc797..1dc686331b 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp +@@ -19,7 +19,7 @@ struct pooling_onednn : typed_primitive_onednn_impl { + using parent = typed_primitive_onednn_impl; + using parent::parent; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::pooling_onednn) + + protected: + std::unique_ptr clone() const override { +diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp +index 581c37c015..635d465fc5 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp +@@ -41,7 +41,7 @@ struct reduction_onednn : typed_primitive_onednn_impl { + using parent = typed_primitive_onednn_impl; + using parent::parent; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::reduction_onednn) + + protected: + std::unique_ptr clone() const override { +diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp +index 284dd8b166..433e043067 100644 +--- a/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp ++++ b/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp +@@ -19,7 +19,7 @@ struct reorder_onednn : typed_primitive_onednn_impl; + using parent::parent; + +- DECLARE_OBJECT_TYPE_SERIALIZATION ++ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::reorder_onednn) + + protected: + std::unique_ptr clone() const override { +diff --git a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h +index 3244ad20b4..454c92ac97 100644 +--- a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h ++++ b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h +@@ -54,7 +54,7 @@ struct primitive_impl { + + virtual std::vector get_internal_buffer_layouts() const = 0; + virtual void set_node_params(const program_node&) {} +- virtual std::string get_type() const = 0; ++ virtual const std::string& get_type_info() const = 0; + virtual void set_arguments(primitive_inst& instance) = 0; + virtual void set_arguments(primitive_inst& instance, kernel_arguments_data& args) = 0; + virtual kernel_arguments_data get_arguments(const primitive_inst& instance) const = 0; diff --git a/recipes/openvino/all/patches/2023.1.0/0005-dynamic-protobuf.patch b/recipes/openvino/all/patches/2023.1.0/0005-dynamic-protobuf.patch new file mode 100644 index 00000000000000..50b087b4268b4a --- /dev/null +++ b/recipes/openvino/all/patches/2023.1.0/0005-dynamic-protobuf.patch @@ -0,0 +1,218 @@ +diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake +index df3586474b..8e50b25ea3 100644 +--- a/cmake/developer_package/frontends/frontends.cmake ++++ b/cmake/developer_package/frontends/frontends.cmake +@@ -130,6 +130,10 @@ macro(ov_add_frontend) + foreach(INFILE IN LISTS proto_files) + get_filename_component(FILE_DIR ${INFILE} DIRECTORY) + get_filename_component(FILE_WE ${INFILE} NAME_WE) ++ if(FILE_WE MATCHES "^(any|wrappers)$") ++ # we need to skip standard protobuf files ++ continue() ++ endif() + set(OUTPUT_PB_SRC ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}.pb.cc) + set(OUTPUT_PB_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}.pb.h) + set(GENERATED_PROTO ${INFILE}) +diff --git a/src/frontends/common/src/manager.cpp b/src/frontends/common/src/manager.cpp +index 2fa59398b1..6194fca758 100644 +--- a/src/frontends/common/src/manager.cpp ++++ b/src/frontends/common/src/manager.cpp +@@ -20,11 +20,6 @@ class FrontEndManager::Impl { + std::mutex m_loading_mutex; + std::vector m_plugins; + +- /// \brief map of shared object per frontend +- static std::unordered_map> m_shared_objects_map; +- /// \brief Mutex to guard access the shared object map +- static std::mutex m_shared_objects_map_mutex; +- + public: + Impl() { + search_all_plugins(); +@@ -36,10 +31,6 @@ public: + auto fe_obj = std::make_shared(); + fe_obj->m_shared_object = std::make_shared(plugin.get_so_pointer()); + fe_obj->m_actual = plugin.get_creator().m_creator(); +- +- std::lock_guard guard(m_shared_objects_map_mutex); +- m_shared_objects_map.emplace(plugin.get_creator().m_name, fe_obj->m_shared_object); +- + return fe_obj; + } + +@@ -49,6 +40,7 @@ public: + {"ir", "ir"}, + {"onnx", "onnx"}, + {"tf", "tensorflow"}, ++ {"tflite", "tensorflow_lite"}, + {"paddle", "paddle"}, + {"pytorch", "pytorch"}, + }; +@@ -127,8 +119,8 @@ public: + } + + static void shutdown() { +- std::lock_guard guard(m_shared_objects_map_mutex); +- m_shared_objects_map.clear(); ++ std::lock_guard guard(get_shared_objects_mutex()); ++ get_shared_objects_map().clear(); + } + + private: +@@ -153,6 +145,7 @@ private: + {".xml", {"ir", "ir"}}, + {".onnx", {"onnx", "onnx"}}, + {".pb", {"tf", "tensorflow"}}, ++ {".pbtxt", {"tf", "tensorflow"}}, + {".tflite", {"tflite", "tensorflow_lite"}}, + {".pdmodel", {"paddle", "paddle"}}, + // {".ts", {"pytorch", "pytorch"}}, +@@ -223,9 +216,6 @@ private: + } + }; + +-std::unordered_map> FrontEndManager::Impl::m_shared_objects_map{}; +-std::mutex FrontEndManager::Impl::m_shared_objects_map_mutex{}; +- + FrontEndManager::FrontEndManager() : m_impl(new Impl()) {} + + FrontEndManager::FrontEndManager(FrontEndManager&&) noexcept = default; +diff --git a/src/frontends/common/src/plugin_loader.cpp b/src/frontends/common/src/plugin_loader.cpp +index a044152d8d..a98eff766b 100644 +--- a/src/frontends/common/src/plugin_loader.cpp ++++ b/src/frontends/common/src/plugin_loader.cpp +@@ -16,17 +16,32 @@ + + #include + +-#include + #include + #include + + #include "openvino/util/file_util.hpp" ++#include "openvino/util/log.hpp" + #include "openvino/util/shared_object.hpp" + #include "plugin_loader.hpp" + + using namespace ov; + using namespace ov::frontend; + ++// Note, static methods below are required to create an order of initialization of static variables ++// e.g. if users (not encouraged) created ov::Model globally, we need to ensure proper order of initialization ++ ++/// \return map of shared object per frontend ++std::unordered_map>& ov::frontend::get_shared_objects_map() { ++ static std::unordered_map> shared_objects_map; ++ return shared_objects_map; ++} ++ ++/// \return Mutex to guard access the shared object map ++std::mutex& ov::frontend::get_shared_objects_mutex() { ++ static std::mutex shared_objects_map_mutex; ++ return shared_objects_map_mutex; ++} ++ + #ifdef OPENVINO_STATIC_LIBRARY + + # include "ov_frontends.hpp" +@@ -131,6 +146,10 @@ bool PluginInfo::load() { + m_load_failed = true; + return false; + } ++ ++ std::lock_guard guard(get_shared_objects_mutex()); ++ get_shared_objects_map().emplace(get_creator().m_name, get_so_pointer()); ++ + return true; + } + +diff --git a/src/frontends/common/src/plugin_loader.hpp b/src/frontends/common/src/plugin_loader.hpp +index 93e6a5cc2e..dccf8ddf7a 100644 +--- a/src/frontends/common/src/plugin_loader.hpp ++++ b/src/frontends/common/src/plugin_loader.hpp +@@ -4,7 +4,12 @@ + + #pragma once + +-#include ++#include ++#include ++#include ++#include ++ ++#include "openvino/frontend/manager.hpp" + + #ifdef _WIN32 + static const char PathSeparator[] = ";"; +@@ -15,6 +20,9 @@ static const char PathSeparator[] = ":"; + namespace ov { + namespace frontend { + ++std::unordered_map>& get_shared_objects_map(); ++std::mutex& get_shared_objects_mutex(); ++ + /// \brief Internal data structure holding by each frontend. Includes library handle and extensions. + class FrontEndSharedData { + friend inline void add_extension_to_shared_data(std::shared_ptr& obj, +diff --git a/src/frontends/tensorflow/src/proto/meta_graph.proto b/src/frontends/tensorflow/src/proto/meta_graph.proto +index b6918fa853..c59c0680af 100644 +--- a/src/frontends/tensorflow/src/proto/meta_graph.proto ++++ b/src/frontends/tensorflow/src/proto/meta_graph.proto +@@ -14,7 +14,7 @@ syntax = "proto3"; + + package tensorflow; + +-import "any.proto"; ++import "google/protobuf/any.proto"; + import "graph.proto"; + import "op_def.proto"; + import "tensor_shape.proto"; +diff --git a/src/frontends/tensorflow/src/proto/saved_object_graph.proto b/src/frontends/tensorflow/src/proto/saved_object_graph.proto +index 671441075c..3918a4a8d1 100644 +--- a/src/frontends/tensorflow/src/proto/saved_object_graph.proto ++++ b/src/frontends/tensorflow/src/proto/saved_object_graph.proto +@@ -14,7 +14,7 @@ syntax = "proto3"; + + package tensorflow; + +-import "any.proto"; ++import "google/protobuf/any.proto"; + import "tensor_shape.proto"; + import "types.proto"; + import "variable.proto"; +diff --git a/src/frontends/tensorflow/src/proto/trackable_object_graph.proto b/src/frontends/tensorflow/src/proto/trackable_object_graph.proto +index f4a8e4da34..f0a9617432 100644 +--- a/src/frontends/tensorflow/src/proto/trackable_object_graph.proto ++++ b/src/frontends/tensorflow/src/proto/trackable_object_graph.proto +@@ -14,7 +14,7 @@ syntax = "proto3"; + + package tensorflow; + +-import "wrappers.proto"; ++import "google/protobuf/wrappers.proto"; + + option cc_enable_arenas = true; + option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; +diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake +index 43e0ed671a..10042641e4 100644 +--- a/thirdparty/dependencies.cmake ++++ b/thirdparty/dependencies.cmake +@@ -415,14 +415,14 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND + if(CMAKE_VERBOSE_MAKEFILE) + set(Protobuf_DEBUG ON) + endif() +- if(OV_VCPKG_BUILD) +- set(protobuf_config CONFIG) +- endif() + # try to find newer version first (major is changed) + # see https://protobuf.dev/support/version-support/ and + # https://github.com/protocolbuffers/protobuf/commit/d61f75ff6db36b4f9c0765f131f8edc2f86310fa +- find_package(Protobuf 4.22.0 QUIET ${protobuf_config}) ++ find_package(Protobuf 4.22.0 QUIET CONFIG) + if(NOT Protobuf_FOUND) ++ if(OV_VCPKG_BUILD) ++ set(protobuf_config CONFIG) ++ endif() + # otherwise, fallback to existing default + find_package(Protobuf 3.20.3 REQUIRED ${protobuf_config}) + endif() diff --git a/recipes/openvino/all/patches/2023.1.0/0006-macos-14.patch b/recipes/openvino/all/patches/2023.1.0/0006-macos-14.patch new file mode 100644 index 00000000000000..4184c1832cef38 --- /dev/null +++ b/recipes/openvino/all/patches/2023.1.0/0006-macos-14.patch @@ -0,0 +1,12 @@ +diff --git a/src/plugins/intel_cpu/src/nodes/mha.cpp b/src/plugins/intel_cpu/src/nodes/mha.cpp +index d4405be5d4..19cf63ac72 100644 +--- a/src/plugins/intel_cpu/src/nodes/mha.cpp ++++ b/src/plugins/intel_cpu/src/nodes/mha.cpp +@@ -16,6 +16,7 @@ + #include "common/cpu_convert.h" + #include "transformations/cpu_opset/x64/op/mha.hpp" + #include "dnnl_extension_utils.h" ++#include "utils/bfloat16.hpp" + #include + + using namespace InferenceEngine; 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/all/test_package/CMakeLists.txt b/recipes/openvino/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..60799331791bdf --- /dev/null +++ b/recipes/openvino/all/test_package/CMakeLists.txt @@ -0,0 +1,61 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX C) + +# Common + +macro(add_component def comp) + if(${def}) + list(APPEND OpenVINO_COMPONENTS ${comp}) + endif() +endmacro() + +add_component(ENABLE_ONNX_FRONTEND ONNX) +add_component(ENABLE_PADDLE_FRONTEND Paddle) +add_component(ENABLE_TF_FRONTEND TensorFlow) +add_component(ENABLE_TF_LITE_FRONTEND TensorFlowLite) +add_component(ENABLE_PYTORCH_FRONTEND PyTroch) + +find_package(OpenVINO REQUIRED COMPONENTS Runtime ${OpenVINO_COMPONENTS}) + +function(add_plugin_definition target def) + if(${def}) + target_compile_definitions(${target} PRIVATE ${def}) + endif() +endfunction() + +function(add_frontend_definition target def frontend) + if(${def}) + target_compile_definitions(${target} PRIVATE ${def}) + if(NOT TARGET openvino::frontend::${frontend}) + message(FATAL_ERROR "Target for ${frontend} has not been created") + endif() + endif() +endfunction() + +# C++ test_package + +set(target ${PROJECT_NAME}_cpp) +add_executable(${target} test_package.cpp) + +add_plugin_definition(${target} ENABLE_IR_FRONTEND) +add_frontend_definition(${target} ENABLE_ONNX_FRONTEND onnx) +add_frontend_definition(${target} ENABLE_PADDLE_FRONTEND paddle) +add_frontend_definition(${target} ENABLE_TF_FRONTEND tensorflow) +add_frontend_definition(${target} ENABLE_TF_LITE_FRONTEND tensorflow_lite) +add_frontend_definition(${target} ENABLE_PYTORCH_FRONTEND pytorch) + +target_link_libraries(${target} PRIVATE openvino::runtime) +target_compile_features(${target} PRIVATE cxx_std_11) + +# C test_package + +set(target ${PROJECT_NAME}_c) +add_executable(${target} test_package.c) + +add_plugin_definition(${target} ENABLE_INTEL_CPU) +add_plugin_definition(${target} ENABLE_INTEL_GPU) +add_plugin_definition(${target} ENABLE_AUTO) +add_plugin_definition(${target} ENABLE_HETERO) +add_plugin_definition(${target} ENABLE_AUTO_BATCH) + +target_link_libraries(${target} PRIVATE openvino::runtime::c) diff --git a/recipes/openvino/all/test_package/conanfile.py b/recipes/openvino/all/test_package/conanfile.py new file mode 100644 index 00000000000000..9d90e91b9a9f9a --- /dev/null +++ b/recipes/openvino/all/test_package/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + deps = CMakeDeps(self) + # deps.check_components_exist = True + deps.generate() + + tc = CMakeToolchain(self) + tc.variables["CMAKE_VERBOSE_MAKEFILE"] = True + # HW plugins + tc.variables["ENABLE_INTEL_CPU"] = self.dependencies[self.tested_reference_str].options.enable_cpu + tc.variables["ENABLE_INTEL_GPU"] = self.dependencies[self.tested_reference_str].options.get_safe("enable_gpu", False) + # SW plugins + tc.variables["ENABLE_AUTO"] = self.dependencies[self.tested_reference_str].options.enable_auto + tc.variables["ENABLE_HETERO"] = self.dependencies[self.tested_reference_str].options.enable_hetero + tc.variables["ENABLE_AUTO_BATCH"] = self.dependencies[self.tested_reference_str].options.enable_auto_batch + # Frontends + tc.variables["ENABLE_IR_FRONTEND"] = self.dependencies[self.tested_reference_str].options.enable_ir_frontend + tc.variables["ENABLE_ONNX_FRONTEND"] = self.dependencies[self.tested_reference_str].options.enable_onnx_frontend + tc.variables["ENABLE_TF_FRONTEND"] = self.dependencies[self.tested_reference_str].options.enable_tf_frontend + tc.variables["ENABLE_TF_LITE_FRONTEND"] = self.dependencies[self.tested_reference_str].options.enable_tf_lite_frontend + tc.variables["ENABLE_PADDLE_FRONTEND"] = self.dependencies[self.tested_reference_str].options.enable_paddle_frontend + tc.variables["ENABLE_PYTORCH_FRONTEND"] = self.dependencies[self.tested_reference_str].options.enable_pytorch_frontend + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path_c = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_path_c, env="conanrun") + + bin_path_cpp = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_path_cpp, env="conanrun") diff --git a/recipes/openvino/all/test_package/test_package.c b/recipes/openvino/all/test_package/test_package.c new file mode 100644 index 00000000000000..1cea5771a2dbf7 --- /dev/null +++ b/recipes/openvino/all/test_package/test_package.c @@ -0,0 +1,49 @@ +#include + +#define OV_SUCCESS(statement) \ + if ((statement) != 0) \ + return 1; + +#define OV_FAIL(statement) \ + if ((statement) == 0) \ + return 1; + +int test_available_devices() { + ov_core_t* core = NULL; + char* ret = NULL; + OV_SUCCESS(ov_core_create(&core)); +#ifdef ENABLE_INTEL_CPU + OV_SUCCESS(ov_core_get_property(core, "CPU", "AVAILABLE_DEVICES", &ret)); +#else + OV_FAIL(ov_core_get_property(core, "CPU", "AVAILABLE_DEVICES", &ret)); +#endif +#ifdef ENABLE_INTEL_GPU + OV_SUCCESS(ov_core_get_property(core, "GPU", "AVAILABLE_DEVICES", &ret)); +#else + OV_FAIL(ov_core_get_property(core, "GPU", "AVAILABLE_DEVICES", &ret)); +#endif +#ifdef ENABLE_AUTO + OV_SUCCESS(ov_core_get_property(core, "AUTO", "SUPPORTED_METRICS", &ret)); + OV_SUCCESS(ov_core_get_property(core, "MULTI", "SUPPORTED_METRICS", &ret)); +#else + OV_FAIL(ov_core_get_property(core, "AUTO", "SUPPORTED_METRICS", &ret)); + OV_FAIL(ov_core_get_property(core, "MULTI", "SUPPORTED_METRICS", &ret)); +#endif +#ifdef ENABLE_HETERO + OV_SUCCESS(ov_core_get_property(core, "HETERO", "SUPPORTED_METRICS", &ret)); +#else + OV_FAIL(ov_core_get_property(core, "HETERO", "SUPPORTED_METRICS", &ret)); +#endif +#ifdef ENABLE_AUTO_BATCH + OV_SUCCESS(ov_core_get_property(core, "BATCH", "SUPPORTED_METRICS", &ret)); +#else + OV_FAIL(ov_core_get_property(core, "BATCH", "SUPPORTED_METRICS", &ret)); +#endif + ov_core_free(core); + return 0; +} + +int main() { + OV_SUCCESS(test_available_devices()); + return 0; +} diff --git a/recipes/openvino/all/test_package/test_package.cpp b/recipes/openvino/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..baaef66559aa49 --- /dev/null +++ b/recipes/openvino/all/test_package/test_package.cpp @@ -0,0 +1,66 @@ +#include +#include +#include + +#define OV_SUCCESS(statement) \ + if ((statement) != 0) \ + return 1; + +#define OV_FAIL(statement) \ + if ((statement) == 0) \ + return 1; + +int test_available_frontends() { + ov::frontend::FrontEndManager manager; + auto frontend_found = [&] (const std::string & name) -> int { + try { + manager.load_by_framework(name); + } catch (const std::exception & e) { + return 1; + } + return 0; + }; + +#ifdef ENABLE_IR_FRONTEND + OV_SUCCESS(frontend_found("ir")); +#else + OV_FAIL(frontend_found("ir")); +#endif +#ifdef ENABLE_TF_LITE_FRONTEND + OV_SUCCESS(frontend_found("tflite")); +#else + OV_FAIL(frontend_found("tflite")); +#endif +#ifdef ENABLE_PYTORCH_FRONTEND + OV_SUCCESS(frontend_found("pytorch")); +#else + OV_FAIL(frontend_found("pytorch")); +#endif +#ifdef ENABLE_ONNX_FRONTEND + OV_SUCCESS(frontend_found("onnx")); +#else + OV_FAIL(frontend_found("onnx")); +#endif +#ifdef ENABLE_TF_FRONTEND + OV_SUCCESS(frontend_found("tf")); +#else + OV_FAIL(frontend_found("tf")); +#endif +#ifdef ENABLE_PADDLE_FRONTEND + OV_SUCCESS(frontend_found("paddle")); +#else + OV_FAIL(frontend_found("paddle")); +#endif + return 0; +} + +int main() { + OV_SUCCESS(test_available_frontends()); + + // Deinitialize OpenVINO. Important for old systems like Ubuntu 16.04 with obsolete glibc, + // where application deinit can lead to the following issue on exit: + // Inconsistency detected by ld.so: dl-close.c: 811: _dl_close: Assertion `map->l_init_called' failed! + ov::shutdown(); + + return 0; +} diff --git a/recipes/openvino/config.yml b/recipes/openvino/config.yml new file mode 100644 index 00000000000000..60f706469b185a --- /dev/null +++ b/recipes/openvino/config.yml @@ -0,0 +1,5 @@ +versions: + "2023.2.0": + folder: "all" + "2023.1.0": + folder: "all" diff --git a/recipes/opus/all/conandata.yml b/recipes/opus/all/conandata.yml index d7e0ee962c3b21..5ac1b419900e18 100644 --- a/recipes/opus/all/conandata.yml +++ b/recipes/opus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4": + url: "https://github.com/xiph/opus/releases/download/v1.4/opus-1.4.tar.gz" + sha256: "c9b32b4253be5ae63d1ff16eea06b94b5f0f2951b7a02aceef58e3a3ce49c51f" "1.3.1": url: "https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz" sha256: "65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d" diff --git a/recipes/opus/config.yml b/recipes/opus/config.yml index 59334d50773685..3360afdd0ecabb 100644 --- a/recipes/opus/config.yml +++ b/recipes/opus/config.yml @@ -1,3 +1,5 @@ versions: + "1.4": + folder: all "1.3.1": folder: all diff --git a/recipes/opusfile/all/conanfile.py b/recipes/opusfile/all/conanfile.py index ec4750c742092b..e9cced5a0a16c1 100644 --- a/recipes/opusfile/all/conanfile.py +++ b/recipes/opusfile/all/conanfile.py @@ -57,7 +57,7 @@ def layout(self): def requirements(self): self.requires("ogg/1.3.5", transitive_headers=True) - self.requires("opus/1.3.1", transitive_headers=True) + self.requires("opus/1.4", transitive_headers=True) if self.options.http: self.requires("openssl/[>=1.1 <4]") @@ -69,7 +69,7 @@ def build_requirements(self): if not is_msvc(self): 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._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): diff --git a/recipes/osgearth/all/conanfile.py b/recipes/osgearth/all/conanfile.py index 5e59c1a6652d93..e916db567410d7 100644 --- a/recipes/osgearth/all/conanfile.py +++ b/recipes/osgearth/all/conanfile.py @@ -105,13 +105,13 @@ def requirements(self): self.requires("opengl/system") self.requires("gdal/3.4.3") self.requires("openscenegraph/3.6.5") - self.requires("libcurl/7.83.1") + self.requires("libcurl/8.2.0") self.requires("lerc/2.2") self.requires("rapidjson/1.1.0") - self.requires("zlib/1.2.12", override=True) - self.requires("libtiff/4.3.0", override=True) - self.requires("openssl/1.1.1l", override=True) + self.requires("zlib/[>=1.2.11 <2]") # override + self.requires("libtiff/4.5.1") # override + self.requires("libpng/1.6.40") # override # if self.options.build_triton_nodekit: # self.requires("triton_nodekit") @@ -122,11 +122,11 @@ def requirements(self): if self.options.build_rocksdb_cache: self.requires("rocksdb/6.20.3") if self.options.build_zip_plugin: - self.requires("zstd/1.4.9") # override + self.requires("zstd/1.5.5") # override if self.options.with_geos: - self.requires("geos/3.10.2") + self.requires("geos/3.11.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.38.5") + self.requires("sqlite3/3.42.0") if self.options.with_draco: self.requires("draco/1.4.3") # if self.options.with_basisu: @@ -134,9 +134,9 @@ def requirements(self): # if self.options.with_glew: # self.requires("glew/2.2.0") if self.options.with_protobuf: - self.requires("protobuf/3.17.1") + self.requires("protobuf/3.21.9") if self.options.with_webp: - self.requires("libwebp/1.2.0") + self.requires("libwebp/1.3.1") def _patch_sources(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): diff --git a/recipes/outcome/all/conandata.yml b/recipes/outcome/all/conandata.yml index a2d2ce108afcdd..68135018bb9009 100644 --- a/recipes/outcome/all/conandata.yml +++ b/recipes/outcome/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.7": + url: "https://github.com/ned14/outcome/archive/v2.2.7.tar.gz" + sha256: "553fd03bb9684be19dfa251bfa0064e69e30a95b6b0ba9a62d68f8ec4e31662a" "2.2.4": url: "https://github.com/ned14/outcome/archive/v2.2.4.tar.gz" sha256: "29ad35c1980cf7f75294bb52df678c6a08817228e880fac8454cd6ac390fa1fc" diff --git a/recipes/outcome/config.yml b/recipes/outcome/config.yml index a37008481a1738..08abb1cf7e40b3 100644 --- a/recipes/outcome/config.yml +++ b/recipes/outcome/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.7": + folder: all "2.2.4": folder: all "2.2.3": diff --git a/recipes/ozz-animation/all/CMakeLists.txt b/recipes/ozz-animation/all/CMakeLists.txt deleted file mode 100644 index 73c551783746d7..00000000000000 --- a/recipes/ozz-animation/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("source_subfolder") diff --git a/recipes/ozz-animation/all/conandata.yml b/recipes/ozz-animation/all/conandata.yml index 548e0d6eb88588..ace2364367ed03 100644 --- a/recipes/ozz-animation/all/conandata.yml +++ b/recipes/ozz-animation/all/conandata.yml @@ -5,3 +5,6 @@ sources: "0.13.0": url: "https://github.com/guillaumeblanc/ozz-animation/archive/0.13.0.tar.gz" sha256: "2677f28d83bb4be00f92537ee3fb2573f9e99fc82fb1777a1b8a6131aa9b96a4" + "0.14.1": + url: "https://github.com/guillaumeblanc/ozz-animation/archive/0.14.1.tar.gz" + sha256: "621094d43aeea4b11da530178d1199107f2b590a9bfb3cba7c36b3176a86ac1e" diff --git a/recipes/ozz-animation/all/conanfile.py b/recipes/ozz-animation/all/conanfile.py index 7266f8b1ea03c3..6a87de84d42e5c 100644 --- a/recipes/ozz-animation/all/conanfile.py +++ b/recipes/ozz-animation/all/conanfile.py @@ -1,52 +1,129 @@ import os -from conans import ConanFile, CMake, tools +from pathlib import Path +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, rename, get, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class OzzAnimationConan(ConanFile): name = "ozz-animation" description = "Open source c++ skeletal animation library and toolset." license = "MIT" - topics = ("conan", "ozz", "animation", "skeletal") + topics = ("ozz", "animation", "skeletal") homepage = "https://github.com/guillaumeblanc/ozz-animation" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], + "shared": [True, False], + + #runtime geometry library (skinning jobs) + "ozz_geometry": [True, False], + + #runtime animation library + "ozz_animation": [True, False], + + #library for parsing CLI args + "ozz_options": [True, False], + + #library for offline processing + "ozz_animation_offline": [True, False], + + #library for creating tools + "ozz_animation_tools": [True, False], + + #gltf2ozz CLI tool + "tools": [True, False], } default_options = { "fPIC": True, + "shared": False, + "tools": False, + "ozz_geometry": True, + "ozz_animation": True, + "ozz_options": False, + "ozz_animation_offline": False, + "ozz_animation_tools": False, } - short_paths = True - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" + def validate(self): + def _ensure_enabled(opt, req): + if self.options.get_safe(opt): + missing = [r for r in req if not getattr(self.options, r, False)] + if missing: + raise ConanInvalidConfiguration(f"Option '{opt}' requires option(s) {missing} to be enabled too") + _ensure_enabled('ozz_animation_offline', ['ozz_animation']) + _ensure_enabled('ozz_animation_tools', ['ozz_animation_offline', 'ozz_options']) + _ensure_enabled('tools', ['ozz_animation_tools']) + + if self.settings.compiler == 'gcc': + # GCC 11.2 bug breaks build + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 + # https://github.com/guillaumeblanc/ozz-animation/issues/147 + if Version(self.settings.compiler.version) < "11.3": + raise ConanInvalidConfiguration(f"GCC 11.3 or newer required") + + if self.options.shared and Version(self.version) < "0.14.0": + raise ConanInvalidConfiguration(f"Can't build shared library for {self.version}") 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") + #this component ships an old version of jsoncpp (0.10.6) which isn't on + #conan center, so this will prevent ODR violations until either + #upstream updates to a newer jsoncpp version, or someone adds a package + #for that version of jsoncpp + if self.options.ozz_animation_tools: + self.provides = ['jsoncpp'] + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + def layout(self): + cmake_layout(self, src_folder="src") + 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 _configure_cmake(self): cmake = CMake(self) - cmake.definitions["ozz_build_fbx"] = False - cmake.definitions["ozz_build_data"] = False - cmake.definitions["ozz_build_samples"] = False - cmake.definitions["ozz_build_howtos"] = False - cmake.definitions["ozz_build_tests"] = False - cmake.definitions["ozz_build_cpp11"] = True - cmake.configure(build_folder=self._build_subfolder) + cmvars = { + "ozz_build_fbx": False, + "ozz_build_data": False, + "ozz_build_samples": False, + "ozz_build_howtos": False, + "ozz_build_tests": False, + "ozz_build_cpp11": True, + "ozz_build_tools": False, + "ozz_build_gltf": False, + } + + if self.options.ozz_animation_tools: + cmvars["ozz_build_tools"] = True + + if self.options.tools: + cmvars["ozz_build_tools"] = True + cmvars["ozz_build_gltf"] = True + + cmake.configure(variables = cmvars) return cmake def build(self): + subfolder = Path(self.source_folder) for before, after in [('string(REGEX REPLACE "/MT" "/MD" ${flag} "${${flag}}")', ""), ('string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")', "")]: - tools.replace_in_file(os.path.join(self._source_subfolder, "build-utils", "cmake", "compiler_settings.cmake"), before, after) + replace_in_file(self, subfolder/"build-utils"/"cmake"/"compiler_settings.cmake", before, after) - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "animation", "offline", "tools", "CMakeLists.txt"), + replace_in_file(self, subfolder/"src"/"animation"/"offline"/"tools"/"CMakeLists.txt", "if(NOT EMSCRIPTEN)", "if(NOT CMAKE_CROSSCOMPILING)") @@ -54,13 +131,68 @@ def build(self): cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - os.remove(os.path.join(self.package_folder, "CHANGES.md")) - os.remove(os.path.join(self.package_folder, "LICENSE.md")) - os.remove(os.path.join(self.package_folder, "README.md")) - self.copy(pattern="LICENSE.md", dst="licenses", src=self._source_subfolder) + pkg = self.package_path + + if self.options.ozz_animation_tools: + json = Path(self.build_folder)/'src'/'animation'/'offline'/'tools'/'json' + copy(self, "*.a", src=json, dst=pkg/'lib', keep_path=False) + copy(self, "*.so", src=json, dst=pkg/'lib', keep_path=False) + copy(self, "*.dylib", src=json, dst=pkg/'lib', keep_path=False) + copy(self, "*.lib", src=json, dst=pkg/'lib', keep_path=False) + copy(self, "*.dll", src=json, dst=pkg/'bin', keep_path=False) + + os.remove(pkg/"CHANGES.md") + os.remove(pkg/"LICENSE.md") + os.remove(pkg/"README.md") + + (pkg/'bin').mkdir(exist_ok=True) + for file in filter(lambda p: p.suffix=='.dll', (pkg/'lib').iterdir()): + rename(self, src=file, dst=pkg/'bin'/file.name) + + copy(self, pattern="LICENSE.md", dst=pkg/"licenses", src=self.source_folder) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + postfix = { + "Debug": "_d", + "Release": "_r", + "MinSizeRel": "_rs", + "RelWithDebInfo": "_rd", + }[str(self.settings.build_type)] + + def _add_libm(c): + if self.settings.os in ("Linux", "Android", "FreeBSD"): + self.cpp_info.components[c].system_libs = ["m"] + + self.cpp_info.components["base"].libs = [f"ozz_base{postfix}"] + _add_libm("base") + + if self.options.ozz_geometry: + self.cpp_info.components["geometry"].libs = [f"ozz_geometry{postfix}"] + self.cpp_info.components["geometry"].requires = ["base"] + _add_libm("geometry") + + if self.options.ozz_animation: + self.cpp_info.components["animation"].libs = [f"ozz_animation{postfix}"] + self.cpp_info.components["animation"].requires = ["base"] + _add_libm("animation") + + if self.options.ozz_animation_offline: + self.cpp_info.components["animation_offline"].libs = [f"ozz_animation_offline{postfix}"] + self.cpp_info.components["animation_offline"].requires = ["animation"] + _add_libm("animation_offline") + + if self.options.ozz_options: + self.cpp_info.components["options"].libs = [f"ozz_options{postfix}"] + self.cpp_info.components["options"].requires = ["base"] + _add_libm("options") + + if self.options.ozz_animation_tools: + self.cpp_info.components["animation_tools"].libs = [f"ozz_animation_tools{postfix}"] + self.cpp_info.components["animation_tools"].requires = ["animation_offline", "options", "jsoncpp"] + self.cpp_info.components["jsoncpp"].libs = [f"json{postfix}"] + + if self.options.tools: + self.buildenv_info.prepend_path("PATH", str(Path(self.package_folder)/"bin"/"tools")) diff --git a/recipes/ozz-animation/all/test_package/CMakeLists.txt b/recipes/ozz-animation/all/test_package/CMakeLists.txt index ef4d8f93d6c964..0c1c8ada3a5bea 100644 --- a/recipes/ozz-animation/all/test_package/CMakeLists.txt +++ b/recipes/ozz-animation/all/test_package/CMakeLists.txt @@ -1,11 +1,12 @@ cmake_minimum_required(VERSION 3.1) project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(ozz-animation REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) + +target_link_libraries(${CMAKE_PROJECT_NAME} + ozz-animation::ozz-animation +) diff --git a/recipes/ozz-animation/all/test_package/conanfile.py b/recipes/ozz-animation/all/test_package/conanfile.py index 4903f1a7e8fa0f..304895d77753a9 100644 --- a/recipes/ozz-animation/all/test_package/conanfile.py +++ b/recipes/ozz-animation/all/test_package/conanfile.py @@ -1,16 +1,25 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) cmake.configure() cmake.build() + def layout(self): + cmake_layout(self) + 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): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/ozz-animation/all/test_package/test_package.cpp b/recipes/ozz-animation/all/test_package/test_package.cpp index 9202b08874e2ce..6ed8f2ae5d31c0 100644 --- a/recipes/ozz-animation/all/test_package/test_package.cpp +++ b/recipes/ozz-animation/all/test_package/test_package.cpp @@ -2,6 +2,8 @@ #include "ozz/base/log.h" #include "ozz/base/io/stream.h" +#include "ozz/animation/runtime/animation.h" +#include "ozz/geometry/runtime/skinning_job.h" int main() { diff --git a/recipes/ozz-animation/all/test_v1_package/CMakeLists.txt b/recipes/ozz-animation/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..ef4d8f93d6c964 --- /dev/null +++ b/recipes/ozz-animation/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) +set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) +target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/ozz-animation/all/test_v1_package/conanfile.py b/recipes/ozz-animation/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..4903f1a7e8fa0f --- /dev/null +++ b/recipes/ozz-animation/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "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", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ozz-animation/all/test_v1_package/test_package.cpp b/recipes/ozz-animation/all/test_v1_package/test_package.cpp new file mode 100644 index 00000000000000..9202b08874e2ce --- /dev/null +++ b/recipes/ozz-animation/all/test_v1_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include "ozz/base/log.h" +#include "ozz/base/io/stream.h" + +int main() +{ + ozz::io::File file("test.ozz", "rb"); + + if (!file.opened()) { + } +} diff --git a/recipes/ozz-animation/config.yml b/recipes/ozz-animation/config.yml index a9085cf3fa2b2c..8e1c91c8b156cd 100644 --- a/recipes/ozz-animation/config.yml +++ b/recipes/ozz-animation/config.yml @@ -3,3 +3,5 @@ versions: folder: all "0.13.0": folder: all + "0.14.1": + folder: all diff --git a/recipes/paho-mqtt-c/all/conandata.yml b/recipes/paho-mqtt-c/all/conandata.yml index 97257e57f3eab0..fb14bce735ef18 100644 --- a/recipes/paho-mqtt-c/all/conandata.yml +++ b/recipes/paho-mqtt-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.13": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.13.tar.gz" + sha256: "47c77e95609812da82feee30db435c3b7c720d4fd3147d466ead126e657b6d9c" "1.3.12": url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.12.tar.gz" sha256: "6a70a664ed3bbcc1eafdc45a5dc11f3ad70c9bac12a54c2f8cef15c0e7d0a93b" diff --git a/recipes/paho-mqtt-c/config.yml b/recipes/paho-mqtt-c/config.yml index 7d5e8aea45866a..5fed002dda09d1 100644 --- a/recipes/paho-mqtt-c/config.yml +++ b/recipes/paho-mqtt-c/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.13": + folder: "all" "1.3.12": folder: "all" "1.3.11": diff --git a/recipes/panzi-portable-endian/all/conandata.yml b/recipes/panzi-portable-endian/all/conandata.yml index 5cba065a6c8226..a4dfc7805d29ce 100644 --- a/recipes/panzi-portable-endian/all/conandata.yml +++ b/recipes/panzi-portable-endian/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "cci.20150416": - url: "https://gist.github.com/panzi/6856583/archive/1eca2ab34f2301b9641aa73d1016b951fff3fc39.zip" - sha256: "488d5d08215f657e769b31764013ef845355832cc6f1d165e1809fa5fe168eeb" + "cci.20220509": + url: "https://gist.github.com/panzi/6856583/archive/f6512b0830a4e9e06b26e32fc2509d67bbfa93d8.zip" + sha256: "88593bad9a1050779e98f93194b028566df575e06da9f8a60e44fa97a36b92f8" diff --git a/recipes/panzi-portable-endian/all/conanfile.py b/recipes/panzi-portable-endian/all/conanfile.py index 9c18999c225be6..5655ba304a520a 100644 --- a/recipes/panzi-portable-endian/all/conanfile.py +++ b/recipes/panzi-portable-endian/all/conanfile.py @@ -1,34 +1,43 @@ import os -from conans import ConanFile, tools + +from conan import ConanFile +from conan.tools.files import copy, get, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class PanziPortableEndian(ConanFile): name = "panzi-portable-endian" + description = ("This provides the endian conversion functions from " + "endian.h on Windows, Linux, *BSD, and Mac OS X") + license = "LicenseRef-panzi-portable-endian-public-domain" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gist.github.com/panzi/6856583" - description = "This provides the endian conversion functions form endian.h on Windows, Linux, *BSD, and Mac OS X" - topics = ("conan", "endian") - license = "Unlicense" + topics = ("endian", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() 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 _extract_license(self): - header = tools.load(os.path.join( - self._source_subfolder, "portable_endian.h")) - license_contents = header[0:(header.find("#ifndef", 1))] - tools.save("LICENSE", license_contents) + header = load(self, os.path.join(self.source_folder, "portable_endian.h")) + license_contents = header[0: (header.find("#ifndef", 1))] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package(self): self._extract_license() - self.copy("LICENSE", dst="licenses") - self.copy(pattern="*.h", dst="include", - src=self._source_subfolder, keep_path=False) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/panzi-portable-endian/all/test_package/CMakeLists.txt b/recipes/panzi-portable-endian/all/test_package/CMakeLists.txt index 454c47bb2cbab0..272ae426964be8 100644 --- a/recipes/panzi-portable-endian/all/test_package/CMakeLists.txt +++ b/recipes/panzi-portable-endian/all/test_package/CMakeLists.txt @@ -1,9 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(panzi-portable-endian REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE panzi-portable-endian::panzi-portable-endian) diff --git a/recipes/panzi-portable-endian/all/test_package/conanfile.py b/recipes/panzi-portable-endian/all/test_package/conanfile.py index a59a26a52c8dcd..ef5d7042163ecc 100644 --- a/recipes/panzi-portable-endian/all/test_package/conanfile.py +++ b/recipes/panzi-portable-endian/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/panzi-portable-endian/all/test_package/test_package.c b/recipes/panzi-portable-endian/all/test_package/test_package.c new file mode 100644 index 00000000000000..8a45d0928397d6 --- /dev/null +++ b/recipes/panzi-portable-endian/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + uint64_t num = 100; + le64toh(num); +} diff --git a/recipes/panzi-portable-endian/all/test_package/test_package.cpp b/recipes/panzi-portable-endian/all/test_package/test_package.cpp deleted file mode 100644 index d5884326032eaf..00000000000000 --- a/recipes/panzi-portable-endian/all/test_package/test_package.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#include - -int main() { - uint64_t num = 100; - le64toh(num); -} diff --git a/recipes/panzi-portable-endian/all/test_v1_package/CMakeLists.txt b/recipes/panzi-portable-endian/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/panzi-portable-endian/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/panzi-portable-endian/all/test_v1_package/conanfile.py b/recipes/panzi-portable-endian/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..abcaeed3f89b67 --- /dev/null +++ b/recipes/panzi-portable-endian/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/panzi-portable-endian/config.yml b/recipes/panzi-portable-endian/config.yml index 5b6ed6e7fb0747..dcdd7cd8a501e1 100644 --- a/recipes/panzi-portable-endian/config.yml +++ b/recipes/panzi-portable-endian/config.yml @@ -1,3 +1,3 @@ versions: - "cci.20150416": + "cci.20220509": folder: all diff --git a/recipes/parallel-hashmap/all/conandata.yml b/recipes/parallel-hashmap/all/conandata.yml index e810473c6e2e79..3e06bdb26e6524 100644 --- a/recipes/parallel-hashmap/all/conandata.yml +++ b/recipes/parallel-hashmap/all/conandata.yml @@ -23,9 +23,3 @@ sources: "1.32": url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.32.tar.gz" sha256: "50cc7abc08f78c6396a33a334e5bc0b3ade121af8604690dae13a1bad47cf07c" - "1.31": - url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.31.tar.gz" - sha256: "1826589041140837f91ab0e3421abbf7e9184454bb83403b5a0359a0bf87bd68" - "1.30": - url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.30.tar.gz" - sha256: "ae14fa41110b5fe211d3f7599318fb1a3e862353c7110cd8370cdc044a98d815" diff --git a/recipes/parallel-hashmap/all/conanfile.py b/recipes/parallel-hashmap/all/conanfile.py index d8dcf1537c3580..5f3e3f51ac1102 100644 --- a/recipes/parallel-hashmap/all/conanfile.py +++ b/recipes/parallel-hashmap/all/conanfile.py @@ -12,12 +12,16 @@ class ParallelHashmapConan(ConanFile): name = "parallel-hashmap" description = "A family of header-only, very fast and memory-friendly hashmap and btree containers." license = "Apache-2.0" - topics = ("parallel-hashmap", "parallel", "hashmap", "btree") + topics = ("parallel", "hashmap", "btree") homepage = "https://github.com/greg7mdp/parallel-hashmap" url = "https://github.com/conan-io/conan-center-index" + 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() @@ -25,12 +29,8 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - def layout(self): - basic_layout(self, src_folder="src") - 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 @@ -66,7 +66,6 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "phmap") self.cpp_info.set_property("cmake_target_name", "phmap") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed diff --git a/recipes/parallel-hashmap/all/test_package/conanfile.py b/recipes/parallel-hashmap/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/parallel-hashmap/all/test_package/conanfile.py +++ b/recipes/parallel-hashmap/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/parallel-hashmap/config.yml b/recipes/parallel-hashmap/config.yml index a8a50d11cadad3..a1c1439981d11d 100644 --- a/recipes/parallel-hashmap/config.yml +++ b/recipes/parallel-hashmap/config.yml @@ -15,7 +15,3 @@ versions: folder: all "1.32": folder: all - "1.31": - folder: all - "1.30": - folder: all diff --git a/recipes/parg/all/CMakeLists.txt b/recipes/parg/all/CMakeLists.txt index ea07630def81d0..5aea9449b5c812 100644 --- a/recipes/parg/all/CMakeLists.txt +++ b/recipes/parg/all/CMakeLists.txt @@ -1,12 +1,6 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) -include("conanbuildinfo.cmake") -conan_basic_setup() -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory("source_subfolder") - -set_target_properties(parg PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/parg.h") - +add_subdirectory(src) +set_target_properties(parg PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/parg.h") install(TARGETS parg) diff --git a/recipes/parg/all/conandata.yml b/recipes/parg/all/conandata.yml index 799c3f613ca57c..72c50c78f7433d 100644 --- a/recipes/parg/all/conandata.yml +++ b/recipes/parg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.3": + url: "https://github.com/jibsen/parg/archive/refs/tags/v1.0.3.tar.gz" + sha256: "cd54a94b4138735f6c9fbdf426a9caa8ffd5bc90988eb02f493bc86de61ce5ad" "1.0.2": url: "https://github.com/jibsen/parg/archive/refs/tags/v1.0.2.tar.gz" sha256: "3c728affd1442c5778cf548d53339132ce033c92fd61f7522d1e59fe6b1b36a8" diff --git a/recipes/parg/all/conanfile.py b/recipes/parg/all/conanfile.py index 0e70a696cc0392..ef4d18c549aef2 100644 --- a/recipes/parg/all/conanfile.py +++ b/recipes/parg/all/conanfile.py @@ -1,60 +1,79 @@ import os -from conans import ConanFile, CMake, tools + +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class PargConan(ConanFile): name = "parg" - license = "CC0-1.0" + description = "Parser for argv that works similarly to getopt" + license = ("CC0-1.0", "MIT-0") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jibsen/parg" - description = "Parser for argv that works similarly to getopt" - topics = ("conan", 'getopt', 'c') - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], - "fPIC": [True, False]} - default_options = {"shared": False, - "fPIC": True} - exports_sources = ["CMakeLists.txt"] - generators = "cmake", - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + topics = ("getopt", "c") - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "1.0.3": + self.licenses = "CC0-1.0" + else: + self.licenses = "MIT-0" - def _configure_cmake(self): - if self._cmake: - return self._cmake - cmake = CMake(self) - cmake.configure(build_folder=self._build_subfolder) - self._cmake = cmake - return self._cmake + 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): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + 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) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) cmake.build() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + if Version(self.version) < "1.0.3": + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + else: + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["parg"] diff --git a/recipes/parg/all/test_package/CMakeLists.txt b/recipes/parg/all/test_package/CMakeLists.txt index 187d95623fba10..ee46ccf27506c7 100644 --- a/recipes/parg/all/test_package/CMakeLists.txt +++ b/recipes/parg/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(parg REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/parg/all/test_package/conanfile.py b/recipes/parg/all/test_package/conanfile.py index 86f0279553123c..5030221edcc76f 100644 --- a/recipes/parg/all/test_package/conanfile.py +++ b/recipes/parg/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,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("%s -h" % bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} -h", env="conanrun") diff --git a/recipes/parg/all/test_v1_package/CMakeLists.txt b/recipes/parg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/parg/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/parg/all/test_v1_package/conanfile.py b/recipes/parg/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..86f0279553123c --- /dev/null +++ b/recipes/parg/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run("%s -h" % bin_path, run_environment=True) diff --git a/recipes/parg/config.yml b/recipes/parg/config.yml index 732f7eb9a62dd4..6503626e2502c6 100644 --- a/recipes/parg/config.yml +++ b/recipes/parg/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.3": + folder: "all" "1.0.2": folder: "all" diff --git a/recipes/patchelf/all/conandata.yml b/recipes/patchelf/all/conandata.yml index 9385c94daf7b23..0a5b78dee92b92 100644 --- a/recipes/patchelf/all/conandata.yml +++ b/recipes/patchelf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.18": + url: "https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0.tar.bz2" + sha256: "1952b2a782ba576279c211ee942e341748fdb44997f704dd53def46cd055470b" "0.13": url: "https://github.com/NixOS/patchelf/archive/0.13.tar.gz" sha256: "60c6aeadb673de9cc1838b630c81f61e31c501de324ef7f1e8094a2431197d09" diff --git a/recipes/patchelf/all/conanfile.py b/recipes/patchelf/all/conanfile.py index 904e2cf4472dbe..b41b9ff27f4773 100644 --- a/recipes/patchelf/all/conanfile.py +++ b/recipes/patchelf/all/conanfile.py @@ -1,11 +1,12 @@ 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.build import cross_building, check_min_cppstd from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import copy, get, rmdir from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os @@ -21,6 +22,23 @@ class PatchElfConan(ConanFile): license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "0.18" else "17" + + @property + def _compilers_minimum_version(self): + return { + "17": { + # patchelf/0.18.0 requires gcc >= 8 + "gcc": "8", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + def layout(self): basic_layout(self, src_folder="src") @@ -29,7 +47,15 @@ def build_requirements(self): def validate(self): if not is_apple_os(self) and self.settings.os not in ("FreeBSD", "Linux"): - raise ConanInvalidConfiguration("PatchELF is only available for GNU-like operating systems (e.g. Linux)") + raise ConanInvalidConfiguration(f"{self.ref} is only available for GNU-like operating systems (e.g. Linux)") + + 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) diff --git a/recipes/patchelf/config.yml b/recipes/patchelf/config.yml index 0782807cb46ce3..f1bedb2bb26d8e 100644 --- a/recipes/patchelf/config.yml +++ b/recipes/patchelf/config.yml @@ -1,4 +1,6 @@ versions: + "0.18": + folder: all "0.13": folder: all "0.12": diff --git a/recipes/pbtools/all/CMakeLists.txt b/recipes/pbtools/all/CMakeLists.txt deleted file mode 100644 index 432799d5aaab2e..00000000000000 --- a/recipes/pbtools/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/lib) diff --git a/recipes/pbtools/all/conandata.yml b/recipes/pbtools/all/conandata.yml index 529d052902f815..236ef4b15fa0a8 100644 --- a/recipes/pbtools/all/conandata.yml +++ b/recipes/pbtools/all/conandata.yml @@ -1,7 +1,10 @@ sources: + "0.47.0": + url: "https://github.com/eerimoq/pbtools/archive/0.47.0.tar.gz" + sha256: "f53189ad061e4063d7cb5a3863f778221868b820a1dde4e65b217537c3fa0c9e" "0.45.2": url: "https://github.com/eerimoq/pbtools/archive/0.45.2.tar.gz" sha256: "723967fff6e1d51a078ce7328f937cafe0c32b4e9ab19735cf591d15afc281d3" "0.45.0": url: "https://github.com/eerimoq/pbtools/archive/refs/tags/0.45.0.zip" - sha256: 84b17003f1c7b6c62061e93e11abe8729480338f5f106948ebfefa303c163b75 + sha256: "84b17003f1c7b6c62061e93e11abe8729480338f5f106948ebfefa303c163b75" diff --git a/recipes/pbtools/all/conanfile.py b/recipes/pbtools/all/conanfile.py index 9aee2f753fe6d3..8ae53d392140af 100644 --- a/recipes/pbtools/all/conanfile.py +++ b/recipes/pbtools/all/conanfile.py @@ -1,53 +1,64 @@ -import functools -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + + +required_conan_version = ">=1.53.0" class PbtoolsConan(ConanFile): name = "pbtools" description = "A Google Protocol Buffers C library" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/eerimoq/pbtools" - license = "MIT" topics = ("protobuf", "serialization", "rpc", "protocol-buffers") - 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" - - @property - def _source_subfolder(self): - return "source_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 _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.os == "Windows": - raise ConanInvalidConfiguration("This library is not compatible with Windows") + raise ConanInvalidConfiguration(f"{self.ref} is not compatible with Windows") 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.configure(build_folder=self._build_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "lib")) 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): diff --git a/recipes/pbtools/all/test_package/CMakeLists.txt b/recipes/pbtools/all/test_package/CMakeLists.txt index 9f0ff5e7f11af5..e01a140f079aa0 100644 --- a/recipes/pbtools/all/test_package/CMakeLists.txt +++ b/recipes/pbtools/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest C) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) find_package(pbtools REQUIRED CONFIG) -add_executable(test_package test_package.c hello_world.c) -target_link_libraries(test_package pbtools::pbtools) +add_executable(${PROJECT_NAME} test_package.c hello_world.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pbtools::pbtools) diff --git a/recipes/pbtools/all/test_package/conanfile.py b/recipes/pbtools/all/test_package/conanfile.py index 1ed584307b354b..bd118a1d0023be 100644 --- a/recipes/pbtools/all/test_package/conanfile.py +++ b/recipes/pbtools/all/test_package/conanfile.py @@ -1,18 +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 TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class PbtoolsTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + def requirements(self): + self.requires(self.tested_reference_str) def build_requirements(self): if self.settings.os == "Macos" and self.settings.arch == "armv8": # 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. - self.build_requires("cmake/3.20.1") + self.tool_requires("cmake/[>=3.20]") + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -20,6 +28,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/pbtools/all/test_v1_package/CMakeLists.txt b/recipes/pbtools/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/pbtools/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/pbtools/all/test_v1_package/conanfile.py b/recipes/pbtools/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..1ed584307b354b --- /dev/null +++ b/recipes/pbtools/all/test_v1_package/conanfile.py @@ -0,0 +1,25 @@ +import os + +from conans import ConanFile, CMake, tools + + +class PbtoolsTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build_requirements(self): + if self.settings.os == "Macos" and self.settings.arch == "armv8": + # 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. + self.build_requires("cmake/3.20.1") + + 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/pbtools/config.yml b/recipes/pbtools/config.yml index 81c0b9ecee392a..06df1f3ce62324 100644 --- a/recipes/pbtools/config.yml +++ b/recipes/pbtools/config.yml @@ -1,4 +1,6 @@ versions: + "0.47.0": + folder: "all" "0.45.2": folder: "all" "0.45.0": diff --git a/recipes/pcapplusplus/cmake/conandata.yml b/recipes/pcapplusplus/cmake/conandata.yml new file mode 100644 index 00000000000000..26ff7631cb6715 --- /dev/null +++ b/recipes/pcapplusplus/cmake/conandata.yml @@ -0,0 +1,4 @@ +sources: + "23.09": + url: "https://github.com/seladb/PcapPlusPlus/archive/v23.09.tar.gz" + sha256: "608292f7d2a2e1b7af26adf89347597a6131547eea4e513194bc4f584a40fe74" diff --git a/recipes/pcapplusplus/cmake/conanfile.py b/recipes/pcapplusplus/cmake/conanfile.py new file mode 100644 index 00000000000000..e1a985494deda4 --- /dev/null +++ b/recipes/pcapplusplus/cmake/conanfile.py @@ -0,0 +1,73 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.52.0" + +class PcapplusplusConan(ConanFile): + name = "pcapplusplus" + package_type = "static-library" + license = "Unlicense" + description = "PcapPlusPlus is a multiplatform C++ library for capturing, parsing and crafting of network packets" + topics = ("pcap", "network", "security", "packet") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/seladb/PcapPlusPlus" + settings = "os", "arch", "build_type", "compiler" + options = { + "immediate_mode": [True, False], + "fPIC": [True, False], + } + default_options = { + "immediate_mode": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def requirements(self): + if self.settings.os == "Windows": + self.requires("npcap/1.70") + else: + self.requires("libpcap/1.10.1") + + def validate(self): + if self.settings.os not in ("FreeBSD", "Linux", "Macos", "Windows"): + raise ConanInvalidConfiguration(f"{self.settings.os} is not supported") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PCAPPP_BUILD_TESTS"] = False + tc.variables["PCAPPP_BUILD_EXAMPLES"] = False + tc.generate() + + def layout(self): + cmake_layout(self, src_folder="src") + + 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"), keep_path=False) + 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.libs = ["Pcap++", "Packet++", "Common++"] + if self.settings.os == "Macos": + self.cpp_info.frameworks = ["CoreFoundation", "SystemConfiguration"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "iphlpapi"] + self.cpp_info.set_property("cmake_file_name", "PcapPlusPlus") + self.cpp_info.set_property("cmake_target_name", "PcapPlusPlus::PcapPlusPlus") diff --git a/recipes/pcapplusplus/cmake/test_package/CMakeLists.txt b/recipes/pcapplusplus/cmake/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d30ed5e5eaa780 --- /dev/null +++ b/recipes/pcapplusplus/cmake/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(PcapPlusPlus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PcapPlusPlus::PcapPlusPlus) diff --git a/recipes/pcapplusplus/cmake/test_package/conanfile.py b/recipes/pcapplusplus/cmake/test_package/conanfile.py new file mode 100644 index 00000000000000..cc326072eb57b8 --- /dev/null +++ b/recipes/pcapplusplus/cmake/test_package/conanfile.py @@ -0,0 +1,29 @@ +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", "compiler", "build_type", "arch" + 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.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], "test_package"), env="conanrun") diff --git a/recipes/pcapplusplus/cmake/test_package/test_package.cpp b/recipes/pcapplusplus/cmake/test_package/test_package.cpp new file mode 100644 index 00000000000000..65ce01f5c61cb2 --- /dev/null +++ b/recipes/pcapplusplus/cmake/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include +#include "pcapplusplus/PcapPlusPlusVersion.h" + +int main() { + std::cout << "PCAP++ VERSION: " << pcpp::getPcapPlusPlusVersionFull() << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/pcapplusplus/config.yml b/recipes/pcapplusplus/config.yml index 26e119bb00764c..d89c980a8be556 100644 --- a/recipes/pcapplusplus/config.yml +++ b/recipes/pcapplusplus/config.yml @@ -7,3 +7,5 @@ versions: folder: all "22.11": folder: all + "23.09": + folder: cmake diff --git a/recipes/pcl/all/conandata.yml b/recipes/pcl/all/conandata.yml new file mode 100644 index 00000000000000..6eea92ef4a7619 --- /dev/null +++ b/recipes/pcl/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.13.1": + url: https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.13.1.tar.gz + sha256: 8ab98a9db371d822de0859084a375a74bdc7f31c96d674147710cf4101b79621 +patches: + "1.13.1": + - patch_file: "patches/0001-cmake_use_conan_targets.patch" + patch_description: "Update PCL CMake files to work with Conan" + patch_type: "conan" + - patch_file: "patches/0001-fix-FindOpenNI-bug.patch" + patch_description: "Fix a libusb detection bug in FindOpenNI.cmake" + patch_type: "bugfix" + - patch_file: "patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch" + patch_description: "Add Eigen3::Eigen target to pcl_common target" + patch_type: "conan" + - patch_file: "patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch" + patch_description: "MovingLeastSquares: reduce the number of instantiations to reduce compile time" + patch_source: "https://github.com/PointCloudLibrary/pcl/pull/5764" + patch_type: "conan" diff --git a/recipes/pcl/all/conanfile.py b/recipes/pcl/all/conanfile.py new file mode 100644 index 00000000000000..3d3a9f2fd7b3e1 --- /dev/null +++ b/recipes/pcl/all/conanfile.py @@ -0,0 +1,582 @@ +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, export_conandata_patches, get, copy, rmdir, rm +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version +from conan.tools.system import package_manager +import os + +required_conan_version = ">=1.53.0" + +class PclConan(ConanFile): + name = "pcl" + description = ("The Point Cloud Library (PCL) is a standalone, large-scale, " + "open project for 2D/3D image and point cloud processing.") + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/PointCloudLibrary/pcl" + topics = ("computer vision", "point cloud", "pointcloud", "3d", "pcd", "ply", "stl", "ifs", "vtk") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + # Enable/disable individual components + "2d": [True, False], + "features": [True, False], + "filters": [True, False], + "geometry": [True, False], + "io": [True, False], + "kdtree": [True, False], + "keypoints": [True, False], + "ml": [True, False], + "octree": [True, False], + "outofcore": [True, False], + "people": [True, False], + "recognition": [True, False], + "registration": [True, False], + "sample_consensus": [True, False], + "search": [True, False], + "segmentation": [True, False], + "simulation": [True, False], + "stereo": [True, False], + "surface": [True, False], + "tracking": [True, False], + "visualization": [True, False], + "cuda_common": [True, False], + "cuda_features": [True, False], + "cuda_io": [True, False], + "cuda_sample_consensus": [True, False], + "cuda_segmentation": [True, False], + "gpu_containers": [True, False], + "gpu_features": [True, False], + "gpu_kinfu": [True, False], + "gpu_kinfu_large_scale": [True, False], + "gpu_octree": [True, False], + "gpu_people": [True, False], + "gpu_segmentation": [True, False], + "gpu_surface": [True, False], + "gpu_tracking": [True, False], + "gpu_utils": [True, False], + "apps": [True, False], + "tools": [True, False], + # Optional external dependencies. + # Only used if the corresponding component is enabled. + "with_cuda": [True, False], + "with_flann": [True, False], + "with_libusb": [True, False], + "with_opencv": [True, False], + "with_opengl": [True, False], + "with_openmp": [True, False], + "with_pcap": [True, False], + "with_png": [True, False], + "with_qhull": [True, False], + "with_qt": [True, False], + "with_vtk": [True, False], + # TODO: + # "with_davidsdk": [True, False], + # "with_dssdk": [True, False], + # "with_ensenso": [True, False], + # "with_fzapi": [True, False], + # "with_metslib": [True, False], + # "with_openni": [True, False], + # "with_openni2": [True, False], + # "with_rssdk": [True, False], + # "with_rssdk2": [True, False], + # "with_qvtk": [True, False], + # Precompile for a minimal set of point types only instead of all (e.g., pcl::PointXYZ instead of PCL_XYZ_POINT_TYPES) + "precompile_only_core_point_types": [True, False], + # Whether to append a ''/d/rd/s postfix to executables on Windows depending on the build type + "add_build_type_postfix": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + # Enable/disable individual components + "2d": True, + "features": True, + "filters": True, + "geometry": True, + "io": True, + "kdtree": True, + "keypoints": True, + "ml": True, + "octree": True, + "outofcore": False, + "people": False, + "recognition": True, + "registration": True, + "sample_consensus": True, + "search": True, + "segmentation": True, + "simulation": False, + "stereo": True, + "surface": True, + "tracking": True, + # Visualization is currently disabled by default due to missing VTK package + "visualization": False, + # GPU components are disabled by default + "cuda_common": False, + "cuda_features": False, + "cuda_io": False, + "cuda_sample_consensus": False, + "cuda_segmentation": False, + "gpu_containers": False, + "gpu_features": False, + "gpu_kinfu": False, + "gpu_kinfu_large_scale": False, + "gpu_octree": False, + "gpu_people": False, + "gpu_segmentation": False, + "gpu_surface": False, + "gpu_tracking": False, + "gpu_utils": False, + "apps": False, + "tools": False, + # Optional external dependencies + "with_cuda": False, + "with_flann": True, + "with_libusb": True, + "with_opencv": True, + "with_opengl": True, + "with_openmp": False, + "with_pcap": True, + "with_png": True, + "with_qhull": True, + "with_qt": True, + "with_vtk": False, + # Enabled to avoid excessive memory usage during compilation in CCI + "precompile_only_core_point_types": True, + "add_build_type_postfix": False, + } + + short_paths = True + + # The component details have been extracted from their CMakeLists.txt files using + # https://gist.github.com/valgur/e54e39b6a8931b58cc1776515104c828 + @property + def _external_deps(self): + return { + "common": ["boost", "eigen"], + "cuda_common": ["cuda"], + "cuda_features": ["cuda"], + "cuda_io": ["cuda", "openni"], + "cuda_sample_consensus": ["cuda"], + "cuda_segmentation": ["cuda"], + "gpu_containers": ["cuda"], + "gpu_features": ["cuda"], + "gpu_kinfu": ["cuda"], + "gpu_kinfu_large_scale": ["cuda"], + "gpu_octree": ["cuda"], + "gpu_people": ["cuda"], + "gpu_segmentation": ["cuda"], + "gpu_surface": ["cuda"], + "gpu_tracking": ["cuda"], + "gpu_utils": ["cuda"], + "io": ["zlib"], + "people": ["vtk"], + "surface": ["zlib"], + "visualization": ["vtk"], + } + + @property + def _external_optional_deps(self): + return { + "2d": ["vtk"], + "io": ["davidsdk", "dssdk", "ensenso", "fzapi", "libusb", "openni", "openni2", "pcap", "png", "rssdk", "rssdk2", "vtk"], + "kdtree": ["flann"], + "people": ["openni"], + "recognition": ["metslib"], + "search": ["flann"], + "simulation": ["opengl"], + "surface": ["qhull", "vtk"], + "visualization": ["davidsdk", "dssdk", "ensenso", "opengl", "openni", "openni2", "qvtk", "rssdk"], + "apps": ["cuda", "libusb", "opengl", "openni", "png", "qhull", "qt", "qvtk", "vtk"], + "tools": ["cuda", "davidsdk", "dssdk", "ensenso", "opencv", "opengl", "openni", "openni2", "qhull", "rssdk", "vtk"], + } + + def _ext_dep_to_conan_target(self, dep): + if not self._is_enabled(dep): + return [] + return { + "boost": ["boost::boost"], + "cuda": [], + "davidsdk": [], + "dssdk": [], + "eigen": ["eigen::eigen"], + "ensenso": [], + "flann": ["flann::flann"], + "fzapi": [], + "libusb": ["libusb::libusb"], + "metslib": [], + "opencv": ["opencv::opencv"], + "opengl": ["opengl::opengl", "freeglut::freeglut", "glew::glew", "glu::glu"], + "openni": [], + "openni2": [], + "pcap": ["libpcap::libpcap"], + "png": ["libpng::libpng"], + "qhull": ["qhull::qhull"], + "qt": ["qt::qt"], + "qvtk": [], + "rssdk": [], + "rssdk2": [], + "vtk": [], + "zlib": ["zlib::zlib"], + }[dep] + + @property + def _internal_deps(self): + return { + "2d": ["common", "filters"], + "common": [], + "cuda_common": [], + "cuda_features": ["common", "cuda_common", "io"], + "cuda_io": ["common", "cuda_common", "io"], + "cuda_sample_consensus": ["common", "cuda_common", "io"], + "cuda_segmentation": ["common", "cuda_common", "io"], + "features": ["2d", "common", "filters", "kdtree", "octree", "search"], + "filters": ["common", "kdtree", "octree", "sample_consensus", "search"], + "geometry": ["common"], + "gpu_containers": ["common"], + "gpu_features": ["common", "geometry", "gpu_containers", "gpu_octree", "gpu_utils"], + "gpu_kinfu": ["common", "geometry", "gpu_containers", "io", "search"], + "gpu_kinfu_large_scale": ["common", "features", "filters", "geometry", "gpu_containers", + "gpu_utils", "io", "kdtree", "octree", "search", "surface"], + "gpu_octree": ["common", "gpu_containers", "gpu_utils"], + "gpu_people": ["common", "features", "filters", "geometry", "gpu_containers", + "gpu_utils", "io", "kdtree", "octree", "search", "segmentation", + "surface", "visualization"], + "gpu_segmentation": ["common", "gpu_containers", "gpu_octree", "gpu_utils"], + "gpu_surface": ["common", "geometry", "gpu_containers", "gpu_utils"], + "gpu_tracking": ["common", "filters", "gpu_containers", "gpu_octree", + "gpu_utils", "kdtree", "octree", "search", "tracking"], + "gpu_utils": ["common", "gpu_containers"], + "io": ["common", "octree"], + "kdtree": ["common"], + "keypoints": ["common", "features", "filters", "kdtree", "octree", "search"], + "ml": ["common"], + "octree": ["common"], + "outofcore": ["common", "filters", "io", "octree", "visualization"], + "people": ["common", "filters", "geometry", "io", "kdtree", "octree", + "sample_consensus", "search", "segmentation", "visualization"], + "recognition": ["common", "features", "filters", "io", "kdtree", "ml", + "octree", "registration", "sample_consensus", "search"], + "registration": ["common", "features", "filters", "kdtree", "octree", + "sample_consensus", "search"], + "sample_consensus": ["common", "search"], + "search": ["common", "kdtree", "octree"], + "segmentation": ["common", "features", "filters", "geometry", "kdtree", + "ml", "octree", "sample_consensus", "search"], + "simulation": ["common", "features", "filters", "geometry", "io", + "kdtree", "octree", "search", "surface", "visualization"], + "stereo": ["common", "io"], + "surface": ["common", "kdtree", "octree", "search"], + "tracking": ["common", "filters", "kdtree", "octree", "search"], + "visualization": ["common", "geometry", "io", "kdtree", "octree", "search"], + } + + @property + def _internal_optional_deps(self): + return { + "apps": ["2d", "common", "cuda_common", "cuda_features", "cuda_io", + "cuda_sample_consensus", "cuda_segmentation", "features", "filters", + "geometry", "io", "kdtree", "keypoints", "ml", "octree", "recognition", + "registration", "sample_consensus", "search", "segmentation", "stereo", + "surface", "tracking", "visualization"], + "tools": ["features", "filters", "geometry", "gpu_kinfu", "gpu_kinfu_large_scale", + "io", "kdtree", "keypoints", "ml", "octree", "recognition", "registration", + "sample_consensus", "search", "segmentation", "surface", "visualization"], + } + + def _is_header_only(self, component): + return component in {"2d", "cuda_common", "geometry"} + + @property + def _extra_libs(self): + return {"io": ["pcl_io_ply"]} + + def _enabled_components(self, opts=None): + opts = opts or self.options + return {c for c in self._internal_deps if opts.get_safe(c)} | {"common"} + + def _disabled_components(self, opts=None): + opts = opts or self.options + return {c for c in self._internal_deps if not opts.get_safe(c)} - {"common"} + + def _used_ext_deps(self, opts): + all_deps = set() + for component in self._enabled_components(opts): + all_deps.update(self._external_deps.get(component, [])) + all_deps.update(self._external_optional_deps.get(component, [])) + return all_deps + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "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 system_requirements(self): + if self._is_enabled("vtk"): + # TODO: add vtk/system package? + # https://repology.org/project/vtk/versions + package_manager.Apt(self).install(["libvtk9-dev"], update=True, check=True) + package_manager.Dnf(self).install(["vtk-devel"], update=True, check=True) + package_manager.Yum(self).install(["vtk-devel"], update=True, check=True) + package_manager.PacMan(self).install(["vtk"], update=True, check=True) + package_manager.Zypper(self).install(["vtk"], update=True, check=True) + package_manager.Pkg(self).install(["vtk9"], update=True, check=True) + package_manager.Brew(self).install(["vtk"], update=True, check=True) + if self.settings.os == "Windows": + self.output.warning("VTK must be installed manually on Windows.") + + def _is_enabled(self, dep): + always_available = ["boost", "eigen", "zlib"] + is_available = self.options.get_safe(f"with_{dep}") or dep in always_available + is_used = dep in self._used_ext_deps(self.options) + return is_available and is_used + + def requirements(self): + self.requires("boost/1.83.0", transitive_headers=True) + self.requires("eigen/3.4.0", transitive_headers=True) + if self._is_enabled("flann"): + self.requires("flann/1.9.2", transitive_headers=True) + if self._is_enabled("png"): + self.requires("libpng/1.6.40") + if self._is_enabled("qhull"): + self.requires("qhull/8.0.1", transitive_headers=True) + if self._is_enabled("qt"): + self.requires("qt/6.6.1") + if self._is_enabled("libusb"): + self.requires("libusb/1.0.26", transitive_headers=True) + if self._is_enabled("pcap"): + self.requires("libpcap/1.10.4") + if self._is_enabled("opengl"): + # OpenGL is only used if VTK is available + self.requires("opengl/system", transitive_headers=True) + self.requires("freeglut/3.4.0", transitive_headers=True) + self.requires("glew/2.2.0", transitive_headers=True) + self.requires("glu/system", transitive_headers=True) + if self._is_enabled("opencv"): + self.requires("opencv/4.8.1", transitive_headers=True) + if self._is_enabled("zlib"): + self.requires("zlib/[>=1.2.11 <2]") + # TODO: + # self.requires("vtk/9.x.x", transitive_headers=True) + # self.requires("openni/x.x.x", transitive_headers=True) + # self.requires("openni2/x.x.x", transitive_headers=True) + # self.requires("ensenso/x.x.x", transitive_headers=True) + # self.requires("davidsdk/x.x.x", transitive_headers=True) + # self.requires("dssdk/x.x.x", transitive_headers=True) + # self.requires("rssdk/x.x.x", transitive_headers=True) + # self.requires("metslib/x.x.x", transitive_headers=True) + # self.requires("openmp/system", transitive_headers=True) + # self.requires("opennurbs/x.x.x", transitive_headers=True) + # self.requires("poisson4/x.x.x", transitive_headers=True) + + def package_id(self): + used_deps = self._used_ext_deps(self.info.options) + # Disable options that have no effect + all_opts = [opt for opt, value in self.info.options.items()] + for opt in all_opts: + if opt.startswith("with_") and opt.split("_", 1)[1] not in used_deps: + setattr(self.info.options, opt, False) + + def validate(self): + enabled_components = self._enabled_components() + for component in sorted(enabled_components): + for dep in self._external_deps.get(component, []): + if not self._is_enabled(dep): + raise ConanInvalidConfiguration( + f"'with_{dep}=True' is required when '{component}' is enabled." + ) + for dep in self._internal_deps[component]: + if dep not in enabled_components: + raise ConanInvalidConfiguration( + f"'{dep}=True' is required when '{component}' is enabled." + ) + + 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["PCL_SHARED_LIBS"] = self.options.shared + tc.cache_variables["WITH_LIBUSB"] = self._is_enabled("libusb") + tc.cache_variables["WITH_OPENGL"] = self._is_enabled("opengl") + tc.cache_variables["WITH_OPENMP"] = self._is_enabled("openmp") + tc.cache_variables["WITH_PCAP"] = self._is_enabled("pcap") + tc.cache_variables["WITH_PNG"] = self._is_enabled("png") + tc.cache_variables["WITH_QHULL"] = self._is_enabled("qhull") + if self._is_enabled("qhull"): + # Upstream FindQhull.cmake defines HAVE_QHULL which changes content of pcl_config.h + # Since we use CMakeDeps instead of this file, we have to manually inject HAVE_QHULL + tc.cache_variables["HAVE_QHULL"] = True + tc.cache_variables["WITH_QT"] = self._is_enabled("qt") + tc.cache_variables["WITH_VTK"] = self._is_enabled("vtk") + tc.cache_variables["WITH_CUDA"] = self._is_enabled("cuda") + tc.cache_variables["BUILD_CUDA"] = self._is_enabled("cuda") + tc.cache_variables["BUILD_GPU"] = self._is_enabled("cuda") + tc.cache_variables["WITH_SYSTEM_ZLIB"] = True + tc.cache_variables["PCL_ONLY_CORE_POINT_TYPES"] = self.options.precompile_only_core_point_types + # The default False setting breaks OpenGL detection in CMake + tc.cache_variables["PCL_ALLOW_BOTH_SHARED_AND_STATIC_DEPENDENCIES"] = True + tc.variables["OpenGL_GL_PREFERENCE"] = "GLVND" + + if not self.options.add_build_type_postfix: + tc.cache_variables["CMAKE_DEBUG_POSTFIX"] = "" + tc.cache_variables["CMAKE_RELEASE_POSTFIX"] = "" + tc.cache_variables["CMAKE_RELWITHDEBINFO_POSTFIX"] = "" + tc.cache_variables["CMAKE_MINSIZEREL_POSTFIX"] = "" + + tc.cache_variables["BUILD_tools"] = self.options.tools + tc.cache_variables["BUILD_apps"] = self.options.apps + tc.cache_variables["BUILD_examples"] = False + enabled = sorted(self._enabled_components()) + disabled = sorted(self._disabled_components()) + self.output.info("Enabled components: " + ", ".join(enabled)) + self.output.info("Disabled components: " + ", ".join(disabled)) + for comp in enabled: + tc.cache_variables[f"BUILD_{comp}"] = True + for comp in disabled: + tc.cache_variables[f"BUILD_{comp}"] = False + + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("eigen", "cmake_file_name", "EIGEN") + deps.set_property("flann", "cmake_file_name", "FLANN") + deps.set_property("flann", "cmake_target_name", "FLANN::FLANN") + deps.set_property("libpcap", "cmake_file_name", "PCAP") + deps.set_property("qhull", "cmake_file_name", "QHULL") + deps.set_property("qhull", "cmake_target_name", "QHULL::QHULL") + deps.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + for mod in ["Eigen", "FLANN", "GLEW", "Pcap", "Qhull", "libusb"]: + os.remove(os.path.join(self.source_folder, "cmake", "Modules", f"Find{mod}.cmake")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + 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")) + # Remove MSVC runtime libraries + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + rm(self, dll_pattern_to_remove, os.path.join(self.package_folder, "bin")) + + @property + def _version_suffix(self): + semver = Version(self.version) + return f"{semver.major}.{semver.minor}" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PCL") + self.cpp_info.set_property("cmake_target_name", "PCL::PCL") + self.cpp_info.set_property("cmake_find_mode", "both") + + for name in sorted(self._enabled_components()): + component = self.cpp_info.components[name] + component.names["cmake_find_package"] = name + component.names["cmake_find_package_multi"] = name + component.set_property("cmake_file_name", name) + component.set_property("cmake_module_file_name", name) + component.set_property("cmake_target_name", f"PCL::{name}") + component.set_property("pkg_config_name", f"pcl_{name}-{self._version_suffix}") + component.includedirs = [os.path.join("include", f"pcl-{self._version_suffix}")] + if not self._is_header_only(name): + component.libs = [f"pcl_{name}"] + component.libs += self._extra_libs.get(name, []) + component.requires += self._internal_deps[name] + for opt_dep in self._internal_optional_deps.get(name, []): + if self.options.get_safe(opt_dep): + component.requires.append(opt_dep) + for dep in self._external_deps.get(name, []) + self._external_optional_deps.get(name, []): + component.requires += self._ext_dep_to_conan_target(dep) + + if self.options.apps: + component = self.cpp_info.components["apps"] + component.libs = [] + component.includedirs = [] + component.requires = self._internal_optional_deps["apps"] + for dep in self._external_optional_deps["apps"]: + component.requires += self._ext_dep_to_conan_target(dep) + + if self.options.tools: + component = self.cpp_info.components["tools"] + component.libs = [] + component.includedirs = [] + component.requires = self._internal_optional_deps["tools"] + for dep in self._external_optional_deps["tools"]: + component.requires += self._ext_dep_to_conan_target(dep) + + common = self.cpp_info.components["common"] + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + common.system_libs.append("pthread") + if self.options.with_openmp: + if self.settings.os == "Linux": + if self.settings.compiler == "gcc": + common.sharedlinkflags.append("-fopenmp") + common.exelinkflags.append("-fopenmp") + elif self.settings.os == "Windows": + if self.settings.compiler == "msvc": + common.system_libs.append("delayimp") + elif self.settings.compiler == "gcc": + common.system_libs.append("gomp") + if self.settings.os == "Windows": + common.system_libs.append("ws2_32") + + # TODO: Legacy, to be removed on Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "PCL" + self.cpp_info.names["cmake_find_package_multi"] = "PCL" diff --git a/recipes/pcl/all/patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch b/recipes/pcl/all/patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch new file mode 100644 index 00000000000000..5dfeedf59e5f46 --- /dev/null +++ b/recipes/pcl/all/patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch @@ -0,0 +1,25 @@ +From a975f68d2e399a1563fe0d66b2c048978f0282d1 Mon Sep 17 00:00:00 2001 +From: Esteban DUGUEPEROUX +Date: Mon, 7 Aug 2023 23:50:12 +0200 +Subject: [PATCH] Add Eigen3::Eigen target in pcl_common target + +--- + common/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt +index 48e1a202e..e0ced5241 100644 +--- a/common/CMakeLists.txt ++++ b/common/CMakeLists.txt +@@ -179,7 +179,7 @@ target_include_directories(${LIB_NAME} PUBLIC + $ + ) + +-target_link_libraries(${LIB_NAME} Boost::boost) ++target_link_libraries(${LIB_NAME} Boost::boost Eigen3::Eigen) + + if(MSVC AND NOT (MSVC_VERSION LESS 1915)) + # MSVC resolved a byte alignment issue in compiler version 15.9 +-- +2.41.0 + diff --git a/recipes/pcl/all/patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch b/recipes/pcl/all/patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch new file mode 100644 index 00000000000000..35fba73e8b0675 --- /dev/null +++ b/recipes/pcl/all/patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch @@ -0,0 +1,38 @@ +From 0bc2f2cc369f7d013ee5c29075188c4e26ea6f87 Mon Sep 17 00:00:00 2001 +From: Markus Vieth +Date: Sat, 15 Jul 2023 15:49:25 +0200 +Subject: [PATCH] MovingLeastSquares: reduce the number of instantiations to + reduce compile time PCL_XYZ_POINT_TYPES currently contains 18 types, so + previously, MLS was instantiated for 18*18=324 different type combinations. + However, among those were instantiations which are likely used by nobody + (like `pcl::MovingLeastSquares`). With + these changes, MLS is only instantiated 6*6+(18-6)=48 times. The most common + type combinations should be covered, but if someone uses an uncommon + combinations, they have to add `#define PCL_NO_PRECOMPILE` before including + `pcl/surface/mls.h` to avoid linker errors. + +--- + surface/src/mls.cpp | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/surface/src/mls.cpp b/surface/src/mls.cpp +index ba2fd655300..c948f4d19e1 100644 +--- a/surface/src/mls.cpp ++++ b/surface/src/mls.cpp +@@ -80,6 +80,15 @@ pcl::MLSResult::calculatePrincipalCurvatures (const double u, const double v) co + PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal)) + ((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) + #else +- PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, (PCL_XYZ_POINT_TYPES)(PCL_XYZ_POINT_TYPES)) ++ // PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, (PCL_XYZ_POINT_TYPES)(PCL_XYZ_POINT_TYPES)) ++ // All instantiations that are available with PCL_ONLY_CORE_POINT_TYPES, plus instantiations for all XYZ types where PointInT and PointOutT are the same ++ #define PCL_INSTANTIATE_MovingLeastSquaresSameInAndOut(T) template class PCL_EXPORTS pcl::MovingLeastSquares; ++ PCL_INSTANTIATE(MovingLeastSquaresSameInAndOut, PCL_XYZ_POINT_TYPES) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZ))((pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZI))((pcl::PointXYZ)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZRGB))((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZRGBA))((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZRGBNormal))((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointNormal))((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal))) + #endif + #endif // PCL_NO_PRECOMPILE diff --git a/recipes/pcl/all/patches/0001-cmake_use_conan_targets.patch b/recipes/pcl/all/patches/0001-cmake_use_conan_targets.patch new file mode 100644 index 00000000000000..5461a0bfed49e0 --- /dev/null +++ b/recipes/pcl/all/patches/0001-cmake_use_conan_targets.patch @@ -0,0 +1,52 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -297,7 +297,7 @@ + # OpenMP (optional) + option(WITH_OPENMP "Build with parallelization using OpenMP" TRUE) + if(WITH_OPENMP) +- find_package(OpenMP COMPONENTS C CXX) ++ find_package(OpenMP REQUIRED COMPONENTS C CXX) + endif() + if(OpenMP_FOUND) + string(APPEND CMAKE_C_FLAGS " ${OpenMP_C_FLAGS}") +@@ -319,11 +319,11 @@ + find_package(Threads REQUIRED) + + # Eigen (required) +-find_package(Eigen 3.3 REQUIRED) ++find_package(EIGEN REQUIRED CONFIG) + include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS}) + + # FLANN (required) +-find_package(FLANN 1.9.1 REQUIRED) ++find_package(FLANN CONFIG) + if(NOT (${FLANN_LIBRARY_TYPE} MATCHES ${PCL_FLANN_REQUIRED_TYPE}) AND NOT (${PCL_FLANN_REQUIRED_TYPE} MATCHES "DONTCARE")) + message(FATAL_ERROR "Flann was selected with ${PCL_FLANN_REQUIRED_TYPE} but found as ${FLANN_LIBRARY_TYPE}") + endif() +@@ -359,7 +359,7 @@ + # LibPNG + option(WITH_PNG "PNG file support" TRUE) + if(WITH_PNG) +- find_package(PNG) ++ find_package(PNG REQUIRED CONFIG) + if(PNG_FOUND) + set(HAVE_PNG ON) + include_directories(SYSTEM "${PNG_INCLUDE_DIR}") +@@ -369,7 +369,7 @@ + # Qhull + option(WITH_QHULL "Include convex-hull operations" TRUE) + if(WITH_QHULL) +- find_package(Qhull) ++ find_package(QHULL REQUIRED CONFIG) + if(NOT (${QHULL_LIBRARY_TYPE} MATCHES ${PCL_QHULL_REQUIRED_TYPE}) AND NOT (${PCL_QHULL_REQUIRED_TYPE} MATCHES "DONTCARE")) + message(FATAL_ERROR "Qhull was selected with ${PCL_QHULL_REQUIRED_TYPE} but found as ${QHULL_LIBRARY_TYPE}") + endif() +@@ -404,7 +404,7 @@ + #Find PCAP + option(WITH_PCAP "pcap file capabilities in Velodyne HDL driver" TRUE) + if(WITH_PCAP) +- find_package(Pcap) ++ find_package(PCAP REQUIRED CONFIG) + endif() + + # OpenGL and GLUT diff --git a/recipes/pcl/all/patches/0001-fix-FindOpenNI-bug.patch b/recipes/pcl/all/patches/0001-fix-FindOpenNI-bug.patch new file mode 100644 index 00000000000000..34cf4a671e2859 --- /dev/null +++ b/recipes/pcl/all/patches/0001-fix-FindOpenNI-bug.patch @@ -0,0 +1,32 @@ +--- cmake/Modules/FindOpenNI.cmake ++++ cmake/Modules/FindOpenNI.cmake +@@ -52,7 +52,12 @@ + + # Libraries + if(NOT WIN32) +- find_package(libusb REQUIRED) ++ find_package(libusb QUIET) ++ if (NOT libusb_FOUND) ++ message(WARNING "Found OpenNI library, but required libusb is not available") ++ set(OPENNI_FOUND FALSE) ++ return() ++ endif() + set(OPENNI_LIBRARIES ${OPENNI_LIBRARY} libusb::libusb) + else() + set(OPENNI_LIBRARIES ${OPENNI_LIBRARY}) +--- cmake/Modules/FindOpenNI2.cmake ++++ cmake/Modules/FindOpenNI2.cmake +@@ -42,7 +42,12 @@ + + # Libraries + if(NOT WIN32) +- find_package(libusb REQUIRED) ++ find_package(libusb QUIET) ++ if (NOT libusb_FOUND) ++ message(WARNING "Found OpenNI2 library, but required libusb is not available") ++ set(OPENNI2_FOUND FALSE) ++ return() ++ endif() + set(OPENNI2_LIBRARIES ${OPENNI2_LIBRARY} libusb::libusb) + else() + set(OPENNI2_LIBRARIES ${OPENNI2_LIBRARY}) diff --git a/recipes/pcl/all/test_package/CMakeLists.txt b/recipes/pcl/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..57794a612df2a9 --- /dev/null +++ b/recipes/pcl/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(PCL REQUIRED surface CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE PCL::filters) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/pcl/all/test_package/conanfile.py b/recipes/pcl/all/test_package/conanfile.py new file mode 100644 index 00000000000000..02eb5ce439fb40 --- /dev/null +++ b/recipes/pcl/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 + + +# It will become the standard on Conan 2.x +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/pcl/all/test_package/test_package.cpp b/recipes/pcl/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..cca717d08eb8f6 --- /dev/null +++ b/recipes/pcl/all/test_package/test_package.cpp @@ -0,0 +1,73 @@ +// Copied from https://github.com/PointCloudLibrary/pcl/blob/pcl-1.13.1/examples/filters/example_extract_indices.cpp +/* + * Software License Agreement (BSD License) + * + * Point Cloud Library (PCL) - www.pointclouds.org + * Copyright (c) 2009-2011, Willow Garage, Inc. + * + * 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. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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. + * + * $Id: example_ExtractIndices.cpp 4117 2012-01-31 17:56:02Z aichim $ + * + */ + +#include + +#include + +int +main (int, char**) +{ + using PointType = pcl::PointXYZ; + using CloudType = pcl::PointCloud; + CloudType::Ptr cloud (new CloudType); + cloud->is_dense = false; + PointType p; + for (unsigned int i = 0; i < 5; ++i) + { + p.x = p.y = p.z = static_cast (i); + cloud->push_back (p); + } + + std::cout << "Cloud has " << cloud->size () << " points." << std::endl; + + pcl::PointIndices indices; + indices.indices.push_back (0); + indices.indices.push_back (2); + + pcl::ExtractIndices extract_indices; + extract_indices.setIndices (pcl::make_shared (indices)); + extract_indices.setInputCloud (cloud); + pcl::PointCloud::Ptr output (new pcl::PointCloud); + extract_indices.filter (*output); + + std::cout << "Output has " << output->size () << " points." << std::endl; + return (0); +} diff --git a/recipes/pcl/config.yml b/recipes/pcl/config.yml new file mode 100644 index 00000000000000..aac1819cc10c01 --- /dev/null +++ b/recipes/pcl/config.yml @@ -0,0 +1,3 @@ +versions: + "1.13.1": + folder: all diff --git a/recipes/pcre/all/conanfile.py b/recipes/pcre/all/conanfile.py index 8d0c74976c81bf..ca51bc38829c60 100644 --- a/recipes/pcre/all/conanfile.py +++ b/recipes/pcre/all/conanfile.py @@ -75,7 +75,7 @@ def requirements(self): if self.options.get_safe("with_bzip2"): self.requires("bzip2/1.0.8") if self.options.get_safe("with_zlib"): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if not self.options.build_pcre_8 and not self.options.build_pcre_16 and not self.options.build_pcre_32: diff --git a/recipes/pcre2/all/conanfile.py b/recipes/pcre2/all/conanfile.py index 5982290e7cdbe1..14600c9abe85c9 100644 --- a/recipes/pcre2/all/conanfile.py +++ b/recipes/pcre2/all/conanfile.py @@ -16,7 +16,7 @@ class PCRE2Conan(ConanFile): description = "Perl Compatible Regular Expressions" topics = ("regex", "regexp", "perl") license = "BSD-3-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -65,7 +65,7 @@ def layout(self): def requirements(self): if self.options.get_safe("with_zlib"): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.get_safe("with_bzip2"): self.requires("bzip2/1.0.8") @@ -76,8 +76,7 @@ def validate(self): raise ConanInvalidConfiguration("build_pcre2_8 must be enabled for the pcre2grep program") 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/pdcurses/all/CMakeLists.txt b/recipes/pdcurses/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d4..00000000000000 --- a/recipes/pdcurses/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/pdcurses/all/conanfile.py b/recipes/pdcurses/all/conanfile.py index c9fb1fa9f32f79..3a01de34987fe0 100644 --- a/recipes/pdcurses/all/conanfile.py +++ b/recipes/pdcurses/all/conanfile.py @@ -1,149 +1,198 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanException, ConanInvalidConfiguration import os import re +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, copy, get, load, replace_in_file, rmdir, save, rename +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, NMakeToolchain, NMakeDeps + +required_conan_version = ">=1.53.0" + class PDCursesConan(ConanFile): name = "pdcurses" description = "PDCurses - a curses library for environments that don't fit the termcap/terminfo model" - topics = ("conan", "pdcurses", "curses", "ncurses") + license = "LicenseRef-LICENSE" url = "https://github.com/conan-io/conan-center-index" homepage = "https://pdcurses.org/" - license = "Unlicense", "MITX", "CC-BY-4.0", "GPL", "FSFUL" + topics = ("curses", "ncurses") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "enable_widec": [True, False], - "with_sdl": [None, "1", "2"], + "with_sdl": [True, False], + "with_x11": [True, False], } default_options = { "shared": False, "fPIC": True, "enable_widec": False, - "with_sdl": None, + "with_sdl": False, + "with_x11": True, } - _autotools = None - - @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 - if self.settings.os not in ("FreeBSD", "Linux"): - del self.options.enable_widec + if self.settings.os not in ["FreeBSD", "Linux"]: + del self.options.with_x11 + if is_apple_os(self): + # Only the sdl2 subsystem is supported on macOS + self.options.with_sdl = True def configure(self): - if tools.is_apple_os(self.settings.os): - raise ConanInvalidConfiguration("pdcurses does not support Apple") - if self.options.with_sdl: - raise ConanInvalidConfiguration("conan-center-index has no packages for sdl (yet)") if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + 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 self.settings.os in ("FreeBSD", "Linux"): + if self.options.with_sdl: + self.requires("sdl/2.28.3", transitive_libs=True) + if self.options.get_safe("with_x11"): self.requires("xorg/system") + def validate(self): + if self.options.with_sdl and self.settings.os == "Windows": + raise ConanInvalidConfiguration("with_sdl option is not yet supported on Windows") + if self.settings.os != "Windows" and not self.options.get_safe("with_x11") and not self.options.with_sdl: + raise ConanInvalidConfiguration("At least one of with_x11 or with_sdl options must be enabled") + if self.options.with_sdl: + if self.options.shared: + raise ConanInvalidConfiguration("Shared library output is not available for with_sdl option") + if cross_building(self): + raise ConanInvalidConfiguration("Cross-building is not supported for with_sdl option") + def build_requirements(self): - if self.settings.compiler != "Visual Studio": - self.build_requires("make/4.2.1") + if not is_msvc(self): + if not self.conf.get("tools.gnu:make_program", check_type=str): + self.tool_requires("make/4.4") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("PDCurses-{}".format(self.version), self._source_subfolder) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-shared" if self.options.shared else "--disable-shared", - "--enable-widec" if self.options.enable_widec else "--disable-widec", - ] - self._autotools.configure(args=conf_args) - return self._autotools - - def _build_windows(self): - with tools.chdir(os.path.join(self._source_subfolder, "wincon")): - args = [] + 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() + deps = NMakeDeps(self) + deps.generate() + else: + tc = AutotoolsToolchain(self) + tc.configure_args.append("--prefix={}".format(unix_path(self, self.package_folder))) + tc.configure_args.append("--enable-widec" if self.options.enable_widec else "--disable-widec") if self.options.shared: - args.append("DLL=Y") - args = " ".join(args) - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - self.run("nmake -f Makefile.vc {}".format(args)) - else: - self.run("{} libs {}".format(os.environ["CONAN_MAKE_PROGRAM"], args)) + tc.make_args.append("DLL=Y") + if self.options.with_sdl: + self.dependencies["sdl"].cpp_info.includedirs.append(os.path.join("include", "SDL2")) + sdl_info = self.dependencies["sdl"].cpp_info.aggregated_components() + def_flags = " ".join(f"-D{x}" for x in sdl_info.defines) + includedir_flags = " ".join(f"-I{x}" for x in sdl_info.includedirs) + libdir_flags = " ".join(f"-L{x}" for x in sdl_info.libdirs) + lib_flags = " ".join(f"-l{x}" for x in (sdl_info.libs + sdl_info.system_libs)) + tc.make_args += [ + f"CFLAGS={includedir_flags} {def_flags}", + f"LDFLAGS={libdir_flags} {lib_flags}", + ] + if self.options.enable_widec: + tc.make_args.append("WIDE=Y") + tc.generate() def _patch_sources(self): - if self.settings.compiler == "Visual Studio": - tools.replace_in_file(os.path.join(self._source_subfolder, "wincon", "Makefile.vc"), - "$(CFLAGS)", - "$(CFLAGS) -{}".format(self.settings.compiler.runtime)) - tools.replace_in_file(os.path.join(self._source_subfolder, "x11", "Makefile.in"), - "$(INSTALL) -c -m 644 $(osdir)/libXCurses.a $(libdir)/libXCurses.a", - "-$(INSTALL) -c -m 644 $(osdir)/libXCurses.a $(libdir)/libXCurses.a") - tools.replace_in_file(os.path.join(self._source_subfolder, "x11", "Makefile.in"), - "\nall:\t", - "\nall:\t{}\t#".format("@SHL_TARGETS@" if self.options.shared else "$(LIBCURSES)")) + if is_msvc(self): + replace_in_file(self, os.path.join(self.source_folder, "wincon", "Makefile.vc"), + "$(CFLAGS)", + "$(CFLAGS) -{}".format(msvc_runtime_flag(self))) + replace_in_file(self, os.path.join(self.source_folder, "x11", "Makefile.in"), + "$(INSTALL) -c -m 644 $(osdir)/libXCurses.a $(libdir)/libXCurses.a", + "-$(INSTALL) -c -m 644 $(osdir)/libXCurses.a $(libdir)/libXCurses.a") + replace_in_file(self, os.path.join(self.source_folder, "x11", "Makefile.in"), + "\nall:\t", + "\nall:\t{}\t#".format("@SHL_TARGETS@" if self.options.shared else "$(LIBCURSES)")) def build(self): self._patch_sources() - if self.settings.os == "Windows": - self._build_windows() + if is_msvc(self): + self._build_msvc() else: - with tools.chdir(os.path.join(self._source_subfolder, "x11")): - autotools = self._configure_autotools() + self._build_autotools() + + def _build_autotools(self): + if self.options.get_safe("with_x11"): + with chdir(self, os.path.join(self.source_folder, "x11")): + autotools = Autotools(self) + autotools.configure(build_script_folder=os.path.join(self.source_folder, "x11")) + autotools.make() + if self.options.with_sdl: + with chdir(self, os.path.join(self.source_folder, "sdl2")): + autotools = Autotools(self) autotools.make() - @property - def _subsystem_folder(self): - return { - "Windows": "wincon", - }.get(str(self.settings.os), "x11") + + def _build_msvc(self): + with chdir(self, os.path.join(self.source_folder, "wincon")): + args = [] + if self.options.shared: + args.append("DLL=Y") + if self.options.enable_widec: + args.append("WIDE=Y") + args = " ".join(args) + if is_msvc(self): + self.run(f"nmake -f Makefile.vc {args}") + else: + self.run(f"make libs {args}") @property def _license_text(self): - readme = tools.load(os.path.join(self._source_subfolder, self._subsystem_folder, "README.md")) - match = re.search(r"Distribution Status\n[\-]+(?:[\r\n])+((?:[0-9a-z .,;*]+[\r\n])+)", readme, - re.IGNORECASE | re.MULTILINE) - if not match: - raise ConanException("Cannot extract distribution status") - return match.group(1).strip() + "\n" + readme = load(self, os.path.join(self.source_folder, "README.md")) + match = re.search(r"Legal Stuff\n[\-]+[\r\n]+((?:.*\n)+)\n\nMaintainer", readme, re.IGNORECASE | re.MULTILINE) + license = match.group(1).strip() + "\n" + if self.options.get_safe("with_x11"): + readme = load(self, os.path.join(self.source_folder, "x11", "README.md")) + match = re.search(r"Distribution Status\n[\-]+[\r\n]+((?:[0-9a-z .,;*]+[\r\n])+)", readme, re.IGNORECASE | re.MULTILINE) + if not match: + raise ConanException("Cannot extract distribution status") + license += "\n" + match.group(1).strip() + "\n" + return license - def package(self): - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) - if self.settings.os == "Windows": - self.copy(pattern="curses.h", src=self._source_subfolder, dst="include") - self.copy(pattern="*.dll", dst="bin", keep_path=False) - self.copy(pattern="*.lib", dst="lib", keep_path=False) - self.copy(pattern="*.a", dst="lib", keep_path=False) - - if self.settings.compiler != "Visual Studio": - os.rename(os.path.join(self.package_folder, "lib", "pdcurses.a"), - os.path.join(self.package_folder, "lib", "libpdcurses.a")) - else: - with tools.chdir(os.path.join(self._source_subfolder, "x11")): - autotools = self._configure_autotools() + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) + if self.options.get_safe("with_x11"): + with chdir(self, os.path.join(self.source_folder, "x11")): + autotools = Autotools(self) autotools.install() - tools.rmdir(os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "bin")) + copy(self, "curses.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + build_folders = [] + if self.settings.os == "Windows": + build_folders += [self.source_folder] + if self.options.with_sdl: + build_folders += [os.path.join(self.source_folder, "sdl2")] + for build_folder in build_folders: + copy(self, "*.dll", dst=os.path.join(self.package_folder, "bin"), src=build_folder, keep_path=False) + for pattern in ["*.lib", "*.a", "*.so*", "*.dylib*"]: + copy(self, pattern, dst=os.path.join(self.package_folder, "lib"), src=build_folder, keep_path=False) + if (self.settings.os == "Windows" or self.options.with_sdl) and not is_msvc(self): + rename(self, os.path.join(self.package_folder, "lib", "pdcurses.a"), + os.path.join(self.package_folder, "lib", "libpdcurses.a")) def package_info(self): - if self.settings.os == "Windows": + if self.settings.os == "Windows" or self.options.with_sdl: self.cpp_info.libs = ["pdcurses"] - elif self.settings.os in ("FreeBSD", "Linux"): + if self.options.get_safe("with_x11"): self.cpp_info.includedirs.append(os.path.join("include", "xcurses")) - self.cpp_info.libs = ["XCurses"] + self.cpp_info.libs += ["XCurses"] diff --git a/recipes/pdcurses/all/test_package/CMakeLists.txt b/recipes/pdcurses/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..06f34416c70f62 100644 --- a/recipes/pdcurses/all/test_package/CMakeLists.txt +++ b/recipes/pdcurses/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(pdcurses REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE pdcurses::pdcurses) diff --git a/recipes/pdcurses/all/test_package/conanfile.py b/recipes/pdcurses/all/test_package/conanfile.py index 4aebe114eeb59c..ef5d7042163ecc 100644 --- a/recipes/pdcurses/all/test_package/conanfile.py +++ b/recipes/pdcurses/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", "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 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/pdcurses/all/test_v1_package/CMakeLists.txt b/recipes/pdcurses/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/pdcurses/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/pdcurses/all/test_v1_package/conanfile.py b/recipes/pdcurses/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..3f4a9f50f389e4 --- /dev/null +++ b/recipes/pdcurses/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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/pdf-writer/all/conandata.yml b/recipes/pdf-writer/all/conandata.yml new file mode 100644 index 00000000000000..396c829a1f2534 --- /dev/null +++ b/recipes/pdf-writer/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "4.6.1": + url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.6.1.tar.gz" + sha256: "6e95fcb26ec679fa12ce6638d35a591e80960b35956a142d9a80b9a8c80ca824" + "4.5.12": + url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.5.12.tar.gz" + sha256: "40fcbaa66fc46fcb588ceda119ba8839ff6d2c886191ac5e68ed702475c7336e" +patches: + "4.6.1": + - patch_file: "patches/4.5.12-0001-fix-cmake.patch" + patch_description: "disable test/cpack, use cci package" + patch_type: "conan" + "4.5.12": + - patch_file: "patches/4.5.12-0001-fix-cmake.patch" + patch_description: "disable test/cpack, use cci package" + patch_type: "conan" diff --git a/recipes/pdf-writer/all/conanfile.py b/recipes/pdf-writer/all/conanfile.py new file mode 100644 index 00000000000000..976af4f35f8250 --- /dev/null +++ b/recipes/pdf-writer/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.gnu import PkgConfigDeps +import os + +required_conan_version = ">=1.53.0" + +class PDFWriterConan(ConanFile): + name = "pdf-writer" + description = "High performance library for creating, modiyfing and parsing PDF files in C++" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/galkahana/PDF-Writer" + topics = ("pdf", "writer") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_png": [True, False], + "with_jpeg": [True, False], + "with_tiff": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_png": True, + "with_jpeg": True, + "with_tiff": True, + } + + @property + def _min_cppstd(self): + return 11 + + 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("freetype/2.13.0") + self.requires("libaesgm/2013.1.1") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_png: + self.requires("libjpeg/9e") + if self.options.with_jpeg: + self.requires("libpng/1.6.40") + if self.options.with_tiff: + self.requires("libtiff/4.6.0") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_BUNDLED"] = False + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PDFHummus") + self.cpp_info.set_property("cmake_target_name", "PDFHummus::PDFWriter") + self.cpp_info.libs = ["PDFWriter"] + self.cpp_info.requires = ["freetype::freetype", "zlib::zlib", "libaesgm::libaesgm"] + if self.options.with_png: + self.cpp_info.requires.append("libjpeg::libjpeg") + if self.options.with_jpeg: + self.cpp_info.requires.append("libpng::libpng") + if self.options.with_tiff: + self.cpp_info.requires.append("libtiff::libtiff") diff --git a/recipes/pdf-writer/all/patches/4.5.12-0001-fix-cmake.patch b/recipes/pdf-writer/all/patches/4.5.12-0001-fix-cmake.patch new file mode 100644 index 00000000000000..02aec77b37c06b --- /dev/null +++ b/recipes/pdf-writer/all/patches/4.5.12-0001-fix-cmake.patch @@ -0,0 +1,42 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8dcb27d..ca69cdf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -153,21 +153,21 @@ endif(NOT USE_BUNDLED) + + ADD_SUBDIRECTORY(PDFWriter) + +-if(PROJECT_IS_TOP_LEVEL) ++if(0) + # avoid installing the testing lib altogether when included in another project. + # it's annoying when in parent all, and more annoying to then get the tests added + # to the parent project ctest. + enable_testing() + ADD_SUBDIRECTORY(PDFWriterTesting) +-endif(PROJECT_IS_TOP_LEVEL) ++endif() + +-include(InstallRequiredSystemLibraries) +-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +-set(CPACK_PACKAGE_VERSION_MAJOR "${PDFHummus_VERSION_MAJOR}") +-set(CPACK_PACKAGE_VERSION_MINOR "${PDFHummus_VERSION_MINOR}") +-set(CPACK_SOURCE_GENERATOR "ZIP") +-set(CPACK_GENERATOR "ZIP") +-include(CPack) ++# include(InstallRequiredSystemLibraries) ++# set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") ++# set(CPACK_PACKAGE_VERSION_MAJOR "${PDFHummus_VERSION_MAJOR}") ++# set(CPACK_PACKAGE_VERSION_MINOR "${PDFHummus_VERSION_MINOR}") ++# set(CPACK_SOURCE_GENERATOR "ZIP") ++# set(CPACK_GENERATOR "ZIP") ++# include(CPack) + + install(EXPORT PDFHummusTargets + FILE PDFHummusTargets.cmake +@@ -196,4 +196,4 @@ install(FILES + export(EXPORT PDFHummusTargets + FILE "${CMAKE_CURRENT_BINARY_DIR}/PDFHummusTargets.cmake" + NAMESPACE PDFHummus:: +-) +\ No newline at end of file ++) diff --git a/recipes/pdf-writer/all/test_package/CMakeLists.txt b/recipes/pdf-writer/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..079a134d31c95f --- /dev/null +++ b/recipes/pdf-writer/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(PDFHummus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PDFHummus::PDFWriter) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/pdf-writer/all/test_package/conanfile.py b/recipes/pdf-writer/all/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/pdf-writer/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pdf-writer/all/test_package/test_package.cpp b/recipes/pdf-writer/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..aa251ff45f3855 --- /dev/null +++ b/recipes/pdf-writer/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include "PDFWriter/PDFWriter.h" + +int main(void) { + PDFWriter pdfWriter; + + auto status = pdfWriter.StartPDF( + "test_package.pdf", + ePDFVersion13, + LogConfiguration(true, true, "AppendPagesTestLog.txt") + ); + + if (status != PDFHummus::eSuccess) { + std::cerr << "failed to create pdf" << std::endl; + return 1; + } + + status = pdfWriter.EndPDF(); + + if (status != PDFHummus::eSuccess) { + std::cerr << "failed to close pdf" << std::endl; + return 1; + } + + return 0; +} diff --git a/recipes/pdf-writer/config.yml b/recipes/pdf-writer/config.yml new file mode 100644 index 00000000000000..a4aeb1f1b89b41 --- /dev/null +++ b/recipes/pdf-writer/config.yml @@ -0,0 +1,5 @@ +versions: + "4.6.1": + folder: all + "4.5.12": + 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..7a5488384bc9eb 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("freetype/2.13.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/pdqsort/all/conanfile.py b/recipes/pdqsort/all/conanfile.py index c6b4987b3d5ef9..0a1df56b8a3d7b 100644 --- a/recipes/pdqsort/all/conanfile.py +++ b/recipes/pdqsort/all/conanfile.py @@ -13,18 +13,18 @@ class PdqsortConan(ConanFile): topics = ("pdqsort", "sort") homepage = "https://github.com/orlp/pdqsort" url = "https://github.com/conan-io/conan-center-index" + 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 @@ -35,6 +35,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/pdqsort/all/test_package/conanfile.py b/recipes/pdqsort/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/pdqsort/all/test_package/conanfile.py +++ b/recipes/pdqsort/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/pdqsort/all/test_v1_package/CMakeLists.txt b/recipes/pdqsort/all/test_v1_package/CMakeLists.txt index 400c3982bde1ab..b21cc49efde95c 100644 --- a/recipes/pdqsort/all/test_v1_package/CMakeLists.txt +++ b/recipes/pdqsort/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(pdqsort REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE pdqsort::pdqsort) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/perf/all/conandata.yml b/recipes/perf/all/conandata.yml index 72be9d8648e782..7cffe456681aec 100644 --- a/recipes/perf/all/conandata.yml +++ b/recipes/perf/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "5.13": - patch_file: patches/0001-Wno-strict-prototypes.patch - base_path: source_subfolder diff --git a/recipes/perf/all/conanfile.py b/recipes/perf/all/conanfile.py index 2b1346904f2b52..cfea4cd9b1a61c 100644 --- a/recipes/perf/all/conanfile.py +++ b/recipes/perf/all/conanfile.py @@ -1,51 +1,74 @@ -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.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.47.0" + class Perf(ConanFile): name = "perf" description = "Linux profiling with performance counters" - topics = ("linux", "profiling") + license = "GPL-2.0 WITH Linux-syscall-note" url = "https://github.com/conan-io/conan-center-index" homepage = "https://perf.wiki.kernel.org/index.php" - license = "GPL-2.0 WITH Linux-syscall-note" - settings = "os", "compiler", "build_type", "arch" - exports_sources = "patches/*" + topics = ("linux", "profiling") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler def validate(self): - if self.settings.os != "Linux": + if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration("perf is supported only on Linux") def build_requirements(self): - self.build_requires("flex/2.6.4") - self.build_requires("bison/3.5.3") + self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") 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 = AutotoolsToolchain(self) + tc.make_args += ["NO_LIBPYTHON=1"] + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - autotools = AutoToolsBuildEnvironment(self) - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder, "tools", "perf")): - vars=autotools.vars - vars["NO_LIBPYTHON"] = "1" - autotools.make(vars=vars) + apply_conandata_patches(self) + autotools = Autotools(self) + with chdir(self, os.path.join(self.source_folder, "tools", "perf")): + autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - self.copy("LICENSES/**", src=self._source_subfolder, dst="licenses") - - self.copy("perf", src=os.path.join(self._source_subfolder, "tools", "perf"), dst="bin") + copy(self, "COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSES/**", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, "perf", + src=os.path.join(self.source_folder, "tools", "perf"), + dst=os.path.join(self.package_folder, "bin")) def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + # TODO: remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: %s" % bin_path) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/perf/all/test_package/conanfile.py b/recipes/perf/all/test_package/conanfile.py index 4001f8991b6768..451dee24987b03 100644 --- a/recipes/perf/all/test_package/conanfile.py +++ b/recipes/perf/all/test_package/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile, tools +from conan import ConanFile -class TestPackage(ConanFile): +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): - if not tools.cross_building(self): - self.run("perf version") + self.run("perf version") diff --git a/recipes/perf/all/test_v1_package/conanfile.py b/recipes/perf/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..4001f8991b6768 --- /dev/null +++ b/recipes/perf/all/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackage(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("perf version") diff --git a/recipes/perfetto/all/conandata.yml b/recipes/perfetto/all/conandata.yml index 9a9ac089dcd8fe..d490b5c402d8e2 100644 --- a/recipes/perfetto/all/conandata.yml +++ b/recipes/perfetto/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "40.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v40.0.tar.gz" + sha256: "bd78f0165e66026c31c8c39221ed2863697a8bba5cd39b12e4b43d0b7f71626f" + "39.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v39.0.tar.gz" + sha256: "241cbaddc9ff4e5d1de2d28497fef40b5510e9ca60808815bf4944d0d2f026db" + "38.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v38.0.tar.gz" + sha256: "92160b0fbeb8c4992cc0690d832dd923cee1dda466f3364ef4ed26a835e55e40" + "37.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v37.0.tar.gz" + sha256: "39d7b3635834398828cfd189bd61afb0657ca2a3a08efbfd9866bfbcd440810b" "35.0": url: "https://github.com/google/perfetto/archive/refs/tags/v35.0.tar.gz" sha256: "224b6552e60ad0fc7c1447bdf719ddd9ceceaf2b6773b71541c21df5890f4166" @@ -23,27 +35,6 @@ sources: "26.1": url: "https://github.com/google/perfetto/archive/refs/tags/v26.1.tar.gz" sha256: "cce387e82e2a137fce2eba927f80f20407764b77637a1a92b9b24065a500ce6d" - "25.0": - url: "https://github.com/google/perfetto/archive/refs/tags/v25.0.tar.gz" - sha256: "73a4b895df9222ddb231b8d903099d6da08cd079f27983f540e89156fa88ba67" - "24.2": - url: "https://github.com/google/perfetto/archive/refs/tags/v24.2.tar.gz" - sha256: "b296d0a939e694fd2e73ed6c6418b774b5ef6809ddf60988989416e5cbf90b41" - "23.0": - url: "https://github.com/google/perfetto/archive/refs/tags/v23.0.tar.gz" - sha256: "9d2955736ce9d234e0f5153acfefea8facfa762c9167024902ea98f9010207aa" - "22.1": - url: "https://github.com/google/perfetto/archive/refs/tags/v22.1.tar.gz" - sha256: "013ba743019a1ca04627f7ce8bf424b60ed7f0f57e232eff719ae879be4c90fd" - "22.0": - url: "https://github.com/google/perfetto/archive/refs/tags/v22.0.tar.gz" - sha256: "c62e9059a566136665b0c69e1f9901fc747b1eca813cd59a76e941bc2772340c" - "21.0": - url: "https://github.com/google/perfetto/archive/refs/tags/v21.0.tar.gz" - sha256: "8ce7d7c3dd8a2edd6d37092eb139e11bbf9c7e33a9964bab96c0505def6e1ad4" - "20.1": - url: "https://github.com/google/perfetto/archive/refs/tags/v20.1.tar.gz" - sha256: "d681bb76e2b73e6ba46db53c1502f31f4f16c36cd6e91d4ae839a3b44272f646" patches: "31.0": - patch_file: "patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch" @@ -51,13 +42,3 @@ patches: patch_type: "backport" patch_source: "https://android-review.googlesource.com/c/platform/external/perfetto/+/2355222" sha256: "ad253a9bba3941bd8d1f206422d60eb1c06cb6d75d60eff5b5b8ae0f2ec7e15c" - "25.0": - - patch_file: "patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch" - "22.1": - - patch_file: "patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch" - "22.0": - - patch_file: "patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch" - "21.0": - - patch_file: "patches/v21.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch" - "20.1": - - patch_file: "patches/v20.1/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch" diff --git a/recipes/perfetto/all/conanfile.py b/recipes/perfetto/all/conanfile.py index 44d0edf055cd6e..6c9cecd7c62eff 100644 --- a/recipes/perfetto/all/conanfile.py +++ b/recipes/perfetto/all/conanfile.py @@ -12,11 +12,12 @@ class PerfettoConan(ConanFile): name = "perfetto" + description = "Performance instrumentation and tracing for Android, Linux and Chrome" license = "Apache-2.0" - homepage = "https://perfetto.dev" url = "https://github.com/conan-io/conan-center-index" - description = "Performance instrumentation and tracing for Android, Linux and Chrome" + homepage = "https://perfetto.dev" topics = ("linux", "profiling", "tracing") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -28,7 +29,6 @@ class PerfettoConan(ConanFile): "fPIC": True, "disable_logging": False, } - short_paths = True @property @@ -78,8 +78,7 @@ def loose_lt_semver(v1, v2): ) 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) @@ -107,4 +106,3 @@ def package_info(self): self.cpp_info.system_libs.append("ws2_32") if is_msvc(self): self.cpp_info.cxxflags.append("/Zc:__cplusplus") - diff --git a/recipes/perfetto/all/patches/v20.1/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch b/recipes/perfetto/all/patches/v20.1/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch deleted file mode 100644 index 27f4b089cd4fdc..00000000000000 --- a/recipes/perfetto/all/patches/v20.1/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/sdk/perfetto.h b/sdk/perfetto.h -index a362342d0..d5fb9e997 100644 ---- a/sdk/perfetto.h -+++ b/sdk/perfetto.h -@@ -580,7 +580,8 @@ PERFETTO_EXPORT void LogMessage(LogLev, - __LINE__, ##__VA_ARGS__); \ - } while (0) - #elif defined(PERFETTO_DISABLE_LOG) --#define PERFETTO_XLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__) -+#define PERFETTO_XLOG(level, fmt, ...) ::perfetto::base::ignore_result(level, \ -+ fmt, ##__VA_ARGS__) - #else - #define PERFETTO_XLOG(level, fmt, ...) \ - ::perfetto::base::LogMessage(level, ::perfetto::base::Basename(__FILE__), \ diff --git a/recipes/perfetto/all/patches/v21.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch b/recipes/perfetto/all/patches/v21.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch deleted file mode 100644 index 56e86bb66c9e9b..00000000000000 --- a/recipes/perfetto/all/patches/v21.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/sdk/perfetto.h b/sdk/perfetto.h -index 4509cbda5..7cd41d570 100644 ---- a/sdk/perfetto.h -+++ b/sdk/perfetto.h -@@ -622,7 +622,8 @@ inline void MaybeSerializeLastLogsForCrashReporting() {} - __LINE__, ##__VA_ARGS__); \ - } while (0) - #elif defined(PERFETTO_DISABLE_LOG) --#define PERFETTO_XLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__) -+#define PERFETTO_XLOG(level, fmt, ...) ::perfetto::base::ignore_result(level, \ -+ fmt, ##__VA_ARGS__) - #else - #define PERFETTO_XLOG(level, fmt, ...) \ - ::perfetto::base::LogMessage(level, ::perfetto::base::Basename(__FILE__), \ diff --git a/recipes/perfetto/all/patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch b/recipes/perfetto/all/patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch deleted file mode 100644 index 5e4004e7ada011..00000000000000 --- a/recipes/perfetto/all/patches/v22.x/0001-Fix-perfetto-logging-when-PERFETTO_DISABLE_LOG-activ.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/sdk/perfetto.h b/sdk/perfetto.h -index f88ac9728..a242b37a4 100644 ---- a/sdk/perfetto.h -+++ b/sdk/perfetto.h -@@ -623,7 +623,8 @@ inline void MaybeSerializeLastLogsForCrashReporting() {} - __LINE__, ##__VA_ARGS__); \ - } while (0) - #elif defined(PERFETTO_DISABLE_LOG) --#define PERFETTO_XLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__) -+#define PERFETTO_XLOG(level, fmt, ...) ::perfetto::base::ignore_result(level, \ -+ fmt, ##__VA_ARGS__) - #else - #define PERFETTO_XLOG(level, fmt, ...) \ - ::perfetto::base::LogMessage(level, ::perfetto::base::Basename(__FILE__), \ diff --git a/recipes/perfetto/all/patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch b/recipes/perfetto/all/patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch deleted file mode 100644 index d109447e2946e7..00000000000000 --- a/recipes/perfetto/all/patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/sdk/perfetto.h b/sdk/perfetto.h -index 677e0e2..df0de12 100644 ---- a/sdk/perfetto.h -+++ b/sdk/perfetto.h -@@ -16140,7 +16140,7 @@ template <> - struct TraceTimestampTraits { - static inline TraceTimestamp ConvertTimestampToTraceTimeNs( - const uint64_t& timestamp) { -- return {internal::TrackEventInternal::GetClockId(), timestamp}; -+ return {static_cast(internal::TrackEventInternal::GetClockId()), timestamp}; - } - }; - diff --git a/recipes/perfetto/config.yml b/recipes/perfetto/config.yml index bd944a09e558ee..52841e460eedc7 100644 --- a/recipes/perfetto/config.yml +++ b/recipes/perfetto/config.yml @@ -1,4 +1,12 @@ versions: + "40.0": + folder: all + "39.0": + folder: all + "38.0": + folder: all + "37.0": + folder: all "35.0": folder: all "34.0": @@ -15,17 +23,3 @@ versions: folder: all "26.1": folder: all - "25.0": - folder: all - "24.2": - folder: all - "23.0": - folder: all - "22.1": - folder: all - "22.0": - folder: all - "21.0": - folder: all - "20.1": - folder: all diff --git a/recipes/pexports/all/conandata.yml b/recipes/pexports/all/conandata.yml index 5b08eb793f8dc1..17b38bf1e163f9 100644 --- a/recipes/pexports/all/conandata.yml +++ b/recipes/pexports/all/conandata.yml @@ -5,8 +5,5 @@ sources: patches: "0.47": - patch_file: "patches/0001-add-help.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-fix-MSVC-stack-overflow.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-fix-MSVC-x86.patch" - base_path: "source_subfolder" diff --git a/recipes/pexports/all/conanfile.py b/recipes/pexports/all/conanfile.py index 44edf44c3e48fb..88c3b2437f34ac 100644 --- a/recipes/pexports/all/conanfile.py +++ b/recipes/pexports/all/conanfile.py @@ -1,94 +1,110 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import contextlib 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 Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, chdir, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path, is_msvc + +required_conan_version = ">=1.52.0" class PExportsConan(ConanFile): name = "pexports" description = "pexports is a program to extract exported symbols from a PE image (executable)." - homepage = "https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/" license = "GPL-2.0-or-later" - topics = ("windows", "dll", "PE", "symbols", "import", "library") url = "https://github.com/conan-io/conan-center-index" - settings = "os", "arch", "compiler", "build_type" - - exports_sources = "patches/*" - - _autotools = None + homepage = "https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/" + topics = ("windows", "dll", "PE", "symbols", "import", "library") - @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): + 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 build_requirements(self): - self.build_requires("automake/1.16.3") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): del self.info.settings.compiler - def source(self): - filename = "pexports.tar.xz" - tools.get(**self.conan_data["sources"][self.version], filename=filename, - destination=self._source_subfolder, strip_root=True) + def validate(self): + # FIXME: Need to build with Mac M1 + if self.settings.arch in ["armv8", "armv8.3"] and cross_building(self): + raise ConanInvalidConfiguration(f"Conan recipe {self.ref} does not support armv8. Contributions are welcome!") - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "LD": "{} link -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - } - with tools.environment_append(env): - yield + def build_requirements(self): + self.tool_requires("automake/1.16.5") + 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.25") else: - yield - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - host = build = None - if self.settings.compiler == "Visual Studio": - self._autotools.defines.append("YY_NO_UNISTD_H") - host = build = False - self._autotools.configure(configure_dir=self._source_subfolder, host=host, build=build) - return self._autotools + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + + def source(self): + filename = "pexports.tar.xz" + get(self, **self.conan_data["sources"][self.version], filename=filename, 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) + tc.configure_args.append(f"--prefix={unix_path(self, self.package_folder)}") + if is_msvc(self): + tc.extra_defines.append("YY_NO_UNISTD_H") + 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)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.vars(self).save_script("conanbuild_msvc") + + def _patch_sources(self): + apply_conandata_patches(self) + # Fix for: Invalid configuration `aarch64-apple-darwin': machine `aarch64-apple' not recognized + replace_in_file(self, os.path.join(self.source_folder, "build-aux", "config.sub"), + "avr | avr32 ", "avr | avr32 | aarch64") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) - with self._build_context(): - autotools = self._configure_autotools() + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + suffix = ".exe" if self.settings.os == "Windows" else "" + copy(self, "pexports" + suffix, src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) 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/pexports/all/test_package/CMakeLists.txt b/recipes/pexports/all/test_package/CMakeLists.txt index 7345b4f993eae0..c25a9626aeb525 100644 --- a/recipes/pexports/all/test_package/CMakeLists.txt +++ b/recipes/pexports/all/test_package/CMakeLists.txt @@ -1,13 +1,10 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) if(NOT WIN32) message(FATAL_ERROR "pexports only supports Windows") endif() -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - find_program(PEXPORTS_BIN "pexports") set(EXPORTS_DEF_PATH "${CMAKE_BINARY_DIR}/exports.def") if(MSVC) diff --git a/recipes/pexports/all/test_package/conanfile.py b/recipes/pexports/all/test_package/conanfile.py index cd2e47277e1d74..8919154c6885e4 100644 --- a/recipes/pexports/all/test_package/conanfile.py +++ b/recipes/pexports/all/test_package/conanfile.py @@ -1,11 +1,22 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException import os +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.files import load + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + 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 self.settings.os == "Windows": @@ -14,13 +25,14 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - self.run("pexports -H", run_environment=True) + if can_run(self): + self.run("pexports -H") + if self.settings.os == "Windows": - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") exports_def_path = os.path.join(self.build_folder, "exports.def") - exports_def_contents = tools.load(exports_def_path) - self.output.info("{} contents:\n{}".format(exports_def_path, exports_def_contents)) - if not "test_package_function" in exports_def_contents: + exports_def_contents = load(self, exports_def_path) + self.output.info(f"{exports_def_path} contents:\n{exports_def_contents}") + if "test_package_function" not in exports_def_contents: raise ConanException("pexport could not detect `test_package_function` in the dll") diff --git a/recipes/pexports/all/test_v1_package/CMakeLists.txt b/recipes/pexports/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/pexports/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/pexports/all/test_v1_package/conanfile.py b/recipes/pexports/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..ecb888f16f156d --- /dev/null +++ b/recipes/pexports/all/test_v1_package/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run("pexports -H", run_environment=True) + if self.settings.os == "Windows": + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + exports_def_path = os.path.join(self.build_folder, "exports.def") + exports_def_contents = tools.load(exports_def_path) + self.output.info("{} contents:\n{}".format(exports_def_path, exports_def_contents)) + if not "test_package_function" in exports_def_contents: + raise ConanException("pexport could not detect `test_package_function` in the dll") diff --git a/recipes/pfr/all/conandata.yml b/recipes/pfr/all/conandata.yml index a92db9416c3b37..ad60c0a68373e6 100644 --- a/recipes/pfr/all/conandata.yml +++ b/recipes/pfr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://github.com/boostorg/pfr/archive/refs/tags/2.2.0.tar.gz" + sha256: "6f490ec1383de5855dcf801c23f0a967f888eb6e1440b6ca0bf36c12d4ae7ac7" "2.1.0": url: "https://github.com/boostorg/pfr/archive/refs/tags/2.1.0.tar.gz" sha256: "7c18a4ab73b70f8b3513fa3a836c6f4310f627bbf55f62b89bdd7aa787c7da31" diff --git a/recipes/pfr/config.yml b/recipes/pfr/config.yml index 656874f3125928..979e702ffcb5f3 100644 --- a/recipes/pfr/config.yml +++ b/recipes/pfr/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.0": + folder: "all" "2.1.0": folder: "all" "2.0.3": diff --git a/recipes/picobench/all/conandata.yml b/recipes/picobench/all/conandata.yml index 0bbacb7273fdfd..f6484b7236c423 100644 --- a/recipes/picobench/all/conandata.yml +++ b/recipes/picobench/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.05": + url: "https://github.com/iboB/picobench/archive/v2.05.tar.gz" + sha256: "4e10c3c7042c0519662565eed8949f5eb328333d2c9a2443464dede04ce0b00d" "2.02": url: "https://github.com/iboB/picobench/archive/refs/tags/v2.02.tar.gz" sha256: "22a896535d0e2fd8793cdc6c14bef42275f8de8d24ce2cfc55442ed1e0973c83" @@ -6,6 +9,10 @@ sources: url: "https://github.com/iboB/picobench/archive/refs/tags/v2.01.tar.gz" sha256: "164cb3b2d72a9b31e7559f6829ae38b6b955840571531117e0d6f53d669d3a2b" patches: + "2.05": + - patch_file: "patches/2.02-0001-add-install.patch" + patch_description: "add installer" + patch_type: "conan" "2.02": - patch_file: "patches/2.02-0001-add-install.patch" patch_description: "add installer" diff --git a/recipes/picobench/config.yml b/recipes/picobench/config.yml index d9b367577730d1..eb0d152fc4aa23 100644 --- a/recipes/picobench/config.yml +++ b/recipes/picobench/config.yml @@ -1,4 +1,6 @@ versions: + "2.05": + folder: all "2.02": folder: all "2.01": diff --git a/recipes/pipes/all/conanfile.py b/recipes/pipes/all/conanfile.py index 70bc84cbc789fc..c2e8937d21d4a5 100644 --- a/recipes/pipes/all/conanfile.py +++ b/recipes/pipes/all/conanfile.py @@ -1,20 +1,26 @@ -from conans import ConanFile, tools -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.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + class PipesConan(ConanFile): name = "pipes" description = "Pipelines for expressive code on collections in C++" license = "MIT" - topics = ("pipes", "functional-programming") - homepage = "https://github.com/joboccara/pipes" url = "https://github.com/conan-io/conan-center-index" - settings = "compiler" - no_copy_source = True + homepage = "https://github.com/joboccara/pipes" + topics = ("functional-programming", "header-only") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _minimum_cpp_standard(self): @@ -31,23 +37,30 @@ def _minimum_compilers_version(self): def configure(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._minimum_cpp_standard) min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) if not min_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) + self.output.warning(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") else: - if tools.Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( - self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler" + f" {self.settings.compiler} {self.settings.compiler.version} does not support it." + ) + + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() - + self.info.clear() + def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("pipes-{}".format(self.version), self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include"), keep_path=True) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"), keep_path=True) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/pipes/all/test_package/CMakeLists.txt b/recipes/pipes/all/test_package/CMakeLists.txt index f24c18a1bb2e16..39ba4f454e712f 100644 --- a/recipes/pipes/all/test_package/CMakeLists.txt +++ b/recipes/pipes/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(pipes REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/pipes/all/test_package/conanfile.py b/recipes/pipes/all/test_package/conanfile.py index 910ae60d104386..ef5d7042163ecc 100644 --- a/recipes/pipes/all/test_package/conanfile.py +++ b/recipes/pipes/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,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/pipes/all/test_package/test_package.cpp b/recipes/pipes/all/test_package/test_package.cpp index 5279bc00ec63cc..2050756e502b31 100644 --- a/recipes/pipes/all/test_package/test_package.cpp +++ b/recipes/pipes/all/test_package/test_package.cpp @@ -1,6 +1,10 @@ -#include +// Workaround for pipes not finding size_t +#include + #include +#include + int main() { auto source = std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; auto destination = std::vector{}; diff --git a/recipes/pixman/all/conandata.yml b/recipes/pixman/all/conandata.yml index 1f4279689a6c33..4a6a13bbe99c7c 100644 --- a/recipes/pixman/all/conandata.yml +++ b/recipes/pixman/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.42.2": + url: "https://www.cairographics.org/releases/pixman-0.42.2.tar.gz" + sha256: "ea1480efada2fd948bc75366f7c349e1c96d3297d09a3fe62626e38e234a625e" "0.40.0": url: "https://www.cairographics.org/releases/pixman-0.40.0.tar.gz" sha256: "6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc" @@ -6,6 +9,11 @@ sources: url: "https://www.cairographics.org/releases/pixman-0.38.4.tar.gz" sha256: "da66d6fd6e40aee70f7bd02e4f8f76fc3f006ec879d346bae6a723025cfbdde7" patches: + "0.42.2": + - patch_file: "patches/0.42.2-0001-pixman-arma64-Adjustments-to-build-with-llvm-integra.patch" + patch_description: "Adjustments to build for arm64 with LLVM's assembler" + patch_type: "portability" + patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/71" "0.40.0": - patch_file: "patches/0001-incompatible-pointer-types.patch" patch_description: "backport fix for clang build" diff --git a/recipes/pixman/all/conanfile.py b/recipes/pixman/all/conanfile.py index a5d1aeafc9a5da..aca2fe9a7ec266 100644 --- a/recipes/pixman/all/conanfile.py +++ b/recipes/pixman/all/conanfile.py @@ -20,7 +20,7 @@ class PixmanConan(ConanFile): description = "Pixman is a low-level software library for pixel manipulation" topics = ("graphics", "compositing", "rasterization") url = "https://github.com/conan-io/conan-center-index" - homepage = "https://cairographics.org/" + homepage = "https://gitlab.freedesktop.org/pixman/pixman" license = ("LGPL-2.1-only", "MPL-1.1") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -54,7 +54,7 @@ def validate(self): raise ConanInvalidConfiguration("pixman can only be built as a static library on Windows") def build_requirements(self): - self.tool_requires("meson/1.1.1") + self.tool_requires("meson/1.2.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/pixman/all/patches/0.42.2-0001-pixman-arma64-Adjustments-to-build-with-llvm-integra.patch b/recipes/pixman/all/patches/0.42.2-0001-pixman-arma64-Adjustments-to-build-with-llvm-integra.patch new file mode 100644 index 00000000000000..4507dc378d06c2 --- /dev/null +++ b/recipes/pixman/all/patches/0.42.2-0001-pixman-arma64-Adjustments-to-build-with-llvm-integra.patch @@ -0,0 +1,3290 @@ +From 58a85103ccaa90e217b081149d0a90837d791b14 Mon Sep 17 00:00:00 2001 +From: Heiko Lewin +Date: Tue, 18 Jul 2023 07:19:34 +0200 +Subject: [PATCH] pixman-arma64: Adjustments to build with llvm integrated + assembler + +This enables building the aarch64 assembly with clang. +Changes: +1. Use `.func` or `.endfunc` only if available +2. Prefix macro arg names with `\` +3. Use `\()` instead of `&` +4. Always use commas to separate macro arguments +5. Prefix asm symbols with an undderscore if necessary +--- + meson.build | 28 + + pixman/pixman-arm-asm.h | 32 +- + pixman/pixman-arma64-neon-asm-bilinear.S | 421 ++++++------- + pixman/pixman-arma64-neon-asm.S | 720 +++++++++++------------ + pixman/pixman-arma64-neon-asm.h | 684 ++++++++++----------- + test/utils.h | 2 +- + 6 files changed, 968 insertions(+), 919 deletions(-) + +diff --git a/meson.build b/meson.build +index 15bd4df..e05d73d 100644 +--- a/meson.build ++++ b/meson.build +@@ -243,6 +243,34 @@ if not use_vmx.disabled() + endif + endif + ++if cc.compiles(''' ++ __asm__ ( ++ ".func meson_test" ++ ".endfunc" ++ );''', ++ name : 'test for ASM .func directive') ++ config.set('ASM_HAVE_FUNC_DIRECTIVE', 1) ++endif ++ ++ ++if cc.links(''' ++ #include ++ ++ __asm__ ( ++ " .global _testlabel\n" ++ "_testlabel:\n" ++ ); ++ ++ int testlabel(); ++ int main(int argc, char* argv[]) { ++ return testlabel(); ++ }''', ++ name : 'test for ASM leading underscore') ++ config.set('ASM_LEADING_UNDERSCORE', 1) ++endif ++ ++ ++ + if have_vmx + config.set10('USE_VMX', true) + elif use_vmx.enabled() +diff --git a/pixman/pixman-arm-asm.h b/pixman/pixman-arm-asm.h +index ee78541..8253906 100644 +--- a/pixman/pixman-arm-asm.h ++++ b/pixman/pixman-arm-asm.h +@@ -25,13 +25,33 @@ + * + */ + ++ ++#include "config.h" ++ ++ + /* Supplementary macro for setting function attributes */ +-.macro pixman_asm_function fname +- .func fname +- .global fname ++.macro pixman_asm_function_impl fname ++#ifdef ASM_HAVE_FUNC_DIRECTIVE ++ .func \fname ++#endif ++ .global \fname + #ifdef __ELF__ +- .hidden fname +- .type fname, %function ++ .hidden \fname ++ .type \fname, %function ++#endif ++\fname: ++.endm ++ ++.macro pixman_asm_function fname ++#ifdef ASM_LEADING_UNDERSCORE ++ pixman_asm_function_impl _\fname ++#else ++ pixman_asm_function_impl \fname ++#endif ++.endm ++ ++.macro pixman_end_asm_function ++#ifdef ASM_HAVE_FUNC_DIRECTIVE ++ .endfunc + #endif +-fname: + .endm +diff --git a/pixman/pixman-arma64-neon-asm-bilinear.S b/pixman/pixman-arma64-neon-asm-bilinear.S +index 31d103d..7303bdc 100644 +--- a/pixman/pixman-arma64-neon-asm-bilinear.S ++++ b/pixman/pixman-arma64-neon-asm-bilinear.S +@@ -77,50 +77,50 @@ + asr WTMP1, X, #16 + add X, X, UX + add TMP1, TOP, TMP1, lsl #2 +- ld1 {®1&.2s}, [TMP1], STRIDE +- ld1 {®2&.2s}, [TMP1] ++ ld1 {\()\reg1\().2s}, [TMP1], STRIDE ++ ld1 {\()\reg2\().2s}, [TMP1] + .endm + + .macro bilinear_load_0565 reg1, reg2, tmp + asr WTMP1, X, #16 + add X, X, UX + add TMP1, TOP, TMP1, lsl #1 +- ld1 {®2&.s}[0], [TMP1], STRIDE +- ld1 {®2&.s}[1], [TMP1] +- convert_four_0565_to_x888_packed reg2, reg1, reg2, tmp ++ ld1 {\()\reg2\().s}[0], [TMP1], STRIDE ++ ld1 {\()\reg2\().s}[1], [TMP1] ++ convert_four_0565_to_x888_packed \reg2, \reg1, \reg2, \tmp + .endm + + .macro bilinear_load_and_vertical_interpolate_two_8888 \ + acc1, acc2, reg1, reg2, reg3, reg4, tmp1, tmp2 + +- bilinear_load_8888 reg1, reg2, tmp1 +- umull &acc1&.8h, ®1&.8b, v28.8b +- umlal &acc1&.8h, ®2&.8b, v29.8b +- bilinear_load_8888 reg3, reg4, tmp2 +- umull &acc2&.8h, ®3&.8b, v28.8b +- umlal &acc2&.8h, ®4&.8b, v29.8b ++ bilinear_load_8888 \reg1, \reg2, \tmp1 ++ umull \()\acc1\().8h, \()\reg1\().8b, v28.8b ++ umlal \()\acc1\().8h, \()\reg2\().8b, v29.8b ++ bilinear_load_8888 \reg3, \reg4, \tmp2 ++ umull \()\acc2\().8h, \()\reg3\().8b, v28.8b ++ umlal \()\acc2\().8h, \()\reg4\().8b, v29.8b + .endm + + .macro bilinear_load_and_vertical_interpolate_four_8888 \ +- xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi \ ++ xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi, \ + yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi + + bilinear_load_and_vertical_interpolate_two_8888 \ +- xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi ++ \xacc1, \xacc2, \xreg1, \xreg2, \xreg3, \xreg4, \xacc2lo, xacc2hi + bilinear_load_and_vertical_interpolate_two_8888 \ +- yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi ++ \yacc1, \yacc2, \yreg1, \yreg2, \yreg3, \yreg4, \yacc2lo, \yacc2hi + .endm + + .macro vzip reg1, reg2 +- zip1 v24.8b, reg1, reg2 +- zip2 reg2, reg1, reg2 +- mov reg1, v24.8b ++ zip1 v24.8b, \reg1, \reg2 ++ zip2 \reg2, \reg1, \reg2 ++ mov \reg1, v24.8b + .endm + + .macro vuzp reg1, reg2 +- uzp1 v24.8b, reg1, reg2 +- uzp2 reg2, reg1, reg2 +- mov reg1, v24.8b ++ uzp1 v24.8b, \reg1, \reg2 ++ uzp2 \reg2, \reg1, \reg2 ++ mov \reg1, v24.8b + .endm + + .macro bilinear_load_and_vertical_interpolate_two_0565 \ +@@ -131,23 +131,23 @@ + asr WTMP2, X, #16 + add X, X, UX + add TMP2, TOP, TMP2, lsl #1 +- ld1 {&acc2&.s}[0], [TMP1], STRIDE +- ld1 {&acc2&.s}[2], [TMP2], STRIDE +- ld1 {&acc2&.s}[1], [TMP1] +- ld1 {&acc2&.s}[3], [TMP2] +- convert_0565_to_x888 acc2, reg3, reg2, reg1 +- vzip ®1&.8b, ®3&.8b +- vzip ®2&.8b, ®4&.8b +- vzip ®3&.8b, ®4&.8b +- vzip ®1&.8b, ®2&.8b +- umull &acc1&.8h, ®1&.8b, v28.8b +- umlal &acc1&.8h, ®2&.8b, v29.8b +- umull &acc2&.8h, ®3&.8b, v28.8b +- umlal &acc2&.8h, ®4&.8b, v29.8b ++ ld1 {\()\acc2\().s}[0], [TMP1], STRIDE ++ ld1 {\()\acc2\().s}[2], [TMP2], STRIDE ++ ld1 {\()\acc2\().s}[1], [TMP1] ++ ld1 {\()\acc2\().s}[3], [TMP2] ++ convert_0565_to_x888 \acc2, \reg3, \reg2, \reg1 ++ vzip \()\reg1\().8b, \()\reg3\().8b ++ vzip \()\reg2\().8b, \()\reg4\().8b ++ vzip \()\reg3\().8b, \()\reg4\().8b ++ vzip \()\reg1\().8b, \()\reg2\().8b ++ umull \()\acc1\().8h, \()\reg1\().8b, v28.8b ++ umlal \()\acc1\().8h, \()\reg2\().8b, v29.8b ++ umull \()\acc2\().8h, \()\reg3\().8b, v28.8b ++ umlal \()\acc2\().8h, \()\reg4\().8b, v29.8b + .endm + + .macro bilinear_load_and_vertical_interpolate_four_0565 \ +- xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi \ ++ xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi, \ + yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi + + asr WTMP1, X, #16 +@@ -156,49 +156,49 @@ + asr WTMP2, X, #16 + add X, X, UX + add TMP2, TOP, TMP2, lsl #1 +- ld1 {&xacc2&.s}[0], [TMP1], STRIDE +- ld1 {&xacc2&.s}[2], [TMP2], STRIDE +- ld1 {&xacc2&.s}[1], [TMP1] +- ld1 {&xacc2&.s}[3], [TMP2] +- convert_0565_to_x888 xacc2, xreg3, xreg2, xreg1 ++ ld1 {\()\xacc2\().s}[0], [TMP1], STRIDE ++ ld1 {\()\xacc2\().s}[2], [TMP2], STRIDE ++ ld1 {\()\xacc2\().s}[1], [TMP1] ++ ld1 {\()\xacc2\().s}[3], [TMP2] ++ convert_0565_to_x888 \xacc2, \xreg3, \xreg2, \xreg1 + asr WTMP1, X, #16 + add X, X, UX + add TMP1, TOP, TMP1, lsl #1 + asr WTMP2, X, #16 + add X, X, UX + add TMP2, TOP, TMP2, lsl #1 +- ld1 {&yacc2&.s}[0], [TMP1], STRIDE +- vzip &xreg1&.8b, &xreg3&.8b +- ld1 {&yacc2&.s}[2], [TMP2], STRIDE +- vzip &xreg2&.8b, &xreg4&.8b +- ld1 {&yacc2&.s}[1], [TMP1] +- vzip &xreg3&.8b, &xreg4&.8b +- ld1 {&yacc2&.s}[3], [TMP2] +- vzip &xreg1&.8b, &xreg2&.8b +- convert_0565_to_x888 yacc2, yreg3, yreg2, yreg1 +- umull &xacc1&.8h, &xreg1&.8b, v28.8b +- vzip &yreg1&.8b, &yreg3&.8b +- umlal &xacc1&.8h, &xreg2&.8b, v29.8b +- vzip &yreg2&.8b, &yreg4&.8b +- umull &xacc2&.8h, &xreg3&.8b, v28.8b +- vzip &yreg3&.8b, &yreg4&.8b +- umlal &xacc2&.8h, &xreg4&.8b, v29.8b +- vzip &yreg1&.8b, &yreg2&.8b +- umull &yacc1&.8h, &yreg1&.8b, v28.8b +- umlal &yacc1&.8h, &yreg2&.8b, v29.8b +- umull &yacc2&.8h, &yreg3&.8b, v28.8b +- umlal &yacc2&.8h, &yreg4&.8b, v29.8b ++ ld1 {\()\yacc2\().s}[0], [TMP1], STRIDE ++ vzip \()\xreg1\().8b, \()\xreg3\().8b ++ ld1 {\()\yacc2\().s}[2], [TMP2], STRIDE ++ vzip \()\xreg2\().8b, \()\xreg4\().8b ++ ld1 {\()\yacc2\().s}[1], [TMP1] ++ vzip \()\xreg3\().8b, \()\xreg4\().8b ++ ld1 {\()\yacc2\().s}[3], [TMP2] ++ vzip \()\xreg1\().8b, \()\xreg2\().8b ++ convert_0565_to_x888 \yacc2, \yreg3, \yreg2, \yreg1 ++ umull \()\xacc1\().8h, \()\xreg1\().8b, v28.8b ++ vzip \()\yreg1\().8b, \()\yreg3\().8b ++ umlal \()\xacc1\().8h, \()\xreg2\().8b, v29.8b ++ vzip \()\yreg2\().8b, \()\yreg4\().8b ++ umull \()\xacc2\().8h, \()\xreg3\().8b, v28.8b ++ vzip \()\yreg3\().8b, \()\yreg4\().8b ++ umlal \()\xacc2\().8h, \()\xreg4\().8b, v29.8b ++ vzip \()\yreg1\().8b, \()\yreg2\().8b ++ umull \()\yacc1\().8h, \()\yreg1\().8b, v28.8b ++ umlal \()\yacc1\().8h, \()\yreg2\().8b, v29.8b ++ umull \()\yacc2\().8h, \()\yreg3\().8b, v28.8b ++ umlal \()\yacc2\().8h, \()\yreg4\().8b, v29.8b + .endm + + .macro bilinear_store_8888 numpix, tmp1, tmp2 +-.if numpix == 4 ++.if \numpix == 4 + st1 {v0.2s, v1.2s}, [OUT], #16 +-.elseif numpix == 2 ++.elseif \numpix == 2 + st1 {v0.2s}, [OUT], #8 +-.elseif numpix == 1 ++.elseif \numpix == 1 + st1 {v0.s}[0], [OUT], #4 + .else +- .error bilinear_store_8888 numpix is unsupported ++ .error bilinear_store_8888 \numpix is unsupported + .endif + .endm + +@@ -207,15 +207,15 @@ + vuzp v2.8b, v3.8b + vuzp v1.8b, v3.8b + vuzp v0.8b, v2.8b +- convert_8888_to_0565 v2, v1, v0, v1, tmp1, tmp2 +-.if numpix == 4 ++ convert_8888_to_0565 v2, v1, v0, v1, \tmp1, \tmp2 ++.if \numpix == 4 + st1 {v1.4h}, [OUT], #8 +-.elseif numpix == 2 ++.elseif \numpix == 2 + st1 {v1.s}[0], [OUT], #4 +-.elseif numpix == 1 ++.elseif \numpix == 1 + st1 {v1.h}[0], [OUT], #2 + .else +- .error bilinear_store_0565 numpix is unsupported ++ .error bilinear_store_0565 \numpix is unsupported + .endif + .endm + +@@ -228,20 +228,20 @@ + .endm + + .macro bilinear_load_mask_8 numpix, mask +-.if numpix == 4 +- ld1 {&mask&.s}[0], [MASK], #4 +-.elseif numpix == 2 +- ld1 {&mask&.h}[0], [MASK], #2 +-.elseif numpix == 1 +- ld1 {&mask&.b}[0], [MASK], #1 ++.if \numpix == 4 ++ ld1 {\()\mask\().s}[0], [MASK], #4 ++.elseif \numpix == 2 ++ ld1 {\()\mask\().h}[0], [MASK], #2 ++.elseif \numpix == 1 ++ ld1 {\()\mask\().b}[0], [MASK], #1 + .else +- .error bilinear_load_mask_8 numpix is unsupported ++ .error bilinear_load_mask_8 \numpix is unsupported + .endif +- prfm PREFETCH_MODE, [MASK, #prefetch_offset] ++ prfum PREFETCH_MODE, [MASK, #(prefetch_offset)] + .endm + + .macro bilinear_load_mask mask_fmt, numpix, mask +- bilinear_load_mask_&mask_fmt numpix, mask ++ bilinear_load_mask_\mask_fmt \numpix, \mask + .endm + + +@@ -256,30 +256,30 @@ + .endm + + .macro bilinear_load_dst_8888 numpix, dst0, dst1, dst01 +-.if numpix == 4 +- ld1 {&dst0&.2s, &dst1&.2s}, [OUT] +-.elseif numpix == 2 +- ld1 {&dst0&.2s}, [OUT] +-.elseif numpix == 1 +- ld1 {&dst0&.s}[0], [OUT] ++.if \numpix == 4 ++ ld1 {\()\dst0\().2s, \()\dst1\().2s}, [OUT] ++.elseif \numpix == 2 ++ ld1 {\()\dst0\().2s}, [OUT] ++.elseif \numpix == 1 ++ ld1 {\()\dst0\().s}[0], [OUT] + .else +- .error bilinear_load_dst_8888 numpix is unsupported ++ .error bilinear_load_dst_8888 \numpix is unsupported + .endif +- mov &dst01&.d[0], &dst0&.d[0] +- mov &dst01&.d[1], &dst1&.d[0] ++ mov \()\dst01\().d[0], \()\dst0\().d[0] ++ mov \()\dst01\().d[1], \()\dst1\().d[0] + prfm PREFETCH_MODE, [OUT, #(prefetch_offset * 4)] + .endm + + .macro bilinear_load_dst_8888_over numpix, dst0, dst1, dst01 +- bilinear_load_dst_8888 numpix, dst0, dst1, dst01 ++ bilinear_load_dst_8888 \numpix, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_load_dst_8888_add numpix, dst0, dst1, dst01 +- bilinear_load_dst_8888 numpix, dst0, dst1, dst01 ++ bilinear_load_dst_8888 \numpix, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_load_dst dst_fmt, op, numpix, dst0, dst1, dst01 +- bilinear_load_dst_&dst_fmt&_&op numpix, dst0, dst1, dst01 ++ bilinear_load_dst_\()\dst_fmt\()_\()\op \numpix, \dst0, \dst1, \dst01 + .endm + + /* +@@ -298,19 +298,19 @@ + .endm + + .macro bilinear_duplicate_mask_8 numpix, mask +-.if numpix == 4 +- dup &mask&.2s, &mask&.s[0] +-.elseif numpix == 2 +- dup &mask&.4h, &mask&.h[0] +-.elseif numpix == 1 +- dup &mask&.8b, &mask&.b[0] ++.if \numpix == 4 ++ dup \()\mask\().2s, \()\mask\().s[0] ++.elseif \numpix == 2 ++ dup \()\mask\().4h, \()\mask\().h[0] ++.elseif \numpix == 1 ++ dup \()\mask\().8b, \()\mask\().b[0] + .else +- .error bilinear_duplicate_mask_8 is unsupported ++ .error bilinear_duplicate_\mask_8 is unsupported + .endif + .endm + + .macro bilinear_duplicate_mask mask_fmt, numpix, mask +- bilinear_duplicate_mask_&mask_fmt numpix, mask ++ bilinear_duplicate_mask_\()\mask_fmt \numpix, \mask + .endm + + /* +@@ -318,14 +318,14 @@ + * Interleave should be done when maks is enabled or operator is 'over'. + */ + .macro bilinear_interleave src0, src1, src01, dst0, dst1, dst01 +- vuzp &src0&.8b, &src1&.8b +- vuzp &dst0&.8b, &dst1&.8b +- vuzp &src0&.8b, &src1&.8b +- vuzp &dst0&.8b, &dst1&.8b +- mov &src01&.d[1], &src1&.d[0] +- mov &src01&.d[0], &src0&.d[0] +- mov &dst01&.d[1], &dst1&.d[0] +- mov &dst01&.d[0], &dst0&.d[0] ++ vuzp \()\src0\().8b, \()\src1\().8b ++ vuzp \()\dst0\().8b, \()\dst1\().8b ++ vuzp \()\src0\().8b, \()\src1\().8b ++ vuzp \()\dst0\().8b, \()\dst1\().8b ++ mov \()\src01\().d[1], \()\src1\().d[0] ++ mov \()\src01\().d[0], \()\src0\().d[0] ++ mov \()\dst01\().d[1], \()\dst1\().d[0] ++ mov \()\dst01\().d[0], \()\dst0\().d[0] + .endm + + .macro bilinear_interleave_src_dst_x_src \ +@@ -335,37 +335,38 @@ + .macro bilinear_interleave_src_dst_x_over \ + numpix, src0, src1, src01, dst0, dst1, dst01 + +- bilinear_interleave src0, src1, src01, dst0, dst1, dst01 ++ bilinear_interleave \src0, \src1, \src01, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_interleave_src_dst_x_add \ + numpix, src0, src1, src01, dst0, dst1, dst01 +- bilinear_interleave src0, src1, src01, dst0, dst1, dst01 ++ ++ bilinear_interleave \src0, \src1, \src01, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_interleave_src_dst_8_src \ + numpix, src0, src1, src01, dst0, dst1, dst01 + +- bilinear_interleave src0, src1, src01, dst0, dst1, dst01 ++ bilinear_interleave \src0, \src1, \src01, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_interleave_src_dst_8_over \ + numpix, src0, src1, src01, dst0, dst1, dst01 + +- bilinear_interleave src0, src1, src01, dst0, dst1, dst01 ++ bilinear_interleave \src0, \src1, \src01, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_interleave_src_dst_8_add \ + numpix, src0, src1, src01, dst0, dst1, dst01 + +- bilinear_interleave src0, src1, src01, dst0, dst1, dst01 ++ bilinear_interleave \src0, \src1, \src01, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_interleave_src_dst \ + mask_fmt, op, numpix, src0, src1, src01, dst0, dst1, dst01 + +- bilinear_interleave_src_dst_&mask_fmt&_&op \ +- numpix, src0, src1, src01, dst0, dst1, dst01 ++ bilinear_interleave_src_dst_\()\mask_fmt\()_\()\op \ ++ \numpix, \src0, \src1, \src01, \dst0, \dst1, \dst01 + .endm + + +@@ -383,25 +384,25 @@ + numpix, src0, src1, src01, mask, \ + tmp01, tmp23, tmp45, tmp67 + +- umull &tmp01&.8h, &src0&.8b, &mask&.8b +- umull &tmp23&.8h, &src1&.8b, &mask&.8b ++ umull \()\tmp01\().8h, \()\src0\().8b, \()\mask\().8b ++ umull \()\tmp23\().8h, \()\src1\().8b, \()\mask\().8b + /* bubbles */ +- urshr &tmp45&.8h, &tmp01&.8h, #8 +- urshr &tmp67&.8h, &tmp23&.8h, #8 ++ urshr \()\tmp45\().8h, \()\tmp01\().8h, #8 ++ urshr \()\tmp67\().8h, \()\tmp23\().8h, #8 + /* bubbles */ +- raddhn &src0&.8b, &tmp45&.8h, &tmp01&.8h +- raddhn &src1&.8b, &tmp67&.8h, &tmp23&.8h +- mov &src01&.d[0], &src0&.d[0] +- mov &src01&.d[1], &src1&.d[0] ++ raddhn \()\src0\().8b, \()\tmp45\().8h, \()\tmp01\().8h ++ raddhn \()\src1\().8b, \()\tmp67\().8h, \()\tmp23\().8h ++ mov \()\src01\().d[0], \()\src0\().d[0] ++ mov \()\src01\().d[1], \()\src1\().d[0] + .endm + + .macro bilinear_apply_mask_to_src \ + mask_fmt, numpix, src0, src1, src01, mask, \ + tmp01, tmp23, tmp45, tmp67 + +- bilinear_apply_mask_to_src_&mask_fmt \ +- numpix, src0, src1, src01, mask, \ +- tmp01, tmp23, tmp45, tmp67 ++ bilinear_apply_mask_to_src_\()\mask_fmt \ ++ \numpix, \src0, \src1, \src01, \mask, \ ++ \tmp01, \tmp23, \tmp45, \tmp67 + .endm + + +@@ -418,90 +419,90 @@ + numpix, src0, src1, src01, dst0, dst1, dst01, \ + tmp01, tmp23, tmp45, tmp67, tmp8 + +- dup &tmp8&.2s, &src1&.s[1] ++ dup \()\tmp8\().2s, \()\src1\().s[1] + /* bubbles */ +- mvn &tmp8&.8b, &tmp8&.8b ++ mvn \()\tmp8\().8b, \()\tmp8\().8b + /* bubbles */ +- umull &tmp01&.8h, &dst0&.8b, &tmp8&.8b ++ umull \()\tmp01\().8h, \()\dst0\().8b, \()\tmp8\().8b + /* bubbles */ +- umull &tmp23&.8h, &dst1&.8b, &tmp8&.8b ++ umull \()\tmp23\().8h, \()\dst1\().8b, \()\tmp8\().8b + /* bubbles */ +- urshr &tmp45&.8h, &tmp01&.8h, #8 +- urshr &tmp67&.8h, &tmp23&.8h, #8 ++ urshr \()\tmp45\().8h, \()\tmp01\().8h, #8 ++ urshr \()\tmp67\().8h, \()\tmp23\().8h, #8 + /* bubbles */ +- raddhn &dst0&.8b, &tmp45&.8h, &tmp01&.8h +- raddhn &dst1&.8b, &tmp67&.8h, &tmp23&.8h +- mov &dst01&.d[0], &dst0&.d[0] +- mov &dst01&.d[1], &dst1&.d[0] ++ raddhn \()\dst0\().8b, \()\tmp45\().8h, \()\tmp01\().8h ++ raddhn \()\dst1\().8b, \()\tmp67\().8h, \()\tmp23\().8h ++ mov \()\dst01\().d[0], \()\dst0\().d[0] ++ mov \()\dst01\().d[1], \()\dst1\().d[0] + /* bubbles */ +- uqadd &src0&.8b, &dst0&.8b, &src0&.8b +- uqadd &src1&.8b, &dst1&.8b, &src1&.8b +- mov &src01&.d[0], &src0&.d[0] +- mov &src01&.d[1], &src1&.d[0] ++ uqadd \()\src0\().8b, \()\dst0\().8b, \()\src0\().8b ++ uqadd \()\src1\().8b, \()\dst1\().8b, \()\src1\().8b ++ mov \()\src01\().d[0], \()\src0\().d[0] ++ mov \()\src01\().d[1], \()\src1\().d[0] + .endm + + .macro bilinear_combine_add \ + numpix, src0, src1, src01, dst0, dst1, dst01, \ + tmp01, tmp23, tmp45, tmp67, tmp8 + +- uqadd &src0&.8b, &dst0&.8b, &src0&.8b +- uqadd &src1&.8b, &dst1&.8b, &src1&.8b +- mov &src01&.d[0], &src0&.d[0] +- mov &src01&.d[1], &src1&.d[0] ++ uqadd \()\src0\().8b, \()\dst0\().8b, \()\src0\().8b ++ uqadd \()\src1\().8b, \()\dst1\().8b, \()\src1\().8b ++ mov \()\src01\().d[0], \()\src0\().d[0] ++ mov \()\src01\().d[1], \()\src1\().d[0] + .endm + + .macro bilinear_combine \ + op, numpix, src0, src1, src01, dst0, dst1, dst01, \ + tmp01, tmp23, tmp45, tmp67, tmp8 + +- bilinear_combine_&op \ +- numpix, src0, src1, src01, dst0, dst1, dst01, \ +- tmp01, tmp23, tmp45, tmp67, tmp8 ++ bilinear_combine_\()\op \ ++ \numpix, \src0, \src1, \src01, \dst0, \dst1, \dst01, \ ++ \tmp01, \tmp23, \tmp45, \tmp67, \tmp8 + .endm + + /* + * Macros for final deinterleaving of destination pixels if needed. + */ + .macro bilinear_deinterleave numpix, dst0, dst1, dst01 +- vuzp &dst0&.8b, &dst1&.8b ++ vuzp \()\dst0\().8b, \()\dst1\().8b + /* bubbles */ +- vuzp &dst0&.8b, &dst1&.8b +- mov &dst01&.d[0], &dst0&.d[0] +- mov &dst01&.d[1], &dst1&.d[0] ++ vuzp \()\dst0\().8b, \()\dst1\().8b ++ mov \()\dst01\().d[0], \()\dst0\().d[0] ++ mov \()\dst01\().d[1], \()\dst1\().d[0] + .endm + + .macro bilinear_deinterleave_dst_x_src numpix, dst0, dst1, dst01 + .endm + + .macro bilinear_deinterleave_dst_x_over numpix, dst0, dst1, dst01 +- bilinear_deinterleave numpix, dst0, dst1, dst01 ++ bilinear_deinterleave \numpix, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_deinterleave_dst_x_add numpix, dst0, dst1, dst01 +- bilinear_deinterleave numpix, dst0, dst1, dst01 ++ bilinear_deinterleave \numpix, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_deinterleave_dst_8_src numpix, dst0, dst1, dst01 +- bilinear_deinterleave numpix, dst0, dst1, dst01 ++ bilinear_deinterleave \numpix, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_deinterleave_dst_8_over numpix, dst0, dst1, dst01 +- bilinear_deinterleave numpix, dst0, dst1, dst01 ++ bilinear_deinterleave \numpix, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_deinterleave_dst_8_add numpix, dst0, dst1, dst01 +- bilinear_deinterleave numpix, dst0, dst1, dst01 ++ bilinear_deinterleave \numpix, \dst0, \dst1, \dst01 + .endm + + .macro bilinear_deinterleave_dst mask_fmt, op, numpix, dst0, dst1, dst01 +- bilinear_deinterleave_dst_&mask_fmt&_&op numpix, dst0, dst1, dst01 ++ bilinear_deinterleave_dst_\()\mask_fmt\()_\()\op \numpix, \dst0, \dst1, \dst01 + .endm + + + .macro bilinear_interpolate_last_pixel src_fmt, mask_fmt, dst_fmt, op +- bilinear_load_&src_fmt v0, v1, v2 +- bilinear_load_mask mask_fmt, 1, v4 +- bilinear_load_dst dst_fmt, op, 1, v18, v19, v9 ++ bilinear_load_\()\src_fmt v0, v1, v2 ++ bilinear_load_mask \mask_fmt, 1, v4 ++ bilinear_load_dst \dst_fmt, \op, 1, v18, v19, v9 + umull v2.8h, v0.8b, v28.8b + umlal v2.8h, v1.8b, v29.8b + /* 5 cycles bubble */ +@@ -509,28 +510,28 @@ + umlsl v0.4s, v2.4h, v15.h[0] + umlal2 v0.4s, v2.8h, v15.h[0] + /* 5 cycles bubble */ +- bilinear_duplicate_mask mask_fmt, 1, v4 ++ bilinear_duplicate_mask \mask_fmt, 1, v4 + shrn v0.4h, v0.4s, #(2 * BILINEAR_INTERPOLATION_BITS) + /* 3 cycles bubble */ + xtn v0.8b, v0.8h + /* 1 cycle bubble */ + bilinear_interleave_src_dst \ +- mask_fmt, op, 1, v0, v1, v0, v18, v19, v9 ++ \mask_fmt, \op, 1, v0, v1, v0, v18, v19, v9 + bilinear_apply_mask_to_src \ +- mask_fmt, 1, v0, v1, v0, v4, \ ++ \mask_fmt, 1, v0, v1, v0, v4, \ + v3, v8, v10, v11 + bilinear_combine \ +- op, 1, v0, v1, v0, v18, v19, v9, \ ++ \op, 1, v0, v1, v0, v18, v19, v9, \ + v3, v8, v10, v11, v5 +- bilinear_deinterleave_dst mask_fmt, op, 1, v0, v1, v0 +- bilinear_store_&dst_fmt 1, v17, v18 ++ bilinear_deinterleave_dst \mask_fmt, \op, 1, v0, v1, v0 ++ bilinear_store_\()\dst_fmt 1, v17, v18 + .endm + + .macro bilinear_interpolate_two_pixels src_fmt, mask_fmt, dst_fmt, op +- bilinear_load_and_vertical_interpolate_two_&src_fmt \ ++ bilinear_load_and_vertical_interpolate_two_\()\src_fmt \ + v1, v11, v18, v19, v20, v21, v22, v23 +- bilinear_load_mask mask_fmt, 2, v4 +- bilinear_load_dst dst_fmt, op, 2, v18, v19, v9 ++ bilinear_load_mask \mask_fmt, 2, v4 ++ bilinear_load_dst \dst_fmt, \op, 2, v18, v19, v9 + ushll v0.4s, v1.4h, #BILINEAR_INTERPOLATION_BITS + umlsl v0.4s, v1.4h, v15.h[0] + umlal2 v0.4s, v1.8h, v15.h[0] +@@ -539,25 +540,25 @@ + umlal2 v10.4s, v11.8h, v15.h[4] + shrn v0.4h, v0.4s, #(2 * BILINEAR_INTERPOLATION_BITS) + shrn2 v0.8h, v10.4s, #(2 * BILINEAR_INTERPOLATION_BITS) +- bilinear_duplicate_mask mask_fmt, 2, v4 ++ bilinear_duplicate_mask \mask_fmt, 2, v4 + ushr v15.8h, v12.8h, #(16 - BILINEAR_INTERPOLATION_BITS) + add v12.8h, v12.8h, v13.8h + xtn v0.8b, v0.8h + bilinear_interleave_src_dst \ +- mask_fmt, op, 2, v0, v1, v0, v18, v19, v9 ++ \mask_fmt, \op, 2, v0, v1, v0, v18, v19, v9 + bilinear_apply_mask_to_src \ +- mask_fmt, 2, v0, v1, v0, v4, \ ++ \mask_fmt, 2, v0, v1, v0, v4, \ + v3, v8, v10, v11 + bilinear_combine \ +- op, 2, v0, v1, v0, v18, v19, v9, \ ++ \op, 2, v0, v1, v0, v18, v19, v9, \ + v3, v8, v10, v11, v5 +- bilinear_deinterleave_dst mask_fmt, op, 2, v0, v1, v0 +- bilinear_store_&dst_fmt 2, v16, v17 ++ bilinear_deinterleave_dst \mask_fmt, \op, 2, v0, v1, v0 ++ bilinear_store_\()\dst_fmt 2, v16, v17 + .endm + + .macro bilinear_interpolate_four_pixels src_fmt, mask_fmt, dst_fmt, op +- bilinear_load_and_vertical_interpolate_four_&src_fmt \ +- v1, v11, v4, v5, v6, v7, v22, v23 \ ++ bilinear_load_and_vertical_interpolate_four_\()\src_fmt \ ++ v1, v11, v4, v5, v6, v7, v22, v23, \ + v3, v9, v16, v17, v20, v21, v18, v19 + prfm PREFETCH_MODE, [TMP1, PF_OFFS] + sub TMP1, TMP1, STRIDE +@@ -580,23 +581,23 @@ + shrn2 v0.8h, v10.4s, #(2 * BILINEAR_INTERPOLATION_BITS) + shrn v2.4h, v2.4s, #(2 * BILINEAR_INTERPOLATION_BITS) + shrn2 v2.8h, v8.4s, #(2 * BILINEAR_INTERPOLATION_BITS) +- bilinear_load_mask mask_fmt, 4, v4 +- bilinear_duplicate_mask mask_fmt, 4, v4 ++ bilinear_load_mask \mask_fmt, 4, v4 ++ bilinear_duplicate_mask \mask_fmt, 4, v4 + ushr v15.8h, v12.8h, #(16 - BILINEAR_INTERPOLATION_BITS) + xtn v0.8b, v0.8h + xtn v1.8b, v2.8h + add v12.8h, v12.8h, v13.8h +- bilinear_load_dst dst_fmt, op, 4, v2, v3, v21 ++ bilinear_load_dst \dst_fmt, \op, 4, v2, v3, v21 + bilinear_interleave_src_dst \ +- mask_fmt, op, 4, v0, v1, v0, v2, v3, v11 ++ \mask_fmt, \op, 4, v0, v1, v0, v2, v3, v11 + bilinear_apply_mask_to_src \ +- mask_fmt, 4, v0, v1, v0, v4, \ ++ \mask_fmt, 4, v0, v1, v0, v4, \ + v6, v8, v9, v10 + bilinear_combine \ +- op, 4, v0, v1, v0, v2, v3, v1, \ ++ \op, 4, v0, v1, v0, v2, v3, v1, \ + v6, v8, v9, v10, v23 +- bilinear_deinterleave_dst mask_fmt, op, 4, v0, v1, v0 +- bilinear_store_&dst_fmt 4, v6, v7 ++ bilinear_deinterleave_dst \mask_fmt, \op, 4, v0, v1, v0 ++ bilinear_store_\()\dst_fmt 4, v6, v7 + .endm + + .set BILINEAR_FLAG_USE_MASK, 1 +@@ -636,14 +637,14 @@ + prefetch_distance, \ + flags + +-pixman_asm_function fname +-.if pixblock_size == 8 +-.elseif pixblock_size == 4 ++pixman_asm_function \fname ++.if \pixblock_size == 8 ++.elseif \pixblock_size == 4 + .else + .error unsupported pixblock size + .endif + +-.if ((flags) & BILINEAR_FLAG_USE_MASK) == 0 ++.if ((\flags) & BILINEAR_FLAG_USE_MASK) == 0 + OUT .req x0 + TOP .req x1 + BOTTOM .req x2 +@@ -699,7 +700,7 @@ pixman_asm_function fname + STRIDE .req x15 + DUMMY .req x30 + +- .set prefetch_offset, prefetch_distance ++ .set prefetch_offset, \prefetch_distance + + stp x29, x30, [sp, -16]! + mov x29, sp +@@ -714,7 +715,7 @@ pixman_asm_function fname + sub sp, sp, 120 + .endif + +- mov WTMP1, #prefetch_distance ++ mov WTMP1, #\prefetch_distance + umull PF_OFFS, WTMP1, UX + + sub STRIDE, BOTTOM, TOP +@@ -735,11 +736,11 @@ pixman_asm_function fname + /* ensure good destination alignment */ + cmp WIDTH, #1 + blt 100f +- tst OUT, #(1 << dst_bpp_shift) ++ tst OUT, #(1 << \dst_bpp_shift) + beq 100f + ushr v15.8h, v12.8h, #(16 - BILINEAR_INTERPOLATION_BITS) + add v12.8h, v12.8h, v13.8h +- bilinear_process_last_pixel ++ \bilinear_process_last_pixel + sub WIDTH, WIDTH, #1 + 100: + add v13.8h, v13.8h, v13.8h +@@ -748,50 +749,50 @@ pixman_asm_function fname + + cmp WIDTH, #2 + blt 100f +- tst OUT, #(1 << (dst_bpp_shift + 1)) ++ tst OUT, #(1 << (\dst_bpp_shift + 1)) + beq 100f +- bilinear_process_two_pixels ++ \bilinear_process_two_pixels + sub WIDTH, WIDTH, #2 + 100: +-.if pixblock_size == 8 ++.if \pixblock_size == 8 + cmp WIDTH, #4 + blt 100f +- tst OUT, #(1 << (dst_bpp_shift + 2)) ++ tst OUT, #(1 << (\dst_bpp_shift + 2)) + beq 100f +- bilinear_process_four_pixels ++ \bilinear_process_four_pixels + sub WIDTH, WIDTH, #4 + 100: + .endif +- subs WIDTH, WIDTH, #pixblock_size ++ subs WIDTH, WIDTH, #\pixblock_size + blt 100f +- asr PF_OFFS, PF_OFFS, #(16 - src_bpp_shift) +- bilinear_process_pixblock_head +- subs WIDTH, WIDTH, #pixblock_size ++ asr PF_OFFS, PF_OFFS, #(16 - \src_bpp_shift) ++ \bilinear_process_pixblock_head ++ subs WIDTH, WIDTH, #\pixblock_size + blt 500f + 0: +- bilinear_process_pixblock_tail_head +- subs WIDTH, WIDTH, #pixblock_size ++ \bilinear_process_pixblock_tail_head ++ subs WIDTH, WIDTH, #\pixblock_size + bge 0b + 500: +- bilinear_process_pixblock_tail ++ \bilinear_process_pixblock_tail + 100: +-.if pixblock_size == 8 ++.if \pixblock_size == 8 + tst WIDTH, #4 + beq 200f +- bilinear_process_four_pixels ++ \bilinear_process_four_pixels + 200: + .endif + /* handle the remaining trailing pixels */ + tst WIDTH, #2 + beq 200f +- bilinear_process_two_pixels ++ \bilinear_process_two_pixels + 200: + tst WIDTH, #1 + beq 300f +- bilinear_process_last_pixel ++ \bilinear_process_last_pixel + 300: + +-.if ((flags) & BILINEAR_FLAG_USE_MASK) == 0 ++.if ((\flags) & BILINEAR_FLAG_USE_MASK) == 0 + sub x29, x29, 64 + ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [x29], 32 + ld1 {v12.8b, v13.8b, v14.8b, v15.8b}, [x29], 32 +@@ -829,11 +830,11 @@ pixman_asm_function fname + .unreq TMP3 + .unreq TMP4 + .unreq STRIDE +-.if ((flags) & BILINEAR_FLAG_USE_MASK) != 0 ++.if ((\flags) & BILINEAR_FLAG_USE_MASK) != 0 + .unreq MASK + .endif + +-.endfunc ++pixman_end_asm_function + + .endm + +diff --git a/pixman/pixman-arma64-neon-asm.S b/pixman/pixman-arma64-neon-asm.S +index 774d98d..107c133 100644 +--- a/pixman/pixman-arma64-neon-asm.S ++++ b/pixman/pixman-arma64-neon-asm.S +@@ -267,54 +267,54 @@ + sli v4.8h, v4.8h, #5 + ushll v14.8h, v17.8b, #7 + sli v14.8h, v14.8h, #1 +- PF add PF_X, PF_X, #8 ++ PF add, PF_X, PF_X, #8 + ushll v8.8h, v19.8b, #7 + sli v8.8h, v8.8h, #1 +- PF tst PF_CTL, #0xF ++ PF tst, PF_CTL, #0xF + sri v6.8b, v6.8b, #5 +- PF beq 10f +- PF add PF_X, PF_X, #8 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 + 10: + mvn v3.8b, v3.8b +- PF beq 10f +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + sri v7.8b, v7.8b, #6 + shrn v30.8b, v4.8h, #2 + umull v10.8h, v3.8b, v6.8b +- PF lsl DUMMY, PF_X, #src_bpp_shift +- PF prfm PREFETCH_MODE, [PF_SRC, DUMMY] ++ PF lsl, DUMMY, PF_X, #src_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_SRC, DUMMY] + umull v11.8h, v3.8b, v7.8b + umull v12.8h, v3.8b, v30.8b +- PF lsl DUMMY, PF_X, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [PF_DST, DUMMY] ++ PF lsl, DUMMY, PF_X, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_DST, DUMMY] + sri v14.8h, v8.8h, #5 +- PF cmp PF_X, ORIG_W ++ PF cmp, PF_X, ORIG_W + ushll v9.8h, v18.8b, #7 + sli v9.8h, v9.8h, #1 + urshr v17.8h, v10.8h, #8 +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W + 10: + urshr v19.8h, v11.8h, #8 + urshr v18.8h, v12.8h, #8 +- PF ble 10f +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF ble, 10f ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + sri v14.8h, v9.8h, #11 + mov v28.d[0], v14.d[0] + mov v29.d[0], v14.d[1] +- PF ble 10f +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF ldrsb DUMMY, [PF_SRC, DUMMY] +- PF add PF_SRC, PF_SRC, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF ldrsb, DUMMY, [PF_SRC, DUMMY] ++ PF add, PF_SRC, PF_SRC, #1 + 10: + raddhn v20.8b, v10.8h, v17.8h + raddhn v23.8b, v11.8h, v19.8h +- PF ble 10f +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF ldrsb DUMMY, [PF_DST, DUMMY] +- PF add PF_DST, PF_SRC, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF ldrsb, DUMMY, [PF_DST, DUMMY] ++ PF add, PF_DST, PF_SRC, #1 + 10: + raddhn v22.8b, v12.8h, v18.8h + st1 {v14.8h}, [DST_W], #16 +@@ -474,32 +474,32 @@ generate_composite_function \ + + .macro pixman_composite_src_8888_0565_process_pixblock_tail_head + sri v14.8h, v8.8h, #5 +- PF add PF_X, PF_X, #8 +- PF tst PF_CTL, #0xF ++ PF add, PF_X, PF_X, #8 ++ PF tst, PF_CTL, #0xF + fetch_src_pixblock +- PF beq 10f +- PF add PF_X, PF_X, #8 +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + sri v14.8h, v9.8h, #11 + mov v28.d[0], v14.d[0] + mov v29.d[0], v14.d[1] +- PF cmp PF_X, ORIG_W +- PF lsl DUMMY, PF_X, #src_bpp_shift +- PF prfm PREFETCH_MODE, [PF_SRC, DUMMY] ++ PF cmp, PF_X, ORIG_W ++ PF lsl, DUMMY, PF_X, #src_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_SRC, DUMMY] + ushll v8.8h, v1.8b, #7 + sli v8.8h, v8.8h, #1 + st1 {v14.8h}, [DST_W], #16 +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + ushll v14.8h, v2.8b, #7 + sli v14.8h, v14.8h, #1 +- PF ble 10f +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF ldrsb DUMMY, [PF_SRC, DUMMY] +- PF add PF_SRC, PF_SRC, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF ldrsb, DUMMY, [PF_SRC, DUMMY] ++ PF add, PF_SRC, PF_SRC, #1 + 10: + ushll v9.8h, v0.8b, #7 + sli v9.8h, v9.8h, #1 +@@ -566,31 +566,31 @@ generate_composite_function \ + + .macro pixman_composite_add_8_8_process_pixblock_tail_head + fetch_src_pixblock +- PF add PF_X, PF_X, #32 +- PF tst PF_CTL, #0xF ++ PF add, PF_X, PF_X, #32 ++ PF tst, PF_CTL, #0xF + ld1 {v4.8b, v5.8b, v6.8b, v7.8b}, [DST_R], #32 +- PF beq 10f +- PF add PF_X, PF_X, #32 +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #32 ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + st1 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 +- PF cmp PF_X, ORIG_W +- PF lsl DUMMY, PF_X, #src_bpp_shift +- PF prfm PREFETCH_MODE, [PF_SRC, DUMMY] +- PF lsl DUMMY, PF_X, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [PF_DST, DUMMY] +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF cmp, PF_X, ORIG_W ++ PF lsl, DUMMY, PF_X, #src_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_SRC, DUMMY] ++ PF lsl, DUMMY, PF_X, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_DST, DUMMY] ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + uqadd v28.8b, v0.8b, v4.8b +- PF ble 10f +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF ldrsb DUMMY, [PF_SRC, DUMMY] +- PF add PF_SRC, PF_SRC, #1 +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF ldrsb DUMMY, [PF_DST, DUMMY] +- PF add PF_DST, PF_DST, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF ldrsb, DUMMY, [PF_SRC, DUMMY] ++ PF add, PF_SRC, PF_SRC, #1 ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF ldrsb, DUMMY, [PF_DST, DUMMY] ++ PF add, PF_DST, PF_DST, #1 + 10: + uqadd v29.8b, v1.8b, v5.8b + uqadd v30.8b, v2.8b, v6.8b +@@ -612,31 +612,31 @@ generate_composite_function \ + + .macro pixman_composite_add_8888_8888_process_pixblock_tail_head + fetch_src_pixblock +- PF add PF_X, PF_X, #8 +- PF tst PF_CTL, #0xF ++ PF add, PF_X, PF_X, #8 ++ PF tst, PF_CTL, #0xF + ld1 {v4.8b, v5.8b, v6.8b, v7.8b}, [DST_R], #32 +- PF beq 10f +- PF add PF_X, PF_X, #8 +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + st1 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 +- PF cmp PF_X, ORIG_W +- PF lsl DUMMY, PF_X, #src_bpp_shift +- PF prfm PREFETCH_MODE, [PF_SRC, DUMMY] +- PF lsl DUMMY, PF_X, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [PF_DST, DUMMY] +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF cmp, PF_X, ORIG_W ++ PF lsl, DUMMY, PF_X, #src_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_SRC, DUMMY] ++ PF lsl, DUMMY, PF_X, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_DST, DUMMY] ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + uqadd v28.8b, v0.8b, v4.8b +- PF ble 10f +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF ldrsb DUMMY, [PF_SRC, DUMMY] +- PF add PF_SRC, PF_SRC, #1 +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF ldrsb DUMMY, [PF_DST, DUMMY] +- PF add PF_DST, PF_DST, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF ldrsb, DUMMY, [PF_SRC, DUMMY] ++ PF add, PF_SRC, PF_SRC, #1 ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF ldrsb, DUMMY, [PF_DST, DUMMY] ++ PF add, PF_DST, PF_DST, #1 + 10: + uqadd v29.8b, v1.8b, v5.8b + uqadd v30.8b, v2.8b, v6.8b +@@ -689,45 +689,45 @@ generate_composite_function_single_scanline \ + .macro pixman_composite_out_reverse_8888_8888_process_pixblock_tail_head + ld4 {v4.8b, v5.8b, v6.8b, v7.8b}, [DST_R], #32 + urshr v14.8h, v8.8h, #8 +- PF add PF_X, PF_X, #8 +- PF tst PF_CTL, #0xF ++ PF add, PF_X, PF_X, #8 ++ PF tst, PF_CTL, #0xF + urshr v15.8h, v9.8h, #8 + urshr v16.8h, v10.8h, #8 + urshr v17.8h, v11.8h, #8 +- PF beq 10f +- PF add PF_X, PF_X, #8 +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + raddhn v28.8b, v14.8h, v8.8h + raddhn v29.8b, v15.8h, v9.8h +- PF cmp PF_X, ORIG_W ++ PF cmp, PF_X, ORIG_W + raddhn v30.8b, v16.8h, v10.8h + raddhn v31.8b, v17.8h, v11.8h + fetch_src_pixblock +- PF lsl DUMMY, PF_X, #src_bpp_shift +- PF prfm PREFETCH_MODE, [PF_SRC, DUMMY] ++ PF lsl, DUMMY, PF_X, #src_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_SRC, DUMMY] + mvn v22.8b, v3.8b +- PF lsl DUMMY, PF_X, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [PF_DST, DUMMY] ++ PF lsl, DUMMY, PF_X, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_DST, DUMMY] + st4 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W + 10: + umull v8.8h, v22.8b, v4.8b +- PF ble 10f +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF ble, 10f ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + umull v9.8h, v22.8b, v5.8b +- PF ble 10f +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF ldrsb DUMMY, [PF_SRC, DUMMY] +- PF add PF_SRC, PF_SRC, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF ldrsb, DUMMY, [PF_SRC, DUMMY] ++ PF add, PF_SRC, PF_SRC, #1 + 10: + umull v10.8h, v22.8b, v6.8b +- PF ble 10f +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF ldrsb DUMMY, [PF_DST, DUMMY] +- PF add PF_DST, PF_DST, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF ldrsb, DUMMY, [PF_DST, DUMMY] ++ PF add, PF_DST, PF_DST, #1 + 10: + umull v11.8h, v22.8b, v7.8b + .endm +@@ -759,18 +759,18 @@ generate_composite_function_single_scanline \ + .macro pixman_composite_over_8888_8888_process_pixblock_tail_head + ld4 {v4.8b, v5.8b, v6.8b, v7.8b}, [DST_R], #32 + urshr v14.8h, v8.8h, #8 +- PF add PF_X, PF_X, #8 +- PF tst PF_CTL, #0xF ++ PF add, PF_X, PF_X, #8 ++ PF tst, PF_CTL, #0xF + urshr v15.8h, v9.8h, #8 + urshr v16.8h, v10.8h, #8 + urshr v17.8h, v11.8h, #8 +- PF beq 10f +- PF add PF_X, PF_X, #8 +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + raddhn v28.8b, v14.8h, v8.8h + raddhn v29.8b, v15.8h, v9.8h +- PF cmp PF_X, ORIG_W ++ PF cmp, PF_X, ORIG_W + raddhn v30.8b, v16.8h, v10.8h + raddhn v31.8b, v17.8h, v11.8h + uqadd v28.8b, v0.8b, v28.8b +@@ -778,30 +778,30 @@ generate_composite_function_single_scanline \ + uqadd v30.8b, v2.8b, v30.8b + uqadd v31.8b, v3.8b, v31.8b + fetch_src_pixblock +- PF lsl DUMMY, PF_X, #src_bpp_shift +- PF prfm PREFETCH_MODE, [PF_SRC, DUMMY] ++ PF lsl, DUMMY, PF_X, #src_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_SRC, DUMMY] + mvn v22.8b, v3.8b +- PF lsl DUMMY, PF_X, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [PF_DST, DUMMY] ++ PF lsl, DUMMY, PF_X, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_DST, DUMMY] + st4 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W + 10: + umull v8.8h, v22.8b, v4.8b +- PF ble 10f +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF ble, 10f ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + umull v9.8h, v22.8b, v5.8b +- PF ble 10f +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF ldrsb DUMMY, [PF_SRC, DUMMY] +- PF add PF_SRC, PF_SRC, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF ldrsb, DUMMY, [PF_SRC, DUMMY] ++ PF add, PF_SRC, PF_SRC, #1 + 10: + umull v10.8h, v22.8b, v6.8b +- PF ble 10f +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF ldrsb DUMMY, [PF_DST, DUMMY] +- PF add PF_DST, PF_DST, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF ldrsb, DUMMY, [PF_DST, DUMMY] ++ PF add, PF_DST, PF_DST, #1 + 10: + umull v11.8h, v22.8b, v7.8b + .endm +@@ -865,30 +865,30 @@ generate_composite_function_single_scanline \ + raddhn v31.8b, v17.8h, v11.8h + ld4 {v4.8b, v5.8b, v6.8b, v7.8b}, [DST_R], #32 + uqadd v28.8b, v0.8b, v28.8b +- PF add PF_X, PF_X, #8 +- PF tst PF_CTL, #0x0F +- PF beq 10f +- PF add PF_X, PF_X, #8 +- PF sub PF_CTL, PF_CTL, #1 ++ PF add, PF_X, PF_X, #8 ++ PF tst, PF_CTL, #0x0F ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + uqadd v29.8b, v1.8b, v29.8b + uqadd v30.8b, v2.8b, v30.8b + uqadd v31.8b, v3.8b, v31.8b +- PF cmp PF_X, ORIG_W ++ PF cmp, PF_X, ORIG_W + umull v8.8h, v24.8b, v4.8b +- PF lsl DUMMY, PF_X, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [PF_DST, DUMMY] ++ PF lsl, DUMMY, PF_X, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_DST, DUMMY] + umull v9.8h, v24.8b, v5.8b +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W + 10: + umull v10.8h, v24.8b, v6.8b +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF subs, PF_CTL, PF_CTL, #0x10 + umull v11.8h, v24.8b, v7.8b +- PF ble 10f +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF ldrsb DUMMY, [PF_DST, DUMMY] +- PF add PF_DST, PF_DST, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF ldrsb, DUMMY, [PF_DST, DUMMY] ++ PF add, PF_DST, PF_DST, #1 + 10: + st4 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 + .endm +@@ -917,18 +917,18 @@ generate_composite_function \ + + .macro pixman_composite_over_reverse_n_8888_process_pixblock_tail_head + urshr v14.8h, v8.8h, #8 +- PF add PF_X, PF_X, #8 +- PF tst PF_CTL, #0xF ++ PF add, PF_X, PF_X, #8 ++ PF tst, PF_CTL, #0xF + urshr v15.8h, v9.8h, #8 + urshr v12.8h, v10.8h, #8 + urshr v13.8h, v11.8h, #8 +- PF beq 10f +- PF add PF_X, PF_X, #8 +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + raddhn v28.8b, v14.8h, v8.8h + raddhn v29.8b, v15.8h, v9.8h +- PF cmp PF_X, ORIG_W ++ PF cmp, PF_X, ORIG_W + raddhn v30.8b, v12.8h, v10.8h + raddhn v31.8b, v13.8h, v11.8h + uqadd v28.8b, v0.8b, v28.8b +@@ -937,22 +937,22 @@ generate_composite_function \ + uqadd v31.8b, v3.8b, v31.8b + ld4 {v0.8b, v1.8b, v2.8b, v3.8b}, [DST_R], #32 + mvn v22.8b, v3.8b +- PF lsl DUMMY, PF_X, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [PF_DST, DUMMY] ++ PF lsl, DUMMY, PF_X, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_DST, DUMMY] + st4 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 +- PF blt 10f +- PF sub PF_X, PF_X, ORIG_W ++ PF blt, 10f ++ PF sub, PF_X, PF_X, ORIG_W + 10: + umull v8.8h, v22.8b, v4.8b +- PF blt 10f +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF blt, 10f ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + umull v9.8h, v22.8b, v5.8b + umull v10.8h, v22.8b, v6.8b +- PF blt 10f +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF ldrsb DUMMY, [PF_DST, DUMMY] +- PF add PF_DST, PF_DST, #1 ++ PF blt, 10f ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF ldrsb, DUMMY, [PF_DST, DUMMY] ++ PF add, PF_DST, PF_DST, #1 + 10: + umull v11.8h, v22.8b, v7.8b + .endm +@@ -1410,35 +1410,35 @@ generate_composite_function \ + + .macro pixman_composite_src_n_8_8888_process_pixblock_tail_head + fetch_mask_pixblock +- PF add PF_X, PF_X, #8 ++ PF add, PF_X, PF_X, #8 + rshrn v28.8b, v8.8h, #8 +- PF tst PF_CTL, #0x0F ++ PF tst, PF_CTL, #0x0F + rshrn v29.8b, v9.8h, #8 +- PF beq 10f +- PF add PF_X, PF_X, #8 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 + 10: + rshrn v30.8b, v10.8h, #8 +- PF beq 10f +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + rshrn v31.8b, v11.8h, #8 +- PF cmp PF_X, ORIG_W ++ PF cmp, PF_X, ORIG_W + umull v8.8h, v24.8b, v0.8b +- PF lsl DUMMY, PF_X, #mask_bpp_shift +- PF prfm PREFETCH_MODE, [PF_MASK, DUMMY] ++ PF lsl, DUMMY, PF_X, #mask_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_MASK, DUMMY] + umull v9.8h, v24.8b, v1.8b +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W + 10: + umull v10.8h, v24.8b, v2.8b +- PF ble 10f +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF ble, 10f ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + umull v11.8h, v24.8b, v3.8b +- PF ble 10f +- PF lsl DUMMY, MASK_STRIDE, #mask_bpp_shift +- PF ldrsb DUMMY, [PF_MASK, DUMMY] +- PF add PF_MASK, PF_MASK, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, MASK_STRIDE, #mask_bpp_shift ++ PF ldrsb, DUMMY, [PF_MASK, DUMMY] ++ PF add, PF_MASK, PF_MASK, #1 + 10: + st4 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 + ursra v8.8h, v8.8h, #8 +@@ -1491,35 +1491,35 @@ generate_composite_function \ + + .macro pixman_composite_src_n_8_8_process_pixblock_tail_head + fetch_mask_pixblock +- PF add PF_X, PF_X, #8 ++ PF add, PF_X, PF_X, #8 + rshrn v28.8b, v0.8h, #8 +- PF tst PF_CTL, #0x0F ++ PF tst, PF_CTL, #0x0F + rshrn v29.8b, v1.8h, #8 +- PF beq 10f +- PF add PF_X, PF_X, #8 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 + 10: + rshrn v30.8b, v2.8h, #8 +- PF beq 10f +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + rshrn v31.8b, v3.8h, #8 +- PF cmp PF_X, ORIG_W ++ PF cmp, PF_X, ORIG_W + umull v0.8h, v24.8b, v16.8b +- PF lsl DUMMY, PF_X, mask_bpp_shift +- PF prfm PREFETCH_MODE, [PF_MASK, DUMMY] ++ PF lsl, DUMMY, PF_X, mask_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_MASK, DUMMY] + umull v1.8h, v25.8b, v16.8b +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W + 10: + umull v2.8h, v26.8b, v16.8b +- PF ble 10f +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF ble, 10f ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + umull v3.8h, v27.8b, v16.8b +- PF ble 10f +- PF lsl DUMMY, MASK_STRIDE, #mask_bpp_shift +- PF ldrsb DUMMY, [PF_MASK, DUMMY] +- PF add PF_MASK, PF_MASK, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, MASK_STRIDE, #mask_bpp_shift ++ PF ldrsb, DUMMY, [PF_MASK, DUMMY] ++ PF add, PF_MASK, PF_MASK, #1 + 10: + st1 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 + ursra v0.8h, v0.8h, #8 +@@ -1599,44 +1599,44 @@ generate_composite_function \ + urshr v17.8h, v13.8h, #8 + fetch_mask_pixblock + urshr v18.8h, v14.8h, #8 +- PF add PF_X, PF_X, #8 ++ PF add, PF_X, PF_X, #8 + urshr v19.8h, v15.8h, #8 +- PF tst PF_CTL, #0x0F ++ PF tst, PF_CTL, #0x0F + raddhn v28.8b, v16.8h, v12.8h +- PF beq 10f +- PF add PF_X, PF_X, #8 ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 + 10: + raddhn v29.8b, v17.8h, v13.8h +- PF beq 10f +- PF sub PF_CTL, PF_CTL, #1 ++ PF beq, 10f ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + raddhn v30.8b, v18.8h, v14.8h +- PF cmp PF_X, ORIG_W ++ PF cmp, PF_X, ORIG_W + raddhn v31.8b, v19.8h, v15.8h +- PF lsl DUMMY, PF_X, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [PF_DST, DUMMY] ++ PF lsl, DUMMY, PF_X, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_DST, DUMMY] + umull v16.8h, v24.8b, v8.8b +- PF lsl DUMMY, PF_X, #mask_bpp_shift +- PF prfm PREFETCH_MODE, [PF_MASK, DUMMY] ++ PF lsl, DUMMY, PF_X, #mask_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_MASK, DUMMY] + umull v17.8h, v24.8b, v9.8b +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W + 10: + umull v18.8h, v24.8b, v10.8b +- PF ble 10f +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF ble, 10f ++ PF subs, PF_CTL, PF_CTL, #0x10 + 10: + umull v19.8h, v24.8b, v11.8b +- PF ble 10f +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF ldrsb DUMMY, [PF_DST, DUMMY] +- PF add PF_DST, PF_DST, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF ldrsb, DUMMY, [PF_DST, DUMMY] ++ PF add, PF_DST, PF_DST, #1 + 10: + uqadd v28.8b, v0.8b, v28.8b +- PF ble 10f +- PF lsl DUMMY, MASK_STRIDE, #mask_bpp_shift +- PF ldrsb DUMMY, [PF_MASK, DUMMY] +- PF add PF_MASK, PF_MASK, #1 ++ PF ble, 10f ++ PF lsl, DUMMY, MASK_STRIDE, #mask_bpp_shift ++ PF ldrsb, DUMMY, [PF_MASK, DUMMY] ++ PF add, PF_MASK, PF_MASK, #1 + 10: + uqadd v29.8b, v1.8b, v29.8b + uqadd v30.8b, v2.8b, v30.8b +@@ -2412,7 +2412,7 @@ generate_composite_function_single_scanline \ + default_cleanup_need_all_regs, \ + pixman_composite_out_reverse_8888_n_8888_process_pixblock_head, \ + pixman_composite_out_reverse_8888_n_8888_process_pixblock_tail, \ +- pixman_composite_out_reverse_8888_8888_8888_process_pixblock_tail_head \ ++ pixman_composite_out_reverse_8888_8888_8888_process_pixblock_tail_head, \ + 28, /* dst_w_basereg */ \ + 4, /* dst_r_basereg */ \ + 0, /* src_basereg */ \ +@@ -2487,7 +2487,7 @@ generate_composite_function \ + default_cleanup_need_all_regs, \ + pixman_composite_over_8888_n_8888_process_pixblock_head, \ + pixman_composite_over_8888_n_8888_process_pixblock_tail, \ +- pixman_composite_over_8888_8888_8888_process_pixblock_tail_head \ ++ pixman_composite_over_8888_8888_8888_process_pixblock_tail_head, \ + 28, /* dst_w_basereg */ \ + 4, /* dst_r_basereg */ \ + 0, /* src_basereg */ \ +@@ -2501,7 +2501,7 @@ generate_composite_function_single_scanline \ + default_cleanup_need_all_regs, \ + pixman_composite_over_8888_n_8888_process_pixblock_head, \ + pixman_composite_over_8888_n_8888_process_pixblock_tail, \ +- pixman_composite_over_8888_8888_8888_process_pixblock_tail_head \ ++ pixman_composite_over_8888_8888_8888_process_pixblock_tail_head, \ + 28, /* dst_w_basereg */ \ + 4, /* dst_r_basereg */ \ + 0, /* src_basereg */ \ +@@ -2529,7 +2529,7 @@ generate_composite_function \ + default_cleanup_need_all_regs, \ + pixman_composite_over_8888_n_8888_process_pixblock_head, \ + pixman_composite_over_8888_n_8888_process_pixblock_tail, \ +- pixman_composite_over_8888_8_8888_process_pixblock_tail_head \ ++ pixman_composite_over_8888_8_8888_process_pixblock_tail_head, \ + 28, /* dst_w_basereg */ \ + 4, /* dst_r_basereg */ \ + 0, /* src_basereg */ \ +@@ -2680,11 +2680,11 @@ generate_composite_function \ + urshr v13.8h, v10.8h, #8 + fetch_src_pixblock + raddhn v30.8b, v11.8h, v8.8h +- PF add PF_X, PF_X, #8 +- PF tst PF_CTL, #0xF +- PF beq 10f +- PF add PF_X, PF_X, #8 +- PF sub PF_CTL, PF_CTL, #1 ++ PF add, PF_X, PF_X, #8 ++ PF tst, PF_CTL, #0xF ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + raddhn v29.8b, v12.8h, v9.8h + raddhn v28.8b, v13.8h, v10.8h +@@ -2692,16 +2692,16 @@ generate_composite_function \ + umull v9.8h, v3.8b, v1.8b + umull v10.8h, v3.8b, v2.8b + st4 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 +- PF cmp PF_X, ORIG_W +- PF lsl DUMMY, PF_X, src_bpp_shift +- PF prfm PREFETCH_MODE, [PF_SRC, DUMMY] +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W +- PF subs PF_CTL, PF_CTL, #0x10 +- PF ble 10f +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF ldrsb DUMMY, [PF_SRC, DUMMY] +- PF add PF_SRC, PF_SRC, #1 ++ PF cmp, PF_X, ORIG_W ++ PF lsl, DUMMY, PF_X, src_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_SRC, DUMMY] ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W ++ PF subs, PF_CTL, PF_CTL, #0x10 ++ PF ble, 10f ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF ldrsb, DUMMY, [PF_SRC, DUMMY] ++ PF add, PF_SRC, PF_SRC, #1 + 10: + .endm + +@@ -2749,11 +2749,11 @@ generate_composite_function \ + urshr v13.8h, v10.8h, #8 + fetch_src_pixblock + raddhn v28.8b, v11.8h, v8.8h +- PF add PF_X, PF_X, #8 +- PF tst PF_CTL, #0xF +- PF beq 10f +- PF add PF_X, PF_X, #8 +- PF sub PF_CTL, PF_CTL, #1 ++ PF add, PF_X, PF_X, #8 ++ PF tst, PF_CTL, #0xF ++ PF beq, 10f ++ PF add, PF_X, PF_X, #8 ++ PF sub, PF_CTL, PF_CTL, #1 + 10: + raddhn v29.8b, v12.8h, v9.8h + raddhn v30.8b, v13.8h, v10.8h +@@ -2761,16 +2761,16 @@ generate_composite_function \ + umull v9.8h, v3.8b, v1.8b + umull v10.8h, v3.8b, v2.8b + st4 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32 +- PF cmp PF_X, ORIG_W +- PF lsl DUMMY, PF_X, src_bpp_shift +- PF prfm PREFETCH_MODE, [PF_SRC, DUMMY] +- PF ble 10f +- PF sub PF_X, PF_X, ORIG_W +- PF subs PF_CTL, PF_CTL, #0x10 +- PF ble 10f +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF ldrsb DUMMY, [PF_SRC, DUMMY] +- PF add PF_SRC, PF_SRC, #1 ++ PF cmp, PF_X, ORIG_W ++ PF lsl, DUMMY, PF_X, src_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_SRC, DUMMY] ++ PF ble, 10f ++ PF sub, PF_X, PF_X, ORIG_W ++ PF subs, PF_CTL, PF_CTL, #0x10 ++ PF ble, 10f ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF ldrsb, DUMMY, [PF_SRC, DUMMY] ++ PF add, PF_SRC, PF_SRC, #1 + 10: + .endm + +@@ -3131,53 +3131,53 @@ generate_composite_function_nearest_scanline \ + asr TMP1, X, #16 + add X, X, UX + add TMP1, TOP, TMP1, lsl #2 +- ld1 {®1&.2s}, [TMP1], STRIDE +- ld1 {®2&.2s}, [TMP1] ++ ld1 {\()\reg1\().2s}, [TMP1], STRIDE ++ ld1 {\()\reg2\().2s}, [TMP1] + .endm + + .macro bilinear_load_0565 reg1, reg2, tmp + asr TMP1, X, #16 + add X, X, UX + add TMP1, TOP, TMP1, lsl #1 +- ld1 {®2&.s}[0], [TMP1], STRIDE +- ld1 {®2&.s}[1], [TMP1] +- convert_four_0565_to_x888_packed reg2, reg1, reg2, tmp ++ ld1 {\()\reg2\().s}[0], [TMP1], STRIDE ++ ld1 {\()\reg2\().s}[1], [TMP1] ++ convert_four_0565_to_x888_packed \reg2, \reg1, \reg2, \tmp + .endm + + .macro bilinear_load_and_vertical_interpolate_two_8888 \ + acc1, acc2, reg1, reg2, reg3, reg4, tmp1, tmp2 + +- bilinear_load_8888 reg1, reg2, tmp1 +- umull &acc1&.8h, ®1&.8b, v28.8b +- umlal &acc1&.8h, ®2&.8b, v29.8b +- bilinear_load_8888 reg3, reg4, tmp2 +- umull &acc2&.8h, ®3&.8b, v28.8b +- umlal &acc2&.8h, ®4&.8b, v29.8b ++ bilinear_load_8888 \reg1, \reg2, \tmp1 ++ umull \()\acc1\().8h, \()\reg1\().8b, v28.8b ++ umlal \()\acc1\().8h, \()\reg2\().8b, v29.8b ++ bilinear_load_8888 \reg3, \reg4, \tmp2 ++ umull \()\acc2\().8h, \()\reg3\().8b, v28.8b ++ umlal \()\acc2\().8h, \()\reg4\().8b, v29.8b + .endm + + .macro bilinear_load_and_vertical_interpolate_four_8888 \ +- xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi \ ++ xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi, \ + yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi + + bilinear_load_and_vertical_interpolate_two_8888 \ +- xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi ++ \xacc1, \xacc2, \xreg1, \xreg2, \xreg3, \xreg4, \xacc2lo, \xacc2hi + bilinear_load_and_vertical_interpolate_two_8888 \ +- yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi ++ \yacc1, \yacc2, \yreg1, \yreg2, \yreg3, \yreg4, \yacc2lo, \yacc2hi + .endm + + .macro vzip reg1, reg2 + umov TMP4, v31.d[0] +- zip1 v31.8b, reg1, reg2 +- zip2 reg2, reg1, reg2 +- mov reg1, v31.8b ++ zip1 v31.8b, \reg1, \reg2 ++ zip2 \reg2, \reg1, \reg2 ++ mov \reg1, v31.8b + mov v31.d[0], TMP4 + .endm + + .macro vuzp reg1, reg2 + umov TMP4, v31.d[0] +- uzp1 v31.8b, reg1, reg2 +- uzp2 reg2, reg1, reg2 +- mov reg1, v31.8b ++ uzp1 v31.8b, \reg1, \reg2 ++ uzp2 \reg2, \reg1, \reg2 ++ mov \reg1, v31.8b + mov v31.d[0], TMP4 + .endm + +@@ -3189,23 +3189,23 @@ generate_composite_function_nearest_scanline \ + asr TMP2, X, #16 + add X, X, UX + add TMP2, TOP, TMP2, lsl #1 +- ld1 {&acc2&.s}[0], [TMP1], STRIDE +- ld1 {&acc2&.s}[2], [TMP2], STRIDE +- ld1 {&acc2&.s}[1], [TMP1] +- ld1 {&acc2&.s}[3], [TMP2] +- convert_0565_to_x888 acc2, reg3, reg2, reg1 +- vzip ®1&.8b, ®3&.8b +- vzip ®2&.8b, ®4&.8b +- vzip ®3&.8b, ®4&.8b +- vzip ®1&.8b, ®2&.8b +- umull &acc1&.8h, ®1&.8b, v28.8b +- umlal &acc1&.8h, ®2&.8b, v29.8b +- umull &acc2&.8h, ®3&.8b, v28.8b +- umlal &acc2&.8h, ®4&.8b, v29.8b ++ ld1 {\()\acc2\().s}[0], [TMP1], STRIDE ++ ld1 {\()\acc2\().s}[2], [TMP2], STRIDE ++ ld1 {\()\acc2\().s}[1], [TMP1] ++ ld1 {\()\acc2\().s}[3], [TMP2] ++ convert_0565_to_x888 \acc2, \reg3, \reg2, \reg1 ++ vzip \()\reg1\().8b, \()\reg3\().8b ++ vzip \()\reg2\().8b, \()\reg4\().8b ++ vzip \()\reg3\().8b, \()\reg4\().8b ++ vzip \()\reg1\().8b, \()\reg2\().8b ++ umull \()\acc1\().8h, \()\reg1\().8b, v28.8b ++ umlal \()\acc1\().8h, \()\reg2\().8b, v29.8b ++ umull \()\acc2\().8h, \()\reg3\().8b, v28.8b ++ umlal \()\acc2\().8h, \()\reg4\().8b, v29.8b + .endm + + .macro bilinear_load_and_vertical_interpolate_four_0565 \ +- xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi \ ++ xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi, \ + yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi + asr TMP1, X, #16 + add X, X, UX +@@ -3213,49 +3213,49 @@ generate_composite_function_nearest_scanline \ + asr TMP2, X, #16 + add X, X, UX + add TMP2, TOP, TMP2, lsl #1 +- ld1 {&xacc2&.s}[0], [TMP1], STRIDE +- ld1 {&xacc2&.s}[2], [TMP2], STRIDE +- ld1 {&xacc2&.s}[1], [TMP1] +- ld1 {&xacc2&.s}[3], [TMP2] +- convert_0565_to_x888 xacc2, xreg3, xreg2, xreg1 ++ ld1 {\()\xacc2\().s}[0], [TMP1], STRIDE ++ ld1 {\()\xacc2\().s}[2], [TMP2], STRIDE ++ ld1 {\()\xacc2\().s}[1], [TMP1] ++ ld1 {\()\xacc2\().s}[3], [TMP2] ++ convert_0565_to_x888 \xacc2, \xreg3, \xreg2, \xreg1 + asr TMP1, X, #16 + add X, X, UX + add TMP1, TOP, TMP1, lsl #1 + asr TMP2, X, #16 + add X, X, UX + add TMP2, TOP, TMP2, lsl #1 +- ld1 {&yacc2&.s}[0], [TMP1], STRIDE +- vzip &xreg1&.8b, &xreg3&.8b +- ld1 {&yacc2&.s}[2], [TMP2], STRIDE +- vzip &xreg2&.8b, &xreg4&.8b +- ld1 {&yacc2&.s}[1], [TMP1] +- vzip &xreg3&.8b, &xreg4&.8b +- ld1 {&yacc2&.s}[3], [TMP2] +- vzip &xreg1&.8b, &xreg2&.8b +- convert_0565_to_x888 yacc2, yreg3, yreg2, yreg1 +- umull &xacc1&.8h, &xreg1&.8b, v28.8b +- vzip &yreg1&.8b, &yreg3&.8b +- umlal &xacc1&.8h, &xreg2&.8b, v29.8b +- vzip &yreg2&.8b, &yreg4&.8b +- umull &xacc2&.8h, &xreg3&.8b, v28.8b +- vzip &yreg3&.8b, &yreg4&.8b +- umlal &xacc2&.8h, &xreg4&.8b, v29.8b +- vzip &yreg1&.8b, &yreg2&.8b +- umull &yacc1&.8h, &yreg1&.8b, v28.8b +- umlal &yacc1&.8h, &yreg2&.8b, v29.8b +- umull &yacc2&.8h, &yreg3&.8b, v28.8b +- umlal &yacc2&.8h, &yreg4&.8b, v29.8b ++ ld1 {\()\yacc2\().s}[0], [TMP1], STRIDE ++ vzip \()\xreg1\().8b, \()\xreg3\().8b ++ ld1 {\()\yacc2\().s}[2], [TMP2], STRIDE ++ vzip \()\xreg2\().8b, \()\xreg4\().8b ++ ld1 {\()\yacc2\().s}[1], [TMP1] ++ vzip \()\xreg3\().8b, \()\xreg4\().8b ++ ld1 {\()\yacc2\().s}[3], [TMP2] ++ vzip \()\xreg1\().8b, \()\xreg2\().8b ++ convert_0565_to_x888 \yacc2, \yreg3, \yreg2, \yreg1 ++ umull \()\xacc1\().8h, \()\xreg1\().8b, v28.8b ++ vzip \()\yreg1\().8b, \()\yreg3\().8b ++ umlal \()\xacc1\().8h, \()\xreg2\().8b, v29.8b ++ vzip \()\yreg2\().8b, \()\yreg4\().8b ++ umull \()\xacc2\().8h, \()\xreg3\().8b, v28.8b ++ vzip \()\yreg3\().8b, \()\yreg4\().8b ++ umlal \()\xacc2\().8h, \()\xreg4\().8b, v29.8b ++ vzip \()\yreg1\().8b, \()\yreg2\().8b ++ umull \()\yacc1\().8h, \()\yreg1\().8b, v28.8b ++ umlal \()\yacc1\().8h, \()\yreg2\().8b, v29.8b ++ umull \()\yacc2\().8h, \()\yreg3\().8b, v28.8b ++ umlal \()\yacc2\().8h, \()\yreg4\().8b, v29.8b + .endm + + .macro bilinear_store_8888 numpix, tmp1, tmp2 +-.if numpix == 4 ++.if \numpix == 4 + st1 {v0.2s, v1.2s}, [OUT], #16 +-.elseif numpix == 2 ++.elseif \numpix == 2 + st1 {v0.2s}, [OUT], #8 +-.elseif numpix == 1 ++.elseif \numpix == 1 + st1 {v0.s}[0], [OUT], #4 + .else +- .error bilinear_store_8888 numpix is unsupported ++ .error bilinear_store_8888 \numpix is unsupported + .endif + .endm + +@@ -3264,20 +3264,20 @@ generate_composite_function_nearest_scanline \ + vuzp v2.8b, v3.8b + vuzp v1.8b, v3.8b + vuzp v0.8b, v2.8b +- convert_8888_to_0565 v2, v1, v0, v1, tmp1, tmp2 +-.if numpix == 4 ++ convert_8888_to_0565 v2, v1, v0, v1, \tmp1, \tmp2 ++.if \numpix == 4 + st1 {v1.4h}, [OUT], #8 +-.elseif numpix == 2 ++.elseif \numpix == 2 + st1 {v1.s}[0], [OUT], #4 +-.elseif numpix == 1 ++.elseif \numpix == 1 + st1 {v1.h}[0], [OUT], #2 + .else +- .error bilinear_store_0565 numpix is unsupported ++ .error bilinear_store_0565 \numpix is unsupported + .endif + .endm + + .macro bilinear_interpolate_last_pixel src_fmt, dst_fmt +- bilinear_load_&src_fmt v0, v1, v2 ++ bilinear_load_\()\src_fmt v0, v1, v2 + umull v2.8h, v0.8b, v28.8b + umlal v2.8h, v1.8b, v29.8b + /* 5 cycles bubble */ +@@ -3289,11 +3289,11 @@ generate_composite_function_nearest_scanline \ + /* 3 cycles bubble */ + xtn v0.8b, v0.8h + /* 1 cycle bubble */ +- bilinear_store_&dst_fmt 1, v3, v4 ++ bilinear_store_\()\dst_fmt 1, v3, v4 + .endm + + .macro bilinear_interpolate_two_pixels src_fmt, dst_fmt +- bilinear_load_and_vertical_interpolate_two_&src_fmt \ ++ bilinear_load_and_vertical_interpolate_two_\()\src_fmt \ + v1, v11, v2, v3, v20, v21, v22, v23 + ushll v0.4s, v1.4h, #BILINEAR_INTERPOLATION_BITS + umlsl v0.4s, v1.4h, v15.h[0] +@@ -3306,12 +3306,12 @@ generate_composite_function_nearest_scanline \ + ushr v15.8h, v12.8h, #(16 - BILINEAR_INTERPOLATION_BITS) + add v12.8h, v12.8h, v13.8h + xtn v0.8b, v0.8h +- bilinear_store_&dst_fmt 2, v3, v4 ++ bilinear_store_\()\dst_fmt 2, v3, v4 + .endm + + .macro bilinear_interpolate_four_pixels src_fmt, dst_fmt +- bilinear_load_and_vertical_interpolate_four_&src_fmt \ +- v1, v11, v14, v20, v16, v17, v22, v23 \ ++ bilinear_load_and_vertical_interpolate_four_\()\src_fmt \ ++ v1, v11, v14, v20, v16, v17, v22, v23, \ + v3, v9, v24, v25, v26, v27, v18, v19 + prfm PREFETCH_MODE, [TMP1, PF_OFFS] + sub TMP1, TMP1, STRIDE +@@ -3338,54 +3338,54 @@ generate_composite_function_nearest_scanline \ + xtn v0.8b, v0.8h + xtn v1.8b, v2.8h + add v12.8h, v12.8h, v13.8h +- bilinear_store_&dst_fmt 4, v3, v4 ++ bilinear_store_\()\dst_fmt 4, v3, v4 + .endm + + .macro bilinear_interpolate_four_pixels_head src_fmt, dst_fmt +-.ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt +- bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt&_head ++.ifdef have_bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt ++ bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt\()_head + .else +- bilinear_interpolate_four_pixels src_fmt, dst_fmt ++ bilinear_interpolate_four_pixels \src_fmt, \dst_fmt + .endif + .endm + + .macro bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt +-.ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt +- bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt&_tail ++.ifdef have_bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt ++ bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail + .endif + .endm + + .macro bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt +-.ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt +- bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt&_tail_head ++.ifdef have_bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt ++ bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail_head + .else +- bilinear_interpolate_four_pixels src_fmt, dst_fmt ++ bilinear_interpolate_four_pixels \src_fmt, \dst_fmt + .endif + .endm + + .macro bilinear_interpolate_eight_pixels_head src_fmt, dst_fmt +-.ifdef have_bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt +- bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt&_head ++.ifdef have_bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt ++ bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt\()_head + .else +- bilinear_interpolate_four_pixels_head src_fmt, dst_fmt +- bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt ++ bilinear_interpolate_four_pixels_head \src_fmt, \dst_fmt ++ bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt + .endif + .endm + + .macro bilinear_interpolate_eight_pixels_tail src_fmt, dst_fmt +-.ifdef have_bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt +- bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt&_tail ++.ifdef have_bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt ++ bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail + .else +- bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt ++ bilinear_interpolate_four_pixels_tail \src_fmt, \dst_fmt + .endif + .endm + + .macro bilinear_interpolate_eight_pixels_tail_head src_fmt, dst_fmt +-.ifdef have_bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt +- bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt&_tail_head ++.ifdef have_bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt ++ bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail_head + .else +- bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt +- bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt ++ bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt ++ bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt + .endif + .endm + +@@ -3410,7 +3410,7 @@ generate_composite_function_nearest_scanline \ + src_bpp_shift, dst_bpp_shift, \ + prefetch_distance, flags + +-pixman_asm_function fname ++pixman_asm_function \fname + OUT .req x0 + TOP .req x1 + BOTTOM .req x2 +@@ -3442,7 +3442,7 @@ pixman_asm_function fname + stp x10, x11, [x29, -96] + stp x12, x13, [x29, -112] + +- mov PF_OFFS, #prefetch_distance ++ mov PF_OFFS, #\prefetch_distance + mul PF_OFFS, PF_OFFS, UX + + subs STRIDE, BOTTOM, TOP +@@ -3463,11 +3463,11 @@ pixman_asm_function fname + /* ensure good destination alignment */ + cmp WIDTH, #1 + blt 100f +- tst OUT, #(1 << dst_bpp_shift) ++ tst OUT, #(1 << \dst_bpp_shift) + beq 100f + ushr v15.8h, v12.8h, #(16 - BILINEAR_INTERPOLATION_BITS) + add v12.8h, v12.8h, v13.8h +- bilinear_interpolate_last_pixel src_fmt, dst_fmt ++ bilinear_interpolate_last_pixel \src_fmt, \dst_fmt + sub WIDTH, WIDTH, #1 + 100: + add v13.8h, v13.8h, v13.8h +@@ -3476,62 +3476,62 @@ pixman_asm_function fname + + cmp WIDTH, #2 + blt 100f +- tst OUT, #(1 << (dst_bpp_shift + 1)) ++ tst OUT, #(1 << (\dst_bpp_shift + 1)) + beq 100f +- bilinear_interpolate_two_pixels src_fmt, dst_fmt ++ bilinear_interpolate_two_pixels \src_fmt, \dst_fmt + sub WIDTH, WIDTH, #2 + 100: +-.if ((flags) & BILINEAR_FLAG_UNROLL_8) != 0 ++.if ((\flags) & BILINEAR_FLAG_UNROLL_8) != 0 + /*********** 8 pixels per iteration *****************/ + cmp WIDTH, #4 + blt 100f +- tst OUT, #(1 << (dst_bpp_shift + 2)) ++ tst OUT, #(1 << (\dst_bpp_shift + 2)) + beq 100f +- bilinear_interpolate_four_pixels src_fmt, dst_fmt ++ bilinear_interpolate_four_pixels \src_fmt, \dst_fmt + sub WIDTH, WIDTH, #4 + 100: + subs WIDTH, WIDTH, #8 + blt 100f +- asr PF_OFFS, PF_OFFS, #(16 - src_bpp_shift) +- bilinear_interpolate_eight_pixels_head src_fmt, dst_fmt ++ asr PF_OFFS, PF_OFFS, #(16 - \src_bpp_shift) ++ bilinear_interpolate_eight_pixels_head \src_fmt, \dst_fmt + subs WIDTH, WIDTH, #8 + blt 500f + 1000: +- bilinear_interpolate_eight_pixels_tail_head src_fmt, dst_fmt ++ bilinear_interpolate_eight_pixels_tail_head \src_fmt, \dst_fmt + subs WIDTH, WIDTH, #8 + bge 1000b + 500: +- bilinear_interpolate_eight_pixels_tail src_fmt, dst_fmt ++ bilinear_interpolate_eight_pixels_tail \src_fmt, \dst_fmt + 100: + tst WIDTH, #4 + beq 200f +- bilinear_interpolate_four_pixels src_fmt, dst_fmt ++ bilinear_interpolate_four_pixels \src_fmt, \dst_fmt + 200: + .else + /*********** 4 pixels per iteration *****************/ + subs WIDTH, WIDTH, #4 + blt 100f +- asr PF_OFFS, PF_OFFS, #(16 - src_bpp_shift) +- bilinear_interpolate_four_pixels_head src_fmt, dst_fmt ++ asr PF_OFFS, PF_OFFS, #(16 - \src_bpp_shift) ++ bilinear_interpolate_four_pixels_head \src_fmt, \dst_fmt + subs WIDTH, WIDTH, #4 + blt 500f + 1000: +- bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt ++ bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt + subs WIDTH, WIDTH, #4 + bge 1000b + 500: +- bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt ++ bilinear_interpolate_four_pixels_tail \src_fmt, \dst_fmt + 100: + /****************************************************/ + .endif + /* handle the remaining trailing pixels */ + tst WIDTH, #2 + beq 200f +- bilinear_interpolate_two_pixels src_fmt, dst_fmt ++ bilinear_interpolate_two_pixels \src_fmt, \dst_fmt + 200: + tst WIDTH, #1 + beq 300f +- bilinear_interpolate_last_pixel src_fmt, dst_fmt ++ bilinear_interpolate_last_pixel \src_fmt, \dst_fmt + 300: + sub x29, x29, 64 + ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [x29], #32 +@@ -3556,7 +3556,7 @@ pixman_asm_function fname + .unreq TMP3 + .unreq TMP4 + .unreq STRIDE +-.endfunc ++pixman_end_asm_function + + .endm + +diff --git a/pixman/pixman-arma64-neon-asm.h b/pixman/pixman-arma64-neon-asm.h +index 5d93172..6aa6838 100644 +--- a/pixman/pixman-arma64-neon-asm.h ++++ b/pixman/pixman-arma64-neon-asm.h +@@ -80,146 +80,146 @@ + */ + + .macro pixldst1 op, elem_size, reg1, mem_operand, abits +- op {v®1&.&elem_size}, [&mem_operand&], #8 ++ \op {v\()\reg1\().\()\elem_size}, [\()\mem_operand\()], #8 + .endm + + .macro pixldst2 op, elem_size, reg1, reg2, mem_operand, abits +- op {v®1&.&elem_size, v®2&.&elem_size}, [&mem_operand&], #16 ++ \op {v\()\reg1\().\()\elem_size, v\()\reg2\().\()\elem_size}, [\()\mem_operand\()], #16 + .endm + + .macro pixldst4 op, elem_size, reg1, reg2, reg3, reg4, mem_operand, abits +- op {v®1&.&elem_size, v®2&.&elem_size, v®3&.&elem_size, v®4&.&elem_size}, [&mem_operand&], #32 ++ \op {v\()\reg1\().\()\elem_size, v\()\reg2\().\()\elem_size, v\()\reg3\().\()\elem_size, v\()\reg4\().\()\elem_size}, [\()\mem_operand\()], #32 + .endm + + .macro pixldst0 op, elem_size, reg1, idx, mem_operand, abits, bytes +- op {v®1&.&elem_size}[idx], [&mem_operand&], #&bytes& ++ \op {v\()\reg1\().\()\elem_size}[\idx], [\()\mem_operand\()], #\()\bytes\() + .endm + + .macro pixldst3 op, elem_size, reg1, reg2, reg3, mem_operand +- op {v®1&.&elem_size, v®2&.&elem_size, v®3&.&elem_size}, [&mem_operand&], #24 ++ \op {v\()\reg1\().\()\elem_size, v\()\reg2\().\()\elem_size, v\()\reg3\().\()\elem_size}, [\()\mem_operand\()], #24 + .endm + + .macro pixldst30 op, elem_size, reg1, reg2, reg3, idx, mem_operand +- op {v®1&.&elem_size, v®2&.&elem_size, v®3&.&elem_size}[idx], [&mem_operand&], #3 ++ \op {v\()\reg1\().\()\elem_size, v\()\reg2\().\()\elem_size, v\()\reg3\().\()\elem_size}[\idx], [\()\mem_operand\()], #3 + .endm + + .macro pixldst numbytes, op, elem_size, basereg, mem_operand, abits +-.if numbytes == 32 +- .if elem_size==32 +- pixldst4 op, 2s, %(basereg+4), %(basereg+5), \ +- %(basereg+6), %(basereg+7), mem_operand, abits +- .elseif elem_size==16 +- pixldst4 op, 4h, %(basereg+4), %(basereg+5), \ +- %(basereg+6), %(basereg+7), mem_operand, abits ++.if \numbytes == 32 ++ .if \elem_size==32 ++ pixldst4 \op, 2s, %(\basereg+4), %(\basereg+5), \ ++ %(\basereg+6), %(\basereg+7), \mem_operand, \abits ++ .elseif \elem_size==16 ++ pixldst4 \op, 4h, %(\basereg+4), %(\basereg+5), \ ++ %(\basereg+6), %(\basereg+7), \mem_operand, \abits + .else +- pixldst4 op, 8b, %(basereg+4), %(basereg+5), \ +- %(basereg+6), %(basereg+7), mem_operand, abits ++ pixldst4 \op, 8b, %(\basereg+4), %(\basereg+5), \ ++ %(\basereg+6), %(\basereg+7), \mem_operand, \abits + .endif +-.elseif numbytes == 16 +- .if elem_size==32 +- pixldst2 op, 2s, %(basereg+2), %(basereg+3), mem_operand, abits +- .elseif elem_size==16 +- pixldst2 op, 4h, %(basereg+2), %(basereg+3), mem_operand, abits ++.elseif \numbytes == 16 ++ .if \elem_size==32 ++ pixldst2 \op, 2s, %(\basereg+2), %(\basereg+3), \mem_operand, \abits ++ .elseif \elem_size==16 ++ pixldst2 \op, 4h, %(\basereg+2), %(\basereg+3), \mem_operand, \abits + .else +- pixldst2 op, 8b, %(basereg+2), %(basereg+3), mem_operand, abits ++ pixldst2 \op, 8b, %(\basereg+2), %(\basereg+3), \mem_operand, \abits + .endif +-.elseif numbytes == 8 +- .if elem_size==32 +- pixldst1 op, 2s, %(basereg+1), mem_operand, abits +- .elseif elem_size==16 +- pixldst1 op, 4h, %(basereg+1), mem_operand, abits ++.elseif \numbytes == 8 ++ .if \elem_size==32 ++ pixldst1 \op, 2s, %(\basereg+1), \mem_operand, \abits ++ .elseif \elem_size==16 ++ pixldst1 \op, 4h, %(\basereg+1), \mem_operand, \abits + .else +- pixldst1 op, 8b, %(basereg+1), mem_operand, abits ++ pixldst1 \op, 8b, %(\basereg+1), \mem_operand, \abits + .endif +-.elseif numbytes == 4 +- .if !RESPECT_STRICT_ALIGNMENT || (elem_size == 32) +- pixldst0 op, s, %(basereg+0), 1, mem_operand, abits, 4 +- .elseif elem_size == 16 +- pixldst0 op, h, %(basereg+0), 2, mem_operand, abits, 2 +- pixldst0 op, h, %(basereg+0), 3, mem_operand, abits, 2 ++.elseif \numbytes == 4 ++ .if !RESPECT_STRICT_ALIGNMENT || (\elem_size == 32) ++ pixldst0 \op, s, %(\basereg+0), 1, \mem_operand, \abits, 4 ++ .elseif \elem_size == 16 ++ pixldst0 \op, h, %(\basereg+0), 2, \mem_operand, \abits, 2 ++ pixldst0 \op, h, %(\basereg+0), 3, \mem_operand, \abits, 2 + .else +- pixldst0 op, b, %(basereg+0), 4, mem_operand, abits, 1 +- pixldst0 op, b, %(basereg+0), 5, mem_operand, abits, 1 +- pixldst0 op, b, %(basereg+0), 6, mem_operand, abits, 1 +- pixldst0 op, b, %(basereg+0), 7, mem_operand, abits, 1 ++ pixldst0 \op, b, %(\basereg+0), 4, \mem_operand, \abits, 1 ++ pixldst0 \op, b, %(\basereg+0), 5, \mem_operand, \abits, 1 ++ pixldst0 \op, b, %(\basereg+0), 6, \mem_operand, \abits, 1 ++ pixldst0 \op, b, %(\basereg+0), 7, \mem_operand, \abits, 1 + .endif +-.elseif numbytes == 2 +- .if !RESPECT_STRICT_ALIGNMENT || (elem_size == 16) +- pixldst0 op, h, %(basereg+0), 1, mem_operand, abits, 2 ++.elseif \numbytes == 2 ++ .if !RESPECT_STRICT_ALIGNMENT || (\elem_size == 16) ++ pixldst0 \op, h, %(\basereg+0), 1, \mem_operand, \abits, 2 + .else +- pixldst0 op, b, %(basereg+0), 2, mem_operand, abits, 1 +- pixldst0 op, b, %(basereg+0), 3, mem_operand, abits, 1 ++ pixldst0 \op, b, %(\basereg+0), 2, \mem_operand, \abits, 1 ++ pixldst0 \op, b, %(\basereg+0), 3, \mem_operand, \abits, 1 + .endif +-.elseif numbytes == 1 +- pixldst0 op, b, %(basereg+0), 1, mem_operand, abits, 1 ++.elseif \numbytes == 1 ++ pixldst0 \op, b, %(\basereg+0), 1, \mem_operand, \abits, 1 + .else +- .error "unsupported size: numbytes" ++ .error "unsupported size: \numbytes" + .endif + .endm + + .macro pixld numpix, bpp, basereg, mem_operand, abits=0 +-.if bpp > 0 +-.if (bpp == 32) && (numpix == 8) && (DEINTERLEAVE_32BPP_ENABLED != 0) +- pixldst4 ld4, 8b, %(basereg+4), %(basereg+5), \ +- %(basereg+6), %(basereg+7), mem_operand, abits +-.elseif (bpp == 24) && (numpix == 8) +- pixldst3 ld3, 8b, %(basereg+3), %(basereg+4), %(basereg+5), mem_operand +-.elseif (bpp == 24) && (numpix == 4) +- pixldst30 ld3, b, %(basereg+0), %(basereg+1), %(basereg+2), 4, mem_operand +- pixldst30 ld3, b, %(basereg+0), %(basereg+1), %(basereg+2), 5, mem_operand +- pixldst30 ld3, b, %(basereg+0), %(basereg+1), %(basereg+2), 6, mem_operand +- pixldst30 ld3, b, %(basereg+0), %(basereg+1), %(basereg+2), 7, mem_operand +-.elseif (bpp == 24) && (numpix == 2) +- pixldst30 ld3, b, %(basereg+0), %(basereg+1), %(basereg+2), 2, mem_operand +- pixldst30 ld3, b, %(basereg+0), %(basereg+1), %(basereg+2), 3, mem_operand +-.elseif (bpp == 24) && (numpix == 1) +- pixldst30 ld3, b, %(basereg+0), %(basereg+1), %(basereg+2), 1, mem_operand ++.if \bpp > 0 ++.if (\bpp == 32) && (\numpix == 8) && (DEINTERLEAVE_32BPP_ENABLED != 0) ++ pixldst4 ld4, 8b, %(\basereg+4), %(\basereg+5), \ ++ %(\basereg+6), %(\basereg+7), \mem_operand, \abits ++.elseif (\bpp == 24) && (\numpix == 8) ++ pixldst3 ld3, 8b, %(\basereg+3), %(\basereg+4), %(\basereg+5), \mem_operand ++.elseif (\bpp == 24) && (\numpix == 4) ++ pixldst30 ld3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 4, \mem_operand ++ pixldst30 ld3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 5, \mem_operand ++ pixldst30 ld3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 6, \mem_operand ++ pixldst30 ld3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 7, \mem_operand ++.elseif (\bpp == 24) && (\numpix == 2) ++ pixldst30 ld3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 2, \mem_operand ++ pixldst30 ld3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 3, \mem_operand ++.elseif (\bpp == 24) && (\numpix == 1) ++ pixldst30 ld3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 1, \mem_operand + .else +- pixldst %(numpix * bpp / 8), ld1, %(bpp), basereg, mem_operand, abits ++ pixldst %(\numpix * \bpp / 8), ld1, %(\bpp), \basereg, \mem_operand, \abits + .endif + .endif + .endm + + .macro pixst numpix, bpp, basereg, mem_operand, abits=0 +-.if bpp > 0 +-.if (bpp == 32) && (numpix == 8) && (DEINTERLEAVE_32BPP_ENABLED != 0) +- pixldst4 st4, 8b, %(basereg+4), %(basereg+5), \ +- %(basereg+6), %(basereg+7), mem_operand, abits +-.elseif (bpp == 24) && (numpix == 8) +- pixldst3 st3, 8b, %(basereg+3), %(basereg+4), %(basereg+5), mem_operand +-.elseif (bpp == 24) && (numpix == 4) +- pixldst30 st3, b, %(basereg+0), %(basereg+1), %(basereg+2), 4, mem_operand +- pixldst30 st3, b, %(basereg+0), %(basereg+1), %(basereg+2), 5, mem_operand +- pixldst30 st3, b, %(basereg+0), %(basereg+1), %(basereg+2), 6, mem_operand +- pixldst30 st3, b, %(basereg+0), %(basereg+1), %(basereg+2), 7, mem_operand +-.elseif (bpp == 24) && (numpix == 2) +- pixldst30 st3, b, %(basereg+0), %(basereg+1), %(basereg+2), 2, mem_operand +- pixldst30 st3, b, %(basereg+0), %(basereg+1), %(basereg+2), 3, mem_operand +-.elseif (bpp == 24) && (numpix == 1) +- pixldst30 st3, b, %(basereg+0), %(basereg+1), %(basereg+2), 1, mem_operand +-.elseif numpix * bpp == 32 && abits == 32 +- pixldst 4, st1, 32, basereg, mem_operand, abits +-.elseif numpix * bpp == 16 && abits == 16 +- pixldst 2, st1, 16, basereg, mem_operand, abits ++.if \bpp > 0 ++.if (\bpp == 32) && (\numpix == 8) && (DEINTERLEAVE_32BPP_ENABLED != 0) ++ pixldst4 st4, 8b, %(\basereg+4), %(\basereg+5), \ ++ %(\basereg+6), %(\basereg+7), \mem_operand, \abits ++.elseif (\bpp == 24) && (\numpix == 8) ++ pixldst3 st3, 8b, %(\basereg+3), %(\basereg+4), %(\basereg+5), \mem_operand ++.elseif (\bpp == 24) && (\numpix == 4) ++ pixldst30 st3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 4, \mem_operand ++ pixldst30 st3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 5, \mem_operand ++ pixldst30 st3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 6, \mem_operand ++ pixldst30 st3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 7, \mem_operand ++.elseif (\bpp == 24) && (\numpix == 2) ++ pixldst30 st3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 2, \mem_operand ++ pixldst30 st3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 3, \mem_operand ++.elseif (\bpp == 24) && (\numpix == 1) ++ pixldst30 st3, b, %(\basereg+0), %(\basereg+1), %(\basereg+2), 1, \mem_operand ++.elseif \numpix * \bpp == 32 && \abits == 32 ++ pixldst 4, st1, 32, \basereg, \mem_operand, \abits ++.elseif \numpix * \bpp == 16 && \abits == 16 ++ pixldst 2, st1, 16, \basereg, \mem_operand, \abits + .else +- pixldst %(numpix * bpp / 8), st1, %(bpp), basereg, mem_operand, abits ++ pixldst %(\numpix * \bpp / 8), st1, %(\bpp), \basereg, \mem_operand, \abits + .endif + .endif + .endm + + .macro pixld_a numpix, bpp, basereg, mem_operand +-.if (bpp * numpix) <= 128 +- pixld numpix, bpp, basereg, mem_operand, %(bpp * numpix) ++.if (\bpp * \numpix) <= 128 ++ pixld \numpix, \bpp, \basereg, \mem_operand, %(\bpp * \numpix) + .else +- pixld numpix, bpp, basereg, mem_operand, 128 ++ pixld \numpix, \bpp, \basereg, \mem_operand, 128 + .endif + .endm + + .macro pixst_a numpix, bpp, basereg, mem_operand +-.if (bpp * numpix) <= 128 +- pixst numpix, bpp, basereg, mem_operand, %(bpp * numpix) ++.if (\bpp * \numpix) <= 128 ++ pixst \numpix, \bpp, \basereg, \mem_operand, %(\bpp * \numpix) + .else +- pixst numpix, bpp, basereg, mem_operand, 128 ++ pixst \numpix, \bpp, \basereg, \mem_operand, 128 + .endif + .endm + +@@ -228,96 +228,96 @@ + * aliases to be defined) + */ + .macro pixld1_s elem_size, reg1, mem_operand +-.if elem_size == 16 ++.if \elem_size == 16 + asr TMP1, VX, #16 + adds VX, VX, UNIT_X + bmi 55f + 5: subs VX, VX, SRC_WIDTH_FIXED + bpl 5b + 55: +- add TMP1, mem_operand, TMP1, lsl #1 ++ add TMP1, \mem_operand, TMP1, lsl #1 + asr TMP2, VX, #16 + adds VX, VX, UNIT_X + bmi 55f + 5: subs VX, VX, SRC_WIDTH_FIXED + bpl 5b + 55: +- add TMP2, mem_operand, TMP2, lsl #1 +- ld1 {v®1&.h}[0], [TMP1] ++ add TMP2, \mem_operand, TMP2, lsl #1 ++ ld1 {v\()\reg1\().h}[0], [TMP1] + asr TMP1, VX, #16 + adds VX, VX, UNIT_X + bmi 55f + 5: subs VX, VX, SRC_WIDTH_FIXED + bpl 5b + 55: +- add TMP1, mem_operand, TMP1, lsl #1 +- ld1 {v®1&.h}[1], [TMP2] ++ add TMP1, \mem_operand, TMP1, lsl #1 ++ ld1 {v\()\reg1\().h}[1], [TMP2] + asr TMP2, VX, #16 + adds VX, VX, UNIT_X + bmi 55f + 5: subs VX, VX, SRC_WIDTH_FIXED + bpl 5b + 55: +- add TMP2, mem_operand, TMP2, lsl #1 +- ld1 {v®1&.h}[2], [TMP1] +- ld1 {v®1&.h}[3], [TMP2] +-.elseif elem_size == 32 ++ add TMP2, \mem_operand, TMP2, lsl #1 ++ ld1 {v\()\reg1\().h}[2], [TMP1] ++ ld1 {v\()\reg1\().h}[3], [TMP2] ++.elseif \elem_size == 32 + asr TMP1, VX, #16 + adds VX, VX, UNIT_X + bmi 55f + 5: subs VX, VX, SRC_WIDTH_FIXED + bpl 5b + 55: +- add TMP1, mem_operand, TMP1, lsl #2 ++ add TMP1, \mem_operand, TMP1, lsl #2 + asr TMP2, VX, #16 + adds VX, VX, UNIT_X + bmi 55f + 5: subs VX, VX, SRC_WIDTH_FIXED + bpl 5b + 55: +- add TMP2, mem_operand, TMP2, lsl #2 +- ld1 {v®1&.s}[0], [TMP1] +- ld1 {v®1&.s}[1], [TMP2] ++ add TMP2, \mem_operand, TMP2, lsl #2 ++ ld1 {v\()\reg1\().s}[0], [TMP1] ++ ld1 {v\()\reg1\().s}[1], [TMP2] + .else + .error "unsupported" + .endif + .endm + + .macro pixld2_s elem_size, reg1, reg2, mem_operand +-.if 0 /* elem_size == 32 */ ++.if 0 /* \elem_size == 32 */ + mov TMP1, VX, asr #16 + add VX, VX, UNIT_X, asl #1 +- add TMP1, mem_operand, TMP1, asl #2 ++ add TMP1, \mem_operand, TMP1, asl #2 + mov TMP2, VX, asr #16 + sub VX, VX, UNIT_X +- add TMP2, mem_operand, TMP2, asl #2 +- ld1 {v®1&.s}[0], [TMP1] ++ add TMP2, \mem_operand, TMP2, asl #2 ++ ld1 {v\()\reg1\().s}[0], [TMP1] + mov TMP1, VX, asr #16 + add VX, VX, UNIT_X, asl #1 +- add TMP1, mem_operand, TMP1, asl #2 +- ld1 {v®2&.s}[0], [TMP2, :32] ++ add TMP1, \mem_operand, TMP1, asl #2 ++ ld1 {v\()\reg2\().s}[0], [TMP2, :32] + mov TMP2, VX, asr #16 + add VX, VX, UNIT_X +- add TMP2, mem_operand, TMP2, asl #2 +- ld1 {v®1&.s}[1], [TMP1] +- ld1 {v®2&.s}[1], [TMP2] ++ add TMP2, \mem_operand, TMP2, asl #2 ++ ld1 {v\()\reg1\().s}[1], [TMP1] ++ ld1 {v\()\reg2\().s}[1], [TMP2] + .else +- pixld1_s elem_size, reg1, mem_operand +- pixld1_s elem_size, reg2, mem_operand ++ pixld1_s \elem_size, \reg1, \mem_operand ++ pixld1_s \elem_size, \reg2, \mem_operand + .endif + .endm + + .macro pixld0_s elem_size, reg1, idx, mem_operand +-.if elem_size == 16 ++.if \elem_size == 16 + asr TMP1, VX, #16 + adds VX, VX, UNIT_X + bmi 55f + 5: subs VX, VX, SRC_WIDTH_FIXED + bpl 5b + 55: +- add TMP1, mem_operand, TMP1, lsl #1 +- ld1 {v®1&.h}[idx], [TMP1] +-.elseif elem_size == 32 ++ add TMP1, \mem_operand, TMP1, lsl #1 ++ ld1 {v\()\reg1\().h}[\idx], [TMP1] ++.elseif \elem_size == 32 + asr DUMMY, VX, #16 + mov TMP1, DUMMY + adds VX, VX, UNIT_X +@@ -325,85 +325,85 @@ + 5: subs VX, VX, SRC_WIDTH_FIXED + bpl 5b + 55: +- add TMP1, mem_operand, TMP1, lsl #2 +- ld1 {v®1&.s}[idx], [TMP1] ++ add TMP1, \mem_operand, TMP1, lsl #2 ++ ld1 {v\()\reg1\().s}[\idx], [TMP1] + .endif + .endm + + .macro pixld_s_internal numbytes, elem_size, basereg, mem_operand +-.if numbytes == 32 +- pixld2_s elem_size, %(basereg+4), %(basereg+5), mem_operand +- pixld2_s elem_size, %(basereg+6), %(basereg+7), mem_operand +- pixdeinterleave elem_size, %(basereg+4) +-.elseif numbytes == 16 +- pixld2_s elem_size, %(basereg+2), %(basereg+3), mem_operand +-.elseif numbytes == 8 +- pixld1_s elem_size, %(basereg+1), mem_operand +-.elseif numbytes == 4 +- .if elem_size == 32 +- pixld0_s elem_size, %(basereg+0), 1, mem_operand +- .elseif elem_size == 16 +- pixld0_s elem_size, %(basereg+0), 2, mem_operand +- pixld0_s elem_size, %(basereg+0), 3, mem_operand ++.if \numbytes == 32 ++ pixld2_s \elem_size, %(\basereg+4), %(\basereg+5), \mem_operand ++ pixld2_s \elem_size, %(\basereg+6), %(\basereg+7), \mem_operand ++ pixdeinterleave \elem_size, %(\basereg+4) ++.elseif \numbytes == 16 ++ pixld2_s \elem_size, %(\basereg+2), %(\basereg+3), \mem_operand ++.elseif \numbytes == 8 ++ pixld1_s \elem_size, %(\basereg+1), \mem_operand ++.elseif \numbytes == 4 ++ .if \elem_size == 32 ++ pixld0_s \elem_size, %(\basereg+0), 1, \mem_operand ++ .elseif \elem_size == 16 ++ pixld0_s \elem_size, %(\basereg+0), 2, \mem_operand ++ pixld0_s \elem_size, %(\basereg+0), 3, \mem_operand + .else +- pixld0_s elem_size, %(basereg+0), 4, mem_operand +- pixld0_s elem_size, %(basereg+0), 5, mem_operand +- pixld0_s elem_size, %(basereg+0), 6, mem_operand +- pixld0_s elem_size, %(basereg+0), 7, mem_operand ++ pixld0_s \elem_size, %(\basereg+0), 4, \mem_operand ++ pixld0_s \elem_size, %(\basereg+0), 5, \mem_operand ++ pixld0_s \elem_size, %(\basereg+0), 6, \mem_operand ++ pixld0_s \elem_size, %(\basereg+0), 7, \mem_operand + .endif +-.elseif numbytes == 2 +- .if elem_size == 16 +- pixld0_s elem_size, %(basereg+0), 1, mem_operand ++.elseif \numbytes == 2 ++ .if \elem_size == 16 ++ pixld0_s \elem_size, %(\basereg+0), 1, \mem_operand + .else +- pixld0_s elem_size, %(basereg+0), 2, mem_operand +- pixld0_s elem_size, %(basereg+0), 3, mem_operand ++ pixld0_s \elem_size, %(\basereg+0), 2, \mem_operand ++ pixld0_s \elem_size, %(\basereg+0), 3, \mem_operand + .endif +-.elseif numbytes == 1 +- pixld0_s elem_size, %(basereg+0), 1, mem_operand ++.elseif \numbytes == 1 ++ pixld0_s \elem_size, %(\basereg+0), 1, \mem_operand + .else +- .error "unsupported size: numbytes" ++ .error "unsupported size: \numbytes" + .endif + .endm + + .macro pixld_s numpix, bpp, basereg, mem_operand +-.if bpp > 0 +- pixld_s_internal %(numpix * bpp / 8), %(bpp), basereg, mem_operand ++.if \bpp > 0 ++ pixld_s_internal %(\numpix * \bpp / 8), %(\bpp), \basereg, \mem_operand + .endif + .endm + + .macro vuzp8 reg1, reg2 + umov DUMMY, v16.d[0] +- uzp1 v16.8b, v®1&.8b, v®2&.8b +- uzp2 v®2&.8b, v®1&.8b, v®2&.8b +- mov v®1&.8b, v16.8b ++ uzp1 v16.8b, v\()\reg1\().8b, v\()\reg2\().8b ++ uzp2 v\()\reg2\().8b, v\()\reg1\().8b, v\()\reg2\().8b ++ mov v\()\reg1\().8b, v16.8b + mov v16.d[0], DUMMY + .endm + + .macro vzip8 reg1, reg2 + umov DUMMY, v16.d[0] +- zip1 v16.8b, v®1&.8b, v®2&.8b +- zip2 v®2&.8b, v®1&.8b, v®2&.8b +- mov v®1&.8b, v16.8b ++ zip1 v16.8b, v\()\reg1\().8b, v\()\reg2\().8b ++ zip2 v\()\reg2\().8b, v\()\reg1\().8b, v\()\reg2\().8b ++ mov v\()\reg1\().8b, v16.8b + mov v16.d[0], DUMMY + .endm + + /* deinterleave B, G, R, A channels for eight 32bpp pixels in 4 registers */ + .macro pixdeinterleave bpp, basereg +-.if (bpp == 32) && (DEINTERLEAVE_32BPP_ENABLED != 0) +- vuzp8 %(basereg+0), %(basereg+1) +- vuzp8 %(basereg+2), %(basereg+3) +- vuzp8 %(basereg+1), %(basereg+3) +- vuzp8 %(basereg+0), %(basereg+2) ++.if (\bpp == 32) && (DEINTERLEAVE_32BPP_ENABLED != 0) ++ vuzp8 %(\basereg+0), %(\basereg+1) ++ vuzp8 %(\basereg+2), %(\basereg+3) ++ vuzp8 %(\basereg+1), %(\basereg+3) ++ vuzp8 %(\basereg+0), %(\basereg+2) + .endif + .endm + + /* interleave B, G, R, A channels for eight 32bpp pixels in 4 registers */ + .macro pixinterleave bpp, basereg +-.if (bpp == 32) && (DEINTERLEAVE_32BPP_ENABLED != 0) +- vzip8 %(basereg+0), %(basereg+2) +- vzip8 %(basereg+1), %(basereg+3) +- vzip8 %(basereg+2), %(basereg+3) +- vzip8 %(basereg+0), %(basereg+1) ++.if (\bpp == 32) && (DEINTERLEAVE_32BPP_ENABLED != 0) ++ vzip8 %(\basereg+0), %(\basereg+2) ++ vzip8 %(\basereg+1), %(\basereg+3) ++ vzip8 %(\basereg+2), %(\basereg+3) ++ vzip8 %(\basereg+0), %(\basereg+1) + .endif + .endm + +@@ -437,52 +437,52 @@ + */ + .macro PF a, x:vararg + .if (PREFETCH_TYPE_CURRENT == PREFETCH_TYPE_ADVANCED) +- a x ++ \a \x + .endif + .endm + + .macro cache_preload std_increment, boost_increment + .if (src_bpp_shift >= 0) || (dst_r_bpp != 0) || (mask_bpp_shift >= 0) +-.if std_increment != 0 +- PF add PF_X, PF_X, #std_increment ++.if \std_increment != 0 ++ PF add, PF_X, PF_X, #\std_increment + .endif +- PF tst PF_CTL, #0xF +- PF beq 71f +- PF add PF_X, PF_X, #boost_increment +- PF sub PF_CTL, PF_CTL, #1 ++ PF tst, PF_CTL, #0xF ++ PF beq, 71f ++ PF add, PF_X, PF_X, #\boost_increment ++ PF sub, PF_CTL, PF_CTL, #1 + 71: +- PF cmp PF_X, ORIG_W ++ PF cmp, PF_X, ORIG_W + .if src_bpp_shift >= 0 +- PF lsl DUMMY, PF_X, #src_bpp_shift +- PF prfm PREFETCH_MODE, [PF_SRC, DUMMY] ++ PF lsl, DUMMY, PF_X, #src_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_SRC, DUMMY] + .endif + .if dst_r_bpp != 0 +- PF lsl DUMMY, PF_X, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [PF_DST, DUMMY] ++ PF lsl, DUMMY, PF_X, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_DST, DUMMY] + .endif + .if mask_bpp_shift >= 0 +- PF lsl DUMMY, PF_X, #mask_bpp_shift +- PF prfm PREFETCH_MODE, [PF_MASK, DUMMY] ++ PF lsl, DUMMY, PF_X, #mask_bpp_shift ++ PF prfm, PREFETCH_MODE, [PF_MASK, DUMMY] + .endif +- PF ble 71f +- PF sub PF_X, PF_X, ORIG_W +- PF subs PF_CTL, PF_CTL, #0x10 ++ PF ble, 71f ++ PF sub, PF_X, PF_X, ORIG_W ++ PF subs, PF_CTL, PF_CTL, #0x10 + 71: +- PF ble 72f ++ PF ble, 72f + .if src_bpp_shift >= 0 +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF ldrsb DUMMY, [PF_SRC, DUMMY] +- PF add PF_SRC, PF_SRC, #1 ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF ldrsb, DUMMY, [PF_SRC, DUMMY] ++ PF add, PF_SRC, PF_SRC, #1 + .endif + .if dst_r_bpp != 0 +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF ldrsb DUMMY, [PF_DST, DUMMY] +- PF add PF_DST, PF_DST, #1 ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF ldrsb, DUMMY, [PF_DST, DUMMY] ++ PF add, PF_DST, PF_DST, #1 + .endif + .if mask_bpp_shift >= 0 +- PF lsl DUMMY, MASK_STRIDE, #mask_bpp_shift +- PF ldrsb DUMMY, [PF_MASK, DUMMY] +- PF add PF_MASK, PF_MASK, #1 ++ PF lsl, DUMMY, MASK_STRIDE, #mask_bpp_shift ++ PF ldrsb, DUMMY, [PF_MASK, DUMMY] ++ PF add, PF_MASK, PF_MASK, #1 + .endif + 72: + .endif +@@ -521,21 +521,21 @@ + + .if src_bpp > 0 || mask_bpp > 0 || dst_r_bpp > 0 + .irp lowbit, 1, 2, 4, 8, 16 +-local skip1 +-.if (dst_w_bpp <= (lowbit * 8)) && ((lowbit * 8) < (pixblock_size * dst_w_bpp)) +-.if lowbit < 16 /* we don't need more than 16-byte alignment */ +- tst DST_R, #lowbit ++ ++.if (dst_w_bpp <= (\lowbit * 8)) && ((\lowbit * 8) < (pixblock_size * dst_w_bpp)) ++.if \lowbit < 16 /* we don't need more than 16-byte alignment */ ++ tst DST_R, #\lowbit + beq 51f + .endif +- pixld_src (lowbit * 8 / dst_w_bpp), src_bpp, src_basereg, SRC +- pixld (lowbit * 8 / dst_w_bpp), mask_bpp, mask_basereg, MASK ++ pixld_src (\lowbit * 8 / dst_w_bpp), src_bpp, src_basereg, SRC ++ pixld (\lowbit * 8 / dst_w_bpp), mask_bpp, mask_basereg, MASK + .if dst_r_bpp > 0 +- pixld_a (lowbit * 8 / dst_r_bpp), dst_r_bpp, dst_r_basereg, DST_R ++ pixld_a (\lowbit * 8 / dst_r_bpp), dst_r_bpp, dst_r_basereg, DST_R + .else +- add DST_R, DST_R, #lowbit ++ add DST_R, DST_R, #\lowbit + .endif +- PF add PF_X, PF_X, #(lowbit * 8 / dst_w_bpp) +- sub W, W, #(lowbit * 8 / dst_w_bpp) ++ PF add, PF_X, PF_X, #(\lowbit * 8 / dst_w_bpp) ++ sub W, W, #(\lowbit * 8 / dst_w_bpp) + 51: + .endif + .endr +@@ -544,23 +544,23 @@ local skip1 + pixdeinterleave mask_bpp, mask_basereg + pixdeinterleave dst_r_bpp, dst_r_basereg + +- process_pixblock_head ++ \process_pixblock_head + cache_preload 0, pixblock_size + cache_preload_simple +- process_pixblock_tail ++ \process_pixblock_tail + + pixinterleave dst_w_bpp, dst_w_basereg + + .irp lowbit, 1, 2, 4, 8, 16 +-.if (dst_w_bpp <= (lowbit * 8)) && ((lowbit * 8) < (pixblock_size * dst_w_bpp)) +-.if lowbit < 16 /* we don't need more than 16-byte alignment */ +- tst DST_W, #lowbit ++.if (dst_w_bpp <= (\lowbit * 8)) && ((\lowbit * 8) < (pixblock_size * dst_w_bpp)) ++.if \lowbit < 16 /* we don't need more than 16-byte alignment */ ++ tst DST_W, #\lowbit + beq 51f + .endif + .if src_bpp == 0 && mask_bpp == 0 && dst_r_bpp == 0 +- sub W, W, #(lowbit * 8 / dst_w_bpp) ++ sub W, W, #(\lowbit * 8 / dst_w_bpp) + .endif +- pixst_a (lowbit * 8 / dst_w_bpp), dst_w_bpp, dst_w_basereg, DST_W ++ pixst_a (\lowbit * 8 / dst_w_bpp), dst_w_bpp, dst_w_basereg, DST_W + 51: + .endif + .endr +@@ -592,18 +592,18 @@ local skip1 + beq 52f + .if src_bpp > 0 || mask_bpp > 0 || dst_r_bpp > 0 + .irp chunk_size, 16, 8, 4, 2, 1 +-.if pixblock_size > chunk_size +- tst W, #chunk_size ++.if pixblock_size > \chunk_size ++ tst W, #\chunk_size + beq 51f +- pixld_src chunk_size, src_bpp, src_basereg, SRC +- pixld chunk_size, mask_bpp, mask_basereg, MASK +-.if dst_aligned_flag != 0 +- pixld_a chunk_size, dst_r_bpp, dst_r_basereg, DST_R ++ pixld_src \chunk_size, src_bpp, src_basereg, SRC ++ pixld \chunk_size, mask_bpp, mask_basereg, MASK ++.if \dst_aligned_flag != 0 ++ pixld_a \chunk_size, dst_r_bpp, dst_r_basereg, DST_R + .else +- pixld chunk_size, dst_r_bpp, dst_r_basereg, DST_R ++ pixld \chunk_size, dst_r_bpp, dst_r_basereg, DST_R + .endif +-.if cache_preload_flag != 0 +- PF add PF_X, PF_X, #chunk_size ++.if \cache_preload_flag != 0 ++ PF add, PF_X, PF_X, #\chunk_size + .endif + 51: + .endif +@@ -613,21 +613,21 @@ local skip1 + pixdeinterleave mask_bpp, mask_basereg + pixdeinterleave dst_r_bpp, dst_r_basereg + +- process_pixblock_head +-.if cache_preload_flag != 0 ++ \process_pixblock_head ++.if \cache_preload_flag != 0 + cache_preload 0, pixblock_size + cache_preload_simple + .endif +- process_pixblock_tail ++ \process_pixblock_tail + pixinterleave dst_w_bpp, dst_w_basereg + .irp chunk_size, 16, 8, 4, 2, 1 +-.if pixblock_size > chunk_size +- tst W, #chunk_size ++.if pixblock_size > \chunk_size ++ tst W, #\chunk_size + beq 51f +-.if dst_aligned_flag != 0 +- pixst_a chunk_size, dst_w_bpp, dst_w_basereg, DST_W ++.if \dst_aligned_flag != 0 ++ pixst_a \chunk_size, dst_w_bpp, dst_w_basereg, DST_W + .else +- pixst chunk_size, dst_w_bpp, dst_w_basereg, DST_W ++ pixst \chunk_size, dst_w_bpp, dst_w_basereg, DST_W + .endif + 51: + .endif +@@ -660,7 +660,7 @@ local skip1 + .endif + subs H, H, #1 + mov DST_R, DST_W +- bge start_of_loop_label ++ bge \start_of_loop_label + .endm + + /* +@@ -687,7 +687,7 @@ local skip1 + src_basereg_ = 0, \ + mask_basereg_ = 24 + +- pixman_asm_function fname ++ pixman_asm_function \fname + stp x29, x30, [sp, -16]! + mov x29, sp + sub sp, sp, 232 /* push all registers */ +@@ -712,10 +712,10 @@ local skip1 + * has to be used instead of ADVANCED. + */ + .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_DEFAULT +-.if prefetch_distance == 0 ++.if \prefetch_distance == 0 + .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_NONE + .elseif (PREFETCH_TYPE_CURRENT > PREFETCH_TYPE_SIMPLE) && \ +- ((src_bpp_ == 24) || (mask_bpp_ == 24) || (dst_w_bpp_ == 24)) ++ ((\src_bpp_ == 24) || (\mask_bpp_ == 24) || (\dst_w_bpp_ == 24)) + .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_SIMPLE + .endif + +@@ -723,17 +723,17 @@ local skip1 + * Make some macro arguments globally visible and accessible + * from other macros + */ +- .set src_bpp, src_bpp_ +- .set mask_bpp, mask_bpp_ +- .set dst_w_bpp, dst_w_bpp_ +- .set pixblock_size, pixblock_size_ +- .set dst_w_basereg, dst_w_basereg_ +- .set dst_r_basereg, dst_r_basereg_ +- .set src_basereg, src_basereg_ +- .set mask_basereg, mask_basereg_ ++ .set src_bpp, \src_bpp_ ++ .set mask_bpp, \mask_bpp_ ++ .set dst_w_bpp, \dst_w_bpp_ ++ .set pixblock_size, \pixblock_size_ ++ .set dst_w_basereg, \dst_w_basereg_ ++ .set dst_r_basereg, \dst_r_basereg_ ++ .set src_basereg, \src_basereg_ ++ .set mask_basereg, \mask_basereg_ + + .macro pixld_src x:vararg +- pixld x ++ pixld \x + .endm + .macro fetch_src_pixblock + pixld_src pixblock_size, src_bpp, \ +@@ -810,22 +810,22 @@ local skip1 + .error "requested dst bpp (dst_w_bpp) is not supported" + .endif + +-.if (((flags) & FLAG_DST_READWRITE) != 0) ++.if (((\flags) & FLAG_DST_READWRITE) != 0) + .set dst_r_bpp, dst_w_bpp + .else + .set dst_r_bpp, 0 + .endif +-.if (((flags) & FLAG_DEINTERLEAVE_32BPP) != 0) ++.if (((\flags) & FLAG_DEINTERLEAVE_32BPP) != 0) + .set DEINTERLEAVE_32BPP_ENABLED, 1 + .else + .set DEINTERLEAVE_32BPP_ENABLED, 0 + .endif + +-.if prefetch_distance < 0 || prefetch_distance > 15 +- .error "invalid prefetch distance (prefetch_distance)" ++.if \prefetch_distance < 0 || \prefetch_distance > 15 ++ .error "invalid prefetch distance (\prefetch_distance)" + .endif + +- PF mov PF_X, #0 ++ PF mov, PF_X, #0 + mov DST_R, DST_W + + .if src_bpp == 24 +@@ -844,15 +844,15 @@ local skip1 + /* + * Setup advanced prefetcher initial state + */ +- PF mov PF_SRC, SRC +- PF mov PF_DST, DST_R +- PF mov PF_MASK, MASK +- /* PF_CTL = prefetch_distance | ((h - 1) << 4) */ +- PF lsl DUMMY, H, #4 +- PF mov PF_CTL, DUMMY +- PF add PF_CTL, PF_CTL, #(prefetch_distance - 0x10) +- +- init ++ PF mov, PF_SRC, SRC ++ PF mov, PF_DST, DST_R ++ PF mov, PF_MASK, MASK ++ /* PF_CTL = \prefetch_distance | ((h - 1) << 4) */ ++ PF lsl, DUMMY, H, #4 ++ PF mov, PF_CTL, DUMMY ++ PF add, PF_CTL, PF_CTL, #(\prefetch_distance - 0x10) ++ ++ \init + subs H, H, #1 + mov ORIG_W, W + blt 9f +@@ -863,9 +863,9 @@ local skip1 + * long scanlines + */ + 0: +- ensure_destination_ptr_alignment process_pixblock_head, \ +- process_pixblock_tail, \ +- process_pixblock_tail_head ++ ensure_destination_ptr_alignment \process_pixblock_head, \ ++ \process_pixblock_tail, \ ++ \process_pixblock_tail_head + + /* Implement "head (tail_head) ... (tail_head) tail" loop pattern */ + pixld_a pixblock_size, dst_r_bpp, \ +@@ -873,32 +873,32 @@ local skip1 + fetch_src_pixblock + pixld pixblock_size, mask_bpp, \ + (mask_basereg - pixblock_size * mask_bpp / 64), MASK +- PF add PF_X, PF_X, #pixblock_size +- process_pixblock_head ++ PF add, PF_X, PF_X, #pixblock_size ++ \process_pixblock_head + cache_preload 0, pixblock_size + cache_preload_simple + subs W, W, #(pixblock_size * 2) + blt 200f + + 100: +- process_pixblock_tail_head ++ \process_pixblock_tail_head + cache_preload_simple + subs W, W, #pixblock_size + bge 100b + + 200: +- process_pixblock_tail ++ \process_pixblock_tail + pixst_a pixblock_size, dst_w_bpp, \ + (dst_w_basereg - pixblock_size * dst_w_bpp / 64), DST_W + + /* Process the remaining trailing pixels in the scanline */ + process_trailing_pixels 1, 1, \ +- process_pixblock_head, \ +- process_pixblock_tail, \ +- process_pixblock_tail_head ++ \process_pixblock_head, \ ++ \process_pixblock_tail, \ ++ \process_pixblock_tail_head + advance_to_next_scanline 0b + +- cleanup ++ \cleanup + 1000: + /* pop all registers */ + sub x29, x29, 64 +@@ -925,16 +925,16 @@ local skip1 + */ + 800: + .if src_bpp_shift >= 0 +- PF lsl DUMMY, SRC_STRIDE, #src_bpp_shift +- PF prfm PREFETCH_MODE, [SRC, DUMMY] ++ PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift ++ PF prfm, PREFETCH_MODE, [SRC, DUMMY] + .endif + .if dst_r_bpp != 0 +- PF lsl DUMMY, DST_STRIDE, #dst_bpp_shift +- PF prfm PREFETCH_MODE, [DST_R, DUMMY] ++ PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift ++ PF prfm, PREFETCH_MODE, [DST_R, DUMMY] + .endif + .if mask_bpp_shift >= 0 +- PF lsl DUMMY, MASK_STRIDE, #mask_bpp_shift +- PF prfm PREFETCH_MODE, [MASK, DUMMY] ++ PF lsl, DUMMY, MASK_STRIDE, #mask_bpp_shift ++ PF prfm, PREFETCH_MODE, [MASK, DUMMY] + .endif + /* Process exactly pixblock_size pixels if needed */ + tst W, #pixblock_size +@@ -944,19 +944,19 @@ local skip1 + fetch_src_pixblock + pixld pixblock_size, mask_bpp, \ + (mask_basereg - pixblock_size * mask_bpp / 64), MASK +- process_pixblock_head +- process_pixblock_tail ++ \process_pixblock_head ++ \process_pixblock_tail + pixst pixblock_size, dst_w_bpp, \ + (dst_w_basereg - pixblock_size * dst_w_bpp / 64), DST_W + 100: + /* Process the remaining trailing pixels in the scanline */ + process_trailing_pixels 0, 0, \ +- process_pixblock_head, \ +- process_pixblock_tail, \ +- process_pixblock_tail_head ++ \process_pixblock_head, \ ++ \process_pixblock_tail, \ ++ \process_pixblock_tail_head + advance_to_next_scanline 800b + 9: +- cleanup ++ \cleanup + /* pop all registers */ + sub x29, x29, 64 + ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [x29], 32 +@@ -995,7 +995,7 @@ local skip1 + .unreq PF_DST + .unreq PF_MASK + .unreq DUMMY +- .endfunc ++ pixman_end_asm_function + .endm + + /* +@@ -1019,23 +1019,23 @@ local skip1 + src_basereg_ = 0, \ + mask_basereg_ = 24 + +- pixman_asm_function fname ++ pixman_asm_function \fname + .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_NONE + + /* + * Make some macro arguments globally visible and accessible + * from other macros + */ +- .set src_bpp, src_bpp_ +- .set mask_bpp, mask_bpp_ +- .set dst_w_bpp, dst_w_bpp_ +- .set pixblock_size, pixblock_size_ +- .set dst_w_basereg, dst_w_basereg_ +- .set dst_r_basereg, dst_r_basereg_ +- .set src_basereg, src_basereg_ +- .set mask_basereg, mask_basereg_ +- +-.if use_nearest_scaling != 0 ++ .set src_bpp, \src_bpp_ ++ .set mask_bpp, \mask_bpp_ ++ .set dst_w_bpp, \dst_w_bpp_ ++ .set pixblock_size, \pixblock_size_ ++ .set dst_w_basereg, \dst_w_basereg_ ++ .set dst_r_basereg, \dst_r_basereg_ ++ .set src_basereg, \src_basereg_ ++ .set mask_basereg, \mask_basereg_ ++ ++.if \use_nearest_scaling != 0 + /* + * Assign symbolic names to registers for nearest scaling + */ +@@ -1052,7 +1052,7 @@ local skip1 + DUMMY .req x30 + + .macro pixld_src x:vararg +- pixld_s x ++ pixld_s \x + .endm + + sxtw x0, w0 +@@ -1080,7 +1080,7 @@ local skip1 + DUMMY .req x30 + + .macro pixld_src x:vararg +- pixld x ++ pixld \x + .endm + + sxtw x0, w0 +@@ -1093,12 +1093,12 @@ local skip1 + st1 {v12.8b, v13.8b, v14.8b, v15.8b}, [x29], 32 + .endif + +-.if (((flags) & FLAG_DST_READWRITE) != 0) ++.if (((\flags) & FLAG_DST_READWRITE) != 0) + .set dst_r_bpp, dst_w_bpp + .else + .set dst_r_bpp, 0 + .endif +-.if (((flags) & FLAG_DEINTERLEAVE_32BPP) != 0) ++.if (((\flags) & FLAG_DEINTERLEAVE_32BPP) != 0) + .set DEINTERLEAVE_32BPP_ENABLED, 1 + .else + .set DEINTERLEAVE_32BPP_ENABLED, 0 +@@ -1109,15 +1109,15 @@ local skip1 + (src_basereg - pixblock_size * src_bpp / 64), SRC + .endm + +- init ++ \init + mov DST_R, DST_W + + cmp W, #pixblock_size + blt 800f + +- ensure_destination_ptr_alignment process_pixblock_head, \ +- process_pixblock_tail, \ +- process_pixblock_tail_head ++ ensure_destination_ptr_alignment \process_pixblock_head, \ ++ \process_pixblock_tail, \ ++ \process_pixblock_tail_head + + subs W, W, #pixblock_size + blt 700f +@@ -1128,26 +1128,26 @@ local skip1 + fetch_src_pixblock + pixld pixblock_size, mask_bpp, \ + (mask_basereg - pixblock_size * mask_bpp / 64), MASK +- process_pixblock_head ++ \process_pixblock_head + subs W, W, #pixblock_size + blt 200f + 100: +- process_pixblock_tail_head ++ \process_pixblock_tail_head + subs W, W, #pixblock_size + bge 100b + 200: +- process_pixblock_tail ++ \process_pixblock_tail + pixst_a pixblock_size, dst_w_bpp, \ + (dst_w_basereg - pixblock_size * dst_w_bpp / 64), DST_W + 700: + /* Process the remaining trailing pixels in the scanline (dst aligned) */ + process_trailing_pixels 0, 1, \ +- process_pixblock_head, \ +- process_pixblock_tail, \ +- process_pixblock_tail_head ++ \process_pixblock_head, \ ++ \process_pixblock_tail, \ ++ \process_pixblock_tail_head + +- cleanup +-.if use_nearest_scaling != 0 ++ \cleanup ++.if \use_nearest_scaling != 0 + sub x29, x29, 64 + ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [x29], 32 + ld1 {v12.8b, v13.8b, v14.8b, v15.8b}, [x29], 32 +@@ -1167,12 +1167,12 @@ local skip1 + 800: + /* Process the remaining trailing pixels in the scanline (dst unaligned) */ + process_trailing_pixels 0, 0, \ +- process_pixblock_head, \ +- process_pixblock_tail, \ +- process_pixblock_tail_head ++ \process_pixblock_head, \ ++ \process_pixblock_tail, \ ++ \process_pixblock_tail_head + +- cleanup +-.if use_nearest_scaling != 0 ++ \cleanup ++.if \use_nearest_scaling != 0 + sub x29, x29, 64 + ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [x29], 32 + ld1 {v12.8b, v13.8b, v14.8b, v15.8b}, [x29], 32 +@@ -1213,15 +1213,15 @@ local skip1 + .purgem fetch_src_pixblock + .purgem pixld_src + +- .endfunc ++ pixman_end_asm_function + .endm + + .macro generate_composite_function_single_scanline x:vararg +- generate_composite_function_scanline 0, x ++ generate_composite_function_scanline 0, \x + .endm + + .macro generate_composite_function_nearest_scanline x:vararg +- generate_composite_function_scanline 1, x ++ generate_composite_function_scanline 1, \x + .endm + + /* Default prologue/epilogue, nothing special needs to be done */ +@@ -1255,22 +1255,22 @@ local skip1 + * value (in) is lost. + */ + .macro convert_0565_to_8888 in, out_a, out_r, out_g, out_b +- shrn &out_r&.8b, &in&.8h, #8 +- shrn &out_g&.8b, &in&.8h, #3 +- sli &in&.8h, &in&.8h, #5 +- movi &out_a&.8b, #255 +- sri &out_r&.8b, &out_r&.8b, #5 +- sri &out_g&.8b, &out_g&.8b, #6 +- shrn &out_b&.8b, &in&.8h, #2 ++ shrn \()\out_r\().8b, \()\in\().8h, #8 ++ shrn \()\out_g\().8b, \()\in\().8h, #3 ++ sli \()\in\().8h, \()\in\().8h, #5 ++ movi \()\out_a\().8b, #255 ++ sri \()\out_r\().8b, \()\out_r\().8b, #5 ++ sri \()\out_g\().8b, \()\out_g\().8b, #6 ++ shrn \()\out_b\().8b, \()\in\().8h, #2 + .endm + + .macro convert_0565_to_x888 in, out_r, out_g, out_b +- shrn &out_r&.8b, &in&.8h, #8 +- shrn &out_g&.8b, &in&.8h, #3 +- sli &in&.8h, &in&.8h, #5 +- sri &out_r&.8b, &out_r&.8b, #5 +- sri &out_g&.8b, &out_g&.8b, #6 +- shrn &out_b&.8b, &in&.8h, #2 ++ shrn \()\out_r\().8b, \()\in\().8h, #8 ++ shrn \()\out_g\().8b, \()\in\().8h, #3 ++ sli \()\in\().8h, \()\in\().8h, #5 ++ sri \()\out_r\().8b, \()\out_r\().8b, #5 ++ sri \()\out_g\().8b, \()\out_g\().8b, #6 ++ shrn \()\out_b\().8b, \()\in\().8h, #2 + .endm + + /* +@@ -1280,14 +1280,14 @@ local skip1 + * registers (tmp1, tmp2) + */ + .macro convert_8888_to_0565 in_r, in_g, in_b, out, tmp1, tmp2 +- ushll &tmp1&.8h, &in_g&.8b, #7 +- shl &tmp1&.8h, &tmp1&.8h, #1 +- ushll &out&.8h, &in_r&.8b, #7 +- shl &out&.8h, &out&.8h, #1 +- ushll &tmp2&.8h, &in_b&.8b, #7 +- shl &tmp2&.8h, &tmp2&.8h, #1 +- sri &out&.8h, &tmp1&.8h, #5 +- sri &out&.8h, &tmp2&.8h, #11 ++ ushll \()\tmp1\().8h, \()\in_g\().8b, #7 ++ shl \()\tmp1\().8h, \()\tmp1\().8h, #1 ++ ushll \()\out\().8h, \()\in_r\().8b, #7 ++ shl \()\out\().8h, \()\out\().8h, #1 ++ ushll \()\tmp2\().8h, \()\in_b\().8b, #7 ++ shl \()\tmp2\().8h, \()\tmp2\().8h, #1 ++ sri \()\out\().8h, \()\tmp1\().8h, #5 ++ sri \()\out\().8h, \()\tmp2\().8h, #11 + .endm + + /* +@@ -1297,14 +1297,14 @@ local skip1 + * value from 'in' is lost + */ + .macro convert_four_0565_to_x888_packed in, out0, out1, tmp +- shl &out0&.4h, &in&.4h, #5 /* G top 6 bits */ +- shl &tmp&.4h, &in&.4h, #11 /* B top 5 bits */ +- sri &in&.4h, &in&.4h, #5 /* R is ready in top bits */ +- sri &out0&.4h, &out0&.4h, #6 /* G is ready in top bits */ +- sri &tmp&.4h, &tmp&.4h, #5 /* B is ready in top bits */ +- ushr &out1&.4h, &in&.4h, #8 /* R is in place */ +- sri &out0&.4h, &tmp&.4h, #8 /* G & B is in place */ +- zip1 &tmp&.4h, &out0&.4h, &out1&.4h /* everything is in place */ +- zip2 &out1&.4h, &out0&.4h, &out1&.4h +- mov &out0&.d[0], &tmp&.d[0] ++ shl \()\out0\().4h, \()\in\().4h, #5 /* G top 6 bits */ ++ shl \()\tmp\().4h, \()\in\().4h, #11 /* B top 5 bits */ ++ sri \()\in\().4h, \()\in\().4h, #5 /* R is ready \in top bits */ ++ sri \()\out0\().4h, \()\out0\().4h, #6 /* G is ready \in top bits */ ++ sri \()\tmp\().4h, \()\tmp\().4h, #5 /* B is ready \in top bits */ ++ ushr \()\out1\().4h, \()\in\().4h, #8 /* R is \in place */ ++ sri \()\out0\().4h, \()\tmp\().4h, #8 /* G \() B is \in place */ ++ zip1 \()\tmp\().4h, \()\out0\().4h, \()\out1\().4h /* everything is \in place */ ++ zip2 \()\out1\().4h, \()\out0\().4h, \()\out1\().4h ++ mov \()\out0\().d[0], \()\tmp\().d[0] + .endm +diff --git a/test/utils.h b/test/utils.h +index 701417f..389b5c1 100644 +--- a/test/utils.h ++++ b/test/utils.h +@@ -3,7 +3,7 @@ + #endif + + #include +-#include "pixman-private.h" /* For 'inline' definition */ ++#include "pixman-compiler.h" /* For 'inline' definition */ + #include "utils-prng.h" + + #if defined(_MSC_VER) +-- +2.41.0 + diff --git a/recipes/pixman/config.yml b/recipes/pixman/config.yml index b237af91644c9c..6f0c5774800903 100644 --- a/recipes/pixman/config.yml +++ b/recipes/pixman/config.yml @@ -1,4 +1,6 @@ versions: + "0.42.2": + folder: "all" "0.40.0": folder: "all" "0.38.4": diff --git a/recipes/pkgconf/all/conandata.yml b/recipes/pkgconf/all/conandata.yml index 9d79648be05d08..413c62bff29ba5 100644 --- a/recipes/pkgconf/all/conandata.yml +++ b/recipes/pkgconf/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.1.0": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.1.0.tar.xz" + sha256: "266d5861ee51c52bc710293a1d36622ae16d048d71ec56034a02eb9cf9677761" + "2.0.3": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.0.3.tar.xz" + sha256: "cabdf3c474529854f7ccce8573c5ac68ad34a7e621037535cbc3981f6b23836c" + "2.0.2": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.0.2.tar.xz" + sha256: "ea5a25ef8f251eb5377ec0e21c75fb61894433cfbdbf0b2559ba33e4c2664401" "1.9.5": url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.9.5.tar.xz" sha256: "1ac1656debb27497563036f7bffc281490f83f9b8457c0d60bcfb638fb6b6171" @@ -12,6 +21,12 @@ sources: url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.7.3.tar.xz" sha256: "b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0" patches: + "2.1.0": + - patch_file: "patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "2.0.3": + - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "2.0.2": + - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" "1.9.5": - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" "1.9.3": diff --git a/recipes/pkgconf/all/conanfile.py b/recipes/pkgconf/all/conanfile.py index 2645619ecf3209..673b980405e75c 100644 --- a/recipes/pkgconf/all/conanfile.py +++ b/recipes/pkgconf/all/conanfile.py @@ -7,7 +7,6 @@ from conan.tools.meson import Meson, MesonToolchain from conan.tools.microsoft import is_msvc, unix_path_package_info_legacy from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration required_conan_version = ">=1.57.0" @@ -52,11 +51,15 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + def package_id(self): + if not self.info.options.enable_lib: + del self.info.settings.compiler + def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.2.2") 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 _patch_sources(self): apply_conandata_patches(self) @@ -112,10 +115,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - def package_id(self): - if not self.info.options.enable_lib: - del self.info.settings.compiler - def package_info(self): if self.options.enable_lib: self.cpp_info.set_property("pkg_config_name", "libpkgconf") @@ -129,12 +128,10 @@ def package_info(self): self.cpp_info.libdirs = [] bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var: {}".format(bindir)) self.env_info.PATH.append(bindir) exesuffix = ".exe" if self.settings.os == "Windows" else "" pkg_config = os.path.join(bindir, "pkgconf" + exesuffix).replace("\\", "/") - self.output.info("Setting PKG_CONFIG env var: {}".format(pkg_config)) self.buildenv_info.define_path("PKG_CONFIG", pkg_config) pkgconf_aclocal = os.path.join(self.package_folder, "bin", "aclocal") @@ -144,10 +141,5 @@ def package_info(self): # TODO: remove in conanv2 automake_extra_includes = unix_path_package_info_legacy(self, pkgconf_aclocal.replace("\\", "/")) - self.output.info("Appending AUTOMAKE_CONAN_INCLUDES env var: {}".format(automake_extra_includes)) self.env_info.PKG_CONFIG = pkg_config self.env_info.AUTOMAKE_CONAN_INCLUDES.append(automake_extra_includes) - - # TODO: to remove in conan v2 once pkg_config generator removed - if self.options.enable_lib: - self.cpp_info.names["pkg_config"] = "libpkgconf" diff --git a/recipes/pkgconf/all/patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/recipes/pkgconf/all/patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 00000000000000..ad4d094366b002 --- /dev/null +++ b/recipes/pkgconf/all/patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -170,7 +170,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ":;")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/recipes/pkgconf/config.yml b/recipes/pkgconf/config.yml index 04e2163e1ba778..f64bc13961492e 100644 --- a/recipes/pkgconf/config.yml +++ b/recipes/pkgconf/config.yml @@ -1,4 +1,10 @@ versions: + "2.1.0": + folder: "all" + "2.0.3": + folder: "all" + "2.0.2": + folder: "all" "1.9.5": folder: "all" "1.9.3": diff --git a/recipes/platform.converters/all/conandata.yml b/recipes/platform.converters/all/conandata.yml index dbc2ae3eae6999..f7a43902b2ca7d 100644 --- a/recipes/platform.converters/all/conandata.yml +++ b/recipes/platform.converters/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.4.0": + url: "https://github.com/linksplatform/Converters/archive/csharp_0.4.0.tar.gz" + sha256: "dd55cff0c66fbb169d255d12e62c0ceba2e9d5c94921786871945c3a5c2d7357" "0.1.0": - url: https://github.com/linksplatform/Converters/archive/refs/tags/cpp_0.1.0.zip - sha256: a1a9e566b6628b1e09875f9ee93fb7fb600a8371d07e00a25c127e1609375d96 + url: "https://github.com/linksplatform/Converters/archive/refs/tags/cpp_0.1.0.zip" + sha256: "a1a9e566b6628b1e09875f9ee93fb7fb600a8371d07e00a25c127e1609375d96" diff --git a/recipes/platform.converters/all/conanfile.py b/recipes/platform.converters/all/conanfile.py index 4991da89bae2cc..898832d2cd9d42 100644 --- a/recipes/platform.converters/all/conanfile.py +++ b/recipes/platform.converters/all/conanfile.py @@ -1,65 +1,71 @@ -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.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.50.0" class PlatformConvertersConan(ConanFile): name = "platform.converters" + description = ( + "platform.converters is one of the libraries of the LinksPlatform " + "modular framework, to provide conversions between different types" + ) license = "MIT" - homepage = "https://github.com/linksplatform/Converters" url = "https://github.com/conan-io/conan-center-index" - description = "platform.converters is one of the libraries of the LinksPlatform modular framework, " \ - "to provide conversions between different types" - topics = ("linksplatform", "cpp20", "converters", "any", "native") - settings = "compiler", "arch" - no_copy_source = True + homepage = "https://github.com/linksplatform/Converters" + topics = ("linksplatform", "cpp20", "converters", "any", "native", "header-only") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property - def _internal_cpp_subfolder(self): - return os.path.join(self._source_subfolder, "cpp", "Platform.Converters") + def _min_cppstd(self): + return 20 @property def _compilers_minimum_version(self): return { "gcc": "10", "Visual Studio": "16", + "msvc": "192", "clang": "14", - "apple-clang": "14" + "apple-clang": "14", } - @property - def _minimum_cpp_standard(self): - return 20 - - def validate(self): - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) - - if not minimum_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) + def layout(self): + basic_layout(self, src_folder="src") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{}/{} requires c++{}, " - "which is not supported by {} {}.".format( - self.name, self.version, self._minimum_cpp_standard, self.settings.compiler, - self.settings.compiler.version)) + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._min_cppstd) - def package_id(self): - self.info.header_only() + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _internal_cpp_subfolder(self): + return os.path.join(self.source_folder, "cpp", "Platform.Converters") def package(self): - self.copy("*.h", dst="include", src=self._internal_cpp_subfolder) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=self._internal_cpp_subfolder) + 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.libdirs = [] diff --git a/recipes/platform.converters/all/test_package/CMakeLists.txt b/recipes/platform.converters/all/test_package/CMakeLists.txt index 80c8108b7c3f74..3372d3e73b1861 100644 --- a/recipes/platform.converters/all/test_package/CMakeLists.txt +++ b/recipes/platform.converters/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(platform.converters CONFIG REQUIRED) +find_package(platform.converters REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} platform.converters::platform.converters) diff --git a/recipes/platform.converters/all/test_package/conanfile.py b/recipes/platform.converters/all/test_package/conanfile.py index 49a3a66ea5bad4..ef5d7042163ecc 100644 --- a/recipes/platform.converters/all/test_package/conanfile.py +++ b/recipes/platform.converters/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,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/platform.converters/all/test_package/test_package.cpp b/recipes/platform.converters/all/test_package/test_package.cpp index 283e7f59b558b9..47a24cfe4903b6 100644 --- a/recipes/platform.converters/all/test_package/test_package.cpp +++ b/recipes/platform.converters/all/test_package/test_package.cpp @@ -5,8 +5,8 @@ using namespace Platform::Converters; int main() { - int source {48}; + int source{48}; char to = Converter::Convert(source); - std::cout<<"int value: "< +#include +#include +#include +#include + #include #include diff --git a/recipes/platform.equality/all/test_v1_package/CMakeLists.txt b/recipes/platform.equality/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/platform.equality/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/platform.equality/all/test_v1_package/conanfile.py b/recipes/platform.equality/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/platform.equality/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/platform.exceptions/all/conandata.yml b/recipes/platform.exceptions/all/conandata.yml index 9d13e79d6d9952..cf054ea78bcab7 100644 --- a/recipes/platform.exceptions/all/conandata.yml +++ b/recipes/platform.exceptions/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "0.2.0": - url: https://github.com/linksplatform/Exceptions/archive/refs/tags/0.4.0_0.2.0.zip - sha256: 9e4513da667e41f0bbe776123747ac63958972edb00eaee300c495ae3b39eb9b - "0.3.0": - url: https://github.com/linksplatform/Exceptions/archive/refs/tags/cpp_0.3.0.zip - sha256: 08506f334098e8c9106ff357efd7f68b83a3c1f4dc03b6b97b6229b14737d0ce + "0.5.0": + url: "https://github.com/linksplatform/Exceptions/archive/csharp_0.5.0.tar.gz" + sha256: "5fbdd49adf7840431a581d0bfe61a5d247398a1fe622101b3985714d11d411f4" + "0.3.2": + url: "https://github.com/linksplatform/Exceptions/archive/refs/tags/cpp_0.3.2.tar.gz" + sha256: "f2d3af59fd66ef47f93557a2b64d0c8e7a1a0cd033f0e3ae2f09153f81117f71" + "0.2.1": + url: "https://github.com/linksplatform/Exceptions/archive/refs/tags/cpp_0.2.1.tar.gz" + sha256: "9e31f6162cd226a4be3eb0e263b8c1c00e5de1fb41575d4d19207e9ff55f2687" diff --git a/recipes/platform.exceptions/all/conanfile.py b/recipes/platform.exceptions/all/conanfile.py index e352e58aa4f019..28942c0367e11c 100644 --- a/recipes/platform.exceptions/all/conanfile.py +++ b/recipes/platform.exceptions/all/conanfile.py @@ -1,28 +1,34 @@ -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.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 PlatformExceptionsConan(ConanFile): name = "platform.exceptions" + description = "platform.exceptions is one of the libraries of the LinksPlatform modular framework, to ensure exceptions" license = "MIT" - homepage = "https://github.com/linksplatform/Exceptions" url = "https://github.com/conan-io/conan-center-index" - description = "platform.exceptions is one of the libraries of the LinksPlatform modular framework, " \ - "to ensure exceptions" - topics = ("linksplatform", "cpp20", "exceptions", "any", "ranges", "native") - settings = "compiler", "arch" + homepage = "https://github.com/linksplatform/Exceptions" + topics = ("linksplatform", "cpp20", "exceptions", "any", "ranges", "native", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + return 20 @property def _internal_cpp_subfolder(self): - return os.path.join(self._source_subfolder, "cpp", "Platform.Exceptions") + return os.path.join(self.source_folder, "cpp", "Platform.Exceptions") @property def _compilers_minimum_version(self): @@ -30,42 +36,47 @@ def _compilers_minimum_version(self): "gcc": "10", "Visual Studio": "16", "clang": "11", - "apple-clang": "11" + "apple-clang": "11", } - @property - def _minimum_cpp_standard(self): - return 20 + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - if tools.Version(self.version) >= "0.3.0": - self.requires("platform.delegates/0.2.7") + if Version(self.version) >= "0.3.0": + self.requires("platform.delegates/0.3.7") else: self.requires("platform.delegates/0.1.3") + def package_id(self): + self.info.clear() + def validate(self): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) if not minimum_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) + self.output.warning(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{}/{} requires c++{}, " - "which is not supported by {} {}.".format( - self.name, self.version, self._minimum_cpp_standard, self.settings.compiler, - self.settings.compiler.version)) + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.name}/{self.version} requires c++{self._minimum_cpp_standard}, which is not supported" + f" by {self.settings.compiler} {self.settings.compiler.version}." + ) if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) - - def package_id(self): - self.info.header_only() + check_min_cppstd(self, self._minimum_cpp_standard) 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("*.h", dst="include", src=self._internal_cpp_subfolder) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=self._internal_cpp_subfolder) + 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.libdirs = [] diff --git a/recipes/platform.exceptions/all/test_package/CMakeLists.txt b/recipes/platform.exceptions/all/test_package/CMakeLists.txt index dadfcbe5ecf0af..a63090495da9c5 100644 --- a/recipes/platform.exceptions/all/test_package/CMakeLists.txt +++ b/recipes/platform.exceptions/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(platform.exceptions REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE platform.exceptions::platform.exceptions) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) diff --git a/recipes/platform.exceptions/all/test_package/conanfile.py b/recipes/platform.exceptions/all/test_package/conanfile.py index d4128b04507778..ef5d7042163ecc 100644 --- a/recipes/platform.exceptions/all/test_package/conanfile.py +++ b/recipes/platform.exceptions/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" + 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/platform.exceptions/all/test_v1_package/CMakeLists.txt b/recipes/platform.exceptions/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/platform.exceptions/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/platform.exceptions/all/test_v1_package/conanfile.py b/recipes/platform.exceptions/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/platform.exceptions/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/platform.exceptions/config.yml b/recipes/platform.exceptions/config.yml index 0906286bf12252..7914985fc71b1f 100644 --- a/recipes/platform.exceptions/config.yml +++ b/recipes/platform.exceptions/config.yml @@ -1,5 +1,7 @@ versions: - "0.2.0": + "0.5.0": folder: all - "0.3.0": + "0.3.2": + folder: all + "0.2.1": folder: all diff --git a/recipes/platform.hashing/all/conandata.yml b/recipes/platform.hashing/all/conandata.yml index c156d1c289438c..f7e585564ab8a8 100644 --- a/recipes/platform.hashing/all/conandata.yml +++ b/recipes/platform.hashing/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.6": + url: "https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.5.6.tar.gz" + sha256: "b387d772750eea2187ca7ca0651ddd701e8f2ef6eb8d86a6f8dfda00193a4123" "0.5.5": url: "https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.5.5.tar.gz" sha256: "8155f1d0b18cfdad7b93f6c41aaabbe655c9f7ce6bfddb10eae86156cbff02cf" diff --git a/recipes/platform.hashing/all/conanfile.py b/recipes/platform.hashing/all/conanfile.py index 8e331fda1698f6..0e0affe79e746a 100644 --- a/recipes/platform.hashing/all/conanfile.py +++ b/recipes/platform.hashing/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 get, copy from conan.tools.layout import basic_layout from conan.tools.scm import Version from conan.tools.microsoft import is_msvc @@ -47,8 +47,10 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - if Version(self.version) >= "0.5.0": - self.requires("cpu_features/0.8.0", transitive_headers=True) + if Version(self.version) >= "0.5.6": + self.requires("cpuinfo/cci.20220228", transitive_headers=True) + elif Version(self.version) >= "0.5.0": + self.requires("cpu_features/0.9.0", transitive_headers=True) def package_id(self): self.info.clear() diff --git a/recipes/platform.hashing/config.yml b/recipes/platform.hashing/config.yml index ee55970fe3a0b7..4a9a6395456f81 100644 --- a/recipes/platform.hashing/config.yml +++ b/recipes/platform.hashing/config.yml @@ -1,4 +1,6 @@ versions: + "0.5.6": + folder: all "0.5.5": folder: all "0.4.0": diff --git a/recipes/playrho/all/CMakeLists.txt b/recipes/playrho/all/CMakeLists.txt deleted file mode 100644 index 7d5ba25565b0ab..00000000000000 --- a/recipes/playrho/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/playrho/all/conandata.yml b/recipes/playrho/all/conandata.yml index 03bf919319da86..df36531f2762c4 100644 --- a/recipes/playrho/all/conandata.yml +++ b/recipes/playrho/all/conandata.yml @@ -2,8 +2,6 @@ sources: "1.1.0": url: "https://github.com/louis-langholtz/PlayRho/archive/refs/tags/v1.1.0.tar.gz" sha256: "45c0337440387a85a97a4b7907b79f780233bf2062635471b71a32245b0c0158" - patches: "1.1.0": - patch_file: "patches/1.1.0-0001-fix-target-name.patch" - base_path: "source_subfolder" diff --git a/recipes/playrho/all/conanfile.py b/recipes/playrho/all/conanfile.py index 9aab4b29f12b39..619e24882a4630 100644 --- a/recipes/playrho/all/conanfile.py +++ b/recipes/playrho/all/conanfile.py @@ -1,9 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.tools import ConanInvalidConfiguration import os -import functools -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, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, rename +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + class PlayrhoConan(ConanFile): name = "playrho" @@ -12,25 +17,34 @@ class PlayrhoConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/louis-langholtz/PlayRho/" topics = ("physics-engine", "collision-detection", "box2d") + + 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, } - generators = "cmake" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_versions(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "msvc": "192", + "Visual Studio": "16", + } 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": @@ -38,54 +52,46 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - @property - def _compilers_minimum_versions(self): - return { - "gcc": "8", - "Visual Studio": "16", - "clang": "7", - "apple-clang": "12", - } + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, self._min_cppstd) - compilers_minimum_version = self._compilers_minimum_versions - minimum_version = compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version: - if tools.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)) + minimum_version = self._compilers_minimum_versions.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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["PLAYRHO_BUILD_SHARED"] = self.options.shared - cmake.definitions["PLAYRHO_BUILD_STATIC"] = not self.options.shared - cmake.definitions["PLAYRHO_INSTALL"] = True - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["PLAYRHO_BUILD_SHARED"] = self.options.shared + tc.variables["PLAYRHO_BUILD_STATIC"] = not self.options.shared + tc.variables["PLAYRHO_INSTALL"] = True + 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(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", + 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", "PlayRho")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "PlayRho")) def package_info(self): self.cpp_info.libs = ["PlayRho"] diff --git a/recipes/playrho/all/test_package/CMakeLists.txt b/recipes/playrho/all/test_package/CMakeLists.txt index cf755d3555681b..6486eec9801471 100644 --- a/recipes/playrho/all/test_package/CMakeLists.txt +++ b/recipes/playrho/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(PlayRho REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/playrho/all/test_package/conanfile.py b/recipes/playrho/all/test_package/conanfile.py index 61ac8b93182903..ef5d7042163ecc 100644 --- a/recipes/playrho/all/test_package/conanfile.py +++ b/recipes/playrho/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 PlayrhoTestConan(ConanFile): +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 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/playrho/all/test_v1_package/CMakeLists.txt b/recipes/playrho/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/playrho/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/playrho/all/test_v1_package/conanfile.py b/recipes/playrho/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..61ac8b93182903 --- /dev/null +++ b/recipes/playrho/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 PlayrhoTestConan(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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/plog/all/conandata.yml b/recipes/plog/all/conandata.yml index a2d1cb2b746a69..d1c46d7ff154b1 100644 --- a/recipes/plog/all/conandata.yml +++ b/recipes/plog/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.10": + url: "https://github.com/SergiusTheBest/plog/archive/1.1.10.tar.gz" + sha256: "55a090fc2b46ab44d0dde562a91fe5fc15445a3caedfaedda89fe3925da4705a" "1.1.9": url: "https://github.com/SergiusTheBest/plog/archive/1.1.9.tar.gz" sha256: "058315b9ec9611b659337d4333519ab4783fad3f2f23b1cc7bb84d977ea38055" diff --git a/recipes/plog/config.yml b/recipes/plog/config.yml index c3432fc6b2f2ae..5526e402261bcd 100644 --- a/recipes/plog/config.yml +++ b/recipes/plog/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.10": + folder: all "1.1.9": folder: all "1.1.5": diff --git a/recipes/plusaes/all/conandata.yml b/recipes/plusaes/all/conandata.yml index 539b28539b8748..595f0e1a79d210 100644 --- a/recipes/plusaes/all/conandata.yml +++ b/recipes/plusaes/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.0": + url: "https://github.com/kkAyataka/plusaes/archive/refs/tags/v1.0.0.tar.gz" + sha256: "0e33e8d0e2ea5e6f9eb7a06093f576350ce8ef58339ce9de791514a8f433087d" "0.10.0": url: "https://github.com/kkAyataka/plusaes/archive/refs/tags/v0.10.0.tar.gz" sha256: "092d64f372f5b732c8e35ab8f1049d4c6ef2eaa4c6ababc56b541b26f4095e51" diff --git a/recipes/plusaes/all/conanfile.py b/recipes/plusaes/all/conanfile.py index 5d1248265e161c..c0737891223108 100644 --- a/recipes/plusaes/all/conanfile.py +++ b/recipes/plusaes/all/conanfile.py @@ -1,35 +1,48 @@ -from conans import ConanFile, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class PlusaesConan(ConanFile): name = "plusaes" description = "Header only C++ AES cipher library" - topics = ("encryption", "header-only") license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/kkAyataka/plusaes" + topics = ("encryption", "header-only") + + 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 11 + + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) 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): - root_dir = self._source_subfolder + root_dir = self.source_folder include_dir = os.path.join(root_dir, "include") - self.copy(pattern="LICENSE_1_0.txt", dst="licenses", src=root_dir) - self.copy(pattern="*plusaes.hpp", dst="include", src=include_dir) + copy(self, "LICENSE_1_0.txt", dst=os.path.join(self.package_folder, "licenses"), src=root_dir) + copy(self, "*plusaes.hpp", dst=os.path.join(self.package_folder, "include"), src=include_dir) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/plusaes/all/test_package/CMakeLists.txt b/recipes/plusaes/all/test_package/CMakeLists.txt index 0a4d2fae5c706b..8b5b4793ec8d85 100644 --- a/recipes/plusaes/all/test_package/CMakeLists.txt +++ b/recipes/plusaes/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(plusaes REQUIRED CONFIG) diff --git a/recipes/plusaes/all/test_package/conanfile.py b/recipes/plusaes/all/test_package/conanfile.py index a500b98343c743..ef5d7042163ecc 100644 --- a/recipes/plusaes/all/test_package/conanfile.py +++ b/recipes/plusaes/all/test_package/conanfile.py @@ -1,9 +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) @@ -11,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/plusaes/all/test_v1_package/CMakeLists.txt b/recipes/plusaes/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/plusaes/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/plusaes/all/test_v1_package/conanfile.py b/recipes/plusaes/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a500b98343c743 --- /dev/null +++ b/recipes/plusaes/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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) diff --git a/recipes/plusaes/config.yml b/recipes/plusaes/config.yml index 1b582dcf6716ba..f5fa9d899d2442 100644 --- a/recipes/plusaes/config.yml +++ b/recipes/plusaes/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.0": + folder: all "0.10.0": folder: all diff --git a/recipes/pngpp/all/conanfile.py b/recipes/pngpp/all/conanfile.py index 9693d59416e60c..57559867af002e 100644 --- a/recipes/pngpp/all/conanfile.py +++ b/recipes/pngpp/all/conanfile.py @@ -22,7 +22,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libpng/1.6.38") + self.requires("libpng/1.6.40") def package_id(self): self.info.clear() diff --git a/recipes/poco/all/conandata.yml b/recipes/poco/all/conandata.yml index c1f5e069c2cc2f..44d50ff4a064fd 100644 --- a/recipes/poco/all/conandata.yml +++ b/recipes/poco/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.12.5p2": + url: "https://github.com/pocoproject/poco/archive/poco-1.12.5p2-release.tar.gz" + sha256: "08d201bb287cb59e13577901758aeb3ced7ea44627c79f5c162eb60323812685" + "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 +23,60 @@ 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.5p2": + - 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.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 330da5a01ce349..6ede924a2f3297 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) @@ -112,13 +132,13 @@ def requirements(self): self.requires("pcre/8.45") else: self.requires("pcre2/10.42") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.enable_xml: self.requires("expat/2.5.0") if self.options.enable_data_sqlite: - self.requires("sqlite3/3.41.2") + self.requires("sqlite3/3.44.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.7") + 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..c50a32bedbc589 100644 --- a/recipes/poco/config.yml +++ b/recipes/poco/config.yml @@ -1,4 +1,8 @@ versions: + "1.12.5p2": + folder: all + "1.12.5p1": + folder: all "1.12.4": folder: all "1.12.3": @@ -11,9 +15,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/podofo/all/conanfile.py b/recipes/podofo/all/conanfile.py index b3f7dffd4c0717..87fbb60fe26b7e 100644 --- a/recipes/podofo/all/conanfile.py +++ b/recipes/podofo/all/conanfile.py @@ -63,7 +63,7 @@ def layout(self): def requirements(self): self.requires("freetype/2.13.0") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.settings.os != "Windows": self.requires("fontconfig/2.14.2") if self.options.with_openssl: diff --git a/recipes/poly2tri/all/CMakeLists.txt b/recipes/poly2tri/all/CMakeLists.txt index 584d7ebc98cae7..f72581637fe532 100644 --- a/recipes/poly2tri/all/CMakeLists.txt +++ b/recipes/poly2tri/all/CMakeLists.txt @@ -11,6 +11,11 @@ add_library(poly2tri ${POLY2TRI_SRC_DIR}/sweep/sweep_context.cc ) +# _USE_MATH_DEFINES is defined in utils.h where M_PI is used, but it can break because math.h or cmath +# may have already been included indirectly by other headers included by sweep.cc before inclusion of utils.h +# Therefore we ensure that _USE_MATH_DEFINES is defined before any inclusion of headers. +target_compile_definitions(poly2tri PRIVATE _USE_MATH_DEFINES) + if(MSVC AND BUILD_SHARED_LIBS) set_property(TARGET poly2tri PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() diff --git a/recipes/poly2tri/all/conanfile.py b/recipes/poly2tri/all/conanfile.py index d43ae54e6e9c64..8890a1140dca4d 100644 --- a/recipes/poly2tri/all/conanfile.py +++ b/recipes/poly2tri/all/conanfile.py @@ -58,3 +58,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["poly2tri"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/poshlib/all/CMakeLists.txt b/recipes/poshlib/all/CMakeLists.txt index 7e123f6b4b780d..ada768afc9da63 100644 --- a/recipes/poshlib/all/CMakeLists.txt +++ b/recipes/poshlib/all/CMakeLists.txt @@ -1,22 +1,16 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.12) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup() - if(WIN32 AND BUILD_SHARED_LIBS) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() -file(GLOB SRCS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/*.c) -file(GLOB HDRS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/*.h) +file(GLOB SRCS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c) +file(GLOB HDRS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h) add_library(posh ${SRCS_FILES}) -target_include_directories(posh PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) +target_include_directories(posh PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) -install(TARGETS posh - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) +include(GNUInstallDirs) +install(TARGETS posh) install(FILES ${HDRS_FILES} DESTINATION include) diff --git a/recipes/poshlib/all/conanfile.py b/recipes/poshlib/all/conanfile.py index 8a2c26baad7242..7ad4e9bed544b8 100644 --- a/recipes/poshlib/all/conanfile.py +++ b/recipes/poshlib/all/conanfile.py @@ -1,17 +1,21 @@ import os -import glob -from conans import ConanFile, CMake, tools + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, replace_in_file + +required_conan_version = ">=1.53.0" class PoshlibConan(ConanFile): name = "poshlib" description = "Posh is a software framework used in cross-platform software development." - homepage = "https://github.com/PhilipLudington/poshlib" - url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "posh", "framework", "cross-platform") license = "BSD-2-Clause" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/PhilipLudington/poshlib" + topics = ("posh", "framework", "cross-platform") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,47 +26,51 @@ class PoshlibConan(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob('poshlib-*/')[0] - os.rename(extracted_dir, self._source_subfolder) + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + 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") + + def source(self): + 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() - return self._cmake + def _patch_sources(self): + replace_in_file( + self, + os.path.join(self.source_folder, "posh.h"), + "defined _ARM", + "defined _ARM || defined __arm64 || defined __arm64__ || defined __aarch64__", + ) def build(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "posh.h"), - "defined _ARM", - "defined _ARM || defined __arm64") - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): - cmake = self._configure_cmake() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) cmake.install() - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) - if self.settings.os == 'Windows' and self.options.shared: + self.cpp_info.libs = collect_libs(self) + if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines.append("POSH_DLL") diff --git a/recipes/poshlib/all/test_package/CMakeLists.txt b/recipes/poshlib/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..06a245507c5630 100644 --- a/recipes/poshlib/all/test_package/CMakeLists.txt +++ b/recipes/poshlib/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(poshlib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE poshlib::poshlib) diff --git a/recipes/poshlib/all/test_package/conanfile.py b/recipes/poshlib/all/test_package/conanfile.py index 16ec9f68ef9742..ef5d7042163ecc 100644 --- a/recipes/poshlib/all/test_package/conanfile.py +++ b/recipes/poshlib/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): - 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/poshlib/all/test_v1_package/CMakeLists.txt b/recipes/poshlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/poshlib/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/poshlib/all/test_v1_package/conanfile.py b/recipes/poshlib/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..90eb89e3f2f46b --- /dev/null +++ b/recipes/poshlib/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") + self.run(bin_path, run_environment=True) diff --git a/recipes/premake/5.x/conandata.yml b/recipes/premake/5.x/conandata.yml index d96239dcf6113b..91cb25d43c2277 100644 --- a/recipes/premake/5.x/conandata.yml +++ b/recipes/premake/5.x/conandata.yml @@ -2,13 +2,6 @@ sources: "5.0.0-alpha15": url: "https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-src.zip" sha256: "880f56e7cb9f4945d1cb879f059189462c1b7bf62ef43ac7d25842dfb177dd53" - "5.0.0-alpha14": - url: "https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-src.zip" - sha256: "7c9fa4488156625c819dd03f2b48bfd4712fbfabdc2b5768e8c7f52dd7d16608" patches: "5.0.0-alpha15": - patch_file: "patches/0001-5.0.0-alpha15-mingw.patch" - base_path: "source_subfolder" - "5.0.0-alpha14": - - patch_file: "patches/0001-5.0.0-alpha14-mingw.patch" - base_path: "source_subfolder" diff --git a/recipes/premake/5.x/conanfile.py b/recipes/premake/5.x/conanfile.py index f0834e0449cd27..d4fa461153f3cd 100644 --- a/recipes/premake/5.x/conanfile.py +++ b/recipes/premake/5.x/conanfile.py @@ -1,19 +1,33 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild -from conans.errors import ConanInvalidConfiguration import glob import os import re +import shutil + +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuild, MSBuildToolchain, is_msvc, check_min_vs + +required_conan_version = ">=1.53.0" class PremakeConan(ConanFile): name = "premake" - topics = ("conan", "premake", "build", "build-systems") - description = "Describe your software project just once, using Premake's simple and easy to read syntax, and build it everywhere" + description = ( + "Describe your software project just once, " + "using Premake's simple and easy to read syntax, " + "and build it everywhere" + ) + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://premake.github.io" - license = "BSD-3-Clause" + topics = ("build", "build-systems") + + package_type = "application" settings = "os", "arch", "compiler", "build_type" - exports_sources = "patches/**" options = { "lto": [True, False], } @@ -21,35 +35,53 @@ class PremakeConan(ConanFile): "lto": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - - 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 export_sources(self): + export_conandata_patches(self) def config_options(self): - if self.settings.os != "Windows" or self.settings.compiler == "Visual Studio": - del self.options.lto + if self.settings.os != "Windows" or is_msvc(self): + self.options.rm_safe("lto") + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def requirements(self): + if self.settings.os != "Windows": + self.requires("util-linux-libuuid/2.39") def validate(self): - if hasattr(self, 'settings_build') and tools.cross_building(self, skip_x64_x86=True): + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross-building not implemented") + if conan_version.major == 1 and self.settings.build_type == "Debug": + # This configuration fails without any error messages in C3I. + # https://c3i.jfrog.io/artifactory/misc/logs/pr/18844/15-linux-clang/premake/5.0.0-alpha15/ + raise ConanInvalidConfiguration("Debug build not supported with Conan 1.x") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) @property - def _msvc_version(self): - return { - "12": "2013", - "14": "2015", - "15": "2017", - "16": "2019", - }.get(str(self.settings.compiler.version), "2017") + def _ide_version(self): + compiler_version = str(self.settings.compiler.version) + if str(self.settings.compiler) == "Visual Studio": + return {"17": "2022", + "16": "2019", + "15": "2017", + "14": "2015", + "12": "2013"}.get(compiler_version) + else: + return {"193": "2022", + "192": "2019", + "191": "2017", + "190": "2015", + "180": "2013"}.get(compiler_version) @property - def _msvc_build_dirname(self): - return "vs{}".format(self._msvc_version) + def _msvc_build_dir(self): + return os.path.join(self.source_folder, "build", f"vs{self._ide_version}") def _version_info(self, version): res = [] @@ -63,13 +95,6 @@ def _version_info(self, version): res.append(p) return tuple(res) - @property - def _gmake_directory_name_prefix(self): - if self._version_info(self.version) <= self._version_info("5.0.0-alpha14"): - return "gmake" - else: - return "gmake2" - @property def _gmake_platform(self): return { @@ -80,8 +105,8 @@ def _gmake_platform(self): }[str(self.settings.os)] @property - def _gmake_build_dirname(self): - return "{}.{}".format(self._gmake_directory_name_prefix, self._gmake_platform) + def _gmake_build_dir(self): + return os.path.join(self.source_folder, "build", f"gmake2.{self._gmake_platform}") @property def _gmake_config(self): @@ -91,35 +116,62 @@ def _gmake_config(self): "x86": "x86", "x86_64": "x64", }[str(self.settings.arch)] - config = "{}_{}".format(build_type, arch) + config = f"{build_type}_{arch}" else: config = build_type return config + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.make_args = ["verbose=1", f"config={self._gmake_config}"] + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if self.options.get_safe("lto", None) == False: - for fn in glob.glob(os.path.join(self._source_subfolder, "build", self._gmake_build_dirname, "*.make")): - tools.replace_in_file(fn, "-flto", "", strict=False) + apply_conandata_patches(self) + if self.options.get_safe("lto", None) is False: + for fn in glob.glob(os.path.join(self._gmake_build_dir, "*.make")): + replace_in_file(self, fn, "-flto", "", strict=False) + if check_min_vs(self, 193, raise_invalid=False): + # Create VS 2022 project directory based on VS 2019 one + if "alpha" in str(self.version): + shutil.move(os.path.join(self.source_folder, "build", "vs2019"), + os.path.join(self.source_folder, "build", "vs2022")) + for vcxproj in glob.glob(os.path.join(self.source_folder, "build", "vs2022", "*.vcxproj")): + replace_in_file(self, vcxproj, "v142", "v143") def build(self): self._patch_sources() - if self.settings.compiler == "Visual Studio": - with tools.chdir(os.path.join(self._source_subfolder, "build", self._msvc_build_dirname)): + if is_msvc(self): + with chdir(self, self._msvc_build_dir): msbuild = MSBuild(self) - msbuild.build("Premake5.sln", platforms={"x86": "Win32", "x86_64": "x64"}) + msbuild.build(sln="Premake5.sln") else: - with tools.chdir(os.path.join(self._source_subfolder, "build", self._gmake_build_dirname)): - env_build = AutoToolsBuildEnvironment(self) - env_build.make(target="Premake5", args=["verbose=1", "config={}".format(self._gmake_config)]) + with chdir(self, self._gmake_build_dir): + autotools = Autotools(self) + autotools.make(target="Premake5") def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*premake5.exe", dst="bin", keep_path=False) - self.copy(pattern="*premake5", dst="bin", keep_path=False) + copy(self, "LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + suffix = ".exe" if self.settings.os == "Windows" else "" + copy(self, f"*/premake5{suffix}", + dst=os.path.join(self.package_folder, "bin"), + src=os.path.join(self.source_folder, "bin"), + keep_path=False) def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + # TODO: Legacy, to be removed on Conan 2.0 bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) self.env_info.PATH.append(bindir) diff --git a/recipes/premake/5.x/patches/0001-5.0.0-alpha14-mingw.patch b/recipes/premake/5.x/patches/0001-5.0.0-alpha14-mingw.patch deleted file mode 100644 index 0dd121be8b2aef..00000000000000 --- a/recipes/premake/5.x/patches/0001-5.0.0-alpha14-mingw.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- a/contrib/curl/lib/select.h -+++ b/contrib/curl/lib/select.h -@@ -36,7 +36,8 @@ - - #if !defined(HAVE_STRUCT_POLLFD) && \ - !defined(HAVE_SYS_POLL_H) && \ -- !defined(HAVE_POLL_H) -+ !defined(HAVE_POLL_H) && \ -+ !defined(POLLIN) - - #define POLLIN 0x01 - #define POLLPRI 0x02 ---- src/host/os_isdir.c -+++ src/host/os_isdir.c -@@ -9,7 +9,7 @@ - #include "premake.h" - - #ifdef _WIN32 --#include -+#include - #endif - - int os_isdir(lua_State* L) ---- src/host/os_uuid.c -+++ src/host/os_uuid.c -@@ -7,7 +7,7 @@ - #include "premake.h" - - #if PLATFORM_WINDOWS --#include -+#include - #endif - - ---- build/gmake.windows/Premake5.make -+++ build/gmake.windows/Premake5.make -@@ -22,7 +22,7 @@ - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -flto -O3 -Wall -Wextra - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -flto -O3 -Wall -Wextra -fno-stack-protector - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -- LIBS += bin/x86/Release/lua-lib.lib bin/x86/Release/zip-lib.lib bin/x86/Release/zlib-lib.lib bin/x86/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -+ LIBS += bin/x86/Release/lua-lib.lib bin/x86/Release/zip-lib.lib bin/x86/Release/zlib-lib.lib bin/x86/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 - LDDEPS += bin/x86/Release/lua-lib.lib bin/x86/Release/zip-lib.lib bin/x86/Release/zlib-lib.lib bin/x86/Release/curl-lib.lib - ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -flto -s - LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -@@ -49,7 +49,7 @@ ifeq ($(config),release_x64) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -flto -O3 -Wall -Wextra - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -flto -O3 -Wall -Wextra -fno-stack-protector - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -- LIBS += bin/x64/Release/lua-lib.lib bin/x64/Release/zip-lib.lib bin/x64/Release/zlib-lib.lib bin/x64/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -+ LIBS += bin/x64/Release/lua-lib.lib bin/x64/Release/zip-lib.lib bin/x64/Release/zlib-lib.lib bin/x64/Release/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 - LDDEPS += bin/x64/Release/lua-lib.lib bin/x64/Release/zip-lib.lib bin/x64/Release/zlib-lib.lib bin/x64/Release/curl-lib.lib - ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -flto -s - LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -@@ -76,7 +76,7 @@ - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -- LIBS += bin/x86/Debug/lua-lib.lib bin/x86/Debug/zip-lib.lib bin/x86/Debug/zlib-lib.lib bin/x86/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -+ LIBS += bin/x86/Debug/lua-lib.lib bin/x86/Debug/zip-lib.lib bin/x86/Debug/zlib-lib.lib bin/x86/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 - LDDEPS += bin/x86/Debug/lua-lib.lib bin/x86/Debug/zip-lib.lib bin/x86/Debug/zlib-lib.lib bin/x86/Debug/curl-lib.lib - ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 - LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -@@ -103,7 +103,7 @@ - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -- LIBS += bin/x64/Debug/lua-lib.lib bin/x64/Debug/zip-lib.lib bin/x64/Debug/zlib-lib.lib bin/x64/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -+ LIBS += bin/x64/Debug/lua-lib.lib bin/x64/Debug/zip-lib.lib bin/x64/Debug/zlib-lib.lib bin/x64/Debug/curl-lib.lib -lole32 -lws2_32 -ladvapi32 -lversion -lcrypt32 - LDDEPS += bin/x64/Debug/lua-lib.lib bin/x64/Debug/zip-lib.lib bin/x64/Debug/zlib-lib.lib bin/x64/Debug/curl-lib.lib - ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 - LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) diff --git a/recipes/premake/5.x/test_package/conanfile.py b/recipes/premake/5.x/test_package/conanfile.py index c300eaeb0abb78..d2d508976967cd 100644 --- a/recipes/premake/5.x/test_package/conanfile.py +++ b/recipes/premake/5.x/test_package/conanfile.py @@ -1,9 +1,17 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.cmake import cmake_layout 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 layout(self): + cmake_layout(self) def test(self): - if not tools.cross_building(self.settings): - self.run("premake5 --version", run_environment=True) + self.run("premake5 --version") diff --git a/recipes/premake/5.x/test_v1_package/conanfile.py b/recipes/premake/5.x/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c300eaeb0abb78 --- /dev/null +++ b/recipes/premake/5.x/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self.settings): + self.run("premake5 --version", run_environment=True) diff --git a/recipes/premake/config.yml b/recipes/premake/config.yml index e529cc98c1a626..95e71fee0aa885 100644 --- a/recipes/premake/config.yml +++ b/recipes/premake/config.yml @@ -1,5 +1,5 @@ versions: - "5.0.0-alpha14": - folder: "5.x" + # "5.0.0-beta2": + # folder: "5.x" "5.0.0-alpha15": folder: "5.x" diff --git a/recipes/procxx-boost-ext-simd/all/conanfile.py b/recipes/procxx-boost-ext-simd/all/conanfile.py index beacde69525027..58d22448c3e7e7 100644 --- a/recipes/procxx-boost-ext-simd/all/conanfile.py +++ b/recipes/procxx-boost-ext-simd/all/conanfile.py @@ -1,61 +1,71 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class ProCxxBoostExSimdConan(ConanFile): name = "procxx-boost-ext-simd" - description = ("Portable SIMD computation library - was proposed as a " - "Boost library" - ) - homepage = "https://github.com/procxx/boost.simd" - topics = ("conan", "boost", "simd") + description = "Portable SIMD computation library - was proposed as a Boost library" license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/procxx/boost.simd" + topics = ("boost", "simd", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" no_copy_source = True - - @property - def _source_subfolder(self): - return "source_subfolder" + short_paths = True @property def _min_cppstd(self): - return "11" + return 11 + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.76.0") + self.requires("boost/1.82.0") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._min_cppstd) - - def package_id(self): - self.info.header_only() + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_folder = "boost.simd-" + self.version - os.rename(extracted_folder, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="*", dst="include", - src=os.path.join(self._source_subfolder, "include")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "*", + 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) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + # this technique was inspired by conan-center's "boost-ex-ut" recipe, # and has been fixed to use the upstream Capitalized `Boost::` # namespace for components - self.cpp_info.names["cmake_find_package"] = "Boost" - self.cpp_info.names["cmake_find_package_multi"] = "Boost" - + self.cpp_info.set_property("cmake_file_name", "Boost.SIMD") + self.cpp_info.set_property("cmake_target_name", "Boost") # The original find_package() name here: + self.cpp_info.components["SIMD"].set_property("cmake_target_name", "Boost::SIMD") + self.cpp_info.components["SIMD"].requires = ["boost::headers"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "Boost.SIMD" self.cpp_info.filenames["cmake_find_package_multi"] = "Boost.SIMD" + self.cpp_info.names["cmake_find_package"] = "Boost" + self.cpp_info.names["cmake_find_package_multi"] = "Boost" self.cpp_info.components["SIMD"].names["cmake_find_package"] = "SIMD" - self.cpp_info.components["SIMD"].names["cmake_find_package_multi"] = \ - "SIMD" - self.cpp_info.components["SIMD"].requires = ["boost::headers"] + self.cpp_info.components["SIMD"].names["cmake_find_package_multi"] = "SIMD" diff --git a/recipes/procxx-boost-ext-simd/all/test_package/CMakeLists.txt b/recipes/procxx-boost-ext-simd/all/test_package/CMakeLists.txt index 36ff666d5a74f0..f2ca3191917217 100644 --- a/recipes/procxx-boost-ext-simd/all/test_package/CMakeLists.txt +++ b/recipes/procxx-boost-ext-simd/all/test_package/CMakeLists.txt @@ -1,19 +1,13 @@ -cmake_minimum_required(VERSION 3.1.0) -project(test_package) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -find_package(Boost.SIMD REQUIRED) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) # FIXME: components from Boost.SIMD (target Boost::SIMD) don't work. # It should be: # find_package(BOOST REQUIRED COMPONENTS SIMD) # See https://github.com/conan-io/conan-center-index/issues/6682 for details. -find_package(Boost REQUIRED COMPONENTS date_time) # COMPONENTS SIMD) + +find_package(Boost.SIMD REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} Boost::headers Boost::SIMD) -# FIXME: recipe should transitively sets proper minimum cxx standard. -# See https://github.com/conan-io/conan/issues/7772 about revising cxx std model. set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/procxx-boost-ext-simd/all/test_package/conanfile.py b/recipes/procxx-boost-ext-simd/all/test_package/conanfile.py index 3be12b2d6b0c52..ef5d7042163ecc 100644 --- a/recipes/procxx-boost-ext-simd/all/test_package/conanfile.py +++ b/recipes/procxx-boost-ext-simd/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 ProCxxBoostExSimdConan(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,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/procxx-boost-ext-simd/all/test_package/test_package.cpp b/recipes/procxx-boost-ext-simd/all/test_package/test_package.cpp index ddf7bb1fb383ad..48b397b470c70c 100644 --- a/recipes/procxx-boost-ext-simd/all/test_package/test_package.cpp +++ b/recipes/procxx-boost-ext-simd/all/test_package/test_package.cpp @@ -3,17 +3,16 @@ // or running library tests - just only check that package is properly created. // See docs for details: // https://docs.conan.io/en/latest/creating_packages/getting_started.html#the-test-package-folder -#include #include +#include #include namespace bs = boost::simd; -int main() -{ +int main() { using namespace boost::date_time; - bs::pack p{1.f,2.f,3.f,4.f}; - std::cout << "Boost.SIMD test from README.md : " << p + 10*p << "\n"; + bs::pack p{1.f, 2.f, 3.f, 4.f}; + std::cout << "Boost.SIMD test from README.md : " << p + 10 * p << "\n"; std::cout << "Boost.date_time interop test: " << boost::gregorian::date(2021, Aug, 4) << "\n"; return 0; } diff --git a/recipes/procxx-boost-ext-simd/all/test_v1_package/CMakeLists.txt b/recipes/procxx-boost-ext-simd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/procxx-boost-ext-simd/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/procxx-boost-ext-simd/all/test_v1_package/conanfile.py b/recipes/procxx-boost-ext-simd/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..70611dabf01ae4 --- /dev/null +++ b/recipes/procxx-boost-ext-simd/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class ProCxxBoostExSimdConan(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/proj/all/conandata.yml b/recipes/proj/all/conandata.yml index 8f4cf560d8dc42..865b4bba90467a 100644 --- a/recipes/proj/all/conandata.yml +++ b/recipes/proj/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9.3.0": + url: "https://github.com/OSGeo/PROJ/archive/9.3.0.tar.gz" + sha256: "f48c334eaf56c38d681bcfa37f188f422a562f45a66e6e646a79b4249641ecdb" "9.2.1": url: "https://github.com/OSGeo/PROJ/releases/download/9.2.1/proj-9.2.1.tar.gz" sha256: "15ebf4afa8744b9e6fccb5d571fc9f338dc3adcf99907d9e62d1af815d4971a1" @@ -24,6 +27,10 @@ sources: url: "https://github.com/OSGeo/PROJ/releases/download/6.3.1/proj-6.3.1.tar.gz" sha256: "6de0112778438dcae30fcc6942dee472ce31399b9e5a2b67e8642529868c86f8" patches: + "9.3.0": + - patch_file: "patches/0001-use-cmake-targets-9.2.1.patch" + patch_type: "conan" + patch_description: "Use cmake targets" "9.2.1": - patch_file: "patches/0001-use-cmake-targets-9.2.1.patch" patch_type: "conan" diff --git a/recipes/proj/all/conanfile.py b/recipes/proj/all/conanfile.py index e5322b9f644f00..cc5091962196d1 100644 --- a/recipes/proj/all/conanfile.py +++ b/recipes/proj/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.apple import is_apple_os -from conan.tools.build import can_run, stdcpp_library +from conan.tools.build import stdcpp_library 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, export_conandata_patches, get, copy, rmdir, replace_in_file, collect_libs, rm, rename @@ -9,7 +9,7 @@ import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.5" class ProjConan(ConanFile): @@ -19,7 +19,7 @@ class ProjConan(ConanFile): topics = "dsp", "proj", "proj4", "projections", "gis", "geospatial" homepage = "https://proj.org" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -38,6 +38,10 @@ class ProjConan(ConanFile): "build_executables": True, } + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def export_sources(self): export_conandata_patches(self) @@ -56,24 +60,24 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("nlohmann_json/3.11.2") - self.requires("sqlite3/3.42.0", run=can_run(self)) + self.requires("nlohmann_json/3.11.3") + self.requires("sqlite3/3.44.2") if self.options.get_safe("with_tiff"): - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") if self.options.get_safe("with_curl"): - self.requires("libcurl/8.0.1") + self.requires("libcurl/[>=7.78.0 <9]") def build_requirements(self): - if not can_run(self): - self.tool_requires("sqlite3/3.42.0") + if not self._is_legacy_one_profile: + self.tool_requires("sqlite3/") 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): env = VirtualBuildEnv(self) env.generate() - if can_run(self): + if self._is_legacy_one_profile: env = VirtualRunEnv(self) env.generate(scope="build") @@ -101,8 +105,10 @@ def generate(self): if Version(self.version) >= "8.1.0": tc.variables["NLOHMANN_JSON_ORIGIN"] = "external" tc.variables["CMAKE_MACOSX_BUNDLE"] = False - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + if self.settings.os == "Linux": + # Workaround for: https://github.com/conan-io/conan/issues/13560 + libdirs_host = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs] + tc.variables["CMAKE_BUILD_RPATH"] = ";".join(libdirs_host) tc.generate() deps = CMakeDeps(self) @@ -135,7 +141,7 @@ def _patch_sources(self): else: cmake_sqlite_call = "generate_proj_db.cmake" pattern = "\"${EXE_SQLITE3}\"" - if can_run(self): + if self._is_legacy_one_profile: lib_paths = self.dependencies["sqlite3"].cpp_info.libdirs else: lib_paths = self.dependencies.build["sqlite3"].cpp_info.libdirs diff --git a/recipes/proj/config.yml b/recipes/proj/config.yml index 1eba8e77164d54..57e61ab70191e1 100644 --- a/recipes/proj/config.yml +++ b/recipes/proj/config.yml @@ -1,4 +1,6 @@ versions: + "9.3.0": + folder: "all" "9.2.1": folder: "all" "9.1.1": diff --git a/recipes/prometheus-cpp/all/conanfile.py b/recipes/prometheus-cpp/all/conanfile.py index 77a024b271ec11..10a8edf3a1e5eb 100644 --- a/recipes/prometheus-cpp/all/conanfile.py +++ b/recipes/prometheus-cpp/all/conanfile.py @@ -17,7 +17,7 @@ class PrometheusCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jupp0r/prometheus-cpp" topics = ("metrics", "prometheus", "networking") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -66,9 +66,9 @@ def requirements(self): if self.options.with_pull: self.requires("civetweb/1.16") if self.options.with_push: - self.requires("libcurl/8.0.1") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.get_safe("with_compression"): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.info.settings.compiler.cppstd: diff --git a/recipes/protobuf-c/all/conandata.yml b/recipes/protobuf-c/all/conandata.yml index 9007e5a9a5e009..76c13c0bb20578 100644 --- a/recipes/protobuf-c/all/conandata.yml +++ b/recipes/protobuf-c/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "1.5.0": + url: "https://github.com/protobuf-c/protobuf-c/archive/v1.5.0.tar.gz" + sha256: "d4cb022d55f49796959b07a9d83040822e39129bc0eb28f4e8301da17d758f62" "1.4.1": url: https://github.com/protobuf-c/protobuf-c/archive/v1.4.1.tar.gz sha256: 99be336cdb15dfc5827efe34e5ac9aaa962e2485db547dd254d2a122a7d23102 patches: + "1.5.0": + - patch_file: "patches/1.5.0-disable-msvc-runtime.patch" + patch_description: "disable msvc runtime setting" + patch_type: conan "1.4.1": # TODO: This won't be needed once upstream PR (https://github.com/protobuf-c/protobuf-c/pull/555) gets merged - patch_file: "patches/1.4.1-cmake-protobuf-target.patch" diff --git a/recipes/protobuf-c/all/conanfile.py b/recipes/protobuf-c/all/conanfile.py index 83f6ad3e9a327a..2111ba51320e00 100644 --- a/recipes/protobuf-c/all/conanfile.py +++ b/recipes/protobuf-c/all/conanfile.py @@ -55,6 +55,8 @@ def build_requirements(self): self.tool_requires("protobuf/3.21.9", visible=True) else: self.tool_requires("protobuf/3.21.9") + if Version(self.version) >= "1.5.0": + self.tool_requires("cmake/[>=3.19 <4]") def requirements(self): self.requires("protobuf/3.21.9") @@ -89,9 +91,11 @@ def package(self): cmake = CMake(self) cmake.install() copy(self, pattern="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")) + # TODO: This won't be needed once upstream PR (https://github.com/protobuf-c/protobuf-c/pull/555) gets merged copy(self, "protobuf-c.cmake", dst=os.path.join(self.package_folder, self._cmake_install_base_path), src=self.export_sources_folder) - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): # upstream CMake config file name and target name matches the package name diff --git a/recipes/protobuf-c/all/patches/1.5.0-disable-msvc-runtime.patch b/recipes/protobuf-c/all/patches/1.5.0-disable-msvc-runtime.patch new file mode 100644 index 00000000000000..babf079071444b --- /dev/null +++ b/recipes/protobuf-c/all/patches/1.5.0-disable-msvc-runtime.patch @@ -0,0 +1,13 @@ +diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt +index f46fba7..bac3ce4 100644 +--- a/build-cmake/CMakeLists.txt ++++ b/build-cmake/CMakeLists.txt +@@ -68,7 +68,7 @@ if(MSVC) + + # Allow matching protobuf runtime dependency + if(NOT BUILD_SHARED_LIBS) +- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") ++# set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + endif(NOT BUILD_SHARED_LIBS) + + ENDIF() diff --git a/recipes/protobuf-c/config.yml b/recipes/protobuf-c/config.yml index 4709a2eb80f4cf..e8bcb860994297 100644 --- a/recipes/protobuf-c/config.yml +++ b/recipes/protobuf-c/config.yml @@ -1,3 +1,5 @@ versions: + "1.5.0": + folder: all "1.4.1": folder: all diff --git a/recipes/protobuf/all/conandata.yml b/recipes/protobuf/all/conandata.yml index 76af562b2e6c02..0417c4d805f42f 100644 --- a/recipes/protobuf/all/conandata.yml +++ b/recipes/protobuf/all/conandata.yml @@ -5,21 +5,18 @@ sources: "3.21.9": url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.9.tar.gz" sha256: "1add10f9bd92775b91f326da259f243881e904dd509367d5031d4c782ba82810" - "3.21.4": - url: "https://github.com/protocolbuffers/protobuf/archive/v3.21.4.tar.gz" - sha256: "85d42d4485f36f8cec3e475a3b9e841d7d78523cd775de3a86dba77081f4ca25" + "3.20.3": + url: "https://github.com/protocolbuffers/protobuf/archive/v3.20.3.tar.gz" + sha256: "9c0fd39c7a08dff543c643f0f4baf081988129a411b977a07c46221793605638" "3.20.0": url: "https://github.com/protocolbuffers/protobuf/archive/v3.20.0.tar.gz" sha256: "b07772d38ab07e55eca4d50f4b53da2d998bb221575c60a4f81100242d4b4889" "3.19.6": url: "https://github.com/protocolbuffers/protobuf/archive/v3.19.6.tar.gz" sha256: "9a301cf94a8ddcb380b901e7aac852780b826595075577bb967004050c835056" - "3.19.4": - url: "https://github.com/protocolbuffers/protobuf/archive/v3.19.4.tar.gz" - sha256: "3bd7828aa5af4b13b99c191e8b1e884ebfa9ad371b0ce264605d347f135d2568" - "3.18.1": - url: "https://github.com/protocolbuffers/protobuf/archive/v3.18.1.tar.gz" - sha256: "9111bf0b542b631165fadbd80aa60e7fb25b25311c532139ed2089d76ddf6dd7" + "3.18.3": + url: "https://github.com/protocolbuffers/protobuf/archive/v3.18.3.tar.gz" + sha256: "663b3a6d56605e6ab7888d32a1525c34f34639b25b8996337821591e60c37041" "3.17.1": url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.17.1.tar.gz" sha256: "036d66d6eec216160dd898cfb162e9d82c1904627642667cc32b104d407bb411" @@ -34,8 +31,8 @@ patches: patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" patch_type: "bugfix" patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" - "3.21.4": - - patch_file: "patches/protobuf-3.21.4-upstream-macos-macros.patch" + "3.20.3": + - patch_file: "patches/protobuf-3.20.0-upstream-macos-macros.patch" patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" patch_type: "bugfix" patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" @@ -53,16 +50,7 @@ patches: patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" patch_type: "bugfix" patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" - "3.19.4": - - patch_file: "patches/upstream-pr-9437-msvc-runtime.patch" - patch_description: "Properly handle CMAKE_MSVC_RUNTIME_LIBRARY when using CMake >= 3.15" - patch_type: "portability" - patch_source: "https://github.com/protocolbuffers/protobuf/pull/9437" - - patch_file: "patches/protobuf-3.19.4-upstream-macos-macros.patch" - patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" - patch_type: "bugfix" - patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" - "3.18.1": + "3.18.3": - patch_file: "patches/protobuf-3.18.1-upstream-macos-macros.patch" patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" patch_type: "bugfix" diff --git a/recipes/protobuf/all/conanfile.py b/recipes/protobuf/all/conanfile.py index d12aca6f2317cc..f696a278806848 100644 --- a/recipes/protobuf/all/conanfile.py +++ b/recipes/protobuf/all/conanfile.py @@ -19,7 +19,7 @@ class ProtobufConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/protocolbuffers/protobuf" license = "BSD-3-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -48,18 +48,12 @@ def _is_clang_cl(self): def _is_clang_x86(self): return self.settings.compiler == "clang" and self.settings.arch == "x86" - @property - def _can_disable_rtti(self): - return Version(self.version) >= "3.15.4" - def export_sources(self): export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self._can_disable_rtti: - del self.options.with_rtti def configure(self): if self.options.shared: @@ -70,7 +64,7 @@ def layout(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.options.shared and is_msvc_static_runtime(self): @@ -79,7 +73,7 @@ def validate(self): check_min_vs(self, "190") if self.settings.compiler == "clang": - if Version(self.version) >= "3.15.4" and Version(self.settings.compiler.version) < "4": + if Version(self.settings.compiler.version) < "4": raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang < 4") def source(self): @@ -97,10 +91,8 @@ def generate(self): tc.cache_variables["protobuf_BUILD_PROTOC_BINARIES"] = self.settings.os != "tvOS" if not self.options.debug_suffix: tc.cache_variables["protobuf_DEBUG_POSTFIX"] = "" - if Version(self.version) >= "3.14.0": - tc.cache_variables["protobuf_BUILD_LIBPROTOC"] = self.settings.os != "tvOS" - if self._can_disable_rtti: - tc.cache_variables["protobuf_DISABLE_RTTI"] = not self.options.with_rtti + tc.cache_variables["protobuf_BUILD_LIBPROTOC"] = self.settings.os != "tvOS" + tc.cache_variables["protobuf_DISABLE_RTTI"] = not self.options.with_rtti if is_msvc(self) or self._is_clang_cl: runtime = msvc_runtime_flag(self) if not runtime: @@ -132,20 +124,33 @@ def _patch_sources(self): protoc_filename = "protoc" + exe_ext module_folder_depth = len(os.path.normpath(self._cmake_install_base_path).split(os.path.sep)) protoc_rel_path = "{}bin/{}".format("".join(["../"] * module_folder_depth), protoc_filename) - protoc_target = textwrap.dedent("""\ + protoc_target = textwrap.dedent(f"""\ if(NOT TARGET protobuf::protoc) + # Locate protoc executable + ## Workaround for legacy "cmake" generator in case of cross-build if(CMAKE_CROSSCOMPILING) - find_program(PROTOC_PROGRAM protoc PATHS ENV PATH NO_DEFAULT_PATH) + find_program(PROTOC_PROGRAM NAMES protoc PATHS ENV PATH NO_DEFAULT_PATH) endif() + ## And here this will work fine with "CMakeToolchain" (for native & cross-build) + ## and legacy "cmake" generator in case of native build + if(NOT PROTOC_PROGRAM) + find_program(PROTOC_PROGRAM NAMES protoc) + endif() + ## Last resort: we search in package folder directly if(NOT PROTOC_PROGRAM) set(PROTOC_PROGRAM \"${{CMAKE_CURRENT_LIST_DIR}}/{protoc_rel_path}\") endif() get_filename_component(PROTOC_PROGRAM \"${{PROTOC_PROGRAM}}\" ABSOLUTE) + + # Give opportunity to users to provide an external protoc executable + # (this is a feature of official FindProtobuf.cmake) set(Protobuf_PROTOC_EXECUTABLE ${{PROTOC_PROGRAM}} CACHE FILEPATH \"The protoc compiler\") + + # Create executable imported target protobuf::protoc add_executable(protobuf::protoc IMPORTED) set_property(TARGET protobuf::protoc PROPERTY IMPORTED_LOCATION ${{Protobuf_PROTOC_EXECUTABLE}}) endif() - """.format(protoc_rel_path=protoc_rel_path)) + """) replace_in_file(self, protobuf_config_cmake, "include(\"${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake\")", diff --git a/recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch deleted file mode 100644 index b0f3ddc0920474..00000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc -index 37632cf..561fd0f 100644 ---- a/src/google/protobuf/port_def.inc -+++ b/src/google/protobuf/port_def.inc -@@ -763,6 +763,22 @@ - #undef timezone - #endif // _MSC_VER - -+#ifdef __APPLE__ -+// Inconvenient macro names from usr/include/math.h in some macOS SDKs. -+#pragma push_macro("DOMAIN") -+#undef DOMAIN -+// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. -+#pragma push_macro("TRUE") -+#undef TRUE -+#pragma push_macro("FALSE") -+#undef FALSE -+// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. -+#pragma push_macro("UID_MAX") -+#undef UID_MAX -+#pragma push_macro("GID_MAX") -+#undef GID_MAX -+#endif // __APPLE__ -+ - #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) - // Don't let Objective-C Macros interfere with proto identifiers with the same - // name. -diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc -index 579eb41..7a179f9 100644 ---- a/src/google/protobuf/port_undef.inc -+++ b/src/google/protobuf/port_undef.inc -@@ -129,6 +129,14 @@ - #pragma pop_macro("timezone") - #endif - -+#ifdef __APPLE__ -+#pragma pop_macro("DOMAIN") -+#pragma pop_macro("TRUE") -+#pragma pop_macro("FALSE") -+#pragma pop_macro("UID_MAX") -+#pragma pop_macro("GID_MAX") -+#endif // __APPLE__ -+ - #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) - #pragma pop_macro("DEBUG") - #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch deleted file mode 100644 index 6cf85b0ac39410..00000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc -index b7af780..d50ac87 100644 ---- a/src/google/protobuf/port_def.inc -+++ b/src/google/protobuf/port_def.inc -@@ -870,6 +870,8 @@ - // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. - #pragma push_macro("UID_MAX") - #undef UID_MAX -+#pragma push_macro("GID_MAX") -+#undef GID_MAX - #endif // __APPLE__ - - #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) -diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc -index e880fa5..f8968d9 100644 ---- a/src/google/protobuf/port_undef.inc -+++ b/src/google/protobuf/port_undef.inc -@@ -144,6 +144,7 @@ - #pragma pop_macro("TRUE") - #pragma pop_macro("FALSE") - #pragma pop_macro("UID_MAX") -+#pragma pop_macro("GID_MAX") - #endif // __APPLE__ - - #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/upstream-pr-9153-msvc-runtime.patch b/recipes/protobuf/all/patches/upstream-pr-9153-msvc-runtime.patch deleted file mode 100644 index e55d642882aa34..00000000000000 --- a/recipes/protobuf/all/patches/upstream-pr-9153-msvc-runtime.patch +++ /dev/null @@ -1,15 +0,0 @@ -upstream PR: https://github.com/protocolbuffers/protobuf/pull/9153 - ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -182,7 +182,9 @@ else (protobuf_BUILD_SHARED_LIBS) - # making programmatic control difficult. Prefer the functionality in newer - # CMake versions when available. - if(CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15) -- set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>) -+ if(protobuf_MSVC_STATIC_RUNTIME) -+ set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>) -+ endif() - else() - # In case we are building static libraries, link also the runtime library statically - # so that MSVCR*.DLL is not required at runtime. diff --git a/recipes/protobuf/all/test_package/conanfile.py b/recipes/protobuf/all/test_package/conanfile.py index 3823d923c46842..81404c86104a87 100644 --- a/recipes/protobuf/all/test_package/conanfile.py +++ b/recipes/protobuf/all/test_package/conanfile.py @@ -1,13 +1,12 @@ from conan import ConanFile -from conan.tools.build import can_run, cross_building +from conan.tools.build import can_run from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps" + generators = "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" test_type = "explicit" def layout(self): @@ -17,15 +16,9 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - if cross_building(self) and hasattr(self, "settings_build"): - self.tool_requires(self.tested_reference_str) + self.tool_requires(self.tested_reference_str) def generate(self): - VirtualRunEnv(self).generate() - if cross_building(self) and hasattr(self, "settings_build"): - VirtualBuildEnv(self).generate() - else: - VirtualRunEnv(self).generate(scope="build") tc = CMakeToolchain(self) tc.cache_variables["protobuf_LITE"] = self.dependencies[self.tested_reference_str].options.lite tc.generate() diff --git a/recipes/protobuf/config.yml b/recipes/protobuf/config.yml index 1c42531d91fe05..89750d93410cce 100644 --- a/recipes/protobuf/config.yml +++ b/recipes/protobuf/config.yml @@ -3,15 +3,13 @@ versions: folder: all "3.21.9": folder: all - "3.21.4": + "3.20.3": folder: all "3.20.0": folder: all "3.19.6": folder: all - "3.19.4": - folder: all - "3.18.1": + "3.18.3": folder: all "3.17.1": folder: all diff --git a/recipes/psimd/all/conanfile.py b/recipes/psimd/all/conanfile.py index 138520809226b4..977da9b21114ce 100644 --- a/recipes/psimd/all/conanfile.py +++ b/recipes/psimd/all/conanfile.py @@ -13,6 +13,7 @@ class PsimdConan(ConanFile): topics = ("psimd", "simd") homepage = "https://github.com/Maratyszcza/psimd" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -23,8 +24,7 @@ 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 diff --git a/recipes/ptex/all/conanfile.py b/recipes/ptex/all/conanfile.py index f8059fec65c6b2..48fcf6593c820d 100644 --- a/recipes/ptex/all/conanfile.py +++ b/recipes/ptex/all/conanfile.py @@ -40,7 +40,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/pugixml/all/conandata.yml b/recipes/pugixml/all/conandata.yml index 0e56e7f953dbc0..cfdd629e0abb24 100644 --- a/recipes/pugixml/all/conandata.yml +++ b/recipes/pugixml/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.14": + url: "https://github.com/zeux/pugixml/releases/download/v1.14/pugixml-1.14.tar.gz" + sha256: "2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015" "1.13": url: "https://github.com/zeux/pugixml/releases/download/v1.13/pugixml-1.13.tar.gz" sha256: "40c0b3914ec131485640fa57e55bf1136446026b41db91c1bef678186a12abbe" diff --git a/recipes/pugixml/all/conanfile.py b/recipes/pugixml/all/conanfile.py index c5890f6dbab550..7ac623ed2f0816 100644 --- a/recipes/pugixml/all/conanfile.py +++ b/recipes/pugixml/all/conanfile.py @@ -15,6 +15,7 @@ class PugiXmlConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://pugixml.org/" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { diff --git a/recipes/pugixml/config.yml b/recipes/pugixml/config.yml index 191cc957e0c3b6..384412d36091f9 100644 --- a/recipes/pugixml/config.yml +++ b/recipes/pugixml/config.yml @@ -1,4 +1,6 @@ versions: + "1.14": + folder: "all" "1.13": folder: "all" "1.12.1": diff --git a/recipes/pulseaudio/all/conanfile.py b/recipes/pulseaudio/all/conanfile.py index 84e7c6bf375e7f..1a469fa5694dfd 100644 --- a/recipes/pulseaudio/all/conanfile.py +++ b/recipes/pulseaudio/all/conanfile.py @@ -58,13 +58,13 @@ def layout(self): def requirements(self): self.requires("libiconv/1.17") - self.requires("libsndfile/1.2.0") - self.requires("libcap/2.66") + self.requires("libsndfile/1.2.2") + self.requires("libcap/2.69") self.requires("libtool/2.4.7") if self.options.with_alsa: - self.requires("libalsa/1.2.7.2") + self.requires("libalsa/1.2.10") if self.options.with_glib: - self.requires("glib/2.76.1") + self.requires("glib/2.78.1") if self.options.get_safe("with_fftw"): self.requires("fftw/3.3.10") if self.options.with_x11: @@ -72,25 +72,24 @@ def requirements(self): if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_dbus: - self.requires("dbus/1.15.2") + self.requires("dbus/1.15.8") def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("pulseaudio supports only linux currently") if self.options.get_safe("with_fftw"): - fftw_precision = self.dependencies["fftw"].options.precision - if fftw_precision != "single": + if not self.dependencies["fftw"].options.precision_single: raise ConanInvalidConfiguration( - f"Pulse audio cannot use fftw {fftw_precision} precision. " - "Either set option fftw:precision=single or pulseaudio:with_fftw=False" + f"Pulse audio uses fftw single precision. " + "Either set option -o fftw/*:precision_single=True or -o pulseaudio/*:with_fftw=False" ) def build_requirements(self): self.tool_requires("gettext/0.21") 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") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/pupnp/all/conandata.yml b/recipes/pupnp/all/conandata.yml index 388307853302ae..7964480fefad59 100644 --- a/recipes/pupnp/all/conandata.yml +++ b/recipes/pupnp/all/conandata.yml @@ -8,3 +8,6 @@ sources: "1.14.12": url: "https://github.com/pupnp/pupnp/archive/release-1.14.12.tar.gz" sha256: "6a7f26818d5aa3949bc2e68739387a261c564430ba612f793c61d31619dde1e4" + "1.14.18": + url: "https://github.com/pupnp/pupnp/archive/release-1.14.18.tar.gz" + sha256: "8b038be04c04886b6304c0878f7eb502c8f4800524acf44ce8f9cd7f9319df90" diff --git a/recipes/pupnp/all/conanfile.py b/recipes/pupnp/all/conanfile.py index be3c8ca6dae343..718caaaae44f4a 100644 --- a/recipes/pupnp/all/conanfile.py +++ b/recipes/pupnp/all/conanfile.py @@ -1,8 +1,15 @@ -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.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 Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class PupnpConan(ConanFile): @@ -15,8 +22,10 @@ class PupnpConan(ConanFile): license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/pupnp/pupnp" - topics = ("conan", "upnp", "networking") - settings = "os", "compiler", "build_type", "arch" + topics = ("upnp", "networking") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -28,7 +37,7 @@ class PupnpConan(ConanFile): "largefile": [True, False], "tools": [True, False], "blocking-tcp": [True, False], - "debug": [True, False] + "debug": [True, False], } default_options = { "shared": False, @@ -41,95 +50,75 @@ class PupnpConan(ConanFile): "largefile": True, "tools": True, "blocking-tcp": False, - "debug": True # Actually enables logging routines... + "debug": True, } - _autotools = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC 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") if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): # Note, pupnp has build instructions for Visual Studio but they # include VC 6 and require pthreads-w32 library. # Someone who needs it and has possibility to build it could step in. raise ConanInvalidConfiguration("Visual Studio not supported yet in this recipe") - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - def build_requirements(self): - 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("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) - - def _configure_autotools(self): - if not self._autotools: - args = [ - "--enable-static=%s" % ("no" if self.options.shared else "yes"), - "--enable-shared=%s" % ("yes" if self.options.shared else "no"), - "--disable-samples", - ] - - def enable_disable(opt): - what = "enable" if getattr(self.options, opt) else "disable" - return "--{}-{}".format(what, opt) - - args.extend( - map( - enable_disable, - ( - "ipv6", - "reuseaddr", - "webserver", - "client", - "device", - "largefile", - "tools", - "debug" - ), - ) - ) - - args.append("--%s-blocking_tcp_connections" % ("enable" if getattr(self.options, "blocking-tcp") else "disable")) - - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.configure(configure_dir=self._source_subfolder, args=args) - return self._autotools + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + features = {} + features["samples"] = False + features["blocking_tcp_connections"] = self.options["blocking-tcp"] + for opt in ("ipv6", "reuseaddr", "webserver", "client", "device", "largefile", "tools", "debug"): + features[opt] = self.options.get_safe(opt) + for feature, enabled in features.items(): + what = "enable" if enabled else "disable" + tc.configure_args.append(f"--{what}-{feature}") + tc.generate() def build(self): - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + autotools = Autotools(self) autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.names["pkg_config"] = "libupnp" + self.cpp_info.set_property("pkg_config_name", "libupnp") self.cpp_info.libs = ["upnp", "ixml"] self.cpp_info.includedirs.append(os.path.join("include", "upnp")) if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/pupnp/all/test_package/CMakeLists.txt b/recipes/pupnp/all/test_package/CMakeLists.txt index 4715fd995b522f..d453ce024a9683 100644 --- a/recipes/pupnp/all/test_package/CMakeLists.txt +++ b/recipes/pupnp/all/test_package/CMakeLists.txt @@ -1,10 +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(TARGETS) - -find_package(pupnp REQUIRED) +find_package(pupnp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} pupnp::pupnp) diff --git a/recipes/pupnp/all/test_package/conanfile.py b/recipes/pupnp/all/test_package/conanfile.py index 91263ae215697e..ef5d7042163ecc 100644 --- a/recipes/pupnp/all/test_package/conanfile.py +++ b/recipes/pupnp/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 CMake, ConanFile, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class PupnpTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - 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) @@ -13,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - 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/pupnp/all/test_v1_package/CMakeLists.txt b/recipes/pupnp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/pupnp/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/pupnp/all/test_v1_package/conanfile.py b/recipes/pupnp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..b1255b47b830e3 --- /dev/null +++ b/recipes/pupnp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import CMake, ConanFile, tools + + +class PupnpTestConan(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, skip_x64_x86=True): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/pupnp/config.yml b/recipes/pupnp/config.yml index 700325f13fdc85..1338c7bbcf33f3 100644 --- a/recipes/pupnp/config.yml +++ b/recipes/pupnp/config.yml @@ -5,3 +5,5 @@ versions: folder: all "1.14.12": folder: all + "1.14.18": + folder: all diff --git a/recipes/pybind11/all/conandata.yml b/recipes/pybind11/all/conandata.yml index 062301bf4716d3..62adb5a253c62e 100644 --- a/recipes/pybind11/all/conandata.yml +++ b/recipes/pybind11/all/conandata.yml @@ -20,3 +20,6 @@ sources: 2.10.4: url: "https://github.com/pybind/pybind11/archive/v2.10.4.tar.gz" sha256: "832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970" + 2.11.1: + url: "https://github.com/pybind/pybind11/archive/v2.11.1.tar.gz" + sha256: "d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c" diff --git a/recipes/pybind11/all/conanfile.py b/recipes/pybind11/all/conanfile.py index 4ca688fce0b2be..aa098ee90ec20f 100644 --- a/recipes/pybind11/all/conanfile.py +++ b/recipes/pybind11/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.cmake import CMake, CMakeToolchain from conan.tools.layout import basic_layout from conan.tools.files import get, copy, replace_in_file, rm, rmdir +from conan.tools.scm import Version import os @@ -45,8 +46,9 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) + checked_target = "lto" if self.version < Version("2.11.0") else "pybind11" replace_in_file(self, os.path.join(self.package_folder, "lib", "cmake", "pybind11", "pybind11Common.cmake"), - "if(TARGET pybind11::lto)", + f"if(TARGET pybind11::{checked_target})", "if(FALSE)") replace_in_file(self, os.path.join(self.package_folder, "lib", "cmake", "pybind11", "pybind11Common.cmake"), "add_library(", diff --git a/recipes/pybind11/all/test_package/conanfile.py b/recipes/pybind11/all/test_package/conanfile.py index 0f281e118c5443..1022e21500a404 100644 --- a/recipes/pybind11/all/test_package/conanfile.py +++ b/recipes/pybind11/all/test_package/conanfile.py @@ -50,4 +50,4 @@ def _python_interpreter(self): def test(self): if can_run(self): module_path = os.path.join(self.source_folder, "test.py") - self.run(f"{self._python_interpreter} {module_path}", env="conanrun") + self.run(f"{self._python_interpreter} \"{module_path}\"", env="conanrun") diff --git a/recipes/pybind11/config.yml b/recipes/pybind11/config.yml index 03a8eff62e5b8f..0637bb6f5067ed 100644 --- a/recipes/pybind11/config.yml +++ b/recipes/pybind11/config.yml @@ -13,3 +13,5 @@ versions: folder: all "2.10.4": folder: all + "2.11.1": + folder: all diff --git a/recipes/pybind11_json/all/conanfile.py b/recipes/pybind11_json/all/conanfile.py index 4c4feedd8416af..829dedced7271c 100644 --- a/recipes/pybind11_json/all/conanfile.py +++ b/recipes/pybind11_json/all/conanfile.py @@ -1,48 +1,47 @@ -from conans import ConanFile, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class Pybind11JsonConan(ConanFile): name = "pybind11_json" - homepage = "https://github.com/pybind/pybind11_json" description = "An nlohmann_json to pybind11 bridge" - topics = ( - "conan", - "header-only", - "json", - "nlohmann_json", - "pybind11", - "pybind11_json", - "python", - "python-binding", - ) - url = "https://github.com/conan-io/conan-center-index" - no_copy_source = True license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/pybind/pybind11_json" + topics = ("header-only", "json", "nlohmann_json", "pybind11", "pybind11_json", "python", "python-binding") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True - def package_id(self): - self.info.header_only() + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("nlohmann_json/3.9.1") - self.requires("pybind11/2.6.2") + self.requires("nlohmann_json/3.11.2") + self.requires("pybind11/2.10.4") + + def package_id(self): + self.info.clear() 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(pattern="LICENSE*", src=self._source_subfolder, dst="licenses") - self.copy( - "*", 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, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "pybind11_json" - self.cpp_info.names["cmake_find_package_multi"] = "pybind11_json" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_target_aliases", ["pybind11_json"]) diff --git a/recipes/pybind11_json/all/test_package/CMakeLists.txt b/recipes/pybind11_json/all/test_package/CMakeLists.txt index d1ca457a18f131..f795a0bec71587 100644 --- a/recipes/pybind11_json/all/test_package/CMakeLists.txt +++ b/recipes/pybind11_json/all/test_package/CMakeLists.txt @@ -1,12 +1,10 @@ -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) set(CMAKE_CXX_STANDARD 11) find_package(pybind11_json REQUIRED CONFIG) add_executable(test_package test_package.cpp) -target_link_libraries(test_package PUBLIC pybind11_json::pybind11_json) # FIXME: target should be pybind11_json + # FIXME: target should be pybind11_json, replace once Conan v1 has been dropped +target_link_libraries(test_package PUBLIC pybind11_json::pybind11_json) diff --git a/recipes/pybind11_json/all/test_package/conanfile.py b/recipes/pybind11_json/all/test_package/conanfile.py index 7e2dfe859bb27b..fae501d0afb9e4 100644 --- a/recipes/pybind11_json/all/test_package/conanfile.py +++ b/recipes/pybind11_json/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" + 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/pybind11_json/all/test_package/test_package.cpp b/recipes/pybind11_json/all/test_package/test_package.cpp index 1e50fae0cd666c..2ebca6ab52bbde 100644 --- a/recipes/pybind11_json/all/test_package/test_package.cpp +++ b/recipes/pybind11_json/all/test_package/test_package.cpp @@ -17,10 +17,10 @@ int main() { py::scoped_interpreter guard{}; const py::dict original_py_dict{"number"_a=1234, "hello"_a="world"}; - + const nl::json converted_nl_json{original_py_dict}; std::cout << "Converted nlohmann::json contents: " << converted_nl_json << std::endl; - + const py::dict converted_py_dict = converted_nl_json.front(); // assigning the only list element std::cout << "Converted py::dict contents: {hello:" << converted_py_dict["hello"].cast() diff --git a/recipes/pybind11_json/all/test_v1_package/CMakeLists.txt b/recipes/pybind11_json/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/pybind11_json/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/pybind11_json/all/test_v1_package/conanfile.py b/recipes/pybind11_json/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7e2dfe859bb27b --- /dev/null +++ b/recipes/pybind11_json/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qarchive/all/conandata.yml b/recipes/qarchive/all/conandata.yml index da2432b9b6e33b..5c350fe46c402a 100644 --- a/recipes/qarchive/all/conandata.yml +++ b/recipes/qarchive/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.2.8": + url: "https://github.com/antony-jr/QArchive/archive/v2.2.8.tar.gz" + sha256: "2f231b48b51de5d730f98bffbff34d7791b61ea766429230d81bce82c7ce1bf9" + "2.2.6": + url: "https://github.com/antony-jr/QArchive/archive/v2.2.6.tar.gz" + sha256: "c0cad2bc79eeb4ab4180fd97822a967b8a0e3c594387ccf921733449ee5bd3e6" "2.2.4": url: "https://github.com/antony-jr/QArchive/archive/v2.2.4.tar.gz" sha256: "7c7f0e3bf3d6fb5130aa4632201873511944cd98ab16b273da5072198f53ad7b" diff --git a/recipes/qarchive/all/conanfile.py b/recipes/qarchive/all/conanfile.py index b299a0c2ae050d..320e0e4349c527 100644 --- a/recipes/qarchive/all/conanfile.py +++ b/recipes/qarchive/all/conanfile.py @@ -49,7 +49,7 @@ def layout(self): def requirements(self): self.requires("libarchive/3.6.2") - self.requires("qt/5.15.9") + self.requires("qt/5.15.10", transitive_headers=True, transitive_libs=True) def build_requirements(self): self.tool_requires("cmake/[>=3.17 <4]") @@ -104,7 +104,8 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "QArchive") self.cpp_info.set_property("pkg_config_name", "QArchive") self.cpp_info.libs = ["QArchive"] - self.cpp_info.includedirs = [os.path.join("include", "QArchive")] + self.cpp_info.includedirs.append(os.path.join("include", "QArchive")) + self.cpp_info.requires = ["qt::qtCore", "libarchive::libarchive"] # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "QArchive" diff --git a/recipes/qarchive/config.yml b/recipes/qarchive/config.yml index 3db8c0c3676e91..201ce057fb3e53 100644 --- a/recipes/qarchive/config.yml +++ b/recipes/qarchive/config.yml @@ -1,4 +1,8 @@ versions: + "2.2.8": + folder: all + "2.2.6": + folder: all "2.2.4": folder: all "2.2.3": diff --git a/recipes/qdbm/all/CMakeLists.txt b/recipes/qdbm/all/CMakeLists.txt index 39427c2f3ccc36..504c6e681a7127 100644 --- a/recipes/qdbm/all/CMakeLists.txt +++ b/recipes/qdbm/all/CMakeLists.txt @@ -1,11 +1,7 @@ -cmake_minimum_required(VERSION 3.1) - +cmake_minimum_required(VERSION 3.12) project(qdbm_wrapper VERSION "${CONAN_qdbm_VERSION}" LANGUAGES C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS KEEP_RPATHS) - -set(QDBM_SRC_DIR ${PROJECT_SOURCE_DIR}/source_subfolder) +set(QDBM_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/src) # ---- Dependencies ---- @@ -64,9 +60,7 @@ set_target_properties( # ---- Install ---- include(GNUInstallDirs) - -install( - TARGETS qdbm +install(TARGETS qdbm RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" diff --git a/recipes/qdbm/all/conandata.yml b/recipes/qdbm/all/conandata.yml index c04a6ca2954e60..bd41a3e5c73fa9 100644 --- a/recipes/qdbm/all/conandata.yml +++ b/recipes/qdbm/all/conandata.yml @@ -1,4 +1,4 @@ sources: "1.8.78": sha256: "b466fe730d751e4bfc5900d1f37b0fb955f2826ac456e70012785e012cdcb73e" - url: http://fallabs.com/qdbm/qdbm-1.8.78.tar.gz + url: "https://dbmx.net/qdbm/qdbm-1.8.78.tar.gz" diff --git a/recipes/qdbm/all/conanfile.py b/recipes/qdbm/all/conanfile.py index 476d0ec62783b6..7de5afa132670e 100644 --- a/recipes/qdbm/all/conanfile.py +++ b/recipes/qdbm/all/conanfile.py @@ -1,17 +1,22 @@ -from conans import ConanFile, CMake, tools -import functools +import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.53.0" class QDBMConan(ConanFile): name = "qdbm" description = "QDBM is a library of routines for managing a database." - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://fallabs.com/qdbm/" - topics = ("qdbm", "database", "db") license = "LGPL-2.1-or-later" - settings = ("os", "arch", "compiler", "build_type") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://dbmx.net/qdbm/" + topics = ("database", "db") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -27,52 +32,50 @@ class QDBMConan(ConanFile): "with_zlib": True, } - generators = "cmake", "cmake_find_package" - exports_sources = "CMakeLists.txt" - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - del self.options.with_pthread + self.options.rm_safe("with_pthread") 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_iconv: - self.requires("libiconv/1.16") + self.requires("libiconv/1.17") if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/[>=1.2.11 <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) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["CONAN_qdbm_VERSION"] = self.version - cmake.definitions["MYICONV"] = self.options.with_iconv - cmake.definitions["MYZLIB"] = self.options.with_zlib - cmake.definitions["MYPTHREAD"] = self.options\ - .get_safe("with_pthread", False) - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CONAN_qdbm_VERSION"] = self.version + tc.variables["MYICONV"] = self.options.with_iconv + tc.variables["MYZLIB"] = self.options.with_zlib + tc.variables["MYPTHREAD"] = self.options.get_safe("with_pthread", False) + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) 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() def package_info(self): diff --git a/recipes/qdbm/all/test_package/CMakeLists.txt b/recipes/qdbm/all/test_package/CMakeLists.txt index ea1c210104fb13..5c076c42369f78 100644 --- a/recipes/qdbm/all/test_package/CMakeLists.txt +++ b/recipes/qdbm/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(qdbm REQUIRED CONFIG) add_executable(test_package test_package.c) diff --git a/recipes/qdbm/all/test_package/conanfile.py b/recipes/qdbm/all/test_package/conanfile.py index ec80e0c5cc1345..ef5d7042163ecc 100644 --- a/recipes/qdbm/all/test_package/conanfile.py +++ b/recipes/qdbm/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", "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) @@ -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/qdbm/all/test_package/test_package.c b/recipes/qdbm/all/test_package/test_package.c index 68bad9e85cf152..3d79beba622577 100644 --- a/recipes/qdbm/all/test_package/test_package.c +++ b/recipes/qdbm/all/test_package/test_package.c @@ -1,12 +1,8 @@ #include #include -int main(int argc, char const* argv[]) +int main() { - (void)argc; - (void)argv; - - cbfree(NULL); - - return 0; + cbfree(NULL); + return 0; } diff --git a/recipes/qdbm/all/test_v1_package/CMakeLists.txt b/recipes/qdbm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/qdbm/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/qdbm/all/test_v1_package/conanfile.py b/recipes/qdbm/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..ec80e0c5cc1345 --- /dev/null +++ b/recipes/qdbm/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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") + self.run(bin_path, run_environment=True) diff --git a/recipes/qpdf/all/conanfile.py b/recipes/qpdf/all/conanfile.py index d5b0654a5d1792..e97cf90bc30a7b 100644 --- a/recipes/qpdf/all/conanfile.py +++ b/recipes/qpdf/all/conanfile.py @@ -62,15 +62,15 @@ def layout(self): def requirements(self): # https://qpdf.readthedocs.io/en/stable/installation.html#basic-dependencies - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_ssl == "openssl": self.requires("openssl/[>=1.1 <4]") 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.1") + self.requires("mozjpeg/4.1.3") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -88,7 +88,7 @@ def validate(self): def build_requirements(self): self.tool_requires("cmake/[>=3.16 <4]") 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/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml index d0847c695c3717..db92ab6d5dace6 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -1,4 +1,26 @@ sources: + "5.15.11": + url: + - "https://download.qt.io/official_releases/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://download.qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://mirror.web4africa.ng/qt/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" + sha256: "7426b1eaab52ed169ce53804bdd05dfe364f761468f888a0f15a308dc1dc2951" "5.15.10": url: - "https://download.qt.io/official_releases/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" @@ -55,6 +77,37 @@ sources: - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" sha256: "8a71986676a3f37a198a9113acedbfd5bc5606a459b6b85816d951458adbe9a0" patches: + "5.15.11": + - "base_path": "qt5/qtbase" + "patch_file": "patches/aa2a39dea5.diff" + - "base_path": "qt5/qtwebengine" + "patch_file": "patches/c72097e.diff" + - "base_path": "qt5/qttools" + "patch_file": "patches/fix-macdeployqt.diff" + - "base_path": "qt5/qtwebengine/src/3rdparty/chromium/v8" + "patch_file": "patches/chromium-v8-missing-constexpr.patch" + - "base_path": "qt5/qtwebengine/src/3rdparty" + "patch_file": "patches/chromium-skia-missing-iterator-include.patch" + - "base_path": "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" + "patch_file": "patches/skia-cd397f3.diff" + - "base_path": "qt5/qtwebengine/src/3rdparty" + "patch_file": "patches/0001-Find-fontconfig-using-pkg-config.patch" + - "base_path": "qt5/qtbase" + "patch_file": "patches/android-backtrace.diff" + - "base_path": "qt5/qtbase" + "patch_file": "patches/android-openssl.diff" + - "base_path": "qt5/qtbase" + "patch_file": "patches/android-new-ndk.diff" + - patch_file: "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" + base_path: "qt5/qtbase" + patch_description: "Fix qmake build with apple-clang>=15" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" + - patch_file: "patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch" + base_path: "qt5/qtbase" + patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" "5.15.10": - "base_path": "qt5/qtbase" "patch_file": "patches/aa2a39dea5.diff" @@ -78,6 +131,16 @@ patches: "patch_file": "patches/android-openssl.diff" - "base_path": "qt5/qtbase" "patch_file": "patches/android-new-ndk.diff" + - patch_file: "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" + base_path: "qt5/qtbase" + patch_description: "Fix qmake build with apple-clang>=15" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" + - patch_file: "patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch" + base_path: "qt5/qtbase" + patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" "5.15.9": - "base_path": "qt5/qtbase" "patch_file": "patches/aa2a39dea5.diff" @@ -101,6 +164,16 @@ patches: "patch_file": "patches/android-openssl.diff" - "base_path": "qt5/qtbase" "patch_file": "patches/android-new-ndk.diff" + - patch_file: "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" + base_path: "qt5/qtbase" + patch_description: "Fix build with apple-clang 15" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" + - patch_file: "patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch" + base_path: "qt5/qtbase" + patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" "5.15.8": - patch_file: "patches/aa2a39dea5.diff" base_path: "qt5/qtbase" @@ -124,6 +197,16 @@ patches: base_path: "qt5/qtbase" - patch_file: "patches/android-new-ndk.diff" base_path: "qt5/qtbase" + - patch_file: "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" + base_path: "qt5/qtbase" + patch_description: "Fix build with apple-clang 15" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" + - patch_file: "patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch" + base_path: "qt5/qtbase" + patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" "5.15.7": - patch_file: "patches/337f28c9ab.patch" base_path: "qt5/qtbase" @@ -155,3 +238,13 @@ patches: base_path: "qt5/qtbase" - patch_file: "patches/android-new-ndk.diff" base_path: "qt5/qtbase" + - patch_file: "patches/5.15.7-fix-qmake-default-libdirs-apple-clang-15.patch" + base_path: "qt5/qtbase" + patch_description: "Fix build with apple-clang 15" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" + - patch_file: "patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch" + base_path: "qt5/qtbase" + patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" + patch_type: "portability" + patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 8e54f6b2a47b08..a4c631120b3561 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv from conan.tools.files import chdir, copy, get, load, replace_in_file, rm, rmdir, save, export_conandata_patches, apply_conandata_patches from conan.tools.gnu import PkgConfigDeps -from conan.tools.microsoft import msvc_runtime_flag, is_msvc, VCVars +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, is_msvc_static_runtime, VCVars from conan.tools.scm import Version import configparser import glob @@ -15,7 +15,7 @@ import textwrap import shutil -required_conan_version = ">=1.59.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.5" class QtConan(ConanFile): @@ -33,7 +33,7 @@ class QtConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.qt.io" license = "LGPL-3.0-only" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -308,7 +308,7 @@ def validate(self): raise ConanInvalidConfiguration("Qt without libc++ needs qt:with_doubleconversion. " "Either enable qt:with_doubleconversion or switch to libc++") - if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: + if is_msvc_static_runtime(self) and self.options.shared: raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") if self.settings.compiler == "apple-clang": @@ -339,7 +339,7 @@ def validate(self): raise ConanInvalidConfiguration("sqlite3 option enable_column_metadata must be enabled for qt") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_pcre2: @@ -349,53 +349,54 @@ def requirements(self): if is_apple_os(self): self.requires("moltenvk/1.2.2") if self.options.with_glib: - self.requires("glib/2.77.0") + self.requires("glib/2.78.0") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: self.requires("double-conversion/3.3.0") if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.14.2") if self.options.get_safe("with_icu", False): self.requires("icu/73.2") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: - self.requires("harfbuzz/8.0.1") + self.requires("harfbuzz/8.3.0") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: if self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.0") else: self.requires("libjpeg/9e") if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: self.requires("libpng/1.6.40") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/3.44.2") if self.options.get_safe("with_mysql", False): - self.requires("libmysqlclient/8.0.31") + self.requires("libmysqlclient/8.1.0") if self.options.with_pq: - self.requires("libpq/15.3") + self.requires("libpq/15.4") if self.options.with_odbc: if self.settings.os != "Windows": self.requires("odbc/2.3.11") if self.options.get_safe("with_openal", False): self.requires("openal-soft/1.22.2") if self.options.get_safe("with_libalsa", False): - self.requires("libalsa/1.2.7.2") - if self.options.get_safe("with_x11", False): - self.requires("xkbcommon/1.5.0") + self.requires("libalsa/1.2.10") + if self.options.get_safe("with_x11"): self.requires("xorg/system") + if self.options.get_safe("with_x11") or self.options.qtwayland: + self.requires("xkbcommon/1.5.0") if self.options.get_safe("opengl", "no") != "no": self.requires("opengl/system") if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]: self.requires("expat/2.5.0") - self.requires("opus/1.3.1") + self.requires("opus/1.4") if not self.options.qtwayland: self.requires("xorg-proto/2022.2") self.requires("libxshmfence/1.3") - self.requires("nss/3.89") + self.requires("nss/3.93") self.requires("libdrm/2.4.114") self.requires("egl/system") if self.options.get_safe("with_gstreamer", False): @@ -403,14 +404,13 @@ def requirements(self): if self.options.get_safe("with_pulseaudio", False): self.requires("pulseaudio/14.2") if self.options.with_dbus: - self.requires("dbus/1.15.6") + self.requires("dbus/1.15.8") if self.options.qtwayland: self.requires("wayland/1.22.0") - self.requires("xkbcommon/1.5.0") if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: self.requires("krb5/1.18.3") # conan-io/conan-center-index#4102 if self.options.get_safe("with_atspi"): - self.requires("at-spi2-core/2.49.1") + self.requires("at-spi2-core/2.50.0") if self.options.get_safe("with_md4c", False): self.requires("md4c/0.4.8") @@ -437,12 +437,12 @@ def build_requirements(self): self.tool_requires("gperf/3.1") # gperf, bison, flex, python >= 2.7.5 & < 3 if self._settings_build.os == "Windows": - self.tool_requires("winflexbison/2.5.24") + self.tool_requires("winflexbison/2.5.25") else: self.tool_requires("bison/3.8.2") self.tool_requires("flex/2.6.4") if self.options.qtwayland: - self.tool_requires("wayland/1.22.0") + self.tool_requires("wayland/") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -475,18 +475,6 @@ def generate(self): env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) if self.settings.os == "Windows": env.prepend_path("PATH", os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")) - if self._settings_build.os == "Macos": - # On macOS, SIP resets DYLD_LIBRARY_PATH injected by VirtualBuildEnv & VirtualRunEnv - dyld_library_path = "$DYLD_LIBRARY_PATH" - dyld_library_path_build = vbe.vars().get("DYLD_LIBRARY_PATH") - if dyld_library_path_build: - dyld_library_path = f"{dyld_library_path_build}:{dyld_library_path}" - if not cross_building(self): - dyld_library_path_host = vre.vars().get("DYLD_LIBRARY_PATH") - if dyld_library_path_host: - dyld_library_path = f"{dyld_library_path_host}:{dyld_library_path}" - save(self, "bash_env", f'export DYLD_LIBRARY_PATH="{dyld_library_path}"') - env.define_path("BASH_ENV", os.path.abspath("bash_env")) env.vars(self).save_script("conan_qt_env_file") def _make_program(self): @@ -801,6 +789,19 @@ def _getenvpath(var): if self._settings_build.os == "Linux" and self.settings.compiler == "clang": args += ['QMAKE_CXXFLAGS+="-ftemplate-depth=1024"'] + if self._settings_build.os == "Macos": + # On macOS, SIP resets DYLD_LIBRARY_PATH injected by VirtualBuildEnv & VirtualRunEnv. + # Qt builds several executables (moc etc) which are called later on during build of + # libraries, and these executables link to several external dependencies in requirements(). + # If these external libs are shared, moc calls fail because its dylib dependencies + # are not found (unless they can be accidentally found in system paths). + # So the workaround is to add libdirs of these external dependencies to LC_RPATH + # of runtime artifacts. + if not cross_building(self): + for libpath in VirtualRunEnv(self).vars().get("DYLD_LIBRARY_PATH", "").split(":"): + # see https://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-rpathdir + args += [f"QMAKE_RPATHDIR+=\"{libpath}\""] + if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]: args += ["-qt-webengine-ffmpeg", "-system-webengine-opus", @@ -841,7 +842,8 @@ def package(self): Translations = bin/datadir/translations Documentation = bin/datadir/doc Examples = bin/datadir/examples""") - copy(self, "*LICENSE*", os.path.join(self.source_folder, "qt5/"), os.path.join(self.package_folder, "licenses")) + copy(self, "*LICENSE*", os.path.join(self.source_folder, "qt5/"), os.path.join(self.package_folder, "licenses"), + excludes="qtbase/examples/*") for module in self._submodules: if not self.options.get_safe(module): rmdir(self, os.path.join(self.package_folder, "licenses", module)) @@ -1047,7 +1049,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): "exec_prefix=${prefix}", ] self.cpp_info.components["qtCore"].set_property("pkg_config_custom_content", "\n".join(pkg_config_vars)) - + if self.settings.os == "Windows": module = "WinMain" componentname = f"qt{module}" @@ -1251,6 +1253,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.qtwayland and self.options.gui: _create_module("WaylandClient", ["Gui", "wayland::wayland-client"]) diff --git a/recipes/qt/5.x.x/patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch b/recipes/qt/5.x.x/patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch new file mode 100644 index 00000000000000..21112d5316d7a0 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch @@ -0,0 +1,43 @@ +--- a/src/corelib/global/qcompilerdetection.h ++++ b/src/corelib/global/qcompilerdetection.h +@@ -1050,16 +1050,22 @@ + # endif // !_HAS_CONSTEXPR + # endif // !__GLIBCXX__ && !_LIBCPP_VERSION + # endif // Q_OS_QNX +-# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \ +- && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) ++# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) ++# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) + // Apple has not updated libstdc++ since 2007, which means it does not have + // or std::move. Let's disable these features +-# undef Q_COMPILER_INITIALIZER_LISTS +-# undef Q_COMPILER_RVALUE_REFS +-# undef Q_COMPILER_REF_QUALIFIERS ++# undef Q_COMPILER_INITIALIZER_LISTS ++# undef Q_COMPILER_RVALUE_REFS ++# undef Q_COMPILER_REF_QUALIFIERS + // Also disable , since it's clearly not there +-# undef Q_COMPILER_ATOMICS +-# endif ++# undef Q_COMPILER_ATOMICS ++# endif ++# if defined(__cpp_lib_memory_resource) \ ++ && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) \ ++ || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000)) ++# undef __cpp_lib_memory_resource // Only supported on macOS 14 and iOS 17 ++# endif ++# endif // (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) + # if defined(Q_CC_CLANG) && defined(Q_CC_INTEL) && Q_CC_INTEL >= 1500 + // ICC 15.x and 16.0 have their own implementation of std::atomic, which is activated when in Clang mode + // (probably because libc++'s on OS X failed to compile), but they're missing some +--- a/src/corelib/tools/qduplicatetracker_p.h ++++ b/src/corelib/tools/qduplicatetracker_p.h +@@ -52,7 +52,7 @@ + + #include + +-#if QT_HAS_INCLUDE() && __cplusplus > 201402L ++#if defined(__cpp_lib_memory_resource) && __cplusplus > 201402L + # include + # include + #else diff --git a/recipes/qt/5.x.x/patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch b/recipes/qt/5.x.x/patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch new file mode 100644 index 00000000000000..2eb73ac2b79b54 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch @@ -0,0 +1,43 @@ +--- a/src/corelib/global/qcompilerdetection.h ++++ b/src/corelib/global/qcompilerdetection.h +@@ -1041,16 +1041,22 @@ + # endif // !_HAS_CONSTEXPR + # endif // !__GLIBCXX__ && !_LIBCPP_VERSION + # endif // Q_OS_QNX +-# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \ +- && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) ++# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) ++# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) + // Apple has not updated libstdc++ since 2007, which means it does not have + // or std::move. Let's disable these features +-# undef Q_COMPILER_INITIALIZER_LISTS +-# undef Q_COMPILER_RVALUE_REFS +-# undef Q_COMPILER_REF_QUALIFIERS ++# undef Q_COMPILER_INITIALIZER_LISTS ++# undef Q_COMPILER_RVALUE_REFS ++# undef Q_COMPILER_REF_QUALIFIERS + // Also disable , since it's clearly not there +-# undef Q_COMPILER_ATOMICS +-# endif ++# undef Q_COMPILER_ATOMICS ++# endif ++# if defined(__cpp_lib_memory_resource) \ ++ && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) \ ++ || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000)) ++# undef __cpp_lib_memory_resource // Only supported on macOS 14 and iOS 17 ++# endif ++# endif // (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) + # if defined(Q_CC_CLANG) && defined(Q_CC_INTEL) && Q_CC_INTEL >= 1500 + // ICC 15.x and 16.0 have their own implementation of std::atomic, which is activated when in Clang mode + // (probably because libc++'s on OS X failed to compile), but they're missing some +--- a/src/corelib/tools/qduplicatetracker_p.h ++++ b/src/corelib/tools/qduplicatetracker_p.h +@@ -52,7 +52,7 @@ + + #include + +-#if QT_HAS_INCLUDE() && __cplusplus > 201402L ++#if defined(__cpp_lib_memory_resource) && __cplusplus > 201402L + # include + # include + #else diff --git a/recipes/qt/5.x.x/patches/5.15.7-fix-qmake-default-libdirs-apple-clang-15.patch b/recipes/qt/5.x.x/patches/5.15.7-fix-qmake-default-libdirs-apple-clang-15.patch new file mode 100644 index 00000000000000..1f9f0f90f6e5b9 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.7-fix-qmake-default-libdirs-apple-clang-15.patch @@ -0,0 +1,26 @@ +--- a/mkspecs/features/toolchain.prf ++++ b/mkspecs/features/toolchain.prf +@@ -283,9 +283,12 @@ isEmpty($${target_prefix}.INCDIRS) { + } + } + } +- isEmpty(QMAKE_DEFAULT_LIBDIRS)|isEmpty(QMAKE_DEFAULT_INCDIRS): \ ++ isEmpty(QMAKE_DEFAULT_INCDIRS): \ + !integrity: \ +- error("failed to parse default search paths from compiler output") ++ error("failed to parse default include paths from compiler output") ++ isEmpty(QMAKE_DEFAULT_LIBDIRS): \ ++ !integrity:!darwin: \ ++ error("failed to parse default library paths from compiler output") + QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS) + } else: ghs { + cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp +@@ -407,7 +410,7 @@ isEmpty($${target_prefix}.INCDIRS) { + QMAKE_DEFAULT_INCDIRS = $$split(INCLUDE, $$QMAKE_DIRLIST_SEP) + } + +- unix:if(!cross_compile|host_build) { ++ unix:!darwin:if(!cross_compile|host_build) { + isEmpty(QMAKE_DEFAULT_INCDIRS): QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include + isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib + } diff --git a/recipes/qt/5.x.x/patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch b/recipes/qt/5.x.x/patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch new file mode 100644 index 00000000000000..a058fb5245ef21 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch @@ -0,0 +1,26 @@ +--- a/mkspecs/features/toolchain.prf ++++ b/mkspecs/features/toolchain.prf +@@ -288,9 +288,12 @@ isEmpty($${target_prefix}.INCDIRS) { + } + } + } +- isEmpty(QMAKE_DEFAULT_LIBDIRS)|isEmpty(QMAKE_DEFAULT_INCDIRS): \ ++ isEmpty(QMAKE_DEFAULT_INCDIRS): \ + !integrity: \ +- error("failed to parse default search paths from compiler output") ++ error("failed to parse default include paths from compiler output") ++ isEmpty(QMAKE_DEFAULT_LIBDIRS): \ ++ !integrity:!darwin: \ ++ error("failed to parse default library paths from compiler output") + QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS) + } else: ghs { + cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp +@@ -412,7 +415,7 @@ isEmpty($${target_prefix}.INCDIRS) { + QMAKE_DEFAULT_INCDIRS = $$split(INCLUDE, $$QMAKE_DIRLIST_SEP) + } + +- unix:if(!cross_compile|host_build) { ++ unix:!darwin:if(!cross_compile|host_build) { + isEmpty(QMAKE_DEFAULT_INCDIRS): QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include + isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib + } diff --git a/recipes/qt/5.x.x/qtmodules5.15.11.conf b/recipes/qt/5.x.x/qtmodules5.15.11.conf new file mode 100644 index 00000000000000..452233655f279d --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.11.conf @@ -0,0 +1,326 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 5.15 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 5.15 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 5.15 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 5.15 + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + branch = 5.15 + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 5.15 + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 5.15 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 5.15 + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 5.15 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + branch = 5.15 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + branch = 5.15 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 5.15 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + branch = 5.15 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 5.15 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + branch = 5.15 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 5.15 + status = addon +[submodule "qtgraphicaleffects"] + depends = qtdeclarative + path = qtgraphicaleffects + url = ../qtgraphicaleffects.git + branch = 5.15 + status = essential +[submodule "qtquickcontrols"] + depends = qtdeclarative + recommends = qtgraphicaleffects + path = qtquickcontrols + url = ../qtquickcontrols.git + branch = 5.15 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 5.15 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 5.15 + status = addon +[submodule "qtx11extras"] + depends = qtbase + path = qtx11extras + url = ../qtx11extras.git + branch = 5.15 + status = addon +[submodule "qtmacextras"] + depends = qtbase + path = qtmacextras + url = ../qtmacextras.git + branch = 5.15 + status = addon +[submodule "qtwinextras"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtwinextras + url = ../qtwinextras.git + branch = 5.15 + status = addon +[submodule "qtandroidextras"] + depends = qtbase + path = qtandroidextras + url = ../qtandroidextras.git + branch = 5.15 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 5.15 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 5.15 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + branch = 5.15 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 5.15 + status = addon +[submodule "qtquickcontrols2"] + depends = qtgraphicaleffects + recommends = qtimageformats + path = qtquickcontrols2 + url = ../qtquickcontrols2.git + branch = 5.15 + status = essential +[submodule "qtpurchasing"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtpurchasing + url = ../qtpurchasing.git + branch = 5.15 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 5.15 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 5.15 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 5.15 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 5.15 + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 5.15 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 5.15 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 5.15 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 5.15 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 5.15 + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 5.15 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 5.15 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + branch = 5.15 + status = addon diff --git a/recipes/qt/6.x.x/conandata.yml b/recipes/qt/6.x.x/conandata.yml index fc7a158ca95177..cb7797f109eafa 100644 --- a/recipes/qt/6.x.x/conandata.yml +++ b/recipes/qt/6.x.x/conandata.yml @@ -1,42 +1,51 @@ sources: - "6.5.1": + "6.6.1": url: - - "https://download.qt.io/official_releases/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://download.qt.io/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://ftp1.nluug.nl/languages/qt/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://ftp2.nluug.nl/languages/qt/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://mirror.netcologne.de/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://master.qt.io/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://qt.mirror.constant.com/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" - sha256: "a2d88a6f8c3835dca52f3b7433149c3de606a96bbf024640c27657276cc7350a" - "6.5.0": + - "https://download.qt.io/official_releases/qt/6.6/6.6.1/single/qt-everywhere-src-6.6.1.tar.xz" + - "https://download.qt.io/archive/qt/6.6/6.6.1/single/qt-everywhere-src-6.6.1.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.6/6.6.1/single/qt-everywhere-src-6.6.1.tar.xz" + sha256: "dd3668f65645fe270bc615d748bd4dc048bd17b9dc297025106e6ecc419ab95d" + "6.6.0": url: - - "https://download.qt.io/official_releases/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://download.qt.io/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://ftp1.nluug.nl/languages/qt/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://ftp2.nluug.nl/languages/qt/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://mirror.netcologne.de/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://master.qt.io/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://qt.mirror.constant.com/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" - sha256: "dba376e110e53895c7c827eea389dc12aa9c45862cd197d2f0d37ee472baf0b0" + - "https://download.qt.io/official_releases/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://download.qt.io/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://mirror.web4africa.ng/qt/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.tar.xz" + sha256: "652538fcb5d175d8f8176c84c847b79177c87847b7273dccaec1897d80b50002" + "6.5.3": + url: + - "https://download.qt.io/official_releases/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://download.qt.io/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirror.web4africa.ng/qt/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.cloud.tencent.com/qt/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + sha256: "7cda4d119aad27a3887329cfc285f2aba5da85601212bcb0aea27bd6b7b544cb" "6.4.2": url: - "https://download.qt.io/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" @@ -45,14 +54,6 @@ sources: - "https://ftp.fau.de/qtproject/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" sha256: "689f53e6652da82fccf7c2ab58066787487339f28d1ec66a8765ad357f4976be" - "6.4.1": - url: - - "https://download.qt.io/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" - - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.4/6.4.1/single/qt-everywhere-src-6.4.1.tar.xz" - sha256: "e20b850b6134098a7f2e7701cfddfb213c6cf394b9e848e6fbc5b0e89dcfcc09" "6.3.2": url: - "https://download.qt.io/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" @@ -62,20 +63,18 @@ sources: - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" sha256: "b90524f686224a0e5a945c1d65307e16a375348dbe275c9ac11de171fe31374a" patches: - "6.5.1": - - base_path: "qtwebengine" - patch_description: "Workaround for too long .rps file name" - patch_file: "patches/c72097e.diff" - - base_path: "qtbase/cmake" - patch_description: "Fix pri helpers, see PR #6668 and QTBUG-95569" - patch_file: "patches/qt6.5.0-pri-helpers-fix.diff" - "6.5.0": - - base_path: "qtwebengine" - patch_description: "Workaround for too long .rps file name" - patch_file: "patches/c72097e.diff" - - base_path: "qtbase/cmake" - patch_description: "Fix pri helpers, see PR #6668 and QTBUG-95569" - patch_file: "patches/qt6.5.0-pri-helpers-fix.diff" + "6.6.1": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "6.6.0": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "6.5.3": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e.diff" "6.4.2": - base_path: "qtbase/cmake" patch_description: "Fix pri helpers" @@ -88,23 +87,6 @@ patches: patch_description: "Fix PCRE2 detection" patch_type: "bugfix" patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/445885" - "6.4.1": - - base_path: "qtbase/cmake" - patch_description: "Fix pri helpers" - patch_file: "patches/qt6-pri-helpers-fix.diff" - - patch_file: "patches/c72097e.diff" - base_path: "qtwebengine" - patch_description: "Workaround for too long .rps file name" - - patch_file: "patches/d13958d.diff" - base_path: "qtbase" - patch_description: "Fix PCRE2 detection" - patch_type: "bugfix" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/445885" - - patch_file: "patches/3801bba82.patch" - base_path: "qtwebengine/src/3rdparty" - patch_description: "fix qtwebengine with MSVC2022" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/444132" "6.3.2": - base_path: "qtbase/cmake" patch_description: "Fix pri helpers" diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index eefa33f1dae931..6113ac9cd6f542 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -26,6 +26,7 @@ class QtConan(ConanFile): "qtserialport", "qtwebsockets", "qtwebchannel", "qtwebengine", "qtwebview", "qtremoteobjects", "qtpositioning", "qtlanguageserver", "qtspeech", "qthttpserver", "qtquick3dphysics", "qtgrpc", "qtquickeffectmaker"] + _submodules += ["qtgraphs"] # new modules for qt 6.6.0 name = "qt" description = "Qt is a cross-platform framework for graphical user interfaces." @@ -116,7 +117,6 @@ class QtConan(ConanFile): "multiconfiguration": False, "disabled_features": "", } - default_options.update({module: False for module in _submodules}) short_paths = True @@ -139,15 +139,16 @@ def _get_module_tree(self): assert section.startswith("submodule ") assert section.count('"') == 2 modulename = section[section.find('"') + 1: section.rfind('"')] + if modulename in ["qtbase", "qtqa", "qtrepotools"]: + continue status = str(config.get(section, "status")) if status not in ["obsolete", "ignore", "additionalLibrary"]: + assert modulename in self._submodules, f"module {modulename} not in self._submodules" self._submodules_tree[modulename] = {"status": status, "path": str(config.get(section, "path")), "depends": []} if config.has_option(section, "depends"): self._submodules_tree[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] - for m in self._submodules_tree: - assert m in ["qtbase", "qtqa", "qtrepotools"] or m in self._submodules, f"module {m} not in self._submodules" return self._submodules_tree @@ -180,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" @@ -213,13 +215,22 @@ def configure(self): def _enablemodule(mod): if mod != "qtbase": setattr(self.options, mod, True) - for req in self._get_module_tree[mod]["depends"]: - _enablemodule(req) + for req in self._get_module_tree[mod]["depends"]: + _enablemodule(req) + # enable all modules which are + # - required by a module explicitely enabled by the consumer for module in self._get_module_tree: - if self.options.get_safe(module): + if getattr(self.options, module): _enablemodule(module) + # disable all modules which are: + # - not explicitely enabled by the consumer and + # - not required by a module explicitely enabled by the consumer + for module in self._get_module_tree: + if getattr(self.options, module).value is None: + setattr(self.options, module, False) + def validate(self): if os.getenv('NOT_ON_C3I', '0') == '0': if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) >= "11" or \ @@ -242,9 +253,15 @@ def validate(self): if Version(self.version) >= "6.4.0" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "12": raise ConanInvalidConfiguration("apple-clang >= 12 required by qt >= 6.4.0") + if Version(self.version) >= "6.6.1" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "13.1": + raise ConanInvalidConfiguration("apple-clang >= 13.1 is required by qt >= 6.6.1 cf QTBUG-119490") + if self.settings.compiler == "clang" and "libstdc++" in str(self.settings.compiler.libcxx): raise ConanInvalidConfiguration("Qt needs recent libstdc++, with charconv. please switch to gcc, or to libc++") + if self.settings.os == "Macos" and self.dependencies["double-conversion"].options.shared: + raise ConanInvalidConfiguration("Test recipe fails because of Macos' SIP. Contributions are welcome.") + if self.options.get_safe("qtwebengine"): if not self.options.shared: raise ConanInvalidConfiguration("Static builds of Qt WebEngine are not supported") @@ -291,11 +308,14 @@ def validate(self): if self.options.with_sqlite3 and not self.dependencies["sqlite3"].options.enable_column_metadata: raise ConanInvalidConfiguration("sqlite3 option enable_column_metadata must be enabled for qt") + if self.options.get_safe("qtspeech") and not self.options.qtdeclarative: + raise ConanInvalidConfiguration("qtspeech requires qtdeclarative, cf QTBUG-108381") + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_pcre2: @@ -305,55 +325,55 @@ def requirements(self): if is_apple_os(self): self.requires("moltenvk/1.2.2") if self.options.with_glib: - self.requires("glib/2.77.0") + self.requires("glib/2.78.1") if self.options.with_doubleconversion and not self.options.multiconfiguration: self.requires("double-conversion/3.3.0") if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.14.2") if self.options.get_safe("with_icu", False): - self.requires("icu/73.2") + self.requires("icu/74.1") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: - self.requires("harfbuzz/8.0.1") + self.requires("harfbuzz/8.3.0") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: if self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.1") else: self.requires("libjpeg/9e") if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: self.requires("libpng/1.6.40") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/3.44.2") if self.options.get_safe("with_mysql", False): - self.requires("libmysqlclient/8.0.31") + self.requires("libmysqlclient/8.1.0") if self.options.with_pq: - self.requires("libpq/15.3") + self.requires("libpq/15.4") if self.options.with_odbc: if self.settings.os != "Windows": self.requires("odbc/2.3.11") if self.options.get_safe("with_openal", False): - self.requires("openal/1.22.2") + self.requires("openal-soft/1.22.2") if self.options.get_safe("with_libalsa", False): - self.requires("libalsa/1.2.7.2") - if self.options.get_safe("with_x11", False): + self.requires("libalsa/1.2.10") + if self.options.get_safe("with_x11") or self.options.qtwayland: self.requires("xkbcommon/1.5.0") + if self.options.get_safe("with_x11", False): self.requires("xorg/system") if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": self.requires("opengl/system") if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.qtwayland: - self.requires("xkbcommon/1.5.0") self.requires("wayland/1.22.0") if self.options.with_brotli: - self.requires("brotli/1.0.9") + self.requires("brotli/1.1.0") if self.options.get_safe("qtwebengine") and self.settings.os == "Linux": self.requires("expat/2.5.0") - self.requires("opus/1.3.1") + self.requires("opus/1.4") self.requires("xorg-proto/2022.2") self.requires("libxshmfence/1.3") - self.requires("nss/3.89") + self.requires("nss/3.93") self.requires("libdrm/2.4.114") if self.options.get_safe("with_gstreamer", False): self.requires("gst-plugins-base/1.19.2") @@ -370,7 +390,7 @@ def build_requirements(self): self.tool_requires("cmake/[>=3.21.1 <4]") self.tool_requires("ninja/1.11.1") 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") if self.settings.os == "Windows": self.tool_requires('strawberryperl/5.32.1.1') @@ -378,11 +398,11 @@ def build_requirements(self): self.tool_requires("nodejs/18.15.0") self.tool_requires("gperf/3.1") # gperf, bison, flex, python >= 2.7.5 & < 3 - if self.settings.os != "Windows": + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.25") + else: self.tool_requires("bison/3.8.2") self.tool_requires("flex/2.6.4") - else: - self.tool_requires("winflexbison/2.5.24") if self.options.qtwayland: self.tool_requires("wayland/1.22.0") @@ -418,6 +438,7 @@ def generate(self): vre.generate(scope="build") # TODO: to remove when properly handled by conan (see https://github.com/conan-io/conan/issues/11962) env = Environment() + env.unset("VCPKG_ROOT") env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) env.vars(self).save_script("conanbuildenv_pkg_config_path") if self._settings_build.os == "Macos": @@ -453,8 +474,9 @@ def generate(self): tc.variables["FEATURE_optimize_size"] = ("ON" if self.settings.build_type == "MinSizeRel" else "OFF") for module in self._get_module_tree: - if module != 'qtbase': - tc.variables[f"BUILD_{module}"] = ("ON" if self.options.get_safe(module) else "OFF") + tc.variables[f"BUILD_{module}"] = ("ON" if getattr(self.options, module) else "OFF") + tc.variables["BUILD_qtqa"] = "OFF" + tc.variables["BUILD_qtrepotools"] = "OFF" tc.variables["FEATURE_system_zlib"] = "ON" @@ -556,6 +578,8 @@ def generate(self): self.output.warning(f"host not supported: {self.settings.os} {self.settings.compiler} {self.settings.compiler.version} {self.settings.arch}") if self.options.cross_compile: tc.variables["QT_QMAKE_DEVICE_OPTIONS"] = f"CROSS_COMPILE={self.options.cross_compile}" + if cross_building(self): + tc.variables["QT_HOST_PATH"] = self.dependencies.direct_build["qt"].package_folder tc.variables["FEATURE_pkg_config"] = "ON" if self.settings.compiler == "gcc" and self.settings.build_type == "Debug" and not self.options.shared: @@ -570,12 +594,19 @@ def generate(self): current_cpp_std = self.settings.get_safe("compiler.cppstd", default_cppstd(self)) current_cpp_std = str(current_cpp_std).replace("gnu", "") cpp_std_map = { - "20": "FEATURE_cxx20" + 11: "FEATURE_cxx11", + 14: "FEATURE_cxx14", + 17: "FEATURE_cxx17", + 20: "FEATURE_cxx20" } if Version(self.version) >= "6.5.0": - cpp_std_map["23"] = "FEATURE_cxx2b" + cpp_std_map[23] = "FEATURE_cxx2b" + + for std,feature in cpp_std_map.items(): + tc.variables[feature] = "ON" if int(current_cpp_std) >= std else "OFF" - tc.variables[cpp_std_map.get(current_cpp_std, "FEATURE_cxx17")] = "ON" + tc.variables["QT_USE_VCPKG"] = False + tc.cache_variables["QT_USE_VCPKG"] = False tc.generate() @@ -627,6 +658,8 @@ def source(self): # use official variable name https://cmake.org/cmake/help/latest/module/FindFontconfig.html replace_in_file(self, os.path.join(self.source_folder, "qtbase", "src", "gui", "configure.cmake"), "FONTCONFIG_FOUND", "Fontconfig_FOUND") + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "QtAutoDetect.cmake") , "qt_auto_detect_vcpkg()", "# qt_auto_detect_vcpkg()") + def _xplatform(self): if self.settings.os == "Linux": if self.settings.compiler == "gcc": @@ -750,9 +783,10 @@ def package(self): save(self, ".qmake.super" , "") cmake = CMake(self) cmake.install() - copy(self, "*LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses"), + excludes="qtbase/examples/*") for module in self._get_module_tree: - if module != "qtbase" and not self.options.get_safe(module): + if not getattr(self.options, module): rmdir(self, os.path.join(self.package_folder, "licenses", module)) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) for mask in ["Find*.cmake", "*Config.cmake", "*-config.cmake"]: @@ -783,10 +817,12 @@ def package(self): targets.append("qvkgen") if self.options.widgets: targets.append("uic") + if self._settings_build.os == "Macos" and self.settings.os != "iOS": + targets.extend(["macdeployqt"]) + if self.settings.os == "Windows": + targets.extend(["windeployqt"]) if self.options.qttools: targets.extend(["qhelpgenerator", "qtattributionsscanner"]) - if self.settings.os == "Windows": - targets.extend(["windeployqt"]) targets.extend(["lconvert", "lprodump", "lrelease", "lrelease-pro", "lupdate", "lupdate-pro"]) if self.options.qtshadertools: targets.append("qsb") @@ -851,6 +887,9 @@ def _create_private_module(module, dependencies): if self.options.qtdeclarative: _create_private_module("Qml", ["CorePrivate", "Qml"]) + save(self, os.path.join(self.package_folder, "lib", "cmake", "Qt6Qml", "conan_qt_qt6_policies.cmake"), textwrap.dedent("""\ + set(QT_KNOWN_POLICY_QTP0001 TRUE) + """)) if self.settings.os in ["Windows", "iOS"]: contents = textwrap.dedent("""\ @@ -1007,7 +1046,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"]) @@ -1091,6 +1130,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.widgets: _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) + _create_module("QuickTest", ["Test", "Quick"]) _create_module("QmlWorkerScript", ["Qml"]) if self.options.qttools and self.options.gui and self.options.widgets: @@ -1119,6 +1159,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"]) @@ -1192,31 +1234,15 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.get_safe("with_libalsa", False): multimedia_reqs.append("libalsa::libalsa") if self.options.with_openal: - multimedia_reqs.append("openal::openal") + multimedia_reqs.append("openal-soft::openal-soft") if self.options.get_safe("with_pulseaudio", False): multimedia_reqs.append("pulseaudio::pulse") _create_module("Multimedia", multimedia_reqs) _create_module("MultimediaWidgets", ["Multimedia", "Widgets", "Gui"]) if self.options.qtdeclarative and qt_quick_enabled: _create_module("MultimediaQuick", ["Multimedia", "Quick"]) - _create_plugin("QM3uPlaylistPlugin", "qtmultimedia_m3u", "playlistformats", []) if self.options.with_gstreamer: - _create_module("MultimediaGstTools", ["Multimedia", "MultimediaWidgets", "Gui", "gst-plugins-base::gst-plugins-base"]) - _create_plugin("QGstreamerAudioDecoderServicePlugin", "gstaudiodecoder", "mediaservice", []) - _create_plugin("QGstreamerCaptureServicePlugin", "gstmediacapture", "mediaservice", []) - _create_plugin("QGstreamerPlayerServicePlugin", "gstmediaplayer", "mediaservice", []) - if self.settings.os == "Linux": - _create_plugin("CameraBinServicePlugin", "gstcamerabin", "mediaservice", []) - _create_plugin("QAlsaPlugin", "qtaudio_alsa", "audio", []) - if self.settings.os == "Windows": - _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) - _create_plugin("DSServicePlugin", "dsengine", "mediaservice", []) - _create_plugin("QWindowsAudioPlugin", "qtaudio_windows", "audio", []) - if self.settings.os == "Macos": - _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) - _create_plugin("AVFMediaPlayerServicePlugin", "qavfmediaplayer", "mediaservice", []) - _create_plugin("AVFServicePlugin", "qavfcamera", "mediaservice", []) - _create_plugin("CoreAudioPlugin", "qtaudio_coreaudio", "audio", []) + _create_plugin("QGstreamerMediaPlugin", "gstreamermediaplugin", "multimedia", ["gst-plugins-base::gst-plugins-base"]) if self.options.get_safe("qtpositioning"): _create_module("Positioning", []) @@ -1270,6 +1296,19 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.get_safe("qtwebview"): _create_module("WebView", ["Core", "Gui"]) + if self.options.get_safe("qtspeech"): + _create_module("TextToSpeech", []) + + if self.options.get_safe("qthttpserver"): + http_server_deps = ["Core", "Network"] + if self.options.get_safe("qtwebsockets"): + http_server_deps.append("WebSockets") + _create_module("HttpServer", http_server_deps) + + if self.options.get_safe("qtgrpc"): + _create_module("Protobuf", []) + _create_module("Grpc", ["Core", "Protobuf", "Network"]) + if self.settings.os in ["Windows", "iOS"]: if self.settings.os == "Windows": self.cpp_info.components["qtEntryPointImplementation"].set_property("cmake_target_name", "Qt6::EntryPointImplementation") @@ -1316,6 +1355,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components["qtCore"].frameworks.append("IOKit") # qtcore requires "_IORegistryEntryCreateCFProperty", "_IOServiceGetMatchingService" and much more which are in "IOKit" framework self.cpp_info.components["qtCore"].frameworks.append("Cocoa") # qtcore requires "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework self.cpp_info.components["qtCore"].frameworks.append("Security") # qtcore requires "_SecRequirementCreateWithString" and more, which are in "Security" framework + self.cpp_info.components["qtNetwork"].system_libs.append("resolv") self.cpp_info.components["qtNetwork"].frameworks.append("SystemConfiguration") if self.options.with_gssapi: self.cpp_info.components["qtNetwork"].frameworks.append("GSS") @@ -1329,10 +1369,15 @@ def _create_plugin(pluginname, libname, plugintype, requires): _add_build_module("qtCore", self._cmake_entry_point_file) for m in os.listdir(os.path.join("lib", "cmake")): - module = os.path.join("lib", "cmake", m, f"{m}Macros.cmake") component_name = m.replace("Qt6", "qt") if component_name == "qt": component_name = "qtCore" + + module = os.path.join("lib", "cmake", m, f"{m}Macros.cmake") + if os.path.isfile(module): + _add_build_module(component_name, module) + + module = os.path.join("lib", "cmake", m, f"{m}ConfigExtras.cmake") if os.path.isfile(module): _add_build_module(component_name, module) @@ -1355,6 +1400,9 @@ def _create_plugin(pluginname, libname, plugintype, requires): build_modules_list = [] + if self.options.qtdeclarative: + build_modules_list.append(os.path.join(self.package_folder, "lib", "cmake", "Qt6Qml", "conan_qt_qt6_policies.cmake")) + def _add_build_modules_for_component(component): for req in self.cpp_info.components[component].requires: if "::" in req: # not a qt component diff --git a/recipes/qt/6.x.x/patches/3801bba82.patch b/recipes/qt/6.x.x/patches/3801bba82.patch deleted file mode 100644 index 79b347ce90a23b..00000000000000 --- a/recipes/qt/6.x.x/patches/3801bba82.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 3801bba822bf88c202a348d3e01dd493c0ca0551 Mon Sep 17 00:00:00 2001 -From: Nadim Asaduzzaman -Date: Fri, 18 Nov 2022 04:34:38 -0700 -Subject: [PATCH] skia: fix compilation with MSVC2022 - -compilation with MSVC2022 failed due to missing string definition within std namespace - -Fixes: QTBUG-108532 -Change-Id: I2119952d5809895e2511ce1c2c262022af3ba191 -Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/444132 -Reviewed-by: Allan Sandfeld Jensen ---- - chromium/third_party/skia/src/core/SkShaderCodeDictionary.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/chromium/third_party/skia/src/core/SkShaderCodeDictionary.h b/chromium/third_party/skia/src/core/SkShaderCodeDictionary.h -index 3a54bbe22e7..8612a469862 100644 ---- a/chromium/third_party/skia/src/core/SkShaderCodeDictionary.h -+++ b/chromium/third_party/skia/src/core/SkShaderCodeDictionary.h -@@ -9,6 +9,7 @@ - #define SkShaderCodeDictionary_DEFINED - - #include -+#include - #include - #include - #include "include/core/SkSpan.h" diff --git a/recipes/qt/6.x.x/patches/c72097e_6.6.0.diff b/recipes/qt/6.x.x/patches/c72097e_6.6.0.diff new file mode 100644 index 00000000000000..968f4abf220b6e --- /dev/null +++ b/recipes/qt/6.x.x/patches/c72097e_6.6.0.diff @@ -0,0 +1,42 @@ +From c72097e8790553771daf3231124c3fbe1a438379 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Thu, 30 Mar 2017 11:37:24 +0300 +Subject: [PATCH] chromium: workaround for too long .rps file name + +Ninja may fail when the build directory is too long: + +ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\ +interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\ +6x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\ +.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\ +le.rsp): Unable to create file. File name too long + +Task-number: QTBUG-59769 +Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1 +--- + src/3rdparty/gn/src/gn/ninja_action_target_writer.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc b/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc +index a5bc6cd..5cefbfe 100644 +--- a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc ++++ b/src/3rdparty/gn/tosrcols/gn/ninja_action_target_writer.cc +@@ -125,9 +125,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { + // strictly necessary for regular one-shot actions, but it's easier to + // just always define unique_name. + std::string rspfile = custom_rule_name; ++ ++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end ++ //please note ".$unique_name" is not used at the moment ++ int pos = 0; ++ std::string delimiter("_"); ++ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos) ++ rspfile = rspfile.substr(0,pos); ++ + if (!target_->sources().empty()) + rspfile += ".$unique_name"; + rspfile += ".rsp"; ++ + out_ << " rspfile = " << rspfile << std::endl; + + // Response file contents. diff --git a/recipes/qt/6.x.x/patches/qt6.5.0-pri-helpers-fix.diff b/recipes/qt/6.x.x/patches/qt6.5.0-pri-helpers-fix.diff deleted file mode 100644 index 47eb2e5ecb95fb..00000000000000 --- a/recipes/qt/6.x.x/patches/qt6.5.0-pri-helpers-fix.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- QtPriHelpers.cmake 2023-05-12 12:40:15.000000000 +0800 -+++ QtPriHelpers.cmake 2023-07-06 11:39:58.305927536 +0800 -@@ -33,7 +33,11 @@ - if(lib_target_type STREQUAL "INTERFACE_LIBRARY") - get_target_property(iface_libs ${lib_target} INTERFACE_LINK_LIBRARIES) - if(iface_libs) -- list(PREPEND lib_targets ${iface_libs}) -+ foreach (iface_lib ${iface_libs}) -+ if (NOT "${iface_lib}" STREQUAL "${lib_target}") -+ list(PREPEND lib_targets ${iface_lib}) -+ endif () -+ endforeach () - endif() - else() - list(APPEND lib_libs "$") diff --git a/recipes/qt/6.x.x/qtmodules6.2.4.conf b/recipes/qt/6.x.x/qtmodules6.2.4.conf deleted file mode 100644 index 92bee3c5b05513..00000000000000 --- a/recipes/qt/6.x.x/qtmodules6.2.4.conf +++ /dev/null @@ -1,299 +0,0 @@ -[submodule "qtbase"] - path = qtbase - url = ../qtbase.git - branch = 6.2.4 - status = essential -[submodule "qtsvg"] - depends = qtbase - path = qtsvg - url = ../qtsvg.git - branch = 6.2.4 - status = addon -[submodule "qtdeclarative"] - depends = qtbase - recommends = qtimageformats qtshadertools qtsvg - path = qtdeclarative - url = ../qtdeclarative.git - branch = 6.2.4 - status = essential -[submodule "qtactiveqt"] - depends = qtbase - path = qtactiveqt - url = ../qtactiveqt.git - branch = 6.2.4 - status = addon -[submodule "qtmultimedia"] - depends = qtbase qtshadertools - recommends = qtdeclarative - path = qtmultimedia - url = ../qtmultimedia.git - branch = 6.2.4 - status = addon -[submodule "qttools"] - depends = qtbase - recommends = qtdeclarative qtactiveqt - path = qttools - url = ../qttools.git - branch = 6.2.4 - status = essential -[submodule "qtxmlpatterns"] - depends = qtbase - recommends = qtdeclarative - path = qtxmlpatterns - url = ../qtxmlpatterns.git - branch = 6.2.4 - status = ignore -[submodule "qttranslations"] - depends = qttools - path = qttranslations - url = ../qttranslations.git - branch = 6.2.4 - status = essential - priority = 30 -[submodule "qtdoc"] - depends = qtdeclarative qttools - recommends = qtmultimedia - path = qtdoc - url = ../qtdoc.git - branch = 6.2.4 - status = essential - priority = 40 -[submodule "qtrepotools"] - path = qtrepotools - url = ../qtrepotools.git - branch = master - status = essential - project = - -[submodule "qtqa"] - depends = qtbase - path = qtqa - url = ../qtqa.git - branch = dev - status = essential - priority = 50 -[submodule "qtlocation"] - depends = qtbase qtpositioning - recommends = qtdeclarative - path = qtlocation - url = ../qtlocation.git - branch = 6.2.4 - status = ignore -[submodule "qtpositioning"] - depends = qtbase - recommends = qtdeclarative qtserialport - path = qtpositioning - url = ../qtpositioning.git - branch = 6.2.4 - status = addon -[submodule "qtsensors"] - depends = qtbase - recommends = qtdeclarative - path = qtsensors - url = ../qtsensors.git - branch = 6.2.4 - status = addon -[submodule "qtsystems"] - depends = qtbase - recommends = qtdeclarative - path = qtsystems - url = ../qtsystems.git - branch = dev - status = ignore -[submodule "qtfeedback"] - depends = qtdeclarative - recommends = qtmultimedia - path = qtfeedback - url = ../qtfeedback.git - branch = master - status = ignore -[submodule "qtpim"] - depends = qtdeclarative - path = qtpim - url = ../qtpim.git - branch = dev - status = ignore -[submodule "qtconnectivity"] - depends = qtbase - recommends = qtdeclarative - path = qtconnectivity - url = ../qtconnectivity.git - branch = 6.2.4 - status = addon -[submodule "qtwayland"] - depends = qtbase - recommends = qtdeclarative - path = qtwayland - url = ../qtwayland.git - branch = 6.2.4 - status = addon -[submodule "qt3d"] - depends = qtbase - recommends = qtdeclarative qtshadertools - path = qt3d - url = ../qt3d.git - branch = 6.2.4 - status = addon -[submodule "qtimageformats"] - depends = qtbase - path = qtimageformats - url = ../qtimageformats.git - branch = 6.2.4 - status = addon -[submodule "qtserialbus"] - depends = qtbase - recommends = qtserialport - path = qtserialbus - url = ../qtserialbus.git - branch = 6.2.4 - status = addon -[submodule "qtserialport"] - depends = qtbase - path = qtserialport - url = ../qtserialport.git - branch = 6.2.4 - status = addon -[submodule "qtwebsockets"] - depends = qtbase - recommends = qtdeclarative - path = qtwebsockets - url = ../qtwebsockets.git - branch = 6.2.4 - status = addon -[submodule "qtwebchannel"] - depends = qtbase - recommends = qtdeclarative qtwebsockets - path = qtwebchannel - url = ../qtwebchannel.git - branch = 6.2.4 - status = addon -[submodule "qtwebengine"] - depends = qtdeclarative - recommends = qtwebchannel qttools qtpositioning - path = qtwebengine - url = ../qtwebengine.git - branch = 6.2.4 - status = addon - priority = 10 -[submodule "qtcanvas3d"] - depends = qtdeclarative - path = qtcanvas3d - url = ../qtcanvas3d.git - branch = 6.2.4 - status = ignore -[submodule "qtwebview"] - depends = qtdeclarative - recommends = qtwebengine - path = qtwebview - url = ../qtwebview.git - branch = 6.2.4 - status = addon -[submodule "qtcharts"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtcharts - url = ../qtcharts.git - branch = 6.2.4 - status = addon -[submodule "qtdatavis3d"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtdatavis3d - url = ../qtdatavis3d.git - branch = 6.2.4 - status = addon -[submodule "qtvirtualkeyboard"] - depends = qtbase qtdeclarative qtsvg - recommends = qtmultimedia - path = qtvirtualkeyboard - url = ../qtvirtualkeyboard.git - branch = 6.2.4 - status = addon -[submodule "qtgamepad"] - depends = qtbase - recommends = qtdeclarative - path = qtgamepad - url = ../qtgamepad.git - branch = 6.2.4 - status = ignore -[submodule "qtscxml"] - depends = qtbase qtdeclarative - path = qtscxml - url = ../qtscxml.git - branch = 6.2.4 - status = addon -[submodule "qtspeech"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtspeech - url = ../qtspeech.git - branch = 6.2.4 - status = ignore -[submodule "qtnetworkauth"] - depends = qtbase - path = qtnetworkauth - url = ../qtnetworkauth.git - branch = 6.2.4 - status = addon -[submodule "qtremoteobjects"] - depends = qtbase - recommends = qtdeclarative - path = qtremoteobjects - url = ../qtremoteobjects.git - branch = 6.2.4 - status = addon -[submodule "qtwebglplugin"] - depends = qtbase qtwebsockets - recommends = qtdeclarative - path = qtwebglplugin - url = ../qtwebglplugin.git - branch = 6.2.4 - status = ignore -[submodule "qtlottie"] - depends = qtbase qtdeclarative - path = qtlottie - url = ../qtlottie.git - branch = 6.2.4 - status = addon -[submodule "qtquicktimeline"] - depends = qtbase qtdeclarative - path = qtquicktimeline - url = ../qtquicktimeline - branch = 6.2.4 - status = addon -[submodule "qtquick3d"] - depends = qtbase qtdeclarative qtshadertools - recommends = qtquicktimeline - path = qtquick3d - url = ../qtquick3d.git - branch = 6.2.4 - status = addon -[submodule "qtshadertools"] - depends = qtbase - path = qtshadertools - url = ../qtshadertools.git - branch = 6.2.4 - status = addon -[submodule "qt5compat"] - depends = qtbase qtdeclarative - path = qt5compat - url = ../qt5compat.git - branch = 6.2.4 - status = deprecated -[submodule "qtcoap"] - depends = qtbase - path = qtcoap - url = ../qtcoap.git - branch = 6.2.4 - status = addon -[submodule "qtmqtt"] - depends = qtbase qtdeclarative - path = qtmqtt - url = ../qtmqtt.git - branch = 6.2.4 - status = addon -[submodule "qtopcua"] - depends = qtbase qtdeclarative - path = qtopcua - url = ../qtopcua.git - branch = 6.2.4 - status = addon \ No newline at end of file diff --git a/recipes/qt/6.x.x/qtmodules6.4.1.conf b/recipes/qt/6.x.x/qtmodules6.4.1.conf deleted file mode 100644 index 0ab0c4ef102771..00000000000000 --- a/recipes/qt/6.x.x/qtmodules6.4.1.conf +++ /dev/null @@ -1,318 +0,0 @@ -[submodule "qtbase"] - path = qtbase - url = ../qtbase.git - branch = 6.4.1 - status = essential -[submodule "qtsvg"] - depends = qtbase - path = qtsvg - url = ../qtsvg.git - branch = 6.4.1 - status = addon -[submodule "qtdeclarative"] - depends = qtbase - recommends = qtimageformats qtshadertools qtsvg qtlanguageserver - path = qtdeclarative - url = ../qtdeclarative.git - branch = 6.4.1 - status = essential -[submodule "qtactiveqt"] - depends = qtbase - path = qtactiveqt - url = ../qtactiveqt.git - branch = 6.4.1 - status = addon -[submodule "qtmultimedia"] - depends = qtbase qtshadertools - recommends = qtdeclarative qtquick3d - path = qtmultimedia - url = ../qtmultimedia.git - branch = 6.4.1 - status = addon -[submodule "qttools"] - depends = qtbase - recommends = qtdeclarative qtactiveqt - path = qttools - url = ../qttools.git - branch = 6.4.1 - status = essential -[submodule "qtxmlpatterns"] - depends = qtbase - recommends = qtdeclarative - path = qtxmlpatterns - url = ../qtxmlpatterns.git - branch = dev - status = ignore -[submodule "qttranslations"] - depends = qttools - path = qttranslations - url = ../qttranslations.git - branch = 6.4.1 - status = essential - priority = 30 -[submodule "qtdoc"] - depends = qtdeclarative qttools - recommends = qtmultimedia - path = qtdoc - url = ../qtdoc.git - branch = 6.4.1 - status = essential - priority = 40 -[submodule "qtrepotools"] - path = qtrepotools - url = ../qtrepotools.git - branch = master - status = essential - project = - -[submodule "qtqa"] - depends = qtbase - path = qtqa - url = ../qtqa.git - branch = dev - status = essential - priority = 50 -[submodule "qtlocation"] - depends = qtbase qtpositioning - recommends = qtdeclarative - path = qtlocation - url = ../qtlocation.git - branch = dev - status = ignore -[submodule "qtpositioning"] - depends = qtbase - recommends = qtdeclarative qtserialport - path = qtpositioning - url = ../qtpositioning.git - branch = 6.4.1 - status = addon -[submodule "qtsensors"] - depends = qtbase - recommends = qtdeclarative - path = qtsensors - url = ../qtsensors.git - branch = 6.4.1 - status = addon -[submodule "qtsystems"] - depends = qtbase - recommends = qtdeclarative - path = qtsystems - url = ../qtsystems.git - branch = dev - status = ignore -[submodule "qtfeedback"] - depends = qtdeclarative - recommends = qtmultimedia - path = qtfeedback - url = ../qtfeedback.git - branch = master - status = ignore -[submodule "qtpim"] - depends = qtdeclarative - path = qtpim - url = ../qtpim.git - branch = dev - status = ignore -[submodule "qtconnectivity"] - depends = qtbase - recommends = qtdeclarative - path = qtconnectivity - url = ../qtconnectivity.git - branch = 6.4.1 - status = addon -[submodule "qtwayland"] - depends = qtbase - recommends = qtdeclarative - path = qtwayland - url = ../qtwayland.git - branch = 6.4.1 - status = addon -[submodule "qt3d"] - depends = qtbase - recommends = qtdeclarative qtshadertools - path = qt3d - url = ../qt3d.git - branch = 6.4.1 - status = addon -[submodule "qtimageformats"] - depends = qtbase - path = qtimageformats - url = ../qtimageformats.git - branch = 6.4.1 - status = addon -[submodule "qtserialbus"] - depends = qtbase - recommends = qtserialport - path = qtserialbus - url = ../qtserialbus.git - branch = 6.4.1 - status = addon -[submodule "qtserialport"] - depends = qtbase - path = qtserialport - url = ../qtserialport.git - branch = 6.4.1 - status = addon -[submodule "qtwebsockets"] - depends = qtbase - recommends = qtdeclarative - path = qtwebsockets - url = ../qtwebsockets.git - branch = 6.4.1 - status = addon -[submodule "qtwebchannel"] - depends = qtbase - recommends = qtdeclarative qtwebsockets - path = qtwebchannel - url = ../qtwebchannel.git - branch = 6.4.1 - status = addon -[submodule "qtwebengine"] - depends = qtdeclarative - recommends = qtwebchannel qttools qtpositioning - path = qtwebengine - url = ../qtwebengine.git - branch = 6.4.1 - status = addon - priority = 10 -[submodule "qtcanvas3d"] - depends = qtdeclarative - path = qtcanvas3d - url = ../qtcanvas3d.git - branch = dev - status = ignore -[submodule "qtwebview"] - depends = qtdeclarative - recommends = qtwebengine - path = qtwebview - url = ../qtwebview.git - branch = 6.4.1 - status = addon -[submodule "qtcharts"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtcharts - url = ../qtcharts.git - branch = 6.4.1 - status = addon -[submodule "qtdatavis3d"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtdatavis3d - url = ../qtdatavis3d.git - branch = 6.4.1 - status = addon -[submodule "qtvirtualkeyboard"] - depends = qtbase qtdeclarative qtsvg - recommends = qtmultimedia - path = qtvirtualkeyboard - url = ../qtvirtualkeyboard.git - branch = 6.4.1 - status = addon -[submodule "qtgamepad"] - depends = qtbase - recommends = qtdeclarative - path = qtgamepad - url = ../qtgamepad.git - branch = dev - status = ignore -[submodule "qtscxml"] - depends = qtbase qtdeclarative - path = qtscxml - url = ../qtscxml.git - branch = 6.4.1 - status = addon -[submodule "qtspeech"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtspeech - url = ../qtspeech.git - branch = 6.4.1 - status = addon -[submodule "qtnetworkauth"] - depends = qtbase - path = qtnetworkauth - url = ../qtnetworkauth.git - branch = 6.4.1 - status = addon -[submodule "qtremoteobjects"] - depends = qtbase - recommends = qtdeclarative - path = qtremoteobjects - url = ../qtremoteobjects.git - branch = 6.4.1 - status = addon -[submodule "qtwebglplugin"] - depends = qtbase qtwebsockets - recommends = qtdeclarative - path = qtwebglplugin - url = ../qtwebglplugin.git - branch = dev - status = ignore -[submodule "qtlottie"] - depends = qtbase qtdeclarative - path = qtlottie - url = ../qtlottie.git - branch = 6.4.1 - status = addon -[submodule "qtquicktimeline"] - depends = qtbase qtdeclarative - path = qtquicktimeline - url = ../qtquicktimeline - branch = 6.4.1 - status = addon -[submodule "qtquick3d"] - depends = qtbase qtdeclarative qtshadertools - recommends = qtquicktimeline - path = qtquick3d - url = ../qtquick3d.git - branch = 6.4.1 - status = addon -[submodule "qtshadertools"] - depends = qtbase - path = qtshadertools - url = ../qtshadertools.git - branch = 6.4.1 - status = addon -[submodule "qt5compat"] - depends = qtbase qtdeclarative - path = qt5compat - url = ../qt5compat.git - branch = 6.4.1 - status = deprecated -[submodule "qtcoap"] - depends = qtbase - path = qtcoap - url = ../qtcoap.git - branch = 6.4.1 - status = addon -[submodule "qtmqtt"] - depends = qtbase qtdeclarative - path = qtmqtt - url = ../qtmqtt.git - branch = 6.4.1 - status = addon -[submodule "qtopcua"] - depends = qtbase qtdeclarative - path = qtopcua - url = ../qtopcua.git - branch = 6.4.1 - status = addon -[submodule "qtlanguageserver"] - depends = qtbase - path = qtlanguageserver - url = ../qtlanguageserver.git - branch = 6.4.1 - status = preview -[submodule "qthttpserver"] - depends = qtbase - recommends = qtwebsockets - path = qthttpserver - url = ../qthttpserver.git - branch = 6.4.1 - status = preview -[submodule "qtquick3dphysics"] - depends = qtbase qtdeclarative qtquick3d qtshadertools - path = qtquick3dphysics - url = ../qtquick3dphysics.git - branch = 6.4.1 - status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.5.0.conf b/recipes/qt/6.x.x/qtmodules6.5.0.conf deleted file mode 100644 index 809df6bd315829..00000000000000 --- a/recipes/qt/6.x.x/qtmodules6.5.0.conf +++ /dev/null @@ -1,331 +0,0 @@ -[submodule "qtbase"] - path = qtbase - url = ../qtbase.git - branch = 6.5.0 - status = essential -[submodule "qtsvg"] - depends = qtbase - path = qtsvg - url = ../qtsvg.git - branch = 6.5.0 - status = addon -[submodule "qtdeclarative"] - depends = qtbase - recommends = qtimageformats qtshadertools qtsvg qtlanguageserver - path = qtdeclarative - url = ../qtdeclarative.git - branch = 6.5.0 - status = essential -[submodule "qtactiveqt"] - depends = qtbase - path = qtactiveqt - url = ../qtactiveqt.git - branch = 6.5.0 - status = addon -[submodule "qtmultimedia"] - depends = qtbase qtshadertools - recommends = qtdeclarative qtquick3d - path = qtmultimedia - url = ../qtmultimedia.git - branch = 6.5.0 - status = addon -[submodule "qttools"] - depends = qtbase - recommends = qtdeclarative qtactiveqt - path = qttools - url = ../qttools.git - branch = 6.5.0 - status = essential -[submodule "qtxmlpatterns"] - depends = qtbase - recommends = qtdeclarative - path = qtxmlpatterns - url = ../qtxmlpatterns.git - branch = dev - status = ignore -[submodule "qttranslations"] - depends = qttools - path = qttranslations - url = ../qttranslations.git - branch = 6.5.0 - status = essential - priority = 30 -[submodule "qtdoc"] - depends = qtdeclarative qttools - recommends = qtmultimedia - path = qtdoc - url = ../qtdoc.git - branch = 6.5.0 - status = essential - priority = 40 -[submodule "qtrepotools"] - path = qtrepotools - url = ../qtrepotools.git - branch = master - status = essential - project = - -[submodule "qtqa"] - depends = qtbase - path = qtqa - url = ../qtqa.git - branch = dev - status = essential - priority = 50 -[submodule "qtlocation"] - depends = qtbase qtpositioning - recommends = qtdeclarative - path = qtlocation - url = ../qtlocation.git - branch = 6.5.0 - status = preview -[submodule "qtpositioning"] - depends = qtbase - recommends = qtdeclarative qtserialport - path = qtpositioning - url = ../qtpositioning.git - branch = 6.5.0 - status = addon -[submodule "qtsensors"] - depends = qtbase - recommends = qtdeclarative - path = qtsensors - url = ../qtsensors.git - branch = 6.5.0 - status = addon -[submodule "qtsystems"] - depends = qtbase - recommends = qtdeclarative - path = qtsystems - url = ../qtsystems.git - branch = dev - status = ignore -[submodule "qtfeedback"] - depends = qtdeclarative - recommends = qtmultimedia - path = qtfeedback - url = ../qtfeedback.git - branch = master - status = ignore -[submodule "qtpim"] - depends = qtdeclarative - path = qtpim - url = ../qtpim.git - branch = dev - status = ignore -[submodule "qtconnectivity"] - depends = qtbase - recommends = qtdeclarative - path = qtconnectivity - url = ../qtconnectivity.git - branch = 6.5.0 - status = addon -[submodule "qtwayland"] - depends = qtbase - recommends = qtdeclarative - path = qtwayland - url = ../qtwayland.git - branch = 6.5.0 - status = addon -[submodule "qt3d"] - depends = qtbase - recommends = qtdeclarative qtshadertools - path = qt3d - url = ../qt3d.git - branch = 6.5.0 - status = addon -[submodule "qtimageformats"] - depends = qtbase - path = qtimageformats - url = ../qtimageformats.git - branch = 6.5.0 - status = addon -[submodule "qtserialbus"] - depends = qtbase - recommends = qtserialport - path = qtserialbus - url = ../qtserialbus.git - branch = 6.5.0 - status = addon -[submodule "qtserialport"] - depends = qtbase - path = qtserialport - url = ../qtserialport.git - branch = 6.5.0 - status = addon -[submodule "qtwebsockets"] - depends = qtbase - recommends = qtdeclarative - path = qtwebsockets - url = ../qtwebsockets.git - branch = 6.5.0 - status = addon -[submodule "qtwebchannel"] - depends = qtbase - recommends = qtdeclarative qtwebsockets - path = qtwebchannel - url = ../qtwebchannel.git - branch = 6.5.0 - status = addon -[submodule "qtwebengine"] - depends = qtdeclarative - recommends = qtwebchannel qttools qtpositioning - path = qtwebengine - url = ../qtwebengine.git - branch = 6.5.0 - status = addon - priority = 10 -[submodule "qtcanvas3d"] - depends = qtdeclarative - path = qtcanvas3d - url = ../qtcanvas3d.git - branch = dev - status = ignore -[submodule "qtwebview"] - depends = qtdeclarative - recommends = qtwebengine - path = qtwebview - url = ../qtwebview.git - branch = 6.5.0 - status = addon -[submodule "qtcharts"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtcharts - url = ../qtcharts.git - branch = 6.5.0 - status = addon -[submodule "qtdatavis3d"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtdatavis3d - url = ../qtdatavis3d.git - branch = 6.5.0 - status = addon -[submodule "qtvirtualkeyboard"] - depends = qtbase qtdeclarative qtsvg - recommends = qtmultimedia - path = qtvirtualkeyboard - url = ../qtvirtualkeyboard.git - branch = 6.5.0 - status = addon -[submodule "qtgamepad"] - depends = qtbase - recommends = qtdeclarative - path = qtgamepad - url = ../qtgamepad.git - branch = dev - status = ignore -[submodule "qtscxml"] - depends = qtbase qtdeclarative - path = qtscxml - url = ../qtscxml.git - branch = 6.5.0 - status = addon -[submodule "qtspeech"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtspeech - url = ../qtspeech.git - branch = 6.5.0 - status = addon -[submodule "qtnetworkauth"] - depends = qtbase - path = qtnetworkauth - url = ../qtnetworkauth.git - branch = 6.5.0 - status = addon -[submodule "qtremoteobjects"] - depends = qtbase - recommends = qtdeclarative - path = qtremoteobjects - url = ../qtremoteobjects.git - branch = 6.5.0 - status = addon -[submodule "qtwebglplugin"] - depends = qtbase qtwebsockets - recommends = qtdeclarative - path = qtwebglplugin - url = ../qtwebglplugin.git - branch = dev - status = ignore -[submodule "qtlottie"] - depends = qtbase qtdeclarative - path = qtlottie - url = ../qtlottie.git - branch = 6.5.0 - status = addon -[submodule "qtquicktimeline"] - depends = qtbase qtdeclarative - path = qtquicktimeline - url = ../qtquicktimeline - branch = 6.5.0 - status = addon -[submodule "qtquick3d"] - depends = qtbase qtdeclarative qtshadertools - recommends = qtquicktimeline - path = qtquick3d - url = ../qtquick3d.git - branch = 6.5.0 - status = addon -[submodule "qtshadertools"] - depends = qtbase - path = qtshadertools - url = ../qtshadertools.git - branch = 6.5.0 - status = addon -[submodule "qt5compat"] - depends = qtbase qtdeclarative - path = qt5compat - url = ../qt5compat.git - branch = 6.5.0 - status = deprecated -[submodule "qtcoap"] - depends = qtbase - path = qtcoap - url = ../qtcoap.git - branch = 6.5.0 - status = addon -[submodule "qtmqtt"] - depends = qtbase qtdeclarative - path = qtmqtt - url = ../qtmqtt.git - branch = 6.5.0 - status = addon -[submodule "qtopcua"] - depends = qtbase qtdeclarative - path = qtopcua - url = ../qtopcua.git - branch = 6.5.0 - status = addon -[submodule "qtlanguageserver"] - depends = qtbase - path = qtlanguageserver - url = ../qtlanguageserver.git - branch = 6.5.0 - status = preview -[submodule "qthttpserver"] - depends = qtbase - recommends = qtwebsockets - path = qthttpserver - url = ../qthttpserver.git - branch = 6.5.0 - status = preview -[submodule "qtquick3dphysics"] - depends = qtbase qtdeclarative qtquick3d qtshadertools - path = qtquick3dphysics - url = ../qtquick3dphysics.git - branch = 6.5.0 - status = addon -[submodule "qtgrpc"] - depends = qtbase - path = qtgrpc - url = ../qtgrpc.git - branch = 6.5.0 - status = preview -[submodule "qtquickeffectmaker"] - depends = qtbase qtdeclarative qtshadertools - recommends = qtquick3d - path = qtquickeffectmaker - url = ../qtquickeffectmaker.git - branch = 6.5.0 - status = addon diff --git a/recipes/qt/6.x.x/qtmodules6.5.1.conf b/recipes/qt/6.x.x/qtmodules6.5.1.conf deleted file mode 100644 index 32adb4f64f4121..00000000000000 --- a/recipes/qt/6.x.x/qtmodules6.5.1.conf +++ /dev/null @@ -1,331 +0,0 @@ -[submodule "qtbase"] - path = qtbase - url = ../qtbase.git - branch = 6.5.1 - status = essential -[submodule "qtsvg"] - depends = qtbase - path = qtsvg - url = ../qtsvg.git - branch = 6.5.1 - status = addon -[submodule "qtdeclarative"] - depends = qtbase - recommends = qtimageformats qtshadertools qtsvg qtlanguageserver - path = qtdeclarative - url = ../qtdeclarative.git - branch = 6.5.1 - status = essential -[submodule "qtactiveqt"] - depends = qtbase - path = qtactiveqt - url = ../qtactiveqt.git - branch = 6.5.1 - status = addon -[submodule "qtmultimedia"] - depends = qtbase qtshadertools - recommends = qtdeclarative qtquick3d - path = qtmultimedia - url = ../qtmultimedia.git - branch = 6.5.1 - status = addon -[submodule "qttools"] - depends = qtbase - recommends = qtdeclarative qtactiveqt - path = qttools - url = ../qttools.git - branch = 6.5.1 - status = essential -[submodule "qtxmlpatterns"] - depends = qtbase - recommends = qtdeclarative - path = qtxmlpatterns - url = ../qtxmlpatterns.git - branch = dev - status = ignore -[submodule "qttranslations"] - depends = qttools - path = qttranslations - url = ../qttranslations.git - branch = 6.5.1 - status = essential - priority = 30 -[submodule "qtdoc"] - depends = qtdeclarative qttools - recommends = qtmultimedia qtshadertools qtwebengine - path = qtdoc - url = ../qtdoc.git - branch = 6.5.1 - status = essential - priority = 40 -[submodule "qtrepotools"] - path = qtrepotools - url = ../qtrepotools.git - branch = master - status = essential - project = - -[submodule "qtqa"] - depends = qtbase - path = qtqa - url = ../qtqa.git - branch = dev - status = essential - priority = 50 -[submodule "qtlocation"] - depends = qtbase qtpositioning - recommends = qtdeclarative - path = qtlocation - url = ../qtlocation.git - branch = 6.5.1 - status = preview -[submodule "qtpositioning"] - depends = qtbase - recommends = qtdeclarative qtserialport - path = qtpositioning - url = ../qtpositioning.git - branch = 6.5.1 - status = addon -[submodule "qtsensors"] - depends = qtbase - recommends = qtdeclarative - path = qtsensors - url = ../qtsensors.git - branch = 6.5.1 - status = addon -[submodule "qtsystems"] - depends = qtbase - recommends = qtdeclarative - path = qtsystems - url = ../qtsystems.git - branch = dev - status = ignore -[submodule "qtfeedback"] - depends = qtdeclarative - recommends = qtmultimedia - path = qtfeedback - url = ../qtfeedback.git - branch = master - status = ignore -[submodule "qtpim"] - depends = qtdeclarative - path = qtpim - url = ../qtpim.git - branch = dev - status = ignore -[submodule "qtconnectivity"] - depends = qtbase - recommends = qtdeclarative - path = qtconnectivity - url = ../qtconnectivity.git - branch = 6.5.1 - status = addon -[submodule "qtwayland"] - depends = qtbase - recommends = qtdeclarative - path = qtwayland - url = ../qtwayland.git - branch = 6.5.1 - status = addon -[submodule "qt3d"] - depends = qtbase - recommends = qtdeclarative qtshadertools - path = qt3d - url = ../qt3d.git - branch = 6.5.1 - status = addon -[submodule "qtimageformats"] - depends = qtbase - path = qtimageformats - url = ../qtimageformats.git - branch = 6.5.1 - status = addon -[submodule "qtserialbus"] - depends = qtbase - recommends = qtserialport - path = qtserialbus - url = ../qtserialbus.git - branch = 6.5.1 - status = addon -[submodule "qtserialport"] - depends = qtbase - path = qtserialport - url = ../qtserialport.git - branch = 6.5.1 - status = addon -[submodule "qtwebsockets"] - depends = qtbase - recommends = qtdeclarative - path = qtwebsockets - url = ../qtwebsockets.git - branch = 6.5.1 - status = addon -[submodule "qtwebchannel"] - depends = qtbase - recommends = qtdeclarative qtwebsockets - path = qtwebchannel - url = ../qtwebchannel.git - branch = 6.5.1 - status = addon -[submodule "qtwebengine"] - depends = qtdeclarative - recommends = qtwebchannel qttools qtpositioning - path = qtwebengine - url = ../qtwebengine.git - branch = 6.5.1 - status = addon - priority = 10 -[submodule "qtcanvas3d"] - depends = qtdeclarative - path = qtcanvas3d - url = ../qtcanvas3d.git - branch = dev - status = ignore -[submodule "qtwebview"] - depends = qtdeclarative - recommends = qtwebengine - path = qtwebview - url = ../qtwebview.git - branch = 6.5.1 - status = addon -[submodule "qtcharts"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtcharts - url = ../qtcharts.git - branch = 6.5.1 - status = addon -[submodule "qtdatavis3d"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtdatavis3d - url = ../qtdatavis3d.git - branch = 6.5.1 - status = addon -[submodule "qtvirtualkeyboard"] - depends = qtbase qtdeclarative qtsvg - recommends = qtmultimedia - path = qtvirtualkeyboard - url = ../qtvirtualkeyboard.git - branch = 6.5.1 - status = addon -[submodule "qtgamepad"] - depends = qtbase - recommends = qtdeclarative - path = qtgamepad - url = ../qtgamepad.git - branch = dev - status = ignore -[submodule "qtscxml"] - depends = qtbase qtdeclarative - path = qtscxml - url = ../qtscxml.git - branch = 6.5.1 - status = addon -[submodule "qtspeech"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtspeech - url = ../qtspeech.git - branch = 6.5.1 - status = addon -[submodule "qtnetworkauth"] - depends = qtbase - path = qtnetworkauth - url = ../qtnetworkauth.git - branch = 6.5.1 - status = addon -[submodule "qtremoteobjects"] - depends = qtbase - recommends = qtdeclarative - path = qtremoteobjects - url = ../qtremoteobjects.git - branch = 6.5.1 - status = addon -[submodule "qtwebglplugin"] - depends = qtbase qtwebsockets - recommends = qtdeclarative - path = qtwebglplugin - url = ../qtwebglplugin.git - branch = dev - status = ignore -[submodule "qtlottie"] - depends = qtbase qtdeclarative - path = qtlottie - url = ../qtlottie.git - branch = 6.5.1 - status = addon -[submodule "qtquicktimeline"] - depends = qtbase qtdeclarative - path = qtquicktimeline - url = ../qtquicktimeline - branch = 6.5.1 - status = addon -[submodule "qtquick3d"] - depends = qtbase qtdeclarative qtshadertools - recommends = qtquicktimeline - path = qtquick3d - url = ../qtquick3d.git - branch = 6.5.1 - status = addon -[submodule "qtshadertools"] - depends = qtbase - path = qtshadertools - url = ../qtshadertools.git - branch = 6.5.1 - status = addon -[submodule "qt5compat"] - depends = qtbase qtdeclarative - path = qt5compat - url = ../qt5compat.git - branch = 6.5.1 - status = deprecated -[submodule "qtcoap"] - depends = qtbase - path = qtcoap - url = ../qtcoap.git - branch = 6.5.1 - status = addon -[submodule "qtmqtt"] - depends = qtbase qtdeclarative - path = qtmqtt - url = ../qtmqtt.git - branch = 6.5.1 - status = addon -[submodule "qtopcua"] - depends = qtbase qtdeclarative - path = qtopcua - url = ../qtopcua.git - branch = 6.5.1 - status = addon -[submodule "qtlanguageserver"] - depends = qtbase - path = qtlanguageserver - url = ../qtlanguageserver.git - branch = 6.5.1 - status = preview -[submodule "qthttpserver"] - depends = qtbase - recommends = qtwebsockets - path = qthttpserver - url = ../qthttpserver.git - branch = 6.5.1 - status = preview -[submodule "qtquick3dphysics"] - depends = qtbase qtdeclarative qtquick3d qtshadertools - path = qtquick3dphysics - url = ../qtquick3dphysics.git - branch = 6.5.1 - status = addon -[submodule "qtgrpc"] - depends = qtbase - path = qtgrpc - url = ../qtgrpc.git - branch = 6.5.1 - status = preview -[submodule "qtquickeffectmaker"] - depends = qtbase qtdeclarative qtshadertools - recommends = qtquick3d - path = qtquickeffectmaker - url = ../qtquickeffectmaker.git - branch = 6.5.1 - status = addon diff --git a/recipes/qt/6.x.x/qtmodules6.5.3.conf b/recipes/qt/6.x.x/qtmodules6.5.3.conf new file mode 100644 index 00000000000000..aee8d5684dcece --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.5.3.conf @@ -0,0 +1,332 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.5.3 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.5.3 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.5.3 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.5.3 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.5.3 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.5.3 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.5.3 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.5.3 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.5.3 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.5.3 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.5.3 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.5.3 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.5.3 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools + path = qt3d + url = ../qt3d.git + branch = 6.5.3 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.5.3 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.5.3 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.5.3 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.5.3 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.5.3 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.5.3 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.5.3 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.5.3 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.5.3 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.5.3 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.5.3 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.5.3 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.5.3 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.5.3 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.5.3 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.5.3 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.5.3 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.5.3 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.5.3 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.5.3 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.5.3 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.5.3 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.5.3 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.5.3 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.5.3 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.5.3 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.5.3 + status = addon diff --git a/recipes/qt/6.x.x/qtmodules6.6.0.conf b/recipes/qt/6.x.x/qtmodules6.6.0.conf new file mode 100644 index 00000000000000..e3853727b0712c --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.6.0.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.6.0 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.6.0 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.6.0 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.6.0 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.6.0 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.6.0 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.6.0 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.6.0 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.6.0 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.6.0 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.6.0 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.6.0 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.6.0 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.6.0 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.6.0 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.6.0 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.6.0 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.6.0 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.6.0 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.6.0 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.6.0 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.6.0 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.6.0 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.6.0 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.6.0 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.6.0 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.6.0 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.6.0 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.6.0 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.6.0 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.6.0 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.6.0 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.6.0 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.6.0 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.6.0 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.6.0 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.6.0 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.6.0 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.6.0 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.6.0 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.6.0 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.6.0 + status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.6.1.conf b/recipes/qt/6.x.x/qtmodules6.6.1.conf new file mode 100644 index 00000000000000..3d1fa112d7390a --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.6.1.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.6.1 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.6.1 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.6.1 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.6.1 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.6.1 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.6.1 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.6.1 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.6.1 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.6.1 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.6.1 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.6.1 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.6.1 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.6.1 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.6.1 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.6.1 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.6.1 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.6.1 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.6.1 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.6.1 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.6.1 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.6.1 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.6.1 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.6.1 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.6.1 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.6.1 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.6.1 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.6.1 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.6.1 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.6.1 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.6.1 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.6.1 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.6.1 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.6.1 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.6.1 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.6.1 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.6.1 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.6.1 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.6.1 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.6.1 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.6.1 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.6.1 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.6.1 + status = preview diff --git a/recipes/qt/6.x.x/test_package/conanfile.py b/recipes/qt/6.x.x/test_package/conanfile.py index 3321de8f782393..1153f37c5a8771 100644 --- a/recipes/qt/6.x.x/test_package/conanfile.py +++ b/recipes/qt/6.x.x/test_package/conanfile.py @@ -1,5 +1,4 @@ import os -import textwrap from conan import ConanFile from conan.tools.build import can_run diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml index 84b51c6e98dab4..a8db7bd315aaba 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,14 +1,16 @@ versions: - "6.5.1": + "6.6.1": folder: 6.x.x - "6.5.0": + "6.6.0": folder: 6.x.x - "6.4.2": + "6.5.3": folder: 6.x.x - "6.4.1": + "6.4.2": folder: 6.x.x "6.3.2": folder: 6.x.x + "5.15.11": + folder: 5.x.x "5.15.10": folder: 5.x.x "5.15.9": diff --git a/recipes/qtawesome/all/conandata.yml b/recipes/qtawesome/all/conandata.yml new file mode 100644 index 00000000000000..f5b2397c54cc52 --- /dev/null +++ b/recipes/qtawesome/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "6.4.0": + url: "https://github.com/gamecreature/QtAwesome/archive/font-awesome-6.4.0.tar.gz" + sha256: "4310aba189e0bba4090997ecfefe27c2c7595aa499b790389dabdce5b4e54f5a" +patches: + "6.4.0": + - patch_file: "patches/0001-add-install.patch" + patch_description: "Add install target to CMakeLists.txt" + patch_type: "bugfix" + patch_source: "https://github.com/gamecreature/QtAwesome/pull/52" + - patch_file: "patches/0002-ce7784e-add-header.patch" + patch_description: "Add header to CMakeLists.txt" + patch_type: "bugfix" + patch_source: "https://github.com/gamecreature/QtAwesome/pull/50" diff --git a/recipes/qtawesome/all/conanfile.py b/recipes/qtawesome/all/conanfile.py new file mode 100644 index 00000000000000..915710817d9845 --- /dev/null +++ b/recipes/qtawesome/all/conanfile.py @@ -0,0 +1,106 @@ +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 +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualRunEnv +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class QtAwesomeConan(ConanFile): + name = "qtawesome" + description = "Font Awesome for Qt Applications" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gamecreature/QtAwesome" + # no "conan" and project name in topics. Use topics from the upstream listed on GH + topics = ("font", "icons", "qt") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + 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") + # FIXME: we shouldn't have to force shared in qt, but config file + # generated by conan in qt static is likely broken, or maybe env vars. + self.options["qt"].shared = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("qt/5.15.9", transitive_headers=True, transitive_libs=True) + + 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." + ) + if self.settings.os == "Linux": + raise ConanInvalidConfiguration("Linux is not supported yet") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if not self.settings.compiler.cppstd: + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) + tc.generate() + vre = VirtualRunEnv(self) + vre.generate(scope="build") + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.md", 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 = ["QtAwesome"] diff --git a/recipes/qtawesome/all/patches/0001-add-install.patch b/recipes/qtawesome/all/patches/0001-add-install.patch new file mode 100644 index 00000000000000..b3851eb38d11e0 --- /dev/null +++ b/recipes/qtawesome/all/patches/0001-add-install.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 94b36d7..f92ec26 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23,3 +23,18 @@ target_include_directories(QtAwesome + target_link_libraries(QtAwesome PUBLIC + Qt${QT_VERSION_MAJOR}::Widgets + ) ++ ++install(TARGETS QtAwesome ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++) ++ ++install(FILES ++ QtAwesome/QtAwesome.h ++ QtAwesome/QtAwesomeAnim.h ++ QtAwesome/QtAwesomeEnumGenerated.h ++ QtAwesome/QtAwesomeStringGenerated.h ++ DESTINATION include ++ ) ++ diff --git a/recipes/qtawesome/all/patches/0002-ce7784e-add-header.patch b/recipes/qtawesome/all/patches/0002-ce7784e-add-header.patch new file mode 100644 index 00000000000000..1dc32834b35c8c --- /dev/null +++ b/recipes/qtawesome/all/patches/0002-ce7784e-add-header.patch @@ -0,0 +1,23 @@ +commit d0398003e820300f902263e67ec06afbdef90c7c +Author: Martin Delille +Date: Fri Mar 31 18:32:51 2023 +0200 + + Add headers to CMakeLists.txt + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f92ec26..93f030d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,8 +11,12 @@ set(CMAKE_AUTORCC ON) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + add_library(QtAwesome ++ QtAwesome/QtAwesome.h + QtAwesome/QtAwesome.cpp ++ QtAwesome/QtAwesomeAnim.h + QtAwesome/QtAwesomeAnim.cpp ++ QtAwesome/QtAwesomeEnumGenerated.h ++ QtAwesome/QtAwesomeStringGenerated.h + QtAwesome/QtAwesomeFree.qrc + ) + diff --git a/recipes/qtawesome/all/test_package/CMakeLists.txt b/recipes/qtawesome/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..4a085bcb1915dd --- /dev/null +++ b/recipes/qtawesome/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(QtAwesome REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qtawesome::qtawesome) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/qtawesome/all/test_package/conanfile.py b/recipes/qtawesome/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/qtawesome/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/qtawesome/all/test_package/test_package.cpp b/recipes/qtawesome/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..cca63995ee056d --- /dev/null +++ b/recipes/qtawesome/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include "QtAwesome.h" + +int main(void) { + fa::QtAwesome awesome(nullptr); + awesome.font(10, 12); + + return EXIT_SUCCESS; +} diff --git a/recipes/qtawesome/config.yml b/recipes/qtawesome/config.yml new file mode 100644 index 00000000000000..773fa8e42ed56f --- /dev/null +++ b/recipes/qtawesome/config.yml @@ -0,0 +1,3 @@ +versions: + "6.4.0": + folder: all diff --git a/recipes/quazip/all/conanfile.py b/recipes/quazip/all/conanfile.py index 0203b4a63fa9cd..6e40033d8025b7 100644 --- a/recipes/quazip/all/conanfile.py +++ b/recipes/quazip/all/conanfile.py @@ -48,8 +48,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/5.15.9") - self.requires("zlib/1.2.13") + self.requires("qt/5.15.9", transitive_headers=True, transitive_libs=True) + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True) if Version(self.version) >= "1.4": self.requires("bzip2/1.0.8") diff --git a/recipes/quickfix/all/conandata.yml b/recipes/quickfix/all/conandata.yml index 863c20f1e79d63..bec3ce0e03d95e 100644 --- a/recipes/quickfix/all/conandata.yml +++ b/recipes/quickfix/all/conandata.yml @@ -5,20 +5,11 @@ sources: patches: "1.15.1": - patch_file: "patches/0001-Fix-build-for-C-17-replace-throw-.-with-EXCEPT.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-except-copy.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-fix-condition-for-using-tr1-namespace.patch" - base_path: "source_subfolder" - patch_file: "patches/0004-remove-tests-from-compilatin-unit-performance-and-ac.patch" - base_path: "source_subfolder" - patch_file: "patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch" - base_path: "source_subfolder" - patch_file: "patches/0006-manage-postgres-through-conan.patch" - base_path: "source_subfolder" - patch_file: "patches/0007-add-support-to-static-libraries-for-non-windows-buil.patch" - base_path: "source_subfolder" - patch_file: "patches/0008-manage-mysql-through-conan.patch" - base_path: "source_subfolder" - patch_file: "patches/0009-downgrade-cmake-minimum-required.patch" - base_path: "source_subfolder" diff --git a/recipes/quickfix/all/conanfile.py b/recipes/quickfix/all/conanfile.py index c5c614561ff611..adfbbac153de52 100644 --- a/recipes/quickfix/all/conanfile.py +++ b/recipes/quickfix/all/conanfile.py @@ -1,48 +1,42 @@ -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 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, rmdir, collect_libs + +required_conan_version = ">=1.53.0" + class QuickfixConan(ConanFile): name = "quickfix" + description = "QuickFIX is a free and open source implementation of the FIX protocol" license = "The QuickFIX Software License, Version 1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.quickfixengine.org" - description = "QuickFIX is a free and open source implementation of the FIX protocol" - topics = ("conan", "QuickFIX", "FIX", "Financial Information Exchange", "libraries", "cpp") - settings = "os", "compiler", "build_type", "arch" - options = {"fPIC": [True, False], - "shared": [True, False], - "with_ssl": [True, False], - "with_postgres": [True, False], - "with_mysql": [None, "libmysqlclient"]} - default_options = {"fPIC": True, - "shared": False, - "with_ssl": False, - "with_postgres": False, - "with_mysql": None} - generators = "cmake" - exports_sources = "patches/**" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def requirements(self): - if self.options.with_ssl: - self.requires("openssl/1.1.1q") - - if self.options.with_postgres: - self.requires("libpq/14.2") - - if self.options.with_mysql == "libmysqlclient": - self.requires("libmysqlclient/8.0.29") + topics = ("FIX", "Financial Information Exchange", "libraries", "cpp") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [True, False], + "with_postgres": [True, False], + "with_mysql": [None, "libmysqlclient"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": False, + "with_postgres": False, + "with_mysql": None, + } + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -50,43 +44,67 @@ 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_ssl: + self.requires("openssl/[>=1.1 <4]") + + if self.options.with_postgres: + self.requires("libpq/15.3") + + if self.options.with_mysql == "libmysqlclient": + self.requires("libmysqlclient/8.0.31") def validate(self): if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("QuickFIX cannot be built as shared lib on Windows") - if self.settings.os == "Macos" and self.settings.arch == "armv8": - raise ConanInvalidConfiguration("QuickFIX doesn't support ARM compilation") # See issue: https://github.com/quickfix/quickfix/issues/206 + if is_apple_os(self) and self.settings.arch == "armv8": + # See issue: https://github.com/quickfix/quickfix/issues/206 + raise ConanInvalidConfiguration("QuickFIX doesn't support ARM compilation") - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["HAVE_SSL"] = self.options.with_ssl - self._cmake.definitions["HAVE_POSTGRESQL"] = self.options.with_postgres - self._cmake.definitions["HAVE_MYSQL"] = bool(self.options.with_mysql) - self._cmake.configure(source_folder=self._source_subfolder, 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): + env = VirtualBuildEnv(self) + env.generate() + tc = CMakeToolchain(self) + tc.variables["HAVE_SSL"] = self.options.with_ssl + tc.variables["HAVE_POSTGRESQL"] = self.options.with_postgres + tc.variables["HAVE_MYSQL"] = bool(self.options.with_mysql) + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build(target="quickfix") def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("config.h", dst=os.path.join("include", "quickfix"), src=self._build_subfolder) - self.copy("Except.h", dst="include", src=os.path.join(self._source_subfolder, "src", "C++")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "config.h", + dst=os.path.join(self.package_folder, "include", "quickfix"), + src=self.build_folder) + copy(self, "Except.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "src", "C++")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.options.with_ssl: self.cpp_info.defines.append("HAVE_SSL=1") diff --git a/recipes/quickfix/all/patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch b/recipes/quickfix/all/patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch index 3480935d8cd0e9..fbea88ec0b6c1a 100644 --- a/recipes/quickfix/all/patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch +++ b/recipes/quickfix/all/patches/0005-inc.-required-CMake-version-add-conan-basic-setup-an.patch @@ -25,8 +25,8 @@ index 48908ead..8789432c 100644 endif() project(${quickfix_PROJECT_NAME} VERSION 0.1 LANGUAGES CXX C) -+include(${PROJECT_BINARY_DIR}/../conanbuildinfo.cmake) -+conan_basic_setup() ++ ++ message("-- Project name ${CMAKE_PROJECT_NAME}") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") diff --git a/recipes/quickfix/all/test_package/CMakeLists.txt b/recipes/quickfix/all/test_package/CMakeLists.txt index 57cf0bfd3debb2..59fa2d07ab926b 100644 --- a/recipes/quickfix/all/test_package/CMakeLists.txt +++ b/recipes/quickfix/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(quickfix REQUIRED CONFIG) add_executable(executor ${PROJECT_SOURCE_DIR}/executor.cpp) -target_link_libraries(executor ${CONAN_LIBS}) +target_link_libraries(executor PRIVATE quickfix::quickfix) diff --git a/recipes/quickfix/all/test_package/conanfile.py b/recipes/quickfix/all/test_package/conanfile.py index a68d648c5c5b56..bf3ebab04211e7 100644 --- a/recipes/quickfix/all/test_package/conanfile.py +++ b/recipes/quickfix/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 QuickfixTestConan(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,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "executor") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "executor") + self.run(bin_path, env="conanrun") diff --git a/recipes/quickfix/all/test_v1_package/CMakeLists.txt b/recipes/quickfix/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/quickfix/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/quickfix/all/test_v1_package/conanfile.py b/recipes/quickfix/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..3148dc9605e6c1 --- /dev/null +++ b/recipes/quickfix/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class QuickfixTestConan(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", "executor") + self.run(bin_path, run_environment=True) diff --git a/recipes/quill/all/conandata.yml b/recipes/quill/all/conandata.yml index d0c356569441c7..2eb1a4d7bd925d 100644 --- a/recipes/quill/all/conandata.yml +++ b/recipes/quill/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "3.5.1": + url: "https://github.com/odygrd/quill/archive/v3.5.1.tar.gz" + sha256: "9fa4ebe594c66ce2a409630c304724fa7a2ada0d842ba9c9aaf05f0a90b461f9" + "3.5.0": + url: "https://github.com/odygrd/quill/archive/v3.5.0.tar.gz" + sha256: "47a69465cddeb05645745bed0b3099b49cb627464782f765ce9545723ff1fe84" + "3.4.1": + url: "https://github.com/odygrd/quill/archive/v3.4.1.tar.gz" + sha256: "99f6497b8ba37c30c871fab89f14cd7bc989f3eaa921ccd940a521ee60a6a1c5" + "3.4.0": + url: "https://github.com/odygrd/quill/archive/v3.4.0.tar.gz" + sha256: "16a6cfadc288953f07d128bb51e8ebd4ca6bb8ce4175b5a8af53ce7dde324d8d" + "3.3.1": + url: "https://github.com/odygrd/quill/archive/v3.3.1.tar.gz" + sha256: "f929d54a115b45c32dd2acd1a9810336d35c31fde9f5581c51ad2b80f980d0d1" "3.2.0": url: "https://github.com/odygrd/quill/archive/v3.2.0.tar.gz" sha256: "9745ad83b285bbd0481bd14c1b866b7e6121a981dd211b914f5d55955040fd00" diff --git a/recipes/quill/all/conanfile.py b/recipes/quill/all/conanfile.py index 8de97161e36194..311710c99f8c57 100644 --- a/recipes/quill/all/conanfile.py +++ b/recipes/quill/all/conanfile.py @@ -69,7 +69,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/10.0.0", transitive_headers=True) + self.requires("fmt/10.1.1", transitive_headers=True) def validate(self): supported_archs = ["x86", "x86_64", "armv6", "armv7", "armv7hf", "armv8"] diff --git a/recipes/quill/all/test_package/CMakeLists.txt b/recipes/quill/all/test_package/CMakeLists.txt index d53c2b924044a5..b6b657d776df51 100644 --- a/recipes/quill/all/test_package/CMakeLists.txt +++ b/recipes/quill/all/test_package/CMakeLists.txt @@ -10,3 +10,7 @@ if(quill_VERSION VERSION_GREATER_EQUAL "2.0.0") else() target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) endif() + +if(quill_VERSION VERSION_GREATER_EQUAL "3.3.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE QUILL_FILE_HANDLERS_API_V3_3) +endif() diff --git a/recipes/quill/all/test_package/test_package.cpp b/recipes/quill/all/test_package/test_package.cpp index ab2f3ef6f2de87..b02a6dd344b064 100644 --- a/recipes/quill/all/test_package/test_package.cpp +++ b/recipes/quill/all/test_package/test_package.cpp @@ -3,7 +3,15 @@ int main() { quill::start(); +#ifdef QUILL_FILE_HANDLERS_API_V3_3 + auto file_handler = quill::file_handler("logfile.log", []() { + quill::FileHandlerConfig cfg; + cfg.set_open_mode('w'); + return cfg; + }()); +#else auto file_handler = quill::file_handler("logfile.log", "w"); +#endif auto my_logger = quill::create_logger("my_logger", std::move(file_handler)); LOG_INFO(my_logger, "Hello from {}", "Quill"); diff --git a/recipes/quill/config.yml b/recipes/quill/config.yml index d8522cb2854c60..bca90bfdc7c02f 100644 --- a/recipes/quill/config.yml +++ b/recipes/quill/config.yml @@ -1,4 +1,14 @@ versions: + "3.5.1": + folder: "all" + "3.5.0": + folder: "all" + "3.4.1": + folder: "all" + "3.4.0": + folder: "all" + "3.3.1": + folder: "all" "3.2.0": folder: "all" "3.1.0": diff --git a/recipes/qwt/all/conanfile.py b/recipes/qwt/all/conanfile.py index 3c7b6925650a86..8cc76b47a4e496 100644 --- a/recipes/qwt/all/conanfile.py +++ b/recipes/qwt/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" class QwtConan(ConanFile): @@ -15,7 +15,8 @@ class QwtConan(ConanFile): license = "LGPL-2.1-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://qwt.sourceforge.io/" - topics = ("archive", "compression") + topics = ("chart", "data-visualization", "graph", "plot", "qt") + package_type = "library" description = ( "The Qwt library contains GUI Components and utility classes which are primarily useful for programs " "with a technical background. Beside a framework for 2D plots it provides scales, sliders, dials, compasses, " @@ -43,6 +44,10 @@ class QwtConan(ConanFile): "polar": True, } + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def export_sources(self): export_conandata_patches(self) @@ -58,39 +63,39 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/5.15.9") + self.requires("qt/5.15.11", transitive_headers=True, transitive_libs=True) def validate(self): if hasattr(self, "settings_build") and cross_building(self): raise ConanInvalidConfiguration("Qwt recipe does not support cross-compilation yet") qt_options = self.dependencies["qt"].options - if self.info.options.widgets and not qt_options.widgets: + if self.options.widgets and not qt_options.widgets: raise ConanInvalidConfiguration("qwt:widgets=True requires qt:widgets=True") - if self.info.options.svg and not qt_options.qtsvg: + if self.options.svg and not qt_options.qtsvg: raise ConanInvalidConfiguration("qwt:svg=True requires qt:qtsvg=True") - if self.info.options.opengl and qt_options.opengl == "no": + if self.options.opengl and qt_options.opengl == "no": raise ConanInvalidConfiguration("qwt:opengl=True is not compatible with qt:opengl=no") - if self.info.options.designer and not (qt_options.qttools and qt_options.gui and qt_options.widgets): + if self.options.designer and not (qt_options.qttools and qt_options.gui and qt_options.widgets): raise ConanInvalidConfiguration("qwt:designer=True requires qt:qttools=True, qt::gui=True and qt::widgets=True") def build_requirements(self): - if hasattr(self, "settings_build") and cross_building(self): - self.tool_requires("qt/5.15.7") + if not self._is_legacy_one_profile: + self.tool_requires("qt/") 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): - if hasattr(self, "settings_build") and cross_building(self): - env = VirtualBuildEnv(self) - env.generate() - else: + if self._is_legacy_one_profile: env = VirtualRunEnv(self) env.generate(scope="build") + else: + env = VirtualBuildEnv(self) + env.generate() tc = CMakeToolchain(self) tc.variables["QWT_DLL"] = self.options.shared - tc.variables["QWT_STATIC "] = not self.options.shared + tc.variables["QWT_STATIC"] = not self.options.shared tc.variables["QWT_PLOT"] = self.options.plot tc.variables["QWT_WIDGETS"] = self.options.widgets tc.variables["QWT_SVG"] = self.options.svg diff --git a/recipes/r8brain-free-src/all/conandata.yml b/recipes/r8brain-free-src/all/conandata.yml index e43484f945f023..1e70527306c749 100644 --- a/recipes/r8brain-free-src/all/conandata.yml +++ b/recipes/r8brain-free-src/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "6.5": + url: "https://github.com/avaneev/r8brain-free-src/archive/refs/tags/version-6.5.tar.gz" + sha256: "09114b9e6dc6ccee3049534bbb94a7d40a8a07fdfe86e4edce03f76078cee45d" + "6.4": + url: "https://github.com/avaneev/r8brain-free-src/archive/refs/tags/version-6.4.tar.gz" + sha256: "27e6749e140648894b79003fe16a4d416eca3bed8d067e0f00cfb2e246c556ca" "6.3": url: "https://github.com/avaneev/r8brain-free-src/archive/refs/tags/version-6.3.tar.gz" sha256: "f2cd46cd8806294d9be45ed4e6bda5f8ef1dc808625eec3facde784953d2bc23" diff --git a/recipes/r8brain-free-src/config.yml b/recipes/r8brain-free-src/config.yml index 8f56257b3441dc..79caa70a836d22 100644 --- a/recipes/r8brain-free-src/config.yml +++ b/recipes/r8brain-free-src/config.yml @@ -1,4 +1,8 @@ versions: + "6.5": + folder: all + "6.4": + folder: all "6.3": folder: all "6.2": diff --git a/recipes/rangeless/all/conanfile.py b/recipes/rangeless/all/conanfile.py index d37a7eb54aeb3e..4eb06ece4e6275 100644 --- a/recipes/rangeless/all/conanfile.py +++ b/recipes/rangeless/all/conanfile.py @@ -1,34 +1,66 @@ -from conans import ConanFile, tools import os -import glob + +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 RangelessConan(ConanFile): name = "rangeless" description = "c++ LINQ -like library of higher-order functions for data manipulation" license = "MIT" - homepage = "https://github.com/ast-al/rangeless" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ast-al/rangeless" topics = ("range", "linq", "lazy-evaluation", "header-only") - settings = "compiler" + + 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 14 - def configure(self): - minimal_cpp_standard = "14" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "14", + "msvc": "191", + } + + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + 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.get_safe("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 = glob.glob(self.name + "-*/")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.hpp", 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, "*.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.libdirs = [] diff --git a/recipes/rangeless/all/test_package/CMakeLists.txt b/recipes/rangeless/all/test_package/CMakeLists.txt index 5e1e9d9b89fe0a..6f31fb97ff44ca 100644 --- a/recipes/rangeless/all/test_package/CMakeLists.txt +++ b/recipes/rangeless/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -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(rangeless REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE rangeless::rangeless) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/rangeless/all/test_package/conanfile.py b/recipes/rangeless/all/test_package/conanfile.py index 6c9d5dba712c72..ef5d7042163ecc 100644 --- a/recipes/rangeless/all/test_package/conanfile.py +++ b/recipes/rangeless/all/test_package/conanfile.py @@ -1,9 +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) @@ -11,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/rangeless/all/test_package/test_package.cpp b/recipes/rangeless/all/test_package/test_package.cpp index 4f49c17e155f2b..96e45179153e6a 100644 --- a/recipes/rangeless/all/test_package/test_package.cpp +++ b/recipes/rangeless/all/test_package/test_package.cpp @@ -11,7 +11,7 @@ int main() { values = std::move(values) % fn::where([](auto&& _) { return _ % 2 == 0; }) % fn::transform([] (auto&& _) { return _ * 3; }); - + auto expected = std::vector{0,6,12,18,24,30}; bool success = values == expected; diff --git a/recipes/rangeless/all/test_v1_package/CMakeLists.txt b/recipes/rangeless/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/rangeless/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/rangeless/all/test_v1_package/conanfile.py b/recipes/rangeless/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6c9d5dba712c72 --- /dev/null +++ b/recipes/rangeless/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rangesnext/all/conandata.yml b/recipes/rangesnext/all/conandata.yml index 72383f2492ee79..f52ac4400f69a4 100644 --- a/recipes/rangesnext/all/conandata.yml +++ b/recipes/rangesnext/all/conandata.yml @@ -1,8 +1,4 @@ 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" - base_path: "source_subfolder" + sha256: "8b4ba9129346818d1ad2ab1fe00ccb85c5c1b35fef91868aece97aa079e0dec4" diff --git a/recipes/rangesnext/all/conanfile.py b/recipes/rangesnext/all/conanfile.py index b438391b226f93..6c7782838deee2 100644 --- a/recipes/rangesnext/all/conanfile.py +++ b/recipes/rangesnext/all/conanfile.py @@ -1,37 +1,68 @@ -from conans import ConanFile, tools -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.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class RangesnextConan(ConanFile): name = "rangesnext" description = "ranges features for C++23 ported to C++20" - topics = ("conan", "rangesnext", "ranges", "backport", "backport-cpp") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/cor3ntin/rangesnext" - license = "BSL-1.0" - settings = "compiler" + topics = ("ranges", "backport", "backport-cpp", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _compilers_minimum_version = { - "gcc": "10", - "Visual Studio": "19", - "clang": "13" - } - _source_subfolder = "source_subfolder" + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + "msvc": "193", + "Visual Studio": "17", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "20") + check_min_cppstd(self, self._min_cppstd) + + if "clang" in str(self.settings.compiler): + raise ConanInvalidConfiguration("rangesnext is not compatible with Clang") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if not minimum_version or tools.Version(self.settings.compiler.version) < minimum_version: + if not minimum_version or Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("rangesnext requires C++20, which your compiler does not fully support.") 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): - include_folder = os.path.join(self._source_subfolder, "include") - self.copy(pattern="LICENSE.md", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=include_folder) + include_folder = os.path.join(self.source_folder, "include") + copy(self, "LICENSE.md", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=include_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/rangesnext/all/test_package/CMakeLists.txt b/recipes/rangesnext/all/test_package/CMakeLists.txt index 2bd2a465ffb060..9b8b15ab7a013f 100644 --- a/recipes/rangesnext/all/test_package/CMakeLists.txt +++ b/recipes/rangesnext/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(rangesnext REQUIRED CONFIG) diff --git a/recipes/rangesnext/all/test_package/conanfile.py b/recipes/rangesnext/all/test_package/conanfile.py index 6c9d5dba712c72..ef5d7042163ecc 100644 --- a/recipes/rangesnext/all/test_package/conanfile.py +++ b/recipes/rangesnext/all/test_package/conanfile.py @@ -1,9 +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) @@ -11,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/rangesnext/all/test_package/test_package.cpp b/recipes/rangesnext/all/test_package/test_package.cpp index e25f23d0966045..f1a7ea7bef564d 100644 --- a/recipes/rangesnext/all/test_package/test_package.cpp +++ b/recipes/rangesnext/all/test_package/test_package.cpp @@ -1,6 +1,7 @@ -#include #include +#include + namespace rangesnext = cor3ntin::rangesnext; template @@ -12,11 +13,11 @@ bool test_enumerate_with(RangeT &&range) { bool success = true; for (auto &&[i, v] : enumerated_range) { - std::cout << i << " - " << v << "\n"; + std::cout << i << " - " << v << "\n"; success = (i == idx_ref++) && (v == *it_ref++); if (success == false) { - return false; + return false; } } diff --git a/recipes/rangesnext/all/test_v1_package/CMakeLists.txt b/recipes/rangesnext/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/rangesnext/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/rangesnext/all/test_v1_package/conanfile.py b/recipes/rangesnext/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6c9d5dba712c72 --- /dev/null +++ b/recipes/rangesnext/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rapidcsv/all/conandata.yml b/recipes/rapidcsv/all/conandata.yml index 7a2083f7a43d32..22f73545deb36a 100644 --- a/recipes/rapidcsv/all/conandata.yml +++ b/recipes/rapidcsv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "8.80": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.80.tar.gz" + sha256: "4c9e01cb2554cc76acac61532ef33b59e5b1f822160d2eb7efee2c128ea7f4c5" "8.77": url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.77.tar.gz" sha256: "2513c05e1a39799edd93787e86bdd83462bee06150b40942879af955288fa495" diff --git a/recipes/rapidcsv/config.yml b/recipes/rapidcsv/config.yml index d18c0697363e95..643c892898926b 100644 --- a/recipes/rapidcsv/config.yml +++ b/recipes/rapidcsv/config.yml @@ -1,4 +1,6 @@ versions: + "8.80": + folder: "all" "8.77": folder: "all" "8.75": diff --git a/recipes/rapidfuzz/all/conandata.yml b/recipes/rapidfuzz/all/conandata.yml index 72d797c618c5e3..f9ef7412f82746 100644 --- a/recipes/rapidfuzz/all/conandata.yml +++ b/recipes/rapidfuzz/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.2.3": + url: "https://github.com/maxbachmann/rapidfuzz-cpp/archive/refs/tags/v2.2.3.tar.gz" + sha256: "df4412e9593945782de2212095bd4b70a8f8e63ae8f313976c616809be124d2c" + "2.2.0": + url: "https://github.com/maxbachmann/rapidfuzz-cpp/archive/refs/tags/v2.2.0.tar.gz" + sha256: "8fe2d2792ee8b32598f4aa3aad5db7d449fb3c4a32387080f650335cf4faef81" + "2.1.1": + url: "https://github.com/maxbachmann/rapidfuzz-cpp/archive/refs/tags/v2.1.1.tar.gz" + sha256: "1680c0dbf77d228ea81825c24755db99ee0e21a8db3663b5136741b3e108c3f2" "2.0.0": url: "https://github.com/maxbachmann/rapidfuzz-cpp/archive/refs/tags/v2.0.0.tar.gz" sha256: "0d6d399be1de151631bbc189b72089600884831a4dac91e22f17351cef18ae64" diff --git a/recipes/rapidfuzz/config.yml b/recipes/rapidfuzz/config.yml index 62df69f5c87457..71b60f681064b0 100644 --- a/recipes/rapidfuzz/config.yml +++ b/recipes/rapidfuzz/config.yml @@ -1,4 +1,10 @@ versions: + "2.2.3": + folder: "all" + "2.2.0": + folder: "all" + "2.1.1": + folder: "all" "2.0.0": folder: "all" "1.10.4": diff --git a/recipes/rapidjson/all/conandata.yml b/recipes/rapidjson/all/conandata.yml index dd7649f2b814f7..4f7c0b1008ac2b 100644 --- a/recipes/rapidjson/all/conandata.yml +++ b/recipes/rapidjson/all/conandata.yml @@ -3,6 +3,9 @@ sources: url: "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz" sha256: bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e # More recent unofficial releases based on commits + "cci.20230929": + url: "https://github.com/Tencent/rapidjson/archive/f9d53419e912910fd8fa57d5705fa41425428c35.tar.gz" + sha256: "2b521dba5c22eaae6e6e7d4d304cb317e2cf8c687c70046b02792c02f78c127e" "cci.20220822": url: "https://github.com/Tencent/rapidjson/archive/06d58b9e848c650114556a23294d0b6440078c61.tar.gz" sha256: 30d28bbe0bfff9d8dc5d3cf62799b6ee550499cc1520e44bdece81e002480d19 diff --git a/recipes/rapidjson/config.yml b/recipes/rapidjson/config.yml index 82e5350012d0b5..e55a15ea06b311 100644 --- a/recipes/rapidjson/config.yml +++ b/recipes/rapidjson/config.yml @@ -1,6 +1,8 @@ versions: "1.1.0": folder: "all" + "cci.20230929": + folder: "all" "cci.20220822": folder: "all" "cci.20211112": diff --git a/recipes/raylib/all/conandata.yml b/recipes/raylib/all/conandata.yml index 8757de8ae9e8ab..03de4ecb0f5c2e 100644 --- a/recipes/raylib/all/conandata.yml +++ b/recipes/raylib/all/conandata.yml @@ -8,6 +8,14 @@ sources: patches: "4.0.0": - patch_file: "patches/4.0.0-0001-enable-cmake-build-android.patch" + - patch_file: "patches/4.0.0-0002-win32-glfw3native.patch" + patch_description: "Win32: resolve some symbols re-definition of windows.h in glfw3native.h" + patch_type: "portability" + patch_source: "https://github.com/raysan5/raylib/pull/2643" "3.5.0": - patch_file: "patches/3.5.0-0001-enable-cmake-build-android.patch" - patch_file: "patches/3.5.0-0002-cmake-project.patch" + - patch_file: "patches/3.5.0-0003-win32-glfw3native.patch" + patch_description: "Win32: resolve some symbols re-definition of windows.h in glfw3native.h" + patch_type: "portability" + patch_source: "https://github.com/raysan5/raylib/pull/2643" diff --git a/recipes/raylib/all/patches/3.5.0-0001-enable-cmake-build-android.patch b/recipes/raylib/all/patches/3.5.0-0001-enable-cmake-build-android.patch index 41d8a0a51669a3..18b6559a6f2852 100644 --- a/recipes/raylib/all/patches/3.5.0-0001-enable-cmake-build-android.patch +++ b/recipes/raylib/all/patches/3.5.0-0001-enable-cmake-build-android.patch @@ -15,15 +15,6 @@ diff --git a/src/core.c b/src/core.c index e6d27e5f..fb7014b0 100644 --- a/src/core.c +++ b/src/core.c -@@ -186,7 +186,7 @@ - - // Support retrieving native window handlers - #if defined(_WIN32) -- #define GLFW_EXPOSE_NATIVE_WIN32 -+ - #include // WARNING: It requires customization to avoid windows.h inclusion! - - #if !defined(SUPPORT_BUSY_WAIT_LOOP) @@ -3346,10 +3346,12 @@ static bool InitGraphicsDevice(int width, int height) glfwSwapInterval(0); // No V-Sync by default #endif diff --git a/recipes/raylib/all/patches/3.5.0-0003-win32-glfw3native.patch b/recipes/raylib/all/patches/3.5.0-0003-win32-glfw3native.patch new file mode 100644 index 00000000000000..d302d880e59903 --- /dev/null +++ b/recipes/raylib/all/patches/3.5.0-0003-win32-glfw3native.patch @@ -0,0 +1,14 @@ +--- a/src/core.c ++++ b/src/core.c +@@ -186,7 +186,11 @@ + + // Support retrieving native window handlers + #if defined(_WIN32) ++ typedef void *PVOID; ++ typedef PVOID HANDLE; ++ typedef HANDLE HWND; + #define GLFW_EXPOSE_NATIVE_WIN32 ++ #define GLFW_NATIVE_INCLUDE_NONE // To avoid some symbols re-definition in windows.h + #include // WARNING: It requires customization to avoid windows.h inclusion! + + #if !defined(SUPPORT_BUSY_WAIT_LOOP) diff --git a/recipes/raylib/all/patches/4.0.0-0001-enable-cmake-build-android.patch b/recipes/raylib/all/patches/4.0.0-0001-enable-cmake-build-android.patch index 6b4ff9b463c461..4ff586ccfe20dd 100644 --- a/recipes/raylib/all/patches/4.0.0-0001-enable-cmake-build-android.patch +++ b/recipes/raylib/all/patches/4.0.0-0001-enable-cmake-build-android.patch @@ -11,16 +11,3 @@ index c156d6b3..608fe531 100644 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate") find_library(OPENGL_LIBRARY OpenGL) -diff --git a/src/rcore.c b/src/rcore.c -index 3b451552..d7e58c1c 100644 ---- a/src/rcore.c -+++ b/src/rcore.c -@@ -196,7 +196,7 @@ - - // Support retrieving native window handlers - #if defined(_WIN32) -- #define GLFW_EXPOSE_NATIVE_WIN32 -+ - #include "GLFW/glfw3native.h" // WARNING: It requires customization to avoid windows.h inclusion! - - #if defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) diff --git a/recipes/raylib/all/patches/4.0.0-0002-win32-glfw3native.patch b/recipes/raylib/all/patches/4.0.0-0002-win32-glfw3native.patch new file mode 100644 index 00000000000000..292c7cf7b3f373 --- /dev/null +++ b/recipes/raylib/all/patches/4.0.0-0002-win32-glfw3native.patch @@ -0,0 +1,14 @@ +--- a/src/rcore.c ++++ b/src/rcore.c +@@ -196,7 +196,11 @@ + + // Support retrieving native window handlers + #if defined(_WIN32) ++ typedef void *PVOID; ++ typedef PVOID HANDLE; ++ typedef HANDLE HWND; + #define GLFW_EXPOSE_NATIVE_WIN32 ++ #define GLFW_NATIVE_INCLUDE_NONE // To avoid some symbols re-definition in windows.h + #include "GLFW/glfw3native.h" // WARNING: It requires customization to avoid windows.h inclusion! + + #if defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) diff --git a/recipes/re2/all/conandata.yml b/recipes/re2/all/conandata.yml index bc9a3a910cce54..c28d8dfdd5d72c 100644 --- a/recipes/re2/all/conandata.yml +++ b/recipes/re2/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "20231101": + url: "https://github.com/google/re2/releases/download/2023-11-01/re2-2023-11-01.tar.gz" + sha256: "4e6593ac3c71de1c0f322735bc8b0492a72f66ffccfad76e259fa21c41d27d8a" + "20230901": + url: "https://github.com/google/re2/releases/download/2023-09-01/re2-2023-09-01.tar.gz" + sha256: "5bb6875ae1cd1e9fedde98018c346db7260655f86fdb8837e3075103acd3649b" + "20230801": + url: "https://github.com/google/re2/releases/download/2023-08-01/re2-2023-08-01.tar.gz" + sha256: "d82d0efe2389949244445e7a6ac9a10fccc3d6a3d267ec4652991a51291647b0" + "20230701": + url: "https://github.com/google/re2/releases/download/2023-07-01/re2-2023-07-01.tar.gz" + sha256: "18cf85922e27fad3ed9c96a27733037da445f35eb1a2744c306a37c6d11e95c4" "20230602": url: "https://github.com/google/re2/releases/download/2023-06-02/re2-2023-06-02.tar.gz" sha256: "4ccdd5aafaa1bcc24181e6dd3581c3eee0354734bb9f3cb4306273ffa434b94f" @@ -23,15 +35,3 @@ sources: "20210901": url: "https://github.com/google/re2/archive/refs/tags/2021-09-01.tar.gz" sha256: "42a2e1d56b5de252f5d418dc1cc0848e9e52ca22b056453988b18c6195ec7f8d" - "20210601": - url: "https://github.com/google/re2/archive/refs/tags/2021-06-01.tar.gz" - sha256: "26155e050b10b5969e986dab35654247a3b1b295e0532880b5a9c13c0a700ceb" - "20210401": - url: "https://github.com/google/re2/archive/refs/tags/2021-04-01.tar.gz" - sha256: "358aedf71dbf26506848905f5d4417b7adba5cf44d3bbcf70bf4ef68ccb0871e" - "20210202": - url: "https://github.com/google/re2/archive/2021-02-02.tar.gz" - sha256: "1396ab50c06c1a8885fb68bf49a5ecfd989163015fd96699a180d6414937f33f" - "20201101": - url: "https://github.com/google/re2/archive/2020-11-01.tar.gz" - sha256: "8903cc66c9d34c72e2bc91722288ebc7e3ec37787ecfef44d204b2d6281954d7" diff --git a/recipes/re2/all/conanfile.py b/recipes/re2/all/conanfile.py index ca615ecb2c5f0e..8d2e83b161ad92 100644 --- a/recipes/re2/all/conanfile.py +++ b/recipes/re2/all/conanfile.py @@ -60,9 +60,9 @@ def layout(self): def requirements(self): if self.options.get_safe("with_icu"): - self.requires("icu/73.1") + self.requires("icu/73.2") if Version(self.version) >= "20230601": - self.requires("abseil/20230125.3", transitive_headers=True) + self.requires("abseil/20230802.1", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/re2/config.yml b/recipes/re2/config.yml index 6ecf995b443ace..56ae3dda8367ba 100644 --- a/recipes/re2/config.yml +++ b/recipes/re2/config.yml @@ -1,4 +1,12 @@ versions: + "20231101": + folder: all + "20230901": + folder: all + "20230801": + folder: all + "20230701": + folder: all "20230602": folder: all "20230301": @@ -15,11 +23,3 @@ versions: folder: all "20210901": folder: all - "20210601": - folder: all - "20210401": - folder: all - "20210202": - folder: all - "20201101": - folder: all 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/reactiveplusplus/all/conandata.yml b/recipes/reactiveplusplus/all/conandata.yml index b01e397208475c..9e638abe5d43ae 100644 --- a/recipes/reactiveplusplus/all/conandata.yml +++ b/recipes/reactiveplusplus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.3": + url: "https://github.com/victimsnino/ReactivePlusPlus/archive/v0.2.3.tar.gz" + sha256: "9542419f8d7da98126ba2c6ae08fab287b4b3798d89cf75ed9bed2a9e3ec1678" "0.2.1": url: "https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/v0.2.1.tar.gz" sha256: "c41f9a0b727d5bdbc92390b3f075bfa280fd4f6f2aa7db51428fc30023b518d0" diff --git a/recipes/reactiveplusplus/config.yml b/recipes/reactiveplusplus/config.yml index 4fec465c4ccadf..34b32de1aab118 100644 --- a/recipes/reactiveplusplus/config.yml +++ b/recipes/reactiveplusplus/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.3": + folder: all "0.2.1": folder: all "0.1.2": diff --git a/recipes/readline/all/conanfile.py b/recipes/readline/all/conanfile.py index 607d6921916f3f..52881bbd4d54a3 100644 --- a/recipes/readline/all/conanfile.py +++ b/recipes/readline/all/conanfile.py @@ -38,7 +38,7 @@ def requirements(self): if self.options.with_library == "termcap": self.requires("termcap/1.3.1") elif self.options.with_library == "curses": - self.requires("ncurses/6.2") + self.requires("ncurses/6.4") def configure(self): if self.options.shared: diff --git a/recipes/readosm/all/conanfile.py b/recipes/readosm/all/conanfile.py index b9c04661624b42..b9c849a5528870 100644 --- a/recipes/readosm/all/conanfile.py +++ b/recipes/readosm/all/conanfile.py @@ -55,7 +55,7 @@ def layout(self): def requirements(self): self.requires("expat/2.5.0") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def build_requirements(self): if not is_msvc(self): diff --git a/recipes/rectanglebinpack/all/CMakeLists.txt b/recipes/rectanglebinpack/all/CMakeLists.txt deleted file mode 100644 index eab353d6877362..00000000000000 --- a/recipes/rectanglebinpack/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory("source_subfolder") diff --git a/recipes/rectanglebinpack/all/conandata.yml b/recipes/rectanglebinpack/all/conandata.yml index 076654555cbc69..e93b6ba1b60128 100644 --- a/recipes/rectanglebinpack/all/conandata.yml +++ b/recipes/rectanglebinpack/all/conandata.yml @@ -2,9 +2,6 @@ sources: "cci.20210901": - url: "https://github.com/juj/RectangleBinPack/archive/a40fcaf3871da57b0f6a080655b3387374840877.zip" sha256: "88cec105ca8d90d09e9e81f9862caa0cc1cdb851560fb701555eb58b29515748" - - url: "https://unlicense.org/UNLICENSE" - sha256: "7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c" patches: "cci.20210901": - patch_file: "patches/0001_fix_win32_build.patch" - base_path: "source_subfolder" diff --git a/recipes/rectanglebinpack/all/conanfile.py b/recipes/rectanglebinpack/all/conanfile.py index c7332f95311645..f77182eff1815c 100644 --- a/recipes/rectanglebinpack/all/conanfile.py +++ b/recipes/rectanglebinpack/all/conanfile.py @@ -1,19 +1,23 @@ -from conans import ConanFile, CMake, tools import os -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 apply_conandata_patches, copy, export_conandata_patches, get, load, save + +required_conan_version = ">=1.53.0" class RectangleBinPackConan(ConanFile): name = "rectanglebinpack" - license = "Unlicense" + description = "The code can be used to solve the problem of packing a set of 2D rectangles into a larger bin." + license = "LicenseRef-rectanglebinpack-public-domain" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/juj/RectangleBinPack" - description = "The code can be used to solve the problem of packing a set of 2D rectangles into a larger bin." topics = ("rectangle", "packing", "bin") - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -23,15 +27,8 @@ class RectangleBinPackConan(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @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": @@ -39,40 +36,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 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][0], - strip_root=True, destination=self._source_subfolder) - tools.download(filename="LICENSE", **self.conan_data["sources"][self.version][1]) + get(self, **self.conan_data["sources"][self.version][0], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + 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 _extract_license(self): + readme_content = load(self, os.path.join(self.source_folder, "Readme.txt"), encoding="latin-1") + license_content = "\n".join(readme_content.splitlines()[-4:]) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_content) def package(self): - self.copy("LICENSE", dst="licenses") - self.copy("*.h", dst=os.path.join("include", self.name), src=self._source_subfolder, excludes="old/**") - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.lib", dst="lib", keep_path=False) - self.copy("*.so", dst="lib", keep_path=False) - self.copy("*.dylib", dst="lib", keep_path=False) - self.copy("*.a", dst="lib", keep_path=False) + self._extract_license() + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include", self.name), + src=self.source_folder, + excludes="old/**") + copy(self, "*.dll", + dst=os.path.join(self.package_folder, "bin"), + src=self.build_folder, + keep_path=False) + for pattern in ["*.lib", "*.so", "*.dylib", "*.a"]: + copy(self, pattern, + dst=os.path.join(self.package_folder, "lib"), + src=self.build_folder, + keep_path=False) def package_info(self): self.cpp_info.libs = ["RectangleBinPack"] + self.cpp_info.set_property("cmake_file_name", "RectangleBinPack") + self.cpp_info.set_property("cmake_target_name", "RectangleBinPack::RectangleBinPack") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "RectangleBinPack" self.cpp_info.names["cmake_find_package_multi"] = "RectangleBinPack" diff --git a/recipes/rectanglebinpack/all/test_package/CMakeLists.txt b/recipes/rectanglebinpack/all/test_package/CMakeLists.txt index 2d0f2eeb0d7460..4147475a867bb6 100644 --- a/recipes/rectanglebinpack/all/test_package/CMakeLists.txt +++ b/recipes/rectanglebinpack/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.4) -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(RectangleBinPack REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE RectangleBinPack::RectangleBinPack) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/rectanglebinpack/all/test_package/conanfile.py b/recipes/rectanglebinpack/all/test_package/conanfile.py index 16ec9f68ef9742..ef5d7042163ecc 100644 --- a/recipes/rectanglebinpack/all/test_package/conanfile.py +++ b/recipes/rectanglebinpack/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): - 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/rectanglebinpack/all/test_package/test_package.cpp b/recipes/rectanglebinpack/all/test_package/test_package.cpp index b5c67148547b02..7a8bca93d78396 100644 --- a/recipes/rectanglebinpack/all/test_package/test_package.cpp +++ b/recipes/rectanglebinpack/all/test_package/test_package.cpp @@ -5,43 +5,38 @@ #include #include -#include #include +#include using namespace rbp; -bool AreDisjoint(const Rect &a, const Rect &b) -{ - return a.x >= b.x + b.width || a.x + a.width <= b.x || - a.y >= b.y + b.height || a.y + a.height <= b.y; +bool AreDisjoint(const Rect &a, const Rect &b) { + return a.x >= b.x + b.width || a.x + a.width <= b.x || a.y >= b.y + b.height || + a.y + a.height <= b.y; } -bool AllRectsDisjoint(std::vector &packed) -{ - for(size_t i = 0; i < packed.size(); ++i) - for(size_t j = i+1; j < packed.size(); ++j) - { - if (!AreDisjoint(packed[i], packed[j])) - return false; - } - return true; +bool AllRectsDisjoint(std::vector &packed) { + for (size_t i = 0; i < packed.size(); ++i) + for (size_t j = i + 1; j < packed.size(); ++j) { + if (!AreDisjoint(packed[i], packed[j])) + return false; + } + return true; } -int main() -{ - MaxRectsBinPack pack(256, 256, true); +int main() { + MaxRectsBinPack pack(256, 256, true); - std::vector packed; - srand(12412); - for(int i = 1; i < 128; ++i) - { - int a = (rand() % 128) + 1; - int b = (rand() % 128) + 1; - Rect r = pack.Insert(a, b, MaxRectsBinPack::RectBestShortSideFit); - if (!r.width) - break; - packed.push_back(r); - } - printf("Packed %d rectangles. All rects disjoint: %s. Occupancy: %f\n", - (int)packed.size(), AllRectsDisjoint(packed) ? "yes" : "NO!", pack.Occupancy()); + std::vector packed; + srand(12412); + for (int i = 1; i < 128; ++i) { + int a = (rand() % 128) + 1; + int b = (rand() % 128) + 1; + Rect r = pack.Insert(a, b, MaxRectsBinPack::RectBestShortSideFit); + if (!r.width) + break; + packed.push_back(r); + } + printf("Packed %d rectangles. All rects disjoint: %s. Occupancy: %f\n", (int)packed.size(), + AllRectsDisjoint(packed) ? "yes" : "NO!", pack.Occupancy()); } diff --git a/recipes/rectanglebinpack/all/test_v1_package/CMakeLists.txt b/recipes/rectanglebinpack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/rectanglebinpack/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/rectanglebinpack/all/test_v1_package/conanfile.py b/recipes/rectanglebinpack/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..90eb89e3f2f46b --- /dev/null +++ b/recipes/rectanglebinpack/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") + self.run(bin_path, run_environment=True) diff --git a/recipes/redboltz-mqtt_cpp/all/conandata.yml b/recipes/redboltz-mqtt_cpp/all/conandata.yml index ad87340ad9e356..edcba50235f7cd 100644 --- a/recipes/redboltz-mqtt_cpp/all/conandata.yml +++ b/recipes/redboltz-mqtt_cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "13.2.1": + url: "https://github.com/redboltz/mqtt_cpp/archive/v13.2.1.tar.gz" + sha256: "7607536cb7e0e4d32831ef068c48d3d62707df80ba35c5a3fdc31851e7876a9d" "13.0.0": url: "https://github.com/redboltz/mqtt_cpp/archive/refs/tags/v13.0.0.tar.gz" sha256: "5d06caa1218feb23d0a63892ced7b0edfd1f686002676175f6e384275a27a1e7" diff --git a/recipes/redboltz-mqtt_cpp/all/conanfile.py b/recipes/redboltz-mqtt_cpp/all/conanfile.py index 8fdf7f70084cf9..2b3717a2d67c0f 100644 --- a/recipes/redboltz-mqtt_cpp/all/conanfile.py +++ b/recipes/redboltz-mqtt_cpp/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import 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.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 MqttCPPConan(ConanFile): name = "redboltz-mqtt_cpp" @@ -10,50 +16,60 @@ class MqttCPPConan(ConanFile): license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/redboltz/mqtt_cpp" - topics = ("mqtt", "boost", "asio") + topics = ("mqtt", "boost", "asio", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - generators = "cmake" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - def requirements(self): - self.requires("boost/1.79.0") - - def package_id(self): - self.info.header_only() + def _min_cppstd(self): + return 14 @property def _compilers_minimum_version(self): return { "gcc": "6", - "Visual Studio": "15.0", + "Visual Studio": "15", + "msvc": "191", "clang": "5", "apple-clang": "10", } - + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.83.0") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++14, which your compiler does not support.".format(self.name)) - else: - self.output.warn("{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name)) - + 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="LICENSE_1_0.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE_1_0.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + 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.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "mqtt_cpp") self.cpp_info.set_property("cmake_target_name", "mqtt_cpp::mqtt_cpp") diff --git a/recipes/redboltz-mqtt_cpp/all/test_package/CMakeLists.txt b/recipes/redboltz-mqtt_cpp/all/test_package/CMakeLists.txt index d57b3a725b42c5..bb306edeaaa9c5 100644 --- a/recipes/redboltz-mqtt_cpp/all/test_package/CMakeLists.txt +++ b/recipes/redboltz-mqtt_cpp/all/test_package/CMakeLists.txt @@ -1,10 +1,6 @@ -cmake_minimum_required(VERSION 3.8) - +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(mqtt_cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/redboltz-mqtt_cpp/all/test_package/conanfile.py b/recipes/redboltz-mqtt_cpp/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/redboltz-mqtt_cpp/all/test_package/conanfile.py +++ b/recipes/redboltz-mqtt_cpp/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/redboltz-mqtt_cpp/all/test_package/test_package.cpp b/recipes/redboltz-mqtt_cpp/all/test_package/test_package.cpp index 65e10348b409b3..a75d73b3ececd0 100644 --- a/recipes/redboltz-mqtt_cpp/all/test_package/test_package.cpp +++ b/recipes/redboltz-mqtt_cpp/all/test_package/test_package.cpp @@ -6,7 +6,7 @@ int main() { boost::asio::io_context ioc; auto c = MQTT_NS::make_async_client(ioc, "localhost", "40000"); - + c->set_client_id("test_package"); c->set_clean_session(true); diff --git a/recipes/redboltz-mqtt_cpp/all/test_v1_package/CMakeLists.txt b/recipes/redboltz-mqtt_cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/redboltz-mqtt_cpp/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/redboltz-mqtt_cpp/all/test_v1_package/conanfile.py b/recipes/redboltz-mqtt_cpp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/redboltz-mqtt_cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/redboltz-mqtt_cpp/config.yml b/recipes/redboltz-mqtt_cpp/config.yml index ed9e26c6552eb1..3eb6ce30d67472 100644 --- a/recipes/redboltz-mqtt_cpp/config.yml +++ b/recipes/redboltz-mqtt_cpp/config.yml @@ -1,3 +1,5 @@ versions: + "13.2.1": + folder: all "13.0.0": folder: all diff --git a/recipes/redis-plus-plus/all/conanfile.py b/recipes/redis-plus-plus/all/conanfile.py index 5895ab8dac9845..d7fbaf589b20b1 100644 --- a/recipes/redis-plus-plus/all/conanfile.py +++ b/recipes/redis-plus-plus/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, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version import os @@ -64,9 +64,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("hiredis/1.1.0", transitive_headers=True, transitive_libs=True) + self.requires("hiredis/1.2.0", transitive_headers=True, transitive_libs=True) if self.options.get_safe("build_async"): - self.requires("libuv/1.46.0") + self.requires("libuv/1.47.0") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): @@ -97,18 +97,13 @@ def generate(self): tc.variables["REDIS_PLUS_PLUS_BUILD_TEST"] = False tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC"] = not self.options.shared tc.variables["REDIS_PLUS_PLUS_BUILD_SHARED"] = self.options.shared - if Version(self.version) >= "1.2.3": - tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC_WITH_PIC"] = self.options.shared + tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC_WITH_PIC"] = self.options.shared tc.generate() deps = CMakeDeps(self) deps.generate() def _patch_sources(self): apply_conandata_patches(self) - if Version(self.version) < "1.2.3": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "set_target_properties(${STATIC_LIB} PROPERTIES POSITION_INDEPENDENT_CODE ON)", - "") def build(self): self._patch_sources() diff --git a/recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch b/recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch deleted file mode 100644 index de2b4ddbe2f804..00000000000000 --- a/recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -29,6 +29,7 @@ if (REDIS_PLUS_PLUS_USE_TLS) - message(STATUS "Build with TLS support") - - set(TLS_SUB_DIR "${PROJECT_SOURCE_DIR}/tls") -+ find_package(hiredis REQUIRED hiredis_ssl CONFIG) - else() - set(TLS_SUB_DIR "${PROJECT_SOURCE_DIR}/no_tls") - endif() -@@ -36,8 +37,7 @@ endif() - file(GLOB TLS_SOURCE_FILES "${TLS_SUB_DIR}/*.cpp") - - # hiredis dependency --find_path(HIREDIS_HEADER hiredis) --find_library(HIREDIS_LIB hiredis) -+find_package(hiredis REQUIRED hiredis CONFIG) - - # Build static library - option(REDIS_PLUS_PLUS_BUILD_STATIC "Build static library" ON) -@@ -48,7 +48,7 @@ if (REDIS_PLUS_PLUS_BUILD_STATIC) - add_library(${STATIC_LIB} STATIC ${PROJECT_SOURCE_FILES} ${TLS_SOURCE_FILES}) - - target_include_directories(${STATIC_LIB} PUBLIC ${PROJECT_SOURCE_DIR} ${TLS_SUB_DIR}) -- target_include_directories(${STATIC_LIB} PUBLIC ${HIREDIS_HEADER}) -+ target_link_libraries(${STATIC_LIB} PUBLIC hiredis::hiredis) - - if (WIN32) - target_compile_definitions(${STATIC_LIB} PRIVATE NOMINMAX) -@@ -58,6 +58,10 @@ if (REDIS_PLUS_PLUS_BUILD_STATIC) - set_target_properties(${STATIC_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) - endif() - -+ if (REDIS_PLUS_PLUS_USE_TLS) -+ target_link_libraries(${STATIC_LIB} PUBLIC hiredis::hiredis_ssl) -+ endif() -+ - set_target_properties(${STATIC_LIB} PROPERTIES CLEAN_DIRECT_OUTPUT 1) - set_target_properties(${STATIC_LIB} PROPERTIES POSITION_INDEPENDENT_CODE ON) - endif() -@@ -71,7 +75,7 @@ if (REDIS_PLUS_PLUS_BUILD_SHARED) - add_library(${SHARED_LIB} SHARED ${PROJECT_SOURCE_FILES} ${TLS_SOURCE_FILES}) - - target_include_directories(${SHARED_LIB} PUBLIC ${PROJECT_SOURCE_DIR} ${TLS_SUB_DIR}) -- target_include_directories(${SHARED_LIB} PUBLIC ${HIREDIS_HEADER}) -+ target_link_libraries(${SHARED_LIB} PUBLIC hiredis::hiredis) - - if (WIN32) - target_compile_definitions(${SHARED_LIB} PRIVATE NOMINMAX) -@@ -79,11 +83,9 @@ if (REDIS_PLUS_PLUS_BUILD_SHARED) - set_target_properties(${SHARED_LIB} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) - endif() - -- target_link_libraries(${SHARED_LIB} ${HIREDIS_LIB}) - - if (REDIS_PLUS_PLUS_USE_TLS) -- find_library(HIREDIS_TLS_LIB hiredis_ssl) -- target_link_libraries(${SHARED_LIB} ${HIREDIS_TLS_LIB}) -+ target_link_libraries(${SHARED_LIB} PUBLIC hiredis::hiredis_ssl) - endif() - - set_target_properties(${SHARED_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) diff --git a/recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch b/recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch deleted file mode 100644 index d00f3b331f4abe..00000000000000 --- a/recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,10 +1,10 @@ --project(redis++) - - if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - cmake_minimum_required(VERSION 3.0.0) - else() -- cmake_minimum_required(VERSION 2.8.0) -+ cmake_minimum_required(VERSION 3.0.0) - endif() -+project(redis++) - - if (NOT DEFINED REDIS_PLUS_PLUS_CXX_STANDARD) - set(REDIS_PLUS_PLUS_CXX_STANDARD 11) diff --git a/recipes/refl-cpp/all/conanfile.py b/recipes/refl-cpp/all/conanfile.py index 7ba2308354522d..cfecdf8a0b5ec0 100644 --- a/recipes/refl-cpp/all/conanfile.py +++ b/recipes/refl-cpp/all/conanfile.py @@ -15,6 +15,7 @@ class ReflCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/veselink1/refl-cpp" topics = ("header", "header-only", "reflection", "modern", "metaprogramming") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @property @@ -43,15 +44,12 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if not min_version: - self.output.warn(f"{self.ref} recipe lacks information about the {self.settings.compiler} compiler support.") - else: - if Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd} support. " - f"The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it." - ) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + 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) diff --git a/recipes/replxx/all/conandata.yml b/recipes/replxx/all/conandata.yml index 6dce0f8a4cabd9..cc779ef163dc25 100644 --- a/recipes/replxx/all/conandata.yml +++ b/recipes/replxx/all/conandata.yml @@ -5,6 +5,14 @@ sources: "0.0.3": url: "https://github.com/AmokHuginnsson/replxx/archive/release-0.0.3.tar.gz" sha256: "72ad0655eead16544645b1724b27a988543fcefd14d46df6e8dfef17d9ba50ac" - "0.0.2": - url: "https://github.com/AmokHuginnsson/replxx/archive/release-0.0.2.tar.gz" - sha256: "6f5c58b4cd23550d5a589d134727296438793cb818ce7158fbd5e1b0db1548ba" +patches: + "0.0.4": + - patch_file: "patches/0.0.4-0001-fix-export-symbols-windows.patch" + patch_description: "Fix export of symbols for Windows" + patch_type: "portability" + patch_source: "https://github.com/AmokHuginnsson/replxx/pull/151" + "0.0.3": + - patch_file: "patches/0.0.3-0001-fix-export-symbols-windows.patch" + patch_description: "Fix export of symbols for Windows" + patch_type: "portability" + patch_source: "https://github.com/AmokHuginnsson/replxx/pull/151" diff --git a/recipes/replxx/all/conanfile.py b/recipes/replxx/all/conanfile.py index 1d287dc51fe1f8..72beed1028bdca 100644 --- a/recipes/replxx/all/conanfile.py +++ b/recipes/replxx/all/conanfile.py @@ -1,8 +1,7 @@ from conan import ConanFile -from conan.tools.files import get, copy, rmdir, replace_in_file 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.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc import os @@ -33,6 +32,9 @@ class ReplxxConan(ConanFile): def _min_cppstd(self): return 11 + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -53,17 +55,12 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["REPLXX_BuildExamples"] = False - tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["REPLXX_BUILD_EXAMPLES"] = False + tc.variables["REPLXX_BUILD_PACKAGE"] = False tc.generate() def build(self): - if Version(self.version) < "0.0.3": - replace_in_file(self, - os.path.join(self.source_folder, "src", "io.cxx"), - "#include \n", - "#include \n#include \n" - ) + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -75,18 +72,18 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "replxx") + self.cpp_info.set_property("cmake_target_name", "replxx::replxx") libname = "replxx" if is_msvc(self) and not self.options.shared: libname += "-static" if self.settings.build_type == "Debug": libname += "-d" + elif self.settings.build_type == "RelWithDebInfo": + libname += "-rd" self.cpp_info.libs = [libname] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "m"] if not self.options.shared: self.cpp_info.defines.append("REPLXX_STATIC") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "replxx" - self.cpp_info.filenames["cmake_find_package_multi"] = "replxx" diff --git a/recipes/replxx/all/patches/0.0.3-0001-fix-export-symbols-windows.patch b/recipes/replxx/all/patches/0.0.3-0001-fix-export-symbols-windows.patch new file mode 100644 index 00000000000000..752c888324f238 --- /dev/null +++ b/recipes/replxx/all/patches/0.0.3-0001-fix-export-symbols-windows.patch @@ -0,0 +1,51 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,7 +15,6 @@ if (NOT DEFINED CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) + endif() + +-set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS ON) + +@@ -77,8 +76,8 @@ target_compile_definitions( + replxx + PUBLIC + $<$>:REPLXX_STATIC> +- $<$:REPLXX_BUILDING_DLL> + PRIVATE ++ $<$:REPLXX_BUILDING_DLL> + $<$:_CRT_SECURE_NO_WARNINGS=1 /ignore:4503> + ) + target_compile_options( +--- a/include/replxx.h ++++ b/include/replxx.h +@@ -435,7 +435,7 @@ REPLXX_IMPEXP void replxx_bind_key( Replxx*, int code, key_press_handler_t handl + * \param actionName - name of internal action to be invoked on key press. + * \return -1 if invalid action name was used, 0 otherwise. + */ +-int replxx_bind_key_internal( Replxx*, int code, char const* actionName ); ++REPLXX_IMPEXP int replxx_bind_key_internal( Replxx*, int code, char const* actionName ); + + REPLXX_IMPEXP void replxx_set_preload_buffer( Replxx*, const char* preloadText ); + +@@ -552,7 +552,7 @@ REPLXX_IMPEXP int replxx_history_load( Replxx*, const char* filename ); + REPLXX_IMPEXP void replxx_history_clear( Replxx* ); + REPLXX_IMPEXP void replxx_clear_screen( Replxx* ); + #ifdef __REPLXX_DEBUG__ +-void replxx_debug_dump_print_codes(void); ++REPLXX_IMPEXP void replxx_debug_dump_print_codes(void); + #endif + /* the following is extension to the original linenoise API */ + REPLXX_IMPEXP int replxx_install_window_change_handler( Replxx* ); +--- a/include/replxx.hxx ++++ b/include/replxx.hxx +@@ -242,7 +242,7 @@ public: + } + }; + class HistoryScanImpl; +- class HistoryScan { ++ class REPLXX_IMPEXP HistoryScan { + public: + typedef std::unique_ptr impl_t; + private: diff --git a/recipes/replxx/all/patches/0.0.4-0001-fix-export-symbols-windows.patch b/recipes/replxx/all/patches/0.0.4-0001-fix-export-symbols-windows.patch new file mode 100644 index 00000000000000..12104832cd70d5 --- /dev/null +++ b/recipes/replxx/all/patches/0.0.4-0001-fix-export-symbols-windows.patch @@ -0,0 +1,151 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,7 +15,6 @@ if (NOT DEFINED CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) + endif() + +-set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS ON) + +@@ -77,8 +76,8 @@ target_compile_definitions( + replxx + PUBLIC + $<$>:REPLXX_STATIC> +- $<$:REPLXX_BUILDING_DLL> + PRIVATE ++ $<$:REPLXX_BUILDING_DLL> + $<$:_CRT_SECURE_NO_WARNINGS=1 /ignore:4503> + ) + target_compile_options( +--- a/include/replxx.h ++++ b/include/replxx.h +@@ -449,7 +449,7 @@ REPLXX_IMPEXP void replxx_bind_key( Replxx*, int code, key_press_handler_t handl + * \param actionName - name of internal action to be invoked on key press. + * \return -1 if invalid action name was used, 0 otherwise. + */ +-int replxx_bind_key_internal( Replxx*, int code, char const* actionName ); ++REPLXX_IMPEXP int replxx_bind_key_internal( Replxx*, int code, char const* actionName ); + + REPLXX_IMPEXP void replxx_set_preload_buffer( Replxx*, const char* preloadText ); + +@@ -572,7 +572,7 @@ REPLXX_IMPEXP int replxx_history_load( Replxx*, const char* filename ); + REPLXX_IMPEXP void replxx_history_clear( Replxx* ); + REPLXX_IMPEXP void replxx_clear_screen( Replxx* ); + #ifdef __REPLXX_DEBUG__ +-void replxx_debug_dump_print_codes(void); ++REPLXX_IMPEXP void replxx_debug_dump_print_codes(void); + #endif + /* the following is extension to the original linenoise API */ + REPLXX_IMPEXP int replxx_install_window_change_handler( Replxx* ); +@@ -587,35 +587,35 @@ REPLXX_IMPEXP void replxx_disable_bracketed_paste( Replxx* ); + * \param color2 - second input color. + * \return A new color definition that represent combined input colors. + */ +-ReplxxColor replxx_color_combine( ReplxxColor color1, ReplxxColor color2 ); ++REPLXX_IMPEXP ReplxxColor replxx_color_combine( ReplxxColor color1, ReplxxColor color2 ); + + /*! \brief Transform foreground color definition into a background color definition. + * + * \param color - an input foreground color definition. + * \return A background color definition that is a transformed input \e color. + */ +-ReplxxColor replxx_color_bg( ReplxxColor color ); ++REPLXX_IMPEXP ReplxxColor replxx_color_bg( ReplxxColor color ); + + /*! \brief Add `bold` attribute to color definition. + * + * \param color - an input color definition. + * \return A new color definition with bold attribute set. + */ +-ReplxxColor replxx_color_bold( ReplxxColor color ); ++REPLXX_IMPEXP ReplxxColor replxx_color_bold( ReplxxColor color ); + + /*! \brief Add `underline` attribute to color definition. + * + * \param color - an input color definition. + * \return A new color definition with underline attribute set. + */ +-ReplxxColor replxx_color_underline( ReplxxColor color ); ++REPLXX_IMPEXP ReplxxColor replxx_color_underline( ReplxxColor color ); + + /*! \brief Create a new grayscale color of given brightness level. + * + * \param level - a brightness level for new color, must be between 0 (darkest) and 23 (brightest). + * \return A new grayscale color of a given brightest \e level. + */ +-ReplxxColor replxx_color_grayscale( int level ); ++REPLXX_IMPEXP ReplxxColor replxx_color_grayscale( int level ); + + /*! \brief Create a new color in 6×6×6 RGB color space from base component levels. + * +@@ -624,7 +624,7 @@ ReplxxColor replxx_color_grayscale( int level ); + * \param blue - a blue (of RGB) component level, must be 0 and 5. + * \return A new color in 6×6×6 RGB color space. + */ +-ReplxxColor replxx_color_rgb666( int red, int green, int blue ); ++REPLXX_IMPEXP ReplxxColor replxx_color_rgb666( int red, int green, int blue ); + + #ifdef __cplusplus + } +--- a/include/replxx.hxx ++++ b/include/replxx.hxx +@@ -249,7 +249,7 @@ public: + } + }; + class HistoryScanImpl; +- class HistoryScan { ++ class REPLXX_IMPEXP HistoryScan { + public: + typedef std::unique_ptr impl_t; + private: +@@ -646,35 +646,35 @@ namespace color { + * \param color2 - second input color. + * \return A new color definition that represent combined input colors. + */ +-Replxx::Color operator | ( Replxx::Color color1, Replxx::Color color2 ); ++REPLXX_IMPEXP Replxx::Color operator | ( Replxx::Color color1, Replxx::Color color2 ); + + /*! \brief Transform foreground color definition into a background color definition. + * + * \param color - an input foreground color definition. + * \return A background color definition that is a transformed input \e color. + */ +-Replxx::Color bg( Replxx::Color color ); ++REPLXX_IMPEXP Replxx::Color bg( Replxx::Color color ); + + /*! \brief Add `bold` attribute to color definition. + * + * \param color - an input color definition. + * \return A new color definition with bold attribute set. + */ +-Replxx::Color bold( Replxx::Color color ); ++REPLXX_IMPEXP Replxx::Color bold( Replxx::Color color ); + + /*! \brief Add `underline` attribute to color definition. + * + * \param color - an input color definition. + * \return A new color definition with underline attribute set. + */ +-Replxx::Color underline( Replxx::Color color ); ++REPLXX_IMPEXP Replxx::Color underline( Replxx::Color color ); + + /*! \brief Create a new grayscale color of given brightness level. + * + * \param level - a brightness level for new color, must be between 0 (darkest) and 23 (brightest). + * \return A new grayscale color of a given brightest \e level. + */ +-Replxx::Color grayscale( int level ); ++REPLXX_IMPEXP Replxx::Color grayscale( int level ); + + /*! \brief Create a new color in 6×6×6 RGB color space from base component levels. + * +@@ -683,7 +683,7 @@ Replxx::Color grayscale( int level ); + * \param blue - a blue (of RGB) component level, must be 0 and 5. + * \return A new color in 6×6×6 RGB color space. + */ +-Replxx::Color rgb666( int red, int green, int blue ); ++REPLXX_IMPEXP Replxx::Color rgb666( int red, int green, int blue ); + + } + diff --git a/recipes/replxx/config.yml b/recipes/replxx/config.yml index 280ae0c8f55508..9579ce3b8a9cdc 100644 --- a/recipes/replxx/config.yml +++ b/recipes/replxx/config.yml @@ -3,5 +3,3 @@ versions: folder: "all" "0.0.3": folder: "all" - "0.0.2": - folder: "all" diff --git a/recipes/resource_pool/all/conanfile.py b/recipes/resource_pool/all/conanfile.py index 0e8accc6eec6ac..fc3ecee6a87611 100644 --- a/recipes/resource_pool/all/conanfile.py +++ b/recipes/resource_pool/all/conanfile.py @@ -1,32 +1,30 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from conans.tools import check_min_cppstd import os -import glob + +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 ResourcePool(ConanFile): name = "resource_pool" description = "C++ header only library purposed to create pool of some resources like keepalive connections" - topics = ("conan", "resource pool", "resource_pool", "asio", "elsid", "c++17", "cpp17") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "http://github.com/elsid/resource_pool" - license = "MIT" + topics = ("resource pool", "asio", "elsid", "c++17", "cpp17", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - requires = ( - "boost/1.75.0" - ) - generators = "cmake_find_package" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -37,44 +35,56 @@ def _compilers_minimum_version(self): "apple-clang": "10", } - def _validate_compiler_settings(self): + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + # Only compatible with Boost up to v1.79 + self.requires("boost/1.79.0") + + def package_id(self): + self.info.clear() + + def validate(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("resource_pool requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: + self.output.warning("resource_pool requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("resource_pool requires a compiler that supports at least C++17") - def validate(self): - self._validate_compiler_settings() - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob(self.name + "-*/")[0] - os.rename(extracted_dir, 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", "yamail"), src=os.path.join(self._source_subfolder, "include", "yamail")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include", "yamail"), + src=os.path.join(self.source_folder, "include", "yamail")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + main_comp = self.cpp_info.components["_resource_pool"] main_comp.requires = ["boost::boost", "boost::system", "boost::thread"] main_comp.defines = ["BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT"] - main_comp.names["cmake_find_package"] = "resource_pool" - main_comp.names["cmake_find_package_multi"] = "resource_pool" if self.settings.os == "Windows": main_comp.system_libs.append("ws2_32") - # Set up for compatibility with existing cmake configuration + # Set up for compatibility with existing cmake configuration: + # https://github.com/elsid/resource_pool/blob/3ea1f95/examples/CMakeLists.txt#L6C34-L6C54 + self.cpp_info.set_property("cmake_target_name", "elsid::resource_pool") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "resource_pool" self.cpp_info.filenames["cmake_find_package_multi"] = "resource_pool" self.cpp_info.names["cmake_find_package"] = "elsid" self.cpp_info.names["cmake_find_package_multi"] = "elsid" + main_comp.names["cmake_find_package"] = "resource_pool" + main_comp.names["cmake_find_package_multi"] = "resource_pool" diff --git a/recipes/resource_pool/all/test_package/CMakeLists.txt b/recipes/resource_pool/all/test_package/CMakeLists.txt index 6e5e189f75c43d..e10fab1825ee4a 100644 --- a/recipes/resource_pool/all/test_package/CMakeLists.txt +++ b/recipes/resource_pool/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -find_package(resource_pool REQUIRED) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(resource_pool REQUIRED CONFIG) add_executable(example coro.cc) target_compile_features(example PRIVATE cxx_std_17) diff --git a/recipes/resource_pool/all/test_package/conanfile.py b/recipes/resource_pool/all/test_package/conanfile.py index 2f970874682b04..8d52b7021efe14 100644 --- a/recipes/resource_pool/all/test_package/conanfile.py +++ b/recipes/resource_pool/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 ResourcePoolTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package", "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/resource_pool/all/test_package/coro.cc b/recipes/resource_pool/all/test_package/coro.cc index 0e0b3049487750..88ad6ceb45f485 100644 --- a/recipes/resource_pool/all/test_package/coro.cc +++ b/recipes/resource_pool/all/test_package/coro.cc @@ -7,12 +7,14 @@ using ofstream_pool = yamail::resource_pool::async::pool>; using time_traits = yamail::resource_pool::time_traits; -struct null_buffer : std::streambuf { int overflow(int c) override { return c; } } null_buf; +struct null_buffer : std::streambuf { + int overflow(int c) override { return c; } +} null_buf; int main() { boost::asio::io_context service; ofstream_pool pool(1, 10); - boost::asio::spawn(service, [&](boost::asio::yield_context yield){ + boost::asio::spawn(service, [&](boost::asio::yield_context yield) { boost::system::error_code ec; auto handle = pool.get_auto_waste(service, yield[ec], time_traits::duration::max()); if (ec) { diff --git a/recipes/resource_pool/all/test_v1_package/CMakeLists.txt b/recipes/resource_pool/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/resource_pool/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/resource_pool/all/test_v1_package/conanfile.py b/recipes/resource_pool/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..fdaba4642f464d --- /dev/null +++ b/recipes/resource_pool/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class ResourcePoolTestConan(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/restinio/all/conandata.yml b/recipes/restinio/all/conandata.yml index 8eaf747a395e36..06ced9d2281b30 100644 --- a/recipes/restinio/all/conandata.yml +++ b/recipes/restinio/all/conandata.yml @@ -1,37 +1,10 @@ sources: + "0.6.19": + url: "https://github.com/Stiffstream/restinio/archive/v.0.6.19.tar.gz" + sha256: "5a739cac8f3148e7e94f05bb08f5cf569dd31f6f3ea2b893eddfffb0a155eb52" "0.6.18": url: "https://github.com/Stiffstream/restinio/archive/v.0.6.18.tar.gz" sha256: "16fa041f4603746c6cd0f29ab126d02d220034535e7019c6ca1b8b9f58bfeee0" "0.6.17": url: "https://github.com/Stiffstream/restinio/archive/v.0.6.17.tar.gz" sha256: "0140b23f50bb964f6917d1f99205476eba92203dc586673bdf2ea48d7406f2c4" - "0.6.16": - url: "https://github.com/Stiffstream/restinio/archive/v.0.6.16.tar.gz" - sha256: "b3208d746087ba979f51b3a32e08463718c33d58720247d53ffb5bda99f4f92a" - "0.6.15": - url: "https://github.com/Stiffstream/restinio/archive/v.0.6.15.tar.gz" - sha256: "5977e7a21064a42dc690a644adc7ba03037eb4007bfbc36586faf715583967bd" - "0.6.14": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.14.tar.gz - sha256: 9742c051e7199d826697f86e6ba4a9fcb7f00c71a408b5c172134b2206404c4e - "0.6.13": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.13.tar.gz - sha256: 72d7ad40c8d34e69cd79f42145b4059e8a7356114fb13864c3c0ad5a5607b44f - "0.6.12": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.12.tar.gz - sha256: 7176d608afb8e5cd29eec2216e747be262215f5b3ab3df2b3c86e691f1cec79e - "0.6.11": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.11.tar.gz - sha256: 66c25c19efd9dc9683d60f540e9ac09b66245c5afde096fc05ec69cbb502fc5d - "0.6.10": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.10.tar.gz - sha256: dc9cad7e19f1bc255532cee53ab2027c93108c79e27f9fbe971f3ea0b10274a5 - "0.6.9": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.9.tar.gz - sha256: fcb05e15a346b4ff27757b89741289864f82f71affe61364325ce70dddefe31f - "0.6.8.1": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.8.1.tar.gz - sha256: 6a365ce645fc7188c287602886eba1a99c797e01b734f0c69bcb370b3494b54c - "0.6.8": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.8.tar.gz - sha256: 92ab0faa9f9de582df787e133acf5c10fb6ab7cecbd96c128997554d8ceda0cd diff --git a/recipes/restinio/all/conanfile.py b/recipes/restinio/all/conanfile.py index 3d82682de55784..576da558e85baf 100644 --- a/recipes/restinio/all/conanfile.py +++ b/recipes/restinio/all/conanfile.py @@ -38,38 +38,27 @@ def layout(self): def requirements(self): self.requires("http_parser/2.9.4") - - if Version(self.version) >= "0.6.16": - self.requires("fmt/10.0.0") - else: - self.requires("fmt/8.1.1") - + self.requires("fmt/10.1.1") self.requires("expected-lite/0.6.3") self.requires("optional-lite/3.5.0") self.requires("string-view-lite/1.7.0") self.requires("variant-lite/2.0.0") if self.options.asio == "standalone": - if Version(self.version) >= "0.6.9": - self.requires("asio/1.22.1") - else: - self.requires("asio/1.16.1") + self.requires("asio/1.28.1") else: - if Version(self.version) >= "0.6.9": - self.requires("boost/1.82.0") - else: - self.requires("boost/1.73.0") + 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.13") + 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.40") + self.requires("pcre2/10.42") def package_id(self): self.info.clear() diff --git a/recipes/restinio/config.yml b/recipes/restinio/config.yml index c650402f2c5030..224a43066392f5 100644 --- a/recipes/restinio/config.yml +++ b/recipes/restinio/config.yml @@ -1,25 +1,9 @@ versions: + "0.7.0": + folder: "v0.7" + "0.6.19": + folder: all "0.6.18": folder: all "0.6.17": folder: all - "0.6.16": - folder: all - "0.6.15": - folder: all - "0.6.14": - folder: all - "0.6.13": - folder: all - "0.6.12": - folder: all - "0.6.11": - folder: all - "0.6.10": - folder: all - "0.6.9": - folder: all - "0.6.8.1": - folder: all - "0.6.8": - folder: all 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/rg-etc1/all/CMakeLists.txt b/recipes/rg-etc1/all/CMakeLists.txt index 5f0b2b410ca60b..5d4d0f4829476e 100644 --- a/recipes/rg-etc1/all/CMakeLists.txt +++ b/recipes/rg-etc1/all/CMakeLists.txt @@ -1,22 +1,16 @@ cmake_minimum_required(VERSION 3.4) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup() - if(WIN32 AND BUILD_SHARED_LIBS) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() -file(GLOB SRCS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/*.cpp) -file(GLOB HDRS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/*.h) +file(GLOB SRCS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) +file(GLOB HDRS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h) add_library(rg_etc1 ${SRCS_FILES}) -target_include_directories(rg_etc1 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) +target_include_directories(rg_etc1 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) -install(TARGETS rg_etc1 - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) +include(GNUInstallDirs) +install(TARGETS rg_etc1) install(FILES ${HDRS_FILES} DESTINATION include) diff --git a/recipes/rg-etc1/all/conanfile.py b/recipes/rg-etc1/all/conanfile.py index 43c69a50b6b5c9..1a5ed53523f885 100644 --- a/recipes/rg-etc1/all/conanfile.py +++ b/recipes/rg-etc1/all/conanfile.py @@ -1,17 +1,22 @@ import os -import glob -from conans import ConanFile, CMake, tools + +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 collect_libs, copy, get, save + +required_conan_version = ">=1.53.0" class RgEtc1Conan(ConanFile): name = "rg-etc1" description = "A performant, easy to use, and high quality 4x4 pixel block packer/unpacker for the ETC1." - homepage = "https://github.com/richgel999/rg-etc1" - url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "etc1", "packer", "unpacker") license = "Zlib" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/richgel999/rg-etc1" + topics = ("etc1", "packer", "unpacker") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,53 +27,51 @@ class RgEtc1Conan(ConanFile): "fPIC": True, } - _cmake = None - - @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 = glob.glob('rg-etc1-*/')[0] - os.rename(extracted_dir, self._source_subfolder) + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): - if self.settings.os == 'Windows': + 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 _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 validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) cmake.build() def _extract_license(self): - with open(os.path.join(self._source_subfolder, "rg_etc1.h")) as f: + with open(os.path.join(self.source_folder, "rg_etc1.h")) as f: content_lines = f.readlines() license_content = [] for i in range(52, 75): license_content.append(content_lines[i][2:-1]) - tools.save("LICENSE", "\n".join(license_content)) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), "\n".join(license_content)) def package(self): - cmake = self._configure_cmake() - cmake.install() self._extract_license() - self.copy(pattern="LICENSE", dst="licenses") + cmake = CMake(self) + cmake.install() def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["rg_etc1"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/rg-etc1/all/test_package/CMakeLists.txt b/recipes/rg-etc1/all/test_package/CMakeLists.txt index 196188113685c8..249e96fb582fbf 100644 --- a/recipes/rg-etc1/all/test_package/CMakeLists.txt +++ b/recipes/rg-etc1/all/test_package/CMakeLists.txt @@ -1,8 +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(rg-etc1 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE rg-etc1::rg-etc1) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rg-etc1/all/test_package/conanfile.py b/recipes/rg-etc1/all/test_package/conanfile.py index bd7165a553cf41..ef5d7042163ecc 100644 --- a/recipes/rg-etc1/all/test_package/conanfile.py +++ b/recipes/rg-etc1/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" + 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/rg-etc1/all/test_v1_package/CMakeLists.txt b/recipes/rg-etc1/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/rg-etc1/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/rg-etc1/all/test_v1_package/conanfile.py b/recipes/rg-etc1/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7e2dfe859bb27b --- /dev/null +++ b/recipes/rg-etc1/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rgbcx/all/conanfile.py b/recipes/rgbcx/all/conanfile.py index 62f3ee9f485a55..2978797a9067e4 100644 --- a/recipes/rgbcx/all/conanfile.py +++ b/recipes/rgbcx/all/conanfile.py @@ -1,34 +1,53 @@ import os -import glob -from conans import ConanFile, tools + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, replace_in_file +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class RgbcxConan(ConanFile): name = "rgbcx" description = "High-performance scalar BC1-5 encoders." - homepage = "https://github.com/richgel999/bc7enc" + license = ("MIT", "Unlicense") url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "BC1", "BC5", "BCx", "encoding") - license = "MIT", "Unlicense" + homepage = "https://github.com/richgel999/bc7enc" + topics = ("BC1", "BC5", "BCx", "encoding", "header-only") + + 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 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob('bc7enc-*/')[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "rgbcx.h"), - "#include ", - "#include \n#include ") + replace_in_file(self, + os.path.join(self.source_folder, "rgbcx.h"), + "#include ", + "#include \n#include ") def package(self): - self.copy("rgbcx.h", dst="include", src=self._source_subfolder) - self.copy("rgbcx_table4.h", dst="include", src=self._source_subfolder) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "rgbcx.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "rgbcx_table4.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/rgbcx/all/test_package/CMakeLists.txt b/recipes/rgbcx/all/test_package/CMakeLists.txt index 454c47bb2cbab0..e86d42248fffd9 100644 --- a/recipes/rgbcx/all/test_package/CMakeLists.txt +++ b/recipes/rgbcx/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() +find_package(rgbcx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE rgbcx::rgbcx) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/rgbcx/all/test_package/conanfile.py b/recipes/rgbcx/all/test_package/conanfile.py index be0a94674e5bdf..ef5d7042163ecc 100644 --- a/recipes/rgbcx/all/test_package/conanfile.py +++ b/recipes/rgbcx/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 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): - 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/rgbcx/all/test_package/test_package.cpp b/recipes/rgbcx/all/test_package/test_package.cpp index 136968a37d7d17..c4faf6d5e5b499 100644 --- a/recipes/rgbcx/all/test_package/test_package.cpp +++ b/recipes/rgbcx/all/test_package/test_package.cpp @@ -1,3 +1,6 @@ +// Workaround for a missing math.h include in rgbcx.h +#include + #define RGBCX_IMPLEMENTATION #include "rgbcx.h" diff --git a/recipes/rgbcx/all/test_v1_package/CMakeLists.txt b/recipes/rgbcx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/rgbcx/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/rgbcx/all/test_v1_package/conanfile.py b/recipes/rgbcx/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..f96c48347ffda3 --- /dev/null +++ b/recipes/rgbcx/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conan.tools.build import can_run +from conans import ConanFile, CMake + + +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 can_run(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) 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 e26f0a417c73ce..d4d90409ecc54e 100644 --- a/recipes/roaring/all/conandata.yml +++ b/recipes/roaring/all/conandata.yml @@ -1,4 +1,10 @@ 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" "1.3.0": url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.3.0.tar.gz" sha256: "c4fccf6a8cfa6f15f47d0e6f6b202940c2305e3078eb745d25fe9e2739ae5278" @@ -17,36 +23,9 @@ sources: "0.9.9": url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.9.tar.gz" sha256: "3083bcbc37e43403111c482ddf317a710972256c23bc83abc8925803a02bdf60" - "0.9.8": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.8.tar.gz" - sha256: "d83ea18ded541a49f792951a6e71cd20136171ca0a4c15c77ec5cd5b83ca8e63" - "0.9.6": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.6.tar.gz" - sha256: "6d410750eb4ce70db2fa3dc25b7bc33fd4a91a85ef7dff595200d0acef99b1ee" - "0.9.3": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.3.tar.gz" - sha256: "b7534adebf50a554e86b81a2b39459c9921c504e9a876abe00bd741d0a4bc85d" - "0.9.0": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.0.tar.gz" - sha256: "52c1f56e1f84ffb9ff6cb90fd1d23cfe04926f696ae57e796d0b056fff572693" "0.8.1": url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.8.1.tar.gz" sha256: "5359f2a051f10e42cea5edc3cb3650fd272e9125e6a0538901cf30619939d4f8" - "0.8.0": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.8.0.tar.gz" - sha256: "cd6c4770baccfea385c0c6891a8a80133ba26093209740ca0a3eea348aff1a20" "0.7.3": url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.7.3.tar.gz" sha256: "e3f8115ba44ef0e1eb7b982dc3c3233f08f5f95ec1260169c2ad0ca50e56b656" - "0.6.0": - url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v0.6.0.tar.gz" - sha256: "b8e2499ca9ac6ba0d18dbbcde4bae3752acf81f08ea6309ea2a88d27972dffcf" - "0.5.0": - url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v0.5.0.tar.gz" - sha256: "edab1b1a464e5a361ff622dc833170b2f33729c161aee4c2e53a324ac62ef78f" - "0.4.0": - url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v0.4.0.tar.gz" - sha256: "0faf6ac893694d5c283a729373af74f813989ef0257781636ac4c397b48c1219" - "0.3.4": - url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v0.3.4.tar.gz" - sha256: "ddc5899823c46707d7dbf4e4c117a811b0428bdcb84978d9e65ceaefe6f59595" diff --git a/recipes/roaring/all/conanfile.py b/recipes/roaring/all/conanfile.py index 485a7146b02ba0..f0d51742149de0 100644 --- a/recipes/roaring/all/conanfile.py +++ b/recipes/roaring/all/conanfile.py @@ -22,6 +22,7 @@ class RoaringConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_avx": [True, False], + "with_avx512": [True, False], "with_neon": [True, False], "native_optimization": [True, False], } @@ -29,15 +30,23 @@ class RoaringConan(ConanFile): "shared": False, "fPIC": True, "with_avx": True, + "with_avx512": True, "with_neon": True, "native_optimization": False, } + @property + def _min_cppstd(self): + return 11 + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC if self.settings.arch not in ("x86", "x86_64"): del self.options.with_avx + del self.options.with_avx512 + elif Version(self.version) < "1.1.0": + del self.options.with_avx512 if not str(self.settings.arch).startswith("arm"): del self.options.with_neon @@ -50,7 +59,7 @@ def layout(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, "11") + check_min_cppstd(self, self._min_cppstd) if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "11": raise ConanInvalidConfiguration( f"{self.ref} requires at least apple-clang 11 to support runtime dispatching.", @@ -62,6 +71,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["ROARING_DISABLE_AVX"] = not self.options.get_safe("with_avx", False) + if "with_avx512" in self.options: + tc.variables["ROARING_DISABLE_AVX512"] = not self.options.with_avx512 tc.variables["ROARING_DISABLE_NEON"] = not self.options.get_safe("with_neon", False) tc.variables["ROARING_DISABLE_NATIVE"] = not self.options.native_optimization tc.variables["ROARING_BUILD_STATIC"] = not self.options.shared @@ -71,7 +82,8 @@ def generate(self): tc.generate() def build(self): - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_MACOSX_RPATH OFF)", "") + if Version(self.version) < "2.0.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_MACOSX_RPATH OFF)", "") cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/roaring/all/test_package/CMakeLists.txt b/recipes/roaring/all/test_package/CMakeLists.txt index 60d328135f9263..6e9e7fadde2653 100644 --- a/recipes/roaring/all/test_package/CMakeLists.txt +++ b/recipes/roaring/all/test_package/CMakeLists.txt @@ -6,6 +6,3 @@ find_package(roaring REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE roaring::roaring) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -if(roaring_VERSION VERSION_LESS "0.3.0") - target_compile_definitions(${PROJECT_NAME} PRIVATE "ROARING_NO_NAMESPACE") -endif() diff --git a/recipes/roaring/all/test_package/test_package.cpp b/recipes/roaring/all/test_package/test_package.cpp index 456ab7f7990a4e..18169725770ed6 100644 --- a/recipes/roaring/all/test_package/test_package.cpp +++ b/recipes/roaring/all/test_package/test_package.cpp @@ -5,9 +5,7 @@ #include "roaring/roaring.hh" #include "roaring/roaring.h" -#ifndef ROARING_NO_NAMESPACE using namespace roaring; -#endif void test_example_cpp(bool copy_on_write) { // create a new empty bitmap diff --git a/recipes/roaring/config.yml b/recipes/roaring/config.yml index 4dee57cf2ee127..e36bb7126c070e 100644 --- a/recipes/roaring/config.yml +++ b/recipes/roaring/config.yml @@ -1,4 +1,8 @@ versions: + "2.0.4": + folder: all + "2.0.2": + folder: all "1.3.0": folder: all "1.1.5": @@ -11,25 +15,7 @@ versions: folder: all "0.9.9": folder: all - "0.9.8": - folder: all - "0.9.6": - folder: all - "0.9.3": - folder: all - "0.9.0": - folder: all "0.8.1": folder: all - "0.8.0": - folder: all "0.7.3": folder: all - "0.6.0": - folder: all - "0.5.0": - folder: all - "0.4.0": - folder: all - "0.3.4": - folder: all 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/rpclib/all/CMakeLists.txt b/recipes/rpclib/all/CMakeLists.txt deleted file mode 100644 index de7e444eb2469a..00000000000000 --- a/recipes/rpclib/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) - -conan_basic_setup() -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory("source_subfolder") diff --git a/recipes/rpclib/all/conandata.yml b/recipes/rpclib/all/conandata.yml index 696b41e86b171b..d7b9eea3bb30c6 100644 --- a/recipes/rpclib/all/conandata.yml +++ b/recipes/rpclib/all/conandata.yml @@ -2,3 +2,9 @@ sources: "2.3.0": url: "https://github.com/rpclib/rpclib/archive/refs/tags/v2.3.0.tar.gz" sha256: "eb9e6fa65e1a79b37097397f60599b93cb443d304fbc0447c50851bc3452fdef" +patches: + "2.3.0": + - patch_file: "patches/2.3.0-0001-win-link-winsock.patch" + patch_description: "Link to mswsock and ws2_32 if windows" + patch_type: "portability" + patch_source: "https://github.com/rpclib/rpclib/pull/287" diff --git a/recipes/rpclib/all/conanfile.py b/recipes/rpclib/all/conanfile.py index 30a8488efd8a1f..111d6614af1bee 100644 --- a/recipes/rpclib/all/conanfile.py +++ b/recipes/rpclib/all/conanfile.py @@ -1,37 +1,39 @@ -from conans import ConanFile, tools, CMake -from conan.tools.microsoft import msvc_runtime_flag import os -required_conan_version = ">=1.43.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, mkdir, rename, rmdir +from conan.tools.microsoft import is_msvc_static_runtime + +required_conan_version = ">=1.53.0" class rpclibConan(ConanFile): name = "rpclib" description = "A modern C++ msgpack-RPC server and client library." license = "MIT" - topics = ("rpc", "ipc", "rpc-server") - homepage = "https://github.com/rpclib/rpclib/" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/*"] - generators = "cmake" + homepage = "https://github.com/rpclib/rpclib/" + topics = ("rpc", "ipc", "rpc-server") + + 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 + "fPIC": True, } - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "11" - @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": @@ -39,49 +41,60 @@ 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.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) 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) + if is_msvc_static_runtime(self): + tc.variables["RPCLIB_MSVC_STATIC_RUNTIME"] = True + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - 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) - if "MT" in str(msvc_runtime_flag(self)): - self._cmake.definitions["RPCLIB_MSVC_STATIC_RUNTIME"] = True - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def package(self): - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.md", + 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 self.options.shared: + mkdir(self, self.package_path / "bin") + for dll in (self.package_path / "lib").glob("*.dll"): + rename(self, dll, self.package_path / "bin" / dll.name) def package_info(self): self.cpp_info.set_property("cmake_file_name", "rpclib") self.cpp_info.set_property("cmake_target_name", "rpclib::rpc") self.cpp_info.set_property("pkg_config_name", "rpclib") - # Fix for installing dll to lib folder - # - Default CMAKE installs the dll to the lib folder - # causing the test_package to fail - if self.settings.os in ["Windows"]: - if self.options.shared: - self.cpp_info.components["_rpc"].bindirs.append( - os.path.join(self.package_folder, "lib")) + # TODO: back to global scope after Conan 2.0 + self.cpp_info.components["_rpc"].libs = ["rpc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_rpc"].system_libs.extend(["m", "pthread"]) + elif self.settings.os == "Windows": + self.cpp_info.components["_rpc"].system_libs.extend(["mswsock", "ws2_32"]) # TODO: Remove after Conan 2.0 self.cpp_info.components["_rpc"].names["cmake_find_package"] = "rpc" self.cpp_info.components["_rpc"].names["cmake_find_package_multi"] = "rpc" - self.cpp_info.components["_rpc"].libs = ["rpc"] - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["_rpc"].system_libs = ["pthread"] - self.cpp_info.names["pkg_config"] = "librpc" + self.cpp_info.components["_rpc"].set_property("cmake_target_name", "rpclib::rpc") + self.cpp_info.components["_rpc"].set_property("pkg_config_name", "rpclib") diff --git a/recipes/rpclib/all/patches/2.3.0-0001-win-link-winsock.patch b/recipes/rpclib/all/patches/2.3.0-0001-win-link-winsock.patch new file mode 100644 index 00000000000000..47ffb5454d1b33 --- /dev/null +++ b/recipes/rpclib/all/patches/2.3.0-0001-win-link-winsock.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -167,6 +167,9 @@ if(RPCLIB_COMPILE_DEFINITIONS) + endif() + + target_link_libraries(${PROJECT_NAME} ${RPCLIB_DEP_LIBRARIES}) ++if (WIN32) ++ target_link_libraries(${PROJECT_NAME} mswsock ws2_32) ++endif() + target_include_directories( + ${PROJECT_NAME} PUBLIC + $ diff --git a/recipes/rpclib/all/test_package/CMakeLists.txt b/recipes/rpclib/all/test_package/CMakeLists.txt index e585430312fe02..6ea9e950e13d6a 100644 --- a/recipes/rpclib/all/test_package/CMakeLists.txt +++ b/recipes/rpclib/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1.3) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(rpclib REQUIRED CONFIG) -find_package(rpclib CONFIG REQUIRED) - -add_executable(example example.cpp) -set_target_properties(example PROPERTIES CXX_STANDARD 14) -target_link_libraries(example rpclib::rpc) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rpclib::rpc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rpclib/all/test_package/conanfile.py b/recipes/rpclib/all/test_package/conanfile.py index 67c12602a84f3a..3a91c9439218e3 100644 --- a/recipes/rpclib/all/test_package/conanfile.py +++ b/recipes/rpclib/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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -11,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, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/rpclib/all/test_package/example.cpp b/recipes/rpclib/all/test_package/test_package.cpp similarity index 100% rename from recipes/rpclib/all/test_package/example.cpp rename to recipes/rpclib/all/test_package/test_package.cpp diff --git a/recipes/rpclib/all/test_v1_package/CMakeLists.txt b/recipes/rpclib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/rpclib/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/rpclib/all/test_v1_package/conanfile.py b/recipes/rpclib/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..d2f62e670fcd21 --- /dev/null +++ b/recipes/rpclib/all/test_v1_package/conanfile.py @@ -0,0 +1,15 @@ +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): + self.run( os.path.join("bin", "test_package"), run_environment=True ) diff --git a/recipes/rsync/all/conandata.yml b/recipes/rsync/all/conandata.yml new file mode 100644 index 00000000000000..a7d6fc86710c87 --- /dev/null +++ b/recipes/rsync/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.2.7": + url: "https://download.samba.org/pub/rsync/src/rsync-3.2.7.tar.gz" + sha256: "4e7d9d3f6ed10878c58c5fb724a67dacf4b6aac7340b13e488fb2dc41346f2bb" diff --git a/recipes/rsync/all/conanfile.py b/recipes/rsync/all/conanfile.py new file mode 100644 index 00000000000000..c1c2765fe7084d --- /dev/null +++ b/recipes/rsync/all/conanfile.py @@ -0,0 +1,114 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.files import copy, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.apple import is_apple_os +import os + +required_conan_version = ">=1.60.0" + +class RsyncConan(ConanFile): + name = "rsync" + description = "rsync is an open source utility that provides fast incremental file transfer" + topics = ("backup", "transferring", "file-transfer", "ssh", "compression") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://rsync.samba.org/" + license = ("GPL-3.0", "LGPL-3.0") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + options = { + "with_zlib": [True, False], + "with_openssl": [True, False], + "with_zstd": [True, False], + "with_xxhash": [True, False], + "with_lz4": [True, False], + "enable_acl": [True, False] + } + default_options = { + "with_zlib": True, + "with_openssl": True, + "with_zstd": True, + "with_xxhash": True, + "with_lz4": True, + "enable_acl": False + } + + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package_id(self): + del self.info.settings.compiler + + def requirements(self): + 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_zstd: + self.requires("zstd/1.5.5") + + if self.options.with_lz4: + self.requires("lz4/1.9.2") + + if self.options.with_xxhash: + self.requires("xxhash/0.8.1") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows.") + + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Apple systems.") + + def generate(self): + ad = AutotoolsDeps(self) + ad.generate() + + yes_no = lambda v: "yes" if v else "no" + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + f"--enable-acl-support={yes_no(self.options.enable_acl)}", + f"--with-included-zlib={yes_no(not self.options.with_zlib)}", + "--disable-openssl" if not self.options.with_openssl else "--enable-openssl", + f"--with-zstd={yes_no(self.options.with_zstd)}", + f"--with-lz4={yes_no(self.options.with_lz4)}", + f"--with-xxhash={yes_no(self.options.with_xxhash)}", + + "--enable-manpages=no", + ]) + + if self.settings.os == "Neutrino": + tc.extra_defines.append("MAKEDEV_TAKES_3_ARGS") + + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + + rmdir(self, os.path.join(self.package_folder, "share")) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), ignore_case=True) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # TODO: Remove after dropping Conan 1.x from ConanCenterIndex + bindir = os.path.join(self.package_folder, "bin") + self.runenv_info.prepend_path("PATH", bindir) diff --git a/recipes/rsync/all/test_package/conanfile.py b/recipes/rsync/all/test_package/conanfile.py new file mode 100644 index 00000000000000..92140298fe3402 --- /dev/null +++ b/recipes/rsync/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + if not can_run(self): + return + + self.run("rsync --version", env="conanrun") diff --git a/recipes/rsync/config.yml b/recipes/rsync/config.yml new file mode 100644 index 00000000000000..115b04e9ac7796 --- /dev/null +++ b/recipes/rsync/config.yml @@ -0,0 +1,3 @@ +versions: + "3.2.7": + folder: all diff --git a/recipes/rtklib/all/CMakeLists.txt b/recipes/rtklib/all/CMakeLists.txt new file mode 100644 index 00000000000000..6f87c0e328a597 --- /dev/null +++ b/recipes/rtklib/all/CMakeLists.txt @@ -0,0 +1,38 @@ +# Based largely on https://github.com/tomojitakasu/RTKLIB/blob/v2.4.3-b34/app/consapp/rnx2rtkp/gcc/makefile +cmake_minimum_required(VERSION 3.15) +project(rtklib C) + +if (NOT MSVC) + add_compile_options(-ansi $<$>:-O3>) +# add_compile_options(-Wall -pedantic) +# if (GCC) +# add_compile_options(-Wno-unused-but-set-variable) +# endif() +else() + add_compile_options( /D_CRT_SECURE_NO_WARNINGS $<$>:/O2>) +# add_compile_options(/W4) +endif() + +if (APPLE) + # Allow extern functions (showmsg(), settspan() and settime()) to be found at runtime + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup") +endif() + +file(GLOB_RECURSE RTKLIB_SOURCES "src/*.c") + +find_package(Threads REQUIRED) + +add_library(rtklib ${RTKLIB_SOURCES}) +target_include_directories(rtklib PUBLIC src) +target_link_libraries(rtklib PUBLIC Threads::Threads) + +if (WIN32) + target_link_libraries(rtklib PRIVATE + ws2_32 # sockets + winmm # timeGetTime() + ) +endif() + +include(GNUInstallDirs) +install(TARGETS rtklib) +install(FILES src/rtklib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/rtklib/all/conandata.yml b/recipes/rtklib/all/conandata.yml new file mode 100644 index 00000000000000..7dc67f1d1ed6dc --- /dev/null +++ b/recipes/rtklib/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.4.3-b34": + url: "https://github.com/tomojitakasu/RTKLIB/archive/refs/tags/v2.4.3-b34.tar.gz" + sha256: "a9ce13293ef71b028036cb98a114b9bba96bdd439a0aeebca8e9c73156e461cf" +patches: + "2.4.3-b34": + - patch_file: "patches/fix-dll-export-of-global-vars.patch" + patch_description: "Fix missing EXPORT attributes on global variables required for shared Windows builds" + patch_type: "portability" diff --git a/recipes/rtklib/all/conanfile.py b/recipes/rtklib/all/conanfile.py new file mode 100644 index 00000000000000..ea091707cc7ee7 --- /dev/null +++ b/recipes/rtklib/all/conanfile.py @@ -0,0 +1,138 @@ +import os + +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches + +required_conan_version = ">=1.53.0" + + +class RtklibConan(ConanFile): + name = "rtklib" + description = "Library for standard and precise positioning with GNSS" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tomojitakasu/RTKLIB" + topics = ("gnss", "rtk", "ppp", "rinex", "rtcm", "ublox", "novatel", "septentrio") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "trace": [True, False], + "enable_glonass": [True, False], + "enable_qzss": [True, False], + "enable_galileo": [True, False], + "enable_beidou": [True, False], + "enable_irnss": [True, False], + "num_frequencies": ["ANY"], + "num_ext_obs_codes": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "trace": False, + "enable_glonass": True, + "enable_qzss": True, + "enable_galileo": True, + "enable_beidou": True, + "enable_irnss": True, + "num_frequencies": 5, + "num_ext_obs_codes": 3, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", + src=self.recipe_folder, + dst=os.path.join(self.export_sources_folder, "src")) + 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") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _public_defines(self): + # Values used in the public header + # https://github.com/tomojitakasu/RTKLIB/blob/v2.4.3-b34/src/rtklib.h#L6-L15 + # Default values are based on + # https://github.com/tomojitakasu/RTKLIB/blob/v2.4.3-b34/app/consapp/rnx2rtkp/gcc/makefile#L5 + # https://github.com/tomojitakasu/RTKLIB/blob/v2.4.3-b34/app/consapp/convbin/gcc/makefile#L10 + defs = {} + defs["ENAGLO"] = self.options.enable_glonass + defs["ENAQZS"] = self.options.enable_qzss + defs["ENAGAL"] = self.options.enable_galileo + defs["ENACMP"] = self.options.enable_beidou + defs["ENAIRN"] = self.options.enable_irnss + defs["NFREQ"] = str(self.options.num_frequencies) + defs["NEXOBS"] = str(self.options.num_ext_obs_codes) + defs["WIN32"] = self.settings.os == "Windows" + defs["WIN_DLL"] = self.settings.os == "Windows" and self.options.shared + return defs + + def generate(self): + tc = CMakeToolchain(self) + defs = self._public_defines + defs["TRACE"] = self.options.trace + # TODO: add as options and set libraries correctly + defs["LAPACK"] = False + defs["MKL"] = False + # Set default values + defs["SVR_REUSEADDR"] = True # reuse tcp server address + defs["NOCALLOC"] = False # use calloc for zero matrix + defs["CPUTIME_IN_GPST"] = False # cputime operated in gpst + defs["RRCENA"] = False # enable rrc correction + defs["OUTSTAT_AMB"] = False # output ambiguity parameters to solution status + defs["IERS_MODEL"] = False # use IERS tide model + if is_apple_os(self): + # Add baud rates missing from termios.h for stream.c + defs["B460800"] = 460800 + defs["B921600"] = 921600 + for k, v in defs.items(): + if type(v) in (str, int): + tc.preprocessor_definitions[k] = v + elif v: + tc.preprocessor_definitions[k] = "" + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", + 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 = ["rtklib"] + + for k, v in self._public_defines.items(): + if type(v) in (str, int): + self.cpp_info.defines.append(f"{k}={v}") + elif v: + self.cpp_info.defines.append(k) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread", "rt"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "winmm"] diff --git a/recipes/rtklib/all/patches/fix-dll-export-of-global-vars.patch b/recipes/rtklib/all/patches/fix-dll-export-of-global-vars.patch new file mode 100644 index 00000000000000..f52bd22d8d75b6 --- /dev/null +++ b/recipes/rtklib/all/patches/fix-dll-export-of-global-vars.patch @@ -0,0 +1,23 @@ +--- src/rtklib.h ++++ src/rtklib.h +@@ -1293,13 +1293,13 @@ + typedef void fatalfunc_t(const char *); /* fatal callback function type */ + + /* global variables ----------------------------------------------------------*/ +-extern const double chisqr[]; /* chi-sqr(n) table (alpha=0.001) */ +-extern const prcopt_t prcopt_default; /* default positioning options */ +-extern const solopt_t solopt_default; /* default solution output options */ +-extern const sbsigpband_t igpband1[9][8]; /* SBAS IGP band 0-8 */ +-extern const sbsigpband_t igpband2[2][5]; /* SBAS IGP band 9-10 */ +-extern const char *formatstrs[]; /* stream format strings */ +-extern opt_t sysopts[]; /* system options table */ ++EXPORT extern const double chisqr[]; /* chi-sqr(n) table (alpha=0.001) */ ++EXPORT extern const prcopt_t prcopt_default; /* default positioning options */ ++EXPORT extern const solopt_t solopt_default; /* default solution output options */ ++EXPORT extern const sbsigpband_t igpband1[9][8]; /* SBAS IGP band 0-8 */ ++EXPORT extern const sbsigpband_t igpband2[2][5]; /* SBAS IGP band 9-10 */ ++EXPORT extern const char *formatstrs[]; /* stream format strings */ ++EXPORT extern opt_t sysopts[]; /* system options table */ + + /* satellites, systems, codes functions --------------------------------------*/ + EXPORT int satno (int sys, int prn); diff --git a/recipes/rtklib/all/test_package/CMakeLists.txt b/recipes/rtklib/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..326ac56093a5ed --- /dev/null +++ b/recipes/rtklib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(rtklib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rtklib::rtklib) diff --git a/recipes/rtklib/all/test_package/conanfile.py b/recipes/rtklib/all/test_package/conanfile.py new file mode 100644 index 00000000000000..02eb5ce439fb40 --- /dev/null +++ b/recipes/rtklib/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 + + +# It will become the standard on Conan 2.x +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/rtklib/all/test_package/test_package.cpp b/recipes/rtklib/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..51c8582d96563a --- /dev/null +++ b/recipes/rtklib/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#undef lock + +#include +#include + +// Extern functions meant to be defined by the user +extern int showmsg(const char *format, ...) { return 0; } +extern void settspan(gtime_t ts, gtime_t te) {} +extern void settime(gtime_t time) {} + +int main() { + int week = 0; + double sec = time2gpst(timeget(), &week); + std::cout << "Current GPS time: week " << week << ", " << sec << " seconds of week" + << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/rtklib/config.yml b/recipes/rtklib/config.yml new file mode 100644 index 00000000000000..8faa0eba5645fc --- /dev/null +++ b/recipes/rtklib/config.yml @@ -0,0 +1,3 @@ +versions: + "2.4.3-b34": + folder: all diff --git a/recipes/rtm/all/conandata.yml b/recipes/rtm/all/conandata.yml index 09d3d16ab4076f..97395fe668a679 100644 --- a/recipes/rtm/all/conandata.yml +++ b/recipes/rtm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://github.com/nfrechette/rtm/archive/v2.2.0.tar.gz" + sha256: "e627c46de1895b78eee63612ce4e5ade3af28e040edab6ec6f6521366b4e8b9b" "2.1.5": url: "https://github.com/nfrechette/rtm/archive/v2.1.5.tar.gz" sha256: "afb05cb00b59498756ca197028de291a1960e58d5f6fcad161d8240682481eae" diff --git a/recipes/rtm/config.yml b/recipes/rtm/config.yml index 891ce064b3b749..43718a82a0e636 100644 --- a/recipes/rtm/config.yml +++ b/recipes/rtm/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.0": + folder: "all" "2.1.5": folder: "all" "2.1.4": diff --git a/recipes/rtmidi/all/conandata.yml b/recipes/rtmidi/all/conandata.yml index 53cfe6b1111673..7f688e03dcce49 100644 --- a/recipes/rtmidi/all/conandata.yml +++ b/recipes/rtmidi/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.0.0": + url: "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-6.0.0.tar.gz" + sha256: "5960ccf64b42c23400720ccc880e2f205677ce9457f747ef758b598acd64db5b" "5.0.0": url: "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz" sha256: "48db0ed58c8c0e207b5d7327a0210b5bcaeb50e26387935d02829239b0f3c2b9" @@ -8,7 +11,14 @@ sources: patches: "4.0.0": - patch_file: "patches/4.0.0-0001-add-a-separate-licence-file-0b5d67c.patch" + patch_description: "Add a separate LICENCE file" + patch_source: "https://github.com/thestk/rtmidi/commit/0b5d67c" + patch_type: "conan" - patch_file: "patches/4.0.0-0002-rtmidiconfig-install-location-da51f21.patch" + patch_description: "Install rtmidiconfig in the correct location" + patch_source: "https://github.com/conan-io/conan-center-index/issues/252" + patch_type: "conan" - patch_file: "patches/4.0.0-0003-relocatable-macos.patch" patch_description: "Relocatable shared lib on macOS" + patch_source: "https://github.com/thestk/rtmidi/pull/211" patch_type: "conan" diff --git a/recipes/rtmidi/all/conanfile.py b/recipes/rtmidi/all/conanfile.py index a347f4bbefb6f8..c7428d77073361 100644 --- a/recipes/rtmidi/all/conanfile.py +++ b/recipes/rtmidi/all/conanfile.py @@ -46,7 +46,10 @@ def layout(self): def requirements(self): if self._with_alsa: - self.requires("libalsa/1.2.7.2") + self.requires("libalsa/1.2.10") + + 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) @@ -60,7 +63,8 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "${ALSA_LIBRARY}", "ALSA::ALSA") + if Version(self.version) < "6.0.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "${ALSA_LIBRARY}", "ALSA::ALSA") def build(self): self._patch_sources() diff --git a/recipes/rtmidi/config.yml b/recipes/rtmidi/config.yml index 30e9497f54064e..f7c2ad14131bca 100644 --- a/recipes/rtmidi/config.yml +++ b/recipes/rtmidi/config.yml @@ -1,4 +1,6 @@ versions: + "6.0.0": + folder: "all" "5.0.0": folder: "all" "4.0.0": diff --git a/recipes/rvo2/all/CMakeLists.txt b/recipes/rvo2/all/CMakeLists.txt deleted file mode 100644 index 4e4f66d9ee7ef2..00000000000000 --- a/recipes/rvo2/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() - -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/rvo2/all/conanfile.py b/recipes/rvo2/all/conanfile.py index c7ee9cc9e46889..f5f8524c916a7b 100644 --- a/recipes/rvo2/all/conanfile.py +++ b/recipes/rvo2/all/conanfile.py @@ -1,16 +1,23 @@ import os -from conans import ConanFile, tools, CMake + +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file + +required_conan_version = ">=1.53.0" class Rvo2Conan(ConanFile): name = "rvo2" description = "Optimal Reciprocal Collision Avoidance" - topics = ("conan", "collision", "avoidance", ) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/snape/RVO2" - license = "Apache-2.0" + topics = ("collision", "avoidance") - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -20,55 +27,51 @@ class Rvo2Conan(ConanFile): "fPIC": True, } - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - - _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 source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "RVO2-{}".format(self.version) - os.rename(extracted_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.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() def _patch_sources(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "add_subdirectory(examples)", - "") - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "DESTINATION include", - "DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}") - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "RVO DESTINATION lib", - "RVO RUNTIME LIBRARY ARCHIVE") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(examples)", "") + replace_in_file( + self, + os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "DESTINATION include", + "DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}", + ) + replace_in_file( + self, + os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "RVO DESTINATION lib", + "RVO RUNTIME LIBRARY ARCHIVE", + ) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", src=os.path.join(self.source_folder, 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() + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["RVO"] diff --git a/recipes/rvo2/all/test_package/CMakeLists.txt b/recipes/rvo2/all/test_package/CMakeLists.txt index 196188113685c8..17ebed2c5661da 100644 --- a/recipes/rvo2/all/test_package/CMakeLists.txt +++ b/recipes/rvo2/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -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(rvo2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE rvo2::rvo2) diff --git a/recipes/rvo2/all/test_package/conanfile.py b/recipes/rvo2/all/test_package/conanfile.py index bd7165a553cf41..ef5d7042163ecc 100644 --- a/recipes/rvo2/all/test_package/conanfile.py +++ b/recipes/rvo2/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" + 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/rvo2/all/test_v1_package/CMakeLists.txt b/recipes/rvo2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/rvo2/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/rvo2/all/test_v1_package/conanfile.py b/recipes/rvo2/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7e2dfe859bb27b --- /dev/null +++ b/recipes/rvo2/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/s2geometry/all/conandata.yml b/recipes/s2geometry/all/conandata.yml new file mode 100644 index 00000000000000..2320f21a27e4cf --- /dev/null +++ b/recipes/s2geometry/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.10.0": + url: "https://github.com/google/s2geometry/archive/refs/tags/v0.10.0.tar.gz" + sha256: "1c17b04f1ea20ed09a67a83151ddd5d8529716f509dde49a8190618d70532a3d" +patches: + "0.10.0": + - patch_description: "Bump CMAKE_CXX_STANDARD to 14" + patch_file: "patches/bump_cmake_cxx_standard.patch" + patch_source: "https://github.com/google/s2geometry/issues/317" + patch_type: "portability" + - patch_description: "Add message to static_assert to be compatible with c++14 (MSVC)" + patch_file: "patches/add_message_to_static_assert.patch" + patch_type: "portability" diff --git a/recipes/s2geometry/all/conanfile.py b/recipes/s2geometry/all/conanfile.py new file mode 100644 index 00000000000000..31e07fd7e0dc37 --- /dev/null +++ b/recipes/s2geometry/all/conanfile.py @@ -0,0 +1,100 @@ +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 get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.54.0" + + +class S2GeometryConan(ConanFile): + name = "s2geometry" + description = "Computational geometry and spatial indexing on the sphere" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/s2geometry" + topics = ("geometry", "spherical-geometry", "spatial-indexing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + 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("abseil/20230125.3", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + + 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 is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared with Visual Studio") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GOOGLETEST_ROOT"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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 = ["s2"] diff --git a/recipes/s2geometry/all/patches/add_message_to_static_assert.patch b/recipes/s2geometry/all/patches/add_message_to_static_assert.patch new file mode 100644 index 00000000000000..1a458e9936c5d0 --- /dev/null +++ b/recipes/s2geometry/all/patches/add_message_to_static_assert.patch @@ -0,0 +1,13 @@ +diff --git a/src/s2/s2lax_polygon_shape.cc b/src/s2/s2lax_polygon_shape.cc +index e71476a..7bfe874 100644 +--- a/src/s2/s2lax_polygon_shape.cc ++++ b/src/s2/s2lax_polygon_shape.cc +@@ -33,7 +33,7 @@ namespace { + template + std::unique_ptr make_unique_for_overwrite(size_t n) { + // We only need to support this one variant. +- static_assert(std::is_array::value); ++ static_assert(std::is_array::value, ""); + return std::unique_ptr(new typename absl::remove_extent_t[n]); + } + } // namespace diff --git a/recipes/s2geometry/all/patches/bump_cmake_cxx_standard.patch b/recipes/s2geometry/all/patches/bump_cmake_cxx_standard.patch new file mode 100644 index 00000000000000..4bb8e07c259085 --- /dev/null +++ b/recipes/s2geometry/all/patches/bump_cmake_cxx_standard.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f080b4b..b2699ee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,7 +19,7 @@ endif() + # undefined symbol errors since ABSL_HAVE_STD_STRING_VIEW etc will + # end up defined differently. There is probably a better way to achieve + # this than assuming what absl used. +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard to build with") + set(CMAKE_CXX_STANDARD_REQUIRED ON) + # No compiler-specific extensions, i.e. -std=c++11, not -std=gnu++11. + set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/recipes/s2geometry/all/test_package/CMakeLists.txt b/recipes/s2geometry/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..cc8c0e21436028 --- /dev/null +++ b/recipes/s2geometry/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(s2geometry REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE s2geometry::s2geometry) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +if(MSVC) + # Use unsigned characters + target_compile_options(${PROJECT_NAME} PRIVATE "-J") + target_compile_definitions(${PROJECT_NAME} PRIVATE + # Make sure cmath header defines things like M_PI + "_USE_MATH_DEFINES" + # Make sure Windows doesn't define min/max macros that interfere with STL + "NOMINMAX" + ) +endif() diff --git a/recipes/s2geometry/all/test_package/conanfile.py b/recipes/s2geometry/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/s2geometry/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/s2geometry/all/test_package/test_package.cpp b/recipes/s2geometry/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..1f6da7a09f6f29 --- /dev/null +++ b/recipes/s2geometry/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include +#include +#include + +#include +#include + +int main() +{ + S2Builder builder{S2Builder::Options()}; + S2Polygon output; + builder.StartLayer(std::make_unique(&output)); + auto input = s2textformat::MakePolygonOrDie("0:0, 0:5, 5:5, 5:0; 1:1, 1:4, 4:4, 4:1"); + builder.AddShape(*input->index().shape(0)); + S2Error error; + std::cout << "Builder: " << (builder.Build(&error) ? "OK" : error.text()) << std::endl; +} diff --git a/recipes/s2geometry/config.yml b/recipes/s2geometry/config.yml new file mode 100644 index 00000000000000..1b582dcf6716ba --- /dev/null +++ b/recipes/s2geometry/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.0": + folder: all diff --git a/recipes/s2n/all/conandata.yml b/recipes/s2n/all/conandata.yml index 1f39628799a666..8805728159ae74 100644 --- a/recipes/s2n/all/conandata.yml +++ b/recipes/s2n/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.3.56": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.56.tar.gz" + sha256: "5d7bab81357a564453bc453469b4ae02936f1f35225ad297b8d846d2ecdda521" + "1.3.55": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.55.tar.gz" + sha256: "3b4d51d08326757440a7a134dd4d73c904b700d64837aa7fec0aca908b70fd9b" + "1.3.52": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.52.tar.gz" + sha256: "c8ae02ae427763dcffe10d211ed7a2433803affd9aa5836951ef972c53db0120" + "1.3.50": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.50.tar.gz" + sha256: "19c9a7e9e0ce14aae3fc0c55995759f4eadd5b55f5353de69f82c62ccb3693f8" + "1.3.49": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.49.tar.gz" + sha256: "2bc7b170a750a435ad02ab8e696c3ad6e9bb7a585c02899472793f87670184dd" "1.3.31": url: "https://github.com/aws/s2n-tls/archive/v1.3.31.tar.gz" sha256: "23cfb42f82cbe1ce94b59f3b1c1c8eb9d24af2a1ae4c8f854209ff88fddd3900" diff --git a/recipes/s2n/config.yml b/recipes/s2n/config.yml index 611e0f7be0d88e..541cd4177faf35 100644 --- a/recipes/s2n/config.yml +++ b/recipes/s2n/config.yml @@ -1,4 +1,14 @@ versions: + "1.3.56": + folder: all + "1.3.55": + folder: all + "1.3.52": + folder: all + "1.3.50": + folder: all + "1.3.49": + folder: all "1.3.31": folder: all "1.3.15": diff --git a/recipes/sail/all/conandata.yml b/recipes/sail/all/conandata.yml index 3233a1960c7bfd..f34812471ebce4 100644 --- a/recipes/sail/all/conandata.yml +++ b/recipes/sail/all/conandata.yml @@ -1,9 +1,4 @@ sources: - "0.9.0-rc2": - url: "https://github.com/smoked-herring/sail/archive/v0.9.0-rc2.tar.gz" - sha256: "988d318fd4cfbc77ccbda49f4ac751d1998b990db157aef32b0dbd32d11f8fd6" -patches: - "0.9.0-rc2": - - patch_file: "patches/0.9.0-rc2-avif-find-package.patch" - patch_type: "conan" - patch_description: "Make the AVIF codec use find_package()" + "0.9.0": + url: "https://github.com/HappySeaFox/sail/archive/v0.9.0.tar.gz" + sha256: "892738e0f56fed8c6387e1045bba2bfbf1b095024a495845d4879edb310cd1a7" diff --git a/recipes/sail/all/conanfile.py b/recipes/sail/all/conanfile.py index fb389e804f1317..5f767c3bd62c55 100644 --- a/recipes/sail/all/conanfile.py +++ b/recipes/sail/all/conanfile.py @@ -18,27 +18,53 @@ class SAILConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "thread_safe": [True, False], - "with_avif": [True, False], - "with_gif": [True, False], - "with_jpeg2000": [True, False], - "with_jpeg": ["libjpeg", "libjpeg-turbo", False], - "with_png": [True, False], - "with_tiff": [True, False], - "with_webp": [True, False], + "with_highest_priority_codecs": [True, False], + "with_high_priority_codecs": [True, False], + "with_medium_priority_codecs": [True, False], + "with_low_priority_codecs": [True, False], + "with_lowest_priority_codecs": [True, False], + "with_avif": [True, False, "deprecated"], + "with_gif": [True, False, "deprecated"], + "with_jpeg2000": [True, False, "deprecated"], + "with_jpeg": ["libjpeg", "libjpeg-turbo", False, "deprecated"], + "with_png": [True, False, "deprecated"], + "with_tiff": [True, False, "deprecated"], + "with_webp": [True, False, "deprecated"], + } default_options = { "shared": False, "fPIC": True, "thread_safe": True, - "with_avif": True, - "with_gif": True, - "with_jpeg2000": True, - "with_jpeg": "libjpeg", - "with_png": True, - "with_tiff": True, - "with_webp": True, + "with_highest_priority_codecs": True, + "with_high_priority_codecs": True, + "with_medium_priority_codecs": True, + "with_low_priority_codecs": True, + "with_lowest_priority_codecs": True, + "with_avif": "deprecated", + "with_gif": "deprecated", + "with_jpeg2000": "deprecated", + "with_jpeg": "deprecated", + "with_png": "deprecated", + "with_tiff": "deprecated", + "with_webp": "deprecated", + } + options_description = { + "with_avif": "Deprecated", + "with_gif": "Deprecated", + "with_jpeg2000": "Deprecated", + "with_jpeg": "Deprecated", + "with_png": "Deprecated", + "with_tiff": "Deprecated", + "with_webp": "Deprecated", + "with_highest_priority_codecs": "Enable codecs: GIF, JPEG, PNG, TIFF", + "with_high_priority_codecs": "Enable codecs: BMP, SVG", + "with_medium_priority_codecs": "Enable codecs: AVIF, JPEG2000, JPEGXL, WEBL", + "with_low_priority_codecs": "Enable codecs: ICO, PCX, PNM, PSD, QOI, TGA", + "with_lowest_priority_codecs": "Enable codecs: WAL, XBM", } + def export_sources(self): export_conandata_patches(self) @@ -51,22 +77,33 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - if self.options.with_avif: - self.requires("libavif/0.11.1") - if self.options.with_gif: + if self.options.with_highest_priority_codecs: self.requires("giflib/5.2.1") - if self.options.with_jpeg2000: - self.requires("jasper/4.0.0") - if self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") - elif self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") - if self.options.with_png: self.requires("libpng/1.6.40") - if self.options.with_tiff: - self.requires("libtiff/4.5.1") - if self.options.with_webp: - self.requires("libwebp/1.3.1") + self.requires("libtiff/4.6.0") + if self.options.with_medium_priority_codecs: + self.requires("libavif/1.0.2") + self.requires("jasper/4.0.0") + # TODO Re-enable JPEG XL after merging either of the following: + # - https://github.com/conan-io/conan-center-index/pull/13898 + # - https://github.com/conan-io/conan-center-index/pull/18812 + # self.requires("libjxl/0.6.1") + self.requires("libwebp/1.3.2") + + def package_id(self): + del self.info.options.with_avif + del self.info.options.with_gif + del self.info.options.with_jpeg2000 + del self.info.options.with_jpeg + del self.info.options.with_png + del self.info.options.with_tiff + del self.info.options.with_webp + + def validate(self): + for option_name in ["with_avif", "with_gif", "with_jpeg2000", "with_jpeg", "with_png", "with_tiff", "with_webp"]: + if self.options.get_safe(option_name, "deprecated") != "deprecated": + self.output.warning(f"{self.ref}:{option_name} option is deprecated, please, use 'with_xxx_priority_codecs' instead.") def layout(self): cmake_layout(self, src_folder="src") @@ -76,39 +113,33 @@ def source(self): strip_root=True, destination=self.source_folder) def generate(self): - enable_codecs = [] - - if self.options.with_avif: - enable_codecs.append("avif") - if self.options.with_gif: - enable_codecs.append("gif") - if self.options.with_jpeg2000: - enable_codecs.append("jpeg2000") - if self.options.with_jpeg: - enable_codecs.append("jpeg") - if self.options.with_png: - enable_codecs.append("png") - if self.options.with_tiff: - enable_codecs.append("tiff") - if self.options.with_webp: - enable_codecs.append("webp") + only_codecs = [] + + if self.options.with_highest_priority_codecs: + only_codecs.append("highest-priority") + if self.options.with_high_priority_codecs: + only_codecs.append("high-priority") + if self.options.with_medium_priority_codecs: + only_codecs.append("medium-priority") + if self.options.with_low_priority_codecs: + only_codecs.append("low-priority") + if self.options.with_lowest_priority_codecs: + only_codecs.append("lowest-priority") tc = CMakeToolchain(self) - tc.variables["SAIL_BUILD_APPS"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["SAIL_BUILD_APPS"] = False tc.variables["SAIL_BUILD_EXAMPLES"] = False - tc.variables["SAIL_BUILD_TESTS"] = False tc.variables["SAIL_COMBINE_CODECS"] = True - tc.variables["SAIL_ENABLE_CODECS"] = ";".join(enable_codecs) - tc.variables["SAIL_INSTALL_PDB"] = False - tc.variables["SAIL_THREAD_SAFE"] = self.options.thread_safe + tc.variables["SAIL_ONLY_CODECS"] = ";".join(only_codecs) + # SVG requires resvg which is not in Conan yet + # JPEGXL needs porting to Conan2 + tc.variables["SAIL_DISABLE_CODECS"] = "svg;jpegxl" + tc.variables["SAIL_INSTALL_PDB"] = False + tc.variables["SAIL_THREAD_SAFE"] = self.options.thread_safe # TODO: Remove after fixing https://github.com/conan-io/conan/issues/12012 if is_msvc(self): tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) - # TODO: Remove after fixing https://github.com/conan-io/conan-center-index/issues/13159 - # C3I workaround to force CMake to choose the highest version of - # the windows SDK available in the system - if is_msvc(self) and not self.conf.get("tools.cmake.cmaketoolchain:system_version"): - tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0" tc.generate() deps = CMakeDeps(self) @@ -156,19 +187,16 @@ def package_info(self): self.cpp_info.components["sail-codecs"].names["cmake_find_package_multi"] = "SailCodecs" self.cpp_info.components["sail-codecs"].libs = ["sail-codecs"] self.cpp_info.components["sail-codecs"].requires = ["sail-common"] - if self.options.with_avif: - self.cpp_info.components["sail-codecs"].requires.append("libavif::libavif") - if self.options.with_gif: + + if self.options.with_highest_priority_codecs: self.cpp_info.components["sail-codecs"].requires.append("giflib::giflib") - if self.options.with_jpeg2000: - self.cpp_info.components["sail-codecs"].requires.append("jasper::jasper") - if self.options.with_jpeg: - self.cpp_info.components["sail-codecs"].requires.append("{0}::{0}".format(self.options.with_jpeg)) - if self.options.with_png: + self.cpp_info.components["sail-codecs"].requires.append("libjpeg::libjpeg") self.cpp_info.components["sail-codecs"].requires.append("libpng::libpng") - if self.options.with_tiff: self.cpp_info.components["sail-codecs"].requires.append("libtiff::libtiff") - if self.options.with_webp: + if self.options.with_medium_priority_codecs: + self.cpp_info.components["sail-codecs"].requires.append("libavif::libavif") + self.cpp_info.components["sail-codecs"].requires.append("jasper::jasper") + # self.cpp_info.components["sail-codecs"].requires.append("libjxl::libjxl") self.cpp_info.components["sail-codecs"].requires.append("libwebp::libwebp") self.cpp_info.components["libsail"].set_property("cmake_target_name", "SAIL::Sail") diff --git a/recipes/sail/all/patches/0.9.0-rc2-avif-find-package.patch b/recipes/sail/all/patches/0.9.0-rc2-avif-find-package.patch deleted file mode 100644 index 98ec3b23d5ae97..00000000000000 --- a/recipes/sail/all/patches/0.9.0-rc2-avif-find-package.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/src/sail-codecs/avif/CMakeLists.txt b/src/sail-codecs/avif/CMakeLists.txt -index 3f36e0c8..1e31be83 100644 ---- a/src/sail-codecs/avif/CMakeLists.txt -+++ b/src/sail-codecs/avif/CMakeLists.txt -@@ -1,7 +1,6 @@ --find_library(AVIF_LIBRARY avif ${SAIL_CODEC_AVIF_REQUIRED_OPTION}) --find_path(AVIF_INCLUDE_DIRS avif/avif.h ${SAIL_CODEC_AVIF_REQUIRED_OPTION}) -+find_package(libavif ${SAIL_CODEC_AVIF_REQUIRED_OPTION}) - --if (NOT AVIF_LIBRARY OR NOT AVIF_INCLUDE_DIRS) -+if (NOT libavif_FOUND) - return() - endif() - -@@ -18,5 +17,5 @@ set(SAIL_CODECS_FIND_DEPENDENCIES ${SAIL_CODECS_FIND_DEPENDENCIES} "find_depende - sail_codec(NAME avif - SOURCES helpers.h helpers.c io.h io.c avif.c - ICON avif.png -- DEPENDENCY_INCLUDE_DIRS ${AVIF_INCLUDE_DIRS} -- DEPENDENCY_LIBS ${AVIF_LIBRARY}) -+ DEPENDENCY_INCLUDE_DIRS ${avif_INCLUDE_DIRS} -+ DEPENDENCY_LIBS avif) diff --git a/recipes/sail/config.yml b/recipes/sail/config.yml index 4b9680ce33efbc..7dbf8a1dbf4a84 100644 --- a/recipes/sail/config.yml +++ b/recipes/sail/config.yml @@ -1,3 +1,3 @@ versions: - "0.9.0-rc2": + "0.9.0": folder: all diff --git a/recipes/samurai/all/conandata.yml b/recipes/samurai/all/conandata.yml index d10010d1fa9f96..b4ff07102a6733 100644 --- a/recipes/samurai/all/conandata.yml +++ b/recipes/samurai/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "0.9.0": + url: "https://github.com/hpc-maths/samurai/archive/v0.9.0.tar.gz" + sha256: "49f94a7451b1b50cab335a62e294e612fea27cbf5b131827eb69a8e228ad8010" + "0.8.0": + url: "https://github.com/hpc-maths/samurai/archive/v0.8.0.tar.gz" + sha256: "c20c4cdcc7c5a29d6f44369d5b1addee4237b8282b5cce88be4113367d90d82d" + "0.7.0": + url: "https://github.com/hpc-maths/samurai/archive/v0.7.0.tar.gz" + sha256: "159dea32bdce95ddc6bc62c202e60754407d4e5e910d0a382c2030410fe2e729" + "0.6.0": + url: "https://github.com/hpc-maths/samurai/archive/v0.6.0.tar.gz" + sha256: "bab96adac8e1553b79678a22de2248bec67c7c205b5fd35e9e1aaccaca41286e" "0.3.0": url: "https://github.com/hpc-maths/samurai/archive/v0.3.0.tar.gz" sha256: "5e6313d92fa2cd23941192c74014749acfcfbcfd5fdc1601cb3c9f4d151c7f4e" diff --git a/recipes/samurai/all/conanfile.py b/recipes/samurai/all/conanfile.py index 3c3caf72355d32..9bbf83edd69852 100644 --- a/recipes/samurai/all/conanfile.py +++ b/recipes/samurai/all/conanfile.py @@ -40,11 +40,11 @@ def layout(self): def requirements(self): self.requires("cli11/2.3.2") - self.requires("fmt/9.1.0") + self.requires("fmt/10.1.1") self.requires("highfive/2.7.1") - self.requires("pugixml/1.13") - self.requires("xsimd/10.0.0") - self.requires("xtensor/0.24.3") + self.requires("pugixml/1.14") + self.requires("xsimd/11.1.0") + self.requires("xtensor/0.24.6") def package_id(self): self.info.clear() @@ -61,7 +61,6 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - # 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( @@ -72,6 +71,5 @@ def package(self): ) def package_info(self): - # Folders not used for header-only self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/samurai/all/test_package/conanfile.py b/recipes/samurai/all/test_package/conanfile.py index 0a808db45f2453..3a91c9439218e3 100644 --- a/recipes/samurai/all/test_package/conanfile.py +++ b/recipes/samurai/all/test_package/conanfile.py @@ -4,7 +4,6 @@ import os -# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" diff --git a/recipes/samurai/config.yml b/recipes/samurai/config.yml index 0e8084dbaff4b5..b54c9224b6c190 100644 --- a/recipes/samurai/config.yml +++ b/recipes/samurai/config.yml @@ -1,4 +1,12 @@ versions: + "0.9.0": + folder: all + "0.8.0": + folder: all + "0.7.0": + folder: all + "0.6.0": + folder: all "0.3.0": folder: all "0.2.0": diff --git a/recipes/sbepp/all/conanfile.py b/recipes/sbepp/all/conanfile.py index a444e6edb4d52c..550f0466dea48c 100644 --- a/recipes/sbepp/all/conanfile.py +++ b/recipes/sbepp/all/conanfile.py @@ -64,8 +64,13 @@ def package_id(self): def requirements(self): if self.options.with_sbeppc: - self.requires("fmt/9.1.0") - self.requires("pugixml/1.12.1") + # sbepp/<1.1.0 requires fmt and pugixml with hardcoded versions + if Version(self.version) < "1.1.0": + self.requires("fmt/9.1.0") + self.requires("pugixml/1.12.1") + else: + self.requires("fmt/10.1.0") + self.requires("pugixml/1.13") def validate(self): if self.settings.compiler.cppstd: 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/scip/all/conandata.yml b/recipes/scip/all/conandata.yml index 8e5c45d17a6da6..aacd6d1a319fe3 100644 --- a/recipes/scip/all/conandata.yml +++ b/recipes/scip/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "8.1.0": + url: "https://github.com/scipopt/scip/archive/refs/tags/v810.tar.gz" + sha256: "b6daf54c37d02564b12fb32ec3bb7a105710eb0026adeafc602af4435fa94685" + "8.0.4": + url: "https://github.com/scipopt/scip/archive/refs/tags/v804.tar.gz" + sha256: "48be3f568763e3fc209803e9426389df107491371cfcce38f73dcc99ede69a51" "8.0.3": url: "https://github.com/scipopt/scip/archive/refs/tags/v803.tar.gz" sha256: "fe7636f8165a8c9298ff55ed3220d084d4ea31ba9b69d2733beec53e0e4335d6" diff --git a/recipes/scip/all/conanfile.py b/recipes/scip/all/conanfile.py index 1afdaf21774a7c..30a113fa5330e1 100644 --- a/recipes/scip/all/conanfile.py +++ b/recipes/scip/all/conanfile.py @@ -34,6 +34,11 @@ class SCIPConan(ConanFile): "with_tpi": False, "with_sym": "bliss", } + soplex_version_belonging_to_me = { + "8.1.0": "6.0.4", + "8.0.4": "6.0.4", + "8.0.3": "6.0.3" + } @property def _min_cppstd(self): @@ -76,11 +81,11 @@ def config_options(self): def requirements(self): if self.options.with_gmp: - self.requires("gmp/6.2.1") + self.requires("gmp/6.3.0") if self.options.with_sym == "bliss": self.requires("bliss/0.77") - self.requires("soplex/6.0.3") - self.requires("zlib/1.2.13") + self.requires(f"soplex/{self.soplex_version_belonging_to_me[self.version]}") + self.requires("zlib/[>=1.2.11 <2]") def configure(self): self.options["soplex"].with_gmp = self.options.with_gmp diff --git a/recipes/scip/config.yml b/recipes/scip/config.yml index 5a689d128f61a0..f70b85bc6cf446 100644 --- a/recipes/scip/config.yml +++ b/recipes/scip/config.yml @@ -1,3 +1,7 @@ versions: + "8.1.0": + folder: all + "8.0.4": + folder: all "8.0.3": folder: all diff --git a/recipes/scippp/all/conandata.yml b/recipes/scippp/all/conandata.yml new file mode 100644 index 00000000000000..88b2816d64354f --- /dev/null +++ b/recipes/scippp/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.0": + url: "https://github.com/scipopt/SCIPpp/archive/refs/tags/1.1.0.tar.gz" + sha256: "808b58e8ddd873ec403c021f9255004120e58d7ec6fb4b7d99ff6f21950ff8fb" + "1.0.2": + url: "https://github.com/scipopt/SCIPpp/archive/refs/tags/1.0.2.tar.gz" + sha256: "d51dfd0f1ca1b57619f7c82e32d5390d99d5cdaee98ae1ace99ec05a394dcee3" diff --git a/recipes/scippp/all/conanfile.py b/recipes/scippp/all/conanfile.py new file mode 100644 index 00000000000000..77b8d49bdb43cf --- /dev/null +++ b/recipes/scippp/all/conanfile.py @@ -0,0 +1,98 @@ +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 +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from os.path import join + + +class ScipPlusPlus(ConanFile): + name = "scippp" + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps" + description = "SCIP++ is a C++ wrapper for SCIP's C interface" + package_type = "library" + topics = ("mip", "solver", "linear", "programming") + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/scipopt/SCIPpp" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + # see https://github.com/scipopt/SCIPpp/commit/faa80e753f96094004467c1daa98a7ab4d86f279 + if Version(self.version) >= "1.1.0": + return { + "gcc": "8", + "clang": "7", + "apple-clang": "11", + "msvc": "192" + } + else: + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "msvc": "192" + } + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + 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 + + def layout(self): + cmake_layout(self, src_folder="src") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + # see https://github.com/scipopt/SCIPpp/blob/1.0.0/conanfile.py#L25 + self.requires("scip/8.0.4", transitive_headers=True) + + def generate(self): + tc = CMakeToolchain(self) + # In upstream, the version is injected into CMake via git. + tc.variables["scippp_version"] = self.version + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ScipPP"] diff --git a/recipes/scippp/all/test_package/CMakeLists.txt b/recipes/scippp/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..877c0c21bd3c0b --- /dev/null +++ b/recipes/scippp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 17) + +find_package(scippp REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE scippp::scippp) diff --git a/recipes/scippp/all/test_package/conanfile.py b/recipes/scippp/all/test_package/conanfile.py new file mode 100644 index 00000000000000..8a5bb47f50c4ce --- /dev/null +++ b/recipes/scippp/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, cmake_layout +import os + + +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) + + 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/scippp/all/test_package/test_package.cpp b/recipes/scippp/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..5244632b87e16b --- /dev/null +++ b/recipes/scippp/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include +using namespace scippp; +int main() { + std::cout << "This is SCIP++ version " << scippp::getVersion() << std::endl; + Model model("Simple"); + auto x1 = model.addVar("x_1", 1); + auto x2 = model.addVar("x_2", 1); + model.addConstr(3 * x1 + 2 * x2 <= 1, "capacity"); + model.setObjsense(Sense::MAXIMIZE); + model.solve(); +} diff --git a/recipes/scippp/config.yml b/recipes/scippp/config.yml new file mode 100644 index 00000000000000..a59308932f1d8b --- /dev/null +++ b/recipes/scippp/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.0": + folder: all + "1.0.2": + folder: all 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/screen_capture_lite/all/conandata.yml b/recipes/screen_capture_lite/all/conandata.yml index aa72c475ba532d..7bc7e84245c172 100644 --- a/recipes/screen_capture_lite/all/conandata.yml +++ b/recipes/screen_capture_lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "17.1.1369": + url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.1369.tar.gz" + sha256: "72abf1cd9fc538e98547841ec56396ba75a36853e861f7bf721f21c64c34453e" "17.1.1327": url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.1327.tar.gz" sha256: "bc5c17f3df14c1013268fc0107b52a98c6d032803fd1faea1983772f3b7ac5ed" diff --git a/recipes/screen_capture_lite/config.yml b/recipes/screen_capture_lite/config.yml index 7298de37ef3631..d2022be0c81a17 100644 --- a/recipes/screen_capture_lite/config.yml +++ b/recipes/screen_capture_lite/config.yml @@ -1,4 +1,6 @@ versions: + "17.1.1369": + folder: "all" "17.1.1327": folder: "all" "17.1.1173": diff --git a/recipes/sdbus-cpp/all/conandata.yml b/recipes/sdbus-cpp/all/conandata.yml index 4c4e5beb4bad04..ac3e9f3df91887 100644 --- a/recipes/sdbus-cpp/all/conandata.yml +++ b/recipes/sdbus-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.0": + url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.3.0.tar.gz" + sha256: "d44f59abdd64d8f1ca3af7db58bc6518cb081fc9ff16285c3d75a68f5c073d10" "1.2.0": url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.2.0.tar.gz" sha256: "7f7231904abb6a996b8c18ddc5fb50078ef5dff5191649abf9f127aff41d24e9" @@ -16,10 +19,10 @@ patches: "1.0.0": - patch_file: "patches/0002-correct-readme-cpack-resource-path.patch" patch_description: "fix out of tree build by using proper paths in cmake file" - patch_type: "backport" + patch_type: "bugfix" patch_source: "https://github.com/Kistler-Group/sdbus-cpp/commit/0b8f2d97524f354bcaf816b27b6139a5b0c480ba" "0.8.3": - patch_file: "patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch" patch_description: "fix build error by adding missing headers" - patch_type: "backport" + patch_type: "bugfix" patch_source: "https://github.com/Kistler-Group/sdbus-cpp/commit/fb008445b15b452f461c34667f4991f5ce06e481" diff --git a/recipes/sdbus-cpp/all/conanfile.py b/recipes/sdbus-cpp/all/conanfile.py index b93c27ec1b9185..1f8bc66668fefb 100644 --- a/recipes/sdbus-cpp/all/conanfile.py +++ b/recipes/sdbus-cpp/all/conanfile.py @@ -56,7 +56,7 @@ def configure(self): del self.options.fPIC def requirements(self): - self.requires("libsystemd/253.3") + self.requires("libsystemd/253.10") def validate(self): if self.info.settings.os != "Linux": @@ -74,7 +74,7 @@ def validate(self): self.name, self._minimum_cpp_standard, self.info.settings.compiler, self.info.settings.compiler.version)) def build_requirements(self): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") if self.options.with_code_gen: self.tool_requires("expat/2.5.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/sdbus-cpp/config.yml b/recipes/sdbus-cpp/config.yml index 027c0dc56075dc..a48eafa88431d0 100644 --- a/recipes/sdbus-cpp/config.yml +++ b/recipes/sdbus-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.0": + folder: all "1.2.0": folder: all "1.1.0": diff --git a/recipes/sdl/all/conandata.yml b/recipes/sdl/all/conandata.yml index 9aefd688061541..5542cc7bb105c0 100644 --- a/recipes/sdl/all/conandata.yml +++ b/recipes/sdl/all/conandata.yml @@ -1,4 +1,13 @@ 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" + "2.28.2": + url: "https://www.libsdl.org/release/SDL2-2.28.2.tar.gz" + sha256: "64b1102fa22093515b02ef33dd8739dee1ba57e9dbba6a092942b8bbed1a1c5e" "2.26.5": url: "https://www.libsdl.org/release/SDL2-2.26.5.tar.gz" sha256: "ad8fea3da1be64c83c45b1d363a6b4ba8fd60f5bde3b23ec73855709ec5eabf7" diff --git a/recipes/sdl/all/conanfile.py b/recipes/sdl/all/conanfile.py index 6d8d882403cbd1..03ff0430a22b12 100644 --- a/recipes/sdl/all/conanfile.py +++ b/recipes/sdl/all/conanfile.py @@ -81,6 +81,11 @@ class SDLConan(ConanFile): } generators = "CMakeDeps", "PkgConfigDeps", "VirtualBuildEnv" + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") + def layout(self): cmake_layout(self, src_folder="src") @@ -108,7 +113,7 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if is_msvc(self): + if (is_msvc(self) or self._is_clang_cl): del self.options.iconv if self.settings.os != "Linux": del self.options.alsa @@ -144,7 +149,7 @@ def requirements(self): self.requires("libiconv/1.17") if self.settings.os == "Linux": if self.options.alsa: - self.requires("libalsa/1.2.7.2") + self.requires("libalsa/1.2.10") if self.options.pulse: self.requires("pulseaudio/14.2") if self.options.opengl: @@ -152,11 +157,11 @@ def requirements(self): if self.options.nas: self.requires("nas/1.9.5") if self.options.wayland: - self.requires("wayland/1.21.0") - self.requires("xkbcommon/1.4.1") + self.requires("wayland/1.22.0") + self.requires("xkbcommon/1.6.0") self.requires("egl/system") if self.options.libunwind: - self.requires("libunwind/1.6.2") + self.requires("libunwind/1.7.2") def validate(self): # SDL>=2.0.18 requires xcode 12 or higher because it uses CoreHaptics. @@ -184,11 +189,11 @@ def build_requirements(self): # 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.tool_requires("cmake/3.25.3") + self.tool_requires("cmake/3.27.9") if self.settings.os == "Linux" and not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.1.0") if hasattr(self, "settings_build") and self.options.get_safe("wayland"): - self.build_requires("wayland/1.21.0") # Provides wayland-scanner + self.build_requires("wayland/1.22.0") # Provides wayland-scanner def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True, @@ -238,7 +243,7 @@ def define_toolchain(self): if self.settings.os != "Windows" and not self.options.shared: tc.variables["SDL_STATIC_PIC"] = self.options.fPIC - if is_msvc(self) and not self.options.shared: + if (is_msvc(self) or self._is_clang_cl) and not self.options.shared: tc.variables["HAVE_LIBC"] = True tc.variables["SDL_SHARED"] = self.options.shared tc.variables["SDL_STATIC"] = not self.options.shared @@ -323,7 +328,7 @@ def define_toolchain(self): tc.variables["EXTRA_LDFLAGS"] = ";".join(cmake_extra_ldflags) tc.variables["CMAKE_REQUIRED_INCLUDES"] = ";".join(cmake_required_includes) cmake_extra_cflags = ["-I{}".format(path) for _, dep in self.dependencies.items() for path in dep.cpp_info.includedirs] - tc.variables["EXTRA_CFLAGS"] = ";".join(cmake_extra_cflags) + tc.variables["EXTRA_CFLAGS"] = ";".join(cmake_extra_cflags).replace(os.sep, '/') tc.variables["EXTRA_LIBS"] = ";".join(cmake_extra_libs) tc.generate() @@ -355,7 +360,7 @@ def package_info(self): # SDL2 lib_postfix = postfix - if self.version >= "2.0.24" and is_msvc(self) and not self.options.shared: + if self.version >= "2.0.24" and (is_msvc(self) or self._is_clang_cl) and not self.options.shared: lib_postfix = "-static" + postfix self.cpp_info.components["libsdl2"].set_property("cmake_target_name", "SDL2::SDL2") diff --git a/recipes/sdl/config.yml b/recipes/sdl/config.yml index 960f4e5e4f3c04..e05c00ea2969ea 100644 --- a/recipes/sdl/config.yml +++ b/recipes/sdl/config.yml @@ -1,4 +1,10 @@ versions: + "2.28.5": + folder: all + "2.28.3": + folder: all + "2.28.2": + folder: all "2.26.5": folder: all "2.26.1": diff --git a/recipes/sdl_image/all/conandata.yml b/recipes/sdl_image/all/conandata.yml index bc34556c048dd0..0444df801e1ace 100644 --- a/recipes/sdl_image/all/conandata.yml +++ b/recipes/sdl_image/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6.3": + url: "https://github.com/libsdl-org/SDL_image/releases/download/release-2.6.3/SDL2_image-2.6.3.tar.gz" + sha256: "931c9be5bf1d7c8fae9b7dc157828b7eee874e23c7f24b44ba7eff6b4836312c" "2.0.5": url: "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.5.tar.gz" sha256: "bdd5f6e026682f7d7e1be0b6051b209da2f402a2dd8bd1c4bd9c25ad263108d0" diff --git a/recipes/sdl_image/all/conanfile.py b/recipes/sdl_image/all/conanfile.py index 6543a9f1cf3506..bca15363d987dd 100644 --- a/recipes/sdl_image/all/conanfile.py +++ b/recipes/sdl_image/all/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, 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" @@ -28,6 +29,7 @@ class SDLImageConan(ConanFile): "pnm": [True, False], "svg": [True, False], "tga": [True, False], + "qoi": [True, False], "xcf": [True, False], "xpm": [True, False], "xv": [True, False], @@ -35,7 +37,10 @@ class SDLImageConan(ConanFile): "with_libtiff": [True, False], "with_libpng": [True, False], "with_libwebp": [True, False], + "with_avif": [True, False], + "with_jxl": [True, False], "imageio": [True, False], + "wic": [True, False], } default_options = { "shared": False, @@ -47,6 +52,7 @@ class SDLImageConan(ConanFile): "pnm": True, "svg": True, "tga": True, + "qoi": True, "xcf": True, "xpm": True, "xv": True, @@ -54,16 +60,27 @@ class SDLImageConan(ConanFile): "with_libtiff": True, "with_libpng": True, "with_libwebp": True, + "with_avif": False, + "with_jxl": False, "imageio": False, + "wic": False, } - exports_sources = "CMakeLists.txt" + def export_sources(self): + if Version(self.version) < "2.6": + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC if not is_apple_os(self): del self.options.imageio + if Version(self.version) < "2.6": + del self.options.qoi + del self.options.with_avif + del self.options.with_jxl + if self.settings.os != "Windows": + del self.options.wic def configure(self): if self.options.shared: @@ -79,42 +96,75 @@ def layout(self): def requirements(self): # Headers are exposed https://github.com/conan-io/conan-center-index/pull/16167#issuecomment-1508347351 - self.requires("sdl/2.26.5", transitive_headers=True) + self.requires("sdl/2.28.3", transitive_headers=True) if self.options.with_libtiff: - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") if self.options.with_libjpeg: self.requires("libjpeg/9e") if self.options.with_libpng: self.requires("libpng/1.6.40") if self.options.with_libwebp: - self.requires("libwebp/1.3.1") + self.requires("libwebp/1.3.2") + if self.options.get_safe("with_avif"): + self.requires("libavif/1.0.1") def validate(self): if self.options.shared and not self.dependencies["sdl"].options.shared: - raise ConanInvalidConfiguration("sdl_image shared requires sdl shared") + raise ConanInvalidConfiguration(f"{self.ref} shared requires sdl shared") + # TODO: libjxl doesn't support conan v2(yet) + if self.options.get_safe("with_jxl"): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support with_jxl (yet)") + + def build_requirements(self): + if Version(self.version) >= "2.6": + 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) - tc.variables["SDL_IMAGE_SRC_DIR"] = self.source_folder.replace("\\", "/") - tc.variables["BMP"] = self.options.bmp - tc.variables["GIF"] = self.options.gif - tc.variables["IMAGEIO"] = self.options.get_safe("imageio") - tc.variables["JPG"] = self.options.with_libjpeg - tc.variables["LBM"] = self.options.lbm - tc.variables["PCX"] = self.options.pcx - tc.variables["PNG"] = self.options.with_libpng - tc.variables["PNM"] = self.options.pnm - tc.variables["SVG"] = self.options.svg - tc.variables["TGA"] = self.options.tga - tc.variables["TIF"] = self.options.with_libtiff - tc.variables["WEBP"] = self.options.with_libwebp - tc.variables["XCF"] = self.options.xcf - tc.variables["XPM"] = self.options.xpm - tc.variables["XV"] = self.options.xv - tc.variables["SDL_IS_SHARED"] = self.dependencies["sdl"].options.shared + if Version(self.version) < "2.6": + tc.variables["SDL_IMAGE_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["BMP"] = self.options.bmp + tc.variables["GIF"] = self.options.gif + tc.variables["IMAGEIO"] = self.options.get_safe("imageio") + tc.variables["JPG"] = self.options.with_libjpeg + tc.variables["LBM"] = self.options.lbm + tc.variables["PCX"] = self.options.pcx + tc.variables["PNG"] = self.options.with_libpng + tc.variables["PNM"] = self.options.pnm + tc.variables["SVG"] = self.options.svg + tc.variables["TGA"] = self.options.tga + tc.variables["TIF"] = self.options.with_libtiff + tc.variables["WEBP"] = self.options.with_libwebp + tc.variables["XCF"] = self.options.xcf + tc.variables["XPM"] = self.options.xpm + tc.variables["XV"] = self.options.xv + tc.variables["SDL_IS_SHARED"] = self.dependencies["sdl"].options.shared + else: + tc.variables["SDL2IMAGE_VENDORED"] = False + tc.variables["SDL2IMAGE_DEPS_SHARED"] = False + tc.variables["SDL2IMAGE_SAMPLES"] = False + tc.variables["SDL2IMAGE_AVIF"] = self.options.get_safe("with_avif") + tc.variables["SDL2IMAGE_BMP"] = self.options.bmp + tc.variables["SDL2IMAGE_GIF"] = self.options.gif + tc.variables["SDL2IMAGE_JPG"] = self.options.with_libjpeg + tc.variables["SDL2IMAGE_JXL"] = self.options.get_safe("with_jxl") + tc.variables["SDL2IMAGE_LBM"] = self.options.lbm + tc.variables["SDL2IMAGE_PCX"] = self.options.pcx + tc.variables["SDL2IMAGE_PNG"] = self.options.with_libpng + tc.variables["SDL2IMAGE_PNM"] = self.options.pnm + tc.variables["SDL2IMAGE_QOI"] = self.options.get_safe("qoi") + tc.variables["SDL2IMAGE_SVG"] = self.options.svg + tc.variables["SDL2IMAGE_TGA"] = self.options.tga + tc.variables["SDL2IMAGE_TIF"] = self.options.with_libtiff + tc.variables["SDL2IMAGE_WEBP"] = self.options.with_libwebp + tc.variables["SDL2IMAGE_XCF"] = self.options.xcf + tc.variables["SDL2IMAGE_XPM"] = self.options.xpm + tc.variables["SDL2IMAGE_XV"] = self.options.xv + tc.variables["SDL2IMAGE_BACKEND_WIC"] = self.options.get_safe("wic") + tc.variables["SDL2IMAGE_BACKEND_IMAGEIO"] = self.options.get_safe("imageio") tc.generate() cd = CMakeDeps(self) cd.generate() @@ -122,22 +172,46 @@ def generate(self): def build(self): rmdir(self, os.path.join(self.source_folder, "external")) cmake = CMake(self) - cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + if Version(self.version) < "2.6": + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + else: + cmake.configure() cmake.build() + if Version(self.version) >= "2.6": + 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(self): - copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) < "2.6": + copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, "LICENSE.txt", 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")) + 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, "SDL2_image.framework")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + def package_info(self): + lib_postfix = "" + if Version(self.version) >= "2.6": + if self.settings.os == "Windows" and not self.options.shared: + lib_postfix += "-static" + if self.settings.build_type == "Debug": + lib_postfix += "d" + self.cpp_info.set_property("cmake_file_name", "SDL2_image") self.cpp_info.set_property("cmake_target_name", "SDL2_image::SDL2_image") if not self.options.shared: self.cpp_info.set_property("cmake_target_aliases", ["SDL2_image::SDL2_image-static"]) self.cpp_info.set_property("pkg_config_name", "SDL2_image") # TODO: back to global scope in conan v2 once legacy generators removed - self.cpp_info.components["_sdl_image"].libs = ["SDL2_image"] + self.cpp_info.components["_sdl_image"].libs = [f"SDL2_image{lib_postfix}"] self.cpp_info.components["_sdl_image"].includedirs.append(os.path.join("include", "SDL2")) # TODO: to remove in conan v2 once legacy generators removed @@ -158,6 +232,8 @@ def package_info(self): self.cpp_info.components["_sdl_image"].requires.append("libpng::libpng") if self.options.with_libwebp: self.cpp_info.components["_sdl_image"].requires.append("libwebp::libwebp") + if self.options.get_safe("with_avif"): + self.cpp_info.components["_sdl_image"].requires.append("libavif::libavif") if self.options.get_safe("imageio") and not self.options.shared: self.cpp_info.components["_sdl_image"].frameworks = [ "CoreFoundation", @@ -172,3 +248,7 @@ def package_info(self): "MobileCoreServices", "UIKit", ]) + if self.options.get_safe("wic"): + self.cpp_info.system_libs.extend([ + "windowscodecs", + ]) diff --git a/recipes/sdl_image/config.yml b/recipes/sdl_image/config.yml index 1630e08ca5f328..53a0b9c2162746 100644 --- a/recipes/sdl_image/config.yml +++ b/recipes/sdl_image/config.yml @@ -1,3 +1,5 @@ versions: + "2.6.3": + folder: "all" "2.0.5": folder: "all" 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..3fb325e5263853 100644 --- a/recipes/sdl_ttf/all/conanfile.py +++ b/recipes/sdl_ttf/all/conanfile.py @@ -51,11 +51,11 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.2") # 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") + self.requires("harfbuzz/8.3.0") def validate(self): if Version(self.version).major != Version(self.dependencies["sdl"].ref.version).major: diff --git a/recipes/seadex-essentials/all/conanfile.py b/recipes/seadex-essentials/all/conanfile.py index a316b2670766bb..118460968da913 100644 --- a/recipes/seadex-essentials/all/conanfile.py +++ b/recipes/seadex-essentials/all/conanfile.py @@ -51,9 +51,9 @@ def configure(self): def requirements(self): # Headers are exposed https://github.com/SeadexGmbH/essentials/blob/622a07dc1530f5668f5dde0ce18007d420c371cd/essentials/include/essentials/log/log_level.hpp#L15 - self.requires("spdlog/1.11.0", transitive_headers=True) + self.requires("spdlog/1.12.0", transitive_headers=True) # Exposes headers and symbols https://github.com/SeadexGmbH/essentials/blob/622a07dc1530f5668f5dde0ce18007d420c371cd/essentials/include/essentials/type_wrapper.hpp#L282 - self.requires("fmt/10.0.0", transitive_headers=True, transitive_libs=True) + self.requires("fmt/10.1.0", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/seadex-genesis/all/conanfile.py b/recipes/seadex-genesis/all/conanfile.py index 55649339605a91..2328e60870392f 100644 --- a/recipes/seadex-genesis/all/conanfile.py +++ b/recipes/seadex-genesis/all/conanfile.py @@ -50,7 +50,7 @@ def configure(self): def requirements(self): # Exposes headers and symbols: https://github.com/SeadexGmbH/genesis/blob/master/genesis/source/version.cpp - self.requires("fmt/10.0.0", transitive_headers=True, transitive_libs=True) + self.requires("fmt/10.1.0", transitive_headers=True, transitive_libs=True) self.requires("seadex-essentials/2.1.3", transitive_headers=True, transitive_libs=True) def source(self): diff --git a/recipes/seasocks/all/conandata.yml b/recipes/seasocks/all/conandata.yml index 8ea105850a8bab..412d4f0b76fddf 100644 --- a/recipes/seasocks/all/conandata.yml +++ b/recipes/seasocks/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.6": + url: "https://github.com/mattgodbolt/seasocks/archive/v1.4.6.tar.gz" + sha256: "fc69636ce1205d338d4c02784333b04cd774fa368843fcf9f4fe6f8530a2cd67" "1.4.5": url: "https://github.com/mattgodbolt/seasocks/archive/v1.4.5.tar.gz" sha256: "82211959cf8aabc85b300358c5f68cf9c56dfdf4eaa09e548580fce908acfc1b" diff --git a/recipes/seasocks/all/conanfile.py b/recipes/seasocks/all/conanfile.py index 5a35a2a904c834..1662f1e11775fc 100644 --- a/recipes/seasocks/all/conanfile.py +++ b/recipes/seasocks/all/conanfile.py @@ -57,7 +57,7 @@ def layout(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: diff --git a/recipes/seasocks/config.yml b/recipes/seasocks/config.yml index bcda68af0d12d3..b2a6b234212ab4 100644 --- a/recipes/seasocks/config.yml +++ b/recipes/seasocks/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.6": + folder: "all" "1.4.5": folder: "all" "1.4.4": diff --git a/recipes/sentry-breakpad/all/conandata.yml b/recipes/sentry-breakpad/all/conandata.yml index ced5e36dba275c..2687fcfc48fd41 100644 --- a/recipes/sentry-breakpad/all/conandata.yml +++ b/recipes/sentry-breakpad/all/conandata.yml @@ -14,3 +14,49 @@ sources: "0.4.18": url: "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip" sha256: "41fdf6499cd8576142beb03104badcc9e0b80b8ef27080ca71cd4408cc1d7ece" +patches: + "0.6.5": + - patch_file: "patches/0.6.x-0001-remove-third-pary-lss.patch" + patch_description: "Remove third party lss from include" + patch_type: "conan" + patch_source: "https://github.com/getsentry/breakpad/pull/37" + - patch_file: "patches/0.6.x-0002-install-breakpad-header.patch" + patch_description: "Install breakpad header" + patch_type: "conan" + patch_source: "https://github.com/getsentry/sentry-native/pull/872" + "0.6.4": + - patch_file: "patches/0.6.x-0001-remove-third-pary-lss.patch" + patch_description: "Remove third party lss from include" + patch_type: "conan" + patch_source: "https://github.com/getsentry/breakpad/pull/37" + - patch_file: "patches/0.6.x-0002-install-breakpad-header.patch" + patch_description: "Install breakpad header" + patch_type: "conan" + patch_source: "https://github.com/getsentry/sentry-native/pull/872" + "0.6.3": + - patch_file: "patches/0.6.x-0001-remove-third-pary-lss.patch" + patch_description: "Remove third party lss from include" + patch_type: "conan" + patch_source: "https://github.com/getsentry/breakpad/pull/37" + - patch_file: "patches/0.6.x-0002-install-breakpad-header.patch" + patch_description: "Install breakpad header" + patch_type: "conan" + patch_source: "https://github.com/getsentry/sentry-native/pull/872" + "0.5.4": + - patch_file: "patches/0.5.4-0001-remove-third-pary-lss.patch" + patch_description: "Remove third party lss from include" + patch_type: "conan" + patch_source: "https://github.com/getsentry/breakpad/pull/37" + - patch_file: "patches/0.5.4-0002-install-breakpad-header.patch" + patch_description: "Install breakpad header" + patch_type: "conan" + patch_source: "https://github.com/getsentry/sentry-native/pull/872" + "0.4.18": + - patch_file: "patches/0.4.18-0001-remove-third-pary-lss.patch" + patch_description: "Remove third party lss from include" + patch_type: "conan" + patch_source: "https://github.com/getsentry/breakpad/pull/37" + - patch_file: "patches/0.4.18-0002-install-breakpad-header.patch" + patch_description: "Install breakpad header" + patch_type: "conan" + patch_source: "https://github.com/getsentry/sentry-native/pull/872" diff --git a/recipes/sentry-breakpad/all/conanfile.py b/recipes/sentry-breakpad/all/conanfile.py index a7d5646c8989e6..8e95117df3a32f 100644 --- a/recipes/sentry-breakpad/all/conanfile.py +++ b/recipes/sentry-breakpad/all/conanfile.py @@ -3,7 +3,7 @@ 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 copy, get, replace_in_file, save +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.scm import Version import os @@ -43,6 +43,7 @@ def _compilers_minimum_version(self): def export_sources(self): copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -54,7 +55,7 @@ def layout(self): def requirements(self): if self.settings.os in ("FreeBSD", "Linux"): # linux-syscal-support is a public dependency - # see https://github.com/conan-io/conan-center-index/pull/16752#issuecomment-1487241864 + # see https://github.com/conan-io/conan-center-index/pull/16752#issuecomment-1487241864 self.requires("linux-syscall-support/cci.20200813", transitive_headers=True) def validate(self): @@ -75,84 +76,8 @@ def generate(self): tc.variables["LINUX"] = True tc.generate() - def _patch_sources(self): - # FIXME: convert to patches - import textwrap - - files_to_patch = [ - # "src/tools/linux/md2core/minidump-2-core.cc", - # "src/processor/testdata/linux_test_app.cc", - "src/common/memory_allocator.h", - "src/common/linux/memory_mapped_file.cc", - "src/common/linux/file_id.cc", - "src/common/linux/safe_readlink.cc", - "src/client/minidump_file_writer.cc", - "src/client/linux/handler/exception_handler.cc", - "src/client/linux/handler/exception_handler_unittest.cc", - "src/client/linux/log/log.cc", - "src/client/linux/crash_generation/crash_generation_client.cc", - "src/client/linux/minidump_writer/linux_dumper.cc", - "src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc", - "src/client/linux/minidump_writer/proc_cpuinfo_reader.h", - "src/client/linux/minidump_writer/minidump_writer.cc", - "src/client/linux/minidump_writer/linux_ptrace_dumper.cc", - "src/client/linux/minidump_writer/cpu_set.h", - "src/client/linux/minidump_writer/directory_reader.h", - "src/client/linux/minidump_writer/line_reader.h" - ] - - for file in files_to_patch: - replace_in_file(self, - os.path.join(self.source_folder, "external", "breakpad", file), - "#include \"third_party/lss/linux_syscall_support.h\"", - "#include " - ) - - save(self, os.path.join(self.source_folder, "external", "CMakeLists.txt"), - textwrap.dedent("""\ - target_compile_features(breakpad_client PUBLIC cxx_std_11) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - find_path(LINUX_SYSCALL_INCLUDE_DIR NAMES linux_syscall_support.h) - target_include_directories(breakpad_client PRIVATE ${LINUX_SYSCALL_INCLUDE_DIR}) - endif() - install(TARGETS breakpad_client - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin - ) - file(GLOB COMMON_FILES breakpad/src/common/*.h) - install(FILES ${COMMON_FILES} - DESTINATION include/breakpad/common - ) - set(PLATFORM_FOLDER) - if(IOS) - set(PLATFORM_FOLDER ios) - elseif(APPLE) - set(PLATFORM_FOLDER mac) - elseif(UNIX) - set(PLATFORM_FOLDER linux) - endif() - if(WIN32) - set(PLATFORM_FOLDER windows) - endif() - if(NOT PLATFORM_FOLDER) - message(FATAL_ERROR "Unknown os -> don't know how to install headers") - endif() - file(GLOB COMMON_PLATFORM_HEADERS breakpad/src/common/${PLATFORM_FOLDER}/*.h) - install(FILES ${COMMON_PLATFORM_HEADERS} - DESTINATION include/breakpad/common/${PLATFORM_FOLDER}) - install(DIRECTORY breakpad/src/client/${PLATFORM_FOLDER} - DESTINATION include/breakpad/client - FILES_MATCHING PATTERN *.h - ) - install(DIRECTORY breakpad/src/google_breakpad/common - DESTINATION include/breakpad/google_breakpad - FILES_MATCHING PATTERN *.h - ) - """), append=True) - def build(self): - self._patch_sources() + apply_conandata_patches(self) cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() diff --git a/recipes/sentry-breakpad/all/patches/0.4.18-0001-remove-third-pary-lss.patch b/recipes/sentry-breakpad/all/patches/0.4.18-0001-remove-third-pary-lss.patch new file mode 100644 index 00000000000000..a573e142644bba --- /dev/null +++ b/recipes/sentry-breakpad/all/patches/0.4.18-0001-remove-third-pary-lss.patch @@ -0,0 +1,227 @@ +commit a9d52d999e0450a2f6b7ca24b245e718ab537cec +Author: Martin Delille +Date: Tue Aug 8 11:59:04 2023 +0200 + + Remove third_party/lss + +diff --git a/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc b/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc +index d8bfbbad..b7b43cff 100644 +--- a/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc ++++ b/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc +@@ -37,7 +37,7 @@ + + #include "common/linux/eintr_wrapper.h" + #include "common/linux/ignore_ret.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/handler/exception_handler.cc b/external/breakpad/src/client/linux/handler/exception_handler.cc +index 499be0a9..d6c3ba71 100644 +--- a/external/breakpad/src/client/linux/handler/exception_handler.cc ++++ b/external/breakpad/src/client/linux/handler/exception_handler.cc +@@ -95,7 +95,7 @@ + #include "client/linux/minidump_writer/linux_dumper.h" + #include "client/linux/minidump_writer/minidump_writer.h" + #include "common/linux/eintr_wrapper.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + #if defined(__ANDROID__) + #include "linux/sched.h" +diff --git a/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc b/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc +index 35dcbfd4..21647998 100644 +--- a/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc ++++ b/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc +@@ -50,7 +50,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/tests/auto_tempdir.h" + #include "common/using_std_string.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #include "google_breakpad/processor/minidump.h" + + using namespace google_breakpad; +diff --git a/external/breakpad/src/client/linux/log/log.cc b/external/breakpad/src/client/linux/log/log.cc +index 31879409..072377ed 100644 +--- a/external/breakpad/src/client/linux/log/log.cc ++++ b/external/breakpad/src/client/linux/log/log.cc +@@ -33,7 +33,7 @@ + #include + #include + #else +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #endif + + namespace logger { +diff --git a/external/breakpad/src/client/linux/minidump_writer/cpu_set.h b/external/breakpad/src/client/linux/minidump_writer/cpu_set.h +index 1cca9aa5..50f83d8c 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/cpu_set.h ++++ b/external/breakpad/src/client/linux/minidump_writer/cpu_set.h +@@ -35,7 +35,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/directory_reader.h b/external/breakpad/src/client/linux/minidump_writer/directory_reader.h +index a4bde180..e1c69a23 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/directory_reader.h ++++ b/external/breakpad/src/client/linux/minidump_writer/directory_reader.h +@@ -38,7 +38,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/line_reader.h b/external/breakpad/src/client/linux/minidump_writer/line_reader.h +index 9fc4b7cc..cf75dfe0 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/line_reader.h ++++ b/external/breakpad/src/client/linux/minidump_writer/line_reader.h +@@ -35,7 +35,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc b/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc +index 44430c4e..a702ee68 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc +@@ -51,7 +51,7 @@ + #include "common/linux/memory_mapped_file.h" + #include "common/linux/safe_readlink.h" + #include "google_breakpad/common/minidump_exception_linux.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + using google_breakpad::elf::FileID; + +diff --git a/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +index 331f4bb3..c4c5bd42 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +@@ -39,7 +39,7 @@ + #include + + #include "common/scoped_ptr.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + #if defined(__ARM_EABI__) + #define TID_PTR_REGISTER "r3" +diff --git a/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +index e3ddb81a..6712af94 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +@@ -57,7 +57,7 @@ + #include "client/linux/minidump_writer/directory_reader.h" + #include "client/linux/minidump_writer/line_reader.h" + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + // Suspends a thread by attaching to it. + static bool SuspendThread(pid_t pid) { +diff --git a/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc b/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +index 7ce9ac57..4d9f1e21 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +@@ -79,7 +79,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/minidump_type_helper.h" + #include "google_breakpad/common/minidump_format.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h b/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h +index d9461bf3..a915a88b 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h ++++ b/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h +@@ -36,7 +36,7 @@ + + #include "client/linux/minidump_writer/line_reader.h" + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/minidump_file_writer.cc b/external/breakpad/src/client/minidump_file_writer.cc +index 5c3c5cbb..6b0e2dd0 100644 +--- a/external/breakpad/src/client/minidump_file_writer.cc ++++ b/external/breakpad/src/client/minidump_file_writer.cc +@@ -41,7 +41,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/string_conversion.h" + #if defined(__linux__) && __linux__ +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #endif + + #if defined(__ANDROID__) +diff --git a/external/breakpad/src/common/linux/file_id.cc b/external/breakpad/src/common/linux/file_id.cc +index b483eb5c..eff1e8ce 100644 +--- a/external/breakpad/src/common/linux/file_id.cc ++++ b/external/breakpad/src/common/linux/file_id.cc +@@ -46,7 +46,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/linux/memory_mapped_file.h" + #include "common/using_std_string.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + namespace elf { +diff --git a/external/breakpad/src/common/linux/memory_mapped_file.cc b/external/breakpad/src/common/linux/memory_mapped_file.cc +index 99362945..efaae8ec 100644 +--- a/external/breakpad/src/common/linux/memory_mapped_file.cc ++++ b/external/breakpad/src/common/linux/memory_mapped_file.cc +@@ -40,7 +40,7 @@ + #include + + #include "common/memory_range.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/common/linux/safe_readlink.cc b/external/breakpad/src/common/linux/safe_readlink.cc +index 870c28af..37872b5b 100644 +--- a/external/breakpad/src/common/linux/safe_readlink.cc ++++ b/external/breakpad/src/common/linux/safe_readlink.cc +@@ -32,7 +32,7 @@ + + #include + +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/common/memory_allocator.h b/external/breakpad/src/common/memory_allocator.h +index d28fbfc3..fbf8c977 100644 +--- a/external/breakpad/src/common/memory_allocator.h ++++ b/external/breakpad/src/common/memory_allocator.h +@@ -47,7 +47,7 @@ + #define sys_munmap munmap + #define MAP_ANONYMOUS MAP_ANON + #else +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #endif + + namespace google_breakpad { diff --git a/recipes/sentry-breakpad/all/patches/0.4.18-0002-install-breakpad-header.patch b/recipes/sentry-breakpad/all/patches/0.4.18-0002-install-breakpad-header.patch new file mode 100644 index 00000000000000..2956814e8f096e --- /dev/null +++ b/recipes/sentry-breakpad/all/patches/0.4.18-0002-install-breakpad-header.patch @@ -0,0 +1,54 @@ +commit 6f1543b58c2ae4dbe129aec0123e45461da24c3c +Author: Martin Delille +Date: Tue Aug 8 12:45:23 2023 +0200 + + Update external/CMakeLists.txt to install breakpad headers + +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index ca807f7..41d7cd4 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -177,3 +177,43 @@ target_include_directories(breakpad_client + PUBLIC + "$" + ) ++ ++target_compile_features(breakpad_client PUBLIC cxx_std_11) ++if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") ++ find_path(LINUX_SYSCALL_INCLUDE_DIR NAMES linux_syscall_support.h) ++ target_include_directories(breakpad_client PRIVATE ${LINUX_SYSCALL_INCLUDE_DIR}) ++endif() ++install(TARGETS breakpad_client ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin ++) ++file(GLOB COMMON_FILES breakpad/src/common/*.h) ++install(FILES ${COMMON_FILES} ++ DESTINATION include/breakpad/common ++) ++set(PLATFORM_FOLDER) ++if(IOS) ++ set(PLATFORM_FOLDER ios) ++elseif(APPLE) ++ set(PLATFORM_FOLDER mac) ++elseif(UNIX) ++ set(PLATFORM_FOLDER linux) ++endif() ++if(WIN32) ++ set(PLATFORM_FOLDER windows) ++endif() ++if(NOT PLATFORM_FOLDER) ++ message(FATAL_ERROR "Unknown os -> don't know how to install headers") ++endif() ++file(GLOB COMMON_PLATFORM_HEADERS breakpad/src/common/${PLATFORM_FOLDER}/*.h) ++install(FILES ${COMMON_PLATFORM_HEADERS} ++ DESTINATION include/breakpad/common/${PLATFORM_FOLDER}) ++install(DIRECTORY breakpad/src/client/${PLATFORM_FOLDER} ++ DESTINATION include/breakpad/client ++ FILES_MATCHING PATTERN *.h ++) ++install(DIRECTORY breakpad/src/google_breakpad/common ++ DESTINATION include/breakpad/google_breakpad ++ FILES_MATCHING PATTERN *.h ++) diff --git a/recipes/sentry-breakpad/all/patches/0.5.4-0001-remove-third-pary-lss.patch b/recipes/sentry-breakpad/all/patches/0.5.4-0001-remove-third-pary-lss.patch new file mode 100644 index 00000000000000..f97256dfd7ea1a --- /dev/null +++ b/recipes/sentry-breakpad/all/patches/0.5.4-0001-remove-third-pary-lss.patch @@ -0,0 +1,227 @@ +commit d4424474455a06293d64571b58bef889a8956c34 +Author: Martin Delille +Date: Tue Aug 8 11:59:04 2023 +0200 + + Remove third_party/lss + +diff --git a/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc b/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc +index 5a8c6b4c..ea502283 100644 +--- a/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc ++++ b/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc +@@ -36,7 +36,7 @@ + + #include "common/linux/eintr_wrapper.h" + #include "common/linux/ignore_ret.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/handler/exception_handler.cc b/external/breakpad/src/client/linux/handler/exception_handler.cc +index bbdb798b..cc8e451b 100644 +--- a/external/breakpad/src/client/linux/handler/exception_handler.cc ++++ b/external/breakpad/src/client/linux/handler/exception_handler.cc +@@ -94,7 +94,7 @@ + #include "client/linux/minidump_writer/linux_dumper.h" + #include "client/linux/minidump_writer/minidump_writer.h" + #include "common/linux/eintr_wrapper.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + #if defined(__ANDROID__) + #include "linux/sched.h" +diff --git a/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc b/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc +index 691ea133..93ae3cae 100644 +--- a/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc ++++ b/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc +@@ -49,7 +49,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/tests/auto_tempdir.h" + #include "common/using_std_string.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #include "google_breakpad/processor/minidump.h" + + using namespace google_breakpad; +diff --git a/external/breakpad/src/client/linux/log/log.cc b/external/breakpad/src/client/linux/log/log.cc +index c45de64b..69b8832a 100644 +--- a/external/breakpad/src/client/linux/log/log.cc ++++ b/external/breakpad/src/client/linux/log/log.cc +@@ -32,7 +32,7 @@ + #include + #include + #else +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #endif + + namespace logger { +diff --git a/external/breakpad/src/client/linux/minidump_writer/cpu_set.h b/external/breakpad/src/client/linux/minidump_writer/cpu_set.h +index 70c1c758..92f7cdec 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/cpu_set.h ++++ b/external/breakpad/src/client/linux/minidump_writer/cpu_set.h +@@ -34,7 +34,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/directory_reader.h b/external/breakpad/src/client/linux/minidump_writer/directory_reader.h +index 62bba877..568278ff 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/directory_reader.h ++++ b/external/breakpad/src/client/linux/minidump_writer/directory_reader.h +@@ -37,7 +37,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/line_reader.h b/external/breakpad/src/client/linux/minidump_writer/line_reader.h +index d54a67d0..9ba8cd4c 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/line_reader.h ++++ b/external/breakpad/src/client/linux/minidump_writer/line_reader.h +@@ -34,7 +34,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc b/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc +index 01b06fac..d967034d 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc +@@ -50,7 +50,7 @@ + #include "common/linux/memory_mapped_file.h" + #include "common/linux/safe_readlink.h" + #include "google_breakpad/common/minidump_exception_linux.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + using google_breakpad::elf::FileID; + +diff --git a/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +index bc1e4fbe..01fa6bd4 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +@@ -38,7 +38,7 @@ + #include + + #include "common/scoped_ptr.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + #if defined(__ARM_EABI__) + #define TID_PTR_REGISTER "r3" +diff --git a/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +index 718fab7c..51be53ea 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +@@ -56,7 +56,7 @@ + #include "client/linux/minidump_writer/directory_reader.h" + #include "client/linux/minidump_writer/line_reader.h" + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + // Suspends a thread by attaching to it. + static bool SuspendThread(pid_t pid) { +diff --git a/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc b/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +index a5f9b841..6b9241a8 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +@@ -78,7 +78,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/minidump_type_helper.h" + #include "google_breakpad/common/minidump_format.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h b/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h +index 5ae16dfb..dcbb2e63 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h ++++ b/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h +@@ -35,7 +35,7 @@ + + #include "client/linux/minidump_writer/line_reader.h" + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/minidump_file_writer.cc b/external/breakpad/src/client/minidump_file_writer.cc +index d5193e2c..e9d0b3bd 100644 +--- a/external/breakpad/src/client/minidump_file_writer.cc ++++ b/external/breakpad/src/client/minidump_file_writer.cc +@@ -40,7 +40,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/string_conversion.h" + #if defined(__linux__) && __linux__ +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #endif + + #if defined(__ANDROID__) +diff --git a/external/breakpad/src/common/linux/file_id.cc b/external/breakpad/src/common/linux/file_id.cc +index 0bd2a759..a330f9c1 100644 +--- a/external/breakpad/src/common/linux/file_id.cc ++++ b/external/breakpad/src/common/linux/file_id.cc +@@ -45,7 +45,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/linux/memory_mapped_file.h" + #include "common/using_std_string.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + namespace elf { +diff --git a/external/breakpad/src/common/linux/memory_mapped_file.cc b/external/breakpad/src/common/linux/memory_mapped_file.cc +index 7e444607..f193163b 100644 +--- a/external/breakpad/src/common/linux/memory_mapped_file.cc ++++ b/external/breakpad/src/common/linux/memory_mapped_file.cc +@@ -39,7 +39,7 @@ + #include + + #include "common/memory_range.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/common/linux/safe_readlink.cc b/external/breakpad/src/common/linux/safe_readlink.cc +index 97ea62c0..27f39326 100644 +--- a/external/breakpad/src/common/linux/safe_readlink.cc ++++ b/external/breakpad/src/common/linux/safe_readlink.cc +@@ -31,7 +31,7 @@ + + #include + +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/common/memory_allocator.h b/external/breakpad/src/common/memory_allocator.h +index 1c99913a..5fa3c337 100644 +--- a/external/breakpad/src/common/memory_allocator.h ++++ b/external/breakpad/src/common/memory_allocator.h +@@ -46,7 +46,7 @@ + #define sys_munmap munmap + #define MAP_ANONYMOUS MAP_ANON + #else +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #endif + + namespace google_breakpad { diff --git a/recipes/sentry-breakpad/all/patches/0.5.4-0002-install-breakpad-header.patch b/recipes/sentry-breakpad/all/patches/0.5.4-0002-install-breakpad-header.patch new file mode 100644 index 00000000000000..4af6201d0565f4 --- /dev/null +++ b/recipes/sentry-breakpad/all/patches/0.5.4-0002-install-breakpad-header.patch @@ -0,0 +1,54 @@ +commit 32bf5d991a43151e149a88ee77d600170713ad69 +Author: Martin Delille +Date: Tue Aug 8 12:45:23 2023 +0200 + + Update external/CMakeLists.txt to install breakpad headers + +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index ca807f7..41d7cd4 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -177,3 +177,43 @@ target_include_directories(breakpad_client + PUBLIC + "$" + ) ++ ++target_compile_features(breakpad_client PUBLIC cxx_std_11) ++if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") ++ find_path(LINUX_SYSCALL_INCLUDE_DIR NAMES linux_syscall_support.h) ++ target_include_directories(breakpad_client PRIVATE ${LINUX_SYSCALL_INCLUDE_DIR}) ++endif() ++install(TARGETS breakpad_client ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin ++) ++file(GLOB COMMON_FILES breakpad/src/common/*.h) ++install(FILES ${COMMON_FILES} ++ DESTINATION include/breakpad/common ++) ++set(PLATFORM_FOLDER) ++if(IOS) ++ set(PLATFORM_FOLDER ios) ++elseif(APPLE) ++ set(PLATFORM_FOLDER mac) ++elseif(UNIX) ++ set(PLATFORM_FOLDER linux) ++endif() ++if(WIN32) ++ set(PLATFORM_FOLDER windows) ++endif() ++if(NOT PLATFORM_FOLDER) ++ message(FATAL_ERROR "Unknown os -> don't know how to install headers") ++endif() ++file(GLOB COMMON_PLATFORM_HEADERS breakpad/src/common/${PLATFORM_FOLDER}/*.h) ++install(FILES ${COMMON_PLATFORM_HEADERS} ++ DESTINATION include/breakpad/common/${PLATFORM_FOLDER}) ++install(DIRECTORY breakpad/src/client/${PLATFORM_FOLDER} ++ DESTINATION include/breakpad/client ++ FILES_MATCHING PATTERN *.h ++) ++install(DIRECTORY breakpad/src/google_breakpad/common ++ DESTINATION include/breakpad/google_breakpad ++ FILES_MATCHING PATTERN *.h ++) diff --git a/recipes/sentry-breakpad/all/patches/0.6.x-0001-remove-third-pary-lss.patch b/recipes/sentry-breakpad/all/patches/0.6.x-0001-remove-third-pary-lss.patch new file mode 100644 index 00000000000000..5134a67b8fcd0f --- /dev/null +++ b/recipes/sentry-breakpad/all/patches/0.6.x-0001-remove-third-pary-lss.patch @@ -0,0 +1,227 @@ +commit 2f63423367c2624a26e60b3867dd2462530d9334 +Author: Martin Delille +Date: Tue Aug 8 11:59:04 2023 +0200 + + Remove third_party/lss + +diff --git a/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc b/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc +index f06273d5..45599971 100644 +--- a/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc ++++ b/external/breakpad/src/client/linux/crash_generation/crash_generation_client.cc +@@ -40,7 +40,7 @@ + + #include "common/linux/eintr_wrapper.h" + #include "common/linux/ignore_ret.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/handler/exception_handler.cc b/external/breakpad/src/client/linux/handler/exception_handler.cc +index 9e23c119..4edd781c 100644 +--- a/external/breakpad/src/client/linux/handler/exception_handler.cc ++++ b/external/breakpad/src/client/linux/handler/exception_handler.cc +@@ -98,7 +98,7 @@ + #include "client/linux/minidump_writer/linux_dumper.h" + #include "client/linux/minidump_writer/minidump_writer.h" + #include "common/linux/eintr_wrapper.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + #if defined(__ANDROID__) + #include "linux/sched.h" +diff --git a/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc b/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc +index b2d8d468..a9199e2d 100644 +--- a/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc ++++ b/external/breakpad/src/client/linux/handler/exception_handler_unittest.cc +@@ -53,7 +53,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/tests/auto_tempdir.h" + #include "common/using_std_string.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #include "google_breakpad/processor/minidump.h" + + using namespace google_breakpad; +diff --git a/external/breakpad/src/client/linux/log/log.cc b/external/breakpad/src/client/linux/log/log.cc +index 2a48d7fe..0e3329a4 100644 +--- a/external/breakpad/src/client/linux/log/log.cc ++++ b/external/breakpad/src/client/linux/log/log.cc +@@ -36,7 +36,7 @@ + #include + #include + #else +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #endif + + namespace logger { +diff --git a/external/breakpad/src/client/linux/minidump_writer/cpu_set.h b/external/breakpad/src/client/linux/minidump_writer/cpu_set.h +index 70c1c758..92f7cdec 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/cpu_set.h ++++ b/external/breakpad/src/client/linux/minidump_writer/cpu_set.h +@@ -34,7 +34,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/directory_reader.h b/external/breakpad/src/client/linux/minidump_writer/directory_reader.h +index 62bba877..568278ff 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/directory_reader.h ++++ b/external/breakpad/src/client/linux/minidump_writer/directory_reader.h +@@ -37,7 +37,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/line_reader.h b/external/breakpad/src/client/linux/minidump_writer/line_reader.h +index d54a67d0..9ba8cd4c 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/line_reader.h ++++ b/external/breakpad/src/client/linux/minidump_writer/line_reader.h +@@ -34,7 +34,7 @@ + #include + + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc b/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc +index 85922a9c..3df94a6b 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/linux_dumper.cc +@@ -54,7 +54,7 @@ + #include "common/linux/memory_mapped_file.h" + #include "common/linux/safe_readlink.h" + #include "google_breakpad/common/minidump_exception_linux.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + using google_breakpad::elf::FileID; + +diff --git a/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +index 5a135fda..9f27f8d9 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +@@ -42,7 +42,7 @@ + #include + + #include "common/scoped_ptr.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + #if defined(__ARM_EABI__) + #define TID_PTR_REGISTER "r3" +diff --git a/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +index 0e58236b..d8613cd3 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +@@ -60,7 +60,7 @@ + #include "client/linux/minidump_writer/directory_reader.h" + #include "client/linux/minidump_writer/line_reader.h" + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + // Suspends a thread by attaching to it. + static bool SuspendThread(pid_t pid) { +diff --git a/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc b/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +index a95dd254..a0ed1e1d 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc ++++ b/external/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +@@ -82,7 +82,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/minidump_type_helper.h" + #include "google_breakpad/common/minidump_format.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace { + +diff --git a/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h b/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h +index 5ae16dfb..dcbb2e63 100644 +--- a/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h ++++ b/external/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h +@@ -35,7 +35,7 @@ + + #include "client/linux/minidump_writer/line_reader.h" + #include "common/linux/linux_libc_support.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/client/minidump_file_writer.cc b/external/breakpad/src/client/minidump_file_writer.cc +index c00af36c..acf5a520 100644 +--- a/external/breakpad/src/client/minidump_file_writer.cc ++++ b/external/breakpad/src/client/minidump_file_writer.cc +@@ -44,7 +44,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/string_conversion.h" + #if defined(__linux__) && __linux__ +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #endif + + #if defined(__ANDROID__) +diff --git a/external/breakpad/src/common/linux/file_id.cc b/external/breakpad/src/common/linux/file_id.cc +index d8fcbd8d..c81e43bc 100644 +--- a/external/breakpad/src/common/linux/file_id.cc ++++ b/external/breakpad/src/common/linux/file_id.cc +@@ -49,7 +49,7 @@ + #include "common/linux/linux_libc_support.h" + #include "common/linux/memory_mapped_file.h" + #include "common/using_std_string.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + namespace elf { +diff --git a/external/breakpad/src/common/linux/memory_mapped_file.cc b/external/breakpad/src/common/linux/memory_mapped_file.cc +index a7b96eb5..b89a3c95 100644 +--- a/external/breakpad/src/common/linux/memory_mapped_file.cc ++++ b/external/breakpad/src/common/linux/memory_mapped_file.cc +@@ -43,7 +43,7 @@ + #include + + #include "common/memory_range.h" +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/common/linux/safe_readlink.cc b/external/breakpad/src/common/linux/safe_readlink.cc +index a42b01a5..939e5309 100644 +--- a/external/breakpad/src/common/linux/safe_readlink.cc ++++ b/external/breakpad/src/common/linux/safe_readlink.cc +@@ -35,7 +35,7 @@ + + #include + +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + + namespace google_breakpad { + +diff --git a/external/breakpad/src/common/memory_allocator.h b/external/breakpad/src/common/memory_allocator.h +index 1c99913a..5fa3c337 100644 +--- a/external/breakpad/src/common/memory_allocator.h ++++ b/external/breakpad/src/common/memory_allocator.h +@@ -46,7 +46,7 @@ + #define sys_munmap munmap + #define MAP_ANONYMOUS MAP_ANON + #else +-#include "third_party/lss/linux_syscall_support.h" ++#include "linux_syscall_support.h" + #endif + + namespace google_breakpad { diff --git a/recipes/sentry-breakpad/all/patches/0.6.x-0002-install-breakpad-header.patch b/recipes/sentry-breakpad/all/patches/0.6.x-0002-install-breakpad-header.patch new file mode 100644 index 00000000000000..e71cb09fcd1877 --- /dev/null +++ b/recipes/sentry-breakpad/all/patches/0.6.x-0002-install-breakpad-header.patch @@ -0,0 +1,54 @@ +commit 78914ad6c0099d1ca4d891435c85ba0a6289814d +Author: Martin Delille +Date: Tue Aug 8 12:45:23 2023 +0200 + + Update external/CMakeLists.txt to install breakpad headers + +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index 9f3a298..31ac3f8 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -185,3 +185,43 @@ target_include_directories(breakpad_client + PUBLIC + "$" + ) ++ ++target_compile_features(breakpad_client PUBLIC cxx_std_11) ++if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") ++ find_path(LINUX_SYSCALL_INCLUDE_DIR NAMES linux_syscall_support.h) ++ target_include_directories(breakpad_client PRIVATE ${LINUX_SYSCALL_INCLUDE_DIR}) ++endif() ++install(TARGETS breakpad_client ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin ++) ++file(GLOB COMMON_FILES breakpad/src/common/*.h) ++install(FILES ${COMMON_FILES} ++ DESTINATION include/breakpad/common ++) ++set(PLATFORM_FOLDER) ++if(IOS) ++ set(PLATFORM_FOLDER ios) ++elseif(APPLE) ++ set(PLATFORM_FOLDER mac) ++elseif(UNIX) ++ set(PLATFORM_FOLDER linux) ++endif() ++if(WIN32) ++ set(PLATFORM_FOLDER windows) ++endif() ++if(NOT PLATFORM_FOLDER) ++ message(FATAL_ERROR "Unknown os -> don't know how to install headers") ++endif() ++file(GLOB COMMON_PLATFORM_HEADERS breakpad/src/common/${PLATFORM_FOLDER}/*.h) ++install(FILES ${COMMON_PLATFORM_HEADERS} ++ DESTINATION include/breakpad/common/${PLATFORM_FOLDER}) ++install(DIRECTORY breakpad/src/client/${PLATFORM_FOLDER} ++ DESTINATION include/breakpad/client ++ FILES_MATCHING PATTERN *.h ++) ++install(DIRECTORY breakpad/src/google_breakpad/common ++ DESTINATION include/breakpad/google_breakpad ++ FILES_MATCHING PATTERN *.h ++) 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/sentry-crashpad/all/conandata.yml b/recipes/sentry-crashpad/all/conandata.yml index ced5e36dba275c..26aa302e7bd27b 100644 --- a/recipes/sentry-crashpad/all/conandata.yml +++ b/recipes/sentry-crashpad/all/conandata.yml @@ -14,3 +14,10 @@ sources: "0.4.18": url: "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip" sha256: "41fdf6499cd8576142beb03104badcc9e0b80b8ef27080ca71cd4408cc1d7ece" + +patches: + "0.6.5": + - patch_file: "patches/0.6.5-0001-fix-for-gcc13.patch" + patch_type: "backport" + patch_description: "Extra header required for gcc13" + patch_source: "https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/4847514" diff --git a/recipes/sentry-crashpad/all/conanfile.py b/recipes/sentry-crashpad/all/conanfile.py index 645ba8aaf554d6..b18eacff4f64c6 100644 --- a/recipes/sentry-crashpad/all/conanfile.py +++ b/recipes/sentry-crashpad/all/conanfile.py @@ -60,9 +60,9 @@ def build_requirements(self): self.tool_requires("jwasm/2.13") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.settings.os in ("Linux", "FreeBSD"): - self.requires("libcurl/8.1.2") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.get_safe("with_tls"): self.requires("openssl/[>=1.1 <4]") diff --git a/recipes/sentry-crashpad/all/patches/0.2.6-0001-missing-installed-headers.patch b/recipes/sentry-crashpad/all/patches/0.2.6-0001-missing-installed-headers.patch deleted file mode 100644 index 4f57a94cccd7d1..00000000000000 --- a/recipes/sentry-crashpad/all/patches/0.2.6-0001-missing-installed-headers.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- external/crashpad/compat/CMakeLists.txt -+++ external/crashpad/compat/CMakeLists.txt -@@ -108,12 +108,13 @@ - endif() - - if(LINUX OR ANDROID) -- target_include_directories(crashpad_compat ${TI_YPE} "$") -+ target_include_directories(crashpad_compat ${TI_TYPE} "$") -+ target_link_libraries(crashpad_compat ${TI_TYPE} ${CMAKE_DL_LIBS}) - endif() - - if(ANDROID) -- target_include_directories(crashpad_compat ${TI_YPE} "$") -+ target_include_directories(crashpad_compat ${TI_TYPE} "$") - endif() - - set_property(TARGET crashpad_compat PROPERTY EXPORT_NAME compat) - add_library(crashpad::compat ALIAS crashpad_compat) ---- external/crashpad/third_party/mini_chromium/CMakeLists.txt -+++ external/crashpad/third_party/mini_chromium/CMakeLists.txt -@@ -172,3 +172,7 @@ - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/crashpad" - FILES_MATCHING PATTERN "*.h" - ) -+crashpad_install_dev(DIRECTORY build -+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/crashpad/mini_chromium" -+ FILES_MATCHING PATTERN "*.h" -+) ---- external/crashpad/util/CMakeLists.txt -+++ external/crashpad/util/CMakeLists.txt -@@ -237,7 +237,7 @@ - linux/thread_info.cc - linux/thread_info.h - linux/traits.h -- misc/capture_context_linux.S -+ misc/capture_context_linux.S misc/time_linux.cc - misc/paths_linux.cc - posix/process_info_linux.cc - process/process_memory_linux.cc -@@ -353,7 +353,7 @@ - target_include_directories(crashpad_util PRIVATE - $ - ) - target_link_libraries(crashpad_util - PRIVATE - $ - PUBLIC -@@ -371,6 +371,10 @@ - ) - endif() - -+if(LINUX) -+ target_link_libraries(crashpad_util PRIVATE rt pthread) -+endif() -+ - if(WIN32) - target_link_libraries(crashpad_util PRIVATE user32 version winhttp) - if(MSVC) -@@ -395,3 +399,7 @@ - add_library(crashpad::util ALIAS crashpad_util) - - crashpad_install_target(crashpad_util) -+crashpad_install_dev(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" -+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/crashpad/util" -+ FILES_MATCHING PATTERN "*.h" -+) diff --git a/recipes/sentry-crashpad/all/patches/0.6.5-0001-fix-for-gcc13.patch b/recipes/sentry-crashpad/all/patches/0.6.5-0001-fix-for-gcc13.patch new file mode 100644 index 00000000000000..b3a766009b3a74 --- /dev/null +++ b/recipes/sentry-crashpad/all/patches/0.6.5-0001-fix-for-gcc13.patch @@ -0,0 +1,20 @@ +--- a/external/crashpad/third_party/mini_chromium/mini_chromium/base/logging.h 2023-08-25 09:55:27.677142704 +0800 ++++ b/external/crashpad/third_party/mini_chromium/mini_chromium/base/logging.h 2023-08-25 10:06:01.654142494 +0800 +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + + #include "base/check.h" + #include "base/check_op.h" +--- a/external/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h 2023-08-25 10:11:28.084886020 +0800 ++++ b/external/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h 2023-08-25 11:06:37.044297949 +0800 +@@ -6,6 +6,7 @@ + #define MINI_CHROMIUM_BASE_STRINGS_UTF_STRING_CONVERSION_UTILS_H_ + + #include ++#include + + namespace base { + diff --git a/recipes/sentry-native/all/conandata.yml b/recipes/sentry-native/all/conandata.yml index 17d89711effcc9..ced5e36dba275c 100644 --- a/recipes/sentry-native/all/conandata.yml +++ b/recipes/sentry-native/all/conandata.yml @@ -1,13 +1,13 @@ sources: + "0.6.5": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.5/sentry-native.zip" + sha256: "5f74a5c5c3abc6e1e7825d3306be9e3b3fd4e0f586f3cf7e86607d6f56a71995" "0.6.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip" sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38" "0.6.3": url: "https://github.com/getsentry/sentry-native/releases/download/0.6.3/sentry-native.zip" sha256: "6b515c17a9b860ea47c6a5fd7abdfdc89b4b8cbc654c23a8bb42a39bfcb87ad9" - "0.6.2": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.2/sentry-native.zip" - sha256: "9b9f4b2cec961ca132039c7887fb876b3dd6f4795b31ca01d188187f69758efa" "0.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" diff --git a/recipes/sentry-native/all/conanfile.py b/recipes/sentry-native/all/conanfile.py index faa6d8ed510e7d..35bd2e66caa37d 100644 --- a/recipes/sentry-native/all/conanfile.py +++ b/recipes/sentry-native/all/conanfile.py @@ -103,7 +103,7 @@ def layout(self): def requirements(self): if self.options.transport == "curl": - self.requires("libcurl/8.0.1") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.backend == "crashpad": if self.options.with_crashpad == "sentry": self.requires(f"sentry-crashpad/{self.version}") @@ -115,7 +115,7 @@ def requirements(self): if self.options.with_breakpad == "google": self.requires("breakpad/cci.20210521") if self.options.get_safe("qt"): - self.requires("qt/5.15.9") + self.requires("qt/5.15.11") self.requires("openssl/[>=1.1 <4]") def validate(self): @@ -137,7 +137,7 @@ def build_requirements(self): self.tool_requires("cmake/[>=3.16.4 <4]") if self.options.backend == "breakpad": 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/sentry-native/config.yml b/recipes/sentry-native/config.yml index fb99bc2eb64b89..3450228c14b096 100644 --- a/recipes/sentry-native/config.yml +++ b/recipes/sentry-native/config.yml @@ -1,10 +1,10 @@ versions: + "0.6.5": + folder: all "0.6.4": folder: all "0.6.3": folder: all - "0.6.2": - folder: all "0.5.4": folder: all "0.4.18": diff --git a/recipes/seqan/2.x.x/conanfile.py b/recipes/seqan/2.x.x/conanfile.py index 5f567373a4d1a7..fb2227d760d8f2 100644 --- a/recipes/seqan/2.x.x/conanfile.py +++ b/recipes/seqan/2.x.x/conanfile.py @@ -1,56 +1,81 @@ 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.scm import Version + +required_conan_version = ">=1.52.0" + class SeqanConan(ConanFile): name = "seqan" + description = ( + "SeqAn is an open source C++ library of efficient algorithms and data structures for the analysis of sequences " + "with the focus on biological data. Our library applies a unique generic design that guarantees high performance, " + "generality, extensibility, and integration with other libraries. " + "SeqAn is easy to use and simplifies the development of new software tools with a minimal loss of performance." + ) + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/seqan/seqan" - description = """ -SeqAn is an open source C++ library of efficient algorithms and data structures for the analysis of sequences -with the focus on biological data. Our library applies a unique generic design that guarantees high performance, -generality, extensibility, and integration with other libraries. -SeqAn is easy to use and simplifies the development of new software tools with a minimal loss of performance. -""" - topics = ("conan", "cpp98", "cpp11", "cpp14", "cpp17", - "algorithms", "data structures", "biological sequences") - license = "BSD-3-Clause" - settings = "compiler" + topics = ("algorithms", "data structures", "biological sequences", "header-only") + + 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 14 @property def _compilers_minimum_version(self): return { "gcc": "5", - "Visual Studio": "14", "clang": "3.4", - "apple-clang": "3.4" + "apple-clang": "3.4", + "msvc": "190", + "Visual Studio": "14", } - def configure(self): + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("seqan requires C++14, which your compiler does not fully support.") - else: - self.output.warn("seqan requires C++14. Your compiler is unknown. Assuming it supports C++14.") + if not minimum_version: + self.output.warning( + f"{self.name} requires C++{self._min_cppstd}. " + f"Your compiler is unknown. Assuming it supports C++{self._min_cppstd}." + ) + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._min_cppstd}, which your compiler does not fully support." + ) + + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "seqan-seqan-v" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("*", dst="include", - src=os.path.join(self._source_subfolder, "include"), keep_path=True) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + keep_path=True) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os == "Windows": + self.cpp_info.defines = ["NOMINMAX"] diff --git a/recipes/seqan/2.x.x/test_package/CMakeLists.txt b/recipes/seqan/2.x.x/test_package/CMakeLists.txt index 64fd988616e274..6fdde597b12f49 100644 --- a/recipes/seqan/2.x.x/test_package/CMakeLists.txt +++ b/recipes/seqan/2.x.x/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(seqan REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} CONAN_PKG::seqan) +target_link_libraries(${PROJECT_NAME} PRIVATE seqan::seqan) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/seqan/2.x.x/test_package/conanfile.py b/recipes/seqan/2.x.x/test_package/conanfile.py index a59a26a52c8dcd..fae501d0afb9e4 100644 --- a/recipes/seqan/2.x.x/test_package/conanfile.py +++ b/recipes/seqan/2.x.x/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" + 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/seqan/2.x.x/test_package/test_package.cpp b/recipes/seqan/2.x.x/test_package/test_package.cpp index dd08405d3402d7..d9a44258b866dc 100644 --- a/recipes/seqan/2.x.x/test_package/test_package.cpp +++ b/recipes/seqan/2.x.x/test_package/test_package.cpp @@ -1,8 +1,9 @@ // Demo program for clipping with Gaps objects. -#include -#include #include +#include + +#include using namespace seqan; diff --git a/recipes/seqan/2.x.x/test_v1_package/CMakeLists.txt b/recipes/seqan/2.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/seqan/2.x.x/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/seqan/2.x.x/test_v1_package/conanfile.py b/recipes/seqan/2.x.x/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..abcaeed3f89b67 --- /dev/null +++ b/recipes/seqan/2.x.x/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/seqan3/all/conanfile.py b/recipes/seqan3/all/conanfile.py index ef55f38b024ff0..10b57ed42fdf79 100644 --- a/recipes/seqan3/all/conanfile.py +++ b/recipes/seqan3/all/conanfile.py @@ -1,60 +1,69 @@ -from conans import 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.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 Seqan3Conan(ConanFile): name = "seqan3" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/seqan/seqan3" description = "SeqAn3 is the new version of the popular SeqAn template library for the analysis of biological sequences." - topics = ("cpp20", "algorithms", "data structures", "biological sequences") license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/seqan/seqan3" + topics = ("cpp20", "algorithms", "data structures", "biological sequences", "header-only") + + 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 20 @property def _compilers_minimum_version(self): - return { - "gcc": "10", - } + return {"gcc": "10"} + + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler != "gcc": raise ConanInvalidConfiguration("SeqAn3 only supports GCC.") if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 20) + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: + if Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("SeqAn3 requires C++20, which your compiler does not fully support.") else: - self.output.warn("SeqAn3 requires C++20. Your compiler is unknown. Assuming it supports C++20.") + self.output.warning("SeqAn3 requires C++20. Your compiler is unknown. Assuming it supports C++20.") if self.settings.compiler == "gcc" and self.settings.compiler.libcxx != "libstdc++11": - self.output.warn("SeqAn3 does not actively support libstdc++, consider using libstdc++11 instead.") + self.output.warning("SeqAn3 does not actively support libstdc++, consider using libstdc++11 instead.") 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("*", dst="include", - src=os.path.join(self._source_subfolder, "include"), keep_path=True) + copy(self, "*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"), keep_path=True) + copy(self, "LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) for submodule in ["range-v3", "cereal", "sdsl-lite"]: - self.copy("*.hpp", dst="include", - src=os.path.join(self._source_subfolder, "submodules", submodule, "include"), keep_path=True) - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "submodules", submodule, "include"), + keep_path=True) def package_info(self): self.cpp_info.set_property("cmake_file_name", "seqan3") diff --git a/recipes/seqan3/all/test_package/CMakeLists.txt b/recipes/seqan3/all/test_package/CMakeLists.txt index 8c21ec19c63842..11e58315f3f7e9 100644 --- a/recipes/seqan3/all/test_package/CMakeLists.txt +++ b/recipes/seqan3/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(seqan3 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/seqan3/all/test_package/conanfile.py b/recipes/seqan3/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/seqan3/all/test_package/conanfile.py +++ b/recipes/seqan3/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/seqan3/all/test_v1_package/CMakeLists.txt b/recipes/seqan3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/seqan3/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/seqan3/all/test_v1_package/conanfile.py b/recipes/seqan3/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/seqan3/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/serd/all/conanfile.py b/recipes/serd/all/conanfile.py index 038ad977840b24..b5008dc8cfa011 100644 --- a/recipes/serd/all/conanfile.py +++ b/recipes/serd/all/conanfile.py @@ -43,7 +43,7 @@ def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.2.2") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/serdepp/all/conandata.yml b/recipes/serdepp/all/conandata.yml index a5bc02fad6305b..48987703821e78 100644 --- a/recipes/serdepp/all/conandata.yml +++ b/recipes/serdepp/all/conandata.yml @@ -2,3 +2,9 @@ sources: "0.1.4.1": url: "https://github.com/injae/serdepp/archive/refs/tags/v0.1.4.1.tar.gz" sha256: "0a1112e5fb929e22eba14c8699cfcd4b58cfcbb70068149a6a7ed2a532800972" +patches: + "0.1.4.1": + - patch_file: "patches/0.1.4.1-0001-fix-magic_enum-path.patch" + patch_description: "fix magic_enum path" + patch_type: "conan" + patch_source: "https://github.com/injae/serdepp/pull/57" diff --git a/recipes/serdepp/all/conanfile.py b/recipes/serdepp/all/conanfile.py index 3a9cae70272de1..433b310f780808 100644 --- a/recipes/serdepp/all/conanfile.py +++ b/recipes/serdepp/all/conanfile.py @@ -3,7 +3,7 @@ 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.files import copy, get, apply_conandata_patches, export_conandata_patches from conan.tools.layout import basic_layout from conan.tools.scm import Version @@ -49,22 +49,25 @@ def _compilers_minimum_version(self): "apple-clang": "10", } + def export_sources(self): + export_conandata_patches(self) + def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("nameof/0.10.1") - self.requires("magic_enum/0.7.3") + self.requires("nameof/0.10.3") + self.requires("magic_enum/0.9.5") if self.options.with_toml11: - self.requires("toml11/3.7.0") + self.requires("toml11/3.7.1") if self.options.with_yamlcpp: - self.requires("yaml-cpp/0.7.0") + self.requires("yaml-cpp/0.8.0") if self.options.with_rapidjson: self.requires("rapidjson/1.1.0") if self.options.with_fmt: - self.requires("fmt/8.1.1") + self.requires("fmt/10.1.0") if self.options.with_nlohmann_json: - self.requires("nlohmann_json/3.10.5") + self.requires("nlohmann_json/3.11.2") def package_id(self): self.info.clear() @@ -76,13 +79,16 @@ def validate(self): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warning(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + self.output.warning(f"{self.name} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") elif Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least C++17") + raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least C++{self._min_cppstd}") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def build(self): + apply_conandata_patches(self) + def package(self): s = lambda x: os.path.join(self.source_folder, x) p = lambda x: os.path.join(self.package_folder, x) diff --git a/recipes/serdepp/all/patches/0.1.4.1-0001-fix-magic_enum-path.patch b/recipes/serdepp/all/patches/0.1.4.1-0001-fix-magic_enum-path.patch new file mode 100644 index 00000000000000..1d276241e168b5 --- /dev/null +++ b/recipes/serdepp/all/patches/0.1.4.1-0001-fix-magic_enum-path.patch @@ -0,0 +1,26 @@ +diff --git a/include/serdepp/meta.hpp b/include/serdepp/meta.hpp +index d0a607a..5e6674f 100644 +--- a/include/serdepp/meta.hpp ++++ b/include/serdepp/meta.hpp +@@ -11,7 +11,7 @@ + #include + #include + #include +-#include ++#include + #include + + #ifndef __SERDEPP_META_HPP__ +diff --git a/include/serdepp/serializer.hpp b/include/serdepp/serializer.hpp +index 2e984af..d8b7247 100644 +--- a/include/serdepp/serializer.hpp ++++ b/include/serdepp/serializer.hpp +@@ -14,7 +14,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include "serdepp/meta.hpp" diff --git a/recipes/serf/all/CMakeLists.txt b/recipes/serf/all/CMakeLists.txt deleted file mode 100644 index a69305eb3971f9..00000000000000 --- a/recipes/serf/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() - -add_subdirectory(source_subfolder) diff --git a/recipes/serf/all/conandata.yml b/recipes/serf/all/conandata.yml index 10d6d086a2a84a..6a0aa39d546ff4 100644 --- a/recipes/serf/all/conandata.yml +++ b/recipes/serf/all/conandata.yml @@ -1,19 +1,12 @@ sources: "1.3.9": - url: [ - "https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2", - "https://github.com/apache/serf/archive/1.3.9.tar.gz", - ] + url: "https://archive.apache.org/dist/serf/serf-1.3.9.tar.bz2" sha256: "549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc" patches: "1.3.9": - patch_file: "patches/0001-1.3.9-scons-python3.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-1.3.9-scons-respect-flags.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-1.3.9-scons-msvc.patch" - base_path: "source_subfolder" - patch_file: "patches/0004-1.3.9-scons-python-spaces.patch" - base_path: "source_subfolder" - patch_file: "patches/0005-1.3.9-serf-openssl-3.x.patch" - base_path: "source_subfolder" + - patch_file: "patches/0006-1.3.9-scons-fix-zlib-shared-name.patch" diff --git a/recipes/serf/all/conanfile.py b/recipes/serf/all/conanfile.py index 389e7ad59c4e3c..cf758acbc390fb 100644 --- a/recipes/serf/all/conanfile.py +++ b/recipes/serf/all/conanfile.py @@ -1,19 +1,28 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanException -from contextlib import contextmanager -import glob import os import re +from conan import ConanFile +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 +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path, msvs_toolset +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + class SerfConan(ConanFile): name = "serf" - description = "The serf library is a high performance C-based HTTP client library built upon the Apache Portable Runtime (APR) library." + description = ("The serf library is a high performance C-based HTTP client library " + "built upon the Apache Portable Runtime (APR) library.") license = "Apache-2.0" - topics = ("conan", "serf", "apache", "http", "library") - homepage = "https://serf.apache.org/" url = "https://github.com/conan-io/conan-center-index" - exports_sources = "patches/**" + homepage = "https://serf.apache.org/" + topics = ("apache", "http", "library") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,91 +33,100 @@ class SerfConan(ConanFile): "fPIC": True, } + 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: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("apr-util/1.6.1") - self.requires("zlib/1.2.12") - self.requires("openssl/3.0.3") + self.requires("apr-util/1.6.1", transitive_headers=True, transitive_libs=True) + self.requires("zlib/[>=1.2.11 <2]") + self.requires("openssl/[>=1.1 <4]") def build_requirements(self): - self.build_requires("scons/4.3.0") + self.tool_requires("scons/4.3.0") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(glob.glob("serf-*")[0], self._source_subfolder) - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - pc_in = os.path.join(self._source_subfolder, "build", "serf.pc.in") - tools.save(pc_in, tools.load(pc_in)) + get(self, **self.conan_data["sources"][self.version], strip_root=True) @property def _cc(self): - if tools.get_env("CC"): - return tools.get_env("CC") - if tools.is_apple_os(self.settings.os): + if "CC" in os.environ: + return os.environ["CC"] + if is_apple_os(self): return "clang" - return { - "Visual Studio": "cl", - }.get(str(self.settings.compiler), str(self.settings.compiler)) + if is_msvc(self): + return "cl" + return str(self.settings.compiler) def _lib_path_arg(self, path): - argname = "LIBPATH:" if self.settings.compiler == "Visual Studio" else "L" - return "-{}'{}'".format(argname, path.replace("\\", "/")) - - @contextmanager - def _build_context(self): - extra_env = {} - if self.settings.compiler == "Visual Studio": - extra_env["OPENSSL_LIBS"] = ";".join("{}.lib".format(lib) for lib in self.deps_cpp_info["openssl"].libs) - with tools.environment_append(extra_env): - with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): - yield - - def build(self): - self._patch_sources() - autotools = AutoToolsBuildEnvironment(self) - args = ["-Y", os.path.join(self.source_folder, self._source_subfolder)] + argname = "LIBPATH:" if is_msvc(self) else "L" + return "-{}'{}'".format(argname, unix_path(self, path)) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + autotools = AutotoolsToolchain(self) + args = ["-Y", self.source_folder] + libdirs = sum([dep.cpp_info.libdirs for dep in self.dependencies.values()], []) + sharedlinkflags = sum([dep.cpp_info.sharedlinkflags for dep in self.dependencies.values()], []) + includedirs = sum([dep.cpp_info.includedirs for dep in self.dependencies.values()], []) + cflags = sum([dep.cpp_info.cflags for dep in self.dependencies.values()], []) + cflags += autotools.cflags + libs = sum([dep.cpp_info.libs for dep in self.dependencies.values()], []) + if self.options.get_safe("fPIC"): + cflags.append("-fPIC") kwargs = { - "APR": self.deps_cpp_info["apr"].rootpath.replace("\\", "/"), - "APU": self.deps_cpp_info["apr-util"].rootpath.replace("\\", "/"), - "OPENSSL": self.deps_cpp_info["openssl"].rootpath.replace("\\", "/"), - "PREFIX": self.package_folder.replace("\\", "/"), - "LIBDIR": os.path.join(self.package_folder, "lib").replace("\\", "/"), - "ZLIB": self.deps_cpp_info["zlib"].rootpath.replace("\\", "/"), + "APR": unix_path(self, self.dependencies["apr"].package_folder), + "APU": unix_path(self, self.dependencies["apr-util"].package_folder), + "OPENSSL": unix_path(self, self.dependencies["openssl"].package_folder), + "PREFIX": unix_path(self, self.package_folder), + "LIBDIR": unix_path(self, os.path.join(self.package_folder, "lib")), + "ZLIB": unix_path(self, self.dependencies["zlib"].package_folder), "DEBUG": self.settings.build_type == "Debug", - "APR_STATIC": not self.options["apr"].shared, - "CFLAGS": " ".join(self.deps_cpp_info.cflags + (["-fPIC"] if self.options.get_safe("fPIC") else []) + autotools.flags), - "LINKFLAGS": " ".join(self.deps_cpp_info.sharedlinkflags) + " " + " ".join(self._lib_path_arg(l) for l in self.deps_cpp_info.lib_paths), - "CPPFLAGS": " ".join("-D{}".format(d) for d in autotools.defines) + " " + " ".join("-I'{}'".format(inc.replace("\\", "/")) for inc in self.deps_cpp_info.include_paths), + "APR_STATIC": not self.dependencies["apr"].options.shared, + "CFLAGS": " ".join(cflags), + "LINKFLAGS": " ".join(sharedlinkflags + [self._lib_path_arg(l) for l in libdirs]), + "CPPFLAGS": " ".join([f"-D{d}" for d in autotools.defines] + [f"-I'{unix_path(self, inc)}'" for inc in includedirs]), "CC": self._cc, "SOURCE_LAYOUT": "False", } - if self.settings.compiler == "Visual Studio": - kwargs.update({ - "TARGET_ARCH": str(self.settings.arch), - "MSVC_VERSION": "{:.1f}".format(float(tools.msvs_toolset(self.settings).lstrip("v")) / 10), - }) + if is_msvc(self): + kwargs["TARGET_ARCH"] = str(self.settings.arch) + kwargs["MSVC_VERSION"] = "{:.1f}".format(float(msvs_toolset(self).lstrip("v")) / 10) + kwargs["ZLIB_LIBNAME"] = f"{self.dependencies['zlib'].cpp_info.libs[0]}" + env = Environment() + env.define("OPENSSL_LIBS", os.pathsep.join(f"{lib}.lib" for lib in self.dependencies["openssl"].cpp_info.aggregated_components().libs)) + env.vars(self).save_script("conanbuild_msvc") + else: + kwargs["LIBS"] = " ".join(libs) + + escape_str = lambda x: f'"{x}"' + scons_args = " ".join([escape_str(s) for s in args] + [f"{k}={escape_str(v)}" for k, v in kwargs.items()]) + save(self, os.path.join(self.source_folder, "scons_args"), scons_args) - escape_str = lambda x : "\"{}\"".format(x) - with tools.chdir(self._source_subfolder): - with self._build_context(): - self.run("scons {} {}".format(" ".join(escape_str(s) for s in args), " ".join("{}={}".format(k, escape_str(v)) for k, v in kwargs.items())), run_environment=True) + def _patch_sources(self): + apply_conandata_patches(self) + pc_in = os.path.join(self.source_folder, "build", "serf.pc.in") + save(self, pc_in, load(self, pc_in)) + + def build(self): + self._patch_sources() + with chdir(self, self.source_folder): + self.run("scons {}".format(load(self, "scons_args"))) @property def _static_ext(self): @@ -116,50 +134,47 @@ def _static_ext(self): @property def _shared_ext(self): - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): return "dylib" - return { - "Windows": "dll", - }.get(str(self.settings.os), "so") + if self.settings.os == "Windows": + return "dll" + return "so" + + @property + def _version_major(self): + return Version(self.version).major def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - with tools.chdir(self._source_subfolder): - with self._build_context(): - self.run("scons install -Y \"{}\"".format(os.path.join(self.source_folder, self._source_subfolder)), run_environment=True) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + self.run(f'scons install -Y "{self.source_folder}"') - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self.settings.os == "Windows": - for file in glob.glob(os.path.join(self.package_folder, "lib", "*.exp")): - os.unlink(file) - for file in glob.glob(os.path.join(self.package_folder, "lib", "*.pdb")): - os.unlink(file) + rm(self, "*.exp", os.path.join(self.package_folder, "lib"), recursive=True) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib"), recursive=True) if self.options.shared: - for file in glob.glob(os.path.join(self.package_folder, "lib", "serf-{}.*".format(self._version_major))): - os.unlink(file) - tools.mkdir(os.path.join(self.package_folder, "bin")) - os.rename(os.path.join(self.package_folder, "lib", "libserf-{}.dll".format(self._version_major)), - os.path.join(self.package_folder, "bin", "libserf-{}.dll".format(self._version_major))) + rm(self, f"serf-{self._version_major}.*", os.path.join(self.package_folder, "lib"), recursive=True) + mkdir(self, os.path.join(self.package_folder, "bin")) + os.rename(os.path.join(self.package_folder, "lib", f"libserf-{self._version_major}.dll"), + os.path.join(self.package_folder, "bin", f"libserf-{self._version_major}.dll")) else: - for file in glob.glob(os.path.join(self.package_folder, "lib", "libserf-{}.*".format(self._version_major))): - os.unlink(file) + rm(self, f"libserf-{self._version_major}.*", os.path.join(self.package_folder, "lib"), recursive=True) else: ext_to_remove = self._static_ext if self.options.shared else self._shared_ext 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)) - - @property - def _version_major(self): - return self.version.split(".", 1)[0] + fix_apple_shared_install_name(self) def package_info(self): libprefix = "" if self.settings.os == "Windows" and self.options.shared: libprefix = "lib" - libname = "{}serf-{}".format(libprefix, self._version_major) + version_major = Version(self.version).major + libname = f"{libprefix}serf-{version_major}" self.cpp_info.libs = [libname] - self.cpp_info.includedirs.append(os.path.join("include", "serf-{}".format(self._version_major))) - self.cpp_info.names["pkg_config"] = libname + self.cpp_info.includedirs.append(os.path.join("include", f"serf-{version_major}")) + self.cpp_info.set_property("pkg_config_name", libname) if self.settings.os == "Windows": self.cpp_info.system_libs = ["user32", "advapi32", "gdi32", "ws2_32", "crypt32", "mswsock", "rpcrt4", "secur32"] diff --git a/recipes/serf/all/patches/0006-1.3.9-scons-fix-zlib-shared-name.patch b/recipes/serf/all/patches/0006-1.3.9-scons-fix-zlib-shared-name.patch new file mode 100644 index 00000000000000..144bdf9d5c3cc4 --- /dev/null +++ b/recipes/serf/all/patches/0006-1.3.9-scons-fix-zlib-shared-name.patch @@ -0,0 +1,19 @@ +--- SConstruct 2015-09-17 14:46:24.000000000 +0200 ++++ SConstruct 2023-10-23 12:11:41.087125000 +0200 +@@ -117,6 +117,7 @@ + None), + RawListVariable('CPPFLAGS', "Extra flags for the C preprocessor " + "(space separated)", None), ++ RawListVariable('ZLIB_LIBNAME', 'Name of the zlib library file', 'zlib.lib'), + ) + + if sys.platform == 'win32': +@@ -326,7 +327,7 @@ + CPPPATH=['$APR/include', '$APU/include']) + + # zlib +- env.Append(LIBS=['zlib.lib']) ++ env.Append(LIBS=[env['ZLIB_LIBNAME'][0]]) + if not env.get('SOURCE_LAYOUT', None): + env.Append(CPPPATH=['$ZLIB/include'], + LIBPATH=['$ZLIB/lib']) diff --git a/recipes/serf/all/test_package/CMakeLists.txt b/recipes/serf/all/test_package/CMakeLists.txt index f8b971e2db3772..6423a8f84e1749 100644 --- a/recipes/serf/all/test_package/CMakeLists.txt +++ b/recipes/serf/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(serf REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE serf::serf) diff --git a/recipes/serf/all/test_package/conanfile.py b/recipes/serf/all/test_package/conanfile.py index 4aebe114eeb59c..ef5d7042163ecc 100644 --- a/recipes/serf/all/test_package/conanfile.py +++ b/recipes/serf/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", "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 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/serf/all/test_v1_package/CMakeLists.txt b/recipes/serf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/serf/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/serf/all/test_v1_package/conanfile.py b/recipes/serf/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..3f4a9f50f389e4 --- /dev/null +++ b/recipes/serf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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/serial/all/CMakeLists.txt b/recipes/serial/all/CMakeLists.txt index 25209c318b9855..bb8bfce6bd49dd 100644 --- a/recipes/serial/all/CMakeLists.txt +++ b/recipes/serial/all/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.12) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup() - # Work-around for https://github.com/wjwwood/serial/issues/135 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) @@ -11,6 +8,6 @@ if(WIN32 AND BUILD_SHARED_LIBS) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() -add_subdirectory(source_subfolder) +add_subdirectory(src) install(TARGETS serial) diff --git a/recipes/serial/all/conanfile.py b/recipes/serial/all/conanfile.py index d5553000bbddb3..b0bd05408cdc0d 100644 --- a/recipes/serial/all/conanfile.py +++ b/recipes/serial/all/conanfile.py @@ -1,17 +1,22 @@ import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration, ConanException + +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.53.0" class ConanRecipe(ConanFile): name = "serial" description = "Cross-platform library for interfacing with rs-232 serial like ports" - topics = ("serial", "rs-232", "com") - homepage = "http://wjwwood.io/serial/" - url = "https://github.com/conan-io/conan-center-index" license = "MIT" - exports_sources = ["CMakeLists.txt", "Findcatkin.cmake"] - generators = "cmake" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://wjwwood.io/serial/" + topics = ("rs-232", "com") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,11 +27,9 @@ class ConanRecipe(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "Findcatkin.cmake", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -34,35 +37,38 @@ 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 source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("{}-{}".format(self.name, self.version), - 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.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) cmake.build() def package(self): - self.copy("README.md", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "README.md", + 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 = ["serial"] - if self.settings.os == "Linux": - self.cpp_info.system_libs = ["rt", "pthread"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "rt", "pthread"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["setupapi"] - elif tools.is_apple_os(self.settings.os): - self.cpp_info.frameworks = ["IOKit", "Foundation"] + elif is_apple_os(self): + self.cpp_info.frameworks = ["IOKit", "Foundation", "CoreFoundation"] diff --git a/recipes/serial/all/test_package/CMakeLists.txt b/recipes/serial/all/test_package/CMakeLists.txt index 328eaf93b7304d..344a587ace2193 100644 --- a/recipes/serial/all/test_package/CMakeLists.txt +++ b/recipes/serial/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(serial REQUIRED) +find_package(serial REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} serial::serial) diff --git a/recipes/serial/all/test_package/conanfile.py b/recipes/serial/all/test_package/conanfile.py index 5493d58611803c..ef5d7042163ecc 100644 --- a/recipes/serial/all/test_package/conanfile.py +++ b/recipes/serial/all/test_package/conanfile.py @@ -1,9 +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) @@ -11,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/serial/all/test_v1_package/CMakeLists.txt b/recipes/serial/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/serial/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/serial/all/test_v1_package/conanfile.py b/recipes/serial/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..1bf1c7e26255d4 --- /dev/null +++ b/recipes/serial/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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/serial/all/test_v1_package/test_package.cpp b/recipes/serial/all/test_v1_package/test_package.cpp new file mode 100644 index 00000000000000..8cb01ed6a8b53e --- /dev/null +++ b/recipes/serial/all/test_v1_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include +#include +#include + +#include "serial/serial.h" + +using namespace std; + +int main() { + vector devices_found = serial::list_ports(); + + vector::iterator iter = devices_found.begin(); + + while (iter != devices_found.end()) { + serial::PortInfo device = *iter++; + + printf("(%s, %s, %s)\n", device.port.c_str(), + device.description.c_str(), device.hardware_id.c_str()); + } + + return 0; +} 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..c29aef0d78113d 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 = { @@ -60,8 +60,8 @@ def requirements(self): self.requires("libudev/system") self.requires("xorg/system") if self.options.graphics: - self.requires("freetype/2.13.0") - self.requires("stb/cci.20220909") + self.requires("freetype/2.13.2") + 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/shapelib/all/conandata.yml b/recipes/shapelib/all/conandata.yml index 5dde0cb6bfee12..16ed675c6719f7 100644 --- a/recipes/shapelib/all/conandata.yml +++ b/recipes/shapelib/all/conandata.yml @@ -12,3 +12,6 @@ patches: patch_description: "Use the standard BUILD_TESTING variable to control building tests" patch_source: "https://github.com/OSGeo/shapelib/pull/46" patch_type: "portability" + - patch_file: "patches/0003-relocatable-shared-macos.patch" + patch_description: "Relocatable shared lib on macOS" + patch_type: "conan" diff --git a/recipes/shapelib/all/conanfile.py b/recipes/shapelib/all/conanfile.py index 19059022ab189c..bed1f979c1ec89 100644 --- a/recipes/shapelib/all/conanfile.py +++ b/recipes/shapelib/all/conanfile.py @@ -4,16 +4,17 @@ from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class ShapelibConan(ConanFile): name = "shapelib" description = "C library for reading and writing ESRI Shapefiles" - license = "LGPL-2.0-or-later" + license = "LGPL-2.0-or-later", "MIT" topics = ("osgeo", "shapefile", "esri", "geospatial") homepage = "https://github.com/OSGeo/shapelib" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -45,9 +46,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.variables["BUILD_TESTING"] = False - tc.variables["USE_RPATH"] = False + tc.cache_variables["USE_RPATH"] = False tc.generate() def build(self): @@ -58,6 +58,7 @@ def build(self): def package(self): copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "license.html", os.path.join(self.source_folder, "web"), os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rm(self, "*.exe", os.path.join(self.package_folder, "bin")) diff --git a/recipes/shapelib/all/patches/0003-relocatable-shared-macos.patch b/recipes/shapelib/all/patches/0003-relocatable-shared-macos.patch new file mode 100644 index 00000000000000..5994e77d745e17 --- /dev/null +++ b/recipes/shapelib/all/patches/0003-relocatable-shared-macos.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -117,7 +117,6 @@ set_target_properties(shp + PROPERTIES + SOVERSION ${shp_SOVERSION} + VERSION ${shp_VERSION} +- INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}" + ) + + if(USE_RPATH) diff --git a/recipes/shapelib/all/test_package/CMakeLists.txt b/recipes/shapelib/all/test_package/CMakeLists.txt index 30289c1a8112b9..2d8b5a050f64f1 100644 --- a/recipes/shapelib/all/test_package/CMakeLists.txt +++ b/recipes/shapelib/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(shapelib REQUIRED CONFIG) diff --git a/recipes/shapelib/all/test_v1_package/CMakeLists.txt b/recipes/shapelib/all/test_v1_package/CMakeLists.txt index 925ecbe19e448d..2f11d9b196ef70 100644 --- a/recipes/shapelib/all/test_v1_package/CMakeLists.txt +++ b/recipes/shapelib/all/test_v1_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) diff --git a/recipes/shield/all/conandata.yml b/recipes/shield/all/conandata.yml index 38803c2a64ad9f..76d8f2a0a392dd 100644 --- a/recipes/shield/all/conandata.yml +++ b/recipes/shield/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5": + url: "https://github.com/holoplot/shield/archive/0.5.tar.gz" + sha256: "f6494b1c95aeddb23fe507ab8da17234ecd7ca6aff97a92112e1e6459b343ff3" "0.4": url: "https://github.com/holoplot/shield/archive/0.4.tar.gz" sha256: "b93661c463b6a3af1900b9ea94bf0f75bc1bc6bd4d98b700cb29a62249fb6089" diff --git a/recipes/shield/config.yml b/recipes/shield/config.yml index b3c1faaf54b2ba..ab08cd3e58a8ce 100644 --- a/recipes/shield/config.yml +++ b/recipes/shield/config.yml @@ -1,4 +1,6 @@ versions: + "0.5": + folder: all "0.4": folder: all "0.3": diff --git a/recipes/si/all/CMakeLists.txt b/recipes/si/all/CMakeLists.txt deleted file mode 100644 index 6c3ae2de9686da..00000000000000 --- a/recipes/si/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/../conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/si/all/conandata.yml b/recipes/si/all/conandata.yml index 5576f1491e1a59..b17e4f76ae2c0d 100644 --- a/recipes/si/all/conandata.yml +++ b/recipes/si/all/conandata.yml @@ -1,28 +1,19 @@ sources: - 1.7.6: - url: https://github.com/bernedom/SI/archive/1.7.6.tar.gz - sha256: 88041156890c34f7ca92f3ae385b19189583aa5c59ac470bfe2db6df5d5c954b - 2.0.4: - url: https://github.com/bernedom/SI/archive/2.0.4.tar.gz - sha256: 459936b913e887325e6ad69e9d64389b80f49e700aa8e5308df2bd77b8c74a0e - 2.1.3: - url: https://github.com/bernedom/SI/archive/2.1.3.tar.gz - sha256: c4728155bd8878fecc5c71c006e01cb193e6084d1604f79edc71ee723027534b - 2.2.0: - url: https://github.com/bernedom/SI/archive/2.2.0.tar.gz - sha256: 4b42dbe878995e19991487b60e235699b02858a5036a1729890d7adc865794bf - 2.3.0: - url: https://github.com/bernedom/SI/archive/2.3.0.tar.gz - sha256: b714162a933ddf1be66c8f2f2d31b52626189d6e4b292770bbb899106e8f6ac1 - 2.4.0: - url: https://github.com/bernedom/SI/archive/2.4.0.tar.gz - sha256: 84e13b52520808d9a55a073b1bb98376be03dc3b09ddee862a1418ef543e9f2d - 2.4.1: - url: https://github.com/bernedom/SI/archive/2.4.1.tar.gz - sha256: 6bfdbebb549da1b2db93b55c1c7f8228a0cdc6144a815319918237ca8601ad3a - 2.5.0: - url: https://github.com/bernedom/SI/archive/2.5.0.tar.gz - sha256: dc00eb8cfaa32e19c83595b238726188d2b857f8999dae08fe3001d0107ba276 + 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 + url: "https://github.com/bernedom/SI/archive/2.5.1.tar.gz" + sha256: "b7b977c04c220a47a2bd3b8e2b6acfd640d286dfe1ae609f20e184cfec998798" + 2.5.0: + url: "https://github.com/bernedom/SI/archive/2.5.0.tar.gz" + sha256: "dc00eb8cfaa32e19c83595b238726188d2b857f8999dae08fe3001d0107ba276" + 2.4.1: + url: "https://github.com/bernedom/SI/archive/2.4.1.tar.gz" + sha256: "6bfdbebb549da1b2db93b55c1c7f8228a0cdc6144a815319918237ca8601ad3a" + 2.3.0: + url: "https://github.com/bernedom/SI/archive/2.3.0.tar.gz" + sha256: "b714162a933ddf1be66c8f2f2d31b52626189d6e4b292770bbb899106e8f6ac1" + 1.7.6: + url: "https://github.com/bernedom/SI/archive/1.7.6.tar.gz" + sha256: "88041156890c34f7ca92f3ae385b19189583aa5c59ac470bfe2db6df5d5c954b" diff --git a/recipes/si/all/conanfile.py b/recipes/si/all/conanfile.py index 38915243d0beff..ef396846127aaf 100644 --- a/recipes/si/all/conanfile.py +++ b/recipes/si/all/conanfile.py @@ -1,31 +1,33 @@ -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.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 + +required_conan_version = ">=1.52.0" + class SiConan(ConanFile): name = "si" + description = ( + "A header only c++ library that provides type safety and user defined literals " + "for handling physical values defined in the International System of Units." + ) license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/bernedom/SI" - description = "A header only c++ library that provides type safety and user defined literals \ - for handling pyhsical values defined in the International System of Units." - topics = ("physical units", "SI-unit-conversion", - "cplusplus-library", "cplusplus-17") - exports_sources = "CMakeLists.txt" + topics = ("physical units", "SI-unit-conversion", "cplusplus-library", "cplusplus-17", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -36,38 +38,51 @@ def _compilers_minimum_version(self): "apple-clang": "10", } + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") + check_min_cppstd(self, self._min_cppstd) - minimum_version = self._compilers_minimum_version.get( - str(self.settings.compiler), False) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("'si' requires C++17, which your compiler ({} {}) does not support.".format( - self.settings.compiler, self.settings.compiler.version)) + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + "'si' requires C++17, which your compiler " + f"({self.settings.compiler} {self.settings.compiler.version}) does not support.") else: - self.output.warn( - "'si' requires C++17. Your compiler is unknown. Assuming it supports C++17.") + self.output.warning("'si' requires C++17. Your compiler is unknown. Assuming it supports C++17.") - def package_id(self): - self.info.header_only() + def build_requirements(self): + if Version(self.version) >= "2.5.1": + self.tool_requires("cmake/[>=3.23 <4]") 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["SI_BUILD_TESTING"] = False + tc.variables["SI_BUILD_DOC"] = False + tc.variables["SI_INSTALL_LIBRARY"] = True + tc.generate() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) - cmake.definitions["SI_BUILD_TESTING"] = False - cmake.definitions["SI_BUILD_DOC"] = False - cmake.definitions["SI_INSTALL_LIBRARY"] = True - cmake.configure(build_folder=self._build_subfolder) + cmake.configure() 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.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "SI") self.cpp_info.set_property("cmake_target_name", "SI::SI") self.cpp_info.names["cmake_find_package"] = "SI" diff --git a/recipes/si/all/test_package/CMakeLists.txt b/recipes/si/all/test_package/CMakeLists.txt index 14c1322818a6b8..b7052eb3cd9b33 100644 --- a/recipes/si/all/test_package/CMakeLists.txt +++ b/recipes/si/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -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(SI REQUIRED CONFIG) diff --git a/recipes/si/all/test_package/conanfile.py b/recipes/si/all/test_package/conanfile.py index 8ae9b638e62feb..ef5d7042163ecc 100644 --- a/recipes/si/all/test_package/conanfile.py +++ b/recipes/si/all/test_package/conanfile.py @@ -1,11 +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) @@ -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/si/all/test_v1_package/CMakeLists.txt b/recipes/si/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/si/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/si/all/test_v1_package/conanfile.py b/recipes/si/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..8ae9b638e62feb --- /dev/null +++ b/recipes/si/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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/si/config.yml b/recipes/si/config.yml index 8530898d2c4b51..338eb274bf5bee 100644 --- a/recipes/si/config.yml +++ b/recipes/si/config.yml @@ -1,19 +1,13 @@ versions: - 1.7.6: - folder: all - 2.0.4: - folder: all - 2.1.3: + 2.5.3: folder: all - 2.2.0: - folder: all - 2.3.0: + 2.5.1: folder: all - 2.4.0: + 2.5.0: folder: all 2.4.1: folder: all - 2.5.0: + 2.3.0: folder: all - 2.5.1: + 1.7.6: folder: all diff --git a/recipes/signals-light/all/conandata.yml b/recipes/signals-light/all/conandata.yml new file mode 100644 index 00000000000000..6255a706e185e1 --- /dev/null +++ b/recipes/signals-light/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20210616": + url: "https://github.com/a-n-t-h-o-n-y/signals-light/archive/1070e931d20e6d0bf6dacfdca7c2b6094975fb16.tar.gz" + sha256: "b1dfcd5dced5b8e6aef066bc8f5d541f1122a4b807911bfb77b3ed0f4b2d4fec" diff --git a/recipes/signals-light/all/conanfile.py b/recipes/signals-light/all/conanfile.py new file mode 100644 index 00000000000000..c2bd67ed6c42ae --- /dev/null +++ b/recipes/signals-light/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +import os + +required_conan_version = ">=1.52.0" + +class SignalsLightConan(ConanFile): + name = "signals-light" + description = "Lightweight Signals & Slots Library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/a-n-t-h-o-n-y/signals-light/" + topics = ("signals", "slot", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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 does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.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.libdirs = [] diff --git a/recipes/signals-light/all/test_package/CMakeLists.txt b/recipes/signals-light/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d1721523eaa2c3 --- /dev/null +++ b/recipes/signals-light/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(signals-light REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE signals-light::signals-light) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/signals-light/all/test_package/conanfile.py b/recipes/signals-light/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/signals-light/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/signals-light/all/test_package/test_package.cpp b/recipes/signals-light/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..94e057ccb61379 --- /dev/null +++ b/recipes/signals-light/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include "signals_light/signal.hpp" + +int main(void) { + auto signal = sl::Signal{}; + signal.connect([](int i){ std::cout << i << '\n'; }); + signal.connect([](int i){ std::cout << i * 2 << '\n'; }); + + signal(4); // prints "4\n8\n" to standard output. +} diff --git a/recipes/signals-light/config.yml b/recipes/signals-light/config.yml new file mode 100644 index 00000000000000..cbec618d4f846a --- /dev/null +++ b/recipes/signals-light/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210616": + folder: all diff --git a/recipes/simde/all/conanfile.py b/recipes/simde/all/conanfile.py index 9ede298cf49ed4..492893a0540fba 100644 --- a/recipes/simde/all/conanfile.py +++ b/recipes/simde/all/conanfile.py @@ -26,9 +26,9 @@ def package_id(self): self.info.clear() def build_requirements(self): - self.tool_requires("meson/1.1.1") + self.tool_requires("meson/1.2.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") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml index 68f7a88456dcd1..3f7b97847e1699 100644 --- a/recipes/simdjson/all/conandata.yml +++ b/recipes/simdjson/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "3.6.1": + url: "https://github.com/simdjson/simdjson/archive/v3.6.1.tar.gz" + sha256: "76601d1701232a212b62d25d3a6518219b2504ff84e8073c6df7393b2ead3176" + "3.6.0": + url: "https://github.com/simdjson/simdjson/archive/v3.6.0.tar.gz" + sha256: "9eab3197231382b8b99d14d8ca647d6ab6bea1b40008df086d25e6f687309bf6" + "3.5.0": + url: "https://github.com/simdjson/simdjson/archive/v3.5.0.tar.gz" + sha256: "942c9462b3c046e12b898cbf5e198f31a377ab40bb2bde5be98440d1f9212ee0" + "3.3.0": + url: "https://github.com/simdjson/simdjson/archive/v3.3.0.tar.gz" + sha256: "a8c9feff2f19c3ff281d42f0b6b4b18f02236513b99229756fa9a1b14787a58a" + "3.2.3": + url: "https://github.com/simdjson/simdjson/archive/v3.2.3.tar.gz" + sha256: "ab72701b8560c4f93a5de525657b3bf34094f99a1e63bd9db3195d1bcb90aa09" + "3.2.2": + url: "https://github.com/simdjson/simdjson/archive/v3.2.2.tar.gz" + sha256: "13a702536e051db612cdca82bf8585f2c69d9c6fd156ef291b170f13202c1b4c" "3.2.1": url: "https://github.com/simdjson/simdjson/archive/v3.2.1.tar.gz" sha256: "121206c9bfe972a2202a74d4cddb8cb0561932427f96d6c4b70fb49a2a74560e" @@ -8,27 +26,9 @@ sources: "3.1.8": url: "https://github.com/simdjson/simdjson/archive/v3.1.8.tar.gz" sha256: "99e7eeb0a0038e0213da68f099e6a8b67bcaeea1586385ec5f752bea85d902d8" - "3.1.7": - url: "https://github.com/simdjson/simdjson/archive/v3.1.7.tar.gz" - sha256: "c65f5184fba321c7b9e97f6c881af9b607457bdd60fac0467010e099121540e2" - "3.1.5": - url: "https://github.com/simdjson/simdjson/archive/v3.1.5.tar.gz" - sha256: "5b916be17343324426fc467a4041a30151e481700d60790acfd89716ecc37076" - "3.1.1": - url: "https://github.com/simdjson/simdjson/archive/v3.1.1.tar.gz" - sha256: "4fcb1c9b1944e2eb8a4a4a22c979e2827165216f859e94d93c846c1261e0e432" - "3.1.0": - url: "https://github.com/simdjson/simdjson/archive/refs/tags/3.1.0.tar.gz" - sha256: "14d17ba7139d27c1e1bf01e765f5c26e84cc9e9be6a316c977638e01c7de85fa" "3.0.1": url: "https://github.com/simdjson/simdjson/archive/v3.0.1.tar.gz" sha256: "156b1bc5eb0561b2bd166b46d191fd3d95a3e709cc63761477d3b7aec2b6e9ed" "2.2.3": url: "https://github.com/simdjson/simdjson/archive/v2.2.3.tar.gz" sha256: "4c62f2d82edec3dbc63650c10453dc471de9f1be689eb5b4bde89efed89db5d8" - "1.1.0": - url: "https://github.com/simdjson/simdjson/archive/v1.1.0.tar.gz" - sha256: "9effcb21fe48e4bcc9b96031e60c3911c58aa656ad8c78212d269c0db9e0133e" - "0.9.7": - url: "https://github.com/simdjson/simdjson/archive/v0.9.7.tar.gz" - sha256: "a21279ae4cf0049234a822c5c3550f99ec1707d3cda12156d331dcc8cd411ba0" diff --git a/recipes/simdjson/all/conanfile.py b/recipes/simdjson/all/conanfile.py index b0c6d0fa54bf1d..7b42a92cdbbc87 100644 --- a/recipes/simdjson/all/conanfile.py +++ b/recipes/simdjson/all/conanfile.py @@ -72,8 +72,7 @@ def loose_lt_semver(v1, v2): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not fully support." ) - if Version(self.version) >= "2.0.0" and \ - self.settings.compiler == "gcc" and \ + if self.settings.compiler == "gcc" and \ Version(self.settings.compiler.version).major == "9": if self.settings.compiler.get_safe("libcxx") == "libstdc++11": raise ConanInvalidConfiguration(f"{self.ref} doesn't support GCC 9 with libstdc++11.") @@ -86,24 +85,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["SIMDJSON_ENABLE_THREADS"] = self.options.threads - if Version(self.version) < "1.0.0": - tc.variables["SIMDJSON_BUILD_STATIC"] = not self.options.shared - tc.variables["SIMDJSON_SANITIZE"] = False - tc.variables["SIMDJSON_JUST_LIBRARY"] = True - else: - tc.variables["SIMDJSON_DEVELOPER_MODE"] = False + tc.variables["SIMDJSON_DEVELOPER_MODE"] = False tc.generate() def _patch_sources(self): - if Version(self.version) < "1.0.0": - simd_flags_file = os.path.join(self.source_folder, "cmake", "simdjson-flags.cmake") - # Those flags are not set in >=1.0.0 since we disable SIMDJSON_DEVELOPER_MODE - replace_in_file(self, simd_flags_file, "target_compile_options(simdjson-internal-flags INTERFACE -fPIC)", "") - replace_in_file(self, simd_flags_file, "-Werror", "") - replace_in_file(self, simd_flags_file, "/WX", "") - # Relocatable shared lib on macOS - replace_in_file(self, simd_flags_file, "set(CMAKE_MACOSX_RPATH OFF)", "") - else: + if Version(self.version) < "3.3.0": developer_options = os.path.join(self.source_folder, "cmake", "developer-options.cmake") # Relocatable shared lib on macOS replace_in_file(self, developer_options, "set(CMAKE_MACOSX_RPATH OFF)", "") diff --git a/recipes/simdjson/config.yml b/recipes/simdjson/config.yml index 5a66369f45d95a..c4ccbb7735a041 100644 --- a/recipes/simdjson/config.yml +++ b/recipes/simdjson/config.yml @@ -1,23 +1,23 @@ versions: - "3.2.1": + "3.6.1": folder: all - "3.2.0": + "3.6.0": folder: all - "3.1.8": + "3.5.0": folder: all - "3.1.7": + "3.3.0": folder: all - "3.1.5": + "3.2.3": folder: all - "3.1.1": + "3.2.2": folder: all - "3.1.0": + "3.2.1": folder: all - "3.0.1": + "3.2.0": folder: all - "2.2.3": + "3.1.8": folder: all - "1.1.0": + "3.0.1": folder: all - "0.9.7": + "2.2.3": folder: all diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml index b0cd66f4e34df9..b28c517c6191ab 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "4.0.5": + url: "https://github.com/simdutf/simdutf/archive/v4.0.5.tar.gz" + sha256: "040d80ff4321f89ea9739ccc7f468ece9c4bc2630f3d4762b6d829000d2ec625" + "4.0.4": + url: "https://github.com/simdutf/simdutf/archive/v4.0.4.tar.gz" + sha256: "fd24bab9754e24f42e6cd2c9d336accb2674c306f9221c00fb095fe95cfe9247" + "4.0.3": + url: "https://github.com/simdutf/simdutf/archive/v4.0.3.tar.gz" + sha256: "00429eca296f00d9b93939d2561538bad601602ad02fd01ba9ad366268773751" + "3.2.17": + url: "https://github.com/simdutf/simdutf/archive/v3.2.17.tar.gz" + sha256: "c24e3eec1e08522a09b33e603352e574f26d367a7701bf069a65881f64acd519" + "3.2.15": + url: "https://github.com/simdutf/simdutf/archive/v3.2.15.tar.gz" + sha256: "c26d2e2e9124e1c20335d3880d74c8b0d74a5e247ba82ef82d15df4ccc413bcd" "3.2.14": url: "https://github.com/simdutf/simdutf/archive/v3.2.14.tar.gz" sha256: "6bd6cd41e0e588312c3ae24adb297454bd9bd9622ed7443f41300d7201f233a1" @@ -17,22 +32,15 @@ sources: "2.2.0": url: "https://github.com/simdutf/simdutf/archive/v2.2.0.tar.gz" sha256: "b0b8527e194700363cc47e75a7b8d58c88798b0dc31671f5ae5c8803d8678fe6" - "2.1.0": - url: "https://github.com/simdutf/simdutf/archive/v2.1.0.tar.gz" - sha256: "a8a8bbd71c8d8be1f7da16722776988d0640758fe0a46066eb3129868dad08da" - "2.0.9": - url: "https://github.com/simdutf/simdutf/archive/v2.0.9.tar.gz" - sha256: "ff6a19de4c23671e7f1077cf6c0f60bc01197f29c6e4f56fa485c9cd732576ac" - "2.0.8": - url: "https://github.com/simdutf/simdutf/archive/v2.0.8.tar.gz" - sha256: "bd7aa550a8d9a1aba2c0b4eb2088f90c964375b13394f9076f7ba49f51dc40b5" - "2.0.6": - url: "https://github.com/simdutf/simdutf/archive/v2.0.6.tar.gz" - sha256: "40f1f9a4403f81c2c3d736ef9c73662835b2241871caa262fcd654e0898f9e4e" - "1.0.1": - url: "https://github.com/simdutf/simdutf/archive/v1.0.1.tar.gz" - sha256: "e7832ba58fb95fe00de76dbbb2f17d844a7ad02a6f5e3e9e5ce9520e820049a0" patches: + "3.2.17": + - patch_file: "patches/3.2.17-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" + "3.2.15": + - patch_file: "patches/3.2.14-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" "3.2.14": - patch_file: "patches/3.2.14-0001-fix-cmake.patch" patch_description: "remove static build, enable rpath on macOS" @@ -57,29 +65,3 @@ patches: - patch_file: "patches/2.0.3-0001-fix-cmake.patch" patch_description: "remove static build, enable rpath on macOS" patch_type: "conan" - "2.1.0": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "2.0.9": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "2.0.8": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "2.0.6": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - - patch_file: "patches/2.0.6-0002-add-workaround-gcc9.patch" - patch_description: "apply gcc8 workaround to gcc9" - patch_type: "portability" - "1.0.1": - - patch_file: "patches/1.0.1-0001-fix-cmake.patch" - patch_description: "disable test and benchmark build and enable rpath on macOS" - patch_type: "conan" - - patch_file: "patches/1.0.1-0002-remove-static.patch" - patch_description: "remove static build only" - patch_type: "conan" diff --git a/recipes/simdutf/all/conanfile.py b/recipes/simdutf/all/conanfile.py index 6ac2ab3946ae3d..e0a52dd250245b 100644 --- a/recipes/simdutf/all/conanfile.py +++ b/recipes/simdutf/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout @@ -27,7 +28,7 @@ class SimdutfConan(ConanFile): } @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 11 def export_sources(self): @@ -45,8 +46,15 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, self._minimum_cpp_standard) + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + ## simdutf >= 4.0.0 requires _mm_storeu_si64 + if Version(self.version) >= "4.0.0": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 9.") + if self.settings.compiler == "gcc" and self.settings.build_type == "Debug" and \ + Version(self.settings.compiler.version) < "10.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 10 with debug build") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -57,8 +65,7 @@ def generate(self): tc.variables["BUILD_TESTING"] = False if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "8": tc.variables["CMAKE_CXX_FLAGS"] = " -mavx512f" - if Version(self.version) >= "2.0.3": - tc.variables["SIMDUTF_TOOLS"] = False + tc.variables["SIMDUTF_TOOLS"] = False tc.generate() deps = CMakeDeps(self) deps.generate() @@ -74,6 +81,7 @@ def package(self): 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.libs = ["simdutf"] diff --git a/recipes/simdutf/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/simdutf/all/patches/1.0.1-0001-fix-cmake.patch deleted file mode 100644 index 7110c904b0efe2..00000000000000 --- a/recipes/simdutf/all/patches/1.0.1-0001-fix-cmake.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cb8fb1f..66f76ec 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -14,17 +14,17 @@ include(cmake/simdutf-flags.cmake) - - set(SIMDUTF_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - --enable_testing() -+#enable_testing() - add_subdirectory(src) --add_subdirectory(tests) -+# add_subdirectory(tests) - - - --if(CMAKE_CXX_COMPILER_ID MATCHES GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) -- message(STATUS "The benchmark tool requires GCC 8.0 or better.") --else() -- add_subdirectory(benchmarks) --endif() -+#if(CMAKE_CXX_COMPILER_ID MATCHES GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) -+# message(STATUS "The benchmark tool requires GCC 8.0 or better.") -+#else() -+# add_subdirectory(benchmarks) -+#endif() - - - # ---- Install rules ---- -diff --git a/cmake/simdutf-flags.cmake b/cmake/simdutf-flags.cmake -index 9263a7f..39f5a8c 100644 ---- a/cmake/simdutf-flags.cmake -+++ b/cmake/simdutf-flags.cmake -@@ -16,4 +16,4 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake") - set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) --set(CMAKE_MACOSX_RPATH OFF) -+set(CMAKE_MACOSX_RPATH ON) diff --git a/recipes/simdutf/all/patches/1.0.1-0002-remove-static.patch b/recipes/simdutf/all/patches/1.0.1-0002-remove-static.patch deleted file mode 100644 index cdc06b6c7fd09c..00000000000000 --- a/recipes/simdutf/all/patches/1.0.1-0002-remove-static.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 4322f3f..476fd35 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -3,7 +3,7 @@ target_include_directories(simdutf-include-source INTERFACE $/simdutf.cpp) - target_link_libraries(simdutf-source INTERFACE simdutf-include-source) --add_library(simdutf STATIC simdutf.cpp) -+add_library(simdutf simdutf.cpp) - target_include_directories(simdutf PRIVATE $ ) - target_include_directories(simdutf PUBLIC "$") - diff --git a/recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch b/recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch deleted file mode 100644 index 957a9759ee2fac..00000000000000 --- a/recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/src/icelake/icelake_utf8_common.inl.cpp b/src/icelake/icelake_utf8_common.inl.cpp -index 962700b..a192a18 100644 ---- a/src/icelake/icelake_utf8_common.inl.cpp -+++ b/src/icelake/icelake_utf8_common.inl.cpp -@@ -448,12 +448,12 @@ __m512i prev(__m512i input, __m512i previous) { - static_assert(N<=32, "N must be no larger than 32"); - const __m512i movemask = _mm512_setr_epi32(28,29,30,31,0,1,2,3,4,5,6,7,8,9,10,11); - const __m512i rotated = _mm512_permutex2var_epi32(input, movemask, previous); --#if SIMDUTF_GCC8 -- constexpr int shift = 16-N; // workaround for GCC8 -+#if SIMDUTF_GCC8 || SIMDUTF_GCC9 -+ constexpr int shift = 16-N; // workaround for GCC8,9 - return _mm512_alignr_epi8(input, rotated, shift); - #else - return _mm512_alignr_epi8(input, rotated, 16-N); --#endif // SIMDUTF_GCC8 -+#endif // SIMDUTF_GCC8 || SIMDUTF_GCC9 - } - - template -diff --git a/src/simdutf/icelake/intrinsics.h b/src/simdutf/icelake/intrinsics.h -index c71a085..edcd289 100644 ---- a/src/simdutf/icelake/intrinsics.h -+++ b/src/simdutf/icelake/intrinsics.h -@@ -64,7 +64,9 @@ - #if defined(__GNUC__) && !defined(__clang__) - #if __GNUC__ == 8 - #define SIMDUTF_GCC8 1 --#endif // __GNUC__ == 8 -+#elif __GNUC__ == 9 -+#define SIMDUTF_GCC9 1 -+#endif // __GNUC__ == 8 || __GNUC__ == 9 - #endif // defined(__GNUC__) && !defined(__clang__) - - #if SIMDUTF_GCC8 -@@ -83,4 +85,4 @@ inline __m512i _mm512_set_epi8(uint8_t a0, uint8_t a1, uint8_t a2, uint8_t a3, u - } - #endif // SIMDUTF_GCC8 - --#endif // SIMDUTF_HASWELL_INTRINSICS_H -\ No newline at end of file -+#endif // SIMDUTF_HASWELL_INTRINSICS_H diff --git a/recipes/simdutf/all/patches/3.2.17-0001-fix-cmake.patch b/recipes/simdutf/all/patches/3.2.17-0001-fix-cmake.patch new file mode 100644 index 00000000000000..6f1f0aa23c2310 --- /dev/null +++ b/recipes/simdutf/all/patches/3.2.17-0001-fix-cmake.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/simdutf-flags.cmake b/cmake/simdutf-flags.cmake +index d1e9bcd..2ff37c0 100644 +--- a/cmake/simdutf-flags.cmake ++++ b/cmake/simdutf-flags.cmake +@@ -22,4 +22,3 @@ set(SIMDUTF_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for simdutf") + set(CMAKE_CXX_STANDARD ${SIMDUTF_CXX_STANDARD}) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) +-set(CMAKE_MACOSX_RPATH OFF) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ed6be55..0b649c6 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -3,7 +3,7 @@ target_include_directories(simdutf-include-source INTERFACE $/simdutf.cpp) + target_link_libraries(simdutf-source INTERFACE simdutf-include-source) +-add_library(simdutf STATIC simdutf.cpp) ++add_library(simdutf simdutf.cpp) + target_include_directories(simdutf PRIVATE $ ) + target_include_directories(simdutf PUBLIC "$") + diff --git a/recipes/simdutf/config.yml b/recipes/simdutf/config.yml index ec7185837f86c2..d16a8ca4a324b7 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,4 +1,14 @@ versions: + "4.0.5": + folder: all + "4.0.4": + folder: all + "4.0.3": + folder: all + "3.2.17": + folder: all + "3.2.15": + folder: all "3.2.14": folder: all "3.2.2": @@ -11,13 +21,3 @@ versions: folder: all "2.2.0": folder: all - "2.1.0": - folder: all - "2.0.9": - folder: all - "2.0.8": - folder: all - "2.0.6": - folder: all - "1.0.1": - folder: all diff --git a/recipes/simple-websocket-server/all/conanfile.py b/recipes/simple-websocket-server/all/conanfile.py index 65dfdeec4ffb5b..c4f98b42cbc3dd 100644 --- a/recipes/simple-websocket-server/all/conanfile.py +++ b/recipes/simple-websocket-server/all/conanfile.py @@ -31,7 +31,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("openssl/1.1.1q") + self.requires("openssl/[>=1.1 <4]") # only version 2.0.2 upwards is able to build against asio 1.18.0 or higher if Version(self.version) <= "2.0.1": if self.options.use_asio_standalone: @@ -40,9 +40,9 @@ def requirements(self): self.requires("boost/1.73.0") else: if self.options.use_asio_standalone: - self.requires("asio/1.28.0") + self.requires("asio/1.28.1") else: - self.requires("boost/1.82.0") + self.requires("boost/1.83.0") def package_id(self): self.info.clear() diff --git a/recipes/simple-yaml/all/conanfile.py b/recipes/simple-yaml/all/conanfile.py index fea9f3e7e071f5..afb2abee08c4c0 100644 --- a/recipes/simple-yaml/all/conanfile.py +++ b/recipes/simple-yaml/all/conanfile.py @@ -1,74 +1,88 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -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 SimpleYamlConan(ConanFile): name = "simple-yaml" + description = "Read configuration files in YAML format by code structure" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Rechip/simple-yaml" - description = "Read configuration files in YAML format by code structure" - topics = ("cpp", "yaml", "configuration") - settings = ["compiler"] - no_copy_source = True + topics = ("cpp", "yaml", "configuration", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" options = { "enable_enum": [True, False], } default_options = { - "enable_enum": True + "enable_enum": True, } + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def requirements(self): - self.requires("pretty-name/1.0.0") - self.requires("yaml-cpp/0.7.0") - self.requires("source_location/0.2.0") - if self.options.enable_enum: - self.requires("magic_enum/0.7.3") - - def package(self): - self.copy(pattern="LICENSE", dst="licenses", - src=self._source_subfolder) - self.copy(pattern="*", dst="include", - src=os.path.join(self._source_subfolder, "include")) + def _min_cppstd(self): + return 20 @property def _minimum_compilers_version(self): return { - "Visual Studio": "16.3", "gcc": "10", "clang": "11", "apple-clang": "13.3", + "msvc": "193", + "Visual Studio": "16.3", } + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("pretty-name/1.0.0") + self.requires("yaml-cpp/0.8.0") + self.requires("source_location/0.2.1") + if self.options.enable_enum: + self.requires("magic_enum/0.9.3") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "20") - if self.settings.compiler == "clang" and self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] and self.settings.compiler.version == "11": - raise ConanInvalidConfiguration("clang 11 with libstdc++ is not supported due to old libstdc++ missing C++17 support") - minimum_version = self._minimum_compilers_version.get( - str(self.settings.compiler), False) - if not minimum_version: - self.output.warn( - "simple-yaml requires C++20. Your compiler is unknown. Assuming it fully supports C++20.") - elif tools.Version(self.settings.compiler.version) < minimum_version: + check_min_cppstd(self, self._min_cppstd) + if ( + self.settings.compiler == "clang" + and self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] + and self.settings.compiler.version == "11" + ): raise ConanInvalidConfiguration( - "simple-yaml requires C++20, which your compiler does not support.") + "clang 11 with libstdc++ is not supported due to old libstdc++ missing C++17 support" + ) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warning("simple-yaml requires C++20. Your compiler is unknown. Assuming it fully supports C++20.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("simple-yaml requires C++20, which your compiler does not support.") - def package_id(self): - self.info.header_only() + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "simple-yaml" - self.cpp_info.names["cmake_find_package_multi"] = "simple-yaml" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/simple-yaml/all/test_package/CMakeLists.txt b/recipes/simple-yaml/all/test_package/CMakeLists.txt index 506dba003a47f7..08e8ff623e8945 100644 --- a/recipes/simple-yaml/all/test_package/CMakeLists.txt +++ b/recipes/simple-yaml/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(simple-yaml REQUIRED CONFIG) -find_package(simple-yaml CONFIG REQUIRED) add_executable(${PROJECT_NAME} src/test.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE simple-yaml::simple-yaml) diff --git a/recipes/simple-yaml/all/test_package/conanfile.py b/recipes/simple-yaml/all/test_package/conanfile.py index cbe0be23191a28..fae501d0afb9e4 100644 --- a/recipes/simple-yaml/all/test_package/conanfile.py +++ b/recipes/simple-yaml/all/test_package/conanfile.py @@ -1,17 +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 TestPackageConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): - self.cmake = CMake(self) - self.cmake.configure() - self.cmake.build() + 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) + 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/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/skyr-url/all/conanfile.py b/recipes/skyr-url/all/conanfile.py index 11f0da24114c20..86286a2a911c07 100644 --- a/recipes/skyr-url/all/conanfile.py +++ b/recipes/skyr-url/all/conanfile.py @@ -66,7 +66,7 @@ def requirements(self): self.requires("tl-expected/1.1.0", transitive_headers=True) self.requires("range-v3/0.12.0", transitive_headers=True) if self.options.with_json: - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.3") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/sml/all/conandata.yml b/recipes/sml/all/conandata.yml index 3c49eae1512502..39d52a814e37cc 100644 --- a/recipes/sml/all/conandata.yml +++ b/recipes/sml/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.9": + url: "https://github.com/boost-ext/sml/archive/refs/tags/v1.1.9.tar.gz" + sha256: "c5ebffcf791ca0b89fd49a410b720432de748a31b7e0c9e5bd5c567d11c8c477" "1.1.8": url: "https://github.com/boost-ext/sml/archive/refs/tags/v1.1.8.tar.gz" sha256: "d2626b2fd249fa0788ca364a2f8dcb4762dd72195f86d43370e4cad4c02262c5" diff --git a/recipes/sml/config.yml b/recipes/sml/config.yml index 5ebc9beff7190c..aff831fd45b0ab 100644 --- a/recipes/sml/config.yml +++ b/recipes/sml/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.9": + folder: all "1.1.8": folder: all "1.1.6": diff --git a/recipes/snappy/all/conanfile.py b/recipes/snappy/all/conanfile.py index 0ce00288cff646..d60c8245273355 100644 --- a/recipes/snappy/all/conanfile.py +++ b/recipes/snappy/all/conanfile.py @@ -21,10 +21,14 @@ class SnappyConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_bmi2": [True, False, "auto"], + "with_ssse3": [True, False, "auto"], } default_options = { "shared": False, "fPIC": True, + "with_bmi2": "auto", + "with_ssse3": "auto", } def export_sources(self): @@ -33,6 +37,9 @@ def export_sources(self): def config_options(self): if self.settings.os == 'Windows': del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.with_bmi2 + del self.options.with_ssse3 def configure(self): if self.options.shared: @@ -60,6 +67,11 @@ def generate(self): tc.variables["SNAPPY_INSTALL"] = True if Version(self.version) >= "1.1.9": tc.variables["SNAPPY_BUILD_BENCHMARKS"] = False + if self.settings.arch in ["x86", "x86_64"]: + if self.options.with_bmi2 != "auto": + tc.variables["SNAPPY_HAVE_BMI2"] = self.options.with_bmi2 + if self.options.with_ssse3 != "auto": + tc.variables["SNAPPY_HAVE_SSSE3"] = self.options.with_ssse3 tc.generate() def build(self): 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/snitch/all/test_v1_package/CMakeLists.txt b/recipes/snitch/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..0d20897301b68b --- /dev/null +++ b/recipes/snitch/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +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/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 18c9023e618093..3b66eb81644a06 100644 --- a/recipes/so5extra/all/conandata.yml +++ b/recipes/so5extra/all/conandata.yml @@ -1,4 +1,10 @@ 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" "1.5.2": url: "https://github.com/Stiffstream/so5extra/archive/v.1.5.2.tar.gz" sha256: "5409dc255c970d2085381ceded122b80b9ac896a34bafc5ffc431bae304d485d" diff --git a/recipes/so5extra/all/conanfile.py b/recipes/so5extra/all/conanfile.py index 080aef93955585..d9201d13883b21 100644 --- a/recipes/so5extra/all/conanfile.py +++ b/recipes/so5extra/all/conanfile.py @@ -1,63 +1,93 @@ -from conans import 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.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 So5extraConan(ConanFile): name = "so5extra" + description = "A collection of various SObjectizer's extensions." license = "BSD-3-Clause" - homepage = "https://github.com/Stiffstream/so5extra" url = "https://github.com/conan-io/conan-center-index" - description = "A collection of various SObjectizer's extensions." - topics = ("concurrency", "actor-framework", "actors", "agents", "sobjectizer") + homepage = "https://github.com/Stiffstream/so5extra" + topics = ("concurrency", "actor-framework", "actors", "agents", "sobjectizer", "header-only") + + 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 - def requirements(self): - self.requires("sobjectizer/5.7.4") - - def validate(self): - minimal_cpp_standard = "17" - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, minimal_cpp_standard) - minimal_version = { + @property + def _compilers_minimum_version(self): + if self.version >= Version("1.6.0"): + # Since v1.6.0 requirements to compilers were updated: + return { + "gcc": "10", + "clang": "11", + "apple-clang": "13", + "Visual Studio": "17", + "msvc": "192" + } + return { "gcc": "7", "clang": "6", "apple-clang": "10", - "Visual Studio": "15" + "Visual Studio": "15", + "msvc": "191" } - compiler = str(self.settings.compiler) - if compiler not in minimal_version: - self.output.warn( - "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) - self.output.warn( - "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) - return - version = tools.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 layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.version >= Version("1.6.0"): + self.requires("sobjectizer/5.8.1") + else: + self.requires("sobjectizer/5.7.4") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + compiler = str(self.settings.compiler) + if compiler not in self._compilers_minimum_version: + self.output.warning(f"{self.name} recipe lacks information about the {compiler} compiler standard version support") + self.output.warning(f"{self.name} requires a compiler that supports at least C++{self._min_cppstd}") + return + version = Version(self.settings.compiler.version) + if version < self._compilers_minimum_version[compiler]: + raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least C++{self._min_cppstd}") 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("*.hpp", dst="include/so_5_extra", src=os.path.join(self._source_subfolder, "dev", "so_5_extra")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include/so_5_extra"), + src=os.path.join(self.source_folder, "dev", "so_5_extra")) + 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.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "so5extra") self.cpp_info.set_property("cmake_target_name", "sobjectizer::so5extra") + self.cpp_info.components["so_5_extra"].set_property("cmake_target_name", "sobjectizer::so5extra") + self.cpp_info.components["so_5_extra"].requires = ["sobjectizer::sobjectizer"] # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "so5extra" @@ -66,5 +96,3 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "sobjectizer" self.cpp_info.components["so_5_extra"].names["cmake_find_package"] = "so5extra" self.cpp_info.components["so_5_extra"].names["cmake_find_package_multi"] = "so5extra" - self.cpp_info.components["so_5_extra"].set_property("cmake_target_name", "sobjectizer::so5extra") - self.cpp_info.components["so_5_extra"].requires = ["sobjectizer::sobjectizer"] diff --git a/recipes/so5extra/all/test_package/CMakeLists.txt b/recipes/so5extra/all/test_package/CMakeLists.txt index 933e0f59b04bde..6797a4d254c0ad 100644 --- a/recipes/so5extra/all/test_package/CMakeLists.txt +++ b/recipes/so5extra/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(so5extra REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/so5extra/all/test_package/conanfile.py b/recipes/so5extra/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/so5extra/all/test_package/conanfile.py +++ b/recipes/so5extra/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/so5extra/all/test_v1_package/CMakeLists.txt b/recipes/so5extra/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/so5extra/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/so5extra/all/test_v1_package/conanfile.py b/recipes/so5extra/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/so5extra/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/so5extra/config.yml b/recipes/so5extra/config.yml index f77c4a7405ffe8..424326d97fc77d 100644 --- a/recipes/so5extra/config.yml +++ b/recipes/so5extra/config.yml @@ -1,4 +1,8 @@ versions: + "1.6.1": + folder: all + "1.6.0": + folder: all "1.5.2": folder: all "1.5.1": diff --git a/recipes/sobjectizer/all/CMakeLists.txt b/recipes/sobjectizer/all/CMakeLists.txt deleted file mode 100644 index 20ac539cce8621..00000000000000 --- a/recipes/sobjectizer/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder/dev/so_5) diff --git a/recipes/sobjectizer/all/conandata.yml b/recipes/sobjectizer/all/conandata.yml index b8c5263a27c95c..9867b85e589724 100644 --- a/recipes/sobjectizer/all/conandata.yml +++ b/recipes/sobjectizer/all/conandata.yml @@ -33,3 +33,9 @@ sources: "5.7.5": url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.5.tar.gz" sha256: "282b7c72f6a6ee30b9c08b5339c3e327452903e1b246a163a7c8e57b3e37932f" + "5.8.0": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.8.0.tar.gz" + sha256: "de2b4ae0e817a108dae6d6787c79ed84c33bd447842b5fdcb780f6697b4c2d49" + "5.8.1": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.8.1.tar.gz" + sha256: "2d6a1d57ecb1263d00460fd2dbf386e7323ab8643d10667d1646c3bbc91ef764" diff --git a/recipes/sobjectizer/all/conanfile.py b/recipes/sobjectizer/all/conanfile.py index 6ebed35c1f8308..6dfd80e4c926f7 100644 --- a/recipes/sobjectizer/all/conanfile.py +++ b/recipes/sobjectizer/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, CMake, 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, CMakeDeps, cmake_layout +from conan.tools.files import get, copy, rmdir, collect_libs +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class SobjectizerConan(ConanFile): @@ -27,80 +31,85 @@ class SobjectizerConan(ConanFile): "fPIC": True, } - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - _cmake = None - - @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 - - def validate(self): - minimal_cpp_standard = "17" - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, minimal_cpp_standard) - minimal_version = { + self.options.rm_safe("fPIC") + + def _compiler_support_lut(self): + if self.version >= Version("5.8.0"): + # Since v5.8.0 requirements to compilers were updated: + return { + "gcc": "10", + "clang": "11", + "apple-clang": "13", + "Visual Studio": "17", + "msvc": "192" + } + + return { "gcc": "7", "clang": "6", "apple-clang": "10", - "Visual Studio": "15" + "Visual Studio": "15", + "msvc": "191" } + + def validate(self): + minimal_cpp_standard = "17" + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, minimal_cpp_standard) + minimal_version = self._compiler_support_lut() + compiler = str(self.settings.compiler) if compiler not in minimal_version: - self.output.warn( + self.output.warning( "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) - self.output.warn( + self.output.warning( "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) return - version = tools.Version(self.settings.compiler.version) + 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 _configure_cmake(self): - if self._cmake: - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SOBJECTIZER_BUILD_SHARED"] = self.options.shared + tc.variables["SOBJECTIZER_BUILD_STATIC"] = not self.options.shared + tc.variables["SOBJECTIZER_INSTALL"] = True + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" + tc.generate() - self._cmake = CMake(self) - self._cmake.definitions["SOBJECTIZER_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["SOBJECTIZER_BUILD_STATIC"] = not self.options.shared - self._cmake.definitions["SOBJECTIZER_INSTALL"] = True + cmake_deps = CMakeDeps(self) + cmake_deps.generate() - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def layout(self): + cmake_layout(self, src_folder="src") def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "dev", "so_5")) cmake.build() 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): - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - self.copy("license*", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) - 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 = "SharedLib" if self.options.shared else "StaticLib" self.cpp_info.set_property("cmake_file_name", "sobjectizer") self.cpp_info.set_property("cmake_target_name", "sobjectizer::{}".format(cmake_target)) # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["_sobjectizer"].libs = tools.collect_libs(self) + self.cpp_info.components["_sobjectizer"].libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_sobjectizer"].system_libs = ["pthread", "m"] if not self.options.shared: diff --git a/recipes/sobjectizer/all/test_package/CMakeLists.txt b/recipes/sobjectizer/all/test_package/CMakeLists.txt index 9a72279fda74fb..38c12b1dc72ca7 100644 --- a/recipes/sobjectizer/all/test_package/CMakeLists.txt +++ b/recipes/sobjectizer/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(sobjectizer REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/sobjectizer/all/test_package/conanfile.py b/recipes/sobjectizer/all/test_package/conanfile.py index 38f4483872d47f..a9fb96656f2039 100644 --- a/recipes/sobjectizer/all/test_package/conanfile.py +++ b/recipes/sobjectizer/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sobjectizer/all/test_v1_package/CMakeLists.txt b/recipes/sobjectizer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..c960a336839f6a --- /dev/null +++ b/recipes/sobjectizer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sobjectizer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(TARGET sobjectizer::SharedLib) + target_link_libraries(${PROJECT_NAME} sobjectizer::SharedLib) +else() + target_link_libraries(${PROJECT_NAME} sobjectizer::StaticLib) +endif() diff --git a/recipes/sobjectizer/all/test_v1_package/conanfile.py b/recipes/sobjectizer/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..9b63bd176646ba --- /dev/null +++ b/recipes/sobjectizer/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/sobjectizer/config.yml b/recipes/sobjectizer/config.yml index 31292d0fc47479..648b2e28b68fb7 100644 --- a/recipes/sobjectizer/config.yml +++ b/recipes/sobjectizer/config.yml @@ -21,3 +21,7 @@ versions: folder: all "5.7.5": folder: all + "5.8.0": + folder: all + "5.8.1": + folder: all diff --git a/recipes/soci/all/conanfile.py b/recipes/soci/all/conanfile.py index 6b15a39df0e5f1..1f10648c312354 100644 --- a/recipes/soci/all/conanfile.py +++ b/recipes/soci/all/conanfile.py @@ -62,15 +62,15 @@ def configure(self): def requirements(self): if self.options.with_sqlite3: - self.requires("sqlite3/3.41.1") + self.requires("sqlite3/3.44.2") if self.options.with_odbc and self.settings.os != "Windows": self.requires("odbc/2.3.11") if self.options.with_mysql: - self.requires("libmysqlclient/8.0.31") + self.requires("libmysqlclient/8.1.0") if self.options.with_postgresql: - self.requires("libpq/14.7") + self.requires("libpq/15.4") if self.options.with_boost: - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") @property def _minimum_compilers_version(self): diff --git a/recipes/sofa/all/conandata.yml b/recipes/sofa/all/conandata.yml index 7a99aaa5b58935..d4de8c6bcf5025 100644 --- a/recipes/sofa/all/conandata.yml +++ b/recipes/sofa/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20231011": + url: "http://www.iausofa.org/2023_1011_C/sofa_c-20231011.tar.gz" + sha256: "d9c10833cae8b4d9361a0ffda31ec361fd1262362025bec4d4e51a880150ace2" "20210512": url: "http://www.iausofa.org/2021_0512_C/sofa_c-20210512.tar.gz" sha256: "3362baba47ce965af1fc6a3141052a0e1f643d186e8deca83df1ea97455bb2fd" diff --git a/recipes/sofa/config.yml b/recipes/sofa/config.yml index de0c26b7bcf2af..a6912b42b0a988 100644 --- a/recipes/sofa/config.yml +++ b/recipes/sofa/config.yml @@ -1,4 +1,6 @@ versions: + "20231011": + folder: all "20210512": folder: all "20210125_a": diff --git a/recipes/sokol/all/conandata.yml b/recipes/sokol/all/conandata.yml index 28862f21946275..dd1a5b69303284 100644 --- a/recipes/sokol/all/conandata.yml +++ b/recipes/sokol/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230925": + url: "https://github.com/floooh/sokol/archive/5633a0f91bf3354320837ce0c7b4748a953a1401.zip" + sha256: 9c854bc7e6f73024a99554e8e1c8850fddfc325bb2b1ece2c59502c0e3cef68d "cci.20210304": url: "https://github.com/floooh/sokol/archive/c5d55faa1036af9919bd28400e97d37548bb3789.zip" sha256: e61c782e287543ffb8077ac24a7bfee05e867ee27f6c3e9487a2dbfa1ca2b466 diff --git a/recipes/sokol/config.yml b/recipes/sokol/config.yml index 25320f6c19961f..d5b10b1bcb9c11 100644 --- a/recipes/sokol/config.yml +++ b/recipes/sokol/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20230925": + folder: "all" "cci.20210304": folder: "all" diff --git a/recipes/sol2/all/conandata.yml b/recipes/sol2/all/conandata.yml index aa516653323cff..f83f4a6a367354 100644 --- a/recipes/sol2/all/conandata.yml +++ b/recipes/sol2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.3.1": + url: "https://github.com/ThePhD/sol2/archive/v3.3.1.tar.gz" + sha256: "ad121461047d52b449aa84234a6b578fa3ed95d67d1a0703902eba72417f61bb" "3.3.0": url: "https://github.com/ThePhD/sol2/archive/v3.3.0.tar.gz" sha256: "b82c5de030e18cb2bcbcefcd5f45afd526920c517a96413f0b59b4332d752a1e" diff --git a/recipes/sol2/all/conanfile.py b/recipes/sol2/all/conanfile.py index 93f899011d3355..4ebb24964da6a9 100644 --- a/recipes/sol2/all/conanfile.py +++ b/recipes/sol2/all/conanfile.py @@ -17,7 +17,8 @@ class Sol2Conan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ThePhD/sol2" - topics = ("lua", "c++", "bindings", "scripting") + topics = ("lua", "c++", "bindings", "scripting", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -66,7 +67,7 @@ def requirements(self): # v2.x.x & v3.0.x supports up to Lua 5.3 self.requires("lua/5.3.6") else: - self.requires("lua/5.4.4") + self.requires("lua/5.4.6") elif self.options.with_lua == "luajit": self.requires("luajit/2.1.0-beta3") diff --git a/recipes/sol2/config.yml b/recipes/sol2/config.yml index 28097c1cf11a25..d6be5bd0bfdf0f 100644 --- a/recipes/sol2/config.yml +++ b/recipes/sol2/config.yml @@ -1,4 +1,6 @@ versions: + "3.3.1": + folder: "all" "3.3.0": folder: "all" "3.2.3": diff --git a/recipes/sophus/all/conanfile.py b/recipes/sophus/all/conanfile.py index 7fa9bd18760cf6..ef703f320333fa 100644 --- a/recipes/sophus/all/conanfile.py +++ b/recipes/sophus/all/conanfile.py @@ -10,11 +10,10 @@ class SophusConan(ConanFile): name = "sophus" description = "C++ implementation of Lie Groups using Eigen." - topics = ("eigen", "numerical", "math") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://strasdat.github.io/Sophus/" - license = "MIT" - no_copy_source = True + topics = ("eigen", "numerical", "math", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { @@ -23,23 +22,28 @@ class SophusConan(ConanFile): default_options = { "with_fmt": True, } + no_copy_source = True + + def configure(self): + if Version(self.version) < "1.22.4": + del self.options.with_fmt + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): self.requires("eigen/3.4.0", transitive_headers=True) - if self.options.with_fmt and Version(self.version) >= Version("1.22.10"): - self.requires("fmt/9.1.0", transitive_headers=True) - elif self.options.with_fmt and Version(self.version) >= Version("1.22.4"): - self.requires("fmt/8.1.1", transitive_headers=True) + if self.options.get_safe("with_fmt"): + if Version(self.version) >= "1.22.10": + self.requires("fmt/10.1.0", transitive_headers=True) + else: + self.requires("fmt/8.1.1", transitive_headers=True) def package_id(self): self.info.clear() - def layout(self): - basic_layout(self, src_folder="src") - 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 package(self): copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) @@ -51,10 +55,8 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "Sophus::Sophus") self.cpp_info.set_property("pkg_config_name", "sophus") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] - if not self.options.with_fmt: + if self.options.get_safe("with_fmt") == False: self.cpp_info.defines.append("SOPHUS_USE_BASIC_LOGGING=1") # TODO: to remove in conan v2 once cmake_find_package* generator removed diff --git a/recipes/soplex/all/conandata.yml b/recipes/soplex/all/conandata.yml index eaf5ac83b44274..b034a63a756936 100644 --- a/recipes/soplex/all/conandata.yml +++ b/recipes/soplex/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.0.4": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-604.tar.gz" + sha256: "691f5b593cb85c2586522d5de5a5a7692958d22ff1ddffb4fc395f4696590b6f" "6.0.3": url: "https://github.com/scipopt/soplex/archive/refs/tags/release-603.tar.gz" sha256: "2bdf9adc9ac6ad48f98056679b7b852e626ac4aaaf277e7d4ce17794ed1097be" diff --git a/recipes/soplex/all/conanfile.py b/recipes/soplex/all/conanfile.py index d1ea6917fd3ef5..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 @@ -19,6 +18,7 @@ class SoPlexConan(ConanFile): homepage = "https://soplex.zib.de" topics = ("simplex", "solver", "linear", "programming") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -29,7 +29,7 @@ class SoPlexConan(ConanFile): "shared": False, "fPIC": True, "with_boost": True, - "with_gmp": True + "with_gmp": True, } @property @@ -42,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): @@ -52,22 +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." - ) - if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") - - 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 @@ -76,29 +62,42 @@ 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("zlib/1.2.13", transitive_headers=True) + # transitive libs as anything using soplex requires gzread, gzwrite, gzclose, gzopen + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) if self.options.with_gmp: # transitive libs as anything using soplex requires __gmpz_init_set_si # see https://github.com/conan-io/conan-center-index/pull/16017#issuecomment-1495688452 - self.requires("gmp/6.2.1", transitive_headers=True, transitive_libs=True) + self.requires("gmp/6.3.0", transitive_headers=True, transitive_libs=True) if self.options.with_boost: - self.requires("boost/1.81.0", transitive_headers=True) # also update Boost_VERSION_MACRO below! + 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"] = "108100" - 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.variables["Boost_VERSION_MACRO"] = "108300" 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) @@ -113,12 +112,14 @@ def package(self): copy(self, pattern="*.h", src=join(self.source_folder, "src", "soplex"), dst=join(self.package_folder, "include", "soplex")) copy(self, pattern="*.hpp", src=join(self.source_folder, "src", "soplex"), dst=join(self.package_folder, "include", "soplex")) 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="*.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="*.lib", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) + 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/soplex/all/test_v1_package/CMakeLists.txt b/recipes/soplex/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8bf82de500d9f1..00000000000000 --- a/recipes/soplex/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) -set(CMAKE_CXX_STANDARD 14) - -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/soplex/config.yml b/recipes/soplex/config.yml index bce376a5fec908..73bcf839da6182 100644 --- a/recipes/soplex/config.yml +++ b/recipes/soplex/config.yml @@ -1,3 +1,5 @@ versions: + "6.0.4": + folder: all "6.0.3": folder: all diff --git a/recipes/soundtouch/all/conanfile.py b/recipes/soundtouch/all/conanfile.py index dd8ee784980902..66a875621a86da 100644 --- a/recipes/soundtouch/all/conanfile.py +++ b/recipes/soundtouch/all/conanfile.py @@ -48,10 +48,16 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["INTEGER_SAMPLES"] = self.options.integer_samples - tc.variables["SOUNDTOUCH_DLL"] = self.options.with_dll - tc.variables["SOUNDSTRETCH"] = self.options.with_util - tc.variables["OPENMP"] = self.options.with_openmp + tc.cache_variables["INTEGER_SAMPLES"] = self.options.integer_samples + tc.cache_variables["SOUNDTOUCH_DLL"] = self.options.with_dll + tc.cache_variables["SOUNDSTRETCH"] = self.options.with_util + tc.cache_variables["OPENMP"] = self.options.with_openmp + # The finite-math-only optimization has no effect and can cause linking errors + # when linked against glibc >= 2.31 + tc.blocks["cmake_flags_init"].template = tc.blocks["cmake_flags_init"].template + """ + string(APPEND CMAKE_CXX_FLAGS_INIT " -fno-finite-math-only") + string(APPEND CMAKE_C_FLAGS_INIT " -fno-finite-math-only") + """ tc.generate() def build(self): diff --git a/recipes/soxr/all/conanfile.py b/recipes/soxr/all/conanfile.py index d9c0a77657c802..452e658b2375d8 100644 --- a/recipes/soxr/all/conanfile.py +++ b/recipes/soxr/all/conanfile.py @@ -52,9 +52,6 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - if Version(self.version) < "3.21": - # silence warning - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0115"] = "OLD" if is_msvc(self): tc.variables["BUILD_SHARED_RUNTIME"] = not is_msvc_static_runtime(self) # Disable SIMD based resample engines for Apple Silicon and iOS ARMv8 architecture diff --git a/recipes/spdlog/all/conanfile.py b/recipes/spdlog/all/conanfile.py index f2653d49db0738..85bd609950223e 100644 --- a/recipes/spdlog/all/conanfile.py +++ b/recipes/spdlog/all/conanfile.py @@ -56,7 +56,9 @@ def requirements(self): self_version = Version(self.version) fmt_version = "7.1.3" - if self_version >= "1.11.0": + if self_version >= "1.12.0": + fmt_version = "10.1.1" + elif self_version >= "1.11.0": fmt_version = "10.0.0" elif self_version >= "1.10.0": fmt_version = "8.1.1" @@ -142,7 +144,9 @@ def package_info(self): self.cpp_info.components["libspdlog"].defines.append("SPDLOG_FMT_EXTERNAL") self.cpp_info.components["libspdlog"].requires = ["fmt::fmt"] - if not self.options.header_only: + if self.options.header_only: + self.cpp_info.components["libspdlog"].libdirs = [] + else: suffix = "d" if self.settings.build_type == "Debug" else "" self.cpp_info.components["libspdlog"].libs = [f"spdlog{suffix}"] self.cpp_info.components["libspdlog"].defines.append("SPDLOG_COMPILED_LIB") diff --git a/recipes/spectra/all/conanfile.py b/recipes/spectra/all/conanfile.py index 084f85d8c49505..7f108912c8a5cf 100644 --- a/recipes/spectra/all/conanfile.py +++ b/recipes/spectra/all/conanfile.py @@ -15,6 +15,7 @@ class SpectraConan(ConanFile): topics = ("eigenvalue", "header-only") homepage = "https://spectralib.org" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -33,8 +34,7 @@ def validate(self): check_min_cppstd(self, 11) 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 diff --git a/recipes/spirv-cross/all/conandata.yml b/recipes/spirv-cross/all/conandata.yml index 62c01a02172b50..124af978201fc0 100644 --- a/recipes/spirv-cross/all/conandata.yml +++ b/recipes/spirv-cross/all/conandata.yml @@ -1,69 +1,23 @@ sources: + "1.3.268.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "dd656a51ba4c229c1a0bb220b7470723e8fd4b68abb7f2cf2ca4027df824f4a0" + "1.3.261.1": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "a5cf99ed62e93800232e50b782890321d4d7e053dcaa71bd8efc0c48a00bd1dd" + "1.3.250.1": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.250.1.tar.gz" + sha256: "5b7402d7078eeffca0926875b1dcd0f5dd78791a30529de7c8456686f6fc52ce" + "1.3.246.1": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.246.1.tar.gz" + sha256: "44d1aef7e6e247b4b7ec6a1ef0bbb43cc9b681ee689393db90ac815d240808b1" "1.3.243.0": url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.243.0.tar.gz" sha256: "549fff809de2b3484bcc5d710ccd76ca29cbd764dd304c3687252e2f3d034e06" "1.3.239.0": url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.239.0.tar.gz" sha256: "a1695022880e7ef3c2d407647f79876045dc2a3ed012753adc71ead5cc5178ba" - "1.3.236.0": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.236.0.tar.gz" - sha256: "8140a2b53d1e218e9be1f8d5e2749b1ebe854d456e5cb356218fd288747d5438" - "1.3.231.1": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.231.1.tar.gz" - sha256: "3b42f5b6e46b45600e09fd55234f59edb7cfca803e49d7830dc6fb5a086143b1" - "1.3.224.0": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.224.0.tar.gz" - sha256: "00256c33e235c5b9f0fc4b531fb9058d3cf1ff53e21e2db62cd8db848525536c" - "1.3.216.0": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.216.0.tar.gz" - sha256: "dd66ce2f9e6d3b9b8055662ac25172fa5559603f2f23c1a178c74f1602de8732" - "1.3.211.0": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.211.0.tar.gz" - sha256: "0f56755caa78765ab6c2467909c06dea63e6826ee824b496e73469c0d6a9d318" - "1.3.204.0": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.204.0.tar.gz" - sha256: "1b5a9b5b3b333411164fe29de1969d5b590d83891aad14eb49be3c41eccd9edf" + # commit used in Vulkan SDK 1.2.198.0 "cci.20211113": url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/7c3cb0b12c9965497b08403c82ac1b82846fa7be.tar.gz" sha256: "5bb6837e2b75db1a9e36e7d6eac40d905e3460ff3b5234f391adc6bdf6aadcdf" - "cci.20210930": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/97a438d214b24e4958ca137a18639670648cedd0.tar.gz" - sha256: "dd07ce3c261fe8c08dbfbb3dd274f35de50ea8610f57fe5de4fe2b782c4accbd" - "cci.20210823": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/0e2880ab990e79ce6cc8c79c219feda42d98b1e8.tar.gz" - sha256: "611cf4d30d88c48a4a04848a66ae4c5d3a63ccf965fd6017d9ea86ec5c7a088d" - "cci.20210621": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/9cdeefb5e322fc26b5fed70795fe79725648df1f.tar.gz" - sha256: "3742c24e7ccc09fce10e9d88c2f9a2e85f5142cc742be6df5cc3ba3f96defa92" - "20210115": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2021-01-15.tar.gz" - sha256: "d700863b548cbc7f27a678cee305f561669a126eb2cc11d36a7023dfc462b9c4" - "20200917": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-09-17.tar.gz" - sha256: "a3351742fe1fae9a15e91abbfb5314d96f5f77927ed07f55124d6df830ac97a7" - "20200629": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-06-29.tar.gz" - sha256: "29523168867fcfa55b03a65970a8572be67e37accb08ce1051b2d3ae19011452" - "20200519": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-05-19.tar.gz" - sha256: "6cf18ee3fe1a8d64a20da3c5fac334da4c4762d29d7e55a2f0b555cbf5cff708" - "20200403": - url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-04-03.tar.gz" - sha256: "93f3a6dfad17c9ca0bf4d2d80809e90118e13b47502eb395baba8784025d7e97" -patches: - "1.3.236.0": - - patch_file: "patches/1.3.236.0-0001-fix-gcc5.patch" - patch_description: "Fix compilation with gcc-5" - patch_type: "portability" - "cci.20210621": - - patch_file: "patches/0001-fix-bundle-install-cci.20210621.patch" - "20210115": - - patch_file: "patches/0001-fix-bundle-install-20210115.patch" - "20200917": - - patch_file: "patches/0001-fix-bundle-install-20200403.patch" - "20200629": - - patch_file: "patches/0001-fix-bundle-install-20200403.patch" - "20200519": - - patch_file: "patches/0001-fix-bundle-install-20200403.patch" - "20200403": - - patch_file: "patches/0001-fix-bundle-install-20200403.patch" diff --git a/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20200403.patch b/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20200403.patch deleted file mode 100644 index 9334dea225892e..00000000000000 --- a/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20200403.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -433,7 +433,7 @@ if (SPIRV_CROSS_CLI) - target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines} HAVE_SPIRV_CROSS_GIT_VERSION) - set_target_properties(spirv-cross PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}") - if (NOT SPIRV_CROSS_SKIP_INSTALL) -- install(TARGETS spirv-cross RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ install(TARGETS spirv-cross DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() - target_link_libraries(spirv-cross PRIVATE - spirv-cross-glsl diff --git a/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20210115.patch b/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20210115.patch deleted file mode 100644 index 5a9c5313318450..00000000000000 --- a/recipes/spirv-cross/all/patches/0001-fix-bundle-install-20210115.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -441,7 +441,7 @@ if (SPIRV_CROSS_CLI) - target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines} HAVE_SPIRV_CROSS_GIT_VERSION) - set_target_properties(spirv-cross PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}") - if (NOT SPIRV_CROSS_SKIP_INSTALL) -- install(TARGETS spirv-cross RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ install(TARGETS spirv-cross DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() - target_link_libraries(spirv-cross PRIVATE - spirv-cross-glsl diff --git a/recipes/spirv-cross/all/patches/0001-fix-bundle-install-cci.20210621.patch b/recipes/spirv-cross/all/patches/0001-fix-bundle-install-cci.20210621.patch deleted file mode 100644 index 1e4e265cd51547..00000000000000 --- a/recipes/spirv-cross/all/patches/0001-fix-bundle-install-cci.20210621.patch +++ /dev/null @@ -1,13 +0,0 @@ -fixed in https://github.com/KhronosGroup/SPIRV-Cross/pull/1706 - ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -442,7 +442,7 @@ if (SPIRV_CROSS_CLI) - target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines} HAVE_SPIRV_CROSS_GIT_VERSION) - set_target_properties(spirv-cross PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}") - if (NOT SPIRV_CROSS_SKIP_INSTALL) -- install(TARGETS spirv-cross RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ install(TARGETS spirv-cross DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() - target_link_libraries(spirv-cross PRIVATE - spirv-cross-glsl diff --git a/recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch b/recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch deleted file mode 100644 index 70c5857924141d..00000000000000 --- a/recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/spirv_glsl.cpp -+++ b/spirv_glsl.cpp -@@ -4955,9 +4955,9 @@ SmallVector CompilerGLSL::get_composite_constant_ids(ConstantID cons - if (is_array(type) || type.basetype == SPIRType::Struct) - return constant->subconstants; - if (is_matrix(type)) -- return constant->m.id; -+ return SmallVector(constant->m.id); - if (is_vector(type)) -- return constant->m.c[0].id; -+ return SmallVector(constant->m.c[0].id); - SPIRV_CROSS_THROW("Unexpected scalar constant!"); - } - if (!const_composite_insert_ids.count(const_id)) diff --git a/recipes/spirv-cross/config.yml b/recipes/spirv-cross/config.yml index a557c0bb6d2541..fee2421b06ee6c 100644 --- a/recipes/spirv-cross/config.yml +++ b/recipes/spirv-cross/config.yml @@ -1,35 +1,15 @@ 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.0": + "1.3.250.1": folder: all - "1.3.216.0": + "1.3.246.1": folder: all - "1.3.211.0": + "1.3.243.0": folder: all - "1.3.204.0": + "1.3.239.0": folder: all "cci.20211113": folder: all - "cci.20210930": - folder: all - "cci.20210823": - folder: all - "cci.20210621": - folder: all - "20210115": - folder: all - "20200917": - folder: all - "20200629": - folder: all - "20200519": - folder: all - "20200403": - folder: all diff --git a/recipes/spirv-headers/all/conandata.yml b/recipes/spirv-headers/all/conandata.yml index c9233e5ff87a6b..44f2fdcf490abf 100644 --- a/recipes/spirv-headers/all/conandata.yml +++ b/recipes/spirv-headers/all/conandata.yml @@ -1,49 +1,16 @@ sources: + "1.3.268.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4" + "1.3.261.1": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "32b4c6ae6a2fa9b56c2c17233c8056da47e331f76e117729925825ea3e77a739" "1.3.243.0": url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.243.0.tar.gz" sha256: "16927b1868e7891377d059cd549484e4158912439cf77451ae7e01e2a3bcd28b" "1.3.239.0": url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.239.0.tar.gz" sha256: "fdaf6670e311cd1c08ae90bf813e89dd31630205bc60030ffd25fb0af39b51fe" - "1.3.236.0": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.236.0.tar.gz" - sha256: "4d74c685fdd74469eba7c224dd671a0cb27df45fc9aa43cdd90e53bd4f2b2b78" - "1.3.231.1": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.231.1.tar.gz" - sha256: "fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3" - "1.3.224.0": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.224.0.tar.gz" - sha256: "2fb1039ec6cec8943400e9b4d01d8bfe8c62a0bd1fafb7c39c56469aa247b838" - "1.3.216.0": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.216.0.tar.gz" - sha256: "46c49a0e49ea120138102b1dcb3778e5a4f2267c45b9e937810a4cf4fb889e3d" - "1.3.211.0": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.211.0.tar.gz" - sha256: "30a78e61bd812c75e09fdc7a319af206b1044536326bc3e85fea818376a12568" - "1.3.204.0": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.204.0.tar.gz" - sha256: "519d09906dcdd4bf27089ff136d4e8c70abe2915bbde17a1d5ac18c5de6aee67" "1.2.198.0": url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.2.198.0.tar.gz" sha256: "3301a23aca0434336a643e433dcacacdd60000ab3dd35dc0078a297c06124a12" - "cci.20211010": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/814e728b30ddd0f4509233099a3ad96fd4318c07.tar.gz" - sha256: "c262d3c0c36ad5c87fbe3572aa292d2aed4dcd9b1ca4868eff9ec180e3f994f2" - "cci.20210811": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/e71feddb3f17c5586ff7f4cfb5ed1258b800574b.tar.gz" - sha256: "9eb56548460fd8850250ebf78071528fb66c2a5db2ef535edc1d493b2581ec66" - "cci.20210616": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/07f259e68af3a540038fa32df522554e74f53ed5.tar.gz" - sha256: "ce7d299c9e688fe536e106605235dbb7f81613daa7995d4d99d002c808f126f8" - "cci.20210414": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/dafead1765f6c1a5f9f8a76387dcb2abe4e54acd.tar.gz" - sha256: "e1c8530c95fc8c70fa6a7cbc269ebd1b10da3872efa0e3c6eb82452c3e180cda" - "1.5.4": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/1.5.4.tar.gz" - sha256: "fc026b6566167f6db03dc48779f0f986f9ff8c93ed651a557f28cfbe2dff4ede" - "1.5.3": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/1.5.3.tar.gz" - sha256: "eece8a9e147d37997d425d5d2eeb2e757ad25adc30d6651467094f3b18609b5a" - "1.5.1": - url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/1.5.1.corrected.tar.gz" - sha256: "2b6a0ce1c02b9fe7b9ef727369168fe579e5256f1ea013993acdb8d8f06b7e89" diff --git a/recipes/spirv-headers/all/conanfile.py b/recipes/spirv-headers/all/conanfile.py index 852af3d4936841..854ef173282639 100644 --- a/recipes/spirv-headers/all/conanfile.py +++ b/recipes/spirv-headers/all/conanfile.py @@ -13,6 +13,7 @@ class SpirvheadersConan(ConanFile): license = "MIT-KhronosGroup" topics = ("spirv", "spirv-v", "vulkan", "opengl", "opencl", "khronos") url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" def layout(self): @@ -22,8 +23,7 @@ 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 generate(self): tc = CMakeToolchain(self) diff --git a/recipes/spirv-headers/config.yml b/recipes/spirv-headers/config.yml index cb5c705d100c04..f615fa9738359b 100644 --- a/recipes/spirv-headers/config.yml +++ b/recipes/spirv-headers/config.yml @@ -1,33 +1,11 @@ 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.0": - folder: all - "1.3.216.0": - folder: all - "1.3.211.0": + "1.3.243.0": folder: all - "1.3.204.0": + "1.3.239.0": folder: all "1.2.198.0": folder: all - "cci.20211010": - folder: all - "cci.20210811": - folder: all - "cci.20210616": - folder: all - "cci.20210414": - folder: all - "1.5.4": - folder: all - "1.5.3": - folder: all - "1.5.1": - folder: all 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/spix/all/conandata.yml b/recipes/spix/all/conandata.yml index 85ea4e8fd6a622..69403c56106cbc 100644 --- a/recipes/spix/all/conandata.yml +++ b/recipes/spix/all/conandata.yml @@ -5,6 +5,9 @@ sources: "0.5": url: "https://github.com/faaxm/spix/archive/refs/tags/v0.5.tar.gz" sha256: "d3fd9bb069aef6ff6c93c69524ed3603afd24e6b52e4bb8d093c80cec255d4dc" + "0.6": + url: "https://github.com/faaxm/spix/archive/refs/tags/v0.6.tar.gz" + sha256: "5b2f4b89e112f3b31d8576923c2ac4a6913ae3c2a0042640846a65c4af39ac05" patches: "0.4": - patch_file: "patches/0001-use-conan-libs-0.4.patch" @@ -14,3 +17,7 @@ patches: - patch_file: "patches/0001-use-conan-libs-0.5.patch" patch_description: "Link to conan libs" patch_type: "conan" + "0.6": + - patch_file: "patches/0001-use-conan-libs-0.6.patch" + patch_description: "Link to conan libs" + patch_type: "conan" diff --git a/recipes/spix/all/conanfile.py b/recipes/spix/all/conanfile.py index 375acd44db4e03..e4a33c59e2c81d 100644 --- a/recipes/spix/all/conanfile.py +++ b/recipes/spix/all/conanfile.py @@ -66,7 +66,7 @@ def layout(self): def requirements(self): self.requires("anyrpc/1.0.2") - self.requires("qt/6.4.2") + self.requires("qt/6.5.3") def validate(self): if self.settings.compiler.cppstd: @@ -77,9 +77,9 @@ def validate(self): f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." ) - if Version(self.dependencies["qt"].ref.version).major == 6 and not self.options["qt"].qtshadertools: + if Version(self.dependencies["qt"].ref.version).major == 6 and not self.dependencies["qt"].options.qtshadertools: raise ConanInvalidConfiguration(f"{self.ref} requires qt:qtshadertools to get the Quick module") - if not (self.options["qt"].gui and self.options["qt"].qtdeclarative): + if not (self.dependencies["qt"].options.gui and self.dependencies["qt"].options.qtdeclarative): raise ConanInvalidConfiguration(f"{self.ref} requires qt:gui and qt:qtdeclarative to get the Quick module") def source(self): diff --git a/recipes/spix/all/patches/0001-use-conan-libs-0.6.patch b/recipes/spix/all/patches/0001-use-conan-libs-0.6.patch new file mode 100644 index 00000000000000..07463735860816 --- /dev/null +++ b/recipes/spix/all/patches/0001-use-conan-libs-0.6.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,6 @@ option(SPIX_BUILD_EXAMPLES "Build Spix examples." ON) + option(SPIX_BUILD_TESTS "Build Spix unit tests." OFF) + set(SPIX_QT_MAJOR "6" CACHE STRING "Major Qt version to build Spix against") + +-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/modules") + set(CMAKE_CXX_STANDARD 17) + + # Hide symbols unless explicitly flagged with SPIX_EXPORT diff --git a/recipes/spix/config.yml b/recipes/spix/config.yml index 57a887729c2abb..74b40e9de2d7f4 100644 --- a/recipes/spix/config.yml +++ b/recipes/spix/config.yml @@ -3,3 +3,5 @@ versions: folder: all "0.5": folder: all + "0.6": + 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/sqlite3/all/conandata.yml b/recipes/sqlite3/all/conandata.yml index efde056fcf092a..d1238ae4e2a8d8 100644 --- a/recipes/sqlite3/all/conandata.yml +++ b/recipes/sqlite3/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "3.44.2": + url: "https://sqlite.org/2023/sqlite-amalgamation-3440200.zip" + sha256: "833be89b53b3be8b40a2e3d5fedb635080e3edb204957244f3d6987c2bb2345f" + "3.44.1": + url: "https://sqlite.org/2023/sqlite-amalgamation-3440100.zip" + sha256: "cc6545b71ca188e245d5d668543c01f61175f0228a0e1b4ced76fabc75ea6b2e" + "3.44.0": + url: "https://sqlite.org/2023/sqlite-amalgamation-3440000.zip" + sha256: "93299c8d2c8397622fe00bd807204b1f58815f45bda8097bf93b3bf759a3ebad" + "3.43.2": + url: "https://sqlite.org/2023/sqlite-amalgamation-3430200.zip" + sha256: "a17ac8792f57266847d57651c5259001d1e4e4b46be96ec0d985c953925b2a1c" + "3.43.1": + url: "https://sqlite.org/2023/sqlite-amalgamation-3430100.zip" + sha256: "7e634bbd4b2870a83dc7c1e3cc02e4d30b8555cd7db7b332f24e0c447fd0dd16" + "3.43.0": + url: "https://sqlite.org/2023/sqlite-amalgamation-3430000.zip" + sha256: "bb5849ae4d7129c09d20596379a0b3f7b1ac59cf9998eba5ef283ea9b6c000a5" "3.42.0": url: "https://sqlite.org/2023/sqlite-amalgamation-3420000.zip" sha256: "1cc824d0f5e675829fa37018318fda833ea56f7e9de2b41eddd9f7643b5ec29e" diff --git a/recipes/sqlite3/config.yml b/recipes/sqlite3/config.yml index 50ef72c5285aba..8f761c32c82b77 100644 --- a/recipes/sqlite3/config.yml +++ b/recipes/sqlite3/config.yml @@ -1,4 +1,16 @@ versions: + "3.44.2": + folder: all + "3.44.1": + folder: all + "3.44.0": + folder: all + "3.43.2": + folder: all + "3.43.1": + folder: all + "3.43.0": + folder: all "3.42.0": folder: all "3.41.2": diff --git a/recipes/sqlite_orm/all/conanfile.py b/recipes/sqlite_orm/all/conanfile.py index 90bb95e386b2e1..23fa807bf57d52 100644 --- a/recipes/sqlite_orm/all/conanfile.py +++ b/recipes/sqlite_orm/all/conanfile.py @@ -39,7 +39,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("sqlite3/3.41.1", transitive_headers=True, transitive_libs=True) + self.requires("sqlite3/3.44.2", transitive_headers=True, transitive_libs=True) def package_id(self): self.info.clear() diff --git a/recipes/sqlitecpp/all/conandata.yml b/recipes/sqlitecpp/all/conandata.yml index 9f7fc37611e768..a10675f0411088 100644 --- a/recipes/sqlitecpp/all/conandata.yml +++ b/recipes/sqlitecpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.3.1": + url: "https://github.com/SRombauts/SQLiteCpp/archive/3.3.1.tar.gz" + sha256: "71f990f9fb4b004533b6859ce40729af823b87fe691dd99ca084a7fd40db54b9" "3.3.0": url: "https://github.com/SRombauts/SQLiteCpp/archive/3.3.0.tar.gz" sha256: "4a37dd63cf91235ea2ef4494054700c144b3f96e93a330ef61ed53d106353e9c" diff --git a/recipes/sqlitecpp/all/conanfile.py b/recipes/sqlitecpp/all/conanfile.py index 70dd5900f9a1ac..c0bfff9f89eeec 100644 --- a/recipes/sqlitecpp/all/conanfile.py +++ b/recipes/sqlitecpp/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import copy, get, apply_conandata_patches, replace_in_file, rmdir, save +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir, save from conan.tools.scm import Version from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout @@ -14,10 +14,11 @@ class SQLiteCppConan(ConanFile): name = "sqlitecpp" description = "SQLiteCpp is a smart and easy to use C++ sqlite3 wrapper" - topics = ("sqlite", "sqlite3", "data-base") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/SRombauts/SQLiteCpp" - license = "MIT" + topics = ("sqlite", "sqlite3", "data-base") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -31,8 +32,7 @@ class SQLiteCppConan(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": @@ -43,7 +43,7 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - self.requires("sqlite3/3.40.0") + self.requires("sqlite3/3.44.2") def validate(self): if Version(self.version) >= "3.0.0" and self.info.settings.compiler.get_safe("cppstd"): diff --git a/recipes/sqlitecpp/config.yml b/recipes/sqlitecpp/config.yml index 71f5731f373e29..b3381f7005ac85 100644 --- a/recipes/sqlitecpp/config.yml +++ b/recipes/sqlitecpp/config.yml @@ -1,4 +1,6 @@ versions: + "3.3.1": + folder: all "3.3.0": folder: all "3.2.1": 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..ceff1e9e63969f 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.44.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/sqlpp11/all/conandata.yml b/recipes/sqlpp11/all/conandata.yml index 3357310d8ea8c9..6b607672eff4f5 100644 --- a/recipes/sqlpp11/all/conandata.yml +++ b/recipes/sqlpp11/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.64": + url: "https://github.com/rbock/sqlpp11/archive/0.64.tar.gz" + sha256: "72e6d37c716cc45b38c3cf4541604f16224aaa3b511d1f1d0be0c49176c3be86" "0.63": url: "https://github.com/rbock/sqlpp11/archive/0.63.tar.gz" sha256: "8e8229501679435e5052c2184d6772e4d6f61e6a9e2ec7231c5fb9a3d3b88d7e" diff --git a/recipes/sqlpp11/all/conanfile.py b/recipes/sqlpp11/all/conanfile.py index 9ada1d6896ced9..9b3a725b385595 100644 --- a/recipes/sqlpp11/all/conanfile.py +++ b/recipes/sqlpp11/all/conanfile.py @@ -1,9 +1,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.layout import basic_layout from conan.tools.files import get, copy -from conan import Version +from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -20,7 +20,6 @@ class Sqlpp11Conan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property def _min_cppstd(self): return 11 if Version(self.version) < "0.61" else 14 @@ -66,6 +65,4 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "sqlpp11::sqlpp11") # TODO: to remove in conan v2 once cmake_find_package_* generators removed - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/sqlpp11/config.yml b/recipes/sqlpp11/config.yml index e0a6c05b5e9278..cd4a669a1a8d73 100644 --- a/recipes/sqlpp11/config.yml +++ b/recipes/sqlpp11/config.yml @@ -1,4 +1,6 @@ versions: + "0.64": + folder: "all" "0.63": folder: "all" "0.62": diff --git a/recipes/ssht/all/conandata.yml b/recipes/ssht/all/conandata.yml index 077fff5429d558..dab3a69b6f7e96 100644 --- a/recipes/ssht/all/conandata.yml +++ b/recipes/ssht/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.2": + url: "https://github.com/astro-informatics/ssht/archive/v1.5.2.tar.gz" + sha256: "6ce3e48d36a4af57cab9d96f5f845f905808dac8ac8b3ec195f6b49d017a890d" "1.4.0": url: "https://github.com/astro-informatics/ssht/archive/v1.4.0.tar.gz" sha256: "b33f1b763a240df773a1900139aad6f6b5c676bb2b64a8c1062077fd95c08769" diff --git a/recipes/ssht/all/conanfile.py b/recipes/ssht/all/conanfile.py index 616e2e41a56b19..aa4695a01d1547 100644 --- a/recipes/ssht/all/conanfile.py +++ b/recipes/ssht/all/conanfile.py @@ -33,7 +33,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fftw/3.3.9") + self.requires("fftw/3.3.10") def validate(self): if is_msvc(self): diff --git a/recipes/ssht/config.yml b/recipes/ssht/config.yml index fc50f8a9c5846a..aca406dbf9f3fc 100644 --- a/recipes/ssht/config.yml +++ b/recipes/ssht/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.2": + folder: all "1.4.0": folder: all "1.3.7": diff --git a/recipes/ssp/all/conandata.yml b/recipes/ssp/all/conandata.yml new file mode 100644 index 00000000000000..72dce2c480ffe4 --- /dev/null +++ b/recipes/ssp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.6.1": + url: "https://github.com/red0124/ssp/archive/refs/tags/v1.6.1.tar.gz" + sha256: "4cdf75959b0a5fabd0b3e6ec1bad41d7c3f298d5b7f822d6e12b7e4d7dfcdd34" diff --git a/recipes/ssp/all/conanfile.py b/recipes/ssp/all/conanfile.py new file mode 100644 index 00000000000000..4df3741e9cacb8 --- /dev/null +++ b/recipes/ssp/all/conanfile.py @@ -0,0 +1,68 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +import os + +required_conan_version = ">=1.52.0" + +class SspConan(ConanFile): + name = "ssp" + description = "C++ CSV parser" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/red0124/ssp" + topics = ("csv", "parser", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("fast_float/5.3.0") + + def package_id(self): + self.info.clear() + + 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 does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.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.libdirs = [] diff --git a/recipes/ssp/all/test_package/CMakeLists.txt b/recipes/ssp/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..16a9ddec507217 --- /dev/null +++ b/recipes/ssp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(ssp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ssp::ssp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/ssp/all/test_package/conanfile.py b/recipes/ssp/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e845ae751a3017 --- /dev/null +++ b/recipes/ssp/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ssp/all/test_package/test_package.cpp b/recipes/ssp/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..f3a0c45ba85136 --- /dev/null +++ b/recipes/ssp/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include "ss/converter.hpp" + +int main() { + auto converter = ss::converter{}; + + auto val = converter.convert("5"); + + if (val == 5) { + return 0; + } + return 1; +} diff --git a/recipes/ssp/config.yml b/recipes/ssp/config.yml new file mode 100644 index 00000000000000..bd3f43d241a52a --- /dev/null +++ b/recipes/ssp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.6.1": + folder: all diff --git a/recipes/st_tree/all/conanfile.py b/recipes/st_tree/all/conanfile.py index 2654379b52b95a..0f32eb68fb5486 100644 --- a/recipes/st_tree/all/conanfile.py +++ b/recipes/st_tree/all/conanfile.py @@ -1,42 +1,36 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy import os -from conans.errors import ConanInvalidConfiguration -from conans import ConanFile, CMake, tools -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class STTreeConan(ConanFile): name = "st_tree" + description = "A fast and flexible c++ template class for tree data structures" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" - description = "A fast and flexible c++ template class for tree data structures" - topics = ("stl", "container", "data-structures") homepage = "https://github.com/erikerlandson/st_tree" + topics = ("stl", "container", "data-structures", "tree", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def package_id(self): + self.info.clear() - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure(source_folder=self._source_subfolder) - return cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", "licenses", self._source_subfolder) - - cmake = self._configure_cmake() - cmake.install() - - tools.rmdir(os.path.join(self.package_folder, "lib")) - - def package_id(self): - self.info.header_only() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "st_tree" - self.cpp_info.filenames["cmake_find_package_multi"] = "st_tree" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/st_tree/all/test_package/CMakeLists.txt b/recipes/st_tree/all/test_package/CMakeLists.txt index bce4a94d44821f..221a27bafd9eff 100644 --- a/recipes/st_tree/all/test_package/CMakeLists.txt +++ b/recipes/st_tree/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(st_tree CONFIG REQUIRED) +find_package(st_tree REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} st_tree::st_tree) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE st_tree::st_tree) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/st_tree/all/test_package/conanfile.py b/recipes/st_tree/all/test_package/conanfile.py index 5d1d0c318d32cb..ef5d7042163ecc 100644 --- a/recipes/st_tree/all/test_package/conanfile.py +++ b/recipes/st_tree/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 STTreeTestConan(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", "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/stb/all/conandata.yml b/recipes/stb/all/conandata.yml index 661745efcb3f0d..c0c0739831fe06 100644 --- a/recipes/stb/all/conandata.yml +++ b/recipes/stb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230920": + url: "https://github.com/nothings/stb/archive/5736b15f7ea0ffb08dd38af21067c314d6a3aae9.zip" + sha256: "b6601f182fa4bc04dd0f135e38231e8a2c6c9e7901c66a942871f03285713b05" "cci.20220909": url: "https://github.com/nothings/stb/archive/8b5f1f37b5b75829fc72d38e7b5d4bcbf8a26d55.zip" sha256: "93a16ee3e866e719feec459f6f132cce932c5ec751eb38e3ec1975f911353d2e" diff --git a/recipes/stb/all/conanfile.py b/recipes/stb/all/conanfile.py index 540bdbac942b9a..7c777ca96ad4c7 100644 --- a/recipes/stb/all/conanfile.py +++ b/recipes/stb/all/conanfile.py @@ -14,9 +14,9 @@ class StbConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nothings/stb" license = ("Unlicense", "MIT") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - options = { "with_deprecated": [True, False], } @@ -39,11 +39,17 @@ def layout(self): basic_layout(self, src_folder="src") def package_id(self): - self.info.clear() + # Can't call self.info.clear() because options contribute to package id + self.info.settings.clear() + self.info.requires.clear() + try: + # conan v2 specific + self.info.conf.clear() + except AttributeError: + pass 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 diff --git a/recipes/stb/config.yml b/recipes/stb/config.yml index 8542dee0275058..a0248de0acece5 100644 --- a/recipes/stb/config.yml +++ b/recipes/stb/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20230920": + folder: all "cci.20220909": folder: all "cci.20210910": diff --git a/recipes/stc/all/conandata.yml b/recipes/stc/all/conandata.yml index a87f93d04cdefd..a7dd10bef0b552 100644 --- a/recipes/stc/all/conandata.yml +++ b/recipes/stc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.2": + url: "https://github.com/tylov/STC/archive/v4.2.tar.gz" + sha256: "f16c3185ba5693f0257e5b521f0b6b3c11041433a4abbbbc531370364eb75d0c" "4.1.1": url: "https://github.com/tylov/STC/archive/refs/tags/v4.1.1.tar.gz" sha256: "4386f7bc6480ba101f3e71b1adccfff8ccf586a31271d6ddc0f634d727d9f031" diff --git a/recipes/stc/config.yml b/recipes/stc/config.yml index bfb07935d0412b..3db9bf640436f7 100644 --- a/recipes/stc/config.yml +++ b/recipes/stc/config.yml @@ -1,4 +1,6 @@ versions: + "4.2": + folder: "all" "4.1.1": folder: "all" "3.9": diff --git a/recipes/stdgpu/all/cmake/stdgpu-dependencies-cuda.cmake b/recipes/stdgpu/all/cmake/stdgpu-dependencies-cuda.cmake new file mode 100644 index 00000000000000..d3b13dcffb9eec --- /dev/null +++ b/recipes/stdgpu/all/cmake/stdgpu-dependencies-cuda.cmake @@ -0,0 +1,6 @@ +# Mimics the behavior of stdgpu-dependencies.cmake exported by stdgpu for the CUDA backend + +find_dependency(CUDAToolkit 11.0 REQUIRED) +# Using ${stdgpu_LIBRARIES} to allow the target to be renamed using the "cmake_target_name" CMakeDeps property +target_link_libraries(${stdgpu_LIBRARIES} INTERFACE CUDA::cudart) +set_property(TARGET ${stdgpu_LIBRARIES} PROPERTY INTERFACE_COMPILE_FEATURES cuda_std_17) diff --git a/recipes/stdgpu/all/cmake/stdgpu-dependencies-hip.cmake b/recipes/stdgpu/all/cmake/stdgpu-dependencies-hip.cmake new file mode 100644 index 00000000000000..3b575a7ddbf0b8 --- /dev/null +++ b/recipes/stdgpu/all/cmake/stdgpu-dependencies-hip.cmake @@ -0,0 +1,9 @@ +# Mimics the behavior of stdgpu-dependencies.cmake exported by stdgpu for the HIP backend + +find_dependency(thrust 1.9.9 REQUIRED) + +find_dependency(hip 5.1 REQUIRED) + +# Using ${stdgpu_LIBRARIES} to allow the target to be renamed using the "cmake_target_name" CMakeDeps property +target_link_libraries(${stdgpu_LIBRARIES} INTERFACE hip::host) +set_property(TARGET ${stdgpu_LIBRARIES} PROPERTY INTERFACE_COMPILE_FEATURES hip_std_17) diff --git a/recipes/stdgpu/all/conandata.yml b/recipes/stdgpu/all/conandata.yml new file mode 100644 index 00000000000000..34e0429d48408f --- /dev/null +++ b/recipes/stdgpu/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20230913": + url: "https://github.com/stotko/stdgpu/archive/b70405bc62958f1f1334a936a20cd025351816fb.zip" + sha256: "f94c0352fdf2d2bc5490791a56cf42b562a5222e58ce5676510a07bb72ce75b6" + "1.3.0": + url: "https://github.com/stotko/stdgpu/archive/refs/tags/1.3.0.tar.gz" + sha256: "c527dabc6735d8b320b316e9a5b120d258d49c2b7ff9689c8a9b5ad474532a05" diff --git a/recipes/stdgpu/all/conanfile.py b/recipes/stdgpu/all/conanfile.py new file mode 100644 index 00000000000000..7dfe706fa8ef8e --- /dev/null +++ b/recipes/stdgpu/all/conanfile.py @@ -0,0 +1,213 @@ +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.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class StdgpuConan(ConanFile): + name = "stdgpu" + description = "Efficient STL-like Data Structures on the GPU" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://stotko.github.io/stdgpu/" + topics = ("cuda", "data-structures", "gpgpu", "gpu", "hip", "openmp", "rocm", "stl", "thrust") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "backend": ["cuda", "openmp", "hip"], + "setup_compiler_flags": [True, False], + "enable_contract_checks": [None, True, False], + "use_32_bit_index": [True, False], + "openmp": ["llvm", "system"], + } + default_options = { + "shared": False, + "fPIC": True, + "backend": "openmp", + "setup_compiler_flags": False, + "enable_contract_checks": None, + "use_32_bit_index": True, + "openmp": "llvm", + } + + @property + def _min_cppstd(self): + if self.version == "1.3.0": + return 14 + else: + return 17 + + @property + def _compilers_min_versions(self): + if self.version == "1.3.0": + # Based on https://github.com/stotko/stdgpu/tree/1.3.0#building + return { + "gcc": "7", + "clang": "6", + "apple-clang": "6", + "msvc": "192", + "Visual Studio": "16", + } + else: + # > 1.3.0 + # Based on https://github.com/stotko/stdgpu/tree/32e0517#building + return { + "gcc": "9", + "clang": "10", + "apple-clang": "12", + "msvc": "192", + "Visual Studio": "16", + } + + def export_sources(self): + copy(self, "cmake/*", dst=self.export_sources_folder, src=self.recipe_folder) + + 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 self.options.backend == "cuda": + self.options["thrust"].device_system = "cuda" + elif self.options.backend == "openmp": + self.options["thrust"].device_system = "omp" + + def package_id(self): + if self.info.options.backend != "openmp": + del self.info.options.openmp + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.backend != "hip": + self.requires("thrust/1.17.2", transitive_headers=True) + else: + # The baseline Thrust version provided by Nvidia and Conan is not compatible with HIP. + self.output.warning("HIP support requires Thrust with ROCm. " + "Using Thrust from system instead of Conan.") + if self.options.backend == "openmp": + if self.options.openmp == "llvm": + self.requires("llvm-openmp/12.0.1", transitive_headers=True, transitive_libs=True) + else: + self.output.info("Using OpenMP backend with system OpenMP") + + def build_requirements(self): + if Version(self.version) > "1.3.0": + self.tool_requires("cmake/[>=3.18 <4]") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_min_versions.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.backend == "cuda" and self.dependencies["thrust"].options.device_system != "cuda": + raise ConanInvalidConfiguration(f"{self.ref} option backend=cuda should use '-o thrust/*:device_system=cuda' as well.") + if self.options.backend == "openmp" and self.dependencies["thrust"].options.device_system != "omp": + raise ConanInvalidConfiguration(f"{self.ref} option backend=openmp should use '-o thrust/*:device_system=omp' as well.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # All the main params from https://github.com/stotko/#integration + backend = str(self.options.backend).upper() + tc.variables["STDGPU_BACKEND"] = f"STDGPU_BACKEND_{backend}" + tc.variables["STDGPU_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["STDGPU_SETUP_COMPILER_FLAGS"] = self.options.setup_compiler_flags + tc.variables["STDGPU_TREAT_WARNINGS_AS_ERRORS"] = False + tc.variables["STDGPU_BUILD_EXAMPLES"] = False + tc.variables["STDGPU_BUILD_BENCHMARKS"] = False + tc.variables["STDGPU_BUILD_TESTS"] = False + tc.variables["STDGPU_BUILD_TEST_COVERAGE"] = False + tc.variables["STDGPU_ANALYZE_WITH_CLANG_TIDY"] = False + tc.variables["STDGPU_ANALYZE_WITH_CPPCHECK"] = False + if self.options.enable_contract_checks is not None: + tc.variables["STDGPU_ENABLE_CONTRACT_CHECKS"] = self.options.enable_contract_checks + tc.variables["STDGPU_USE_32_BIT_INDEX"] = self.options.use_32_bit_index + tc.preprocessor_definitions["THRUST_IGNORE_CUB_VERSION_CHECK"] = "1" + tc.generate() + deps = CMakeDeps(self) + # FIXME: should be set by the thrust recipe instead + deps.set_property("thrust", "cmake_find_mode", "both") + deps.set_property("openmp", "cmake_find_mode", "both") + deps.generate() + env = VirtualBuildEnv(self) + env.generate() + + def _patch_sources(self): + # Fix repeated application of the THRUST_DEVICE_SYSTEM define + for backend in ["cuda", "openmp"]: + replace_in_file(self, os.path.join(self.source_folder, "src", "stdgpu", backend, "CMakeLists.txt"), + "THRUST_DEVICE_SYSTEM=", + ") # THRUST_DEVICE_SYSTEM=") + replace_in_file(self, os.path.join(self.source_folder, "src", "stdgpu", "openmp", "CMakeLists.txt"), + "find_package(OpenMP 2.0 REQUIRED)", + "find_package(OpenMP REQUIRED)") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", self.package_folder, recursive=True) + copy(self, "*.cmake", + dst=os.path.join(self.package_folder, "lib", "cmake"), + src=os.path.join(self.export_sources_folder, "cmake")) + + def _configure_system_openmp(self): + openmp_flags = [] + if is_msvc(self): + openmp_flags = ["-openmp"] + elif self.settings.compiler in ["clang", "apple-clang"]: + openmp_flags = ["-Xpreprocessor", "-fopenmp"] + elif self.settings.compiler == "gcc": + openmp_flags = ["-fopenmp"] + elif self.settings.compiler == "intel": + openmp_flags = ["/Qopenmp"] if self.settings.os == "Windows" else ["-Qopenmp"] + self.cpp_info.cflags += openmp_flags + self.cpp_info.cxxflags += openmp_flags + self.cpp_info.sharedlinkflags += openmp_flags + self.cpp_info.exelinkflags += openmp_flags + if self.settings.os == "Windows": + if is_msvc(self): + self.cpp_info.system_libs.append("delayimp") + elif self.settings.compiler == "gcc": + self.cpp_info.system_libs.append("gomp") + + def package_info(self): + self.cpp_info.libs = ["stdgpu"] + + if self.options.backend == "openmp": + if self.options.openmp == "system": + self._configure_system_openmp() + elif self.options.backend == "cuda": + module_path = os.path.join("lib", "cmake", "stdgpu-dependencies-cuda.cmake") + self.cpp_info.set_property("cmake_build_modules", [module_path]) + elif self.options.backend == "hip": + module_path = os.path.join("lib", "cmake", "stdgpu-dependencies-hip.cmake") + self.cpp_info.set_property("cmake_build_modules", [module_path]) + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) diff --git a/recipes/stdgpu/all/test_package/CMakeLists.txt b/recipes/stdgpu/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..a42458e26851ce --- /dev/null +++ b/recipes/stdgpu/all/test_package/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(stdgpu CONFIG REQUIRED) + +if (stdgpu_VERSION_STRING EQUAL "1.3.0") + set(CMAKE_CXX_STANDARD 14) +else() + set(CMAKE_CXX_STANDARD 17) +endif() + +if (STDGPU_BACKEND STREQUAL "cuda") + cmake_minimum_required(VERSION 3.17 FATAL_ERROR) + enable_language(CUDA) + add_executable(${PROJECT_NAME}_cuda test_package_cuda.cu) + target_link_libraries(${PROJECT_NAME}_cuda stdgpu::stdgpu) + set_target_properties(${PROJECT_NAME}_cuda PROPERTIES CUDA_ARCHITECTURES OFF) +endif() +if (STDGPU_BACKEND STREQUAL "hip") + cmake_minimum_required(VERSION 3.21 FATAL_ERROR) + enable_language(HIP) + add_executable(${PROJECT_NAME}_hip test_package_hip.hip) + target_link_libraries(${PROJECT_NAME}_hip stdgpu::stdgpu) + set_target_properties(${PROJECT_NAME}_hip PROPERTIES HIP_ARCHITECTURES OFF) +endif() +if (STDGPU_BACKEND STREQUAL "openmp") + add_executable(${PROJECT_NAME}_openmp test_package_openmp.cpp) + target_link_libraries(${PROJECT_NAME}_openmp stdgpu::stdgpu) +endif() + +if (NOT stdgpu_VERSION_STRING STREQUAL "1.3.0") + # v1.3.0 does not have stdgpu/device.h + add_executable(${PROJECT_NAME}_basic test_package_basic.cpp) + target_link_libraries(${PROJECT_NAME}_basic stdgpu::stdgpu) +endif() diff --git a/recipes/stdgpu/all/test_package/conanfile.py b/recipes/stdgpu/all/test_package/conanfile.py new file mode 100644 index 00000000000000..179d561335ad34 --- /dev/null +++ b/recipes/stdgpu/all/test_package/conanfile.py @@ -0,0 +1,39 @@ +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 = "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) + backend = str(self.dependencies["stdgpu"].options.backend) + tc.variables["STDGPU_BACKEND"] = backend + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + for variant in ["basic", "openmp", "cuda", "hip"]: + if variant == "openmp" and self.settings.compiler == "apple-clang" and self.settings.build_type == "Debug": + # Skip OpenMP test for apple-clang in debug mode, which segfaults for some reason + # https://c3i.jfrog.io/c3i/misc/summary.html?json=https://c3i.jfrog.io/c3i/misc/logs/pr/17542/12-macos-clang/stdgpu/cci.20230903/summary.json + continue + bin_path = os.path.join(self.cpp.build.bindir, f"test_package_{variant}") + if os.path.exists(bin_path): + self.run(bin_path, env="conanrun") diff --git a/recipes/stdgpu/all/test_package/test_package_basic.cpp b/recipes/stdgpu/all/test_package/test_package_basic.cpp new file mode 100644 index 00000000000000..754072b6056b3a --- /dev/null +++ b/recipes/stdgpu/all/test_package/test_package_basic.cpp @@ -0,0 +1,10 @@ +#include +#include + +#include + +int main() { + // Minimal test to confirm that the non-platform-specific portion of the library links correctly + std::cout << "stdgpu version: " << STDGPU_VERSION_STRING << std::endl; + stdgpu::print_device_information(); +} diff --git a/recipes/stdgpu/all/test_package/test_package_cuda.cu b/recipes/stdgpu/all/test_package/test_package_cuda.cu new file mode 100644 index 00000000000000..bdcd95e9feb1e1 --- /dev/null +++ b/recipes/stdgpu/all/test_package/test_package_cuda.cu @@ -0,0 +1,55 @@ +// Based on https://github.com/stotko/stdgpu/blob/32e0517/examples/cuda/vector.cu +#include +#include +#include + +#include // device_begin, device_end +#include // createDeviceArray, destroyDeviceArray +#include // STDGPU_HOST_DEVICE +#include // stdgpu::vector + +#include +#include + +__global__ void insert_neighbors_with_duplicates(const int *d_input, const stdgpu::index_t n, + stdgpu::vector vec) { + stdgpu::index_t i = static_cast(blockIdx.x * blockDim.x + threadIdx.x); + + if (i >= n) + return; + + int num = d_input[i]; + int num_neighborhood[3] = {num - 1, num, num + 1}; + + for (int num_neighbor : num_neighborhood) { + vec.push_back(num_neighbor); + } +} + +int sum_stdgpu(stdgpu::index_t n) { + int *d_input = createDeviceArray(n); + auto vec = stdgpu::vector::createDeviceObject(3 * n); + + thrust::sequence(stdgpu::device_begin(d_input), stdgpu::device_end(d_input), 1); + + stdgpu::index_t threads = 32; + stdgpu::index_t blocks = (n + threads - 1) / threads; + insert_neighbors_with_duplicates<<(blocks), + static_cast(threads)>>>(d_input, n, vec); + cudaDeviceSynchronize(); + + auto range_vec = vec.device_range(); + int sum = thrust::reduce(range_vec.begin(), range_vec.end(), 0, thrust::plus()); + + destroyDeviceArray(d_input); + stdgpu::vector::destroyDeviceObject(vec); + + return sum; +} + +int main() { + const int n = 20; + const int sum_closed_form = 3 * (n * (n + 1) / 2); + std::cout << "Sum: " << sum_stdgpu(n) << ", expected: " << sum_closed_form << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/stdgpu/all/test_package/test_package_hip.hip b/recipes/stdgpu/all/test_package/test_package_hip.hip new file mode 100644 index 00000000000000..dc4730565ae0ed --- /dev/null +++ b/recipes/stdgpu/all/test_package/test_package_hip.hip @@ -0,0 +1,64 @@ +// https://github.com/stotko/stdgpu/blob/50530de/examples/hip/ranges.hip +/* + * Copyright 2020 Patrick Stotko + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include // device_begin, device_end +#include // createDeviceArray, destroyDeviceArray +#include // STDGPU_HOST_DEVICE +#include // device_range +#include // stdgpu::unordered_set + +struct square_int +{ + STDGPU_HOST_DEVICE int + operator()(const int x) const + { + return x * x; + } +}; + +int +main() +{ + const stdgpu::index_t n = 100; + + int* d_input = createDeviceArray(n); + int* d_result = createDeviceArray(n); + stdgpu::unordered_set set = stdgpu::unordered_set::createDeviceObject(n); + + thrust::sequence(stdgpu::device_begin(d_input), stdgpu::device_end(d_input), 1); + + auto range_int = stdgpu::device_range(d_input); + thrust::transform(range_int.begin(), range_int.end(), stdgpu::device_begin(d_result), square_int()); + + set.insert(stdgpu::device_cbegin(d_result), stdgpu::device_cend(d_result)); + + auto range_set = set.device_range(); + int sum = thrust::reduce(range_set.begin(), range_set.end(), 0, thrust::plus()); + + const int sum_closed_form = n * (n + 1) * (2 * n + 1) / 6; + + std::cout << "The computed sum from i = 1 to " << n << " of i^2 is " << sum << " (" << sum_closed_form + << " expected)" << std::endl; + + destroyDeviceArray(d_input); + destroyDeviceArray(d_result); + stdgpu::unordered_set::destroyDeviceObject(set); +} diff --git a/recipes/stdgpu/all/test_package/test_package_openmp.cpp b/recipes/stdgpu/all/test_package/test_package_openmp.cpp new file mode 100644 index 00000000000000..87d3c025b094b8 --- /dev/null +++ b/recipes/stdgpu/all/test_package/test_package_openmp.cpp @@ -0,0 +1,47 @@ +// Based on https://github.com/stotko/stdgpu/blob/32e0517/examples/openmp/vector.cpp +#include +#include +#include + +#include // device_begin, device_end +#include // createDeviceArray, destroyDeviceArray +#include // STDGPU_HOST_DEVICE +#include // stdgpu::vector + +#include +#include + +void insert_neighbors_with_duplicates(const int *d_input, const stdgpu::index_t n, + stdgpu::vector &vec) { +#pragma omp parallel for + for (stdgpu::index_t i = 0; i < n; ++i) { + int num = d_input[i]; + int num_neighborhood[3] = {num - 1, num, num + 1}; + for (int num_neighbor : num_neighborhood) + vec.push_back(num_neighbor); + } +} + +int sum_stdgpu(stdgpu::index_t n) { + int *d_input = createDeviceArray(n); + auto vec = stdgpu::vector::createDeviceObject(3 * n); + + thrust::sequence(stdgpu::device_begin(d_input), stdgpu::device_end(d_input), 1); + + insert_neighbors_with_duplicates(d_input, n, vec); + + auto range_vec = vec.device_range(); + int sum = thrust::reduce(range_vec.begin(), range_vec.end(), 0, thrust::plus()); + + destroyDeviceArray(d_input); + stdgpu::vector::destroyDeviceObject(vec); + + return sum; +} + +int main() { + const int n = 20; + const int sum_closed_form = 3 * (n * (n + 1) / 2); + std::cout << "Sum: " << sum_stdgpu(n) << ", expected: " << sum_closed_form << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/stdgpu/config.yml b/recipes/stdgpu/config.yml new file mode 100644 index 00000000000000..73334d8cce8e61 --- /dev/null +++ b/recipes/stdgpu/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20230913": + folder: all + "1.3.0": + folder: all diff --git a/recipes/stduuid/all/conandata.yml b/recipes/stduuid/all/conandata.yml index cb02ec2f291486..106008491388a0 100644 --- a/recipes/stduuid/all/conandata.yml +++ b/recipes/stduuid/all/conandata.yml @@ -8,3 +8,12 @@ sources: "1.0": url: "https://github.com/mariusbancila/stduuid/archive/v1.0.tar.gz" sha256: "e96f2ac7c950c3c24d7e2e44a84236277b7774ee346dcc620edf400d9eda0a3c" +patches: + "1.2.2": + - patch_file: "patches/1.2.2-handle-span-header.patch" + patch_description: "Conditionally include span header based on compiler definition" + patch_type: "conan" + "1.2.3": + - patch_file: "patches/1.2.3-handle-span-header.patch" + patch_description: "Conditionally include span header based on compiler definition" + patch_type: "conan" diff --git a/recipes/stduuid/all/conanfile.py b/recipes/stduuid/all/conanfile.py index f5148b86a236f4..740dfa380f1ad7 100644 --- a/recipes/stduuid/all/conanfile.py +++ b/recipes/stduuid/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 copy, get +from conan.tools.build import check_min_cppstd, valid_min_cppstd +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 @@ -18,16 +18,14 @@ class StduuidConan(ConanFile): homepage = "https://github.com/mariusbancila/stduuid" settings = "os", "arch", "compiler", "build_type" options = { + # True: Use std::span + # False: Use gsl::span "with_cxx20_span": [True, False], } - default_options = { - "with_cxx20_span": False, - } - no_copy_source = True @property def _min_cppstd(self): - return "20" if self.options.with_cxx20_span else "17" + return "20" if self.options.get_safe("with_cxx20_span") else "17" @property def _compilers_minimum_version(self): @@ -38,21 +36,34 @@ def _compilers_minimum_version(self): "msvc": "191", "Visual Studio": "15", } + + def export_sources(self): + export_conandata_patches(self) def layout(self): basic_layout(self, src_folder="src") + def config_options(self): + if Version(self.version) == "1.0": + # Version 1.0 unconditionally depends on gsl span + del self.options.with_cxx20_span + else: + # Conditionally set the default value of with_cxx20_span + # if cppstd is set and is 20 or greater + self.options.with_cxx20_span = (self.settings.compiler.get_safe("cppstd", False) + and valid_min_cppstd(self, 20)) + def requirements(self): - if not self.options.with_cxx20_span: - self.requires("ms-gsl/3.1.0", transitive_headers=True) + if not self.options.get_safe("with_cxx20_span") or Version(self.version) == "1.0": + self.requires("ms-gsl/4.0.0", transitive_headers=True) if self.settings.os == "Linux" and Version(self.version) <= "1.0": - self.requires("libuuid/1.0.3", transitive_headers=True, transitive_libs=True) + self.requires("util-linux-libuuid/2.39", transitive_headers=True, transitive_libs=True) def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler.get_safe("cppsd"): + 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) @@ -62,8 +73,8 @@ def validate(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) + apply_conandata_patches(self) def build(self): pass @@ -75,5 +86,5 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - if not self.options.with_cxx20_span: - self.cpp_info.includedirs.append(os.path.join(self.dependencies["ms-gsl"].cpp_info.includedirs[0], "gsl")) + if self.options.get_safe("with_cxx20_span"): + self.cpp_info.defines = ["LIBUUID_CPP20_OR_GREATER"] diff --git a/recipes/stduuid/all/patches/1.2.2-handle-span-header.patch b/recipes/stduuid/all/patches/1.2.2-handle-span-header.patch new file mode 100644 index 00000000000000..840c78174c7724 --- /dev/null +++ b/recipes/stduuid/all/patches/1.2.2-handle-span-header.patch @@ -0,0 +1,26 @@ +diff --git a/include/uuid.h b/include/uuid.h +index 600846f..5f00a49 100644 +--- a/include/uuid.h ++++ b/include/uuid.h +@@ -15,7 +15,11 @@ + #include + #include + #include +-#include ++#if defined(LIBUUID_CPP20_OR_GREATER) ++# include ++#else ++# include ++#endif + + #ifdef _WIN32 + +@@ -51,7 +55,7 @@ + + namespace uuids + { +-#ifdef __cpp_lib_span ++#if defined(LIBUUID_CPP20_OR_GREATER) + template + using span = std::span; + #else diff --git a/recipes/stduuid/all/patches/1.2.3-handle-span-header.patch b/recipes/stduuid/all/patches/1.2.3-handle-span-header.patch new file mode 100644 index 00000000000000..fae5f65b66c25c --- /dev/null +++ b/recipes/stduuid/all/patches/1.2.3-handle-span-header.patch @@ -0,0 +1,29 @@ +diff --git a/include/uuid.h b/include/uuid.h +index d48059d..4d14e4d 100644 +--- a/include/uuid.h ++++ b/include/uuid.h +@@ -17,15 +17,6 @@ + #include + #include + +-#ifdef __cplusplus +- +-# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) +-# define LIBUUID_CPP20_OR_GREATER +-# endif +- +-#endif +- +- + #ifdef LIBUUID_CPP20_OR_GREATER + #include + #else +@@ -66,7 +57,7 @@ + + namespace uuids + { +-#ifdef __cpp_lib_span ++#if defined(LIBUUID_CPP20_OR_GREATER) + template + using span = std::span; + #else diff --git a/recipes/streamvbyte/all/conandata.yml b/recipes/streamvbyte/all/conandata.yml new file mode 100644 index 00000000000000..6ecc44a0710521 --- /dev/null +++ b/recipes/streamvbyte/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.0.0": + url: "https://github.com/lemire/streamvbyte/archive/refs/tags/v1.0.0.tar.gz" + sha256: "6b1920e9865146ba444cc317aa61cd39cdf760236e354ef7956011a9fe577882" +patches: + "1.0.0": + - patch_file: "patches/1.0.0-0001-fix-cmake.patch" + patch_description: "fix install destination" + patch_source: "https://github.com/lemire/streamvbyte/pull/67" + patch_type: "portability" + - patch_file: "patches/1.0.0-0002-relocatable-shared-macos.patch" + patch_description: "Relocatable shared lib for macOS" + patch_source: "https://github.com/lemire/streamvbyte/pull/66" + patch_type: "portability" diff --git a/recipes/streamvbyte/all/conanfile.py b/recipes/streamvbyte/all/conanfile.py new file mode 100644 index 00000000000000..e296e0b1707999 --- /dev/null +++ b/recipes/streamvbyte/all/conanfile.py @@ -0,0 +1,63 @@ +from conan import ConanFile +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class StreamvbyteConan(ConanFile): + name = "streamvbyte" + description = "Fast integer compression in C using the StreamVByte codec" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lemire/streamvbyte" + topics = ("compression", "simd") + 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): + 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") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["STREAMVBYTE_WERROR"] = False + tc.variables["STREAMVBYTE_WALL"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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 = ["streamvbyte"] diff --git a/recipes/streamvbyte/all/patches/1.0.0-0001-fix-cmake.patch b/recipes/streamvbyte/all/patches/1.0.0-0001-fix-cmake.patch new file mode 100644 index 00000000000000..99ab62225b6388 --- /dev/null +++ b/recipes/streamvbyte/all/patches/1.0.0-0001-fix-cmake.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b6aa73e..547c44d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -136,7 +136,11 @@ install( + ${PROJECT_SOURCE_DIR}/include/streamvbyte_zigzag.h + DESTINATION include + ) +-install(TARGETS streamvbyte DESTINATION lib) ++install(TARGETS streamvbyte ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) + + option(STREAMVBYTE_SANITIZE_UNDEFINED "Sanitize undefined behavior" OFF) + if(STREAMVBYTE_SANITIZE_UNDEFINED) diff --git a/recipes/streamvbyte/all/patches/1.0.0-0002-relocatable-shared-macos.patch b/recipes/streamvbyte/all/patches/1.0.0-0002-relocatable-shared-macos.patch new file mode 100644 index 00000000000000..5d52b1fe170f0a --- /dev/null +++ b/recipes/streamvbyte/all/patches/1.0.0-0002-relocatable-shared-macos.patch @@ -0,0 +1,9 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,4 @@ + cmake_minimum_required(VERSION 3.3) +- +-set(CMAKE_MACOSX_RPATH OFF) + project(STREAMVBYTE VERSION "1.0.0") + + set(STREAMVBYTE_LIB_VERSION "1.0.0" CACHE STRING "streamvbyte library version") diff --git a/recipes/streamvbyte/all/test_package/CMakeLists.txt b/recipes/streamvbyte/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..531d5c3182e367 --- /dev/null +++ b/recipes/streamvbyte/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(streamvbyte REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE streamvbyte::streamvbyte) diff --git a/recipes/streamvbyte/all/test_package/conanfile.py b/recipes/streamvbyte/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/streamvbyte/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/streamvbyte/all/test_package/test_package.c b/recipes/streamvbyte/all/test_package/test_package.c new file mode 100644 index 00000000000000..bda2ad161f9424 --- /dev/null +++ b/recipes/streamvbyte/all/test_package/test_package.c @@ -0,0 +1,29 @@ +#include +#include +#include + +#include "streamvbyte.h" + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wdeclaration-after-statement" +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + +int main(void) { + uint32_t N = 100U; + uint32_t * datain = malloc(N * sizeof(uint32_t)); + uint8_t * compressedbuffer = malloc(streamvbyte_max_compressedbytes(N)); + uint32_t * recovdata = malloc(N * sizeof(uint32_t)); + for (uint32_t k = 0; k < N; ++k) + datain[k] = 120; + size_t compsize = streamvbyte_encode(datain, N, compressedbuffer); // encoding + // here the result is stored in compressedbuffer using compsize bytes + size_t compsize2 = streamvbyte_decode(compressedbuffer, recovdata, + N); // decoding (fast) + assert(compsize == compsize2); + free(datain); + free(compressedbuffer); + free(recovdata); + printf("Compressed %d integers down to %d bytes.\n",N,(int) compsize); + return 0; +} diff --git a/recipes/streamvbyte/config.yml b/recipes/streamvbyte/config.yml new file mode 100644 index 00000000000000..40341aa3db6cd3 --- /dev/null +++ b/recipes/streamvbyte/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/stringzilla/all/conandata.yml b/recipes/stringzilla/all/conandata.yml new file mode 100644 index 00000000000000..63892a4c139d3e --- /dev/null +++ b/recipes/stringzilla/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.0.3": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v2.0.3.tar.gz" + sha256: "6b52a7b4eb8383cbcf83608eaa08e5ba588a378449439b73584713a16d8920e3" + "2.0.1": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v2.0.1.tar.gz" + sha256: "804baa0ed8bb530de25390b21d5d51059644d5b1306364edf948c27157029793" + "1.2.2": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v1.2.2.tar.gz" + sha256: "2e17c49965841647a1c371247f53b2f576e5fb32fe4b84a080d425b12f17703c" + "1.1.3": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v1.1.3.tar.gz" + sha256: "1856c4d780b2c9a12ccd14d04996b35bec9fe537d0a31209000e12777a86e495" diff --git a/recipes/stringzilla/all/conanfile.py b/recipes/stringzilla/all/conanfile.py new file mode 100644 index 00000000000000..bded9fa3b64265 --- /dev/null +++ b/recipes/stringzilla/all/conanfile.py @@ -0,0 +1,48 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.52.0" + +class StringZillaConan(ConanFile): + name = "stringzilla" + description = "Fastest string sort, search, split, and shuffle for long strings and multi-gigabyte files in Python and C, leveraging SIMD with Arm Neon and x86 AVX2 & AVX-512 intrinsics." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ashvardanian/StringZilla/" + topics = ("string", "simd", "sse", "avx", "neon", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + 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) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "stringzilla"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/stringzilla/all/test_package/CMakeLists.txt b/recipes/stringzilla/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..6769ff716eab8a --- /dev/null +++ b/recipes/stringzilla/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(stringzilla REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE stringzilla::stringzilla) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(stringzilla_VERSION VERSION_LESS 2.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE STRINGZILLA_LESS_2_0) +endif() diff --git a/recipes/stringzilla/all/test_package/conanfile.py b/recipes/stringzilla/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/stringzilla/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/stringzilla/all/test_package/test_package.cpp b/recipes/stringzilla/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..c5ffe699dbc065 --- /dev/null +++ b/recipes/stringzilla/all/test_package/test_package.cpp @@ -0,0 +1,52 @@ +#include +#include +#include "stringzilla.h" + +#ifdef STRINGZILLA_LESS_2_0 + +int main(void) { + // Initialize your haystack and needle + strzl_haystack_t haystack = { + "Fastest string sort, search, split, " + "and shuffle for long strings and multi-gigabyte files in Python and C, " + "leveraging SIMD with Arm Neon and x86 AVX2 & AVX-512 intrinsics.", + 171}; + strzl_needle_t needle = {"SIMD", 4}; + + // Count occurrences of a character like a boss 😎 + size_t count = strzl_naive_count_char(haystack, 'a'); + + // Find a character like you're searching for treasure 🏴‍☠️ + size_t position = strzl_naive_find_char(haystack, 'a'); + + // Find a substring like it's Waldo 🕵️‍♂️ + size_t substring_position = strzl_naive_find_substr(haystack, needle); + + return EXIT_SUCCESS; +} + +#else + +int main(void) { + // Initialize your haystack and needle + sz_string_view_t haystack = { + "Fastest string sort, search, split, " + "and shuffle for long strings and multi-gigabyte files in Python and C, " + "leveraging SIMD with Arm Neon and x86 AVX2 & AVX-512 intrinsics.", + 171}; + sz_string_view_t needle = {"SIMD", 4}; + + // Perform string-level operations + sz_size_t character_count = sz_count_char(haystack.start, haystack.length, "a"); + sz_string_start_t substring_position = sz_find_substring( + haystack.start, haystack.length, + needle.start, needle.length + ); + + // Hash strings + sz_u32_t crc32 = sz_hash_crc32(haystack.start, haystack.length); + + return EXIT_SUCCESS; +} + +#endif diff --git a/recipes/stringzilla/config.yml b/recipes/stringzilla/config.yml new file mode 100644 index 00000000000000..bb807cfa424987 --- /dev/null +++ b/recipes/stringzilla/config.yml @@ -0,0 +1,9 @@ +versions: + "2.0.3": + folder: all + "2.0.1": + folder: all + "1.2.2": + folder: all + "1.1.3": + folder: all diff --git a/recipes/strong_type/all/conandata.yml b/recipes/strong_type/all/conandata.yml index 93df54150e6a03..6f362b86eb3464 100644 --- a/recipes/strong_type/all/conandata.yml +++ b/recipes/strong_type/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "v13": + url: "https://github.com/rollbear/strong_type/archive/refs/tags/v13.tar.gz" + sha256: "96a799dff6ed8d83040703c6f79162fc5ddf13d1aea4e56ce456736a30e07c5a" + "v12": + url: "https://github.com/rollbear/strong_type/archive/refs/tags/v12.tar.gz" + sha256: "8af0400c7ae76c7ec8646e929bacb37fc7fcae33e54eeaa61fa9f9df508a9248" "v11": url: "https://github.com/rollbear/strong_type/archive/refs/tags/v11.tar.gz" sha256: "b9879c8835501c05147603ac86097b263437f72a35299b5f96c90be789932418" diff --git a/recipes/strong_type/config.yml b/recipes/strong_type/config.yml index 547a5c53c28e34..cf589fbd0a896c 100644 --- a/recipes/strong_type/config.yml +++ b/recipes/strong_type/config.yml @@ -1,4 +1,8 @@ versions: + "v13": + folder: all + "v12": + folder: all "v11": folder: all "v10": diff --git a/recipes/stx/all/CMakeLists.txt b/recipes/stx/all/CMakeLists.txt deleted file mode 100644 index 8bdaa1e47bfa00..00000000000000 --- a/recipes/stx/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/stx/all/conandata.yml b/recipes/stx/all/conandata.yml index 80294861307793..d0f1a667ea097e 100644 --- a/recipes/stx/all/conandata.yml +++ b/recipes/stx/all/conandata.yml @@ -1,10 +1,22 @@ sources: - "1.0.1": - url: https://github.com/lamarrr/STX/archive/v1.0.1.tar.gz - sha256: c491c888c56b9f800eb7c17a30c81afcf2d9fec4cdae9a73cd1145698a645dd9 + "1.0.5": + url: "https://github.com/lamarrr/STX/archive/v1.0.5.tar.gz" + sha256: "d21a1895bc7057c8c6118a042ec39f364b2ad768394d4facb2fd64b73b07d97f" + "1.0.4": + url: "https://github.com/lamarrr/STX/archive/v1.0.4.tar.gz" + sha256: "89c61efb84828e42ddd6765e323e12b7b8de7ff68116f93227a87c56159c34ab" patches: - "1.0.1": - - patch_file: patches/0001-abseil_find_package.patch - base_path: source_subfolder - - patch_file: patches/0002-cmake_module_path.patch - base_path: source_subfolder + "1.0.5": + - patch_file: "patches/1.0.4-0001-cmake_module_path.patch" + patch_description: "append CMAKE_MODULE_PATH instead of setting CMAKE_MODULE_PATH" + patch_type: "conan" + - patch_file: "patches/1.0.5-0002-add-installer.patch" + patch_description: "use GNUInstallDirs for target path" + patch_type: "portability" + "1.0.4": + - patch_file: "patches/1.0.4-0001-cmake_module_path.patch" + patch_description: "append CMAKE_MODULE_PATH instead of setting CMAKE_MODULE_PATH" + patch_type: "conan" + - patch_file: "patches/1.0.4-0002-add-installer.patch" + patch_description: "use GNUInstallDirs for target path" + patch_type: "portability" diff --git a/recipes/stx/all/conanfile.py b/recipes/stx/all/conanfile.py index b81962b835189a..a4d52d28312f94 100644 --- a/recipes/stx/all/conanfile.py +++ b/recipes/stx/all/conanfile.py @@ -1,149 +1,104 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +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, export_conandata_patches, get, copy +from conan.tools.scm import Version import os -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.53.0" class STXConan(ConanFile): name = 'stx' - homepage = 'https://github.com/lamarrr/STX' + description = 'C++17 & C++ 20 error-handling and utility extensions.' license = 'MIT' url = 'https://github.com/conan-io/conan-center-index' - description = 'C++17 & C++ 20 error-handling and utility extensions.' - topics = 'error-handling', 'result', 'option', 'backtrace', 'panic' - - settings = 'os', 'compiler', 'build_type', 'arch' + homepage = 'https://github.com/lamarrr/STX' + topics = ('error-handling', 'result', 'option', 'backtrace', 'panic') + package_type = "static-library" + settings = 'os', 'arch', 'compiler', 'build_type' options = { - 'shared': [True, False], 'fPIC': [True, False], 'backtrace': [True, False], - 'panic_handler': [None, 'default', 'backtrace'], - 'visible_panic_hook': [True, False], + 'custom_panic_handler': [True, False], } default_options = { - 'shared': False, 'fPIC': True, 'backtrace': False, - 'panic_handler': 'default', - 'visible_panic_hook': False, + 'custom_panic_handler': False, } - exports_sources = ['CMakeLists.txt', 'patches/*'] - generators = 'cmake', 'cmake_find_package' - @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 { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + 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: - del self.options.fPIC + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.backtrace: - self.requires('abseil/20200923.1') + self.requires('abseil/20230125.3') def validate(self): - if (self.options.panic_handler == 'backtrace' and - not self.options.backtrace): - raise ConanInvalidConfiguration( - 'panic_handler=backtrace requires backtrace=True' - ) - - compiler = self.settings.compiler - compiler_version = tools.Version(self.settings.compiler.version) - - if compiler.get_safe('cppstd'): - tools.check_min_cppstd(self, 17) - - if compiler == 'Visual Studio' and compiler_version < 16: - raise ConanInvalidConfiguration( - 'STX requires C++17 language and standard library features ' - 'which VS < 2019 lacks' - ) - - if compiler == 'gcc' and compiler_version < 8: - raise ConanInvalidConfiguration( - 'STX requires C++17 language and standard library features ' - 'which GCC < 8 lacks' - ) + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) - if (compiler == 'clang' and compiler.libcxx and - compiler.libcxx in ['libstdc++', 'libstdc++11'] and - compiler_version < 9): + 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( - 'STX requires C++17 language and standard library features ' - 'which clang < 9 with libc++ lacks' + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if (compiler == 'clang' and compiler.libcxx and - compiler.libcxx == 'libc++' and - compiler_version < 10): - raise ConanInvalidConfiguration( - 'STX requires C++17 language and standard library features ' - 'which clang < 10 with libc++ lacks' - ) - - if compiler == 'apple-clang' and compiler_version < 12: - raise ConanInvalidConfiguration( - 'STX requires C++17 language and standard library features ' - 'which apple-clang < 12 with libc++ lacks' - ) - - if (compiler == 'Visual Studio' and self.options.shared and - tools.Version(self.version) <= '1.0.1'): - raise ConanInvalidConfiguration( - 'shared library build does not work on windows with ' - 'STX version <= 1.0.1' - ) + 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): - 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 build(self): - for patch in self.conan_data.get('patches', {}).get(self.version, []): - tools.patch(**patch) + def generate(self): + tc = CMakeToolchain(self) + tc.variables['STX_ENABLE_BACKTRACE'] = self.options.backtrace + tc.variables['STX_CUSTOM_PANIC_HANDLER'] = self.options.custom_panic_handler + tc.generate() + deps = CMakeDeps(self) + deps.generate() + def build(self): + apply_conandata_patches(self) cmake = CMake(self) - cmake.definitions['STX_BUILD_SHARED'] = self.options.shared - cmake.definitions['STX_ENABLE_BACKTRACE'] = self.options.backtrace - cmake.definitions['STX_ENABLE_PANIC_BACKTRACE'] = \ - self.options.panic_handler == 'backtrace' - cmake.definitions['STX_OVERRIDE_PANIC_HANDLER'] = \ - self.options.panic_handler == None - cmake.definitions['STX_VISIBLE_PANIC_HOOK'] = \ - self.options.visible_panic_hook - - cmake.configure(build_folder=self._build_subfolder) + cmake.configure() cmake.build() def package(self): - self.copy( - '*.h', - dst='include', - src=os.path.join(self._source_subfolder, 'include') - ) - - self.copy('*.lib', dst='lib', keep_path=False) - self.copy('*.dll', dst='bin', keep_path=False) - self.copy('*.so', dst='lib', keep_path=False) - self.copy('*.dylib', dst='lib', keep_path=False) - self.copy('*.a', dst='lib', keep_path=False) - - self.copy('LICENSE', dst='licenses', src=self._source_subfolder) + copy(self, pattern="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 = tools.collect_libs(self) + self.cpp_info.libs = ["stx"] if self.options.backtrace: self.cpp_info.requires = [ @@ -151,14 +106,5 @@ def package_info(self): 'abseil::absl_symbolize' ] - if self.options.visible_panic_hook: - self.cpp_info.defines.append('STX_VISIBLE_PANIC_HOOK') - - if self.options.panic_handler == None: - self.cpp_info.defines.append('STX_OVERRIDE_PANIC_HANDLER') - - if self.options.panic_handler == 'backtrace': - self.cpp_info.defines.append('STX_ENABLE_PANIC_BACKTRACE') - - if self.settings.os == 'Android': + if self.settings.os in ["Linux", "FreeBSD", 'Android']: self.cpp_info.system_libs = ['atomic'] diff --git a/recipes/stx/all/patches/0001-abseil_find_package.patch b/recipes/stx/all/patches/0001-abseil_find_package.patch deleted file mode 100644 index 11c8ae870c7f28..00000000000000 --- a/recipes/stx/all/patches/0001-abseil_find_package.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e4ed99e..5e155ec 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -204,12 +204,7 @@ endif() - # =============================================== - - if(STX_ENABLE_BACKTRACE) -- if(NOT EXISTS third_party/abseil) -- execute_process( -- COMMAND git submodule update --init --recursive third_party/abseil -- WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) -- endif() -- add_subdirectory(third_party/abseil) -+ find_package(absl REQUIRED) - endif() - - # the atomics library doesn't automatically link on my Android phone diff --git a/recipes/stx/all/patches/0002-cmake_module_path.patch b/recipes/stx/all/patches/0002-cmake_module_path.patch deleted file mode 100644 index 909cc4eabba229..00000000000000 --- a/recipes/stx/all/patches/0002-cmake_module_path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5e155ec..d73691d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -30,7 +30,7 @@ project( - HOMEPAGE_URL "https://github.com/lamarrr/STX" - LANGUAGES CXX) - --set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules) -+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules) - - include(CMakeDependentOption) - include(HandleFlags) diff --git a/recipes/stx/all/patches/1.0.4-0001-cmake_module_path.patch b/recipes/stx/all/patches/1.0.4-0001-cmake_module_path.patch new file mode 100644 index 00000000000000..89363cb6ad87d1 --- /dev/null +++ b/recipes/stx/all/patches/1.0.4-0001-cmake_module_path.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4a21163..d11d123 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ project( + HOMEPAGE_URL "https://github.com/lamarrr/STX" + LANGUAGES CXX) + +-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules) ++list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules) + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + diff --git a/recipes/stx/all/patches/1.0.4-0002-add-installer.patch b/recipes/stx/all/patches/1.0.4-0002-add-installer.patch new file mode 100644 index 00000000000000..102b4d0e1195c6 --- /dev/null +++ b/recipes/stx/all/patches/1.0.4-0002-add-installer.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4a21163..d24bb87 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -131,10 +131,14 @@ endif() + # === Install + # + # =============================================== ++include(GNUInstallDirs) + install( + TARGETS stx + EXPORT stx +- LIBRARY DESTINATION lib) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) + install(DIRECTORY include/stx DESTINATION include) + + # =============================================== diff --git a/recipes/stx/all/patches/1.0.5-0002-add-installer.patch b/recipes/stx/all/patches/1.0.5-0002-add-installer.patch new file mode 100644 index 00000000000000..76dc4807839237 --- /dev/null +++ b/recipes/stx/all/patches/1.0.5-0002-add-installer.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ee82585..bea77c7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -113,10 +113,14 @@ target_include_directories(stx PRIVATE src) + # === Install + # + # =============================================== ++include(GNUInstallDirs) + install( + TARGETS stx + EXPORT stx +- LIBRARY DESTINATION lib) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) + install(DIRECTORY include/stx DESTINATION include) + + # =============================================== diff --git a/recipes/stx/all/test_package/CMakeLists.txt b/recipes/stx/all/test_package/CMakeLists.txt index 985bbfd508f2ef..6d43705b506c0c 100644 --- a/recipes/stx/all/test_package/CMakeLists.txt +++ b/recipes/stx/all/test_package/CMakeLists.txt @@ -1,14 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(PackageTest LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) +find_package(stx REQUIRED CONFIG) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(stx CONFIG REQUIRED) - -add_executable(example example.cpp) -target_link_libraries(example PRIVATE stx::stx) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE stx::stx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/stx/all/test_package/conanfile.py b/recipes/stx/all/test_package/conanfile.py index 46663ae7805d27..ef5d7042163ecc 100644 --- a/recipes/stx/all/test_package/conanfile.py +++ b/recipes/stx/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 STXTestConan(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) @@ -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', 'example'), 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/stx/all/test_package/example.cpp b/recipes/stx/all/test_package/test_package.cpp similarity index 100% rename from recipes/stx/all/test_package/example.cpp rename to recipes/stx/all/test_package/test_package.cpp diff --git a/recipes/stx/config.yml b/recipes/stx/config.yml index 715e55357a17be..267193202c4e1c 100644 --- a/recipes/stx/config.yml +++ b/recipes/stx/config.yml @@ -1,3 +1,5 @@ versions: - "1.0.1": + "1.0.5": + folder: all + "1.0.4": folder: all diff --git a/recipes/subunit/all/conandata.yml b/recipes/subunit/all/conandata.yml index afbc1844ad6772..565af62adb5d69 100644 --- a/recipes/subunit/all/conandata.yml +++ b/recipes/subunit/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "1.4.0": - patch_file: "patches/0001-fix-ExtUtils-MakeMaker-error.patch" - base_path: "source_subfolder" diff --git a/recipes/subunit/all/conanfile.py b/recipes/subunit/all/conanfile.py index e662ea1d9f3b1b..b1995dd5991867 100644 --- a/recipes/subunit/all/conanfile.py +++ b/recipes/subunit/all/conanfile.py @@ -1,19 +1,28 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import contextlib import glob 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 Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class SubunitConan(ConanFile): name = "subunit" description = "A streaming protocol for test results" - topics = "subunit", "streaming", "protocol", "test", "results" - license = "Apache-2.0", "BSD-3-Clause" - homepage = "https://launchpad.net/subunit" + license = ("Apache-2.0", "BSD-3-Clause") url = "https://github.com/conan-io/conan-center-index" + homepage = "https://launchpad.net/subunit" + topics = ("subunit", "streaming", "protocol", "test", "results") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,125 +33,135 @@ class SubunitConan(ConanFile): "fPIC": True, } - exports_sources = "patches/*" - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" + + 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: - del self.options.fPIC + self.options.rm_safe("fPIC") - def requirements(self): - self.requires("cppunit/1.15.1") + def layout(self): + basic_layout(self, src_folder="src") - 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.3") + def requirements(self): + self.requires("cppunit/1.15.1", transitive_headers=True) def validate(self): if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("Cannot build shared subunit libraries on Windows") - if self.settings.compiler == "apple-clang" and tools.Version(self.settings.compiler.version) < "10": + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "10": # Complete error is: # make[2]: *** No rule to make target `/Applications/Xcode-9.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/config.h', needed by `Makefile'. Stop. raise ConanInvalidConfiguration("Due to weird make error involving missing config.h file in sysroot") + if self.settings.compiler == "apple-clang" and self.options.shared: + raise ConanInvalidConfiguration("Shared builds with apple-clang are not supported") + def build_requirements(self): + 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") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), - "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)), - "NM": "dumpbin -symbols", - "OBJDUMP": ":", - "RANLIB": ":", - "STRIP": ":", - } - 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) - self._autotools.libs = [] - if self.settings.compiler == "Visual Studio": - self._autotools.flags.append("-FS") - self._autotools.cxx_flags.append("-EHsc") - yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "CHECK_CFLAGS=' '", - "CHECK_LIBS=' '", - "CPPUNIT_CFLAGS='{}'".format(" ".join("-I{}".format(inc) for inc in self.deps_cpp_info["cppunit"].include_paths).replace("\\", "/")), - "CPPUNIT_LIBS='{}'".format(" ".join(self.deps_cpp_info["cppunit"].libs)), + 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) + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.extra_cxxflags.append("-EHsc") + tc.configure_args.append("CHECK_CFLAGS= ") + tc.configure_args.append("CHECK_LIBS= ") + cppunit_info = self.dependencies["cppunit"].cpp_info + tc.configure_args.append("CPPUNIT_LIBS='{}'".format(" ".join(cppunit_info.libs))) + tc.configure_args.append("CPPUNIT_CFLAGS= ") + # Avoid installing i18n + perl things in arch-dependent folders or in a `local` subfolder + tc.make_args += [ + f"INSTALLARCHLIB={unix_path(self, os.path.join(self.package_folder, 'lib'))}", + f"INSTALLSITEARCH={unix_path(self, os.path.join(self.build_folder, 'archlib'))}", + f"INSTALLVENDORARCH={unix_path(self, os.path.join(self.build_folder, 'archlib'))}", + f"INSTALLSITEBIN={unix_path(self, os.path.join(self.package_folder, 'bin'))}", + f"INSTALLSITESCRIPT={unix_path(self, os.path.join(self.package_folder, 'bin'))}", + f"INSTALLSITEMAN1DIR={unix_path(self, os.path.join(self.build_folder, 'share', 'man', 'man1'))}", + f"INSTALLSITEMAN3DIR={unix_path(self, os.path.join(self.build_folder, 'share', 'man', 'man3'))}", ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + tc.generate() + + if is_msvc(self) or self._is_clang_cl: + # AutotoolsDeps causes ./configure to fail on Windows + # Possibly related to https://github.com/conan-io/conan/issues/12784 + env = Environment() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in cppunit_info.includedirs] + [f"-D{d}" for d in cppunit_info.defines]) + env.vars(self).save_script("conanautotoolsdeps_workaround") + else: + deps = AutotoolsDeps(self) + deps.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') + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") 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() + apply_conandata_patches(self) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - # Avoid installing i18n + perl things in arch-dependent folders or in a `local` subfolder - install_args = [ - "INSTALLARCHLIB={}".format(os.path.join(self.package_folder, "lib").replace("\\", "/")), - "INSTALLSITEARCH={}".format(os.path.join(self.build_folder, "archlib").replace("\\", "/")), - "INSTALLVENDORARCH={}".format(os.path.join(self.build_folder, "archlib").replace("\\", "/")), - "INSTALLSITEBIN={}".format(os.path.join(self.package_folder, "bin").replace("\\", "/")), - "INSTALLSITESCRIPT={}".format(os.path.join(self.package_folder, "bin").replace("\\", "/")), - "INSTALLSITEMAN1DIR={}".format(os.path.join(self.build_folder, "share", "man", "man1").replace("\\", "/")), - "INSTALLSITEMAN3DIR={}".format(os.path.join(self.build_folder, "share", "man", "man3").replace("\\", "/")), - ] - autotools.install(args=install_args) - - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pod") + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", self.package_folder, recursive=True) + rm(self, "*.pod", self.package_folder, recursive=True) for d in glob.glob(os.path.join(self.package_folder, "lib", "python*")): - tools.rmdir(d) + rmdir(self, d) for d in glob.glob(os.path.join(self.package_folder, "lib", "*")): if os.path.isdir(d): - tools.rmdir(d) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "Library")) + rmdir(self, d) + for d in glob.glob(os.path.join(self.package_folder, "*")): + if os.path.isdir(d) and os.path.basename(d) not in ["bin", "include", "lib", "licenses"]: + rmdir(self, d) def package_info(self): self.cpp_info.components["libsubunit"].libs = ["subunit"] - self.cpp_info.components["libsubunit"].names["pkgconfig"] = "libsubunit" + self.cpp_info.components["libsubunit"].set_property("pkg_config_name", "libsubunit") self.cpp_info.components["libcppunit_subunit"].libs = ["cppunit_subunit"] self.cpp_info.components["libcppunit_subunit"].requires = ["cppunit::cppunit"] - self.cpp_info.components["libcppunit_subunit"].names["pkgconfig"] = "libcppunit_subunit" + self.cpp_info.components["libcppunit_subunit"].set_property("pkg_config_name", "libcppunit_subunit") 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/subunit/all/test_package/CMakeLists.txt b/recipes/subunit/all/test_package/CMakeLists.txt index ec668b89c232d8..10c8b53495cd6e 100644 --- a/recipes/subunit/all/test_package/CMakeLists.txt +++ b/recipes/subunit/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 CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_package(subunit REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE subunit::subunit) diff --git a/recipes/subunit/all/test_package/conanfile.py b/recipes/subunit/all/test_package/conanfile.py index d4128b04507778..ef5d7042163ecc 100644 --- a/recipes/subunit/all/test_package/conanfile.py +++ b/recipes/subunit/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" + 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/subunit/all/test_v1_package/CMakeLists.txt b/recipes/subunit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/subunit/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/subunit/all/test_v1_package/conanfile.py b/recipes/subunit/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/subunit/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/suyash-ulid/all/conandata.yml b/recipes/suyash-ulid/all/conandata.yml new file mode 100644 index 00000000000000..31eb78c9466e94 --- /dev/null +++ b/recipes/suyash-ulid/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20201213": + url: "https://github.com/suyash/ulid/archive/3a46362db2c0f5fece10e59a52bdefbf7eec0877.tar.gz" + sha256: "4a9756e5d481f591c0ea4f4e767b5eecf05fea32e5b74915b044d1401548485a" diff --git a/recipes/suyash-ulid/all/conanfile.py b/recipes/suyash-ulid/all/conanfile.py new file mode 100644 index 00000000000000..df3cfccf4abd02 --- /dev/null +++ b/recipes/suyash-ulid/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + + +class SuyashUlidConan(ConanFile): + name = "suyash-ulid" + description = "ulids in C++, Header Only" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://suy.io/ulid/" + topics = ("ulid", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + 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) + + # Copy all files to the package folder + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.hh", + os.path.join(self.source_folder, "src"), + os.path.join(self.package_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/suyash-ulid/all/test_package/CMakeLists.txt b/recipes/suyash-ulid/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..16ec5b9fe98024 --- /dev/null +++ b/recipes/suyash-ulid/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(suyash-ulid REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE suyash-ulid::suyash-ulid) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/suyash-ulid/all/test_package/conanfile.py b/recipes/suyash-ulid/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/suyash-ulid/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/suyash-ulid/all/test_package/test_package.cpp b/recipes/suyash-ulid/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..c6c6528f85a1f5 --- /dev/null +++ b/recipes/suyash-ulid/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include "ulid.hh" + +int main(void) { + ulid::ULID ulid = ulid::Create(1484581420, []() { return 4; }); + std::string str = ulid::Marshal(ulid); + std::cout << str << '\n'; // 0001C7STHC0G2081040G208104 + + return EXIT_SUCCESS; +} diff --git a/recipes/suyash-ulid/config.yml b/recipes/suyash-ulid/config.yml new file mode 100644 index 00000000000000..3d9ceb6ab28c07 --- /dev/null +++ b/recipes/suyash-ulid/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20201213": + folder: all diff --git a/recipes/svgpp/all/conandata.yml b/recipes/svgpp/all/conandata.yml new file mode 100644 index 00000000000000..b4612b44411377 --- /dev/null +++ b/recipes/svgpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20221030": + url: "https://github.com/svgpp/svgpp/archive/1583a7b209038bfd0d98c6ce7d4c93986f7b235e.tar.gz" + sha256: "95f4145c43aada913e7b24e37d20d0eef5f170a7c70e00ffcb318a3910b43ca6" diff --git a/recipes/svgpp/all/conanfile.py b/recipes/svgpp/all/conanfile.py new file mode 100644 index 00000000000000..f683b8d50fc0bc --- /dev/null +++ b/recipes/svgpp/all/conanfile.py @@ -0,0 +1,59 @@ +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 +import os + + +required_conan_version = ">=1.52.0" + + +class SvgPPConan(ConanFile): + name = "svgpp" + description = "SVG++ library contains parsers for various SVG syntaxes, " \ + "adapters that simplify handling of parsed data and a lot of other utilities and helpers for the most common tasks." + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/svgpp/svgpp" + topics = ("svgpp", "svg", "parser", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.82.0", transitive_headers=True) + + def package_id(self): + self.info.clear() + + def validate(self): + 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) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE_1_0.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + 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.libdirs = [] + + self.cpp_info.requires.append("boost::headers") diff --git a/recipes/svgpp/all/test_package/CMakeLists.txt b/recipes/svgpp/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..366f84e91c3066 --- /dev/null +++ b/recipes/svgpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(svgpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE svgpp::svgpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/svgpp/all/test_package/conanfile.py b/recipes/svgpp/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/svgpp/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/svgpp/all/test_package/test_package.cpp b/recipes/svgpp/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..cb8c51e57fb338 --- /dev/null +++ b/recipes/svgpp/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + +using namespace svgpp; + +struct Context +{ + void transform_matrix(const boost::array & matrix) + { + std::copy(matrix.begin(), matrix.end(), + std::ostream_iterator(std::cout, " ")); + std::cout << "\n"; + } +}; + +int main() +{ + Context context; + value_parser::parse(tag::attribute::transform(), context, + std::string("translate(-10,-20) scale(2) rotate(45) translate(5,10)"), tag::source::attribute()); + return 0; +} diff --git a/recipes/svgpp/config.yml b/recipes/svgpp/config.yml new file mode 100644 index 00000000000000..d6e527e7221f41 --- /dev/null +++ b/recipes/svgpp/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221030": + folder: "all" diff --git a/recipes/svgwrite/all/conanfile.py b/recipes/svgwrite/all/conanfile.py index cac9b7b0b66e8f..9c1c80b182559b 100644 --- a/recipes/svgwrite/all/conanfile.py +++ b/recipes/svgwrite/all/conanfile.py @@ -56,7 +56,7 @@ def layout(self): def requirements(self): self.requires("span-lite/0.10.3", transitive_headers=True) - self.requires("fmt/10.0.0") + self.requires("fmt/10.1.0") def validate(self): if self.settings.compiler.cppstd: diff --git a/recipes/symengine/all/conandata.yml b/recipes/symengine/all/conandata.yml index d0b808ba0adde3..c52591b6474750 100644 --- a/recipes/symengine/all/conandata.yml +++ b/recipes/symengine/all/conandata.yml @@ -8,3 +8,9 @@ sources: "0.10.1": url: "https://github.com/symengine/symengine/releases/download/v0.10.1/symengine-0.10.1.tar.gz" sha256: "9c007c99e9633f5549a55fa7a66ebcbcf9e04092eb55f7bb781c22b9cf0570c4" + "0.11.1": + url: "https://github.com/symengine/symengine/releases/download/v0.11.1/symengine-0.11.1.tar.gz" + sha256: "217b39955dc19f920c6f54c057fdc89e8e155ddee8f0e3c3cacc67b3e3850b64" + "0.11.2": + url: "https://github.com/symengine/symengine/releases/download/v0.11.2/symengine-0.11.2.tar.gz" + sha256: "f6972acd6a65354f6414e69460d2e175729470632bdac05919bc2f7f32e48cbd" diff --git a/recipes/symengine/all/conanfile.py b/recipes/symengine/all/conanfile.py index cfb736044d218e..c6d7a378b2e216 100644 --- a/recipes/symengine/all/conanfile.py +++ b/recipes/symengine/all/conanfile.py @@ -36,9 +36,9 @@ class SymengineConan(ConanFile): def requirements(self): if self.options.integer_class == "boostmp": - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") else: - self.requires("gmp/6.2.1", transitive_headers=True, transitive_libs=True) + self.requires("gmp/6.3.0", transitive_headers=True, transitive_libs=True) def source(self): get( diff --git a/recipes/symengine/config.yml b/recipes/symengine/config.yml index b95eb1527125e7..b47e71fe86741a 100644 --- a/recipes/symengine/config.yml +++ b/recipes/symengine/config.yml @@ -5,3 +5,7 @@ versions: folder: all "0.10.1": folder: all + "0.11.1": + folder: all + "0.11.2": + folder: all diff --git a/recipes/systemc-cci/all/CMakeLists.txt b/recipes/systemc-cci/all/CMakeLists.txt index 747ee2684985a1..5b34c9bd3214a1 100644 --- a/recipes/systemc-cci/all/CMakeLists.txt +++ b/recipes/systemc-cci/all/CMakeLists.txt @@ -3,13 +3,10 @@ project(cci LANGUAGES CXX) set(LIBRARY_NAME cciapi) -include(${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - find_package(RapidJSON REQUIRED CONFIG) find_package(SystemCLanguage REQUIRED CONFIG) -set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/src") +set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/src") set(CCI_CFG_DIR "${SOURCE_DIR}/cci_cfg") set(CCI_CORE_DIR "${SOURCE_DIR}/cci_core") set(CCI_UTILS_DIR "${SOURCE_DIR}/cci_utils") @@ -31,10 +28,11 @@ set(SOURCES add_library(${LIBRARY_NAME} ${SOURCES}) target_include_directories(${LIBRARY_NAME} PRIVATE ${SOURCE_DIR}) -target_link_libraries(${LIBRARY_NAME} PRIVATE RapidJSON::RapidJSON SystemC::SystemC) +target_link_libraries(${LIBRARY_NAME} PRIVATE rapidjson SystemC::systemc) set_target_properties(${LIBRARY_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE - VERSION ${CONAN_PACKAGE_VERSION}) + VERSION ${CONAN_PACKAGE_VERSION} + COMPILE_FEATURES cxx_std_11) target_compile_definitions(${LIBRARY_NAME} PRIVATE SC_INCLUDE_FX) install(TARGETS ${LIBRARY_NAME} diff --git a/recipes/systemc-cci/all/conandata.yml b/recipes/systemc-cci/all/conandata.yml index 6c1e792ccafa23..1c26e7784920a0 100644 --- a/recipes/systemc-cci/all/conandata.yml +++ b/recipes/systemc-cci/all/conandata.yml @@ -5,8 +5,5 @@ sources: patches: "1.0.0": - patch_file: "patches/broker.patch" - base_path: "source_subfolder" - patch_file: "patches/cci_param_untyped_handle.patch" - base_path: "source_subfolder" - patch_file: "patches/cci_value_converter.patch" - base_path: "source_subfolder" diff --git a/recipes/systemc-cci/all/conanfile.py b/recipes/systemc-cci/all/conanfile.py index 57a3f498adec20..326fef01a251e1 100644 --- a/recipes/systemc-cci/all/conanfile.py +++ b/recipes/systemc-cci/all/conanfile.py @@ -1,42 +1,36 @@ -from conans import tools, CMake +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration -import functools - +from conan.tools.apple import is_apple_os +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 SystemccciConan(ConanFile): name = "systemc-cci" - description = """SystemC Configuration, Control and Inspection library""" - homepage = "https://www.accellera.org/" - url = "https://github.com/conan-io/conan-center-index" + description = "SystemC Configuration, Control and Inspection library" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.accellera.org/" topics = ("simulation", "modeling", "esl", "cci") - settings = "os", "compiler", "build_type", "arch" + + 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 + "fPIC": True, } - generators = "cmake", "cmake_find_package_multi" - - @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"]) + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -44,36 +38,43 @@ 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("systemc/2.3.3") - self.requires("rapidjson/1.1.0") + self.requires("systemc/2.3.4", transitive_headers=True, transitive_libs=True) + self.requires("rapidjson/cci.20220822") def validate(self): - if self.settings.os == "Macos": - raise ConanInvalidConfiguration(f"{self.name} is not suppported on {self.settings.os}.") + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.name} is not supported on {self.settings.os}.") 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.configure(build_folder=self._build_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CONAN_PACKAGE_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) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("NOTICE", 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, "NOTICE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/systemc-cci/all/test_package/CMakeLists.txt b/recipes/systemc-cci/all/test_package/CMakeLists.txt index 062e855b870301..f489f5c553c0f8 100644 --- a/recipes/systemc-cci/all/test_package/CMakeLists.txt +++ b/recipes/systemc-cci/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(systemc-cci REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) diff --git a/recipes/systemc-cci/all/test_package/conanfile.py b/recipes/systemc-cci/all/test_package/conanfile.py index 189bd25a7c2082..ef5d7042163ecc 100644 --- a/recipes/systemc-cci/all/test_package/conanfile.py +++ b/recipes/systemc-cci/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 SystemccciTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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/systemc-cci/all/test_v1_package/CMakeLists.txt b/recipes/systemc-cci/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/systemc-cci/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/systemc-cci/all/test_v1_package/conanfile.py b/recipes/systemc-cci/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..189bd25a7c2082 --- /dev/null +++ b/recipes/systemc-cci/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class SystemccciTestConan(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/systemc/all/CMakeLists.txt b/recipes/systemc/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb93..00000000000000 --- a/recipes/systemc/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/systemc/all/conandata.yml b/recipes/systemc/all/conandata.yml index db213ca0aa8346..234032a9f92d2d 100644 --- a/recipes/systemc/all/conandata.yml +++ b/recipes/systemc/all/conandata.yml @@ -8,15 +8,9 @@ sources: patches: "2.3.3": - patch_file: "patches/0001-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-sc_string_view.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-mingw.patch" - base_path: "source_subfolder" "2.3.4": - patch_file: "patches/0002-sc_string_view.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-mingw.patch" - base_path: "source_subfolder" - patch_file: "patches/0004-cmake.patch" - base_path: "source_subfolder" diff --git a/recipes/systemc/all/conanfile.py b/recipes/systemc/all/conanfile.py index e65862f8bd94bc..60fb8e631adf24 100644 --- a/recipes/systemc/all/conanfile.py +++ b/recipes/systemc/all/conanfile.py @@ -1,20 +1,25 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile, conan_version +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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class SystemcConan(ConanFile): name = "systemc" - description = """SystemC is a set of C++ classes and macros which provide - an event-driven simulation interface.""" - homepage = "https://www.accellera.org/" - url = "https://github.com/conan-io/conan-center-index" + description = ("SystemC is a set of C++ classes and macros which provide " + "an event-driven simulation interface.") license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.accellera.org/" topics = ("simulation", "modeling", "esl", "tlm") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -33,7 +38,7 @@ class SystemcConan(ConanFile): "fPIC": True, "disable_async_updates": False, "disable_copyright_msg": False, - "disable_virtual_bind": False, + "disable_virtual_bind": False, "enable_assertions": True, "enable_immediate_self_notifications": False, "enable_pthreads": False, @@ -41,85 +46,81 @@ class SystemcConan(ConanFile): "enable_phase_callbacks_tracing": False, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_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": del self.options.fPIC - del self.options.enable_pthreads + self.options.rm_safe("enable_pthreads") 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.os == "Macos": + if is_apple_os(self): raise ConanInvalidConfiguration("Macos build not supported") if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Building SystemC as a shared library on Windows is currently not supported") + raise ConanInvalidConfiguration( + "Building SystemC as a shared library on Windows is currently not supported" + ) + + if ( + conan_version.major == 1 + and self.settings.compiler == "gcc" + and Version(self.settings.compiler.version) <= "5" + ): + raise ConanInvalidConfiguration( + f"GCC {self.settings.compiler.version} is not supported by SystemC on Conan v1" + ) 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["DISABLE_ASYNC_UPDATES"] = self.options.disable_async_updates + tc.variables["DISABLE_COPYRIGHT_MESSAGE"] = self.options.disable_copyright_msg + tc.variables["DISABLE_VIRTUAL_BIND"] = self.options.disable_virtual_bind + tc.variables["ENABLE_ASSERTIONS"] = self.options.enable_assertions + tc.variables["ENABLE_IMMEDIATE_SELF_NOTIFICATIONS"] = self.options.enable_immediate_self_notifications + tc.variables["ENABLE_PTHREADS"] = self.options.get_safe("enable_pthreads", False) + tc.variables["ENABLE_PHASE_CALLBACKS"] = self.options.get_safe("enable_phase_callbacks", False) + tc.variables["ENABLE_PHASE_CALLBACKS_TRACING"] = self.options.get_safe("enable_phase_callbacks_tracing", False) + tc.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): + apply_conandata_patches(self) cmake = CMake(self) - cmake.definitions["DISABLE_ASYNC_UPDATES"] = \ - self.options.disable_async_updates - cmake.definitions["DISABLE_COPYRIGHT_MESSAGE"] = \ - self.options.disable_copyright_msg - cmake.definitions["DISABLE_VIRTUAL_BIND"] = \ - self.options.disable_virtual_bind - cmake.definitions["ENABLE_ASSERTIONS"] = \ - self.options.enable_assertions - cmake.definitions["ENABLE_IMMEDIATE_SELF_NOTIFICATIONS"] = \ - self.options.enable_immediate_self_notifications - cmake.definitions["ENABLE_PTHREADS"] = \ - self.options.get_safe("enable_pthreads", False) - cmake.definitions["ENABLE_PHASE_CALLBACKS"] = \ - self.options.get_safe("enable_phase_callbacks", False) - cmake.definitions["ENABLE_PHASE_CALLBACKS_TRACING"] = \ - self.options.get_safe("enable_phase_callbacks_tracing", False) cmake.configure() - return cmake - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("NOTICE", 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, "NOTICE", + 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, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "SystemCLanguage") self.cpp_info.set_property("cmake_target_name", "SystemC::systemc") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed self.cpp_info.components["_systemc"].libs = ["systemc"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["_systemc"].system_libs = ["pthread"] - if self._is_msvc: + self.cpp_info.components["_systemc"].system_libs = ["pthread", "m"] + if is_msvc(self): self.cpp_info.components["_systemc"].cxxflags.append("/vmg") # TODO: to remove in conan v2 once cmake_find_package* generators removed diff --git a/recipes/systemc/all/patches/0001-cmake.patch b/recipes/systemc/all/patches/0001-cmake.patch index 46f27b30da9245..3598e00cb51a59 100644 --- a/recipes/systemc/all/patches/0001-cmake.patch +++ b/recipes/systemc/all/patches/0001-cmake.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -273,12 +273,12 @@ +@@ -273,12 +273,6 @@ FORCE) endif (NOT CMAKE_BUILD_TYPE) @@ -10,12 +10,6 @@ - "The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.") -mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED) - -+#set (CMAKE_CXX_STANDARD 98 CACHE STRING -+# "C++ standard to build all targets. Supported values are 98, 11, and 14.") -+#set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL -+# "The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.") -+#mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED) -+# if (NOT (WIN32 OR CYGWIN)) option (BUILD_SHARED_LIBS "Build shared libraries." ON) else (NOT (WIN32 OR CYGWIN)) diff --git a/recipes/systemc/all/patches/0004-cmake.patch b/recipes/systemc/all/patches/0004-cmake.patch index 83eead38732bc8..5c4004ed81fc29 100644 --- a/recipes/systemc/all/patches/0004-cmake.patch +++ b/recipes/systemc/all/patches/0004-cmake.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -277,12 +277,12 @@ +@@ -277,12 +277,6 @@ FORCE) endif (NOT CMAKE_BUILD_TYPE) @@ -10,12 +10,6 @@ - "The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.") -mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED) - -+#set (CMAKE_CXX_STANDARD 98 CACHE STRING -+# "C++ standard to build all targets. Supported values are 98, 11, 14, and 17.") -+#set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL -+# "The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.") -+#mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED) -+# if (NOT (WIN32 OR CYGWIN)) option (BUILD_SHARED_LIBS "Build shared libraries." ON) else (NOT (WIN32 OR CYGWIN)) diff --git a/recipes/systemc/all/test_package/CMakeLists.txt b/recipes/systemc/all/test_package/CMakeLists.txt index 5d31301bc9ee25..86a595ce48e9a2 100644 --- a/recipes/systemc/all/test_package/CMakeLists.txt +++ b/recipes/systemc/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(SystemCLanguage REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/systemc/all/test_package/conanfile.py b/recipes/systemc/all/test_package/conanfile.py index 49a3a66ea5bad4..ef5d7042163ecc 100644 --- a/recipes/systemc/all/test_package/conanfile.py +++ b/recipes/systemc/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,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/systemc/all/test_v1_package/CMakeLists.txt b/recipes/systemc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/systemc/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/systemc/all/test_v1_package/conanfile.py b/recipes/systemc/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/systemc/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/taglib/all/conanfile.py b/recipes/taglib/all/conanfile.py index 23a0beef8e8854..816397a133c86f 100644 --- a/recipes/taglib/all/conanfile.py +++ b/recipes/taglib/all/conanfile.py @@ -44,7 +44,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/taocpp-json/all/conandata.yml b/recipes/taocpp-json/all/conandata.yml index 732888cb32c08d..08a817ecfe94bf 100644 --- a/recipes/taocpp-json/all/conandata.yml +++ b/recipes/taocpp-json/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.0-beta.14": + sha256: f9e44a1d6a70a6d39b9e45df76eac928e69f5318e5a957fd5c0efdf45dacaf5e + url: https://github.com/taocpp/json/archive/1.0.0-beta.14.tar.gz "1.0.0-beta.13": sha256: 2513b32d1883277f78071ff1cc55d4f35a979fffdaddf6412d3cb67852ce68b5 url: https://github.com/taocpp/json/archive/1.0.0-beta.13.tar.gz diff --git a/recipes/taocpp-json/config.yml b/recipes/taocpp-json/config.yml index 1c4b5480a0dce2..fb0ab49d5fd2c4 100644 --- a/recipes/taocpp-json/config.yml +++ b/recipes/taocpp-json/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.0-beta.14": + folder: all "1.0.0-beta.13": folder: all "1.0.0-beta.12": diff --git a/recipes/taocpp-taopq/all/conanfile.py b/recipes/taocpp-taopq/all/conanfile.py index 4cf5de4b292312..7ea861e1070eaf 100644 --- a/recipes/taocpp-taopq/all/conanfile.py +++ b/recipes/taocpp-taopq/all/conanfile.py @@ -16,7 +16,7 @@ class TaoCPPTaopqConan(ConanFile): homepage = "https://github.com/taocpp/taopq" description = "C++ client library for PostgreSQL" topics = ("cpp17", "postgresql", "libpq", "data-base", "sql") - + package_type = "library" settings = "os", "arch", "build_type", "compiler" options = { "shared": [True, False], @@ -53,7 +53,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libpq/14.5") + # libpq-fe.h is included by many public headers of taocpp-taopq, and also uses some symbols of the lib (see https://github.com/conan-io/conan-center-index/pull/19825#issuecomment-1720996359) + self.requires("libpq/15.4", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/tar/all/conanfile.py b/recipes/tar/all/conanfile.py index afe93c20c680fb..96d4365b7ea609 100644 --- a/recipes/tar/all/conanfile.py +++ b/recipes/tar/all/conanfile.py @@ -1,98 +1,112 @@ -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.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir +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 TarConan(ConanFile): name = "tar" description = "GNU Tar provides the ability to create tar archives, as well as various other kinds of manipulation." - topics = ("tar", "archive") license = "GPL-3-or-later" - homepage = "https://www.gnu.org/software/tar/" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "arch", "compiler", "build_type" - - _autotools = None + homepage = "https://www.gnu.org/software/tar/" + topics = "archive" - @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 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 requirements(self): - self.requires("bzip2/1.0.8") - self.requires("lzip/1.21") - self.requires("xz_utils/5.2.5") + self.requires("bzip2/1.0.8", run=True, headers=False, libs=False) + self.requires("lzip/1.23", run=True, headers=False, libs=False) + self.requires("xz_utils/5.4.4", run=True, headers=False, libs=False) + self.requires("zstd/1.5.5", run=True, headers=False, libs=False) + # self.requires("lzo/2.10", run=True, headers=False, libs=False) def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration("This recipe does not support Windows builds of tar") # FIXME: fails on MSVC and mingw-w64 - if not self.options["bzip2"].build_executable: + if not self.dependencies["bzip2"].options.build_executable: raise ConanInvalidConfiguration("bzip2:build_executable must be enabled") - 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 _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - self._autotools.libs = [] - bzip2_exe = "bzip2" # FIXME: get from bzip2 recipe - lzip_exe = "lzip" # FIXME: get from lzip recipe - lzma_exe = "lzma" # FIXME: get from xz_utils recipe - xz_exe = "xz" # FIXME: get from xz_utils recipe - args = [ + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.generate() + tc.configure_args += [ "--disable-acl", "--disable-nls", "--disable-rpath", - # "--without-gzip", # FIXME: this will use system gzip "--without-posix-acls", "--without-selinux", - "--with-bzip2={}".format(bzip2_exe), - "--with-lzip={}".format(lzip_exe), - "--with-lzma={}".format(lzma_exe), - # "--without-lzop", # FIXME: this will use sytem lzop - "--with-xz={}".format(xz_exe), - # "--without-zstd", # FIXME: this will use system zstd (current zstd recipe does not build programs) + "--with-gzip=gzip", # FIXME: this will use system gzip + "--with-bzip2=bzip2", + "--with-lzip=lzip", + "--with-lzma=lzma", + "--without-lzop", # FIXME: lzo package does not build an executable + "--with-xz=xz", + "--with-zstd=zstd", ] - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if is_msvc(self): + replace_in_file( + self, + os.path.join(self.source_folder, "gnu", "faccessat.c"), + "_GL_INCLUDING_UNISTD_H", + "_GL_INCLUDING_UNISTD_H_NOP", + ) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if self.settings.compiler == "Visual Studio": - tools.replace_in_file(os.path.join(self._source_subfolder, "gnu", "faccessat.c"), - "_GL_INCLUDING_UNISTD_H", "_GL_INCLUDING_UNISTD_H_NOP") - autotools = self._configure_autotools() + self._patch_sources() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() - - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "libexec")) def package_info(self): - 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) + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] tar_bin = os.path.join(self.package_folder, "bin", "tar") - self.user_info.tar = tar_bin + self.conf_info.define("user.tar:path", tar_bin) self.env_info.TAR = tar_bin + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) + self.user_info.tar = tar_bin diff --git a/recipes/tar/all/test_package/conanfile.py b/recipes/tar/all/test_package/conanfile.py index 68b1151321a116..5e1618addc3d04 100644 --- a/recipes/tar/all/test_package/conanfile.py +++ b/recipes/tar/all/test_package/conanfile.py @@ -1,17 +1,40 @@ -from conans import ConanFile, tools import os +from conan import ConanFile +from conan.tools.cmake import cmake_layout +from conan.tools.files import chdir, load, save + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def generate(self): + tar_bin = self.dependencies.build["tar"].conf_info.get("user.tar:path") + save(self, os.path.join(self.build_folder, "tar_bin"), tar_bin) def test(self): - tar_bin = self.deps_user_info["tar"].tar - if not tools.cross_building(self): - with tools.chdir(self.source_folder): - test_tar = os.path.join(self.build_folder, "test.tar.gz") - self.run("{} -czf {} conanfile.py".format(tar_bin, test_tar), run_environment=True) - assert os.path.isfile("test.tar.gz") - self.run("{} -tf test.tar.gz".format(tar_bin), run_environment=True) - self.run("{} -xf test.tar.gz".format(tar_bin), run_environment=True) - assert tools.load(os.path.join(self.source_folder, "conanfile.py")) == tools.load(os.path.join(self.build_folder, "conanfile.py")) + # Verify that the compression tools are available + self.run("gzip --version") + self.run("bzip2 --help") + self.run("lzip --version") + self.run("lzma --version") + self.run("zstd --version") + + tar_bin = load(self, os.path.join(self.build_folder, "tar_bin")) + with chdir(self, self.source_folder): + test_tar = os.path.join(self.build_folder, "test.tar.zstd") + self.run(f"{tar_bin} --zstd -cf {test_tar} conanfile.py") + assert os.path.isfile("test.tar.zstd") + self.run(f"{tar_bin} -tf test.tar.zstd") + self.run(f"{tar_bin} -xf test.tar.zstd") + f1 = load(self, os.path.join(self.source_folder, "conanfile.py")) + f2 = load(self, os.path.join(self.build_folder, "conanfile.py")) + assert f1 == f2 diff --git a/recipes/tar/all/test_v1_package/conanfile.py b/recipes/tar/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..68b1151321a116 --- /dev/null +++ b/recipes/tar/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def test(self): + tar_bin = self.deps_user_info["tar"].tar + if not tools.cross_building(self): + with tools.chdir(self.source_folder): + test_tar = os.path.join(self.build_folder, "test.tar.gz") + self.run("{} -czf {} conanfile.py".format(tar_bin, test_tar), run_environment=True) + assert os.path.isfile("test.tar.gz") + self.run("{} -tf test.tar.gz".format(tar_bin), run_environment=True) + self.run("{} -xf test.tar.gz".format(tar_bin), run_environment=True) + assert tools.load(os.path.join(self.source_folder, "conanfile.py")) == tools.load(os.path.join(self.build_folder, "conanfile.py")) diff --git a/recipes/tcl/all/conandata.yml b/recipes/tcl/all/conandata.yml index ddecf77805a4ca..027d30d480cf09 100644 --- a/recipes/tcl/all/conandata.yml +++ b/recipes/tcl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "8.6.13": + url: "https://downloads.sourceforge.net/project/tcl/Tcl/8.6.13/tcl8.6.13-src.tar.gz" + sha256: "43a1fae7412f61ff11de2cfd05d28cfc3a73762f354a417c62370a54e2caf066" "8.6.11": url: "https://downloads.sourceforge.net/project/tcl/Tcl/8.6.11/tcl8.6.11-src.tar.gz" sha256: "8c0486668586672c5693d7d95817cb05a18c5ecca2f40e2836b9578064088258" @@ -6,6 +9,8 @@ sources: url: "https://downloads.sourceforge.net/project/tcl/Tcl/8.6.10/tcl8.6.10-src.tar.gz" sha256: "5196dbf6638e3df8d5c87b5815c8c2b758496eb6f0e41446596c9a4e638d87ed" patches: + "8.6.13": + - patch_file: "patches/0001-8.6.11-no-read-only-data.patch" "8.6.11": - patch_file: "patches/0001-8.6.11-no-read-only-data.patch" "8.6.10": diff --git a/recipes/tcl/all/conanfile.py b/recipes/tcl/all/conanfile.py index c81bc94de1c844..1722816dbfb147 100644 --- a/recipes/tcl/all/conanfile.py +++ b/recipes/tcl/all/conanfile.py @@ -1,12 +1,15 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name, 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, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir -from conan.tools.gnu import Autotools, AutotoolsToolchain -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag, NMakeToolchain +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag, NMakeToolchain, NMakeDeps +from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=1.55.0" class TclConan(ConanFile): @@ -15,7 +18,7 @@ class TclConan(ConanFile): license = "TCL" url = "https://github.com/conan-io/conan-center-index" homepage = "https://tcl.tk" - topics = ("tcl", "scripting", "programming") + topics = ("scripting", "programming") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -50,7 +53,7 @@ def layout(self): self.folders.generators = "conan" def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.settings.os not in ("FreeBSD", "Linux", "Macos", "Windows"): @@ -69,7 +72,16 @@ def generate(self): if is_msvc(self): tc = NMakeToolchain(self) tc.generate() + + deps = NMakeDeps(self) + deps.generate() else: + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self, prefix=self.package_folder) def yes_no(v): return "yes" if v else "no" tc.configure_args.extend([ @@ -79,6 +91,9 @@ def yes_no(v): return "yes" if v else "no" ]) tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + def _get_default_build_system_subdir(self): return { "Macos": "macosx", @@ -198,54 +213,46 @@ def package(self): "\nTCL_SRC_DIR", "\n#TCL_SRC_DIR") - #fix_apple_shared_install_name(self) + fix_apple_shared_install_name(self) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "TCL") + libs = [] - systemlibs = [] libdirs = [] for root, _, _ in os.walk(os.path.join(self.package_folder, "lib"), topdown=False): newlibs = collect_libs(self, root) if newlibs: libs.extend(newlibs) libdirs.append(root) + self.cpp_info.libs = libs + self.cpp_info.libdirs = libdirs + if self.settings.os == "Windows": - systemlibs.extend(["ws2_32", "netapi32", "userenv"]) + self.cpp_info.system_libs.extend(["ws2_32", "netapi32", "userenv"]) elif self.settings.os in ("FreeBSD", "Linux"): - systemlibs.extend(["dl", "m", "pthread"]) - - defines = [] - if not self.options.shared: - defines.append("STATIC_BUILD") - self.cpp_info.defines = defines - - self.cpp_info.libdirs = libdirs - self.cpp_info.libs = libs - self.cpp_info.system_libs = systemlibs - self.cpp_info.set_property("cmake_file_name", "TCL") - self.cpp_info.names["cmake_find_package"] = "TCL" - self.cpp_info.names["cmake_find_package_multi"] = "TCL" + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) + elif is_apple_os(self): + self.cpp_info.frameworks.append("CoreFoundation") - if self.settings.os == "Macos": - self.cpp_info.frameworks = ["CoreFoundation"] - self.cpp_info.sharedlinkflags = self.cpp_info.exelinkflags + if is_msvc(self) and not self.options.shared: + self.cpp_info.defines.append("STATIC_BUILD") - tcl_library = os.path.join(self.package_folder, "lib", "{}{}".format(self.name, ".".join(self.version.split(".")[:2]))) - self.output.info("Setting TCL_LIBRARY environment variable to {}".format(tcl_library)) - self.runenv_info.define_path('TCL_LIBRARY', tcl_library) - self.env_info.TCL_LIBRARY = tcl_library + tcl_version = Version(self.version) + tcl_library = os.path.join(self.package_folder, "lib", f"tcl{tcl_version.major}.{tcl_version.minor}") + self.runenv_info.define_path("TCL_LIBRARY", tcl_library) tcl_root = self.package_folder - self.output.info("Setting TCL_ROOT environment variable to {}".format(tcl_root)) - self.runenv_info.define_path('TCL_ROOT', tcl_root) - self.env_info.TCL_ROOT = tcl_root + self.runenv_info.define_path("TCL_ROOT", tcl_root) tclsh_list = list(filter(lambda fn: fn.startswith("tclsh"), os.listdir(os.path.join(self.package_folder, "bin")))) tclsh = os.path.join(self.package_folder, "bin", tclsh_list[0]) - self.output.info("Setting TCLSH environment variable to {}".format(tclsh)) - self.runenv_info.define_path('TCLSH', tclsh) - self.env_info.TCLSH = tclsh + self.runenv_info.define_path("TCLSH", tclsh) - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Adding PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "TCL" + self.cpp_info.names["cmake_find_package_multi"] = "TCL" + self.env_info.TCL_LIBRARY = tcl_library + self.env_info.TCL_ROOT = tcl_root + self.env_info.TCLSH = tclsh + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/tcl/config.yml b/recipes/tcl/config.yml index 9e60b9c9066766..108b4ab57b9c6b 100644 --- a/recipes/tcl/config.yml +++ b/recipes/tcl/config.yml @@ -1,4 +1,6 @@ versions: + "8.6.13": + folder: "all" "8.6.11": folder: "all" "8.6.10": diff --git a/recipes/tcp-wrappers/all/conandata.yml b/recipes/tcp-wrappers/all/conandata.yml index 59e770ecf55f2c..9aa6d859497fa2 100644 --- a/recipes/tcp-wrappers/all/conandata.yml +++ b/recipes/tcp-wrappers/all/conandata.yml @@ -5,8 +5,5 @@ sources: patches: "7.6": - patch_file: "patches/0001-shared-clang.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-fix-warnings-by-include-headers.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-add-severity-level-to-library.patch" - base_path: "source_subfolder" diff --git a/recipes/tcp-wrappers/all/conanfile.py b/recipes/tcp-wrappers/all/conanfile.py index 505aeec0d08d68..3089488940a7db 100644 --- a/recipes/tcp-wrappers/all/conanfile.py +++ b/recipes/tcp-wrappers/all/conanfile.py @@ -1,16 +1,26 @@ import os -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.build import cross_building +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get +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 TcpWrappersConan(ConanFile): name = "tcp-wrappers" - homepage = "ftp://ftp.porcupine.org/pub/security/index.html" description = "A security tool which acts as a wrapper for TCP daemons" - topics = ("conan", "tcp", "ip", "daemon", "wrapper") + license = "TCP-wrappers" url = "https://github.com/conan-io/conan-center-index" - license = "BSD" - exports_sources = "patches/**" + homepage = "http://ftp.porcupine.org/pub/security/" + topics = ("tcp", "ip", "daemon", "wrapper") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -20,76 +30,91 @@ class TcpWrappersConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake" @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) - @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": del self.options.fPIC def configure(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("Visual Studio is not supported") 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 source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("tcp_wrappers_{}-ipv6.4".format(self.version), self._source_subfolder) + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("Visual Studio is not supported") + if cross_building(self): + raise ConanInvalidConfiguration("Cross-building is not current supported.") - def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:subsystem", check_type=str): + self.tool_requires("msys2/cci.latest") - def build(self): - self._patch_sources() - with tools.chdir(self._source_subfolder): - autotools = AutoToolsBuildEnvironment(self) - make_args = [ - "REAL_DAEMON_DIR={}".format(tools.unix_path(os.path.join(self.package_folder, "bin"))), - "-j1", - "SHEXT={}".format(self._shext), - ] - if self.options.shared: - make_args.append("shared=1") - env_vars = autotools.vars - if self.options.get_safe("fPIC", True): - env_vars["CFLAGS"] += " -fPIC" - env_vars["ENV_CFLAGS"] = env_vars["CFLAGS"] - # env_vars["SHEXT"] = self._shext - print(env_vars) - with tools.environment_append(env_vars): - autotools.make(target="linux", args=make_args) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) @property def _shext(self): - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): return ".dylib" return ".so" - def package(self): - self.copy(pattern="DISCLAIMER", src=self._source_subfolder, dst="licenses") + def generate(self): + tc = AutotoolsToolchain(self) + tc.make_args.append("REAL_DAEMON_DIR=/bin") + tc.make_args.append(f"SHEXT={self._shext}") + if self.options.shared: + tc.make_args.append("shared=1") + if self.options.get_safe("fPIC") or self.options.shared: + tc.make_args.append("ENV_CFLAGS=-fPIC") + tc.generate() + + def build(self): + apply_conandata_patches(self) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make(target="linux") + def package(self): + copy(self, "DISCLAIMER", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) for exe in ("safe_finger", "tcpd", "tcpdchk", "tcpdmatch", "try-from"): - self.copy(exe, src=self._source_subfolder, dst="bin", keep_path=False) - self.copy("tcpd.h", src=self._source_subfolder, dst="include", keep_path=False) + copy(self, exe, + src=self.source_folder, + dst=os.path.join(self.package_folder, "bin"), + keep_path=False) + copy(self, "tcpd.h", + src=self.source_folder, + dst=os.path.join(self.package_folder, "include"), + keep_path=False) if self.options.shared: - self.copy("libwrap{}".format(self._shext), src=self._source_subfolder, dst="lib", keep_path=False) + copy(self, f"libwrap{self._shext}", + src=self.source_folder, + dst=os.path.join(self.package_folder, "lib"), + keep_path=False) else: - self.copy("libwrap.a", src=self._source_subfolder, dst="lib", keep_path=False) + copy(self, "libwrap.a", + src=self.source_folder, + dst=os.path.join(self.package_folder, "lib"), + keep_path=False) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["wrap"] - 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 once conan v1 not supported anymore + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/tcp-wrappers/all/test_package/CMakeLists.txt b/recipes/tcp-wrappers/all/test_package/CMakeLists.txt index 6226de918d1daa..6bc29bd3fc5c56 100644 --- a/recipes/tcp-wrappers/all/test_package/CMakeLists.txt +++ b/recipes/tcp-wrappers/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 C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_package(tcp-wrappers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE tcp-wrappers::tcp-wrappers) diff --git a/recipes/tcp-wrappers/all/test_package/conanfile.py b/recipes/tcp-wrappers/all/test_package/conanfile.py index bd7165a553cf41..ef5d7042163ecc 100644 --- a/recipes/tcp-wrappers/all/test_package/conanfile.py +++ b/recipes/tcp-wrappers/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" + 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/tcp-wrappers/all/test_package/test_package.c b/recipes/tcp-wrappers/all/test_package/test_package.c index 99571f42118169..297a2849f1a11f 100644 --- a/recipes/tcp-wrappers/all/test_package/test_package.c +++ b/recipes/tcp-wrappers/all/test_package/test_package.c @@ -6,6 +6,6 @@ int main (int argc, char *argv[]) { struct request_info req; request_init(&req, RQ_DAEMON, argv[0], RQ_FILE, 0, 0); - printf("host_acces: %d\n", hosts_access(&req)); + printf("host_access: %d\n", hosts_access(&req)); return 0; } diff --git a/recipes/tcp-wrappers/all/test_v1_package/CMakeLists.txt b/recipes/tcp-wrappers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/tcp-wrappers/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/tcp-wrappers/all/test_v1_package/conanfile.py b/recipes/tcp-wrappers/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7e2dfe859bb27b --- /dev/null +++ b/recipes/tcp-wrappers/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=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/tcsbank-uri-template/all/CMakeLists.txt b/recipes/tcsbank-uri-template/all/CMakeLists.txt deleted file mode 100644 index 8bdaa1e47bfa00..00000000000000 --- a/recipes/tcsbank-uri-template/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/tcsbank-uri-template/all/conandata.yml b/recipes/tcsbank-uri-template/all/conandata.yml index f958e285c4af29..b24ca0f0a2b0fd 100644 --- a/recipes/tcsbank-uri-template/all/conandata.yml +++ b/recipes/tcsbank-uri-template/all/conandata.yml @@ -1,7 +1,4 @@ sources: - "1.1.3": - url: "https://github.com/TinkoffCreditSystems/uri-template/archive/refs/tags/v1.1.3.tar.gz" - sha256: "4eaf984eb7857a56b09e9ad911a77042573d1540a19b9e945369ec6384f54131" "1.1.4": url: "https://github.com/TinkoffCreditSystems/uri-template/archive/refs/tags/v1.1.4.tar.gz" sha256: "5f6e562813f1cf9ce40137db88ea4db54dc4bd77a6e5f813b106d494bbfb72b3" diff --git a/recipes/tcsbank-uri-template/all/conanfile.py b/recipes/tcsbank-uri-template/all/conanfile.py index 03a96370cbb024..aed3fb5a97334c 100644 --- a/recipes/tcsbank-uri-template/all/conanfile.py +++ b/recipes/tcsbank-uri-template/all/conanfile.py @@ -1,20 +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.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class TCSBankUriTemplateConan(ConanFile): name = "tcsbank-uri-template" description = "URI Templates expansion and reverse-matching for C++" - topics = ("conan", "uri-template", "url-template", "rfc-6570") + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/TinkoffCreditSystems/uri-template" - license = "Apache-2.0" + topics = ("uri-template", "url-template", "rfc-6570") - generators = "cmake", "cmake_find_package_multi" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,28 +28,9 @@ class TCSBankUriTemplateConan(ConanFile): "shared": False, "fPIC": True, } - exports_sources = [ - "CMakeLists.txt", - "patches/*", - ] - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["URITEMPLATE_BUILD_TESTING"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -53,55 +38,70 @@ 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): compiler_name = str(self.settings.compiler) - compiler_version = tools.Version(self.settings.compiler.version) + compiler_version = Version(self.settings.compiler.version) # Exclude compiler.cppstd < 17 min_req_cppstd = "17" 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_name)) + check_min_cppstd(self, min_req_cppstd) - # Exclude not supported compilers + # Exclude unsupported compilers compilers_required = { "Visual Studio": "16", + "msvc": "192", "gcc": "7.3", "clang": "6.0", "apple-clang": "10.0", } - if compiler_name not in compilers_required or compiler_version < compilers_required[compiler_name]: + if compiler_name in compilers_required and compiler_version < compilers_required[compiler_name]: raise ConanInvalidConfiguration( - "%s requires a compiler that supports at least C++%s. %s %s is not supported." % - (self.name, min_req_cppstd, compiler_name, compiler_version)) + f"{self.name} requires a compiler that supports at least C++{min_req_cppstd}. " + f"{compiler_name} {compiler_version} is not supported." + ) # Check stdlib ABI compatibility if compiler_name == "gcc" and self.settings.compiler.libcxx != "libstdc++11": - raise ConanInvalidConfiguration('Using %s with GCC requires "compiler.libcxx=libstdc++11"' % self.name) + raise ConanInvalidConfiguration( + f'Using {self.name} with GCC requires "compiler.libcxx=libstdc++11"' + ) elif compiler_name == "clang" and self.settings.compiler.libcxx not in ["libstdc++11", "libc++"]: - raise ConanInvalidConfiguration('Using %s with Clang requires either "compiler.libcxx=libstdc++11"' - ' or "compiler.libcxx=libc++"' % self.name) + raise ConanInvalidConfiguration( + f'Using {self.name} with Clang requires either "compiler.libcxx=libstdc++11" or "compiler.libcxx=libc++"' + ) 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["URITEMPLATE_BUILD_TESTING"] = False + 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")) - 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.names["pkg_config"] = "uri-template" + self.cpp_info.set_property("cmake_file_name", "uri-template") + self.cpp_info.set_property("cmake_target_name", "uri-template::uri-template") + self.cpp_info.set_property("pkg_config_name", "uri-template") + self.cpp_info.libs = collect_libs(self) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "uri-template" self.cpp_info.names["cmake_find_package_multi"] = "uri-template" - self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/tcsbank-uri-template/all/test_package/CMakeLists.txt b/recipes/tcsbank-uri-template/all/test_package/CMakeLists.txt index cb4d85b99bbcf4..bf76cb9ad58674 100644 --- a/recipes/tcsbank-uri-template/all/test_package/CMakeLists.txt +++ b/recipes/tcsbank-uri-template/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(uri-template REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/tcsbank-uri-template/all/test_package/conanfile.py b/recipes/tcsbank-uri-template/all/test_package/conanfile.py index 49a3a66ea5bad4..ef5d7042163ecc 100644 --- a/recipes/tcsbank-uri-template/all/test_package/conanfile.py +++ b/recipes/tcsbank-uri-template/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,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/tcsbank-uri-template/all/test_package/test_package.cpp b/recipes/tcsbank-uri-template/all/test_package/test_package.cpp index b8f028352cf822..91928632cfcba5 100644 --- a/recipes/tcsbank-uri-template/all/test_package/test_package.cpp +++ b/recipes/tcsbank-uri-template/all/test_package/test_package.cpp @@ -1,6 +1,7 @@ -#include #include +#include + int main() { const std::string uri = "http://example.com/search?q=cat&lang=en"; // Parse the template diff --git a/recipes/tcsbank-uri-template/all/test_v1_package/CMakeLists.txt b/recipes/tcsbank-uri-template/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/tcsbank-uri-template/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-uri-template/all/test_v1_package/conanfile.py b/recipes/tcsbank-uri-template/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/tcsbank-uri-template/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/tcsbank-uri-template/config.yml b/recipes/tcsbank-uri-template/config.yml index c744acd213406c..db1dc037a6a68e 100644 --- a/recipes/tcsbank-uri-template/config.yml +++ b/recipes/tcsbank-uri-template/config.yml @@ -1,6 +1,4 @@ versions: - "1.1.3": - folder: all "1.1.4": folder: all "1.2.1": diff --git a/recipes/teemo/all/conandata.yml b/recipes/teemo/all/conandata.yml index 490c174ebfda5d..0b1e02d58ccdc7 100644 --- a/recipes/teemo/all/conandata.yml +++ b/recipes/teemo/all/conandata.yml @@ -1,7 +1,7 @@ sources: "2.7": url: "https://github.com/winsoft666/teemo/archive/refs/tags/v2.7.tar.gz" - sha256: "97be8ae62cd3e2e92ed0ff405dfaf5e6cb6e323b21c53e798adfa5872a2f7084" + sha256: "0cf4f90d22b1c19845db08ff1addc5872327b33f020e8d5409f3819391afaf79" patches: "2.7": diff --git a/recipes/teemo/all/conanfile.py b/recipes/teemo/all/conanfile.py index c34c6cc5a10604..1935bbe91290dd 100644 --- a/recipes/teemo/all/conanfile.py +++ b/recipes/teemo/all/conanfile.py @@ -27,6 +27,7 @@ class TeemoConan(ConanFile): "shared": False, "fPIC": True, } + deprecated = "zoe" @property def _min_cppstd(self): @@ -47,13 +48,14 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libcurl/7.86.0") + self.requires("libcurl/[>=7.78.0 <9]") + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) def validate(self): if self.info.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) if self.info.settings.compiler == "apple-clang" and Version(self.info.settings.compiler.version) < "12.0": - raise ConanInvalidConfiguration(f"{self.ref} can not build on apple-clang < 12.0.") + raise ConanInvalidConfiguration(f"{self.ref} can not build on apple-clang < 12.0.") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -96,6 +98,6 @@ def package_info(self): self.cpp_info.defines.append("TEEMO_EXPORTS") else: self.cpp_info.defines.append("TEEMO_STATIC") - + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/tesseract/all/conanfile.py b/recipes/tesseract/all/conanfile.py index bbdcc2c253a146..06e523dc19f28c 100644 --- a/recipes/tesseract/all/conanfile.py +++ b/recipes/tesseract/all/conanfile.py @@ -82,12 +82,14 @@ def layout(self): def requirements(self): self.requires("leptonica/1.82.0") + if self.settings.os == "Windows" and Version(self.version) >= "5.0.0": + self.requires("libtiff/4.6.0") # libarchive is required for 4.x so default value is true if self.options.get_safe("with_libarchive", default=True): - self.requires("libarchive/3.6.2") + self.requires("libarchive/3.7.1") # libcurl is not required for 4.x if self.options.get_safe("with_libcurl", default=False): - self.requires("libcurl/8.0.1") + self.requires("libcurl/[>=7.78.0 <9]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -185,6 +187,8 @@ def package_info(self): # TODO: back to global scope once cmake_find_package* generators removed self.cpp_info.components["libtesseract"].libs = [self._libname] self.cpp_info.components["libtesseract"].requires = ["leptonica::leptonica"] + if self.settings.os == "Windows" and Version(self.version) >= "5.0.0": + self.cpp_info.components["libtesseract"].requires.append("libtiff::libtiff") if self.options.get_safe("with_libcurl", default=False): self.cpp_info.components["libtesseract"].requires.append("libcurl::libcurl") if self.options.get_safe("with_libarchive", default=True): 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/thelink2012-any/all/conandata.yml b/recipes/thelink2012-any/all/conandata.yml index 05fc280a1c1002..71bf293016c65c 100644 --- a/recipes/thelink2012-any/all/conandata.yml +++ b/recipes/thelink2012-any/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230118": + url: "https://github.com/thelink2012/any/archive/e88b1bfc160fa9b01e6174dd29c812eeeece3be9.tar.gz" + sha256: "4be9b7be551a61730c85c3e08f8513ad217874d0c3f966d8f9eb5e0892424f55" "cci.20200719": url: "https://github.com/thelink2012/any/archive/f67bd5f8bbf7eb628bf38206d4ac5cb22438e6bb.tar.gz" sha256: "1cd121a2fb27936213397ff4ff94fe4d6d4e28cabc13894cc4512eb046d71be8" diff --git a/recipes/thelink2012-any/config.yml b/recipes/thelink2012-any/config.yml index 1eac063d13841a..cdbc38379aaf4d 100644 --- a/recipes/thelink2012-any/config.yml +++ b/recipes/thelink2012-any/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20230118": + folder: all "cci.20200719": folder: all diff --git a/recipes/thrift/all/conanfile.py b/recipes/thrift/all/conanfile.py index 54cc1c65d6945b..3f576411eeb0da 100644 --- a/recipes/thrift/all/conanfile.py +++ b/recipes/thrift/all/conanfile.py @@ -71,7 +71,7 @@ def requirements(self): if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_libevent: self.requires("libevent/2.1.12") if self.options.with_qt5: 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/tidy-html5/all/CMakeLists.txt b/recipes/tidy-html5/all/CMakeLists.txt deleted file mode 100644 index e5cb637716b890..00000000000000 --- a/recipes/tidy-html5/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/tidy-html5/all/conandata.yml b/recipes/tidy-html5/all/conandata.yml index dbfb937f0f3c26..56deb76dc5c665 100644 --- a/recipes/tidy-html5/all/conandata.yml +++ b/recipes/tidy-html5/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "5.8.0": - patch_file: "patches/0001-robust-install-pdb.patch" - base_path: "source_subfolder" diff --git a/recipes/tidy-html5/all/conanfile.py b/recipes/tidy-html5/all/conanfile.py index c7d99c3c56b673..cc182cadf26f4d 100644 --- a/recipes/tidy-html5/all/conanfile.py +++ b/recipes/tidy-html5/all/conanfile.py @@ -1,17 +1,22 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.33.0" +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, rm, rmdir +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class TidyHtml5Conan(ConanFile): name = "tidy-html5" - license = "W3C" + description = "The granddaddy of HTML tools, with support for modern standards" + license = "HTMLTIDY" url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.html-tidy.org" - description = "The granddaddy of HTML tools, with support for modern standards" topics = ("html", "parser", "xml", "tools") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,17 +29,8 @@ class TidyHtml5Conan(ConanFile): "support_localizations": True, } - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @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": @@ -42,51 +38,57 @@ 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], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - cmake = CMake(self) - cmake.definitions['BUILD_TAB2SPACE'] = False - cmake.definitions['BUILD_SAMPLE_CODE'] = False - cmake.definitions['TIDY_COMPAT_HEADERS'] = False - cmake.definitions['SUPPORT_CONSOLE_APP'] = False - cmake.definitions['SUPPORT_LOCALIZATIONS'] = self.options.support_localizations - cmake.definitions['ENABLE_DEBUG_LOG'] = False - cmake.definitions['ENABLE_ALLOC_DEBUG'] = False - cmake.definitions['ENABLE_MEMORY_DEBUG'] = False - cmake.definitions['BUILD_SHARED_LIB'] = self.options.shared - cmake.configure(build_folder=self._build_subfolder) - self._cmake = cmake - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TAB2SPACE"] = False + tc.variables["BUILD_SAMPLE_CODE"] = False + tc.variables["TIDY_COMPAT_HEADERS"] = False + tc.variables["SUPPORT_CONSOLE_APP"] = False + tc.variables["SUPPORT_LOCALIZATIONS"] = self.options.support_localizations + tc.variables["ENABLE_DEBUG_LOG"] = False + tc.variables["ENABLE_ALLOC_DEBUG"] = False + tc.variables["ENABLE_MEMORY_DEBUG"] = False + tc.variables["BUILD_SHARED_LIB"] = self.options.shared + 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", dst="licenses", src=self._source_subfolder) - self.copy("LICENSE.md", dst="licenses", src=os.path.join(self._source_subfolder, 'README')) - cmake = self._configure_cmake() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "LICENSE.md", + dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder, "README")) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib"), recursive=True) if self.options.shared: to_remove = "*tidy_static*" if self.settings.os == "Windows" else "*.a" - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), to_remove) + rm(self, to_remove, os.path.join(self.package_folder, "lib"), recursive=True) def package_info(self): - self.cpp_info.names["pkg_config"] = "tidy" - suffix = "_static" if self.settings.os == "Windows" and not self.options.shared else "" - suffix += "d" if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug" else "" + self.cpp_info.set_property("pkg_config_name", "tidy") + suffix = "" + if self.settings.os == "Windows" and not self.options.shared: + suffix = "_static" + if is_msvc(self) and self.settings.build_type == "Debug": + suffix += "d" self.cpp_info.libs = ["tidy" + suffix] if self.settings.os == "Windows" and not self.options.shared: self.cpp_info.defines.append("TIDY_STATIC") diff --git a/recipes/tidy-html5/all/test_package/CMakeLists.txt b/recipes/tidy-html5/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..e21ed1c05b78fa 100644 --- a/recipes/tidy-html5/all/test_package/CMakeLists.txt +++ b/recipes/tidy-html5/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(tidy-html5 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE tidy-html5::tidy-html5) diff --git a/recipes/tidy-html5/all/test_package/conanfile.py b/recipes/tidy-html5/all/test_package/conanfile.py index bd7165a553cf41..ef5d7042163ecc 100644 --- a/recipes/tidy-html5/all/test_package/conanfile.py +++ b/recipes/tidy-html5/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" + 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/tidy-html5/all/test_v1_package/CMakeLists.txt b/recipes/tidy-html5/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/tidy-html5/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/tidy-html5/all/test_v1_package/conanfile.py b/recipes/tidy-html5/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7e2dfe859bb27b --- /dev/null +++ b/recipes/tidy-html5/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tinkerforge-bindings/all/CMakeLists.txt b/recipes/tinkerforge-bindings/all/CMakeLists.txt index 2ea059e4508bae..64a0e8e101bed9 100644 --- a/recipes/tinkerforge-bindings/all/CMakeLists.txt +++ b/recipes/tinkerforge-bindings/all/CMakeLists.txt @@ -1,26 +1,22 @@ -cmake_minimum_required(VERSION 3.4) -project(tinkerforge_bindings) +cmake_minimum_required(VERSION 3.15) +project(tinkerforge_bindings LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +file(GLOB TINK_SOURCES ${TINKERFORGE_BINDINGS_SRC_DIR}/source/*.c) +file(GLOB TINK_HEADERS ${TINKERFORGE_BINDINGS_SRC_DIR}/source/*.h) -file(GLOB SOURCES ${CMAKE_SOURCE_DIR}/source_subfolder/source/*.c) -file(GLOB HEADERS ${CMAKE_SOURCE_DIR}/source_subfolder/source/*.h) - -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_library(${PROJECT_NAME} ${SOURCES}) - -if(MSVC) - target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32 advapi32) +add_library(${PROJECT_NAME} ${TINK_SOURCES}) +set_target_properties(${PROJECT_NAME} PROPERTIES + PUBLIC_HEADER "${TINK_HEADERS}" + WINDOWS_EXPORT_ALL_SYMBOLS ON +) +if(WIN32) + target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32 advapi32) endif() -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}") +include(GNUInstallDirs) install(TARGETS ${PROJECT_NAME} - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - PUBLIC_HEADER DESTINATION include + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/recipes/tinkerforge-bindings/all/conanfile.py b/recipes/tinkerforge-bindings/all/conanfile.py index fb57c7fccf3f72..43201b9ca39347 100644 --- a/recipes/tinkerforge-bindings/all/conanfile.py +++ b/recipes/tinkerforge-bindings/all/conanfile.py @@ -1,17 +1,23 @@ -from conans import ConanFile, tools, CMake -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 copy, get +from conan.tools.microsoft import is_msvc_static_runtime + +required_conan_version = ">=1.53.0" + class TinkerforgeBindingsConan(ConanFile): name = "tinkerforge-bindings" + description = "API bindings to control Tinkerforge's Bricks and Bricklets" + license = "CC0 1.0 Universal" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.tinkerforge.com/" - license = "CC0 1.0 Universal" - description = "API bindings to control Tinkerforge's Bricks and Bricklets" - topics = "iot", "maker", "bindings" + topics = ("iot", "maker", "bindings") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,19 +28,8 @@ class TinkerforgeBindingsConan(ConanFile): "fPIC": True, } - _cmake = None - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -42,40 +37,42 @@ 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 validate(self): - if self.settings.compiler == "Visual Studio" and self.options.shared and "MT" in self.settings.compiler.runtime: + if self.options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Static runtime + shared is failing to link") def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=False) + get(self, **self.conan_data["sources"][self.version], strip_root=False) - 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["TINKERFORGE_BINDINGS_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): - self.copy("license.txt", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "license.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): + self.cpp_info.set_property("cmake_file_name", "tinkerforge-bindings") self.cpp_info.set_property("cmake_target_name", "tinkerforge::bindings") - self.cpp_info.names["cmake_find_package"] = "tinkerforge" - self.cpp_info.names["cmake_find_package_multi"] = "tinkerforge" - self.cpp_info.filenames["cmake_find_package"] = "tinkerforge-bindings" - self.cpp_info.filenames["cmake_find_package_multi"] = "tinkerforge-bindings" + self.cpp_info.components["_bindings"].set_property("cmake_target_name", "bindings") self.cpp_info.components["_bindings"].names["cmake_find_package"] = "bindings" self.cpp_info.components["_bindings"].names["cmake_find_package_multi"] = "bindings" self.cpp_info.components["_bindings"].libs = ["tinkerforge_bindings"] @@ -84,3 +81,9 @@ def package_info(self): self.cpp_info.components["_bindings"].system_libs = ["pthread"] elif self.settings.os == "Windows": self.cpp_info.components["_bindings"].system_libs = ["advapi32", "ws2_32"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "tinkerforge" + self.cpp_info.names["cmake_find_package_multi"] = "tinkerforge" + self.cpp_info.filenames["cmake_find_package"] = "tinkerforge-bindings" + self.cpp_info.filenames["cmake_find_package_multi"] = "tinkerforge-bindings" diff --git a/recipes/tinkerforge-bindings/all/test_package/CMakeLists.txt b/recipes/tinkerforge-bindings/all/test_package/CMakeLists.txt index b831e148cc9c04..4be380621fecde 100644 --- a/recipes/tinkerforge-bindings/all/test_package/CMakeLists.txt +++ b/recipes/tinkerforge-bindings/all/test_package/CMakeLists.txt @@ -1,10 +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(TARGETS) - -find_package(tinkerforge-bindings REQUIRED) +find_package(tinkerforge-bindings REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} tinkerforge::bindings) diff --git a/recipes/tinkerforge-bindings/all/test_package/conanfile.py b/recipes/tinkerforge-bindings/all/test_package/conanfile.py index 0245c9a8028a3f..ef5d7042163ecc 100644 --- a/recipes/tinkerforge-bindings/all/test_package/conanfile.py +++ b/recipes/tinkerforge-bindings/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" + 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/tinkerforge-bindings/all/test_v1_package/CMakeLists.txt b/recipes/tinkerforge-bindings/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/tinkerforge-bindings/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/tinkerforge-bindings/all/test_v1_package/conanfile.py b/recipes/tinkerforge-bindings/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..9b63bd176646ba --- /dev/null +++ b/recipes/tinkerforge-bindings/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/tiny-dnn/all/CMakeLists.txt b/recipes/tiny-dnn/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33fc..00000000000000 --- a/recipes/tiny-dnn/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/tiny-dnn/all/conanfile.py b/recipes/tiny-dnn/all/conanfile.py index b3a57165d52a3f..d88cf7b9a6e9e4 100644 --- a/recipes/tiny-dnn/all/conanfile.py +++ b/recipes/tiny-dnn/all/conanfile.py @@ -1,35 +1,28 @@ -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.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, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class TinyDnnConan(ConanFile): name = "tiny-dnn" + description = "tiny-dnn is a C++14 implementation of deep learning." license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tiny-dnn/tiny-dnn" - description = "tiny-dnn is a C++14 implementation of deep learning." topics = ("header-only", "deep-learning", "embedded", "iot", "computational") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - options = { - "with_tbb": [True, False], - } - default_options = { - "with_tbb": False, - } - - exports_sources = "CMakeLists.txt" - # TODO: if you move this recipe to CMakeDeps, be aware that tiny-dnn - # relies on CMake variables which are not defined in CMakeDeps, only - # in cmake_find_package. So patch it before. - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" + options = {"with_tbb": [True, False]} + default_options = {"with_tbb": False} + no_copy_source = True @property def _min_cppstd(self): @@ -41,58 +34,71 @@ def _min_compilers_version(self): "gcc": "5", "clang": "3.4", "apple-clang": "10", - "Visual Studio": "14" + "msvc": "190", + "Visual Studio": "14", } + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): self.requires("cereal/1.3.1") self.requires("stb/cci.20210713") if self.options.with_tbb: self.requires("onetbb/2020.3") + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._min_cppstd) + check_min_cppstd(self, self._min_cppstd) compiler = str(self.settings.compiler) - version = tools.Version(self.settings.compiler.version) + version = Version(self.settings.compiler.version) if compiler in self._min_compilers_version and version < self._min_compilers_version[compiler]: - raise ConanInvalidConfiguration( - "{} requires a compiler that supports at least C++{}".format( - self.name, self._min_cppstd, - ) - ) - - def package_id(self): - self.info.header_only() + raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least C++{self._min_cppstd}") 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["USE_TBB"] = self.options.with_tbb + tc.variables["USE_GEMMLOWP"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - tools.replace_in_file( - os.path.join(self._source_subfolder, "tiny_dnn", "util", "image.h"), - "third_party/", "", - ) + replace_in_file(self, + os.path.join(self.source_folder, "tiny_dnn", "util", "image.h"), + "third_party/", "") def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) cmake = CMake(self) - cmake.definitions["USE_TBB"] = self.options.with_tbb - cmake.definitions["USE_GEMMLOWP"] = False cmake.configure() 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.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "tinydnn") self.cpp_info.set_property("cmake_target_name", "TinyDNN::tiny_dnn") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["tinydnn"].set_property("cmake_target_name", "TinyDNN::tiny_dnn") + self.cpp_info.components["tinydnn"].requires = ["cereal::cereal", "stb::stb"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["tinydnn"].system_libs = ["pthread"] if self.options.with_tbb: self.cpp_info.components["tinydnn"].defines = ["CNN_USE_TBB=1"] + self.cpp_info.components["tinydnn"].requires.append("onetbb::onetbb") # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tinydnn" @@ -101,7 +107,3 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "TinyDNN" self.cpp_info.components["tinydnn"].names["cmake_find_package"] = "tiny_dnn" self.cpp_info.components["tinydnn"].names["cmake_find_package_multi"] = "tiny_dnn" - self.cpp_info.components["tinydnn"].set_property("cmake_target_name", "TinyDNN::tiny_dnn") - self.cpp_info.components["tinydnn"].requires = ["cereal::cereal", "stb::stb"] - if self.options.with_tbb: - self.cpp_info.components["tinydnn"].requires.append("onetbb::onetbb") diff --git a/recipes/tiny-dnn/all/test_package/CMakeLists.txt b/recipes/tiny-dnn/all/test_package/CMakeLists.txt index e2d99200a80ab1..efce3e2e319026 100644 --- a/recipes/tiny-dnn/all/test_package/CMakeLists.txt +++ b/recipes/tiny-dnn/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(tinydnn REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/tiny-dnn/all/test_package/conanfile.py b/recipes/tiny-dnn/all/test_package/conanfile.py index 38f4483872d47f..fae501d0afb9e4 100644 --- a/recipes/tiny-dnn/all/test_package/conanfile.py +++ b/recipes/tiny-dnn/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" + 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/tiny-dnn/all/test_v1_package/CMakeLists.txt b/recipes/tiny-dnn/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/tiny-dnn/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/tiny-dnn/all/test_v1_package/conanfile.py b/recipes/tiny-dnn/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/tiny-dnn/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/tinyalsa/all/conandata.yml b/recipes/tinyalsa/all/conandata.yml index e736cb9ab96069..2fbff13d26bb3e 100644 --- a/recipes/tinyalsa/all/conandata.yml +++ b/recipes/tinyalsa/all/conandata.yml @@ -8,4 +8,14 @@ sources: patches: "2.0.0": - patch_file: "patches/tinyalsa-2.0.0-strncpy-warning.patch" - base_path: "source_subfolder" + - patch_file: "patches/tinyalsa-2.0.0-fix-hardcoded-gcc.patch" + patch_description: "Fix hardcoded references to GCC" + patch_type: "portability" + "1.1.1": + - patch_file: "patches/tinyalsa-1.1.1-fix-make-clang-build.patch" + patch_description: "fix clang build using make" + patch_type: "backport" + patch_source: "https://github.com/tinyalsa/tinyalsa/commit/1c13f7cbe1ebee24c2b62d5ba16f2702882da49a" + - patch_file: "patches/tinyalsa-1.1.1-fix-hardcoded-gcc.patch" + patch_description: "Fix hardcoded references to GCC" + patch_type: "portability" diff --git a/recipes/tinyalsa/all/conanfile.py b/recipes/tinyalsa/all/conanfile.py index 3475e6c4f17af9..e88da3d9b79db5 100644 --- a/recipes/tinyalsa/all/conanfile.py +++ b/recipes/tinyalsa/all/conanfile.py @@ -1,68 +1,78 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, chdir, copy, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class TinyAlsaConan(ConanFile): name = "tinyalsa" + description = "A small library to interface with ALSA in the Linux kernel" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tinyalsa/tinyalsa" topics = ("tiny", "alsa", "sound", "audio", "tinyalsa") - description = "A small library to interface with ALSA in the Linux kernel" - exports_sources = ["patches/*",] - options = {"shared": [True, False], "with_utils": [True, False]} - default_options = {'shared': False, 'with_utils': False} + package_type = "library" settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "with_utils": [True, False]} + default_options = {"shared": False, "with_utils": False} - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("{} only works for Linux.".format(self.name)) 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 export_sources(self): + export_conandata_patches(self) 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 = AutotoolsToolchain(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with tools.chdir(self._source_subfolder): - env_build = AutoToolsBuildEnvironment(self) - env_build.make() + apply_conandata_patches(self) + with chdir(self, self.source_folder): + at = Autotools(self) + at.make() def package(self): - self.copy("NOTICE", dst="licenses", src=self._source_subfolder) + copy(self, "NOTICE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - with tools.chdir(self._source_subfolder): - env_build = AutoToolsBuildEnvironment(self) - env_build_vars = env_build.vars - env_build_vars['PREFIX'] = self.package_folder - env_build.install(vars=env_build_vars) + with chdir(self, self.source_folder): + at = Autotools(self) + at.install(args=[f"DESTDIR={self.package_folder}", "PREFIX="]) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) - if not self.options.with_utils: - tools.rmdir(os.path.join(self.package_folder, "bin")) + pattern_to_remove = "*.a" if self.options.shared else "*.so" + rm(self, pattern_to_remove, os.path.join(self.package_folder, "lib")) - with tools.chdir(os.path.join(self.package_folder, "lib")): - files = os.listdir() - for f in files: - if (self.options.shared and f.endswith(".a")) or (not self.options.shared and not f.endswith(".a")): - os.unlink(f) + if not self.options.with_utils: + rmdir(self, os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.libs = ["tinyalsa"] - if tools.Version(self.version) >= "2.0.0": + if Version(self.version) >= "2.0.0": self.cpp_info.system_libs.append("dl") + if self.options.with_utils: bin_path = os.path.join(self.package_folder, "bin") - self.output.info('Appending PATH environment variable: %s' % bin_path) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.path.append(bin_path) + + # Needed for compatibility with v1.x - Remove when 2.0 becomes the default + 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/tinyalsa/all/patches/tinyalsa-1.1.1-fix-hardcoded-gcc.patch b/recipes/tinyalsa/all/patches/tinyalsa-1.1.1-fix-hardcoded-gcc.patch new file mode 100644 index 00000000000000..06261e0620b0d7 --- /dev/null +++ b/recipes/tinyalsa/all/patches/tinyalsa-1.1.1-fix-hardcoded-gcc.patch @@ -0,0 +1,46 @@ +diff --git a/examples/Makefile b/examples/Makefile +index 807d4c8..32a8a9b 100644 +--- a/examples/Makefile ++++ b/examples/Makefile +@@ -1,6 +1,5 @@ + CROSS_COMPILE ?= + +-CC = $(CROSS_COMPILE)gcc + CFLAGS = -Wall -Wextra -Werror -Wfatal-errors -I ../include + + VPATH = ../src +diff --git a/src/Makefile b/src/Makefile +index d33c9f1..0e5c054 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -7,9 +7,6 @@ LIBDIR := $(LIBDIR)/$(DEB_HOST_MULTIARCH) + endif + + CROSS_COMPILE = +-CC = $(CROSS_COMPILE)gcc +-AR = $(CROSS_COMPILE)ar +-LD = $(CROSS_COMPILE)gcc + + WARNINGS = -Wall -Wextra -Werror -Wfatal-errors + INCLUDE_DIRS = -I ../include +@@ -37,7 +34,7 @@ libtinyalsa.so.1: libtinyalsa.so.1.1.1 + ln -sf $< $@ + + libtinyalsa.so.1.1.1: $(OBJECTS) +- $(LD) $(LDFLAGS) -shared -Wl,-soname,libtinyalsa.so.1 $^ -o $@ ++ $(CC) $(LDFLAGS) -shared -Wl,-soname,libtinyalsa.so.1 $^ -o $@ + + .PHONY: clean + clean: +diff --git a/utils/Makefile b/utils/Makefile +index ad4bc5c..ab90c79 100644 +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -4,7 +4,6 @@ BINDIR ?= $(PREFIX)/bin + MANDIR ?= $(PREFIX)/man + + CROSS_COMPILE ?= +-CC = $(CROSS_COMPILE)gcc + + CFLAGS += -Wall -Wextra -Werror -Wfatal-errors + CFLAGS += -I ../include diff --git a/recipes/tinyalsa/all/patches/tinyalsa-1.1.1-fix-make-clang-build.patch b/recipes/tinyalsa/all/patches/tinyalsa-1.1.1-fix-make-clang-build.patch new file mode 100644 index 00000000000000..c0749bfad8d12d --- /dev/null +++ b/recipes/tinyalsa/all/patches/tinyalsa-1.1.1-fix-make-clang-build.patch @@ -0,0 +1,40 @@ +diff --git a/utils/Makefile b/utils/Makefile +index ad4bc5c..fb52cd3 100644 +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -8,21 +8,30 @@ CC = $(CROSS_COMPILE)gcc + + CFLAGS += -Wall -Wextra -Werror -Wfatal-errors + CFLAGS += -I ../include +-CFLAGS += -L ../src + CFLAGS += -O2 + ++LDFLAGS += -L ../src ++ + VPATH = ../src:../include/tinyalsa + + .PHONY: all + all: -ltinyalsa tinyplay tinycap tinymix tinypcminfo + +-tinyplay: tinyplay.c pcm.h mixer.h asoundlib.h libtinyalsa.a ++tinyplay: tinyplay.o libtinyalsa.a ++ ++tinyplay.o: tinyplay.c pcm.h mixer.h asoundlib.h ++ ++tinycap: tinycap.o libtinyalsa.a ++ ++tinycap.o: tinycap.c pcm.h mixer.h asoundlib.h ++ ++tinymix: tinymix.o libtinyalsa.a + +-tinycap: tinycap.c pcm.h mixer.h asoundlib.h libtinyalsa.a ++tinymix.o: tinymix.c pcm.h mixer.h asoundlib.h + +-tinymix: tinymix.c pcm.h mixer.h asoundlib.h libtinyalsa.a ++tinypcminfo: tinypcminfo.o libtinyalsa.a + +-tinypcminfo: tinypcminfo.c pcm.h mixer.h asoundlib.h libtinyalsa.a ++tinypcminfo.o: tinypcminfo.c pcm.h mixer.h asoundlib.h + + .PHONY: clean + clean: diff --git a/recipes/tinyalsa/all/patches/tinyalsa-2.0.0-fix-hardcoded-gcc.patch b/recipes/tinyalsa/all/patches/tinyalsa-2.0.0-fix-hardcoded-gcc.patch new file mode 100644 index 00000000000000..db679cccf2ab7c --- /dev/null +++ b/recipes/tinyalsa/all/patches/tinyalsa-2.0.0-fix-hardcoded-gcc.patch @@ -0,0 +1,46 @@ +diff --git a/examples/Makefile b/examples/Makefile +index 650966d..1f68ff6 100644 +--- a/examples/Makefile ++++ b/examples/Makefile +@@ -1,6 +1,5 @@ + CROSS_COMPILE ?= + +-CC = $(CROSS_COMPILE)gcc + CFLAGS = -Wall -Wextra -Werror -Wfatal-errors -I ../include + + VPATH = ../src +diff --git a/src/Makefile b/src/Makefile +index aaa84b8..ac86400 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -6,9 +6,6 @@ ifdef DEB_HOST_MULTIARCH + LIBDIR := $(LIBDIR)/$(DEB_HOST_MULTIARCH) + endif + +-CC = $(CROSS_COMPILE)gcc +-AR = $(CROSS_COMPILE)ar +-LD = $(CROSS_COMPILE)gcc + + WARNINGS = -Wall -Wextra -Werror -Wfatal-errors + INCLUDE_DIRS = -I ../include +@@ -49,7 +46,7 @@ libtinyalsa.so.$(LIBVERSION_MAJOR): libtinyalsa.so.$(LIBVERSION) + ln -sf $< $@ + + libtinyalsa.so.$(LIBVERSION): $(OBJECTS) +- $(LD) $(LDFLAGS) -shared -Wl,-soname,libtinyalsa.so.$(LIBVERSION_MAJOR) $^ -o $@ ++ $(CC) $(LDFLAGS) -shared -Wl,-soname,libtinyalsa.so.$(LIBVERSION_MAJOR) $^ -o $@ + + .PHONY: clean + clean: +diff --git a/utils/Makefile b/utils/Makefile +index f733c39..38a9cb5 100644 +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -4,7 +4,6 @@ BINDIR ?= $(PREFIX)/bin + MANDIR ?= $(PREFIX)/man + + CROSS_COMPILE ?= +-CC = $(CROSS_COMPILE)gcc + + CFLAGS += -Wall -Wextra -Werror -Wfatal-errors + CFLAGS += -I ../include diff --git a/recipes/tinyalsa/all/test_package/CMakeLists.txt b/recipes/tinyalsa/all/test_package/CMakeLists.txt index 05e771029ef2c2..164aea97900819 100644 --- a/recipes/tinyalsa/all/test_package/CMakeLists.txt +++ b/recipes/tinyalsa/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(PackageTest) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(PackageTest LANGUAGES C) find_package(tinyalsa CONFIG REQUIRED) diff --git a/recipes/tinyalsa/all/test_package/conanfile.py b/recipes/tinyalsa/all/test_package/conanfile.py index 481a3b9adeaa25..03f3d654478f90 100644 --- a/recipes/tinyalsa/all/test_package/conanfile.py +++ b/recipes/tinyalsa/all/test_package/conanfile.py @@ -1,9 +1,23 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.files import load, save import os -from conans import ConanFile, CMake, tools -class LibalsaTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self) + + def generate(self): + save(self, os.path.join(self.build_folder, "with_utils"), + str(self.dependencies["tinyalsa"].options.with_utils)) def build(self): cmake = CMake(self) @@ -11,6 +25,8 @@ def build(self): cmake.build() def test(self): - if not tools.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.bindirs[0], "example") + self.run(bin_path, env="conanrun") + if load(self, os.path.join(self.build_folder, "with_utils")) == "True": + self.run("tinymix --help", env="conanrun") diff --git a/recipes/tinyalsa/all/test_v1_package/CMakeLists.txt b/recipes/tinyalsa/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..0d20897301b68b --- /dev/null +++ b/recipes/tinyalsa/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +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/tinyalsa/all/test_v1_package/conanfile.py b/recipes/tinyalsa/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..bb566468b9731e --- /dev/null +++ b/recipes/tinyalsa/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/tinydir/all/conandata.yml b/recipes/tinydir/all/conandata.yml index 16d1524b1696fc..b8405fd5f17561 100644 --- a/recipes/tinydir/all/conandata.yml +++ b/recipes/tinydir/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.6": + url: "https://github.com/cxong/tinydir/archive/refs/tags/1.2.6.tar.gz" + sha256: "1ecbdf8d04b079f8a9404662708d2333d6b72b956effb0d5296d063db3a02b4e" "1.2.5": url: "https://github.com/cxong/tinydir/archive/refs/tags/1.2.5.tar.gz" sha256: "7ab150a16fa78ea76e9fd58ef88922c03eca2334c023b8d9bc94755fdde522c7" diff --git a/recipes/tinydir/config.yml b/recipes/tinydir/config.yml index 712ebbf8b5754b..065b2720327737 100644 --- a/recipes/tinydir/config.yml +++ b/recipes/tinydir/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.6": + folder: "all" "1.2.5": folder: "all" "1.2.4": diff --git a/recipes/tinyexr/all/conandata.yml b/recipes/tinyexr/all/conandata.yml index 2b4deeb06840bb..e57fb348a5c615 100644 --- a/recipes/tinyexr/all/conandata.yml +++ b/recipes/tinyexr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.7": + url: "https://github.com/syoyo/tinyexr/archive/v1.0.7.tar.gz" + sha256: "1ffcc4ce85edef4af955497417445c2a7d3565ad9f314cd69f33075a37a48359" "1.0.6": url: "https://github.com/syoyo/tinyexr/archive/v1.0.6.tar.gz" sha256: "807a5665a7da8dc5ba4dd2c0f69079d87f37a147399680a54e3b38f86486aa67" diff --git a/recipes/tinyexr/all/conanfile.py b/recipes/tinyexr/all/conanfile.py index 26a07647634a18..cf57d86c163643 100644 --- a/recipes/tinyexr/all/conanfile.py +++ b/recipes/tinyexr/all/conanfile.py @@ -40,7 +40,7 @@ def requirements(self): if self.options.with_z == "miniz": self.requires("miniz/3.0.2") else: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zfp: self.requires("zfp/1.0.0") diff --git a/recipes/tinyexr/config.yml b/recipes/tinyexr/config.yml index b08dcb504fac7a..675ce3be793968 100644 --- a/recipes/tinyexr/config.yml +++ b/recipes/tinyexr/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.7": + folder: all "1.0.6": folder: all "1.0.1": diff --git a/recipes/tinyxml/all/conanfile.py b/recipes/tinyxml/all/conanfile.py index 46d31e88896c2e..3616d277c7fb4b 100644 --- a/recipes/tinyxml/all/conanfile.py +++ b/recipes/tinyxml/all/conanfile.py @@ -25,7 +25,7 @@ class TinyXmlConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "with_stl": False, + "with_stl": True, } exports_sources = "CMakeLists.txt" diff --git a/recipes/tixi3/all/conanfile.py b/recipes/tixi3/all/conanfile.py index b8124c51186f67..945f16516ecaa6 100644 --- a/recipes/tixi3/all/conanfile.py +++ b/recipes/tixi3/all/conanfile.py @@ -33,12 +33,12 @@ def generate(self): deps.generate() def requirements(self): - self.requires("libxml2/2.9.14") + self.requires("libxml2/2.11.5") self.requires("libxslt/1.1.34") - self.requires("libcurl/7.84.0") + self.requires("libcurl/[>=7.78.0 <9]") def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def config_options(self): if self.settings.os == "Windows": @@ -46,20 +46,10 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - + self.options.rm_safe("fPIC") # tixi is a c library - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def export_sources(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): diff --git a/recipes/tixi3/all/test_package/CMakeLists.txt b/recipes/tixi3/all/test_package/CMakeLists.txt index c9358ca94ac503..9d54bfb6f94d4c 100644 --- a/recipes/tixi3/all/test_package/CMakeLists.txt +++ b/recipes/tixi3/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.12) -project(Tixi-Conan-TestPackage CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) find_package(tixi3 REQUIRED) -add_executable(tixi3_conan_test main.cpp) -target_link_libraries(tixi3_conan_test PRIVATE tixi3) +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tixi3) diff --git a/recipes/tixi3/all/test_package/conanfile.py b/recipes/tixi3/all/test_package/conanfile.py index 0e104e3f9a6621..ef5d7042163ecc 100644 --- a/recipes/tixi3/all/test_package/conanfile.py +++ b/recipes/tixi3/all/test_package/conanfile.py @@ -1,13 +1,16 @@ - from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout 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) @@ -19,5 +22,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "tixi3_conan_test") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/tixi3/all/test_v1_package/CMakeLists.txt b/recipes/tixi3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 80f9071294122b..00000000000000 --- a/recipes/tixi3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(tixi3_conan_test CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tixi3 REQUIRED CONFIG) - -add_executable(tixi3_conan_test ../test_package/main.cpp) -target_link_libraries(tixi3_conan_test tixi3) diff --git a/recipes/tixi3/all/test_v1_package/conanfile.py b/recipes/tixi3/all/test_v1_package/conanfile.py deleted file mode 100644 index d620b7c8ee1ca6..00000000000000 --- a/recipes/tixi3/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -import os - -from conan.tools.build import cross_building -from conans import ConanFile, CMake - - -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", "tixi3_conan_test") - self.run(bin_path, run_environment=True) diff --git a/recipes/tk/all/conandata.yml b/recipes/tk/all/conandata.yml index 8cbbcf9134e3cd..7e9e03ca25a75f 100644 --- a/recipes/tk/all/conandata.yml +++ b/recipes/tk/all/conandata.yml @@ -2,3 +2,15 @@ sources: "8.6.10": url: "https://prdownloads.sourceforge.net/tcl/tk8.6.10-src.tar.gz" sha256: "63df418a859d0a463347f95ded5cd88a3dd3aaa1ceecaeee362194bc30f3e386" + +patches: + "8.6.10": + - patch_file: "patches/0001-Add-unix-conan-compatibility.patch" + patch_description: "Add unix conan compatibility" + patch_type: "conan" + - patch_file: "patches/0002-Add-windows-conan-compatibility.patch" + patch_description: "Add windows conan compatibility" + patch_type: "conan" + - patch_file: "patches/0003-Patch-tkConfig.sh.patch" + patch_description: "Remove TK_BUILD_* and TK_SRC_DIR from tkConfig.sh for portability" + patch_type: "portability" diff --git a/recipes/tk/all/conanfile.py b/recipes/tk/all/conanfile.py index 97130833734db4..2c3e88ddc0d5b7 100644 --- a/recipes/tk/all/conanfile.py +++ b/recipes/tk/all/conanfile.py @@ -1,8 +1,26 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanException, ConanInvalidConfiguration, ConanExceptionInUserConanfileMethod import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanException, 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, + rmdir, +) +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import NMakeDeps, NMakeToolchain, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.55.0" + class TkConan(ConanFile): name = "tk" @@ -12,6 +30,7 @@ class TkConan(ConanFile): license = "TCL" url = "https://github.com/conan-io/conan-center-index" settings = "os", "compiler", "build_type", "arch" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -21,24 +40,23 @@ class TkConan(ConanFile): "fPIC": True, } - _autotools = None - - @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": - del self.options.fPIC + self.options.rm_safe("fPIC") 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("tcl/{}".format(self.version)) + self.requires( + f"tcl/{self.version}", transitive_headers=True, transitive_libs=True + ) if self.settings.os == "Linux": self.requires("fontconfig/2.13.93") self.requires("xorg/system") @@ -48,66 +66,84 @@ def _settings_build(self): return getattr(self, "settings_build", self.settings) def build_requirements(self): - if self.settings.compiler != "Visual Studio": - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + if not is_msvc(self): + if ( + self._settings_build.os == "Windows" + and not self.conf.get("tools.microsoft.bash:path") + and not self.conf.get("tools.microsoft.bash:subsystem") + ): self.build_requires("msys2/cci.latest") def validate(self): - if self.options["tcl"].shared != self.options.shared: - raise ConanInvalidConfiguration("The shared option of tcl and tk must have the same value") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def _patch_sources(self): - for build_system in ("unix", "win", ): - config_dir = self._get_configure_folder(build_system) - - if build_system != "win": - # When disabling 64-bit support (in 32-bit), this test must be 0 in order to use "long long" for 64-bit ints - # (${tcl_type_64bit} can be either "__int64" or "long long") - tools.replace_in_file(os.path.join(config_dir, "configure"), - "(sizeof(${tcl_type_64bit})==sizeof(long))", - "(sizeof(${tcl_type_64bit})!=sizeof(long))") - - makefile_in = os.path.join(config_dir, "Makefile.in") - # Avoid clearing CFLAGS and LDFLAGS in the makefile - # tools.replace_in_file(makefile_in, "\nCFLAGS{}".format(" " if (build_system == "win" and name == "tcl") else "\t"), "\n#CFLAGS\t") - tools.replace_in_file(makefile_in, "\nLDFLAGS\t", "\n#LDFLAGS\t") - tools.replace_in_file(makefile_in, "${CFLAGS}", "${CFLAGS} ${CPPFLAGS}") - - rules_ext_vc = os.path.join(self.source_folder, self._source_subfolder, "win", "rules-ext.vc") - tools.replace_in_file(rules_ext_vc, - "\n_RULESDIR = ", - "\n_RULESDIR = .\n#_RULESDIR = ") - rules_vc = os.path.join(self.source_folder, self._source_subfolder, "win", "rules.vc") - tools.replace_in_file(rules_vc, - r"$(_TCLDIR)\generic", - r"$(_TCLDIR)\include") - tools.replace_in_file(rules_vc, - "\nTCLSTUBLIB", - "\n#TCLSTUBLIB") - tools.replace_in_file(rules_vc, - "\nTCLIMPLIB", - "\n#TCLIMPLIB") + if self.dependencies["tcl"].options.shared != self.options.shared: + raise ConanInvalidConfiguration( + "The shared option of tcl and tk must have the same value" + ) + if self.settings.os == "Macos" and cross_building(self): + raise ConanInvalidConfiguration("The tk conan recipe does not currently support Macos cross-builds. A contribution to add this functionality would be welcome.") - win_makefile_in = os.path.join(self._get_configure_folder("win"), "Makefile.in") - tools.replace_in_file(win_makefile_in, "\nTCL_GENERIC_DIR", "\n#TCL_GENERIC_DIR") + def layout(self): + basic_layout(self, src_folder="src") - win_rules_vc = os.path.join(self._source_subfolder, "win", "rules.vc") - tools.replace_in_file(win_rules_vc, - "\ncwarn = $(cwarn) -WX", - "\n# cwarn = $(cwarn) -WX") - # disable whole program optimization to be portable across different MSVC versions. - # See conan-io/conan-center-index#4811 conan-io/conan-center-index#4094 - tools.replace_in_file( - win_rules_vc, - "OPTIMIZATIONS = $(OPTIMIZATIONS) -GL", - "# OPTIMIZATIONS = $(OPTIMIZATIONS) -GL") + def source(self): + get( + self, + **self.conan_data["sources"][self.version], + strip_root=True, + destination=self.source_folder, + ) + + def generate(self): + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + + deps = NMakeDeps(self) + deps.generate() + else: + # Inject runenv variables into buildenv + # This is required because tcl needs to be available when configure tries to + # run a test executable + if not cross_building(self): + runenv = VirtualRunEnv(self) + runenv.generate(scope="build") + + yes_no = lambda v: "yes" if v else "no" + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-threads") + tc.configure_args.append( + f"--enable-symbols={yes_no(self.settings.build_type == 'Debug')}" + ) + tc.configure_args.append( + f"--enable-64bit={yes_no(self.settings.arch == 'x86_64')}" + ) + tc.configure_args.append(f"--enable-aqua={yes_no(is_apple_os(self))}") + tc.configure_args.append( + f"--with-tcl={os.path.join(self.dependencies['tcl'].package_folder, 'lib')}" + ) + tc.configure_args.append(f"--with-x={yes_no(self.settings.os == 'Linux')}") + tc.make_args.append( + f"TCL_GENERIC_DIR={os.path.join(self.dependencies['tcl'].package_folder, 'include')}" + ) + if self.settings.os == "Windows": + tc.extra_defines.extend( + [ + "UNICODE", + "_UNICODE", + "_ATL_XP_TARGETING", + ] + ) + tc.generate() + + if self.settings.os == "Linux": + deps = AutotoolsDeps(self) + deps.generate() def _get_default_build_system(self): - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): return "macosx" elif self.settings.os in ("Linux", "FreeBSD"): return "unix" @@ -120,8 +156,8 @@ def _get_configure_folder(self, build_system=None): if build_system is None: build_system = self._get_default_build_system() if build_system not in ["win", "unix", "macosx"]: - raise ConanExceptionInUserConanfileMethod("Invalid build system: {}".format(build_system)) - return os.path.join(self.source_folder, self._source_subfolder, build_system) + raise ConanException(f"Invalid build system: {build_system}") + return os.path.join(self.source_folder, build_system) def _build_nmake(self, target="release"): # https://core.tcl.tk/tips/doc/trunk/tip/477.md @@ -130,7 +166,7 @@ def _build_nmake(self, target="release"): opts.append("static") if self.settings.build_type == "Debug": opts.append("symbols") - if "MD" in str(self.settings.compiler.runtime): + if "dynamic" in str(self.settings.compiler.runtime) or "MD" in str(self.settings.compiler.runtime): opts.append("msvcrt") else: opts.append("nomsvcrt") @@ -138,121 +174,116 @@ def _build_nmake(self, target="release"): opts.append("unchecked") # https://core.tcl.tk/tk/tktview?name=3d34589aa0 # https://wiki.tcl-lang.org/page/Building+with+Visual+Studio+2017 - tcl_lib_path = os.path.join(self.deps_cpp_info["tcl"].rootpath, "lib") + tcl_lib_path = os.path.join(self.dependencies["tcl"].package_folder, "lib") tclimplib, tclstublib = None, None for lib in os.listdir(tcl_lib_path): if not lib.endswith(".lib"): continue if lib.startswith("tcl{}".format("".join(self.version.split(".")[:2]))): tclimplib = os.path.join(tcl_lib_path, lib) - elif lib.startswith("tclstub{}".format("".join(self.version.split(".")[:2]))): + elif lib.startswith( + "tclstub{}".format("".join(self.version.split(".")[:2])) + ): tclstublib = os.path.join(tcl_lib_path, lib) if tclimplib is None or tclstublib is None: raise ConanException("tcl dependency misses tcl and/or tclstub library") - with tools.vcvars(self.settings): - tcldir = self.deps_cpp_info["tcl"].rootpath.replace("/", "\\\\") + + flags = { + "INSTALLDIR": self.package_folder, + "OPTS": ",".join(opts), + "TCLDIR": self.dependencies["tcl"].package_folder, + "TCL_LIBRARY": self.dependencies["tcl"].runenv_info.vars(self).get("TCL_LIBRARY"), + "TCLIMPLIB": tclimplib, + "TCLSTUBLIB": tclstublib, + } + config_dir = self._get_configure_folder("win") + with chdir(self, config_dir): self.run( - """nmake -nologo -f "{cfgdir}/makefile.vc" INSTALLDIR="{pkgdir}" OPTS={opts} TCLDIR="{tcldir}" TCL_LIBRARY="{tcl_library}" TCLIMPLIB="{tclimplib}" TCLSTUBLIB="{tclstublib}" {target}""".format( - cfgdir=self._get_configure_folder("win"), - pkgdir=self.package_folder, - opts=",".join(opts), - tcldir=tcldir, - tclstublib=tclstublib, - tclimplib=tclimplib, - tcl_library=self.deps_env_info['tcl'].TCL_LIBRARY.replace("\\", "/"), - target=target, - ), cwd=self._get_configure_folder("win"), + f"""nmake -nologo -f makefile.vc {' '.join([f'{k}="{v}"' for k, v in flags.items()])} {target}""", + env="conanbuild", ) - def _configure_autotools(self): - tcl_root = self.deps_cpp_info["tcl"].rootpath - make_args = ["TCL_GENERIC_DIR={}".format(os.path.join(tcl_root, "include")).replace("\\", "/")] - if self._autotools: - return self._autotools, make_args - - tclConfigShFolder = os.path.join(tcl_root, "lib").replace("\\", "/") - - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--with-tcl={}".format(tools.unix_path(tclConfigShFolder)), - "--enable-threads", - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-symbols={}".format(yes_no(self.settings.build_type == "Debug")), - "--enable-64bit={}".format(yes_no(self.settings.arch == "x86_64")), - "--with-x={}".format(yes_no(self.settings.os == "Linux")), - "--enable-aqua={}".format(yes_no(tools.is_apple_os(self.settings.os))), - ] - - if self.settings.os == "Windows": - self._autotools.defines.extend(["UNICODE", "_UNICODE", "_ATL_XP_TARGETING", ]) - self._autotools.libs = [] - self._autotools.configure(configure_dir=self._get_configure_folder(), args=conf_args) - return self._autotools, make_args - def build(self): - self._patch_sources() - - if self.settings.compiler == "Visual Studio": + apply_conandata_patches(self) + if is_msvc(self): self._build_nmake() else: - autotools, make_args = self._configure_autotools() - autotools.make(args=make_args) + autotools = Autotools(self) + autotools.configure(build_script_folder=self._get_configure_folder()) + autotools.make() def package(self): - self.copy(pattern="license.terms", src=self._source_subfolder, dst="licenses") - if self.settings.compiler == "Visual Studio": + copy( + self, + pattern="license.terms", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + if is_msvc(self): self._build_nmake("install") else: - with tools.chdir(self.build_folder): - autotools, make_args = self._configure_autotools() - autotools.install(args=make_args) - autotools.make(target="install-private-headers", args=make_args) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "man")) - tools.rmdir(os.path.join(self.package_folder, "share")) + with chdir(self, self.build_folder): + autotools = Autotools(self) + autotools.install() + # DESTDIR is only default initialized for target="install" + autotools.make( + target="install-private-headers", + args=[f"DESTDIR={self.package_folder}"], + ) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "man")) + rmdir(self, os.path.join(self.package_folder, "share")) - # FIXME: move to patch tkConfigShPath = os.path.join(self.package_folder, "lib", "tkConfig.sh") if os.path.exists(tkConfigShPath): - pkg_path = os.path.join(self.package_folder).replace('\\', '/') - tools.replace_in_file(tkConfigShPath, - pkg_path, - "${TK_ROOT}") - tools.replace_in_file(tkConfigShPath, - "\nTK_BUILD_", - "\n#TK_BUILD_") - tools.replace_in_file(tkConfigShPath, - "\nTK_SRC_DIR", - "\n#TK_SRC_DIR") + # This can only be modified after build since the value being replaced is a result + # of variable substitution in tkConfig.sh.in + replace_in_file(self, tkConfigShPath, "//", "${TK_ROOT}/") def package_info(self): - if self.settings.compiler == "Visual Studio": - tk_version = tools.Version(self.version) - lib_infix = "{}{}".format(tk_version.major, tk_version.minor) + tk_version = Version(self.version) + lib_infix = f"{tk_version.major}.{tk_version.minor}" + if is_msvc(self): + lib_infix = f"{tk_version.major}{tk_version.minor}" tk_suffix = "t{}{}{}".format( "" if self.options.shared else "s", "g" if self.settings.build_type == "Debug" else "", - "x" if "MD" in str(self.settings.compiler.runtime) and not self.options.shared else "", + "x" if ("dynamic" in str(self.settings.compiler.runtime) or "MD" in str(self.settings.compiler.runtime)) and not self.options.shared else "", ) else: - tk_version = tools.Version(self.version) - lib_infix = "{}.{}".format(tk_version.major, tk_version.minor) tk_suffix = "" - self.cpp_info.libs = ["tk{}{}".format(lib_infix, tk_suffix), "tkstub{}".format(lib_infix)] + self.cpp_info.libs = [f"tk{lib_infix}{tk_suffix}", f"tkstub{lib_infix}"] if self.settings.os == "Macos": self.cpp_info.frameworks = ["CoreFoundation", "Cocoa", "Carbon", "IOKit"] elif self.settings.os == "Windows": self.cpp_info.system_libs = [ - "netapi32", "kernel32", "user32", "advapi32", "userenv","ws2_32", "gdi32", - "comdlg32", "imm32", "comctl32", "shell32", "uuid", "ole32", "oleaut32" + "netapi32", + "kernel32", + "user32", + "advapi32", + "userenv", + "ws2_32", + "gdi32", + "comdlg32", + "imm32", + "comctl32", + "shell32", + "uuid", + "ole32", + "oleaut32", ] - tk_library = os.path.join(self.package_folder, "lib", "{}{}".format(self.name, ".".join(self.version.split(".")[:2]))).replace("\\", "/") - self.output.info("Setting TK_LIBRARY environment variable: {}".format(tk_library)) + tk_library = os.path.join( + self.package_folder, + "lib", + f"{self.name}{tk_version.major}.{tk_version.minor}", + ).replace("\\", "/") + self.output.info(f"Setting TK_LIBRARY environment variable: {tk_library}") self.env_info.TK_LIBRARY = tk_library + self.runenv_info.define("TK_LIBRARY", tk_library) - tcl_root = self.package_folder.replace("\\", "/") - self.output.info("Setting TCL_ROOT environment variable: {}".format(tcl_root)) - self.env_info.TCL_ROOT = tcl_root + tk_root = self.package_folder.replace("\\", "/") + self.output.info(f"Setting TK_ROOT environment variable: {tk_root}") + self.env_info.TK_ROOT = tk_root + self.runenv_info.define("TK_ROOT", tk_root) diff --git a/recipes/tk/all/patches/0001-Add-unix-conan-compatibility.patch b/recipes/tk/all/patches/0001-Add-unix-conan-compatibility.patch new file mode 100644 index 00000000000000..6fa4dea2761c6f --- /dev/null +++ b/recipes/tk/all/patches/0001-Add-unix-conan-compatibility.patch @@ -0,0 +1,80 @@ +Subject: [PATCH] Add unix conan compatibility + +--- + unix/Makefile.in | 11 +++++------ + unix/configure | 2 +- + 2 files changed, 6 insertions(+), 7 deletions(-) + +diff --git a/unix/Makefile.in b/unix/Makefile.in +index c6f8c25d7..7bc4a22ba 100644 +--- a/unix/Makefile.in ++++ b/unix/Makefile.in +@@ -143,7 +143,6 @@ CFLAGS = @CFLAGS_DEFAULT@ @CFLAGS@ + # Flags to pass to the linker + LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ + LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ +-LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@ + + # A "-I" switch that can be used when compiling to make all of the + # X11 include files accessible (the configure script will try to +@@ -328,7 +327,7 @@ MAN_FLAGS = @MAN_FLAGS@ + + CC = @CC@ + +-CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ ++CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CPPFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ + -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} -I${TCL_GENERIC_DIR} \ + -I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${AC_FLAGS} \ + ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \ +@@ -338,7 +337,7 @@ CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @TCL_STUB_FLAGS@ + + APP_CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @EXTRA_APP_CC_SWITCHES@ + +-DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \ ++DEPEND_SWITCHES = ${CFLAGS} ${CPPFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \ + -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} \ + ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \ + ${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@ +@@ -620,7 +619,7 @@ objs: ${OBJS} + + + ${WISH_EXE}: $(TK_STUB_LIB_FILE) $(WISH_OBJS) $(TK_LIB_FILE) @APP_RSRC_FILE@ +- ${CC} ${CFLAGS} ${LDFLAGS} $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ \ ++ ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ \ + $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o ${WISH_EXE} + + # Resetting the LIB_RUNTIME_DIR below is required so that +@@ -633,7 +632,7 @@ $(TKTEST_EXE): $(TKTEST_OBJS) $(TK_LIB_FILE) + $(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)" + + tktest-real: ${TK_STUB_LIB_FILE} +- ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} @TK_BUILD_LIB_SPEC@ \ ++ ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} $(TKTEST_OBJS) ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} @TK_BUILD_LIB_SPEC@ \ + $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o $(TKTEST_EXE) + + # # FIXME: This xttest rule seems to be broken in a number of ways. It should +@@ -641,7 +640,7 @@ tktest-real: ${TK_STUB_LIB_FILE} + # # tktest, and it is not clear where this test.o object file comes from. + # + # xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) ${TK_STUB_LIB_FILE} +-# ${CC} ${CFLAGS} ${LDFLAGS} test.o tkTest.o tkSquare.o \ ++# ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.o tkTest.o tkSquare.o \ + # @TK_BUILD_LIB_SPEC@ ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} \ + # $(WISH_LIBS) $(LD_SEARCH_FLAGS) -lXt -o xttest + +diff --git a/unix/configure b/unix/configure +index fb0f5a3d9..77256a740 100755 +--- a/unix/configure ++++ b/unix/configure +@@ -7279,7 +7279,7 @@ int + main () + { + switch (0) { +- case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; ++ case 1: case (sizeof(${tcl_type_64bit})!=sizeof(long)): ; + } + ; + return 0; +-- +2.40.0 + diff --git a/recipes/tk/all/patches/0002-Add-windows-conan-compatibility.patch b/recipes/tk/all/patches/0002-Add-windows-conan-compatibility.patch new file mode 100644 index 00000000000000..bd293b31a745e8 --- /dev/null +++ b/recipes/tk/all/patches/0002-Add-windows-conan-compatibility.patch @@ -0,0 +1,145 @@ +Subject: [PATCH] Add windows conan compatibility + +* Disable whole program optimization to be portable across different MSVC + versions. See conan-io/conan-center-index#4811 and + conan-io/conan-center-index#4094. +--- + win/rules-ext.vc | 8 ++++---- + win/rules.vc | 23 +++++++---------------- + 2 files changed, 11 insertions(+), 20 deletions(-) + +diff --git a/win/rules-ext.vc b/win/rules-ext.vc +index 58c70fa26..e7f953b4c 100644 +--- a/win/rules-ext.vc ++++ b/win/rules-ext.vc +@@ -37,7 +37,7 @@ macro to the name of the project makefile. + # First locate the Tcl directory that we are working with. + !ifdef TCLDIR + +-_RULESDIR = $(TCLDIR:/=\) ++_RULESDIR = . + + !else + +@@ -49,7 +49,7 @@ _RULESDIR=$(INSTALLDIR:/=\) + # Locate Tcl sources + !if [echo _RULESDIR = \> nmakehlp.out] \ + || [nmakehlp -L generic\tcl.h >> nmakehlp.out] +-_RULESDIR = ..\..\tcl ++_RULESDIR = . + !else + !include nmakehlp.out + !endif +@@ -61,9 +61,9 @@ _RULESDIR = ..\..\tcl + # Now look for the targets.vc file under the Tcl root. Note we check this + # file and not rules.vc because the latter also exists on older systems. + !if exist("$(_RULESDIR)\lib\nmake\targets.vc") # Building against installed Tcl +-_RULESDIR = $(_RULESDIR)\lib\nmake ++_RULESDIR = . + !elseif exist("$(_RULESDIR)\win\targets.vc") # Building against Tcl sources +-_RULESDIR = $(_RULESDIR)\win ++_RULESDIR = . + !else + # If we have not located Tcl's targets file, most likely we are compiling + # against an older version of Tcl and so must use our own support files. +diff --git a/win/rules.vc b/win/rules.vc +index cf80c9122..fe4a95dc9 100644 +--- a/win/rules.vc ++++ b/win/rules.vc +@@ -262,7 +262,7 @@ TCLINSTALL = 0 # Tk always builds against Tcl source, not an installed Tcl + !endif # TCLDIR == "" + + _TCLDIR = $(TCLDIR:/=\) +-_TCL_H = $(_TCLDIR)\generic\tcl.h ++_TCL_H = $(_TCLDIR)\include\tcl.h + !if !exist("$(_TCL_H)") + !error Could not locate tcl.h. Please set the TCLDIR macro to point to the Tcl *source* directory. + !endif +@@ -283,9 +283,9 @@ _TCLDIR = $(TCLDIR:/=\) + !if exist("$(_TCLDIR)\include\tcl.h") # Case 2(c) with TCLDIR defined + TCLINSTALL = 1 + _TCL_H = $(_TCLDIR)\include\tcl.h +-!elseif exist("$(_TCLDIR)\generic\tcl.h") # Case 2(d) with TCLDIR defined ++!elseif exist("$(_TCLDIR)\include\tcl.h") # Case 2(d) with TCLDIR defined + TCLINSTALL = 0 +-_TCL_H = $(_TCLDIR)\generic\tcl.h ++_TCL_H = $(_TCLDIR)\include\tcl.h + !endif + + !else # # Case 2(c) for extensions with TCLDIR undefined +@@ -311,7 +311,7 @@ _TCL_H = $(_TCLDIR)\include\tcl.h + !include nmakehlp.out + TCLINSTALL = 0 + TCLDIR = $(_TCLDIR) +-_TCL_H = $(_TCLDIR)\generic\tcl.h ++_TCL_H = $(_TCLDIR)\include\tcl.h + + !endif # exist(...) && ! $(NEED_TCL_SOURCE) + +@@ -619,7 +619,7 @@ OPTIMIZATIONS = $(OPTIMIZATIONS) -GS + # generated libraries only usable by the specific VC++ version that + # created it. Requires /LTCG linker option + !if [nmakehlp -c -GL] +-OPTIMIZATIONS = $(OPTIMIZATIONS) -GL ++ + CC_GL_OPT_ENABLED = 1 + !else + # In newer compilers -GL and -YX are incompatible. +@@ -1085,12 +1085,9 @@ STUBPREFIX = $(PROJECT)stub + + TCLSHNAME = $(PROJECT)sh$(VERSION)$(SUFX).exe + TCLSH = $(OUT_DIR)\$(TCLSHNAME) +-TCLIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib + TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) + TCLLIB = $(OUT_DIR)\$(TCLLIBNAME) + +-TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib +-TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME) + TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" + + !else # ! $(DOING_TCL) +@@ -1105,12 +1102,9 @@ TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe + TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX:t=).exe + !endif + +-TCLSTUBLIB = $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib +-TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:t=).lib + # When building extensions, may be linking against Tcl that does not add + # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. + !if !exist("$(TCLIMPLIB)") +-TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)t$(SUFX:t=).lib + !endif + TCL_LIBRARY = $(_TCLDIR)\lib + TCLREGLIB = $(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib +@@ -1124,18 +1118,15 @@ TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe + !if !exist($(TCLSH)) + TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX:t=).exe + !endif +-TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib +-TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:t=).lib + # When building extensions, may be linking against Tcl that does not add + # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. + !if !exist("$(TCLIMPLIB)") +-TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)t$(SUFX:t=).lib + !endif + TCL_LIBRARY = $(_TCLDIR)\library + TCLREGLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib + TCLDDELIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib + TCLTOOLSDIR = $(_TCLDIR)\tools +-TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" ++TCL_INCLUDES = -I"$(_TCLDIR)\include" -I"$(_TCLDIR)\win" + + !endif # TCLINSTALL + +@@ -1393,7 +1384,7 @@ carch = + + !if $(DEBUG) + # Turn warnings into errors +-cwarn = $(cwarn) -WX ++ + !endif + + INCLUDES = $(TCL_INCLUDES) $(TK_INCLUDES) $(PRJ_INCLUDES) +-- +2.40.0 + diff --git a/recipes/tk/all/patches/0003-Patch-tkConfig.sh.patch b/recipes/tk/all/patches/0003-Patch-tkConfig.sh.patch new file mode 100644 index 00000000000000..ecabe8916794b5 --- /dev/null +++ b/recipes/tk/all/patches/0003-Patch-tkConfig.sh.patch @@ -0,0 +1,89 @@ +Subject: [PATCH] Patch tkConfig.sh to remove TK_BUILD_ directories and + TK_SRC_DIR + +--- + unix/tkConfig.sh.in | 8 ++++---- + win/tkConfig.sh.in | 8 ++++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/unix/tkConfig.sh.in b/unix/tkConfig.sh.in +index bb85ad0a2..e564ec1f9 100644 +--- a/unix/tkConfig.sh.in ++++ b/unix/tkConfig.sh.in +@@ -53,7 +53,7 @@ TK_LIB_FLAG='@TK_LIB_FLAG@' + + # String to pass to linker to pick up the Tk library from its + # build directory. +-TK_BUILD_LIB_SPEC='@TK_BUILD_LIB_SPEC@' ++#TK_BUILD_LIB_SPEC='@TK_BUILD_LIB_SPEC@' + + # String to pass to linker to pick up the Tk library from its + # installed directory. +@@ -69,7 +69,7 @@ TK_INCLUDE_SPEC='@TK_INCLUDE_SPEC@' + # different place than the directory containing the source files, this + # points to the location of the sources, not the location where Tk was + # compiled. +-TK_SRC_DIR='@TK_SRC_DIR@' ++#TK_SRC_DIR='@TK_SRC_DIR@' + + # Needed if you want to make a 'fat' shared library library + # containing tk objects or link a different wish. +@@ -84,14 +84,14 @@ TK_STUB_LIB_FLAG='@TK_STUB_LIB_FLAG@' + + # String to pass to linker to pick up the Tk stub library from its + # build directory. +-TK_BUILD_STUB_LIB_SPEC='@TK_BUILD_STUB_LIB_SPEC@' ++#TK_BUILD_STUB_LIB_SPEC='@TK_BUILD_STUB_LIB_SPEC@' + + # String to pass to linker to pick up the Tk stub library from its + # installed directory. + TK_STUB_LIB_SPEC='@TK_STUB_LIB_SPEC@' + + # Path to the Tk stub library in the build directory. +-TK_BUILD_STUB_LIB_PATH='@TK_BUILD_STUB_LIB_PATH@' ++#TK_BUILD_STUB_LIB_PATH='@TK_BUILD_STUB_LIB_PATH@' + + # Path to the Tk stub library in the install directory. + TK_STUB_LIB_PATH='@TK_STUB_LIB_PATH@' +diff --git a/win/tkConfig.sh.in b/win/tkConfig.sh.in +index c511312f0..d5330b829 100644 +--- a/win/tkConfig.sh.in ++++ b/win/tkConfig.sh.in +@@ -47,7 +47,7 @@ TK_LIB_FLAG='@TK_LIB_FLAG@' + + # String to pass to linker to pick up the Tk library from its + # build directory. +-TK_BUILD_LIB_SPEC='@TK_BUILD_LIB_SPEC@' ++#TK_BUILD_LIB_SPEC='@TK_BUILD_LIB_SPEC@' + + # String to pass to linker to pick up the Tk library from its + # installed directory. +@@ -59,7 +59,7 @@ TK_LIB_SPEC='@TK_LIB_SPEC@' + # different place than the directory containing the source files, this + # points to the location of the sources, not the location where Tk was + # compiled. +-TK_SRC_DIR='@TK_SRC_DIR@' ++#TK_SRC_DIR='@TK_SRC_DIR@' + + # Needed if you want to make a 'fat' shared library library + # containing tk objects or link a different wish. +@@ -74,14 +74,14 @@ TK_STUB_LIB_FLAG='@TK_STUB_LIB_FLAG@' + + # String to pass to linker to pick up the Tk stub library from its + # build directory. +-TK_BUILD_STUB_LIB_SPEC='@TK_BUILD_STUB_LIB_SPEC@' ++#TK_BUILD_STUB_LIB_SPEC='@TK_BUILD_STUB_LIB_SPEC@' + + # String to pass to linker to pick up the Tk stub library from its + # installed directory. + TK_STUB_LIB_SPEC='@TK_STUB_LIB_SPEC@' + + # Path to the Tk stub library in the build directory. +-TK_BUILD_STUB_LIB_PATH='@TK_BUILD_STUB_LIB_PATH@' ++#TK_BUILD_STUB_LIB_PATH='@TK_BUILD_STUB_LIB_PATH@' + + # Path to the Tk stub library in the install directory. + TK_STUB_LIB_PATH='@TK_STUB_LIB_PATH@' +-- +2.40.0 + diff --git a/recipes/tk/all/test_package/CMakeLists.txt b/recipes/tk/all/test_package/CMakeLists.txt index 7672a2d37cdd95..5cec06aa08035b 100644 --- a/recipes/tk/all/test_package/CMakeLists.txt +++ b/recipes/tk/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(PackageTest C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_package(tk CONFIG REQUIRED) -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(example src/test_package.c) +target_link_libraries(example tk::tk) diff --git a/recipes/tk/all/test_package/conanfile.py b/recipes/tk/all/test_package/conanfile.py index a7a94271504b6b..91a8fc7a09b42a 100644 --- a/recipes/tk/all/test_package/conanfile.py +++ b/recipes/tk/all/test_package/conanfile.py @@ -1,17 +1,26 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run -class TclTestConan(ConanFile): + +class fooTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain" + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) cmake.configure() cmake.build() + def layout(self): + cmake_layout(self) + 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): + cmd = os.path.join(self.cpp.build.bindir, "example") + self.run(cmd, env="conanrun") diff --git a/recipes/tk/all/test_package/src/test_package.c b/recipes/tk/all/test_package/src/test_package.c new file mode 100644 index 00000000000000..9a62551dccab6f --- /dev/null +++ b/recipes/tk/all/test_package/src/test_package.c @@ -0,0 +1,24 @@ +#include +#include + +#include +#include + +int main (int argc ,char *argv[]) { + Tcl_FindExecutable(argv[0]); + Tcl_Interp *interp = Tcl_CreateInterp(); + if (Tcl_Init(interp) != TCL_OK) { + fprintf(stderr ,"Tcl_Init error: %s\n" ,Tcl_GetStringResult(interp)); + return EXIT_FAILURE; + } + + if (Tk_Init(interp) != TCL_OK) { + fprintf(stderr, "Tk_Init failed: %s\n", Tcl_GetStringResult(interp)); + fprintf(stderr, "But ignore it: there may not be a X server running.\n"); + return EXIT_SUCCESS; + } + + Tcl_Finalize(); + fprintf(stderr, "Test package success.\n"); + return EXIT_SUCCESS; +} diff --git a/recipes/tk/all/test_package/test_package.c b/recipes/tk/all/test_package/test_package.c deleted file mode 100644 index 601b2c8c2b4fc5..00000000000000 --- a/recipes/tk/all/test_package/test_package.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include - -#include -#include - -int main (int argc ,char *argv[]) { - Tcl_FindExecutable(argv[0]); - Tcl_Interp *interp = Tcl_CreateInterp(); - if (Tcl_Init(interp) != TCL_OK) { - fprintf(stderr ,"Tcl_Init error: %s\n" ,Tcl_GetStringResult(interp)); - return EXIT_FAILURE; - } - - if (Tk_Init(interp) != TCL_OK) { - fprintf(stderr, "Tk_Init failed: %s\n", Tcl_GetStringResult(interp)); - fprintf(stderr, "But ignore it: there may not be a X server running.\n"); - return EXIT_SUCCESS; - } - - Tcl_Finalize(); - return EXIT_SUCCESS; -} diff --git a/recipes/tk/all/test_v1_package/CMakeLists.txt b/recipes/tk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..0fe0f8ae90d2ea --- /dev/null +++ b/recipes/tk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} ../test_package/src/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/tk/all/test_v1_package/conanfile.py b/recipes/tk/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a7a94271504b6b --- /dev/null +++ b/recipes/tk/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TclTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "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", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tmx/all/conanfile.py b/recipes/tmx/all/conanfile.py index 5a3b3214bc42f6..532a780023daa0 100644 --- a/recipes/tmx/all/conanfile.py +++ b/recipes/tmx/all/conanfile.py @@ -52,11 +52,11 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.9.14") + self.requires("libxml2/2.11.4") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.5") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/tng/all/conanfile.py b/recipes/tng/all/conanfile.py index 4a409ba3da2e22..326cababad6b68 100644 --- a/recipes/tng/all/conanfile.py +++ b/recipes/tng/all/conanfile.py @@ -41,7 +41,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/tomlplusplus/all/conandata.yml b/recipes/tomlplusplus/all/conandata.yml index a459f949569ec9..63de1cac4b075c 100644 --- a/recipes/tomlplusplus/all/conandata.yml +++ b/recipes/tomlplusplus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.4.0": + url: "https://github.com/marzer/tomlplusplus/archive/v3.4.0.tar.gz" + sha256: "8517f65938a4faae9ccf8ebb36631a38c1cadfb5efa85d9a72e15b9e97d25155" "3.3.0": url: "https://github.com/marzer/tomlplusplus/archive/v3.3.0.tar.gz" sha256: "fc1a5eb410f3c67e90e5ad1264a1386d020067cfb01b633cc8c0441789aa6cf2" diff --git a/recipes/tomlplusplus/all/conanfile.py b/recipes/tomlplusplus/all/conanfile.py index 44f523638d7139..c7d9d9ea44bf50 100644 --- a/recipes/tomlplusplus/all/conanfile.py +++ b/recipes/tomlplusplus/all/conanfile.py @@ -1,10 +1,12 @@ +import os + from conan import ConanFile -from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.scm import Version from conan.tools.files import get, copy -from conan.errors import ConanInvalidConfiguration -import os +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version required_conan_version = ">=1.51.3" @@ -17,12 +19,13 @@ class TomlPlusPlusConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/marzer/tomlplusplus" license = "MIT" - settings = ("compiler", "arch", "os", "build_type") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _minimum_cpp_standard(self): - return 17 + def _min_cppstd(self): + return "17" @property def _minimum_compilers_version(self): @@ -34,29 +37,30 @@ def _minimum_compilers_version(self): "apple-clang": "10", } + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() def validate(self): - if self.info.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - compiler = f"{self.settings.compiler} {self.settings.compiler.version}" - if not min_version: - self.output.warn(f"{self.ref} recipe lacks information about the {self.settings.compiler} compiler support.") - else: - if Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration(f"{self.ref} requires c++{self._minimum_cpp_standard} support." - " The current compiler {compiler} does not support it.") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + 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." + ) if self.settings.compiler == "apple-clang" and Version(self.version) < "2.3.0": - raise ConanInvalidConfiguration(f"The compiler {compiler} is supported in version >= 2.3.0") + raise ConanInvalidConfiguration("apple-clang is not supported in versions < 2.3.0") if is_msvc(self) and Version(self.version) == "2.1.0": - raise ConanInvalidConfiguration(f"The current compiler {compiler} is unable to build version 2.1.0") + raise ConanInvalidConfiguration("msvc is unable to build version 2.1.0") 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 package(self): copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) @@ -65,10 +69,7 @@ def package(self): copy(self, pattern="toml.hpp", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) def package_info(self): - self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] - self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] - self.cpp_info.set_property("cmake_file_name", "tomlplusplus") self.cpp_info.set_property("cmake_target_name", "tomlplusplus::tomlplusplus") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/tomlplusplus/all/test_package/conanfile.py b/recipes/tomlplusplus/all/test_package/conanfile.py index db279683bd8ccd..57da1f7d0d18bc 100644 --- a/recipes/tomlplusplus/all/test_package/conanfile.py +++ b/recipes/tomlplusplus/all/test_package/conanfile.py @@ -1,36 +1,41 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, cmake_layout +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.scm import Version import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" + def layout(self): + cmake_layout(self) + def requirements(self): self.requires(self.tested_reference_str) + + @property + def _single_header_only(self): + return self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8" - def layout(self): - cmake_layout(self) + def generate(self): + tc = CMakeToolchain(self) + if self._single_header_only: + tc.variables["TOMLPP_BUILD_SINGLE_ONLY"] = True + tc.generate() def build(self): cmake = CMake(self) - if Version(self.deps_cpp_info["tomlplusplus"].version) < "1.3.0": - self.single_header_only = True - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": - self.single_header_only = True - variables = {"TOMLPP_BUILD_SINGLE_ONLY": True} if hasattr(self, "single_header_only") else None - cmake.configure(variables=variables) + cmake.configure() cmake.build() def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - conf_path = os.path.join(self.recipe_folder, "configuration.toml") + conf_path = os.path.join(self.source_folder, "configuration.toml") self.run(f"{bin_path} {conf_path}", env="conanrun") - if not hasattr(self, "single_header_only"): + if not self._single_header_only: bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_multi") self.run(f"{bin_path} {conf_path}", env="conanrun") diff --git a/recipes/tomlplusplus/all/test_v1_package/conanfile.py b/recipes/tomlplusplus/all/test_v1_package/conanfile.py index aba957cc3efa9d..0e8807dfd3ae47 100644 --- a/recipes/tomlplusplus/all/test_v1_package/conanfile.py +++ b/recipes/tomlplusplus/all/test_v1_package/conanfile.py @@ -10,8 +10,6 @@ class TestPackageConan(ConanFile): def build(self): cmake = CMake(self) - if Version(self.deps_cpp_info["tomlplusplus"].version) < "1.3.0": - self.single_header_only = True if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": self.single_header_only = True if hasattr(self, "single_header_only"): @@ -22,7 +20,7 @@ def build(self): def test(self): if not cross_building(self): bin_path = os.path.join("bin", "test_package") - conf_path = os.path.join(self.recipe_folder, "..", "test_package", "configuration.toml") + conf_path = os.path.join(self.source_folder, os.pardir, "test_package", "configuration.toml") self.run(f"{bin_path} {conf_path}", run_environment=True) if not hasattr(self, "single_header_only"): bin_path = os.path.join("bin", "test_package_multi") diff --git a/recipes/tomlplusplus/config.yml b/recipes/tomlplusplus/config.yml index 4cd7ca8687e684..0705075264b761 100644 --- a/recipes/tomlplusplus/config.yml +++ b/recipes/tomlplusplus/config.yml @@ -1,4 +1,6 @@ versions: + "3.4.0": + folder: all "3.3.0": folder: all "3.2.0": diff --git a/recipes/tracy/all/conandata.yml b/recipes/tracy/all/conandata.yml index e66204ae4d119f..de70002df8416a 100644 --- a/recipes/tracy/all/conandata.yml +++ b/recipes/tracy/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.10": + url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.10.tar.gz" + sha256: "a76017d928f3f2727540fb950edd3b736caa97b12dbb4e5edce66542cbea6600" "0.9.1": url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.9.1.tar.gz" sha256: "c2de9f35ab2a516a9689ff18f5b62a55b73b93b66514bd09ba013d7957993cd7" diff --git a/recipes/tracy/all/conanfile.py b/recipes/tracy/all/conanfile.py index bdb852b534295c..a056814ff01654 100644 --- a/recipes/tracy/all/conanfile.py +++ b/recipes/tracy/all/conanfile.py @@ -2,6 +2,7 @@ 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" @@ -25,7 +26,7 @@ class TracyConan(ConanFile): "no_callstack_inlines": ([True, False], False), "only_localhost": ([True, False], False), "no_broadcast": ([True, False], False), - "only_ipv": ([True, False], False), + "only_ipv4": ([True, False], False), "no_code_transfer": ([True, False], False), "no_context_switch": ([True, False], False), "no_exit": ([True, False], False), @@ -35,6 +36,10 @@ class TracyConan(ConanFile): "no_frame_image": ([True, False], False), "no_system_tracing": ([True, False], False), "delayed_init": ([True, False], False), + "manual_lifetime": ([True, False], False), + "fibers": ([True, False], False), + "no_crash_handler": ([True, False], False), + "timer_fallback": ([True, False], False), } options = { "shared": [True, False], @@ -51,6 +56,17 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "0.9": + self.options.rm_safe("manual_lifetime") + self.options.rm_safe("fibers") + self.options.rm_safe("no_crash_handler") + self.options.rm_safe("timer_fallback") + + del self._tracy_options["manual_lifetime"] + del self._tracy_options["fibers"] + del self._tracy_options["no_crash_handler"] + del self._tracy_options["timer_fallback"] + def configure(self): if self.options.shared: self.options.rm_safe("fPIC") diff --git a/recipes/tracy/config.yml b/recipes/tracy/config.yml index 6bea7d9080e333..7f42fe99a398a0 100644 --- a/recipes/tracy/config.yml +++ b/recipes/tracy/config.yml @@ -1,4 +1,6 @@ versions: + "0.10": + folder: all "0.9.1": folder: all "0.9": diff --git a/recipes/trantor/all/conandata.yml b/recipes/trantor/all/conandata.yml index 22a2a702c41db2..5d96de887257b0 100644 --- a/recipes/trantor/all/conandata.yml +++ b/recipes/trantor/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.5.15": + url: "https://github.com/an-tao/trantor/archive/v1.5.15.tar.gz" + sha256: "478d33bc2d48ef2511969c1024eeeee5cf0ef4eea6c65761d0a72b8b9b3004be" + "1.5.14": + url: "https://github.com/an-tao/trantor/archive/v1.5.14.tar.gz" + sha256: "80775d65fd49dfb0eb85d70cd9c0f0cff38a7f46c90db918862c46e03ae63810" + "1.5.13": + url: "https://github.com/an-tao/trantor/archive/v1.5.13.tar.gz" + sha256: "36f02302bff3ffa8d2b1bff29f451d7a11d215a43963fb95aa543b555de2f9bf" + "1.5.12": + url: "https://github.com/an-tao/trantor/archive/v1.5.12.tar.gz" + sha256: "3389a2ace83fdc0df7e3e7f9cd9fa9b774f8054889a13a73777c71e2d8e2f364" "1.5.11": url: "https://github.com/an-tao/trantor/archive/v1.5.11.tar.gz" sha256: "3cff9653380f65acaa6ffa191620a2783e866a4552c3408a6919759ce4cfc1dc" @@ -11,13 +23,23 @@ sources: "1.5.7": url: "https://github.com/an-tao/trantor/archive/v1.5.7.tar.gz" sha256: "42576563afbf1e58c7d68f758cf3fca4d193496d4e3f82c80069d8389a7839d5" - "1.5.6": - url: "https://github.com/an-tao/trantor/archive/v1.5.6.tar.gz" - sha256: "827aca30e120244a8ede9d07446481328d9a3869228f01fc4978b19301d66e65" - "1.5.5": - url: "https://github.com/an-tao/trantor/archive/refs/tags/v1.5.5.tar.gz" - sha256: "5a549c6efebe7ecba73a944cfba4a9713130704d4ccc82af534a2e108b9a0e71" patches: + "1.5.15": + - patch_file: "patches/1.5.15-0001-disable-werror.patch" + patch_description: "disable -Werror for gcc5" + patch_type: "portability" + "1.5.14": + - patch_file: "patches/1.5.12-0001-disable-werror.patch" + patch_description: "disable -Werror for gcc5" + patch_type: "portability" + "1.5.13": + - patch_file: "patches/1.5.12-0001-disable-werror.patch" + patch_description: "disable -Werror for gcc5" + patch_type: "portability" + "1.5.12": + - patch_file: "patches/1.5.12-0001-disable-werror.patch" + patch_description: "disable -Werror for gcc5" + patch_type: "portability" "1.5.11": - patch_file: "patches/1.5.6-0001-include-cstdint.patch" patch_description: "include cstdint for uint8_t, intmax_t" @@ -38,13 +60,3 @@ patches: patch_description: "include cstdint for uint8_t, intmax_t" patch_type: "portability" patch_source: "https://github.com/an-tao/trantor/commit/e8e3887435dcfb310263c588743be1b3746193be" - "1.5.6": - - patch_file: "patches/1.5.6-0001-include-cstdint.patch" - patch_description: "include cstdint for uint8_t, intmax_t" - patch_type: "portability" - patch_source: "https://github.com/an-tao/trantor/commit/e8e3887435dcfb310263c588743be1b3746193be" - "1.5.5": - - patch_file: "patches/1.5.5-0001-include-cstdint.patch" - patch_description: "include cstdint for uint8_t" - patch_type: "portability" - patch_source: "https://github.com/an-tao/trantor/commit/e8e3887435dcfb310263c588743be1b3746193be" diff --git a/recipes/trantor/all/conanfile.py b/recipes/trantor/all/conanfile.py index eae8498e374147..9deee06df4b9bd 100644 --- a/recipes/trantor/all/conanfile.py +++ b/recipes/trantor/all/conanfile.py @@ -5,29 +5,31 @@ 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" +required_conan_version = ">=1.54.0" class TrantorConan(ConanFile): name = "trantor" description = "a non-blocking I/O tcp network lib based on c++14/17" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/an-tao/trantor" topics = ("tcp-server", "asynchronous-programming", "non-blocking-io") - license = "BSD-3-Clause" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], "shared": [True, False], "with_c_ares": [True, False], + "with_spdlog": [True, False], } default_options = { "fPIC": True, "shared": False, "with_c_ares": True, + "with_spdlog": False, + "spdlog/*:header_only": True, } @property @@ -38,7 +40,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "gcc": "5", - "Visual Studio": "15.0", + "Visual Studio": "15", "msvc": "191", "clang": "5", "apple-clang": "10", @@ -50,6 +52,9 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "1.5.15": + del self.options.with_spdlog + del self.default_options["spdlog/*:header_only"] def configure(self): if self.options.shared: @@ -61,34 +66,37 @@ def layout(self): def requirements(self): self.requires("openssl/[>=1.1 <4]") if self.options.with_c_ares: - self.requires("c-ares/1.19.0") + self.requires("c-ares/1.22.0") + if self.options.get_safe("with_spdlog"): + self.requires("spdlog/1.12.0") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) - if minimum_version: - if Version(self.info.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") - else: - self.output.warn(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) # TODO: Compilation succeeds, but execution of test_package fails on Visual Studio with MDd if is_msvc(self) and self.options.shared and "MDd" in msvc_runtime_flag(self): raise ConanInvalidConfiguration(f"{self.ref} does not support the MDd runtime on Visual Studio.") + if self.options.get_safe("with_spdlog") and not self.dependencies["spdlog"].options.header_only: + raise ConanInvalidConfiguration(f"{self.ref} requires header_only spdlog.") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - if Version(self.version) < "1.5.6": - tc.variables["BUILD_TRANTOR_SHARED"] = self.options.shared - else: - # Trantor's CMakeLists.txt has BUILD_SHARED_LIBS option. - tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + # TODO: support other tls providers + if Version(self.version) >= "1.5.12": + tc.variables["TRANTOR_USE_TLS"] = "openssl" tc.variables["BUILD_C-ARES"] = self.options.with_c_ares + tc.variables["USE_SPDLOG"] = self.options.get_safe("with_spdlog") tc.generate() tc = CMakeDeps(self) diff --git a/recipes/trantor/all/patches/1.5.12-0001-disable-werror.patch b/recipes/trantor/all/patches/1.5.12-0001-disable-werror.patch new file mode 100644 index 00000000000000..ac4b2f2545dceb --- /dev/null +++ b/recipes/trantor/all/patches/1.5.12-0001-disable-werror.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 810c2c1..a4f375d 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,7 +46,7 @@ if(BUILD_SHARED_LIBS) + endif(BUILD_SHARED_LIBS) + + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND CMAKE_CXX_COMPILER_ID MATCHES Clang|GNU) +- target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror) ++ target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra) + endif() + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") diff --git a/recipes/trantor/all/patches/1.5.15-0001-disable-werror.patch b/recipes/trantor/all/patches/1.5.15-0001-disable-werror.patch new file mode 100644 index 00000000000000..bbeb7c91c05b7e --- /dev/null +++ b/recipes/trantor/all/patches/1.5.15-0001-disable-werror.patch @@ -0,0 +1,13 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 4ec5461..8ec652a 100755 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -55,7 +55,7 @@ if(MSVC AND MSVC_VERSION GREATER_EQUAL 1914) + endif(MSVC AND MSVC_VERSION GREATER_EQUAL 1914) + + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND CMAKE_CXX_COMPILER_ID MATCHES Clang|GNU) +- target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror) ++ target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra) + endif() + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") diff --git a/recipes/trantor/all/patches/1.5.5-0001-include-cstdint.patch b/recipes/trantor/all/patches/1.5.5-0001-include-cstdint.patch deleted file mode 100644 index 12c881a36cc342..00000000000000 --- a/recipes/trantor/all/patches/1.5.5-0001-include-cstdint.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/trantor/utils/MsgBuffer.h b/trantor/utils/MsgBuffer.h -index 19d42e2..adeeb1b 100644 ---- a/trantor/utils/MsgBuffer.h -+++ b/trantor/utils/MsgBuffer.h -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - #include - #include - #include diff --git a/recipes/trantor/config.yml b/recipes/trantor/config.yml index 57e22ce3a2fae2..dddf9970713ced 100644 --- a/recipes/trantor/config.yml +++ b/recipes/trantor/config.yml @@ -1,4 +1,12 @@ versions: + "1.5.15": + folder: "all" + "1.5.14": + folder: "all" + "1.5.13": + folder: "all" + "1.5.12": + folder: "all" "1.5.11": folder: "all" "1.5.10": @@ -7,7 +15,3 @@ versions: folder: "all" "1.5.7": folder: "all" - "1.5.6": - folder: "all" - "1.5.5": - folder: "all" diff --git a/recipes/tre/all/CMakeLists.txt b/recipes/tre/all/CMakeLists.txt new file mode 100644 index 00000000000000..cf9c37d17b6e1e --- /dev/null +++ b/recipes/tre/all/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required (VERSION 3.15) +project (tre) + +set(HEADERS + local_includes/regex.h + local_includes/tre.h + win32/tre-config.h +) +file(GLOB SRCS lib/*.c) + +include_directories(win32 local_includes) +add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS) +add_definitions(-DHAVE_CONFIG_H -DHAVE_MALLOC_H) +add_library(tre ${SRCS} win32/tre.def) + +install(TARGETS tre + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +install(FILES ${HEADERS} + DESTINATION include/tre +) diff --git a/recipes/tre/all/conandata.yml b/recipes/tre/all/conandata.yml new file mode 100644 index 00000000000000..683be30ad0edef --- /dev/null +++ b/recipes/tre/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230717": + url: "https://github.com/laurikari/tre/archive/07e66d07b44ae95a7a89f79c7ce1090f0f4d64db.tar.gz" + sha256: "f2390091a35c31e90efcce88006c2396f5698759f2f7abd136e771c3e0996961" diff --git a/recipes/tre/all/conanfile.py b/recipes/tre/all/conanfile.py new file mode 100644 index 00000000000000..a6886aa3b08d06 --- /dev/null +++ b/recipes/tre/all/conanfile.py @@ -0,0 +1,91 @@ +import os + +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain + +required_conan_version = ">=1.53.0" + + +class TreConan(ConanFile): + name = "tre" + description = "TRE is a lightweight, robust, and efficient POSIX-compliant regexp matching library with some exciting features such as approximate (fuzzy) matching." + license = "BSD-2-Clause" + homepage = "https://github.com/laurikari/tre" + url = "https://github.com/conan-io/conan-center-index" + topics = "regex", "fuzzy matching" + + 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): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + 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): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + if self.settings.os != "Windows": + self.tool_requires("gettext/0.21") + self.tool_requires("libtool/2.4.7") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + if self.settings.os == "Windows": + copy(self, "CMakeLists.txt", src=self.export_sources_folder, dst=self.source_folder) + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + else: + autotools = Autotools(self) + autotools.install() + 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")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "tre") + self.cpp_info.libs = ["tre"] diff --git a/recipes/tre/all/test_package/CMakeLists.txt b/recipes/tre/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..dff3b713e92cc1 --- /dev/null +++ b/recipes/tre/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(tre REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tre::tre) diff --git a/recipes/tre/all/test_package/conanfile.py b/recipes/tre/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/tre/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/tre/all/test_package/test_package.c b/recipes/tre/all/test_package/test_package.c new file mode 100644 index 00000000000000..605527c604de83 --- /dev/null +++ b/recipes/tre/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include "tre/tre.h" +#include + +int main() +{ + regex_t rx; + tre_regcomp(&rx, "(January|February)", REG_EXTENDED); + + regaparams_t params = {0}; + tre_regaparams_default(¶ms); + + regamatch_t match = {0}; + + if (!tre_regaexec(&rx, "Janvary", &match, params, 0)) { + printf("Levenshtein distance: %d\n", match.cost); + } else { + printf("Failed to match\n"); + } + + return 0; +} diff --git a/recipes/tre/config.yml b/recipes/tre/config.yml new file mode 100644 index 00000000000000..b32c668575dded --- /dev/null +++ b/recipes/tre/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230717": + folder: all diff --git a/recipes/tree-sitter-c/all/CMakeLists.txt b/recipes/tree-sitter-c/all/CMakeLists.txt index 2d76c83c9cbd42..a028ec4e4627cd 100644 --- a/recipes/tree-sitter-c/all/CMakeLists.txt +++ b/recipes/tree-sitter-c/all/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.0) project(tree-sitter-c C) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(tree-sitter REQUIRED CONFIG) include(GenerateExportHeader) @@ -12,11 +9,19 @@ file(WRITE api.h [[ #include #include "tree_sitter_c_export.h" -TREE_SITTER_C_EXPORT const TSLanguage *tree_sitter_c(void); +#ifdef __cplusplus +extern "C" { +#endif + +const TSLanguage *tree_sitter_c(void); + +#ifdef __cplusplus +} +#endif ]]) add_library(${PROJECT_NAME} - source_subfolder/src/parser.c + src/parser.c ) target_link_libraries(${PROJECT_NAME} PUBLIC @@ -24,8 +29,7 @@ target_link_libraries(${PROJECT_NAME} ) target_include_directories(${PROJECT_NAME} PRIVATE - $ - $ + $ ) set_target_properties(${PROJECT_NAME} PROPERTIES diff --git a/recipes/tree-sitter-c/all/conandata.yml b/recipes/tree-sitter-c/all/conandata.yml index fe7f5673971670..f225285a8fae5c 100644 --- a/recipes/tree-sitter-c/all/conandata.yml +++ b/recipes/tree-sitter-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.20.3": + url: "https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v0.20.3.tar.gz" + sha256: "8c72a765230324f2b64e9ed66e027daf1a2ed24dde5fbf21398ad8ff7fca2a2d" "0.20.2": url: "https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.2.tar.gz" sha256: "af66fde03feb0df4faf03750102a0d265b007e5d957057b6b293c13116a70af2" diff --git a/recipes/tree-sitter-c/all/conanfile.py b/recipes/tree-sitter-c/all/conanfile.py index 84ab13ea082134..9f73c2c805dcef 100644 --- a/recipes/tree-sitter-c/all/conanfile.py +++ b/recipes/tree-sitter-c/all/conanfile.py @@ -1,8 +1,9 @@ -from conans import CMake, ConanFile, tools -import functools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, replace_in_file, copy import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class TreeSitterCConan(ConanFile): @@ -13,21 +14,32 @@ class TreeSitterCConan(ConanFile): homepage = "https://github.com/tree-sitter/tree-sitter-c" license = "MIT" settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { - "fPIC": [True, False], "shared": [True, False], + "fPIC": [True, False], } default_options = { - "fPIC": True, "shared": False, + "fPIC": True, } - generators = "cmake", "cmake_find_package_multi" + exports_sources = "CMakeLists.txt" - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=(self.export_sources_folder + "/src")) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TREE_SITTER_C_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() def config_options(self): if self.settings.os == "Windows": @@ -35,38 +47,38 @@ 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("tree-sitter/0.20.0") + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") 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.configure() - return cmake + def requirements(self): + self.requires("tree-sitter/0.20.8", transitive_headers=True, transitive_libs=True) def _patch_sources(self): if not self.options.shared: - tools.replace_in_file( - os.path.join(self._source_subfolder, "src", "parser.c"), + replace_in_file( + self, + os.path.join(self.source_folder, "src", "parser.c"), "__declspec(dllexport)", "" ) def build(self): self._patch_sources() - 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() def package_info(self): diff --git a/recipes/tree-sitter-c/all/test_package/CMakeLists.txt b/recipes/tree-sitter-c/all/test_package/CMakeLists.txt index 48140fe26ab46d..177a777e8ddf7c 100644 --- a/recipes/tree-sitter-c/all/test_package/CMakeLists.txt +++ b/recipes/tree-sitter-c/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(tree-sitter-c REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/tree-sitter-c/all/test_package/conanfile.py b/recipes/tree-sitter-c/all/test_package/conanfile.py index 38f4483872d47f..fc47f4cefd6122 100644 --- a/recipes/tree-sitter-c/all/test_package/conanfile.py +++ b/recipes/tree-sitter-c/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "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) @@ -12,6 +22,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): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/tree-sitter-c/config.yml b/recipes/tree-sitter-c/config.yml index 8304408636b4bf..7070a273f171ac 100644 --- a/recipes/tree-sitter-c/config.yml +++ b/recipes/tree-sitter-c/config.yml @@ -1,4 +1,6 @@ versions: + "0.20.3": + folder: all "0.20.2": folder: all "0.20.1": diff --git a/recipes/troldal-zippy/all/conanfile.py b/recipes/troldal-zippy/all/conanfile.py index c1f661d53497de..999217a8ec5a52 100644 --- a/recipes/troldal-zippy/all/conanfile.py +++ b/recipes/troldal-zippy/all/conanfile.py @@ -4,6 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.layout import basic_layout from conan.tools.scm import Version @@ -29,7 +30,6 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): return { - "Visual Studio": "17", "gcc": "7", "clang": "6", "apple-clang": "10", @@ -42,7 +42,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("miniz/2.2.0") + self.requires("miniz/3.0.2") def package_id(self): self.info.clear() @@ -50,15 +50,18 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if not min_version: - self.output.warning(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") + if is_msvc(self): + check_min_vs(self, "192") else: - if Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration( - f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler" - f" {self.settings.compiler} {self.settings.compiler.version} does not support it." - ) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if not min_version: + self.output.warning(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") + else: + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler" + f" {self.settings.compiler} {self.settings.compiler.version} does not support it." + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/trompeloeil/all/conandata.yml b/recipes/trompeloeil/all/conandata.yml index bb27ac3c59d8a7..aa78e9ef74461b 100644 --- a/recipes/trompeloeil/all/conandata.yml +++ b/recipes/trompeloeil/all/conandata.yml @@ -1,4 +1,10 @@ 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" "43": url: "https://github.com/rollbear/trompeloeil/archive/v43.tar.gz" sha256: "86a0afa2e97347202a0a883ab43da78c1d4bfff0d6cb93205cfc433d0d9eb9eb" @@ -12,5 +18,5 @@ sources: url: "https://github.com/rollbear/trompeloeil/archive/v40.tar.gz" sha256: "e13e3649223a358a5a72fa5a8a1c36325b48e4f3d9d2f2277b17d746797e1734" "39": - url: https://github.com/rollbear/trompeloeil/archive/v39.tar.gz - sha256: 10506E48ABD605740BC9ED43E34059F5068BC80AF14476BD129A3ED3B54D522F + url: "https://github.com/rollbear/trompeloeil/archive/v39.tar.gz" + sha256: "10506E48ABD605740BC9ED43E34059F5068BC80AF14476BD129A3ED3B54D522F" diff --git a/recipes/trompeloeil/all/conanfile.py b/recipes/trompeloeil/all/conanfile.py index c2548bfe997b8b..e3776238f24cfe 100644 --- a/recipes/trompeloeil/all/conanfile.py +++ b/recipes/trompeloeil/all/conanfile.py @@ -1,22 +1,38 @@ 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 import os required_conan_version = ">=1.50.0" - class TrompeloeilConan(ConanFile): name = "trompeloeil" description = "Header only C++14 mocking framework" - topics = ("trompeloeil", "header-only", "mocking") - homepage = "https://github.com/rollbear/trompeloeil" - url = "https://github.com/conan-io/conan-center-index" license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rollbear/trompeloeil" + topics = ("header-only", "mocking") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "190", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } + def layout(self): basic_layout(self, src_folder="src") @@ -25,14 +41,15 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 14) + 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], - destination=self.source_folder, strip_root=True) - - def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "LICENSE*.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) @@ -43,4 +60,3 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "trompeloeil::trompeloeil") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/trompeloeil/config.yml b/recipes/trompeloeil/config.yml index 26645b05ba8da8..4cd5ba1f148f2a 100644 --- a/recipes/trompeloeil/config.yml +++ b/recipes/trompeloeil/config.yml @@ -1,4 +1,8 @@ versions: + "46": + folder: all + "45": + folder: all "43": folder: all "42": diff --git a/recipes/tscns/all/conanfile.py b/recipes/tscns/all/conanfile.py index f9a1b573dbe33f..c1b715cc277477 100644 --- a/recipes/tscns/all/conanfile.py +++ b/recipes/tscns/all/conanfile.py @@ -1,13 +1,14 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.layout import basic_layout -import os - required_conan_version = ">=1.52.0" + class TscnsConan(ConanFile): name = "tscns" description = "A low overhead nanosecond clock based on x86 TSC" @@ -15,6 +16,7 @@ class TscnsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/MengRao/tscns/" topics = ("timestamp", "x86_64", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @property @@ -37,7 +39,7 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) 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/tscns/all/test_v1_package/CMakeLists.txt b/recipes/tscns/all/test_v1_package/CMakeLists.txt index eebfbab4ba7b5f..0d20897301b68b 100644 --- a/recipes/tscns/all/test_v1_package/CMakeLists.txt +++ b/recipes/tscns/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(tscns REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tscns::tscns) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) 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/tsl-array-hash/all/conanfile.py b/recipes/tsl-array-hash/all/conanfile.py index 8c6297fe626729..4e37fe94c16996 100644 --- a/recipes/tsl-array-hash/all/conanfile.py +++ b/recipes/tsl-array-hash/all/conanfile.py @@ -14,6 +14,7 @@ class TslArrayHashConan(ConanFile): topics = ("string", "structure", "hash map", "hash set") homepage = "https://github.com/Tessil/array-hash" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,8 +29,7 @@ def validate(self): check_min_cppstd(self, 11) 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 @@ -43,7 +43,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tsl::array_hash") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-array-hash" @@ -55,4 +54,3 @@ def package_info(self): self.cpp_info.components["array_hash"].set_property("cmake_target_name", "tsl::array_hash") self.cpp_info.components["array_hash"].bindirs = [] self.cpp_info.components["array_hash"].libdirs = [] - self.cpp_info.components["array_hash"].resdirs = [] diff --git a/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt b/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt index 15d716d7a95051..0d20897301b68b 100644 --- a/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt +++ b/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(tsl-array-hash REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tsl::array_hash) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tsl-hat-trie/all/conanfile.py b/recipes/tsl-hat-trie/all/conanfile.py index fbce5d32f1f2b5..0c2749d1da56d7 100644 --- a/recipes/tsl-hat-trie/all/conanfile.py +++ b/recipes/tsl-hat-trie/all/conanfile.py @@ -14,7 +14,7 @@ class TslHatTrieConan(ConanFile): topics = ("string", "trie", "structure", "hash map", "hash set") homepage = "https://github.com/Tessil/hat-trie" url = "https://github.com/conan-io/conan-center-index" - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" def layout(self): @@ -31,8 +31,7 @@ def validate(self): check_min_cppstd(self, 11) 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): rmdir(self, os.path.join(self.source_folder, "include", "tsl", "array-hash")) @@ -48,7 +47,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tsl::hat_trie") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-hat-trie" @@ -61,4 +59,3 @@ def package_info(self): self.cpp_info.components["hat_trie"].set_property("cmake_target_name", "tsl::hat_trie") self.cpp_info.components["hat_trie"].bindirs = [] self.cpp_info.components["hat_trie"].libdirs = [] - self.cpp_info.components["hat_trie"].resdirs = [] diff --git a/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt b/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt index 6a1b5a8c7df69f..0d20897301b68b 100644 --- a/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt +++ b/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(tsl-hat-trie REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hat_trie) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tsl-ordered-map/all/conanfile.py b/recipes/tsl-ordered-map/all/conanfile.py index d13b78edda1474..9883b71a12ac38 100644 --- a/recipes/tsl-ordered-map/all/conanfile.py +++ b/recipes/tsl-ordered-map/all/conanfile.py @@ -14,6 +14,7 @@ class TslOrderedMapConan(ConanFile): topics = ("ordered-map", "structure", "hash map", "hash set") homepage = "https://github.com/Tessil/ordered-map" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,8 +29,7 @@ def validate(self): check_min_cppstd(self, 11) 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 @@ -43,7 +43,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tsl::ordered_map") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-ordered-map" @@ -55,4 +54,3 @@ def package_info(self): self.cpp_info.components["ordered_map"].set_property("cmake_target_name", "tsl::ordered_map") self.cpp_info.components["ordered_map"].bindirs = [] self.cpp_info.components["ordered_map"].libdirs = [] - self.cpp_info.components["ordered_map"].resdirs = [] diff --git a/recipes/tsl-robin-map/all/conanfile.py b/recipes/tsl-robin-map/all/conanfile.py index 60cfac70c1a0d9..14ac380eaf6917 100644 --- a/recipes/tsl-robin-map/all/conanfile.py +++ b/recipes/tsl-robin-map/all/conanfile.py @@ -14,6 +14,7 @@ class TslRobinMapConan(ConanFile): topics = ("robin-map", "structure", "hash map", "hash set") homepage = "https://github.com/Tessil/robin-map" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,8 +29,7 @@ def validate(self): check_min_cppstd(self, 11) 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 @@ -43,7 +43,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tsl::robin_map") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-robin-map" @@ -55,4 +54,3 @@ def package_info(self): self.cpp_info.components["robin_map"].set_property("cmake_target_name", "tsl::robin_map") self.cpp_info.components["robin_map"].bindirs = [] self.cpp_info.components["robin_map"].libdirs = [] - self.cpp_info.components["robin_map"].resdirs = [] diff --git a/recipes/tsl-sparse-map/all/conanfile.py b/recipes/tsl-sparse-map/all/conanfile.py index 4168882cba1a35..9afa37e182a6bf 100644 --- a/recipes/tsl-sparse-map/all/conanfile.py +++ b/recipes/tsl-sparse-map/all/conanfile.py @@ -14,6 +14,7 @@ class TslSparseMapConan(ConanFile): topics = ("sparse-map", "structure", "hash map", "hash set") homepage = "https://github.com/Tessil/sparse-map" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,8 +29,7 @@ def validate(self): check_min_cppstd(self, 11) 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 @@ -43,7 +43,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tsl::sparse_map") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-sparse-map" @@ -55,4 +54,3 @@ def package_info(self): self.cpp_info.components["sparse_map"].set_property("cmake_target_name", "tsl::sparse_map") self.cpp_info.components["sparse_map"].bindirs = [] self.cpp_info.components["sparse_map"].libdirs = [] - self.cpp_info.components["sparse_map"].resdirs = [] diff --git a/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt index 3e681dedd0cd45..0d20897301b68b 100644 --- a/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt +++ b/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(tsl-sparse-map REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tsl::sparse_map) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/tuplet/all/conanfile.py b/recipes/tuplet/all/conanfile.py index e4ef08ece551c8..b8e4521ac33191 100644 --- a/recipes/tuplet/all/conanfile.py +++ b/recipes/tuplet/all/conanfile.py @@ -16,6 +16,7 @@ class TupletConan(ConanFile): homepage = "https://github.com/codeinred/tuplet" description = "A fast, simple tuple implementation that implements tuple as an aggregate" topics = ("tuple", "trivially-copyable", "modern-cpp") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -41,6 +42,9 @@ def _compilers_minimum_version(self): "apple-clang": "12" } + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -62,12 +66,8 @@ def loose_lt_semver(v1, v2): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd} which your compiler ({compiler}-{version}) does not support") - def layout(self): - basic_layout(self, src_folder="src") - 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 diff --git a/recipes/turtle/all/conanfile.py b/recipes/turtle/all/conanfile.py index a032a9c58db934..1f12c41eb77c7b 100644 --- a/recipes/turtle/all/conanfile.py +++ b/recipes/turtle/all/conanfile.py @@ -25,6 +25,10 @@ def requirements(self): def package_id(self): self.info.clear() + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/tweetnacl/all/CMakeLists.txt b/recipes/tweetnacl/all/CMakeLists.txt index 971f0647720b11..b90e7d4a682db8 100644 --- a/recipes/tweetnacl/all/CMakeLists.txt +++ b/recipes/tweetnacl/all/CMakeLists.txt @@ -1,17 +1,10 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.12) project(tweetnacl C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -include(GNUInstallDirs) - add_library(tweetnacl tweetnacl.c) set_target_properties(tweetnacl PROPERTIES PUBLIC_HEADER "tweetnacl.h") +include(GNUInstallDirs) install(TARGETS tweetnacl - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) diff --git a/recipes/tweetnacl/all/conandata.yml b/recipes/tweetnacl/all/conandata.yml index 3dcc47bfef437f..a3fbddf32a9135 100644 --- a/recipes/tweetnacl/all/conandata.yml +++ b/recipes/tweetnacl/all/conandata.yml @@ -1,8 +1,6 @@ sources: "20140427": - url: https://tweetnacl.cr.yp.to/20140427/tweetnacl.c - sha256: 02e65bc3013ff2168983365e55906bc783c4c7e0a60d8100f17bb303a17175c4 + sha256: "02e65bc3013ff2168983365e55906bc783c4c7e0a60d8100f17bb303a17175c4" - url: https://tweetnacl.cr.yp.to/20140427/tweetnacl.h - sha256: 43f29ad721d9927b747b0100ab4160c119e7bb180c7c98a66e4bf79d31244287 - - url: https://unlicense.org/UNLICENSE - sha256: 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c + sha256: "43f29ad721d9927b747b0100ab4160c119e7bb180c7c98a66e4bf79d31244287" diff --git a/recipes/tweetnacl/all/conanfile.py b/recipes/tweetnacl/all/conanfile.py index b5b3d196ced3ec..0c97672dae4cc7 100644 --- a/recipes/tweetnacl/all/conanfile.py +++ b/recipes/tweetnacl/all/conanfile.py @@ -1,19 +1,24 @@ -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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, download, save + +required_conan_version = ">=1.53.0" class TweetnaclConan(ConanFile): name = "tweetnacl" - license = "Unlicense" - homepage = "https://tweetnacl.cr.yp.to" - url = "https://github.com/conan-io/conan-center-index" description = "TweetNaCl is the world's first auditable high-security cryptographic library" - topics = ("nacl", "tweetnacl", "encryption", "signature", "hashing") - exports_sources = "CMakeLists.txt" - generators = "cmake" + license = "Public domain" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tweetnacl.cr.yp.to" + topics = ("nacl", "encryption", "signature", "hashing") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,44 +27,53 @@ class TweetnaclConan(ConanFile): "shared": False, "fPIC": True, } - settings = "os", "compiler", "build_type", "arch" - _cmake = None + def export_sources(self): + copy(self, "CMakeLists.txt", + src=self.recipe_folder, + dst=os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC 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") 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.os in ("Windows", "Macos"): + if self.settings.os == "Windows" or is_apple_os(self): if self.options.shared: - raise ConanInvalidConfiguration("tweetnacl does not support shared on Windows and Madcos: it needs a randombytes implementation") + raise ConanInvalidConfiguration( + "tweetnacl does not support shared on Windows and Macos: it needs a randombytes implementation" + ) def source(self): for url_sha in self.conan_data["sources"][self.version]: - tools.download(url_sha["url"], os.path.basename(url_sha["url"])) - tools.check_sha256(os.path.basename(url_sha["url"]), url_sha["sha256"]) + download(self, **url_sha, filename=os.path.basename(url_sha["url"])) + + 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() - 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("UNLICENSE", dst=os.path.join(self.package_folder, "licenses")) - cmake = self._configure_cmake() + save(self, + os.path.join(self.package_folder, "licenses", "LICENSE"), + "TweetNaCl is a self-contained public-domain C library.") + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/tweetnacl/all/test_package/CMakeLists.txt b/recipes/tweetnacl/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..ff98951f060d9f 100644 --- a/recipes/tweetnacl/all/test_package/CMakeLists.txt +++ b/recipes/tweetnacl/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(tweetnacl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE tweetnacl::tweetnacl) diff --git a/recipes/tweetnacl/all/test_package/conanfile.py b/recipes/tweetnacl/all/test_package/conanfile.py index bd7165a553cf41..ef5d7042163ecc 100644 --- a/recipes/tweetnacl/all/test_package/conanfile.py +++ b/recipes/tweetnacl/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" + 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/tweetnacl/all/test_v1_package/CMakeLists.txt b/recipes/tweetnacl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/tweetnacl/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/tweetnacl/all/test_v1_package/conanfile.py b/recipes/tweetnacl/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7e2dfe859bb27b --- /dev/null +++ b/recipes/tweetnacl/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/twitch-native-ipc/all/CMakeLists.txt b/recipes/twitch-native-ipc/all/CMakeLists.txt deleted file mode 100644 index 3f96a3374441cc..00000000000000 --- a/recipes/twitch-native-ipc/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/twitch-native-ipc/all/conandata.yml b/recipes/twitch-native-ipc/all/conandata.yml index 4ddda5e545311f..0ca341563c80b5 100644 --- a/recipes/twitch-native-ipc/all/conandata.yml +++ b/recipes/twitch-native-ipc/all/conandata.yml @@ -5,8 +5,5 @@ sources: patches: "3.1.1": - patch_file: "patches/cmake-fixes.patch" - base_path: "source_subfolder" - patch_file: "patches/linux-build-fixes.patch" - base_path: "source_subfolder" - patch_file: "patches/export-fixes.patch" - base_path: "source_subfolder" diff --git a/recipes/twitch-native-ipc/all/conanfile.py b/recipes/twitch-native-ipc/all/conanfile.py index 9e025ba63f9933..3f478da041a705 100644 --- a/recipes/twitch-native-ipc/all/conanfile.py +++ b/recipes/twitch-native-ipc/all/conanfile.py @@ -1,31 +1,38 @@ -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 +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + class TwitchNativeIpcConan(ConanFile): name = "twitch-native-ipc" + description = "Twitch native IPC library" license = "MIT" - homepage = "https://github.com/twitchtv/twitch-native-ipc" url = "https://github.com/conan-io/conan-center-index" - description = "Twitch natve ipc library" + homepage = "https://github.com/twitchtv/twitch-native-ipc" topics = ("twitch", "ipc") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "cmake" - exports = ["CMakeLists.txt", "patches/**"] - requires = "libuv/1.40.0" - - _cmake = None - @property - def _source_subfolder(self): - return "source_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 _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return "17" @property def _compilers_min_version(self): @@ -33,63 +40,69 @@ 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.settings.compiler.cppstd: - tools.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("twitch-native-ipc requires C++17") - else: - self.output.warn("unknown compiler, assuming C++17 support") - if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) + def layout(self): + cmake_layout(self, src_folder="src") - 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 + def requirements(self): + self.requires("libuv/1.46.0") - if self.settings.os == "Windows": - self._cmake.definitions["MSVC_DYNAMIC_RUNTIME"] = self.settings.compiler.runtime in ("MD", "MDd") + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_min_version.get(str(self.settings.compiler)) + 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." + ) - 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["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.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 = ["nativeipc"] if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines = ["NATIVEIPC_IMPORT"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] - 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/twitch-native-ipc/all/patches/cmake-fixes.patch b/recipes/twitch-native-ipc/all/patches/cmake-fixes.patch index e9ef8141281a0d..0b516bd88e5393 100644 --- a/recipes/twitch-native-ipc/all/patches/cmake-fixes.patch +++ b/recipes/twitch-native-ipc/all/patches/cmake-fixes.patch @@ -9,26 +9,30 @@ index 491ae46..c0a4f3d 100644 include(setup) project(nativeipc) -diff --git a/cmakeUtils/conanutils.cmake b/cmakeUtils/conanutils.cmake -index cc6c07c..cbf0cd6 100644 ---- a/cmakeUtils/conanutils.cmake -+++ b/cmakeUtils/conanutils.cmake -@@ -59,7 +59,8 @@ macro(run_conan) - set(_keeprpath "KEEP_RPATHS") - endif() - -- conan_cmake_run(CONANFILE conan/conanfile.py -+ if(NOT CONAN_EXPORTED) -+ conan_cmake_run(CONANFILE conan/conanfile.py - BASIC_SETUP - CMAKE_TARGETS - NO_OUTPUT_DIRS -@@ -71,4 +72,5 @@ macro(run_conan) - RELWITHDEBINFO_PROFILE ${_profile} - ENV "CONAN_CMAKE_BINARY_DIR_PATH=${CMAKE_BINARY_DIR}" - ) -+ endif() - endmacro() +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/cmakeUtils/unix.cmake b/cmakeUtils/unix.cmake index 5f4bb4c..9b2856a 100644 --- a/cmakeUtils/unix.cmake @@ -46,7 +50,18 @@ diff --git a/libnativeipc/CMakeLists.txt b/libnativeipc/CMakeLists.txt index fe5cc30..173a156 100644 --- a/libnativeipc/CMakeLists.txt +++ b/libnativeipc/CMakeLists.txt -@@ -81,7 +81,9 @@ if(MSVC) +@@ -59,8 +59,9 @@ + include/nativeipc + ) + ++find_package(libuv REQUIRED CONFIG) + target_link_libraries(nativeipc PRIVATE +- CONAN_PKG::libuv) ++ uv) + + target_compile_definitions(nativeipc PRIVATE) + +@@ -81,7 +82,9 @@ endif() install(TARGETS nativeipc diff --git a/recipes/twitch-native-ipc/all/patches/linux-build-fixes.patch b/recipes/twitch-native-ipc/all/patches/linux-build-fixes.patch index d62079e114cc88..6ce9e9cc4ff9bf 100644 --- a/recipes/twitch-native-ipc/all/patches/linux-build-fixes.patch +++ b/recipes/twitch-native-ipc/all/patches/linux-build-fixes.patch @@ -83,3 +83,15 @@ index 40154b7..9772073 100644 ); #if DO_EXPLICIT_CHECKS +diff --git a/tests/UVServerTransport.h b/libnativeipc/src/UVServerTransport.h +index 40154b7..9772073 100644 +--- a/libnativeipc/src/UVServerTransport.h ++++ b/libnativeipc/src/UVServerTransport.h +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + + namespace Twitch::IPC { + class UVServerTransport diff --git a/recipes/twitch-native-ipc/all/test_package/CMakeLists.txt b/recipes/twitch-native-ipc/all/test_package/CMakeLists.txt index 667b93ec41536f..9e540f91ccbcd6 100644 --- a/recipes/twitch-native-ipc/all/test_package/CMakeLists.txt +++ b/recipes/twitch-native-ipc/all/test_package/CMakeLists.txt @@ -1,12 +1,11 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) +find_package(twitch-native-ipc REQUIRED CONFIG) add_executable(example example.c) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example twitch-native-ipc::twitch-native-ipc) add_executable(example2 example2.cpp) -target_link_libraries(example2 ${CONAN_LIBS}) +target_link_libraries(example2 twitch-native-ipc::twitch-native-ipc) target_compile_features(example2 PRIVATE cxx_std_17) diff --git a/recipes/twitch-native-ipc/all/test_package/conanfile.py b/recipes/twitch-native-ipc/all/test_package/conanfile.py index d9dd1034a82725..673b6b659b1666 100644 --- a/recipes/twitch-native-ipc/all/test_package/conanfile.py +++ b/recipes/twitch-native-ipc/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,6 +21,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "example"), run_environment=True) - self.run(os.path.join("bin", "example2"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "example") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "example2") + self.run(bin_path, env="conanrun") diff --git a/recipes/twitch-native-ipc/all/test_package/example.c b/recipes/twitch-native-ipc/all/test_package/example.c index 5ba8bef81f80ec..8d7d208570a6e5 100644 --- a/recipes/twitch-native-ipc/all/test_package/example.c +++ b/recipes/twitch-native-ipc/all/test_package/example.c @@ -1,19 +1,17 @@ +#include + #include #include -#include int main() { void *server = Twitch_IPC_ConnectionCreateServer("test"); void *client = Twitch_IPC_ConnectionCreateClient("test"); - if(server && client) - { + if (server && client) { printf("success\n"); Twitch_IPC_ConnectionDestroy(server); Twitch_IPC_ConnectionDestroy(client); - } - else - { + } else { abort(); } } diff --git a/recipes/twitch-native-ipc/all/test_package/example2.cpp b/recipes/twitch-native-ipc/all/test_package/example2.cpp index 42a57ddd919136..e2e24904356299 100644 --- a/recipes/twitch-native-ipc/all/test_package/example2.cpp +++ b/recipes/twitch-native-ipc/all/test_package/example2.cpp @@ -1,12 +1,13 @@ -#include #include +#include + int main() { using namespace Twitch::IPC; auto server = ConnectionFactory::newServerConnection("test"); auto client = ConnectionFactory::newClientConnection("test"); - if(server && client) { + if (server && client) { std::cout << "success\n"; server.reset(); client.reset(); diff --git a/recipes/twitch-native-ipc/all/test_v1_package/CMakeLists.txt b/recipes/twitch-native-ipc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/twitch-native-ipc/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/twitch-native-ipc/all/test_v1_package/conanfile.py b/recipes/twitch-native-ipc/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..bbac244c5a058a --- /dev/null +++ b/recipes/twitch-native-ipc/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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) + self.run(os.path.join("bin", "example2"), run_environment=True) 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/uchardet/all/CMakeLists.txt b/recipes/uchardet/all/CMakeLists.txt deleted file mode 100644 index a17cdee90b0356..00000000000000 --- a/recipes/uchardet/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_RPATH) - -add_subdirectory("source_subfolder") diff --git a/recipes/uchardet/all/conanfile.py b/recipes/uchardet/all/conanfile.py index bb92e982496c40..dc6c7c2cfb3273 100644 --- a/recipes/uchardet/all/conanfile.py +++ b/recipes/uchardet/all/conanfile.py @@ -1,18 +1,27 @@ -from conans import ConanFile, CMake, tools import os -import functools -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir + +required_conan_version = ">=1.53.0" class UchardetConan(ConanFile): name = "uchardet" + description = ( + "uchardet is an encoding detector library, which takes a " + "sequence of bytes in an unknown character encoding and " + "attempts to determine the encoding of the text. " + "Returned encoding names are iconv-compatible." + ) + license = "MPL-1.1" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/freedesktop/uchardet" - description = "uchardet is an encoding detector library, which takes a sequence of bytes in an unknown character encoding and attempts to determine the encoding of the text. Returned encoding names are iconv-compatible." - topics = "encoding", "detector" - license = "MPL-1.1" + topics = ("encoding", "detector") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,79 +34,75 @@ class UchardetConan(ConanFile): "check_sse2": True, } - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def config_options(self): if self._settings_build not in ("x86", "x86_64"): - del self.options.check_sse2 + self.options.rm_safe("check_sse2") 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 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["CHECK_SSE2"] = self.options.get_safe("check_sse2", False) + tc.variables["BUILD_BINARY"] = False + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.generate() def _patch_sources(self): # the following fixes that apply to uchardet version 0.0.7 # fix broken cmake - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), "${CMAKE_BINARY_DIR}", - "${CMAKE_CURRENT_BINARY_DIR}") + "${CMAKE_CURRENT_BINARY_DIR}", + ) # fix problem with mac os - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - 'string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} TARGET_ARCHITECTURE)', - 'string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" TARGET_ARCHITECTURE)') + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} TARGET_ARCHITECTURE)", + 'string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" TARGET_ARCHITECTURE)', + ) # disable building tests - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(test)", - "#add_subdirectory(test)") - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["CHECK_SSE2"] = self.options.get_safe("check_sse2", False) - cmake.definitions["BUILD_BINARY"] = False - cmake.definitions["BUILD_STATIC"] = False # disable building static libraries when self.options.shared is True - cmake.configure(build_folder=self._build_subfolder) - return cmake + "#add_subdirectory(test)", + ) def build(self): self._patch_sources() - cmake = self._configure_cmake() + 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", "pkgconfig")) - tools.rmdir(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, "share")) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "uchardet") - self.cpp_info.set_property("cmake_target_name", "uchardet") self.cpp_info.set_property("pkg_config_name", "libuchardet") - - self.cpp_info.names["cmake_find_package"] = "uchardet" - self.cpp_info.names["cmake_find_package_multi"] = "uchardet" - self.cpp_info.names["pkgconfig"] = "libuchardet" self.cpp_info.libs = ["uchardet"] if self.options.shared: self.cpp_info.defines.append("UCHARDET_SHARED") diff --git a/recipes/uchardet/all/test_package/CMakeLists.txt b/recipes/uchardet/all/test_package/CMakeLists.txt index a726e6f66a3bd2..6dbcda3f32f3ca 100644 --- a/recipes/uchardet/all/test_package/CMakeLists.txt +++ b/recipes/uchardet/all/test_package/CMakeLists.txt @@ -1,12 +1,10 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(uchardet REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/uchardet/all/test_package/conanfile.py b/recipes/uchardet/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/uchardet/all/test_package/conanfile.py +++ b/recipes/uchardet/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/uchardet/all/test_v1_package/CMakeLists.txt b/recipes/uchardet/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/uchardet/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/uchardet/all/test_v1_package/conanfile.py b/recipes/uchardet/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..38f4483872d47f --- /dev/null +++ b/recipes/uchardet/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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) diff --git a/recipes/ulfius/all/conanfile.py b/recipes/ulfius/all/conanfile.py index 675ce5de0ba1ef..cfafd90c8a6003 100644 --- a/recipes/ulfius/all/conanfile.py +++ b/recipes/ulfius/all/conanfile.py @@ -6,7 +6,7 @@ import os import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class UlfiusConan(ConanFile): @@ -16,6 +16,8 @@ class UlfiusConan(ConanFile): topics = ("web", "http", "rest", "endpoint", "json", "websocket") license = "LGPL-2.1-or-later" url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -49,28 +51,19 @@ def validate(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 requirements(self): - self.requires("orcania/2.3.1") - self.requires("libmicrohttpd/0.9.75") + self.requires("orcania/2.3.1", transitive_headers=True) + self.requires("libmicrohttpd/0.9.75", transitive_headers=True) if self.options.with_yder: - self.requires("yder/1.4.18") + self.requires("yder/1.4.18", transitive_headers=True) if self.options.with_jansson: - self.requires("jansson/2.14") + self.requires("jansson/2.14", transitive_headers=True) if self.options.with_libcurl: - self.requires("libcurl/7.85.0") + self.requires("libcurl/[>=7.78.0 <9]") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/uncrustify/all/conandata.yml b/recipes/uncrustify/all/conandata.yml index 22c525b3881bdf..994dd9df8f5c3f 100644 --- a/recipes/uncrustify/all/conandata.yml +++ b/recipes/uncrustify/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.78.0": + url: "https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.78.0.tar.gz" + sha256: "377efec187c26c7ad77900d94032fa51b029831c69442d607a6e53ef2115928f" + "0.77.1": + url: "https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.77.1.tar.gz" + sha256: "414bbc9f7860eb18a53074f9af14ed04638a633b2216a73f2629291300d37c1b" "0.75.1": url: "https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.75.1.tar.gz" sha256: "fd14acc0a31ed88b33137bdc26d32964327488c835f885696473ef07caf2e182" diff --git a/recipes/uncrustify/all/conanfile.py b/recipes/uncrustify/all/conanfile.py index da8a4d29e3f0e3..0c905f0cb5c350 100644 --- a/recipes/uncrustify/all/conanfile.py +++ b/recipes/uncrustify/all/conanfile.py @@ -16,6 +16,7 @@ class UncrustifyConan(ConanFile): topics = "beautifier", "command-line" homepage = "https://github.com/uncrustify/uncrustify" url = "https://github.com/conan-io/conan-center-index" + package_type = "application" settings = "os", "arch", "compiler", "build_type" def layout(self): @@ -29,8 +30,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=7") 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) @@ -65,9 +65,6 @@ def package(self): def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 - binpath = os.path.join(self.package_folder, "bin") - self.output.info(f"Adding to PATH: {binpath}") - self.env_info.PATH.append(binpath) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/uncrustify/all/test_package/conanfile.py b/recipes/uncrustify/all/test_package/conanfile.py index ca7e7aabaf2bf1..71b7668f5e09dd 100644 --- a/recipes/uncrustify/all/test_package/conanfile.py +++ b/recipes/uncrustify/all/test_package/conanfile.py @@ -1,15 +1,13 @@ from conan import ConanFile -from conan.tools.build import can_run class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "VirtualRunEnv" + generators = "VirtualBuildEnv" test_type = "explicit" - def requirements(self): - self.requires(self.tested_reference_str) + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - if can_run(self): - self.run("uncrustify --version", env="conanrun") + self.run("uncrustify --version") diff --git a/recipes/uncrustify/config.yml b/recipes/uncrustify/config.yml index 27d29acb917407..67d12c21bb4ac1 100644 --- a/recipes/uncrustify/config.yml +++ b/recipes/uncrustify/config.yml @@ -1,4 +1,8 @@ versions: + "0.78.0": + folder: all + "0.77.1": + folder: all "0.75.1": folder: all "0.74.0": diff --git a/recipes/uni-algo/all/conandata.yml b/recipes/uni-algo/all/conandata.yml index 506f983a8dd2c5..0aedc7a70319b1 100644 --- a/recipes/uni-algo/all/conandata.yml +++ b/recipes/uni-algo/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/uni-algo/uni-algo/archive/v1.1.0.tar.gz" + sha256: "f9aa30df9766fbbc7007b206c6db122313194e75b159dc222cddce016372d2de" "1.0.0": url: "https://github.com/uni-algo/uni-algo/archive/v1.0.0.tar.gz" sha256: "a59d61cd4a4fff08672831c7e5a8c204bb6e96c21506b6471771c01b38958a15" diff --git a/recipes/uni-algo/config.yml b/recipes/uni-algo/config.yml index 9ca04a66695cab..aabd23fca0e2da 100644 --- a/recipes/uni-algo/config.yml +++ b/recipes/uni-algo/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "1.0.0": folder: all "0.8.2": diff --git a/recipes/units/all/conanfile.py b/recipes/units/all/conanfile.py index abb3f73f190416..f5e7559e8b3b49 100644 --- a/recipes/units/all/conanfile.py +++ b/recipes/units/all/conanfile.py @@ -2,6 +2,7 @@ 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 import os @@ -20,6 +21,7 @@ class UnitsConan(ConanFile): "no-dependencies") homepage = "https://github.com/nholthaus/units" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -36,6 +38,9 @@ def _minimum_compilers_version(self): "msvc": "190", } + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -49,8 +54,7 @@ def validate(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): pass @@ -64,4 +68,3 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "units::units") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/units/all/test_v1_package/CMakeLists.txt b/recipes/units/all/test_v1_package/CMakeLists.txt index b01d1d5fd06ef4..0d20897301b68b 100644 --- a/recipes/units/all/test_v1_package/CMakeLists.txt +++ b/recipes/units/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(units REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE units::units) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml index b69698c93c08e0..cb46afb843f82f 100644 --- a/recipes/unordered_dense/all/conandata.yml +++ b/recipes/unordered_dense/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "4.1.2": + url: "https://github.com/martinus/unordered_dense/archive/v4.1.2.tar.gz" + sha256: "300410dbcd32800f83b2113dfecbdfe8cd256caa4cfeb117d646021d6e3209ae" + "4.1.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.1.0.tar.gz" + sha256: "0f594cb3b08fc657db3843139000005b6827e5c69d00f5c8d74c1239bd21746f" + "4.0.4": + url: "https://github.com/martinus/unordered_dense/archive/v4.0.4.tar.gz" + sha256: "b34a8c942963e3a647f1bbc192a6391cd56d7ae615b2ddc1601c1779b5792206" "4.0.1": url: "https://github.com/martinus/unordered_dense/archive/v4.0.1.tar.gz" sha256: "6c8be4f76fed592f8c1ae07ce07eaa8749ed3a929a84a502764564dcbcc53a76" @@ -14,24 +23,12 @@ sources: "3.0.2": url: "https://github.com/martinus/unordered_dense/archive/v3.0.2.tar.gz" sha256: "0c0b874e9682cce3c75a1152308bfbb108538aaf1e90824d7789e2b64122520b" - "3.0.0": - url: "https://github.com/martinus/unordered_dense/archive/v3.0.0.tar.gz" - sha256: "e73452d7c1e274b4a15b553c0904f1de4bcfa61b00514acd1eaad7deac805ef0" "2.0.1": url: "https://github.com/martinus/unordered_dense/archive/v2.0.1.tar.gz" sha256: "450d53bd8709f9476702a3c4975bf6e40d66059b25b125e480534228d7f5616d" - "2.0.0": - url: "https://github.com/martinus/unordered_dense/archive/v2.0.0.tar.gz" - sha256: "e838bdcf380a1aeb6f1fee17fbdf59d7a14b6b9fb6dfca32981e4cbd60739d20" "1.4.0": url: "https://github.com/martinus/unordered_dense/archive/v1.4.0.tar.gz" sha256: "36b6bfe2fe2633f9d9c537b9b808b4be6b77ff51c66d370d855f477517bc3bc9" "1.3.3": url: "https://github.com/martinus/unordered_dense/archive/v1.3.3.tar.gz" sha256: "621a984d7f1de156d3078ecb5e1252bcc2ebc875de6eb6b8635f6c2a0898e496" - "1.3.2": - url: "https://github.com/martinus/unordered_dense/archive/v1.3.2.tar.gz" - sha256: "f12db3b93f31f7f20f4d8cac6adc551f6ae17a5b9a16040abeee427f54427953" - "1.3.1": - url: "https://github.com/martinus/unordered_dense/archive/refs/tags/v1.3.1.tar.gz" - sha256: "d393168833d6609c9eaf54a05b19fc3120f68b85feffb282ab225119a86df1d4" diff --git a/recipes/unordered_dense/config.yml b/recipes/unordered_dense/config.yml index 50c688a80fb211..ff0267b8985262 100644 --- a/recipes/unordered_dense/config.yml +++ b/recipes/unordered_dense/config.yml @@ -1,4 +1,10 @@ versions: + "4.1.2": + folder: all + "4.1.0": + folder: all + "4.0.4": + folder: all "4.0.1": folder: all "4.0.0": @@ -9,17 +15,9 @@ versions: folder: all "3.0.2": folder: all - "3.0.0": - folder: all "2.0.1": folder: all - "2.0.0": - folder: all "1.4.0": folder: all "1.3.3": folder: all - "1.3.2": - folder: all - "1.3.1": - folder: all diff --git a/recipes/upx/all/conanfile.py b/recipes/upx/all/conanfile.py index ebbe1deba6846c..4a0f911cedf71e 100644 --- a/recipes/upx/all/conanfile.py +++ b/recipes/upx/all/conanfile.py @@ -1,23 +1,29 @@ -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.files import copy, get + +required_conan_version = ">=1.47.0" class UPXConan(ConanFile): name = "upx" description = "UPX - the Ultimate Packer for eXecutables " - license = "GPL-2.0-or-later", "special-exception-for-compressed-executables" + license = ("GPL-2.0-or-later", "special-exception-for-compressed-executables") url = "https://github.com/conan-io/conan-center-index" homepage = "https://upx.github.io/" - topics = ("packer", "executable", "compression", "size", "reduction", "small", "footprintt") - no_copy_source = True - settings = "os", "arch" + topics = ("packer", "executable", "compression", "size", "reduction", "small", "footprintt", "pre-built") + + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass - @property - def _source_subfolder(self): - return "source_subfolder" + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type def _conan_data_sources(self): # Don't surround this with try/catch to catch unknown versions @@ -32,24 +38,32 @@ def validate(self): raise ConanInvalidConfiguration(f"This recipe has no upx binary for os/arch={self.settings.os}/{self.settings.arch}") def build(self): - tools.get(**self._conan_data_sources(), - destination=self._source_subfolder, strip_root=True) + get(self, **self._conan_data_sources(), strip_root=True) def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - if self.settings.os == "Windows": - self.copy("upx.exe", src=self._source_subfolder, dst="bin") - else: - self.copy("upx", src=self._source_subfolder, dst="bin") + copy(self, "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + extension = ".exe" if self.settings.os == "Windows" else "" + copy(self, f"upx{extension}", + src=self.source_folder, + dst=os.path.join(self.package_folder, "bin")) def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] 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) - bin_ext = ".exe" if self.settings.os == "Windows" else "" upx = os.path.join(bin_path, f"upx{bin_ext}") + self.conf_info.define("user.upx:upx", upx) + + # TODO: to remove in conan v2 + self.output.info(f"Appending PATH environment variable: {bin_path}") + self.env_info.PATH.append(bin_path) self.user_info.upx = upx diff --git a/recipes/upx/all/test_package/CMakeLists.txt b/recipes/upx/all/test_package/CMakeLists.txt index f31cfe1e1aa8e2..e58a04fd19cf11 100644 --- a/recipes/upx/all/test_package/CMakeLists.txt +++ b/recipes/upx/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) if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU") add_link_options(-static) endif() -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/upx/all/test_package/conanfile.py b/recipes/upx/all/test_package/conanfile.py index 8274c17267c149..8d1367a88209a0 100644 --- a/recipes/upx/all/test_package/conanfile.py +++ b/recipes/upx/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" + 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): cmake = CMake(self) @@ -12,21 +21,20 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self, skip_x64_x86=True): + if can_run(self): bin_ext = ".exe" if self.settings.os == "Windows" else "" - bin_path = os.path.join("bin", f"test_package{bin_ext}") + bin_path = os.path.join(self.cpp.build.bindir, f"test_package{bin_ext}") - upx_bin = self.deps_user_info["upx"].upx - self.run(f"{upx_bin} --help", run_environment=True) + self.run(f"upx --help") original_size = os.stat(bin_path).st_size - self.run(f"{upx_bin} {bin_path}", run_environment=True) + self.run(f"upx {bin_path}") packed_size = os.stat(bin_path).st_size # Run the packed executable to see whether it still works - self.run(bin_path, run_environment=True) + self.run(bin_path, env="conanrun") self.output.info(f"File: {bin_path}") self.output.info(f"Original size: {original_size:>9}") diff --git a/recipes/upx/all/test_package/test_package.c b/recipes/upx/all/test_package/test_package.c index 725533f119f429..f81e0540072d72 100644 --- a/recipes/upx/all/test_package/test_package.c +++ b/recipes/upx/all/test_package/test_package.c @@ -1,6 +1,6 @@ #include -int main(int argc, char *argv[]) { +int main() { puts("Hello world!"); return 0; } diff --git a/recipes/upx/all/test_v1_package/CMakeLists.txt b/recipes/upx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/upx/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/upx/all/test_v1_package/conanfile.py b/recipes/upx/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..2b7a8250c99373 --- /dev/null +++ b/recipes/upx/all/test_v1_package/conanfile.py @@ -0,0 +1,35 @@ +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, skip_x64_x86=True): + bin_ext = ".exe" if self.settings.os == "Windows" else "" + bin_path = os.path.join("bin", f"test_package{bin_ext}") + + upx_bin = self.deps_user_info["upx"].upx + self.run(f"{upx_bin} --help", run_environment=True) + + original_size = os.stat(bin_path).st_size + + self.run(f"{upx_bin} {bin_path}", run_environment=True) + + packed_size = os.stat(bin_path).st_size + + # Run the packed executable to see whether it still works + self.run(bin_path, run_environment=True) + + self.output.info(f"File: {bin_path}") + self.output.info(f"Original size: {original_size:>9}") + self.output.info(f"Packed size: {packed_size:>9}") + self.output.info(f" ---------") + self.output.info(f"Size diff: {original_size-packed_size:>9}") diff --git a/recipes/urdfdom/all/conandata.yml b/recipes/urdfdom/all/conandata.yml new file mode 100644 index 00000000000000..82a20122324507 --- /dev/null +++ b/recipes/urdfdom/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.1.1": + urdfdom: + url: "https://github.com/ros/urdfdom/archive/refs/tags/3.1.1.tar.gz" + sha256: "dd69b2077b8fc1bd2b67022c1dc861cd896ac882df065aa08cabdf2f945a9ac0" + urdfdom_headers: + # Latest unreleased version from 2023-04-25. + # Identical to the latest v1.0.5 release, except headers have been conveniently moved to include/. + # We merge the headers into the main source tree instead of packaging them separately. + url: "https://github.com/ros/urdfdom_headers/archive/1fd21b64ed78493508a174f98af982605d1e4607.zip" + sha256: "aba42c1c83d6d1fb94e54ec84680a8b9e2417337fbaa85424da0e069d0cc89b6" +patches: + "3.1.1": + - patch_file: "patches/001-optional-build-apps.patch" + patch_type: "conan" + patch_description: "Disable building of apps by default" + - patch_file: "patches/002-use-conan-dependencies.patch" + patch_type: "conan" + patch_description: "Use dependencies (console_bridge, TinyXML, GTest) from Conan" + - patch_file: "patches/003-use-merged-urdfdom_headers.patch" + patch_type: "conan" + patch_description: "Use merged urdfdom_headers instead of a separate package" diff --git a/recipes/urdfdom/all/conanfile.py b/recipes/urdfdom/all/conanfile.py new file mode 100644 index 00000000000000..f7a710e7f7ea76 --- /dev/null +++ b/recipes/urdfdom/all/conanfile.py @@ -0,0 +1,107 @@ +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, rm, rmdir + +required_conan_version = ">=1.53.0" + + +class PackageConan(ConanFile): + name = "urdfdom" + description = "Data structures and parsers to access URDF files using the DOM model" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ros/urdfdom" + topics = ("urdf", "ros", "robotics") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 14 + + 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("tinyxml/2.6.2", transitive_headers=True) + self.requires("console_bridge/1.0.2") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + # urdfdom packages its headers separately as urdfdom_headers. + # There is no obvious benefit of doing the same for the Conan package, + # so we simply merge the headers into the main source tree. + sources = self.conan_data["sources"][self.version] + get(self, **sources["urdfdom_headers"], strip_root=True, + destination=os.path.join(self.source_folder, "urdf_parser")) + get(self, **sources["urdfdom"], strip_root=True, destination=self.source_folder) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["APPEND_PROJECT_NAME_TO_INCLUDEDIR"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_APPS"] = False + if not self.options.shared: + tc.preprocessor_definitions["URDFDOM_STATIC"] = "1" + tc.generate() + CMakeDeps(self).generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Do not hard-code libraries to SHARED + parser_cmakelists = os.path.join(self.source_folder, "urdf_parser", "CMakeLists.txt") + replace_in_file(self, parser_cmakelists, " SHARED", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "urdfdom")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.libs = [ + "urdfdom_model", + "urdfdom_model_state", + "urdfdom_sensor", + "urdfdom_world", + ] + + if not self.options.shared: + self.cpp_info.defines.append("URDFDOM_STATIC=1") diff --git a/recipes/urdfdom/all/patches/001-optional-build-apps.patch b/recipes/urdfdom/all/patches/001-optional-build-apps.patch new file mode 100644 index 00000000000000..a89c2b010b26ce --- /dev/null +++ b/recipes/urdfdom/all/patches/001-optional-build-apps.patch @@ -0,0 +1,34 @@ +--- a/urdf_parser/CMakeLists.txt ++++ b/urdf_parser/CMakeLists.txt +@@ -80,6 +78,7 @@ + + # -------------------------------- + ++if(BUILD_APPS) + add_executable(check_urdf src/check_urdf.cpp) + target_include_directories(check_urdf PUBLIC include) + target_link_libraries(check_urdf urdfdom_model urdfdom_world) +@@ -96,6 +95,7 @@ + add_executable(urdf_mem_test test/memtest.cpp) + target_include_directories(urdf_mem_test PUBLIC include) + target_link_libraries(urdf_mem_test urdfdom_model) ++endif() + + include(CTest) + if(BUILD_TESTING) +@@ -103,6 +103,7 @@ + add_subdirectory(test) + endif() + ++if(BUILD_APPS) + INSTALL( + TARGETS + check_urdf +@@ -113,6 +114,7 @@ + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) ++endif() + INSTALL( + TARGETS + urdfdom_model diff --git a/recipes/urdfdom/all/patches/002-use-conan-dependencies.patch b/recipes/urdfdom/all/patches/002-use-conan-dependencies.patch new file mode 100644 index 00000000000000..cbb6f0fc84fb3f --- /dev/null +++ b/recipes/urdfdom/all/patches/002-use-conan-dependencies.patch @@ -0,0 +1,83 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt (revision 1ed7ca95b917f38feb4ff7bd1aa033baf2cfce0e) ++++ b/CMakeLists.txt (revision 6592c04e28cb59b8e9ac5944e3229c50d706a2ee) +@@ -45,19 +45,9 @@ + + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +-find_package(tinyxml_vendor QUIET) +-find_package(TinyXML) +-# bionic has not cmake module, workaround +-if (NOT TinyXML_FOUND AND UNIX) +- include(FindPkgConfig) +- pkg_check_modules (TinyXML tinyxml) +-else() +- # Make it fail in platforms without pkgconfig +- find_package(TinyXML REQUIRED) # bionic has not cmake module +-endif() ++find_package(tinyxml REQUIRED CONFIG) + find_package(urdfdom_headers 1.0 REQUIRED) +-find_package(console_bridge_vendor QUIET) # Provides console_bridge 0.4.0 on platforms without it. +-find_package(console_bridge REQUIRED) ++find_package(console_bridge REQUIRED CONFIG) + + # Control where libraries and executables are placed during the build + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}") + +diff --git a/urdf_parser/CMakeLists.txt b/urdf_parser/CMakeLists.txt +--- a/urdf_parser/CMakeLists.txt (revision 1ed7ca95b917f38feb4ff7bd1aa033baf2cfce0e) ++++ b/urdf_parser/CMakeLists.txt (revision 6592c04e28cb59b8e9ac5944e3229c50d706a2ee) +@@ -5,8 +5,6 @@ + + add_library(${add_urdfdom_library_LIBNAME} SHARED + ${add_urdfdom_library_SOURCES}) +- target_include_directories(${add_urdfdom_library_LIBNAME} SYSTEM PUBLIC +- ${TinyXML_INCLUDE_DIRS}) + target_include_directories(${add_urdfdom_library_LIBNAME} PUBLIC + "$" + "$") +@@ -14,7 +12,7 @@ + ${add_urdfdom_library_LINK} + ${console_bridge_link_libs} + ${urdfdom_headers_link_libs} +- ${TinyXML_LIBRARIES}) ++ tinyxml::tinyxml) + if(NOT CMAKE_CXX_STANDARD) + target_compile_features(${add_urdfdom_library_LIBNAME} PUBLIC cxx_std_14) + endif() + +diff --git a/urdf_parser/test/CMakeLists.txt b/urdf_parser/test/CMakeLists.txt +--- a/urdf_parser/test/CMakeLists.txt (revision 1ed7ca95b917f38feb4ff7bd1aa033baf2cfce0e) ++++ b/urdf_parser/test/CMakeLists.txt (revision 6592c04e28cb59b8e9ac5944e3229c50d706a2ee) +@@ -1,18 +1,8 @@ +-include_directories( +- ${CMAKE_CURRENT_SOURCE_DIR}/gtest/include +- ${CMAKE_CURRENT_SOURCE_DIR}/gtest +- ${CMAKE_CURRENT_SOURCE_DIR} +-) +- +-# Build gtest +-add_library(gtest STATIC gtest/src/gtest-all.cc) +-add_library(gtest_main STATIC gtest/src/gtest_main.cc) +-target_link_libraries(gtest_main gtest) +-target_compile_features(gtest PUBLIC cxx_std_11) +- + execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_results) + execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results) + ++find_package(GTest REQUIRED) ++ + # unit test to fix geometry problems + set(tests + urdf_double_convert.cpp +@@ -27,8 +17,8 @@ + add_executable(${BINARY_NAME} ${GTEST_SOURCE_file}) + + target_link_libraries(${BINARY_NAME} +- gtest_main +- gtest ++ GTest::gtest ++ GTest::gtest_main + urdfdom_model + ) + if (UNIX) diff --git a/recipes/urdfdom/all/patches/003-use-merged-urdfdom_headers.patch b/recipes/urdfdom/all/patches/003-use-merged-urdfdom_headers.patch new file mode 100644 index 00000000000000..b4095fcb7ba42f --- /dev/null +++ b/recipes/urdfdom/all/patches/003-use-merged-urdfdom_headers.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt (revision 82fb54588f3ba5091d9a73d072559ac7061eccdf) ++++ b/CMakeLists.txt (revision 1de2b88f231fa0f7f83a028e971d4ebaed1b164c) +@@ -46,7 +46,6 @@ + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + + find_package(tinyxml REQUIRED CONFIG) +-find_package(urdfdom_headers 1.0 REQUIRED) + find_package(console_bridge REQUIRED CONFIG) + + # Control where libraries and executables are placed during the build + +diff --git a/urdf_parser/CMakeLists.txt b/urdf_parser/CMakeLists.txt +--- a/urdf_parser/CMakeLists.txt (revision 82fb54588f3ba5091d9a73d072559ac7061eccdf) ++++ b/urdf_parser/CMakeLists.txt (revision 1de2b88f231fa0f7f83a028e971d4ebaed1b164c) +@@ -135,4 +135,4 @@ + FILE "urdfdomExport.cmake" + ) + +-INSTALL(DIRECTORY include/urdf_parser DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++INSTALL(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/urdfdom/all/test_package/CMakeLists.txt b/recipes/urdfdom/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..2d7a881934a294 --- /dev/null +++ b/recipes/urdfdom/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(urdfdom REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE urdfdom::urdfdom) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/urdfdom/all/test_package/conanfile.py b/recipes/urdfdom/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/urdfdom/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/urdfdom/all/test_package/test_package.cpp b/recipes/urdfdom/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..a7e4a0d704e359 --- /dev/null +++ b/recipes/urdfdom/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include + +#include + +int main() { + std::string test_str = + "" + " " + ""; + urdf::ModelInterfaceSharedPtr urdf = urdf::parseURDF(test_str); + std::cout << "urdf::parseURDF() ran successfully" << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/urdfdom/config.yml b/recipes/urdfdom/config.yml new file mode 100644 index 00000000000000..fd9669719a7ade --- /dev/null +++ b/recipes/urdfdom/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.1": + folder: all diff --git a/recipes/usockets/all/conandata.yml b/recipes/usockets/all/conandata.yml index e6a17b330a5a44..1e162a7179edda 100644 --- a/recipes/usockets/all/conandata.yml +++ b/recipes/usockets/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.6": + url: "https://github.com/uNetworking/uSockets/archive/v0.8.6.tar.gz" + sha256: "16eba133dd33eade2f5f8dd87612c04b5dd711066e0471c60d641a2f6a988f16" "0.8.5": url: "https://github.com/uNetworking/uSockets/archive/v0.8.5.tar.gz" sha256: "c52c98b7ff2c24534c17ad97d5fea8ca0cb7ff38cc933b8d08bac6e498a2ea6b" @@ -21,6 +24,10 @@ sources: url: "https://github.com/uNetworking/uSockets/archive/v0.4.0.tar.gz" sha256: "f9f15b395def578cc79a5b32abc64fa9cff5dac873062911f515b984b90f7cc2" patches: + "0.8.6": + - patch_file: "patches/0001-makefile_0.8.6.patch" + patch_description: "remove lto options" + patch_type: "portability" "0.8.5": - patch_file: "patches/0001-makefile_0.8.3.patch" patch_description: "remove lto options" diff --git a/recipes/usockets/all/conanfile.py b/recipes/usockets/all/conanfile.py index 4f69ddfc963bf7..0d84532828398e 100644 --- a/recipes/usockets/all/conanfile.py +++ b/recipes/usockets/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, chdir, replace_in_file from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain from conan.tools.layout import basic_layout @@ -32,19 +33,19 @@ class UsocketsConan(ConanFile): } @property - def _minimum_cpp_standard(self): - version = False + def _min_cppstd(self): if self.options.eventloop == "boost": - version = "14" + return "14" # OpenSSL wrapper of uSockets uses C++17 features. if self.options.with_ssl == "openssl": - version = "17" + return "17" - return version + return False - def _minimum_compilers_version(self, cppstd): - standards = { + @property + def _minimum_compilers_version(self): + return { "14": { "Visual Studio": "15", "msvc": "191", @@ -59,11 +60,7 @@ def _minimum_compilers_version(self, cppstd): "clang": "6", "apple-clang": "10", }, - } - return standards.get(cppstd) or {} - - def layout(self): - basic_layout(self, src_folder="src") + }.get(self._min_cppstd, {}) @property def _settings_build(self): @@ -81,41 +78,14 @@ def config_options(self): del self.options.fPIC self.options.eventloop = "libuv" - def validate(self): - if self.options.eventloop == "syscall" and self.settings.os == "Windows": - raise ConanInvalidConfiguration("syscall is not supported on Windows") - - if self.options.eventloop == "gcd" and (self.settings.os != "Linux" or self.settings.compiler != "clang"): - raise ConanInvalidConfiguration("eventloop=gcd is only supported on Linux with clang") - - if Version(self.version) < "0.8.0" and self.options.eventloop not in ("syscall", "libuv", "gcd"): - raise ConanInvalidConfiguration(f"eventloop={self.options.eventloop} is not supported with {self.name}/{self.version}") - - if Version(self.version) >= "0.5.0" and self.options.with_ssl == "wolfssl": - raise ConanInvalidConfiguration(f"with_ssl={self.options.with_ssl} is not supported with {self.name}/{self.version}. https://github.com/uNetworking/uSockets/issues/147") - - if self.options.with_ssl == "wolfssl" and not self.options["wolfssl"].opensslextra: - raise ConanInvalidConfiguration("wolfssl needs opensslextra option enabled for usockets") - - cppstd = self._minimum_cpp_standard - if not cppstd: - return - - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, cppstd) - - minimum_version = self._minimum_compilers_version(cppstd).get(str(self.settings.compiler), False) - if minimum_version: - if Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++{}, which your compiler does not support.".format(self.name, cppstd)) - else: - self.output.warn("{0} requires C++{1}. Your compiler is unknown. Assuming it supports C++{1}.".format(self.name, cppstd)) - def configure(self): - if bool(self._minimum_cpp_standard) == False: + if not bool(self._min_cppstd): 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.with_ssl == "openssl": self.requires("openssl/[>=1.1 <4]") @@ -127,7 +97,36 @@ def requirements(self): elif self.options.eventloop == "gcd": self.requires("libdispatch/5.3.2") elif self.options.eventloop == "boost": - self.requires("boost/1.82.0") + self.requires("boost/1.83.0") + + def validate(self): + if self.options.eventloop == "syscall" and self.settings.os == "Windows": + raise ConanInvalidConfiguration("syscall is not supported on Windows") + + if self.options.eventloop == "gcd" and not (self.settings.os == "Linux" and self.settings.compiler == "clang"): + raise ConanInvalidConfiguration("eventloop=gcd is only supported on Linux with clang") + + if Version(self.version) < "0.8.0" and self.options.eventloop not in ("syscall", "libuv", "gcd"): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support eventloop={self.options.eventloop}") + + if Version(self.version) >= "0.5.0" and self.options.with_ssl == "wolfssl": + raise ConanInvalidConfiguration( + f"{self.ref} doesn't support with_ssl={self.options.with_ssl}. " + "See https://github.com/uNetworking/uSockets/issues/147" + ) + + if self.options.with_ssl == "wolfssl" and not self.dependencies["wolfssl"].options.opensslextra: + raise ConanInvalidConfiguration("wolfssl needs opensslextra option enabled for usockets") + + if bool(self._min_cppstd): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + 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 build_requirements(self): if self._settings_build.os == "Windows" and not self._uses_msbuild: @@ -170,6 +169,9 @@ def generate(self): deps = MSBuildDeps(self) deps.generate() else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) env = tc.environment() if is_msvc(self): @@ -187,7 +189,8 @@ def generate(self): if self.options.eventloop == "libuv": # Workaround for: https://github.com/conan-io/conan/issues/12784 # Otherwise AutotoolsDeps should suffice - env.append("CPPFLAGS", "-I" + unix_path(self, self.dependencies["libuv"].cpp_info.includedirs[0])) + libuv_includes = self.dependencies["libuv"].cpp_info.aggregated_components().includedirs + env.append("CPPFLAGS", " ".join([f"-I{unix_path(self, p)}" for p in libuv_includes])) tc.generate(env) deps = AutotoolsDeps(self) @@ -200,7 +203,6 @@ def _build_msvc(self): def _build_autotools(self): autotools = Autotools(self) - autotools.fpic = self.options.get_safe("fPIC", False) with chdir(self, self.source_folder): args = ["WITH_LTO=0"] if self.options.with_ssl == "openssl": diff --git a/recipes/usockets/all/patches/0001-makefile_0.8.6.patch b/recipes/usockets/all/patches/0001-makefile_0.8.6.patch new file mode 100644 index 00000000000000..e77691ceeac478 --- /dev/null +++ b/recipes/usockets/all/patches/0001-makefile_0.8.6.patch @@ -0,0 +1,35 @@ +diff --git a/Makefile b/Makefile +index aa874b9..d58ac0a 100644 +--- a/Makefile ++++ b/Makefile +@@ -74,10 +74,10 @@ endif + # By default we build the uSockets.a static library + default: + rm -f *.o +- $(CC) $(CFLAGS) -O3 -c src/*.c src/eventing/*.c src/crypto/*.c src/io_uring/*.c ++ $(CC) $(CFLAGS) $(CPPFLAGS) -O3 -c src/*.c src/eventing/*.c src/crypto/*.c src/io_uring/*.c + # Also link in Boost Asio support + ifeq ($(WITH_ASIO),1) +- $(CXX) $(CXXFLAGS) -Isrc -std=c++14 -flto -O3 -c src/eventing/asio.cpp ++ $(CXX) $(CXXFLAGS) -Isrc -std=c++14 $(CPPFLAGS) -O3 -c src/eventing/asio.cpp + endif + + # For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11 +@@ -88,7 +88,7 @@ ifeq ($(WITH_BORINGSSL),1) + $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp + endif + # Create a static library (try windows, then unix) +- lib.exe /out:uSockets.a *.o || $(AR) rvs uSockets.a *.o ++ lib.exe /out:uSockets.lib *.obj || $(AR) rvs libuSockets.a *.o + + # BoringSSL needs cmake and golang + .PHONY: boringssl +@@ -98,7 +98,7 @@ boringssl: + # Builds all examples + .PHONY: examples + examples: default +- for f in examples/*.c; do $(CC) -O3 $(CFLAGS) -o $$(basename "$$f" ".c")$(EXEC_SUFFIX) "$$f" $(LDFLAGS); done ++ for f in examples/*.c; do $(CC) -O3 $(CFLAGS) $(CPPFLAGS) -o $$(basename "$$f" ".c")$(EXEC_SUFFIX) "$$f" $(LDFLAGS); done + + swift_examples: + swiftc -O -I . examples/swift_http_server/main.swift uSockets.a -o swift_http_server diff --git a/recipes/usockets/config.yml b/recipes/usockets/config.yml index c4f53d0a2aff05..ed2a319a00e8b3 100644 --- a/recipes/usockets/config.yml +++ b/recipes/usockets/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.6": + folder: all "0.8.5": folder: all "0.8.3": diff --git a/recipes/usrsctp/all/CMakeLists.txt b/recipes/usrsctp/all/CMakeLists.txt deleted file mode 100644 index 3bead6a0d93200..00000000000000 --- a/recipes/usrsctp/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() - -if (WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/usrsctp/all/conandata.yml b/recipes/usrsctp/all/conandata.yml index 61e799fd3d4645..9dffac4dd65c94 100644 --- a/recipes/usrsctp/all/conandata.yml +++ b/recipes/usrsctp/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "0.9.5.0": - patch_file: "patches/0001-install.patch" - base_path: "source_subfolder" diff --git a/recipes/usrsctp/all/conanfile.py b/recipes/usrsctp/all/conanfile.py index 73752d1325d3b5..9eba2832eb8dde 100644 --- a/recipes/usrsctp/all/conanfile.py +++ b/recipes/usrsctp/all/conanfile.py @@ -1,27 +1,33 @@ -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, replace_in_file + +required_conan_version = ">=1.53.0" + class UsrsctpConan(ConanFile): name = "usrsctp" + description = " A portable SCTP userland stack" license = "BSD-3-Clause" - homepage = "https://github.com/sctplab/usrsctp" url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "network", "sctp") - description = " A portable SCTP userland stack" - settings = "os", "compiler", "arch", "build_type" - options = {"shared": [True, False], - "fPIC": [True, False]} - default_options = {"shared": False, - "fPIC": True} - exports_sources = ["CMakeLists.txt", "patches/*"] - generators = "cmake" + homepage = "https://github.com/sctplab/usrsctp" + topics = ("network", "sctp") - _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_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -29,46 +35,51 @@ 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]) - extracted_dir = "usrsctp-{}".format(self.version) - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["sctp_debug"] = False + tc.variables["sctp_werror"] = False + tc.variables["sctp_build_shared_lib"] = self.options.shared + tc.variables["sctp_build_programs"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["sctp_debug"] = False - self._cmake.definitions["sctp_werror"] = False - self._cmake.definitions["sctp_build_shared_lib"] = self.options.shared - self._cmake.definitions["sctp_build_programs"] = False - self._cmake.configure() - return self._cmake + def _patch_sources(self): + apply_conandata_patches(self) + # Fix "The CMake policy CMP0091 must be NEW, but is ''" + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "project(usrsctplib C)\ncmake_minimum_required(VERSION 3.0)", + "cmake_minimum_required(VERSION 3.15)\nproject(usrsctplib C)") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE.md", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.md", + 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.names["pkg_config"] = "usrsctp" + self.cpp_info.set_property("pkg_config_name", "usrsctp") if self.settings.os == "Windows": - self.cpp_info.system_libs.extend(['ws2_32', 'iphlpapi']) - elif self.settings.os == "Linux": - self.cpp_info.system_libs.extend(['pthread']) + self.cpp_info.system_libs = ["ws2_32", "iphlpapi"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] suffix = "_import" if self.settings.os == "Windows" and self.options.shared else "" self.cpp_info.libs = ["usrsctp" + suffix] diff --git a/recipes/usrsctp/all/test_package/CMakeLists.txt b/recipes/usrsctp/all/test_package/CMakeLists.txt index a60174007a2341..d8fa3f6efba339 100644 --- a/recipes/usrsctp/all/test_package/CMakeLists.txt +++ b/recipes/usrsctp/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(usrsctp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/usrsctp/all/test_package/conanfile.py b/recipes/usrsctp/all/test_package/conanfile.py index 7e2dfe859bb27b..ef5d7042163ecc 100644 --- a/recipes/usrsctp/all/test_package/conanfile.py +++ b/recipes/usrsctp/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,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/usrsctp/all/test_v1_package/CMakeLists.txt b/recipes/usrsctp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/usrsctp/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/usrsctp/all/test_v1_package/conanfile.py b/recipes/usrsctp/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7e2dfe859bb27b --- /dev/null +++ b/recipes/usrsctp/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/utf8.h/all/conanfile.py b/recipes/utf8.h/all/conanfile.py index 3c63ca89d61570..5053468bc7039f 100644 --- a/recipes/utf8.h/all/conanfile.py +++ b/recipes/utf8.h/all/conanfile.py @@ -13,6 +13,7 @@ class Utf8HConan(ConanFile): description = "Single header utf8 string functions for C and C++" topics = ("utf8", "unicode", "text") license = "Unlicense" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -23,8 +24,7 @@ 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,4 +36,3 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/utf8.h/all/test_v1_package/CMakeLists.txt b/recipes/utf8.h/all/test_v1_package/CMakeLists.txt index e35aca1f7a1353..0d20897301b68b 100644 --- a/recipes/utf8.h/all/test_v1_package/CMakeLists.txt +++ b/recipes/utf8.h/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(utf8.h REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE utf8.h::utf8.h) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/utf8proc/all/conandata.yml b/recipes/utf8proc/all/conandata.yml index 2e408e9011b374..c31447372a280a 100644 --- a/recipes/utf8proc/all/conandata.yml +++ b/recipes/utf8proc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.9.0": + url: "https://github.com/JuliaStrings/utf8proc/archive/v2.9.0.tar.gz" + sha256: "18c1626e9fc5a2e192311e36b3010bfc698078f692888940f1fa150547abb0c1" "2.8.0": url: "https://github.com/JuliaStrings/utf8proc/archive/v2.8.0.tar.gz" sha256: "a0a60a79fe6f6d54e7d411facbfcc867a6e198608f2cd992490e46f04b1bcecc" diff --git a/recipes/utf8proc/all/conanfile.py b/recipes/utf8proc/all/conanfile.py index 698e23be72ec9f..39b2b7b1cced3e 100644 --- a/recipes/utf8proc/all/conanfile.py +++ b/recipes/utf8proc/all/conanfile.py @@ -4,17 +4,17 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class Utf8ProcConan(ConanFile): name = "utf8proc" + description = "A clean C library for processing UTF-8 Unicode data" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/JuliaStrings/utf8proc" - description = "A clean C library for processing UTF-8 Unicode data" topics = ("utf", "utf8", "unicode", "text") - license = "MIT expat" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -31,28 +31,19 @@ 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") 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) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() def build(self): diff --git a/recipes/utf8proc/config.yml b/recipes/utf8proc/config.yml index 44b916f7f7e88e..d7d36135481cf6 100644 --- a/recipes/utf8proc/config.yml +++ b/recipes/utf8proc/config.yml @@ -1,4 +1,6 @@ versions: + "2.9.0": + folder: all "2.8.0": folder: all "2.7.0": diff --git a/recipes/utfcpp/all/conandata.yml b/recipes/utfcpp/all/conandata.yml index f435f56f7acf1c..f78d79ff038b93 100644 --- a/recipes/utfcpp/all/conandata.yml +++ b/recipes/utfcpp/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "4.0.1": + url: "https://github.com/nemtrif/utfcpp/archive/v4.0.1.tar.gz" + sha256: "9014342a716258da00b97bf8c201a2edc4d72d2025cd8d62f0650ac627038f95" + "4.0.0": + url: "https://github.com/nemtrif/utfcpp/archive/v4.0.0.tar.gz" + sha256: "ac44d9652aa2ee64d405c1705718f26b385337a9b8cf20bf2b2aac6435a16c1e" + "3.2.5": + url: "https://github.com/nemtrif/utfcpp/archive/v3.2.5.tar.gz" + sha256: "14fd1b3c466814cb4c40771b7f207b61d2c7a0aa6a5e620ca05c00df27f25afd" + "3.2.4": + url: "https://github.com/nemtrif/utfcpp/archive/refs/tags/v3.2.4.tar.gz" + sha256: "fde21a4c519eed25f095a1cd8490167409cc70d7b5e9c38756142e588ccb7c7e" "3.2.3": url: "https://github.com/nemtrif/utfcpp/archive/v3.2.3.tar.gz" sha256: "3ba9b0dbbff08767bdffe8f03b10e596ca351228862722e4c9d4d126d2865250" diff --git a/recipes/utfcpp/all/conanfile.py b/recipes/utfcpp/all/conanfile.py index 34e0685b4ddb26..247b54396ade22 100644 --- a/recipes/utfcpp/all/conanfile.py +++ b/recipes/utfcpp/all/conanfile.py @@ -38,7 +38,8 @@ def package(self): # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), - {"utf8cpp": "utf8cpp::utf8cpp"}, + {"utf8cpp": "utf8cpp::utf8cpp", + "utf8::cpp": "utf8cpp::utf8cpp"}, ) def _create_cmake_module_alias_targets(self, module_file, targets): @@ -59,12 +60,12 @@ def _module_file_rel_path(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "utf8cpp") self.cpp_info.set_property("cmake_target_name", "utf8cpp") + self.cpp_info.set_property("cmake_target_aliases", ["utf8::cpp"]) self.cpp_info.includedirs.append(os.path.join("include", "utf8cpp")) self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "utf8cpp" - self.cpp_info.names["cmake_find_package_multi"] = "utf8cpp" - 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] + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.names[generator] = "utf8cpp" + self.cpp_info.build_modules[generator] = [self._module_file_rel_path] diff --git a/recipes/utfcpp/all/test_package/CMakeLists.txt b/recipes/utfcpp/all/test_package/CMakeLists.txt index fe794ae36be57c..7624c136189142 100644 --- a/recipes/utfcpp/all/test_package/CMakeLists.txt +++ b/recipes/utfcpp/all/test_package/CMakeLists.txt @@ -5,4 +5,6 @@ find_package(utf8cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE utf8cpp) +#check alias +target_link_libraries(${PROJECT_NAME} PRIVATE utf8::cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/utfcpp/config.yml b/recipes/utfcpp/config.yml index 00df0fb881cb8a..eabfdbf69a0cc3 100644 --- a/recipes/utfcpp/config.yml +++ b/recipes/utfcpp/config.yml @@ -1,4 +1,12 @@ versions: + "4.0.1": + folder: all + "4.0.0": + folder: all + "3.2.5": + folder: all + "3.2.4": + folder: all "3.2.3": folder: all "3.2.2": 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/util-linux-libuuid/all/conandata.yml b/recipes/util-linux-libuuid/all/conandata.yml index 4e1010ee8b94f4..c84795c4daf4e6 100644 --- a/recipes/util-linux-libuuid/all/conandata.yml +++ b/recipes/util-linux-libuuid/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.39.2": + url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.2.tar.xz" + sha256: "87abdfaa8e490f8be6dde976f7c80b9b5ff9f301e1b67e3899e1f05a59a1531f" "2.39": url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.tar.xz" sha256: "32b30a336cda903182ed61feb3e9b908b762a5e66fe14e43efb88d37162075cb" diff --git a/recipes/util-linux-libuuid/all/conanfile.py b/recipes/util-linux-libuuid/all/conanfile.py index 736f1aadf03694..e5c35fe2c862ba 100644 --- a/recipes/util-linux-libuuid/all/conanfile.py +++ b/recipes/util-linux-libuuid/all/conanfile.py @@ -105,11 +105,15 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "bin")) rmdir(self, os.path.join(self.package_folder, "sbin")) rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "usr")) fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.set_property("pkg_config_name", "uuid") - self.cpp_info.set_property("cmake_target_name", "LibUUID::LibUUID") - self.cpp_info.set_property("cmake_file_name", "LibUUID") + self.cpp_info.set_property("cmake_target_name", "libuuid::libuuid") + self.cpp_info.set_property("cmake_file_name", "libuuid") + # Maintain alias to `LibUUID::LibUUID` for previous version of the recipe + self.cpp_info.set_property("cmake_target_aliases", ["LibUUID::LibUUID"]) + self.cpp_info.libs = ["uuid"] self.cpp_info.includedirs.append(os.path.join("include", "uuid")) diff --git a/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt b/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt index 02a93367160a0a..75c717f7699008 100644 --- a/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt +++ b/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES C) -find_package(LibUUID REQUIRED CONFIG) +find_package(libuuid REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE LibUUID::LibUUID) +target_link_libraries(${PROJECT_NAME} PRIVATE libuuid::libuuid) target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/util-linux-libuuid/config.yml b/recipes/util-linux-libuuid/config.yml index 427b3a10b7a7d1..4ab19fceb4d3b4 100644 --- a/recipes/util-linux-libuuid/config.yml +++ b/recipes/util-linux-libuuid/config.yml @@ -1,3 +1,5 @@ versions: + "2.39.2": + folder: all "2.39": folder: all diff --git a/recipes/uwebsockets/all/conandata.yml b/recipes/uwebsockets/all/conandata.yml index d0d6f814547b2a..c36f9118f30727 100644 --- a/recipes/uwebsockets/all/conandata.yml +++ b/recipes/uwebsockets/all/conandata.yml @@ -1,28 +1,16 @@ sources: - "20.36.0": - url: "https://github.com/uNetworking/uWebSockets/archive/v20.36.0.tar.gz" - sha256: "cda266f7ed6abe67ef3cae6e223a580fe5091db9156c1f4123ee328ae21511c9" - "20.17.0": - url: "https://github.com/uNetworking/uWebSockets/archive/v20.17.0.tar.gz" - sha256: "62027b0b847563bcc65a760045dc4233328229fc551f97fe5814e518e272141c" - "20.14.0": - url: "https://github.com/uNetworking/uWebSockets/archive/v20.14.0.tar.gz" - sha256: "15cf995844a930c9a36747e8d714b94ff886b6814b5d4e3b3ee176f05681cccc" - "20.9.0": - url: "https://github.com/uNetworking/uWebSockets/archive/v20.9.0.tar.gz" - sha256: "91897568291a2081ffc1ae27c354446cc130c168a25892b2289f25e185af8676" - "20.8.0": - url: "https://github.com/uNetworking/uWebSockets/archive/v20.8.0.tar.gz" - sha256: "6ab4bc0207f44eacbb9c82fd0dc59a49ef84e13698ccdbfb44b92c6a0eaa951a" + "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" + "20.45.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.45.0.tar.gz" + sha256: "db7599e9eac0c18b76740e7c391663652e0d7188b992a1a5a8dc28f347f483ec" "19.3.0": url: "https://github.com/uNetworking/uWebSockets/archive/v19.3.0.tar.gz" sha256: "6f709b4e5fe053a94a952da93c07c919b36bcb8c838c69067560ae85f97c5621" - "19.2.0": - url: "https://github.com/uNetworking/uWebSockets/archive/v19.2.0.tar.gz" - sha256: "2956075293090754bc2431c53634f93a1e74739c61392be6040cb3ed29430ec2" - "19.1.0": - url: "https://github.com/uNetworking/uWebSockets/archive/v19.1.0.tar.gz" - sha256: "65afa329b0c768a7443ea2621f3f371bc5ce0e1c3518d59bb11b9a2c7adb65dd" "18.3.0": url: "https://github.com/uNetworking/uWebSockets/archive/v18.3.0.tar.gz" sha256: "f51317e2a8cd743e6ff9dfd215569824eaca489c24f7d8fd94eaca44443a9728" diff --git a/recipes/uwebsockets/all/conanfile.py b/recipes/uwebsockets/all/conanfile.py index a7539cf95209b7..4598157564ebae 100644 --- a/recipes/uwebsockets/all/conanfile.py +++ b/recipes/uwebsockets/all/conanfile.py @@ -51,12 +51,12 @@ def layout(self): def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.get_safe("with_libdeflate"): self.requires("libdeflate/1.14") if Version(self.version) > "20.17.0": - self.requires("usockets/0.8.5") + self.requires("usockets/0.8.6") elif Version(self.version) >= "20.15.0": self.requires("usockets/0.8.2") elif Version(self.version) >= "19.0.0": diff --git a/recipes/uwebsockets/config.yml b/recipes/uwebsockets/config.yml index be1e8815a9c32c..22cf3f5b226bf9 100644 --- a/recipes/uwebsockets/config.yml +++ b/recipes/uwebsockets/config.yml @@ -1,19 +1,11 @@ versions: - "20.36.0": + "20.48.0": folder: all - "20.17.0": + "20.47.0": folder: all - "20.14.0": - folder: all - "20.9.0": - folder: all - "20.8.0": + "20.45.0": folder: all "19.3.0": folder: all - "19.2.0": - folder: all - "19.1.0": - folder: all "18.3.0": folder: all diff --git a/recipes/v-hacd/all/conanfile.py b/recipes/v-hacd/all/conanfile.py index 0121a2fed52b85..7b0d91b5040841 100644 --- a/recipes/v-hacd/all/conanfile.py +++ b/recipes/v-hacd/all/conanfile.py @@ -16,6 +16,7 @@ class VhacdConan(ConanFile): topics = ("3d", "mesh", "shape", "decomposition", "convex") homepage = "https://github.com/kmammou/v-hacd" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -37,7 +38,7 @@ def package_id(self): def validate(self): 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( @@ -45,8 +46,7 @@ def validate(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): pass diff --git a/recipes/valijson/all/conanfile.py b/recipes/valijson/all/conanfile.py index 4c1f0676480adf..9e8080a170f305 100644 --- a/recipes/valijson/all/conanfile.py +++ b/recipes/valijson/all/conanfile.py @@ -13,6 +13,7 @@ class ValijsonConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tristanpenman/valijson" topics = ("json", "validator", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -31,7 +32,7 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) 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 @@ -46,12 +47,10 @@ def package(self): ) def package_info(self): + self.cpp_info.set_property("cmake_target_name", "ValiJSON::valijson") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.set_property("cmake_target_name", "ValiJSON::valijson") - self.cpp_info.components["libvalijson"].set_property("cmake_target_name", "ValiJSON::valijson") - # TODO: to remove in conan v2 once cmake_find_package_* generators removed # self.cpp_info.filenames["cmake_find_package"] = "valijson" # TBA: There's no installed config file # self.cpp_info.filenames["cmake_find_package_multi"] = "valijson" # TBA: There's no installed config file @@ -59,3 +58,6 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "ValiJSON" self.cpp_info.components["libvalijson"].names["cmake_find_package"] = "valijson" self.cpp_info.components["libvalijson"].names["cmake_find_package_multi"] = "valijson" + self.cpp_info.components["libvalijson"].set_property("cmake_target_name", "ValiJSON::valijson") + self.cpp_info.components["libvalijson"].bindirs = [] + self.cpp_info.components["libvalijson"].libdirs = [] diff --git a/recipes/valijson/all/test_package/CMakeLists.txt b/recipes/valijson/all/test_package/CMakeLists.txt index f283c4c7cf92c1..9fa0294a2d6c6e 100644 --- a/recipes/valijson/all/test_package/CMakeLists.txt +++ b/recipes/valijson/all/test_package/CMakeLists.txt @@ -8,11 +8,11 @@ find_package(RapidJSON REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries( - ${PROJECT_NAME} - PRIVATE - ValiJSON::valijson - nlohmann_json::nlohmann_json - picojson::picojson - rapidjson + ${PROJECT_NAME} + PRIVATE + ValiJSON::valijson + nlohmann_json::nlohmann_json + picojson::picojson + rapidjson ) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/valijson/all/test_package/conanfile.py b/recipes/valijson/all/test_package/conanfile.py index 44512632f983b5..81b93054985f72 100644 --- a/recipes/valijson/all/test_package/conanfile.py +++ b/recipes/valijson/all/test_package/conanfile.py @@ -12,7 +12,7 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires("nlohmann_json/3.9.1") + self.requires("nlohmann_json/3.11.2") self.requires("rapidjson/cci.20200410") self.requires("picojson/1.3.0") self.requires(self.tested_reference_str) @@ -25,10 +25,7 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - schema_file = os.path.abspath(os.path.join(self.source_folder, "schema.json")) - valid_file = os.path.abspath(os.path.join(self.source_folder, "valid.json")) - invalid_file = os.path.abspath(os.path.join(self.source_folder, "invalid.json")) - self.run( - "{} {} {} {}".format(bin_path, schema_file, valid_file, invalid_file), - run_environment=True - ) + schema_file = os.path.join(self.source_folder, "schema.json") + valid_file = os.path.join(self.source_folder, "valid.json") + invalid_file = os.path.join(self.source_folder, "invalid.json") + self.run(f"{bin_path} {schema_file} {valid_file} {invalid_file}", env="conanrun") diff --git a/recipes/valijson/all/test_v1_package/CMakeLists.txt b/recipes/valijson/all/test_v1_package/CMakeLists.txt index 679bcbb3ab1fd1..a2f6329c538d27 100644 --- a/recipes/valijson/all/test_v1_package/CMakeLists.txt +++ b/recipes/valijson/all/test_v1_package/CMakeLists.txt @@ -11,10 +11,10 @@ find_package(RapidJSON REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) target_link_libraries( - ${PROJECT_NAME} - ValiJSON::valijson - nlohmann_json::nlohmann_json - picojson::picojson - RapidJSON::RapidJSON + ${PROJECT_NAME} + ValiJSON::valijson + nlohmann_json::nlohmann_json + picojson::picojson + RapidJSON::RapidJSON ) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/valijson/all/test_v1_package/conanfile.py b/recipes/valijson/all/test_v1_package/conanfile.py index 1ffe3deaeb51c4..f02d6b2bb83203 100644 --- a/recipes/valijson/all/test_v1_package/conanfile.py +++ b/recipes/valijson/all/test_v1_package/conanfile.py @@ -4,7 +4,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) @@ -12,17 +12,14 @@ def build(self): cmake.build() def requirements(self): - self.requires("nlohmann_json/3.9.1") + self.requires("nlohmann_json/3.11.2") self.requires("rapidjson/cci.20200410") self.requires("picojson/1.3.0") def test(self): if not tools.cross_building(self.settings): bin_path = os.path.join("bin", "test_package") - schema_file = os.path.abspath(os.path.join(self.source_folder, os.pardir, "test_package", "schema.json")) - valid_file = os.path.abspath(os.path.join(self.source_folder, os.pardir, "test_package", "valid.json")) - invalid_file = os.path.abspath(os.path.join(self.source_folder, os.pardir, "test_package", "invalid.json")) - self.run( - "{} {} {} {}".format(bin_path, schema_file, valid_file, invalid_file), - run_environment=True - ) + schema_file = os.path.join(self.source_folder, os.pardir, "test_package", "schema.json") + valid_file = os.path.join(self.source_folder, os.pardir, "test_package", "valid.json") + invalid_file = os.path.join(self.source_folder, os.pardir, "test_package", "invalid.json") + self.run(f"{bin_path} {schema_file} {valid_file} {invalid_file}", run_environment=True) diff --git a/recipes/vc/all/conandata.yml b/recipes/vc/all/conandata.yml index b1e2f20f1981dd..ef285ad3397b4d 100644 --- a/recipes/vc/all/conandata.yml +++ b/recipes/vc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.3": + url: "https://github.com/VcDevel/Vc/archive/1.4.3.tar.gz" + sha256: "988ea0053f3fbf17544ca776a2749c097b3139089408b0286fa4e9e8513e037f" "1.4.2": url: "https://github.com/VcDevel/Vc/releases/download/1.4.2/Vc-1.4.2.tar.gz" sha256: "50d3f151e40b0718666935aa71d299d6370fafa67411f0a9e249fbce3e6e3952" diff --git a/recipes/vc/all/conanfile.py b/recipes/vc/all/conanfile.py index 7cfaddf7b08382..12e8e45ebe604c 100644 --- a/recipes/vc/all/conanfile.py +++ b/recipes/vc/all/conanfile.py @@ -4,17 +4,17 @@ from conan.tools.files import copy, get, replace_in_file, rmdir import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.50.0" class VcConan(ConanFile): name = "vc" description = "SIMD Vector Classes for C++." license = "BSD-3-Clause" - topics = ("vc", "simd", "vectorization", "parallel", "sse", "avx", "neon") + topics = ("simd", "vectorization", "parallel", "sse", "avx", "neon") homepage = "https://github.com/VcDevel/Vc" url = "https://github.com/conan-io/conan-center-index" - + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -31,12 +31,11 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) 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/vc/all/test_v1_package/CMakeLists.txt b/recipes/vc/all/test_v1_package/CMakeLists.txt index 492877a81dfa86..0d20897301b68b 100644 --- a/recipes/vc/all/test_v1_package/CMakeLists.txt +++ b/recipes/vc/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Vc REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE Vc::Vc) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/vc/config.yml b/recipes/vc/config.yml index 0ba616ecf92b28..f5a2ce84083be3 100644 --- a/recipes/vc/config.yml +++ b/recipes/vc/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.3": + folder: all "1.4.2": folder: all "1.4.1": diff --git a/recipes/vcglib/all/conanfile.py b/recipes/vcglib/all/conanfile.py index f452d7336181c3..b05d8f64d45598 100644 --- a/recipes/vcglib/all/conanfile.py +++ b/recipes/vcglib/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class VcglibConan(ConanFile): @@ -14,7 +14,7 @@ class VcglibConan(ConanFile): topics = ("vcglib", "mesh-processing") homepage = "https://github.com/cnr-isti-vclab/vcglib" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,24 +35,21 @@ 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("eigen/3.4.0") + # vcglib public headers include several eigen headers (for example vcg/math/matrix44.h includes Eigen/Core) + self.requires("eigen/3.4.0", transitive_headers=True) def validate(self): if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) 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/vcglib/all/test_v1_package/CMakeLists.txt b/recipes/vcglib/all/test_v1_package/CMakeLists.txt index 0b93c9e9b9c662..0d20897301b68b 100644 --- a/recipes/vcglib/all/test_v1_package/CMakeLists.txt +++ b/recipes/vcglib/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(vcglib REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE vcglib::vcglib) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/vectorclass/all/conanfile.py b/recipes/vectorclass/all/conanfile.py index 5696b99489d45d..60e6bdcdc723a7 100644 --- a/recipes/vectorclass/all/conanfile.py +++ b/recipes/vectorclass/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.files import copy, get import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.50.0" class VectorclassConan(ConanFile): @@ -18,7 +18,7 @@ class VectorclassConan(ConanFile): topics = ("vectorclass", "vector", "simd") homepage = "https://github.com/vectorclass/version2" url = "https://github.com/conan-io/conan-center-index" - + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -37,6 +37,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "Visual Studio": "15.7", + "msvc": "191", "gcc": "7", "clang": "4.0", "apple-clang": "9.1", @@ -50,10 +51,10 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.info.settings.os not in ["Linux", "Windows", "Macos"] or self.info.settings.arch not in ["x86", "x86_64"]: + if self.settings.os not in ["Linux", "Windows", "Macos"] or self.settings.arch not in ["x86", "x86_64"]: raise ConanInvalidConfiguration("vectorclass supports Linux/Windows/macOS and x86/x86_64 only.") - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) def loose_lt_semver(v1, v2): @@ -62,15 +63,14 @@ def loose_lt_semver(v1, v2): min_length = min(len(lv1), len(lv2)) return lv1[:min_length] < lv2[:min_length] - minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) - if minimum_version and loose_lt_semver(str(self.info.settings.compiler.version), minimum_version): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + 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.", ) 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/vectorclass/all/test_v1_package/CMakeLists.txt b/recipes/vectorclass/all/test_v1_package/CMakeLists.txt index 1d531c5d5a9305..0d20897301b68b 100644 --- a/recipes/vectorclass/all/test_v1_package/CMakeLists.txt +++ b/recipes/vectorclass/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(vectorclass REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE vectorclass::vectorclass) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/vectorial/all/conanfile.py b/recipes/vectorial/all/conanfile.py index fd7818ff4d997d..91f7fd34d7f37f 100644 --- a/recipes/vectorial/all/conanfile.py +++ b/recipes/vectorial/all/conanfile.py @@ -13,18 +13,18 @@ class VectorialConan(ConanFile): license = "BSD-2-Clause" homepage = "https://github.com/scoopr/vectorial" url = "https://github.com/conan-io/conan-center-index" + 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 @@ -35,8 +35,6 @@ def package(self): 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 = ["m"] diff --git a/recipes/vectorial/all/test_package/conanfile.py b/recipes/vectorial/all/test_package/conanfile.py index d120a992c06a69..0a6bc68712d901 100644 --- a/recipes/vectorial/all/test_package/conanfile.py +++ b/recipes/vectorial/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() diff --git a/recipes/vectorial/all/test_v1_package/CMakeLists.txt b/recipes/vectorial/all/test_v1_package/CMakeLists.txt index 394022f35f7caf..0d20897301b68b 100644 --- a/recipes/vectorial/all/test_v1_package/CMakeLists.txt +++ b/recipes/vectorial/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(vectorial REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE vectorial::vectorial) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) 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..d2c2b6bd073a1c --- /dev/null +++ b/recipes/very-simple-smtps/all/conanfile.py @@ -0,0 +1,120 @@ +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): + self.requires("doctest/2.4.11") + self.requires("libcurl/[>=7.78.0 <9]") + + 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/vir-simd/all/conandata.yml b/recipes/vir-simd/all/conandata.yml index e21aa490a4d135..f9462ed3ee48fa 100644 --- a/recipes/vir-simd/all/conandata.yml +++ b/recipes/vir-simd/all/conandata.yml @@ -1,6 +1,4 @@ sources: - # Newer versions at the top "0.2.0": - url: - - "https://github.com/mattkretz/vir-simd/archive/refs/tags/v0.2.0.tar.gz" + url: "https://github.com/mattkretz/vir-simd/archive/refs/tags/v0.2.0.tar.gz" sha256: "197432196ec73009051188ba686124a469d75d639fc5408613b30ed2981f0b70" diff --git a/recipes/vir-simd/all/conanfile.py b/recipes/vir-simd/all/conanfile.py index 830132a2e93bd1..b79fe3dc61b1b2 100644 --- a/recipes/vir-simd/all/conanfile.py +++ b/recipes/vir-simd/all/conanfile.py @@ -1,13 +1,13 @@ 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 copy, get from conan.tools.layout import basic_layout from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.50.0" class VirSIMDConan(ConanFile): @@ -29,7 +29,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "Visual Studio": "15", - "msvc": "19.15", + "msvc": "191", "gcc": "7", "clang": "5", "apple-clang": "5.1", @@ -38,7 +38,6 @@ def _compilers_minimum_version(self): def layout(self): basic_layout(self, src_folder="src") - # same package ID for any package def package_id(self): self.info.clear() @@ -71,19 +70,7 @@ def package(self): ) def package_info(self): - # Folders not used for header-only - self.cpp_info.bindirs = [] - self.cpp_info.libdirs = [] - - # Set these to the appropriate values if the package has an official FindPACKAGE.cmake - # listed in https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules - # examples: bzip2, freetype, gdal, icu, libcurl, libjpeg, libpng, libtiff, openssl, sqlite3, zlib... - self.cpp_info.set_property("cmake_module_file_name", "vir-simd") - self.cpp_info.set_property("cmake_module_target_name", "vir-simd::vir-simd") - # Set these to the appropriate values if package provides a CMake config file - # (package-config.cmake or packageConfig.cmake, with package::package target, usually installed in /lib/cmake//) self.cpp_info.set_property("cmake_file_name", "vir-simd") self.cpp_info.set_property("cmake_target_name", "vir-simd::vir-simd") - # Set this to the appropriate value if the package provides a pkgconfig file - # (package.pc, usually installed in /lib/pkgconfig/) - self.cpp_info.set_property("pkg_config_name", "vir-simd") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/vir-simd/all/test_package/conanfile.py b/recipes/vir-simd/all/test_package/conanfile.py index 0a808db45f2453..3a91c9439218e3 100644 --- a/recipes/vir-simd/all/test_package/conanfile.py +++ b/recipes/vir-simd/all/test_package/conanfile.py @@ -4,7 +4,6 @@ import os -# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" diff --git a/recipes/visit_struct/all/conanfile.py b/recipes/visit_struct/all/conanfile.py index b4d861bfec980d..7cb8d11207ec2e 100644 --- a/recipes/visit_struct/all/conanfile.py +++ b/recipes/visit_struct/all/conanfile.py @@ -34,7 +34,7 @@ def layout(self): def requirements(self): if self.options.with_boost_fusion or self.options.with_boost_hana: - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") def package_id(self): self.info.clear() 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/vsg/all/conandata.yml b/recipes/vsg/all/conandata.yml index f79242254e9e4b..3b2abd6731e518 100644 --- a/recipes/vsg/all/conandata.yml +++ b/recipes/vsg/all/conandata.yml @@ -8,3 +8,6 @@ sources: "1.0.5": url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/v1.0.5.tar.gz" sha256: "ff58260fcb88d19d92c40a70bc40ff06abb1a8805568eb76862a036d13ada75b" + "1.0.9": + url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/v1.0.9.tar.gz" + sha256: "9a62be7facc13c391c33dc8356b147a3b86f531ea72a28f6b2c364777e761412" diff --git a/recipes/vsg/config.yml b/recipes/vsg/config.yml index 058c041064a224..9269a45607b90a 100644 --- a/recipes/vsg/config.yml +++ b/recipes/vsg/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.9": + folder: all "1.0.5": folder: all "1.0.3": diff --git a/recipes/vtu11/all/conandata.yml b/recipes/vtu11/all/conandata.yml index d079b9a80f8269..bb58ee7fddaeec 100644 --- a/recipes/vtu11/all/conandata.yml +++ b/recipes/vtu11/all/conandata.yml @@ -3,8 +3,3 @@ sources: url: - "https://github.com/phmkopp/vtu11/archive/refs/tags/v1.2.tar.gz" sha256: "c2b560d397c1a86c10e13f029b4ef08621f70ca4c897c44c19e7d025f11baec3" -patches: - "1.2": - - patch_file: "patches/0001-use-CPP17-filesystem-by-default.patch" - patch_description: "Use C++17 filesystem by default when compiling with C++17" - patch_type: "portability" diff --git a/recipes/vtu11/all/conanfile.py b/recipes/vtu11/all/conanfile.py index 389169052faba6..db420586fda774 100644 --- a/recipes/vtu11/all/conanfile.py +++ b/recipes/vtu11/all/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile -from conan.tools.build import check_min_cppstd, valid_min_cppstd -from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy from conan.tools.layout import basic_layout import os +from conan.tools.microsoft import is_msvc required_conan_version = ">=1.53.0" @@ -14,7 +15,9 @@ class PackageConan(ConanFile): license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/phmkopp/vtu11" - topics = ("vtu", "c++11") + topics = ("vtu", "c++11", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True options = { @@ -28,15 +31,12 @@ class PackageConan(ConanFile): def _min_cppstd(self): return 11 - def export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.13", transitive_headers=True) + self.requires("zlib/[>=1.2.11 <2]") def package_id(self): self.info.clear() @@ -48,10 +48,6 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - if valid_min_cppstd(self, 17): - apply_conandata_patches(self) - def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy( @@ -68,6 +64,10 @@ def package_info(self): if self.options.with_zlib: self.cpp_info.defines = ["VTU11_ENABLE_ZLIB"] + # The library uses __cplusplus for feature detection, ensure vs returns the proper one + if is_msvc(self): + self.cpp_info.cxxflags.append("/Zc:__cplusplus") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "vtu11" self.cpp_info.filenames["cmake_find_package_multi"] = "vtu11" diff --git a/recipes/vtu11/all/patches/0001-use-CPP17-filesystem-by-default.patch b/recipes/vtu11/all/patches/0001-use-CPP17-filesystem-by-default.patch deleted file mode 100644 index eb80c0e4f2b2f3..00000000000000 --- a/recipes/vtu11/all/patches/0001-use-CPP17-filesystem-by-default.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/vtu11/inc/alias.hpp -+++ b/vtu11/inc/alias.hpp -@@ -40,20 +40,14 @@ using Byte = unsigned char; - #define VTU11_ASCII_FLOATING_POINT_FORMAT "%.6g" - #endif - --// To dynamically select std::filesystem where available, you could use: --#if defined(__cplusplus) && __cplusplus >= 201703L -- #if __has_include() // has_include is C++17 -- #include -- namespace vtu11fs = std::filesystem; -- #elif __has_include() -- #include -- namespace vtu11fs = std::experimental::filesystem; -- #else -- #include "inc/filesystem.hpp" -- namespace vtu11fs = ghc::filesystem; -- #endif -+#if __has_include() // has_include is C++17 -+ #include -+ namespace vtu11fs = std::filesystem; -+#elif __has_include() -+ #include -+ namespace vtu11fs = std::experimental::filesystem; - #else -- #include "vtu11/inc/filesystem.hpp" -+ #include "inc/filesystem.hpp" - namespace vtu11fs = ghc::filesystem; - #endif - --- -2.34.1 - diff --git a/recipes/vulkan-headers/all/conandata.yml b/recipes/vulkan-headers/all/conandata.yml index a1c2b295687960..a2e54aa68230e5 100644 --- a/recipes/vulkan-headers/all/conandata.yml +++ b/recipes/vulkan-headers/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.3.268.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "94993cbe2b1a604c0d5d9ea37a767e1aba4d771d2bfd4ddceefd66243095164f" + "1.3.261.1": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "7a25ebdb6325e626dc5d33bc937b289ccce7ddb7b0ac1a1b1d5d7ff33b6715d3" "1.3.250.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.250.0.tar.gz" sha256: "0da601a81b868bc543ec09ab7e514d1b059774993dfce81df7150f432c8bf33a" @@ -8,81 +14,6 @@ sources: "1.3.239.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.239.0.tar.gz" sha256: "865fa8e8e8314fcca60777a92f50bd0cf612205a36e719d6975482d3366f619e" - "1.3.236.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.236.0.tar.gz" - sha256: "2df85b3daa78ced7f910db870ea2aed10f718c703e18076b4549ca4005c9c451" - "1.3.231.1": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.231.1.tar.gz" - sha256: "6e16051ccb28821b907a08025eedb82cc73e1056924b32f75880ecae2499f7f6" - "1.3.231.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.231.0.tar.gz" - sha256: "f7c185dedf7753d58e7b59913dd4b77006a6ed91fae598c5961f77d85b183da0" - "1.3.231": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.231.tar.gz" - sha256: "4cb1c0aeb858e1a4955a736b86b0da8511ca8701222e9a252adcf093d40a8d28" - "1.3.224.1": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.224.1.tar.gz" - sha256: "628bd5943c0d007c192769480e789801a088f892445c80cb336fc9b6d236c5ef" - "1.3.224.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.224.0.tar.gz" - sha256: "ccdfa47cea58a080957481fb6c35908d005d04cc5dd1778150dc0c651ccea077" - "1.3.221": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.3.221.tar.gz" - sha256: "75057d8231bb7a3f6ac091f1b08f50604f07a7e9b4424fd12c035f01787ebf0c" - "1.3.216.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.216.0.tar.gz" - sha256: "2c98d1d819fde588fb0f71acebea177f805b3efa26e8260a707a94b1e633be6b" - "1.3.211.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.211.0.tar.gz" - sha256: "c464bcdc24b7541ac4378a270617a23d4d92699679a73f95dc4b9e1da924810a" - "1.3.204.1": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.204.1.tar.gz" - sha256: "9c4d33f71467c915749fbf48c0c3a8ee7833f15babf398e3463cd88791fb592e" - "1.3.204.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.204.0.tar.gz" - sha256: "5c3fcfc5dc1daa5fa1f3a0983fdcb344848f846ae34d933412d13456ebee10c1" - "1.3.204": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.204.tar.gz" - sha256: "2cde2c90975a8f36d00cf8eb6308cb00323aafbc0b7374f4b346f1140f760b3d" "1.2.198.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.2.198.0.tar.gz" sha256: "34782c61cad9b3ccf2fa0a31ec397d4fce99490500b4f3771cb1a48713fece80" - "1.2.198": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.198.tar.gz" - sha256: "0b2c69bc392a0022652f65efe5c51ec39ae90ec427065a914ba74ac6c728db30" - "1.2.195": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.195.tar.gz" - sha256: "8d6e561871bb4dbb7f83e80eac41b3a582dbd874382990c7e4972cb0258fa529" - "1.2.190": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.190.tar.gz" - sha256: "ce997a3d6f43f9697c5ec232efb0f6e7826d0648412ed141f9495e88429075e0" - "1.2.189": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.189.tar.gz" - sha256: "0939d6cb950746f6f9cab59399c0a99628ed186426a972996599f90d34d8a99a" - "1.2.182": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.182.tar.gz" - sha256: "38d1c953de7bb2d839556226851feeb690f0d23bc22ac46c823dcb66c97bfdc8" - "1.2.176.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.2.176.0.tar.gz" - sha256: "211d8552c5cf8b0607323d69c251d9c4639f89550f8de3d51d3995b5cdd737fb" - "1.2.172": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.172.tar.gz" - sha256: "c69619ac2001ac62378a99c56ced14a53801fdc204efb2b1f787c83b47829319" - "1.2.170.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.170.0.tar.gz" - sha256: "d8e6050230ca678bcb0e7dc68d5984290da6eb655e8da9d08b5eaab1e84a7da9" - "1.2.170": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.170.tar.gz" - sha256: "6fa84897197bd72cf4b1a686c903df67fc0fe108e4ed02e6adb3d72c468f1c1f" - "1.2.162.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.162.0.tar.gz" - sha256: "eb0f6a79ac38e137f55a0e13641140e63b765c8ec717a65bf3904614ef754365" - "1.2.162": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.162.tar.gz" - sha256: "deab1a7a28ad3e0a7a0a1c4cd9c54758dce115a5f231b7205432d2bbbfb4d456" - "1.2.154.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.154.0.tar.gz" - sha256: "a0528ade4dd3bd826b960ba4ccabc62e92ecedc3c70331b291e0a7671b3520f9" - "1.2.140": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.140.tar.gz" - sha256: "c708a05b0ef673ae783f8968c5396dc207b9f8c7cde2ddb4a9a281e04661185a" diff --git a/recipes/vulkan-headers/all/conanfile.py b/recipes/vulkan-headers/all/conanfile.py index a17cf251c00d3f..f2e2e4c12ab8e6 100644 --- a/recipes/vulkan-headers/all/conanfile.py +++ b/recipes/vulkan-headers/all/conanfile.py @@ -30,7 +30,7 @@ def build(self): pass def package(self): - copy(self, "LICENSE.txt", 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")) 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, "registry"), dst=os.path.join(self.package_folder, "res", "vulkan", "registry")) diff --git a/recipes/vulkan-headers/config.yml b/recipes/vulkan-headers/config.yml index f84f6da3852f9d..34a8efbe223078 100644 --- a/recipes/vulkan-headers/config.yml +++ b/recipes/vulkan-headers/config.yml @@ -1,59 +1,13 @@ versions: + "1.3.268.0": + folder: all + "1.3.261.1": + folder: all "1.3.250.0": 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.231.0": - folder: all - "1.3.231": - folder: all - "1.3.224.1": - folder: all - "1.3.224.0": - folder: all - "1.3.221": - folder: all - "1.3.216.0": - folder: all - "1.3.211.0": - folder: all - "1.3.204.1": - folder: all - "1.3.204.0": - folder: all - "1.3.204": - folder: all "1.2.198.0": folder: all - "1.2.198": - folder: all - "1.2.195": - folder: all - "1.2.190": - folder: all - "1.2.189": - folder: all - "1.2.182": - folder: all - "1.2.176.0": - folder: all - "1.2.172": - folder: all - "1.2.170.0": - folder: all - "1.2.170": - folder: all - "1.2.162.0": - folder: all - "1.2.162": - folder: all - "1.2.154.0": - folder: all - "1.2.140": - folder: all diff --git a/recipes/vulkan-loader/all/conandata.yml b/recipes/vulkan-loader/all/conandata.yml index fceeca688d80b6..b31ce6fd5b07a5 100644 --- a/recipes/vulkan-loader/all/conandata.yml +++ b/recipes/vulkan-loader/all/conandata.yml @@ -1,78 +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.231.1": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.231.1.tar.gz" - sha256: "5226fbc6a90e4405200c8cfdd5733d5e0c6a64e64dcc614c485ea06e03d66578" - "1.3.231": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/v1.3.231.tar.gz" - sha256: "02e185b939635167ea8f8815f8daab76af36923a3b995951fe6a5d3e25c55bf7" - "1.3.224.0": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.224.0.tar.gz" - sha256: "9f102a89b7d350ce5a6c82887459821aa9725c521128495ed7cbda637ed52022" - "1.3.221": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/v1.3.221.tar.gz" - sha256: "ba7042b2b14a11646ba8bd33c041ccb4f1abe5bdfa2758e301a76bf6d31d2748" - "1.3.216.0": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.216.0.tar.gz" - sha256: "46188d3db019409b82f850628d5c175cc59dcdb3ce146f5c023b97709f67e8f1" - "1.3.211.0": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.211.0.tar.gz" - sha256: "bb42a8e0dda103f98bddb9ae2311ae8e8e988588b600a1114b74a1ba3a0843f4" - "1.3.204.1": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.204.1.tar.gz" - sha256: "5dcd42b564804f4c01891ddd429a4a5028113c4cf39b44256689e8f543773134" - "1.3.204.0": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.204.0.tar.gz" - sha256: "7e9700f454007ea6f1e6eb097a905e7c30ad2be740ddd9e76235658c98db2ddd" "1.2.198.0": url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.2.198.0.tar.gz" sha256: "7d5d56296dcd88af84ed0fde969038370cac8600c4ef7e328788b7422d9025bb" - "1.2.190": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/v1.2.190.tar.gz" - sha256: "f940bb72d123173187c5c341edb7af55fddc68efa79460f9b703a80e9f4bca44" - "1.2.189": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/v1.2.189.tar.gz" - sha256: "6e05f54a0c6a35625e8974f88c197b1817b2bddb253c38540ced9d2bc8132d6c" - "1.2.182": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/v1.2.182.tar.gz" - sha256: "0d1f9fde9d21642526e9baa55d30364c95035c4fe3c6db96836631991b44dd90" - "1.2.172": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/v1.2.172.tar.gz" - sha256: "713dcb73c73194d17251fcd9cff62e5831d4ec30dac2efcf6440595016368ddb" - "1.2.170.0": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/sdk-1.2.170.0.tar.gz" - sha256: "08c125987d4f6b086fcf952be7dce630b677fc943b336030178737bb1eb2ed49" - "1.2.162.0": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/sdk-1.2.162.0.tar.gz" - sha256: "f8f5ec2485e7fdba3f58c1cde5a25145ece1c6a686c91ba4016b28c0af3f21dd" - "1.2.154.0": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/sdk-1.2.154.0.tar.gz" - sha256: "418017d7bab907e72291476df231dd0e7dc7fe20b97e55389c975bcfc48d6433" 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" - "1.3.231.1": - - patch_file: "patches/1.3.231.1-0001-no-find-package-wayland.patch" - patch_description: "CMake: remove attempt to find Wayland" - patch_type: "portability" - patch_source: "https://github.com/KhronosGroup/Vulkan-Loader/pull/1020" - "1.2.182": - - patch_file: "patches/1.2.182-0001-fix-mingw.patch" - patch_description: "Fix MinGW" - patch_type: "portability" - "1.2.154.0": - - patch_file: "patches/1.2.154.0-0001-fix-mingw.patch" - patch_description: "Fix MinGW" - patch_type: "portability" - patch_source: - - "https://github.com/KhronosGroup/Vulkan-Loader/pull/475" - - "https://github.com/KhronosGroup/Vulkan-Loader/pull/495" - - "https://github.com/KhronosGroup/Vulkan-Loader/pull/523" + 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 7d7adac29c32fb..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") @@ -77,7 +64,7 @@ def requirements(self): if self.options.get_safe("with_wsi_xcb") or self.options.get_safe("with_wsi_xlib"): self.requires("xorg/system") if Version(self.version) < "1.3.231" and self.options.get_safe("with_wsi_wayland"): - self.requires("wayland/1.21.0") + self.requires("wayland/1.22.0") def validate(self): if self.options.get_safe("with_wsi_directfb"): @@ -92,9 +79,11 @@ def validate(self): def build_requirements(self): if self._is_pkgconf_needed: 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._is_mingw: self.tool_requires("jwasm/2.13") + if Version(self.version) >= "1.3.234": + self.tool_requires("cmake/[>=3.17.2 <4.0]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -115,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 @@ -136,23 +123,41 @@ 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", "") # This fix is needed due to CMAKE_FIND_PACKAGE_PREFER_CONFIG ON in CMakeToolchain (see https://github.com/conan-io/conan/issues/10387). # Indeed we want to use upstream Find modules of xcb, x11, wayland and directfb. There are properly using pkgconfig under the hood. - replace_in_file(self, cmakelists, "find_package(XCB REQUIRED)", "find_package(XCB REQUIRED MODULE)") - replace_in_file(self, cmakelists, "find_package(X11 REQUIRED)", "find_package(X11 REQUIRED MODULE)") + if Version(self.version) < "1.3.234": + replace_in_file(self, cmakelists, "find_package(XCB REQUIRED)", "find_package(XCB REQUIRED MODULE)") + replace_in_file(self, cmakelists, "find_package(X11 REQUIRED)", "find_package(X11 REQUIRED MODULE)") # find_package(Wayland REQUIRED) was removed, as it was unused if Version(self.version) < "1.3.231": replace_in_file(self, cmakelists, "find_package(Wayland REQUIRED)", "find_package(Wayland REQUIRED MODULE)") - replace_in_file(self, cmakelists, "find_package(DirectFB REQUIRED)", "find_package(DirectFB REQUIRED MODULE)") + if Version(self.version) < "1.3.234": + replace_in_file(self, cmakelists, "find_package(DirectFB REQUIRED)", "find_package(DirectFB REQUIRED MODULE)") def build(self): self._patch_sources() @@ -164,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.2.154.0-0001-fix-mingw.patch b/recipes/vulkan-loader/all/patches/1.2.154.0-0001-fix-mingw.patch deleted file mode 100644 index a585b5a17fff50..00000000000000 --- a/recipes/vulkan-loader/all/patches/1.2.154.0-0001-fix-mingw.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- a/loader/CMakeLists.txt -+++ b/loader/CMakeLists.txt -@@ -133,9 +133,28 @@ set(ASM_FAILURE_MSG "${ASM_FAILURE_MSG}Note that this may be unsafe, as the C co - set(ASM_FAILURE_MSG "${ASM_FAILURE_MSG} the stack frame for certain calls. If the compiler does not do this, then unknown device") - set(ASM_FAILURE_MSG "${ASM_FAILURE_MSG} extensions will suffer from a corrupted stack.") - if(WIN32) -- enable_language(ASM_MASM) -- if(CMAKE_ASM_MASM_COMPILER_WORKS) -- if(NOT CMAKE_CL_64) -+ if(MINGW) -+ find_program(JWASM_FOUND jwasm) -+ if (JWASM_FOUND) -+ set(CMAKE_ASM_MASM_COMPILER ${JWASM_FOUND}) -+ execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE COMPILER_VERSION_OUTPUT) -+ if (COMPILER_VERSION_OUTPUT) -+ if (COMPILER_VERSION_OUTPUT MATCHES "x86_64") -+ set(JWASM_FLAGS -win64) -+ else() -+ set(JWASM_FLAGS -coff) -+ endif() -+ endif() -+ endif() -+ endif() -+ option(USE_MASM "Use MASM" ON) -+ if (USE_MASM) -+ enable_language(ASM_MASM) -+ endif () -+ if(CMAKE_ASM_MASM_COMPILER_WORKS OR JWASM_FOUND) -+ if(MINGW) -+ set(CMAKE_ASM_MASM_FLAGS ${CMAKE_ASM_MASM_FLAGS} ${JWASM_FLAGS}) -+ elseif(NOT CMAKE_CL_64 AND NOT JWASM_FOUND) - set(CMAKE_ASM_MASM_FLAGS ${CMAKE_ASM_MASM_FLAGS} /safeseh) - endif() - -@@ -205,14 +224,16 @@ if(WIN32) - PROPERTIES LINK_FLAGS_DEBUG - "/ignore:4098" - OUTPUT_NAME -- vulkan-1) -+ vulkan-1 -+ PREFIX -+ "") - target_link_libraries(vulkan Vulkan::Headers) - - if(ENABLE_WIN10_ONECORE) - target_link_libraries(vulkan OneCoreUAP.lib LIBCMT.LIB LIBCMTD.LIB LIBVCRUNTIME.LIB LIBUCRT.LIB) - set_target_properties(vulkan PROPERTIES LINK_FLAGS "/NODEFAULTLIB") - else() -- target_link_libraries(vulkan Cfgmgr32) -+ target_link_libraries(vulkan cfgmgr32) - endif() - - add_dependencies(vulkan loader_asm_gen_files) ---- a/loader/loader.c -+++ b/loader/loader.c -@@ -71,6 +71,9 @@ - #include - #include - #include -+#ifdef __MINGW32__ -+#undef strcpy // fix error with redfined strcpy when building with MinGW-w64 -+#endif - #include - #include "adapters.h" - -@@ -695,7 +698,11 @@ VkResult loaderGetDeviceRegistryFiles(const struct loader_instance *inst, char * - LPCSTR value_name) { - static const wchar_t *softwareComponentGUID = L"{5c4c3332-344d-483c-8739-259e934c9cc8}"; - static const wchar_t *displayGUID = L"{4d36e968-e325-11ce-bfc1-08002be10318}"; -+#ifdef CM_GETIDLIST_FILTER_PRESENT - const ULONG flags = CM_GETIDLIST_FILTER_CLASS | CM_GETIDLIST_FILTER_PRESENT; -+#else -+ const ULONG flags = 0x300; -+#endif - - wchar_t childGuid[MAX_GUID_STRING_LEN + 2]; // +2 for brackets {} - ULONG childGuidSize = sizeof(childGuid); diff --git a/recipes/vulkan-loader/all/patches/1.2.182-0001-fix-mingw.patch b/recipes/vulkan-loader/all/patches/1.2.182-0001-fix-mingw.patch deleted file mode 100644 index b0cda85f0d7382..00000000000000 --- a/recipes/vulkan-loader/all/patches/1.2.182-0001-fix-mingw.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/loader/CMakeLists.txt -+++ b/loader/CMakeLists.txt -@@ -229,7 +229,6 @@ if(WIN32) - $ - ${CMAKE_CURRENT_SOURCE_DIR}/vulkan-1.def - ${CMAKE_CURRENT_SOURCE_DIR}/loader.rc) -- if(MSVC) - set_target_properties(vulkan - PROPERTIES - #LINK_FLAGS_DEBUG "/ignore:4098" -@@ -237,13 +236,6 @@ if(WIN32) - vulkan-1 - PREFIX - "") -- else() -- set_target_properties(vulkan -- PROPERTIES -- LIBRARY_OUTPUT_NAME vulkan -- RUNTIME_OUTPUT_NAME vulkan-1 -- ARCHIVE_OUTPUT_NAME vulkan) -- endif() - target_link_libraries(vulkan Vulkan::Headers) - - if(MSVC AND ENABLE_WIN10_ONECORE) diff --git a/recipes/vulkan-loader/all/patches/1.3.231.1-0001-no-find-package-wayland.patch b/recipes/vulkan-loader/all/patches/1.3.231.1-0001-no-find-package-wayland.patch deleted file mode 100644 index 0f841d44ccf387..00000000000000 --- a/recipes/vulkan-loader/all/patches/1.3.231.1-0001-no-find-package-wayland.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -215,10 +215,6 @@ if(UNIX AND NOT APPLE) # i.e.: Linux - find_package(X11 REQUIRED) - endif() - -- if(BUILD_WSI_WAYLAND_SUPPORT) -- find_package(Wayland REQUIRED) -- include_directories(SYSTEM ${WAYLAND_CLIENT_INCLUDE_DIR}) -- endif() - - if(BUILD_WSI_DIRECTFB_SUPPORT) - find_package(DirectFB REQUIRED) 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/all/test_v1_package/conanfile.py b/recipes/vulkan-loader/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d81..00000000000000 --- a/recipes/vulkan-loader/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" - - 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/vulkan-loader/config.yml b/recipes/vulkan-loader/config.yml index 493a9fc0ba0351..a9f30cdd286b92 100644 --- a/recipes/vulkan-loader/config.yml +++ b/recipes/vulkan-loader/config.yml @@ -1,37 +1,11 @@ versions: - "1.3.239.0": - folder: all - "1.3.236.0": - folder: all - "1.3.231.1": - folder: all - "1.3.231": + "1.3.268.0": folder: all - "1.3.224.0": + "1.3.250.0": folder: all - "1.3.221": + "1.3.243.0": folder: all - "1.3.216.0": - folder: all - "1.3.211.0": - folder: all - "1.3.204.1": - folder: all - "1.3.204.0": + "1.3.239.0": folder: all "1.2.198.0": folder: all - "1.2.190": - folder: all - "1.2.189": - folder: all - "1.2.182": - folder: all - "1.2.172": - folder: all - "1.2.170.0": - folder: all - "1.2.162.0": - folder: all - "1.2.154.0": - folder: all diff --git a/recipes/vulkan-memory-allocator/all/conandata.yml b/recipes/vulkan-memory-allocator/all/conandata.yml index d35351a8d12e75..7d88177b91710e 100644 --- a/recipes/vulkan-memory-allocator/all/conandata.yml +++ b/recipes/vulkan-memory-allocator/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231120": + url: "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/5e43c795daf43dd09398d8307212e85025215052.tar.gz" + sha256: "1ee9922fb059bc3b1dc5bbf71020e7a590b6ceb27fc3025d746e15be53fe31b7" "3.0.1": url: "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/refs/tags/v3.0.1.tar.gz" sha256: "2a84762b2d10bf540b9dc1802a198aca8ad1f3d795a4ae144212c595696a360c" @@ -9,5 +12,22 @@ sources: url: "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/v2.3.0.zip" sha256: "1c222c372e90f1a0d5e765420974842cf2503683ca14c30f8a0df340ba541f02" patches: + "3.0.1": + - patch_file: "patches/3.0.1-add-missing-cstdio.patch" + patch_source: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/commit/29d492b60c84ca784ea0943efc7d2e6e0f3bdaac + patch_type: backport + patch_description: Needed to build with GCC 13+ "3.0.0": - patch_file: "patches/0001-fix-appleclang.patch" + patch_source: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/commit/3f9f66740aa6cd8a329cc738c21aaff9020fed46 + patch_type: backport + patch_description: Needed to build with apple-clang 13.1+ + - patch_file: "patches/3.0.0-add-missing-cstdio.patch" + patch_source: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/commit/29d492b60c84ca784ea0943efc7d2e6e0f3bdaac + patch_type: backport + patch_description: Needed to build with GCC 13+ + "2.3.0": + - patch_file: "patches/2.3.0-add-missing-cstdio.patch" + patch_source: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/commit/29d492b60c84ca784ea0943efc7d2e6e0f3bdaac + patch_type: backport + patch_description: Needed to build with GCC 13+ diff --git a/recipes/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch b/recipes/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch index 85be3b03af7437..0cfd3c5acf8f4d 100644 --- a/recipes/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch +++ b/recipes/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch @@ -1,5 +1,3 @@ -from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/commit/3f9f66740aa6cd8a329cc738c21aaff9020fed46 - --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -2569,6 +2569,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( diff --git a/recipes/vulkan-memory-allocator/all/patches/2.3.0-add-missing-cstdio.patch b/recipes/vulkan-memory-allocator/all/patches/2.3.0-add-missing-cstdio.patch new file mode 100644 index 00000000000000..ef7fe08191476c --- /dev/null +++ b/recipes/vulkan-memory-allocator/all/patches/2.3.0-add-missing-cstdio.patch @@ -0,0 +1,15 @@ +diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h +index 32258b4..8da6bba 100644 +--- a/src/vk_mem_alloc.h ++++ b/src/vk_mem_alloc.h +@@ -3470,6 +3470,10 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage( + #include + #include + ++#if VMA_STATS_STRING_ENABLED ++ #include // For snprintf ++#endif ++ + /******************************************************************************* + CONFIGURATION SECTION + diff --git a/recipes/vulkan-memory-allocator/all/patches/3.0.0-add-missing-cstdio.patch b/recipes/vulkan-memory-allocator/all/patches/3.0.0-add-missing-cstdio.patch new file mode 100644 index 00000000000000..2852a9bd33619d --- /dev/null +++ b/recipes/vulkan-memory-allocator/all/patches/3.0.0-add-missing-cstdio.patch @@ -0,0 +1,15 @@ +diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h +index 3b395a7..542191c 100644 +--- a/include/vk_mem_alloc.h ++++ b/include/vk_mem_alloc.h +@@ -2575,6 +2575,10 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #include // For functions like __popcnt, _BitScanForward etc. + #endif + ++#if VMA_STATS_STRING_ENABLED ++ #include // For snprintf ++#endif ++ + /******************************************************************************* + CONFIGURATION SECTION + diff --git a/recipes/vulkan-memory-allocator/all/patches/3.0.1-add-missing-cstdio.patch b/recipes/vulkan-memory-allocator/all/patches/3.0.1-add-missing-cstdio.patch new file mode 100644 index 00000000000000..bab772d3242d78 --- /dev/null +++ b/recipes/vulkan-memory-allocator/all/patches/3.0.1-add-missing-cstdio.patch @@ -0,0 +1,15 @@ +diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h +index 60f5720..31164bc 100644 +--- a/include/vk_mem_alloc.h ++++ b/include/vk_mem_alloc.h +@@ -2578,6 +2578,10 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #include // For std::popcount + #endif + ++#if VMA_STATS_STRING_ENABLED ++ #include // For snprintf ++#endif ++ + /******************************************************************************* + CONFIGURATION SECTION + diff --git a/recipes/vulkan-memory-allocator/config.yml b/recipes/vulkan-memory-allocator/config.yml index 6220702ac9b05b..d260c9a9e2cada 100644 --- a/recipes/vulkan-memory-allocator/config.yml +++ b/recipes/vulkan-memory-allocator/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20231120": + folder: all "3.0.1": folder: all "3.0.0": diff --git a/recipes/vulkan-validationlayers/all/conandata.yml b/recipes/vulkan-validationlayers/all/conandata.yml index cce0aea3d2aac2..71fbe37f78e180 100644 --- a/recipes/vulkan-validationlayers/all/conandata.yml +++ b/recipes/vulkan-validationlayers/all/conandata.yml @@ -17,18 +17,6 @@ sources: "1.3.211.0": url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.211.0.tar.gz" sha256: "927c1cb98c81fe8a1a529cf2d977d701dcda49c495a19583dc00e178b6757203" - "1.3.204.1": - url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.204.1.tar.gz" - sha256: "a5e658a4c1f504ae38488acdbe2ab2799e2ae4b626104d76776f1c24b079f341" - "1.2.198.0": - url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.2.198.0.tar.gz" - sha256: "4a70cc5da26baf873fcf69b081eeeda545515dd66e5904f18fee32b4d275593a" - "1.2.189.2": - url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.2.189.2.tar.gz" - sha256: "f59eb2c7d601c155a528b62637277b9ef4beb5132cbf868eb3779c7d4415bb1c" - "1.2.182": - url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/v1.2.182.tar.gz" - sha256: "5a1f7027c06a8e5ae777d9053b5ce46f10ca623806a43332eb2da06fe46476d4" patches: "1.3.239.0": - patch_file: "patches/1.3.239.0-0001-fix-cmake.patch" @@ -57,19 +45,3 @@ patches: - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" patch_description: "CMake: Adapt to conan" patch_type: "conan" - "1.3.204.1": - - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" - patch_description: "CMake: Adapt to conan" - patch_type: "conan" - "1.2.198.0": - - patch_file: "patches/1.2.198.0-0001-fix-cmake.patch" - patch_description: "CMake: Adapt to conan" - patch_type: "conan" - "1.2.189.2": - - patch_file: "patches/1.2.189.2-0001-fix-cmake.patch" - patch_description: "CMake: Adapt to conan" - patch_type: "conan" - "1.2.182": - - patch_file: "patches/1.2.182-0001-fix-cmake.patch" - patch_description: "CMake: Adapt to conan" - patch_type: "conan" diff --git a/recipes/vulkan-validationlayers/all/conanfile.py b/recipes/vulkan-validationlayers/all/conanfile.py index 9b4e7e7f28c9e2..9ce6269563249b 100644 --- a/recipes/vulkan-validationlayers/all/conanfile.py +++ b/recipes/vulkan-validationlayers/all/conanfile.py @@ -106,7 +106,7 @@ def requirements(self): if self.options.get_safe("with_wsi_xcb") or self.options.get_safe("with_wsi_xlib"): self.requires("xorg/system") if self._needs_wayland_for_build: - self.requires("wayland/1.21.0") + self.requires("wayland/1.22.0") def _require(self, recipe_name): if recipe_name not in self._dependencies_versions: @@ -137,7 +137,7 @@ def loose_lt_semver(v1, v2): def build_requirements(self): if self._needs_pkg_config and 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) >= "1.3.239": self.tool_requires("cmake/[>=3.17.2 <4]") diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.182.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.182.yml deleted file mode 100644 index c3e6505e83271f..00000000000000 --- a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.182.yml +++ /dev/null @@ -1,3 +0,0 @@ -spirv-headers: "cci.20210616" -spirv-tools: "2021.2" -vulkan-headers: "1.2.182" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.189.2.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.189.2.yml deleted file mode 100644 index dd52c0e08b282c..00000000000000 --- a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.189.2.yml +++ /dev/null @@ -1,3 +0,0 @@ -spirv-headers: "cci.20210811" -spirv-tools: "2021.3" -vulkan-headers: "1.2.189" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.198.0.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.198.0.yml deleted file mode 100644 index ac36ea35232c53..00000000000000 --- a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.198.0.yml +++ /dev/null @@ -1,3 +0,0 @@ -spirv-headers: "1.2.198.0" -spirv-tools: "2021.4" -vulkan-headers: "1.2.198.0" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.204.1.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.204.1.yml deleted file mode 100644 index e19c38225be300..00000000000000 --- a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.204.1.yml +++ /dev/null @@ -1,3 +0,0 @@ -spirv-headers: "1.3.204.0" -spirv-tools: "1.3.204.0" -vulkan-headers: "1.3.204.1" diff --git a/recipes/vulkan-validationlayers/config.yml b/recipes/vulkan-validationlayers/config.yml index d99b3e54ca59d2..15d0c149a289cf 100644 --- a/recipes/vulkan-validationlayers/config.yml +++ b/recipes/vulkan-validationlayers/config.yml @@ -11,11 +11,3 @@ versions: folder: all "1.3.211.0": folder: all - "1.3.204.1": - folder: all - "1.2.198.0": - folder: all - "1.2.189.2": - folder: all - "1.2.182": - folder: all diff --git a/recipes/vvenc/all/conandata.yml b/recipes/vvenc/all/conandata.yml new file mode 100644 index 00000000000000..ed507f5b4a2bc7 --- /dev/null +++ b/recipes/vvenc/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "1.8.0": + url: + - "https://github.com/fraunhoferhhi/vvenc/archive/refs/tags/v1.8.0.tar.gz" + sha256: "119970f1e00667045eb12775db10611fc04f9158348144913c9e233f98664714" diff --git a/recipes/vvenc/all/conanfile.py b/recipes/vvenc/all/conanfile.py new file mode 100644 index 00000000000000..50d169ed09a7fd --- /dev/null +++ b/recipes/vvenc/all/conanfile.py @@ -0,0 +1,120 @@ +import os +import sys + +from conan import ConanFile, conan_version +# FIXME: linter complains, but function is there +# https://docs.conan.io/2.0/reference/tools/build.html?highlight=check_min_cppstd#conan-tools-build-check-max-cppstd +# from conan.tools.build import stdcpp_library, check_min_cppstd, check_max_cppstd +from conan.tools.build import stdcpp_library, check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import get, copy, rmdir, rm + +required_conan_version = ">=1.60.1" + + +class vvencRecipe(ConanFile): + name = "vvenc" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + description = "Fraunhofer Versatile Video Encoder (VVenC)" + topics = ("video", "encoder", "codec", "vvc", "h266") + homepage = "https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc.html" + package_type = "library" + + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + def validate_build(self): + if conan_version.major == 2: + self._validate_build2() + elif conan_version.major == 1: + self._validate_build1() + + def _validate_build1(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, 14) + # compiler.cppstd isn't set! but we still continue here in V1, + # imagining just like compiler.cppstd was set to 14 + # while package_id doesn't reflect that at all, and cppstd_default also + # might be different from 14, we silently force -std=c++14 to be + # specified during the build. it may produce more incompatibilities, + # and break user's expectation + # (like, output binary depends really on C++14 symbols libstdc++.so) + # it's V1 design flaw which isn't going to be addressed here + # (and probably nowhere, because conan V1 is going to be discontinued in CCI) + # once V1 is retired, that code will be removed altogether + self.output.warning("compiler.cppstd is not set, but we assume C++14") + + def _validate_build2(self): + # validates the minimum and maximum C++ standard supported + # currently, the project can only be built with C++14 standard + # it cannot be built with older standard because + # it doesn't have all the C++ features needed + # and it cannot be built with newer C++ standard + # because they have existing C++ features removed + check_min_cppstd(self, 14) + # FIXME: linter complains, but function is there + # https://docs.conan.io/2.0/reference/tools/build.html?highlight=check_min_cppstd#conan-tools-build-check-max-cppstd + check_max_cppstd = getattr(sys.modules['conan.tools.build'], 'check_max_cppstd') + check_max_cppstd(self, 14) + + def package_id(self): + # still important, older binutils cannot recognize + # object files created with newer binutils, + # thus linker cannot find any valid object and therefore symbols + # (fails to find `vvenc_get_version`, which is obviously always there) + # this is not exactly modeled by conan right now, + # so "compiler" setting is closest thing to avoid an issue + # (while technically it's not a compiler, but linker and archiver) + # del self.info.settings.compiler + pass + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def configure(self): + if self.options.shared: + self.options.rm_safe('fPIC') + + def layout(self): + cmake_layout(self, src_folder='src') + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.variables["VVENC_ENABLE_LINK_TIME_OPT"] = False + tc.cache_variables["VVENC_ENABLE_LINK_TIME_OPT"] = False + if self.settings.compiler in ["gcc", 'clang']: + tc.blocks["cmake_flags_init"].template += '\nstring(APPEND CMAKE_C_FLAGS_INIT " -Wno-uninitialized")' + tc.blocks["cmake_flags_init"].template += '\nstring(APPEND CMAKE_CXX_FLAGS_INIT " -Wno-uninitialized")' + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + 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")) + rm(self, "*.pdb", os.path.join(self.package_folder, 'bin')) + rm(self, '*.pdb', os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["vvenc"] + if self.options.shared: + self.cpp_info.defines.extend(["VVENC_DYN_LINK"]) # vvcencDecl.h + libcxx = stdcpp_library(self) # source code is C++, but interface is pure C + libcxx = [libcxx] if libcxx else [] + libm = ["m"] if self.settings.get_safe("os") == "Linux" else [] + libpthread = ['pthread'] if self.settings.get_safe('os') == 'Linux' else [] + self.cpp_info.system_libs.extend(libcxx + libm + libpthread) diff --git a/recipes/vvenc/all/test_package/CMakeLists.txt b/recipes/vvenc/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..efaabb8094acbb --- /dev/null +++ b/recipes/vvenc/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest C) + +find_package(vvenc CONFIG REQUIRED) + + + +add_executable(example src/example.c) +target_link_libraries(example vvenc::vvenc) diff --git a/recipes/vvenc/all/test_package/conanfile.py b/recipes/vvenc/all/test_package/conanfile.py new file mode 100644 index 00000000000000..0f4e9c14439cf7 --- /dev/null +++ b/recipes/vvenc/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class vvencTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", 'VirtualRunEnv', "CMakeToolchain" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "example") + self.run(cmd, env="conanrun") diff --git a/recipes/vvenc/all/test_package/src/example.c b/recipes/vvenc/all/test_package/src/example.c new file mode 100644 index 00000000000000..2a6652d65f4eb1 --- /dev/null +++ b/recipes/vvenc/all/test_package/src/example.c @@ -0,0 +1,6 @@ +#include +#include + +int main() { + printf("vvenc_get_version: %s\n", vvenc_get_version()); +} diff --git a/recipes/vvenc/config.yml b/recipes/vvenc/config.yml new file mode 100644 index 00000000000000..6088e2f9810177 --- /dev/null +++ b/recipes/vvenc/config.yml @@ -0,0 +1,3 @@ +versions: + "1.8.0": + folder: "all" diff --git a/recipes/waf/all/conandata.yml b/recipes/waf/all/conandata.yml index 4d28ed8ee80740..07871b61a41013 100644 --- a/recipes/waf/all/conandata.yml +++ b/recipes/waf/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.0.26": + url: "https://waf.io/waf-2.0.26.tar.bz2" + sha256: "c33d19c1bdfae1b078edaef2fab19b1bc734294edd4cc005d4881e9d53ed219c" + "2.0.25": + url: "https://waf.io/waf-2.0.25.tar.bz2" + sha256: "66cff7beed0e77db874e9232cc08874abb3e866c7f0f1f34ba2f959fde44fdd4" "2.0.19": url: "https://waf.io/waf-2.0.19.tar.bz2" sha256: "d8402689b72fe75f759a83b5f6bdf9b4f34ca7fd6007d80680ecfcbef5c2bba5" diff --git a/recipes/waf/all/conanfile.py b/recipes/waf/all/conanfile.py index cc8d7cdece5400..6d2f8a76078a04 100644 --- a/recipes/waf/all/conanfile.py +++ b/recipes/waf/all/conanfile.py @@ -1,28 +1,37 @@ -from conans import ConanFile, tools import os +from conan import ConanFile +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.47.0" + class WafConan(ConanFile): name = "waf" description = "The Waf build system" - topics = ("conan", "waf", "builsystem") + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://waf.io" - license = "BSD-3-Clause" - settings = "os", "arch" + topics = ("buildsystem", "pre-built") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("waf-{}".format(self.version), self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) @property def _license_text(self): - [_, license, _] = open(os.path.join(self.source_folder, self._source_subfolder, "waf"), "rb").read().split(b"\"\"\"", 3) - return license.decode().lstrip() + license_text = self.source_path.joinpath("waf").read_bytes().split(b'"""', 3)[1] + return license_text.decode().lstrip() def build(self): pass @@ -31,30 +40,28 @@ def package(self): binpath = os.path.join(self.package_folder, "bin") libpath = os.path.join(self.package_folder, "lib") - os.mkdir(binpath) - os.mkdir(libpath) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._license_text) - - self.copy("waf", src=self._source_subfolder, dst=binpath) - self.copy("waf-light", src=self._source_subfolder, dst=binpath) - self.copy("waflib/*", src=self._source_subfolder, dst=libpath) + copy(self, "waf", src=self.source_folder, dst=binpath) + copy(self, "waf-light", src=self.source_folder, dst=binpath) + copy(self, "waflib/*", src=self.source_folder, dst=libpath) if self.settings.os == "Windows": - self.copy("waf.bat", src=os.path.join(self._source_subfolder, "utils"), dst=binpath) + copy(self, "waf.bat", src=os.path.join(self.source_folder, "utils"), dst=binpath) os.chmod(os.path.join(binpath, "waf"), 0o755) os.chmod(os.path.join(binpath, "waf-light"), 0o755) def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] + wafdir = os.path.join(self.package_folder, "lib") + self.buildenv_info.define_path("WAFDIR", wafdir) + + # TODO: Legacy, remove in 2.0 binpath = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var: {}".format(binpath)) self.env_info.PATH.append(binpath) - - wafdir = os.path.join(self.package_folder, "lib") - self.output.info("Setting WAFDIR env var: {}".format(wafdir)) self.env_info.WAFDIR = wafdir - - diff --git a/recipes/waf/all/test_package/conanfile.py b/recipes/waf/all/test_package/conanfile.py index 9d956eec268299..f47744ecfec84c 100644 --- a/recipes/waf/all/test_package/conanfile.py +++ b/recipes/waf/all/test_package/conanfile.py @@ -1,42 +1,45 @@ -from conans import ConanFile, tools -from contextlib import contextmanager import os import shutil +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import chdir +from conan.tools.layout import basic_layout + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" exports_sources = "a.cpp", "b.cpp", "main.c", "main.cpp", "wscript" + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def generate(self): + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + env = Environment() + for var in ["DYLD_LIBRARY_PATH", "LD_LIBRARY_PATH"]: + env.append_path(var, self.build_folder) + env.vars(self, scope="run").save_script("conanrun_macos_dyld_path") + def build(self): - if tools.cross_building(self.settings): - return - - for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), self.build_folder) - - waf_path = tools.which("waf") - if waf_path: - waf_path = waf_path.replace("\\", "/") - assert waf_path.startswith(str(self.deps_cpp_info["waf"].rootpath)) - - with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): - self.run("waf -h") - self.run("waf configure") - self.run("waf") - - @contextmanager - def _add_ld_search_path(self): - env = {} - if self.settings.os == "Linux": - env["LD_LIBRARY_PATH"] = [os.path.join(os.getcwd(), "build")] - elif self.settings.os == "Macos": - env["DYLD_LIBRARY_PATH"] = [os.path.join(os.getcwd(), "build")] - with tools.environment_append(env): - yield + if can_run(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + + with chdir(self, self.build_folder): + self.run(f"waf configure -o {self.cpp.build.bindir}") + self.run("waf") def test(self): - if not tools.cross_building(self.settings): - with self._add_ld_search_path(): - self.run(os.path.join("build", "app"), run_environment=True) - self.run(os.path.join("build", "app2"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "app") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "app2") + self.run(bin_path, env="conanrun") diff --git a/recipes/waf/all/test_v1_package/conanfile.py b/recipes/waf/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..252c1f1ae1d966 --- /dev/null +++ b/recipes/waf/all/test_v1_package/conanfile.py @@ -0,0 +1,43 @@ +from conan.tools.apple import is_apple_os +from conans import ConanFile, tools +from contextlib import contextmanager +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + exports_sources = "a.cpp", "b.cpp", "main.c", "main.cpp", "wscript" + + def build(self): + if tools.cross_building(self.settings): + return + + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, os.pardir, "test_package", src), self.build_folder) + + waf_path = tools.which("waf") + if waf_path: + waf_path = waf_path.replace("\\", "/") + assert waf_path.startswith(str(self.deps_cpp_info["waf"].rootpath)) + + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + self.run("waf -h") + self.run("waf configure") + self.run("waf") + + @contextmanager + def _add_ld_search_path(self): + env = {} + if self.settings.os in ["Linux", "FreeBSD"]: + env["LD_LIBRARY_PATH"] = [os.path.join(os.getcwd(), "build")] + elif is_apple_os(self): + env["DYLD_LIBRARY_PATH"] = [os.path.join(os.getcwd(), "build")] + with tools.environment_append(env): + yield + + def test(self): + if not tools.cross_building(self.settings): + with self._add_ld_search_path(): + self.run(os.path.join("build", "app"), run_environment=True) + self.run(os.path.join("build", "app2"), run_environment=True) diff --git a/recipes/waf/config.yml b/recipes/waf/config.yml index e3883114dd1bb7..9df1d7fdf59a0c 100644 --- a/recipes/waf/config.yml +++ b/recipes/waf/config.yml @@ -1,3 +1,7 @@ versions: + "2.0.26": + folder: all + "2.0.25": + folder: all "2.0.19": folder: all diff --git a/recipes/wasm-micro-runtime/all/conandata.yml b/recipes/wasm-micro-runtime/all/conandata.yml new file mode 100644 index 00000000000000..507fb63f458938 --- /dev/null +++ b/recipes/wasm-micro-runtime/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.2.3": + url: "https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-1.2.3.tar.gz" + sha256: "85057f788630dc1b8c371f5443cc192627175003a8ea63c491beaff29a338346" + "1.2.2": + url: "https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-1.2.2.tar.gz" + sha256: "d328fc1e19c54cfdb4248b861de54b62977b9b85c0a40eaaeb9cd9b628c0c788" +patches: + "1.2.3": + - patch_file: "patches/1.2.3-0001-fix-cmake.patch" + patch_description: "separate static and shasred build" + patch_type: "conan" + "1.2.2": + - patch_file: "patches/1.2.2-0001-fix-cmake.patch" + patch_description: "separate static and shasred build" + patch_type: "conan" diff --git a/recipes/wasm-micro-runtime/all/conanfile.py b/recipes/wasm-micro-runtime/all/conanfile.py new file mode 100644 index 00000000000000..4cd796f406c9c8 --- /dev/null +++ b/recipes/wasm-micro-runtime/all/conanfile.py @@ -0,0 +1,138 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + +class WasmMicroRuntimeConan(ConanFile): + name = "wasm-micro-runtime" + description = "WebAssembly Micro Runtime (WAMR)" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://bytecodealliance.github.io/wamr.dev/" + topics = ("wasm", "embedded", "webassembly", "runtime") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_interp": [False, "fast", "classic"], + "with_aot": [True, False], + "with_jit": [True, False], + "with_fast_jit": [True, False], + "libc": ["builtin", "wasi", "uvwasi"], + "with_multi_module": [True, False], + "with_mini_loader": [True, False], + "with_pthread": [True, False], + "with_wasi_threads": [True, False], + "with_tail_call": [True, False], + "with_simd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_interp": "fast", + "with_aot": True, + "with_jit": False, + "with_fast_jit": False, + "libc": "builtin", + "with_multi_module": False, + "with_mini_loader": False, + "with_pthread": False, + "with_wasi_threads": False, + "with_tail_call": False, + "with_simd": True, + } + + 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") + # When with_fast_jit is True, C++ is required. + if not self.options.with_fast_jit: + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + # When with_fast_jit is True, C++ is required. + if not self.options.with_fast_jit: + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if not self.options.with_interp and not self.options.with_aot: + raise ConanInvalidConfiguration(f"{self.ref} requires with_interp and with_aot at least one.") + if self.options.with_jit: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support with_jit(yet).") + if self.options.with_multi_module and self.options.with_mini_loader: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support both with_multi_module and with_mini_loader.") + if self.options.libc == "wasi" and self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support libc=wasi on Windows.") + if self.options.libc == "uvwasi": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support libc=uvwasi(yet).") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + def is_enabled(value): + return 1 if value else 0 + + tc = CMakeToolchain(self) + # FIXME: it should use assembler code instead of C++ on MSVC + if is_msvc(self): + tc.variables["WAMR_BUILD_INVOKE_NATIVE_GENERAL"] = 1 + + # interpreters + tc.variables["WAMR_BUILD_INTERP"] = is_enabled(self.options.with_interp) + if self.options.with_interp: + tc.variables["WAMR_BUILD_FAST_INTERP"] = is_enabled(self.options.with_interp == "fast") + # AOT and JITs + tc.variables["WAMR_BUILD_AOT"] = is_enabled(self.options.with_aot) + tc.variables["WAMR_BUILD_JIT"] = is_enabled(self.options.with_jit) + tc.variables["WAMR_BUILD_FAST_JIT"] = is_enabled(self.options.with_fast_jit) + # LIBC + tc.variables["WAMR_BUILD_LIBC_BUILTIN"] = is_enabled(self.options.libc == "builtin") + tc.variables["WAMR_BUILD_LIBC_WASI"] = is_enabled(self.options.libc == "wasi") + tc.variables["WAMR_BUILD_LIBC_UVWASI"] = is_enabled(self.options.libc == "uvwasi") + # others + tc.variables["WAMR_BUILD_MULTI_MODULE"] = is_enabled(self.options.with_multi_module) + tc.variables["WAMR_BUILD_MINI_LOADER"] = is_enabled(self.options.with_mini_loader) + tc.variables["WAMR_BUILD_LIB_PTHREAD"] = is_enabled(self.options.with_pthread) + tc.variables["WAMR_BUILD_LIB_WASI_THREADS"] = is_enabled(self.options.with_wasi_threads) + tc.variables["WAMR_BUILD_TAIL_CALL"] = is_enabled(self.options.with_tail_call) + tc.variables["WAMR_BUILD_SIMD"] = is_enabled(self.options.with_simd) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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 = ["iwasm" if self.options.shared else "vmlib"] + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("COMPILING_WASM_RUNTIME_API=0") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/wasm-micro-runtime/all/patches/1.2.2-0001-fix-cmake.patch b/recipes/wasm-micro-runtime/all/patches/1.2.2-0001-fix-cmake.patch new file mode 100644 index 00000000000000..baf12ba1a1b627 --- /dev/null +++ b/recipes/wasm-micro-runtime/all/patches/1.2.2-0001-fix-cmake.patch @@ -0,0 +1,57 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c87994..bbcb2fd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -109,11 +109,6 @@ set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + + include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) + +-set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wshadow -Wno-unused-parameter") +-# set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wsign-conversion") +- +-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wno-unused") +- + if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64") + if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang")) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mindirect-branch-register") +@@ -130,22 +125,29 @@ endif () + + include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) + ++if (NOT BUILD_SHARED_LIBS) + # STATIC LIBRARY + add_library(iwasm_static STATIC ${WAMR_RUNTIME_LIB_SOURCE}) + set_target_properties (iwasm_static PROPERTIES OUTPUT_NAME vmlib) + target_include_directories(iwasm_static INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include) +-target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) ++target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS}) ++if(NOT MSVC) ++target_link_libraries (iwasm_static INTERFACE -lm -ldl -lpthread) ++endif() + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_static INTERFACE boringssl_crypto) + endif () + + install (TARGETS iwasm_static ARCHIVE DESTINATION lib) +- ++else() + # SHARED LIBRARY + add_library (iwasm_shared SHARED ${WAMR_RUNTIME_LIB_SOURCE}) + set_target_properties (iwasm_shared PROPERTIES OUTPUT_NAME iwasm) + target_include_directories(iwasm_shared INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include) +-target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) ++target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS}) ++if(NOT MSVC) ++target_link_libraries (iwasm_shared INTERFACE -lm -ldl -lpthread) ++endif() + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_shared INTERFACE boringssl_crypto) + endif () +@@ -155,6 +157,7 @@ if (MINGW) + endif () + + install (TARGETS iwasm_shared LIBRARY DESTINATION lib) ++endif() + + # HEADERS + install (FILES diff --git a/recipes/wasm-micro-runtime/all/patches/1.2.3-0001-fix-cmake.patch b/recipes/wasm-micro-runtime/all/patches/1.2.3-0001-fix-cmake.patch new file mode 100644 index 00000000000000..b67b2a33b5deab --- /dev/null +++ b/recipes/wasm-micro-runtime/all/patches/1.2.3-0001-fix-cmake.patch @@ -0,0 +1,88 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index fbea261..9f9892a 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -108,17 +108,12 @@ endif () + set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + + # Set the strip command based on the system (GNU or Clang) +-if (CMAKE_STRIP) ++if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang" AND CMAKE_STRIP) + set (CMAKE_STRIP_FLAGS "--strip-all") + endif () + + include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) + +-set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wshadow -Wno-unused-parameter") +-# set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wsign-conversion") +- +-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wno-unused") +- + if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64") + if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang")) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mindirect-branch-register") +@@ -135,11 +130,15 @@ endif () + + include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) + ++if (NOT BUILD_SHARED_LIBS) + # STATIC LIBRARY + add_library(iwasm_static STATIC ${WAMR_RUNTIME_LIB_SOURCE}) + set_target_properties (iwasm_static PROPERTIES OUTPUT_NAME vmlib) + target_include_directories(iwasm_static INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include) +-target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) ++target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS}) ++if(NOT MSVC) ++ target_link_libraries (iwasm_static INTERFACE -lm -ldl -lpthread) ++endif() + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_static INTERFACE boringssl_crypto) + endif () +@@ -147,19 +146,22 @@ endif () + install (TARGETS iwasm_static ARCHIVE DESTINATION lib) + + # If it's a Release build, strip the static library +-if (CMAKE_STRIP AND CMAKE_BUILD_TYPE STREQUAL "Release") ++if (0) + # Strip static library + message (STATUS "Stripping static library after build!") + add_custom_command (TARGET iwasm_static POST_BUILD + COMMAND ${CMAKE_STRIP} ${CMAKE_STRIP_FLAGS} $ + ) + endif () +- ++else() + # SHARED LIBRARY + add_library (iwasm_shared SHARED ${WAMR_RUNTIME_LIB_SOURCE}) + set_target_properties (iwasm_shared PROPERTIES OUTPUT_NAME iwasm) + target_include_directories(iwasm_shared INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include) +-target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) ++target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS}) ++if(NOT MSVC) ++ target_link_libraries (iwasm_shared INTERFACE -lm -ldl -lpthread) ++endif() + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_shared INTERFACE boringssl_crypto) + endif () +@@ -169,7 +171,7 @@ if (MINGW) + endif () + + install (TARGETS iwasm_shared LIBRARY DESTINATION lib) +- ++endif() + # HEADERS + install (FILES + ${WAMR_ROOT_DIR}/core/iwasm/include/wasm_c_api.h +@@ -177,6 +179,7 @@ install (FILES + ${WAMR_ROOT_DIR}/core/iwasm/include/lib_export.h + DESTINATION include) + ++if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang" AND BUILD_SHARED_LIBS) + # If it's a Release build, strip the shared library + if (CMAKE_STRIP AND CMAKE_BUILD_TYPE STREQUAL "Release") + # Strip shared library +@@ -185,3 +188,4 @@ if (CMAKE_STRIP AND CMAKE_BUILD_TYPE STREQUAL "Release") + COMMAND ${CMAKE_STRIP} ${CMAKE_STRIP_FLAGS} $ + ) + endif () ++endif () diff --git a/recipes/wasm-micro-runtime/all/test_package/CMakeLists.txt b/recipes/wasm-micro-runtime/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..3cf7f573410ea6 --- /dev/null +++ b/recipes/wasm-micro-runtime/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(wasm-micro-runtime REQUIRED CONFIG) + +if(WAMR_NO_INTERP) +add_executable(${PROJECT_NAME} test_package_no_interp.cpp) +else() +add_executable(${PROJECT_NAME} test_package.cpp) +endif() + +target_link_libraries(${PROJECT_NAME} PRIVATE wasm-micro-runtime::wasm-micro-runtime) diff --git a/recipes/wasm-micro-runtime/all/test_package/conanfile.py b/recipes/wasm-micro-runtime/all/test_package/conanfile.py new file mode 100644 index 00000000000000..d56a8c50a887ae --- /dev/null +++ b/recipes/wasm-micro-runtime/all/test_package/conanfile.py @@ -0,0 +1,33 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain + +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + if not self.dependencies["wasm-micro-runtime"].options.with_interp: + tc.variables["WAMR_NO_INTERP"] = True + tc.generate() + + 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") + wat_path = os.path.join(self.source_folder, "test_package.wasm") + self.run(f"{bin_path} {wat_path}", env="conanrun") diff --git a/recipes/wasm-micro-runtime/all/test_package/test_package.cpp b/recipes/wasm-micro-runtime/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..6e413e2d402fcb --- /dev/null +++ b/recipes/wasm-micro-runtime/all/test_package/test_package.cpp @@ -0,0 +1,65 @@ +#include +#include +#include +#include + +#include "wasm_c_api.h" + +#define own + +int main(int argc, const char* argv[]) { + // Initialize. + printf("Initializing...\n"); + wasm_engine_t* engine = wasm_engine_new(); + wasm_store_t* store = wasm_store_new(engine); + + // Load binary. + printf("Loading binary...\n"); + FILE* file = fopen(argv[1], "rb"); + if (!file) { + printf("> Error loading module!\n"); + return 1; + } + + int ret = fseek(file, 0L, SEEK_END); + if (ret == -1) { + printf("> Error loading module!\n"); + fclose(file); + return 1; + } + + long file_size = ftell(file); + if (file_size == -1) { + printf("> Error loading module!\n"); + fclose(file); + return 1; + } + + ret = fseek(file, 0L, SEEK_SET); + if (ret == -1) { + printf("> Error loading module!\n"); + fclose(file); + return 1; + } + + wasm_byte_vec_t binary; + wasm_byte_vec_new_uninitialized(&binary, file_size); + if (fread(binary.data, file_size, 1, file) != 1) { + printf("> Error loading module!\n"); + fclose(file); + return 1; + } + fclose(file); + + // Compile. + printf("Compiling module...\n"); + own wasm_module_t* module = wasm_module_new(store, &binary); + if (!module) { + printf("> Error compiling module!\n"); + return 1; + } + + wasm_byte_vec_delete(&binary); + + return 0; +} diff --git a/recipes/wasm-micro-runtime/all/test_package/test_package.wasm b/recipes/wasm-micro-runtime/all/test_package/test_package.wasm new file mode 100644 index 00000000000000..18ac7653b03011 Binary files /dev/null and b/recipes/wasm-micro-runtime/all/test_package/test_package.wasm differ diff --git a/recipes/wasm-micro-runtime/all/test_package/test_package_no_interp.cpp b/recipes/wasm-micro-runtime/all/test_package/test_package_no_interp.cpp new file mode 100644 index 00000000000000..8e9d61bfcf7f1c --- /dev/null +++ b/recipes/wasm-micro-runtime/all/test_package/test_package_no_interp.cpp @@ -0,0 +1,64 @@ +#include +#include +#include +#include + +#include "wasm_c_api.h" + +#define own + +// A function to be called from Wasm code. +own wasm_trap_t* hello_callback( + const wasm_val_vec_t* args, wasm_val_vec_t* results +) { + printf("Calling back...\n"); + printf("> Hello World!\n"); + return NULL; +} + +int main(int argc, const char* argv[]) { + // Initialize. + printf("Initializing...\n"); + wasm_engine_t* engine = wasm_engine_new(); + wasm_store_t* store = wasm_store_new(engine); + + // Load binary. + printf("Loading binary...\n"); + FILE* file = fopen(argv[1], "rb"); + if (!file) { + printf("> Error loading module!\n"); + return 1; + } + + long file_size = 10240; + + wasm_byte_vec_t binary; + wasm_byte_vec_new_uninitialized(&binary, file_size); + + // Compile. + printf("Compiling module...\n"); + own wasm_module_t* module = wasm_module_new(store, &binary); + + wasm_byte_vec_delete(&binary); + + // Create external print functions. + printf("Creating callback...\n"); + own wasm_functype_t* hello_type = wasm_functype_new_0_0(); + own wasm_func_t* hello_func = + wasm_func_new(store, hello_type, hello_callback); + + wasm_functype_delete(hello_type); + + wasm_func_delete(hello_func); + + wasm_module_delete(module); + + // Shut down. + printf("Shutting down...\n"); + wasm_store_delete(store); + wasm_engine_delete(engine); + + // All done. + printf("Done.\n"); + return 0; +} diff --git a/recipes/wasm-micro-runtime/config.yml b/recipes/wasm-micro-runtime/config.yml new file mode 100644 index 00000000000000..6d9f399765e2d6 --- /dev/null +++ b/recipes/wasm-micro-runtime/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.3": + folder: all + "1.2.2": + 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://raw.githubusercontent.com/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://raw.githubusercontent.com/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://raw.githubusercontent.com/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://raw.githubusercontent.com/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://raw.githubusercontent.com/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://raw.githubusercontent.com/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/wasmer/all/conandata.yml b/recipes/wasmer/all/conandata.yml index 55462c58cc4d03..8b03fa42930cd7 100644 --- a/recipes/wasmer/all/conandata.yml +++ b/recipes/wasmer/all/conandata.yml @@ -1,4 +1,58 @@ sources: + "4.2.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-windows-amd64.tar.gz" + sha256: "f2eeff46e6974f06d1ee3dc64515a2fbd9f0897575ce7e8ed5c6e3b4353ded24" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-windows-gnu64.tar.gz" + sha256: "13374b1d781a2aec2cb981f8c38ad0935476c7d508b993bc48f684a13e283943" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-linux-amd64.tar.gz" + sha256: "3ea947b1accb6247aa90d914331132827c49a422d2dba8459e2f0cf02c1acf80" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-linux-aarch64.tar.gz" + sha256: "681fe6ad3e7f139d3d2ed8cfbf6ceb4d54098c32da9663bbf849e6429d6e8f1c" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-darwin-amd64.tar.gz" + sha256: "4d629eafe6d7249b276691cb0f834d7d00cf89953700628abe06a224f76b7d79" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-darwin-arm64.tar.gz" + sha256: "ab928c3717c2597f484868d5d97baabe939bffeb1ba38f348bcda9c828022069" + "4.1.1": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-windows-amd64.tar.gz" + sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-windows-gnu64.tar.gz" + sha256: "47fb2d9563995fe180fc2a56255f8eb2ffe19de6ee9d512920a7823bc12e66c5" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-linux-amd64.tar.gz" + sha256: "778e87bb62748f2899bb06fe1d07ca3038705b996c93e0c28db12ccc032c0c4e" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-linux-aarch64.tar.gz" + sha256: "74cc40fcfe4108c0240137a47704d4f6ade8895c70da25358b471fe32ce47a50" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-darwin-amd64.tar.gz" + sha256: "113f58b1560c21607f0011ec6a835bdf109efc2f3be6f200ff8bc8b9591d021e" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-darwin-arm64.tar.gz" + sha256: "5eaf3a3b5a2607dd29f70bf21008140a079662bddf42e75e97da71355a29d961" "4.0.0": Windows: "x86_64": diff --git a/recipes/wasmer/config.yml b/recipes/wasmer/config.yml index 23eb21bb556fff..1f9b03131e5700 100644 --- a/recipes/wasmer/config.yml +++ b/recipes/wasmer/config.yml @@ -1,4 +1,8 @@ versions: + "4.2.0": + folder: "all" + "4.1.1": + folder: "all" "4.0.0": folder: "all" "3.2.1": diff --git a/recipes/wasmtime-cpp/all/conanfile.py b/recipes/wasmtime-cpp/all/conanfile.py index 3b547f8d8dbced..9970e18861d775 100644 --- a/recipes/wasmtime-cpp/all/conanfile.py +++ b/recipes/wasmtime-cpp/all/conanfile.py @@ -43,7 +43,7 @@ def requirements(self): "0.39.0": "0.39.1", "1.0.0": "1.0.1", "6.0.0": "6.0.1", - "9.0.0": "9.0.1", + "9.0.0": "12.0.2", } self.requires(f"wasmtime/{version_map.get(version, version)}") diff --git a/recipes/wasmtime/all/conandata.yml b/recipes/wasmtime/all/conandata.yml index e337fecbbe9778..c449ffc3965a66 100644 --- a/recipes/wasmtime/all/conandata.yml +++ b/recipes/wasmtime/all/conandata.yml @@ -1,4 +1,64 @@ sources: + "12.0.2": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-x86_64-windows-c-api.zip" + sha256: "ad589d69722f0fdf0b6900fe1c708194575c487776504c44a5283c2960c03a92" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-x86_64-mingw-c-api.zip" + sha256: "773737d9072aed6efdbb6c8137561bd3d5e271008e6741687fa504ec384d0799" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-x86_64-linux-c-api.tar.xz" + sha256: "9e02cd4201d74c68a236664f883873335c7427e820ce4a44c47c1cc98ec9e553" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-aarch64-linux-c-api.tar.xz" + sha256: "daf6ca147b288cf915978f064853f403ca163b52806ae0a52ddd5bd91a5a2507" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-s390x-linux-c-api.tar.xz" + sha256: "65e75ffe34ced6710b56da071e9eb734eabdad69be07f3e6baae27e6b1a95d41" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-x86_64-macos-c-api.tar.xz" + sha256: "35a0d3590afb147f9b312820df87189a9a376cc5bddc2d90b8d7e57b412c7dc6" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-aarch64-macos-c-api.tar.xz" + sha256: "6b8a13fbe6c5440b30632a1f9178df1cdc07bbf34633a105666e506bc8db941d" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-aarch64-linux-c-api.tar.xz" + sha256: "daf6ca147b288cf915978f064853f403ca163b52806ae0a52ddd5bd91a5a2507" + "12.0.1": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-x86_64-windows-c-api.zip" + sha256: "e5da4752260ffd38e28cc56fc1db6f3cec65f9bf352b5e9757a92873e5a6f408" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-x86_64-mingw-c-api.zip" + sha256: "7b7a6c7d3e2603ec51837c28ec5c9306d599d44b707d052faa5102c691e07685" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-x86_64-linux-c-api.tar.xz" + sha256: "7f09952cba8e92ff3bd18ad59b847fb353a6cd6c9069b38c1b9763610616347f" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-aarch64-linux-c-api.tar.xz" + sha256: "fd7080f59413aca47e473e2f2517fbd75ef16d963925a7333c09d0621c81b449" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-s390x-linux-c-api.tar.xz" + sha256: "4482d42cf683f5ee4213fcb1c69f0b5fa7b4d948186d26ae6f647cc92ac4e779" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-x86_64-macos-c-api.tar.xz" + sha256: "89059ed138cb59c8c1f9008053da848d3d9e15c5edfe1a3f2f2d7c0c5bbf9597" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-aarch64-macos-c-api.tar.xz" + sha256: "8dca391f22cf53ae4b19a689e3a2cce87541bb4575a98d2f402f36402be419f7" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-aarch64-linux-c-api.tar.xz" + sha256: "fd7080f59413aca47e473e2f2517fbd75ef16d963925a7333c09d0621c81b449" "9.0.1": Windows: "x86_64": diff --git a/recipes/wasmtime/all/conanfile.py b/recipes/wasmtime/all/conanfile.py index 1ceb2e856e7777..4aec54bb577f27 100644 --- a/recipes/wasmtime/all/conanfile.py +++ b/recipes/wasmtime/all/conanfile.py @@ -1,12 +1,12 @@ +import os + 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.microsoft import is_msvc +from conan.tools.scm import Version -import os - -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class WasmtimeConan(ConanFile): @@ -27,14 +27,14 @@ class WasmtimeConan(ConanFile): no_copy_source = True @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 11 @property def _minimum_compilers_version(self): return { "Visual Studio": "15", - "msvc": "190", + "msvc": "191", "apple-clang": "9.4", "clang": "3.3", "gcc": "5.1", @@ -58,27 +58,17 @@ def package_id(self): self.info.settings.compiler = "gcc" def validate(self): - compiler = self.settings.compiler - min_version = self._minimum_compilers_version[str(compiler)] - try: - if Version(compiler.version) < min_version: - msg = ( - f"{self.name} requires C{self._minimum_cpp_standard} features " - f"which are not supported by compiler {compiler} {compiler.version} !!" - ) - raise ConanInvalidConfiguration(msg) - except KeyError: - msg = ( - f"{self.name} recipe lacks information about the {compiler} compiler, " - f"support for the required C{self._minimum_cpp_standard} features is assumed" - ) - self.output.warn(msg) - try: self.conan_data["sources"][self.version][self._sources_os_key][str(self.settings.arch)] except KeyError: raise ConanInvalidConfiguration("Binaries for this combination of architecture/version/os are not available") + 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 build(self): # This is packaging binaries so the download needs to be in build get(self, **self.conan_data["sources"][self.version][self._sources_os_key][str(self.settings.arch)], diff --git a/recipes/wasmtime/config.yml b/recipes/wasmtime/config.yml index dbe6065513d63b..e5ce53b819caaf 100644 --- a/recipes/wasmtime/config.yml +++ b/recipes/wasmtime/config.yml @@ -1,4 +1,8 @@ versions: + "12.0.2": + folder: all + "12.0.1": + folder: all "9.0.1": folder: all "7.0.0": diff --git a/recipes/watcher/all/conandata.yml b/recipes/watcher/all/conandata.yml index 80ba8ba329e37b..857cc8ad363672 100644 --- a/recipes/watcher/all/conandata.yml +++ b/recipes/watcher/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.9.5": + url: "https://github.com/e-dant/watcher/archive/release/0.9.5.tar.gz" + sha256: "41b74d138eec106c35a99e7544def599453a8bf4cf4887ad627e1c9e3355287c" + "0.9.2": + url: "https://github.com/e-dant/watcher/archive/release/0.9.2.tar.gz" + sha256: "d728960cbf5cebb05e1e0b7d61482b1cfd10b6bc616f9e494168f7d5d2e689cf" "0.8.8": url: "https://github.com/e-dant/watcher/archive/release/0.8.8.tar.gz" sha256: "51e61a096d072ae5c78df9318dec50fb5718c88b672305fc4b6bd2c7ba264bbe" @@ -23,22 +29,8 @@ sources: "0.4.3": url: "https://github.com/e-dant/watcher/archive/release/0.4.3.tar.gz" sha256: "8603b45edfa5023752d9e2fdd731efe5a556a542aaf03f6be0e69c68f552b25a" - "0.3.3": - url: "https://github.com/e-dant/watcher/archive/release/0.3.3.tar.gz" - sha256: "1cb4a898741306bb9089bd24175bcbb2cb434531eac6bbcfe1a3679b8bf1f44c" - "0.3.2": - url: "https://github.com/e-dant/watcher/archive/release/0.3.2.tar.gz" - sha256: "f00247ad8ee492cb70143917bd19f80056227f4ebd4263015727f02750e4fbd5" - "0.3.1": - url: "https://github.com/e-dant/watcher/archive/release/0.3.1.tar.gz" - sha256: "0fa79d21ac16c96b7ca50f2563aed9d8841e5b8f139af27d0b2cf199d0d281dc" patches: "0.5.5": - patch_file: "patches/0.5.5-fix-limits_max.patch" patch_description: "fix max macro error in windows" patch_type: "portability" - "0.3.1": - - patch_file: "patches/0.3.1-fix-include.patch" - patch_description: "add missing include headers for some compilers" - patch_type: "portability" - patch_source: "https://github.com/e-dant/watcher/pull/18" diff --git a/recipes/watcher/all/conanfile.py b/recipes/watcher/all/conanfile.py index 31b1acc6f58858..a860da1f34772a 100644 --- a/recipes/watcher/all/conanfile.py +++ b/recipes/watcher/all/conanfile.py @@ -4,6 +4,8 @@ from conan.tools.build import check_min_cppstd from conan.tools.apple import is_apple_os from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.49.0" @@ -19,18 +21,27 @@ class WatcherConan(ConanFile): settings = "os", "arch", "compiler", "build_type" @property - def _minimum_cpp_standard(self): - return 20 + def _min_cppstd(self): + return "20" if Version(self.version) < "0.9.0" else "17" @property def _compilers_minimum_version(self): return { - "gcc": "11", - "clang": "13", - "apple-clang": "13.1", - "Visual Studio": "16", - "msvc": "192", - } + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + "20": { + "gcc": "11", + "clang": "13", + "apple-clang": "13.1", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) def export_sources(self): export_conandata_patches(self) @@ -43,7 +54,7 @@ def package_id(self): def validate(self): if self.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._min_cppstd) def loose_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -54,7 +65,7 @@ def loose_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.", + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) def source(self): @@ -78,6 +89,5 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - if is_apple_os(self): self.cpp_info.frameworks = ["CoreFoundation", "CoreServices"] diff --git a/recipes/watcher/all/patches/0.3.1-fix-include.patch b/recipes/watcher/all/patches/0.3.1-fix-include.patch deleted file mode 100644 index 1c3d12d2130dea..00000000000000 --- a/recipes/watcher/all/patches/0.3.1-fix-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/watcher/adapter/linux/watch.hpp b/include/watcher/adapter/linux/watch.hpp -index 1b6b61a..a3e6aa9 100644 ---- a/include/watcher/adapter/linux/watch.hpp -+++ b/include/watcher/adapter/linux/watch.hpp -@@ -11,6 +11,7 @@ - - #include - #include -+#include - #include - #include - #include diff --git a/recipes/watcher/all/test_package/CMakeLists.txt b/recipes/watcher/all/test_package/CMakeLists.txt index 01b429a54beb88..7cb2b32a687ee5 100644 --- a/recipes/watcher/all/test_package/CMakeLists.txt +++ b/recipes/watcher/all/test_package/CMakeLists.txt @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.12) - project(test_package LANGUAGES CXX) find_package(watcher REQUIRED CONFIG) @@ -7,22 +6,24 @@ find_package(Threads REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE watcher::watcher Threads::Threads) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) -if(watcher_VERSION VERSION_LESS "0.4.0") - target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_NAMESPACE=water) - target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_NAMESPACE=water::watcher::event) - target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_KIND_NAMESPACE=water::watcher::event) + +if(watcher_VERSION VERSION_GREATER_EQUAL "0.9.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +endif() + +if(watcher_VERSION VERSION_LESS "0.8.1") + target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_NAMESPACE=wtr::watcher::event) + target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_KIND_NAMESPACE=wtr::watcher::event) else() - target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_NAMESPACE=wtr) - if(watcher_VERSION VERSION_LESS "0.8.1") - target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_NAMESPACE=wtr::watcher::event) - target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_KIND_NAMESPACE=wtr::watcher::event) - else() - target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_NAMESPACE=wtr::watcher) - target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_KIND_NAMESPACE=wtr::watcher::event) - endif() + target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_NAMESPACE=wtr::watcher) + target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_EVENT_KIND_NAMESPACE=wtr::watcher::event) endif() +if(watcher_VERSION VERSION_GREATER_EQUAL "0.9.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_RAII_SAFE) +endif() if(watcher_VERSION VERSION_GREATER_EQUAL "0.6.0") target_compile_definitions(${PROJECT_NAME} PRIVATE WATCHER_WATCH_OBJECT) elseif(watcher_VERSION VERSION_GREATER_EQUAL "0.5.0") diff --git a/recipes/watcher/all/test_package/test_package.cpp b/recipes/watcher/all/test_package/test_package.cpp index 3216b6f2e2ca31..6e1dd6a280cc9c 100644 --- a/recipes/watcher/all/test_package/test_package.cpp +++ b/recipes/watcher/all/test_package/test_package.cpp @@ -15,7 +15,11 @@ int main(int argc, char** argv) { auto const show_event_json = [](const WATCHER_EVENT_NAMESPACE::event& this_event) { std::cout << " " << this_event; +#ifdef WATCHER_RAII_SAFE + if (this_event.path_type != WATCHER_EVENT_KIND_NAMESPACE::path_type::watcher) { +#else if (this_event.kind != WATCHER_EVENT_KIND_NAMESPACE::kind::watcher) { +#endif std::cout << ","; } std::cout << "\n"; @@ -28,12 +32,12 @@ int main(int argc, char** argv) { std::this_thread::sleep_for(time_until_death); auto const is_watch_dead = lifetime.close(); #else - std::thread([&]() { WATCHER_NAMESPACE::watcher::watch(".", show_event_json); }).detach(); + std::thread([&]() { wtr::watcher::watch(".", show_event_json); }).detach(); std::this_thread::sleep_for(time_until_death); # ifdef WATCHER_DIE_WITH_PATH - auto const is_watch_dead = WATCHER_NAMESPACE::watcher::die(".", show_event_json); + auto const is_watch_dead = wtr::watcher::die(".", show_event_json); # else - auto const is_watch_dead = WATCHER_NAMESPACE::watcher::die(show_event_json); + auto const is_watch_dead = wtr::watcher::die(show_event_json); # endif #endif diff --git a/recipes/watcher/config.yml b/recipes/watcher/config.yml index 61b409d5231609..2b4b53a7cfb59a 100644 --- a/recipes/watcher/config.yml +++ b/recipes/watcher/config.yml @@ -1,4 +1,8 @@ versions: + "0.9.5": + folder: all + "0.9.2": + folder: all "0.8.8": folder: all "0.8.7": @@ -15,9 +19,3 @@ versions: folder: all "0.4.3": folder: all - "0.3.3": - folder: all - "0.3.2": - folder: all - "0.3.1": - folder: all diff --git a/recipes/wavelet_buffer/all/conandata.yml b/recipes/wavelet_buffer/all/conandata.yml index fbf3768205fccf..16606180f5c324 100644 --- a/recipes/wavelet_buffer/all/conandata.yml +++ b/recipes/wavelet_buffer/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.1": + url: "https://github.com/panda-official/WaveletBuffer/archive/refs/tags/v0.7.1.tar.gz" + sha256: "34931da9a8f3c36a37e7e72c801f5ae139006e3c84013511e6baaae3f8d3da3c" "0.5.0": url: "https://github.com/panda-official/WaveletBuffer/archive/refs/tags/v0.5.0.tar.gz" sha256: "2b1fa552f9a6e032dfd9f59bd05c049bf0cac46aced7cd42f49ff0d020cfdb50" @@ -6,19 +9,26 @@ sources: url: "https://github.com/panda-official/WaveletBuffer/archive/refs/tags/v0.4.0.tar.gz" sha256: "0a30080a6d1e9e7f8947ae0c3395d3c86888900c7ae09730f8dd0ed5138daab2" patches: + "0.7.1": + - patch_file: "patches/0.7.1-0001-fix-packages.patch" + patch_description: "don't find catch2, use jpeg instead of libjpeg-turbo" + patch_type: "conan" + - patch_file: "patches/0.7.1-0002-use-cci-packages.patch" + patch_description: "use cci's packages" + patch_type: "conan" "0.5.0": - - patch_file: "patches/0001-0.4.0-cmake-no-openblas.patch" + - patch_file: "patches/0.4.0-0001-cmake-no-openblas.patch" patch_description: "Fix CMakeLists: OpenBLAS is not a dependency" patch_type: "conan" patch_source: "https://github.com/panda-official/WaveletBuffer/pull/49" - - patch_file: "patches/0002-0.4.0-cmake-find-jpeblib.patch" + - patch_file: "patches/0.4.0-0002-cmake-find-jpeblib.patch" patch_description: "Fix CMakeLists: link to jpeg lib only" patch_type: "conan" "0.4.0": - - patch_file: "patches/0001-0.4.0-cmake-no-openblas.patch" + - patch_file: "patches/0.4.0-0001-cmake-no-openblas.patch" patch_description: "Fix CMakeLists: OpenBLAS is not a dependency" patch_type: "conan" patch_source: "https://github.com/panda-official/WaveletBuffer/pull/49" - - patch_file: "patches/0002-0.4.0-cmake-find-jpeblib.patch" + - patch_file: "patches/0.4.0-0002-cmake-find-jpeblib.patch" patch_description: "Fix CMakeLists: link to jpeg lib only" patch_type: "conan" diff --git a/recipes/wavelet_buffer/all/conanfile.py b/recipes/wavelet_buffer/all/conanfile.py index 8e72fbe22217ef..f322218f978f0e 100644 --- a/recipes/wavelet_buffer/all/conanfile.py +++ b/recipes/wavelet_buffer/all/conanfile.py @@ -60,12 +60,15 @@ def layout(self): def requirements(self): self.requires("blaze/3.8", transitive_headers=True) - self.requires("cimg/3.0.2") + self.requires("cimg/3.3.0") if self.options.jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.1") else: self.requires("libjpeg/9e") # FIXME: unvendor SfCompressor which is currently downloaded at build time :s + if Version(self.version) >= "0.6.0": + self.requires("streamvbyte/1.0.0") + self.requires("fpzip/1.3.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -105,12 +108,17 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "wavelet_buffer") self.cpp_info.set_property("cmake_target_name", "wavelet_buffer::wavelet_buffer") - self.cpp_info.libs = ["wavelet_buffer", "sf_compressor"] self.cpp_info.requires = ["blaze::blaze", "cimg::cimg"] + if Version(self.version) >= "0.6.0": + self.cpp_info.libs = ["wavelet_buffer"] + self.cpp_info.requires.extend(["streamvbyte::streamvbyte", "fpzip::fpzip"]) + else: + self.cpp_info.libs = ["wavelet_buffer", "sf_compressor"] if self.options.jpeg == "libjpeg-turbo": self.cpp_info.requires.append("libjpeg-turbo::jpeg") else: diff --git a/recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch b/recipes/wavelet_buffer/all/patches/0.4.0-0001-cmake-no-openblas.patch similarity index 100% rename from recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch rename to recipes/wavelet_buffer/all/patches/0.4.0-0001-cmake-no-openblas.patch diff --git a/recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch b/recipes/wavelet_buffer/all/patches/0.4.0-0002-cmake-find-jpeblib.patch similarity index 100% rename from recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch rename to recipes/wavelet_buffer/all/patches/0.4.0-0002-cmake-find-jpeblib.patch diff --git a/recipes/wavelet_buffer/all/patches/0.7.1-0001-fix-packages.patch b/recipes/wavelet_buffer/all/patches/0.7.1-0001-fix-packages.patch new file mode 100644 index 00000000000000..6621e790da38b8 --- /dev/null +++ b/recipes/wavelet_buffer/all/patches/0.7.1-0001-fix-packages.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2a6681..5ef9cbb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,9 +59,8 @@ else() + endif() + + find_package(blaze REQUIRED) +-find_package(libjpeg-turbo REQUIRED) ++find_package(JPEG REQUIRED) + find_package(cimg REQUIRED) +-find_package(Catch2 REQUIRED) + + # Create wb target + set(WB_TARGET_NAME ${PROJECT_NAME}) +@@ -146,7 +145,7 @@ target_include_directories( + # Link dependencies + target_link_libraries(${WB_TARGET_NAME} PRIVATE streamvbyte) + target_link_libraries(${WB_TARGET_NAME} PRIVATE fpzip) +-target_link_libraries(${WB_TARGET_NAME} PRIVATE libjpeg-turbo::libjpeg-turbo) ++target_link_libraries(${WB_TARGET_NAME} PRIVATE JPEG::JPEG) + target_link_libraries(${WB_TARGET_NAME} PRIVATE cimg::cimg) + + target_link_libraries(${WB_TARGET_NAME} PUBLIC blaze::blaze) diff --git a/recipes/wavelet_buffer/all/patches/0.7.1-0002-use-cci-packages.patch b/recipes/wavelet_buffer/all/patches/0.7.1-0002-use-cci-packages.patch new file mode 100644 index 00000000000000..260b4ac4bbddc3 --- /dev/null +++ b/recipes/wavelet_buffer/all/patches/0.7.1-0002-use-cci-packages.patch @@ -0,0 +1,66 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5ef9cbb..fed641b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -80,39 +80,12 @@ add_library( + sources/internal/matrix_compressor.cc + ) + +-include(FetchContent) +- +-fetchcontent_declare( +- streamvbyte +- URL https://github.com/lemire/streamvbyte/archive/refs/tags/v1.0.0.zip +- URL_HASH MD5=3d1a01cfb704947fa6498944082aeed1 +-) +- +-fetchcontent_declare( +- fpzip +- URL https://github.com/LLNL/fpzip/releases/download/1.3.0/fpzip-1.3.0.zip +- URL_HASH MD5=933ed7628de406a24fe2de61c8c3356c +-) +- +-fetchcontent_makeavailable(streamvbyte) +- +-fetchcontent_getproperties(fpzip) +- +-if(NOT fpzip_POPULATED) +- fetchcontent_populate(fpzip) +- # Make subproject to use 'BUILD_SHARED_LIBS=ON' setting. +- set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "Build SHARED libraries") +- add_subdirectory(${fpzip_SOURCE_DIR} ${fpzip_BINARY_DIR}) +-endif() ++find_package(streamvbyte REQUIRED CONFIG) ++find_package(fpzip REQUIRED CONFIG) + + # Add alias + add_library(${WB_TARGET_NAME}::${WB_TARGET_NAME} ALIAS ${WB_TARGET_NAME}) + +-# Set fPIC +-set_target_properties(${WB_TARGET_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) +-set_target_properties(streamvbyte PROPERTIES POSITION_INDEPENDENT_CODE ON) +-set_target_properties(fpzip PROPERTIES POSITION_INDEPENDENT_CODE ON) +- + # Turn off parallelization in blaze + target_compile_definitions( + ${WB_TARGET_NAME} +@@ -143,8 +116,8 @@ target_include_directories( + ) + + # Link dependencies +-target_link_libraries(${WB_TARGET_NAME} PRIVATE streamvbyte) +-target_link_libraries(${WB_TARGET_NAME} PRIVATE fpzip) ++target_link_libraries(${WB_TARGET_NAME} PRIVATE streamvbyte::streamvbyte) ++target_link_libraries(${WB_TARGET_NAME} PRIVATE fpzip::fpzip) + target_link_libraries(${WB_TARGET_NAME} PRIVATE JPEG::JPEG) + target_link_libraries(${WB_TARGET_NAME} PRIVATE cimg::cimg) + +@@ -178,7 +151,7 @@ endif() + include(GNUInstallDirs) + + # Create package targets file +-install(TARGETS ${WB_TARGET_NAME} streamvbyte EXPORT ${WB_TARGET_NAME}-target) ++install(TARGETS ${WB_TARGET_NAME} EXPORT ${WB_TARGET_NAME}-target) + install( + EXPORT ${WB_TARGET_NAME}-target + FILE ${WB_TARGET_NAME}-targets.cmake diff --git a/recipes/wavelet_buffer/config.yml b/recipes/wavelet_buffer/config.yml index d13fcfd021b7b0..80a49141e8ea47 100644 --- a/recipes/wavelet_buffer/config.yml +++ b/recipes/wavelet_buffer/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.1": + folder: all "0.5.0": folder: all "0.4.0": diff --git a/recipes/wayland-protocols/all/conandata.yml b/recipes/wayland-protocols/all/conandata.yml index f5d4a91464dd2f..9574e69bcf1e98 100644 --- a/recipes/wayland-protocols/all/conandata.yml +++ b/recipes/wayland-protocols/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.32": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.32/downloads/wayland-protocols-1.32.tar.xz" + sha256: "7459799d340c8296b695ef857c07ddef24c5a09b09ab6a74f7b92640d2b1ba11" "1.31": url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.31/downloads/wayland-protocols-1.31.tar.xz" sha256: "a07fa722ed87676ec020d867714bc9a2f24c464da73912f39706eeef5219e238" diff --git a/recipes/wayland-protocols/all/conanfile.py b/recipes/wayland-protocols/all/conanfile.py index 04a7ce005ea56e..5888f7b0c3ad17 100644 --- a/recipes/wayland-protocols/all/conanfile.py +++ b/recipes/wayland-protocols/all/conanfile.py @@ -27,7 +27,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def build_requirements(self): - self.tool_requires("meson/1.1.1") + self.tool_requires("meson/1.2.2") def layout(self): basic_layout(self, src_folder="src") diff --git a/recipes/wayland-protocols/all/test_package/conanfile.py b/recipes/wayland-protocols/all/test_package/conanfile.py index 06a3d74d242191..6004f71f932671 100644 --- a/recipes/wayland-protocols/all/test_package/conanfile.py +++ b/recipes/wayland-protocols/all/test_package/conanfile.py @@ -20,9 +20,9 @@ def requirements(self): self.requires("wayland/1.22.0") def build_requirements(self): - self.tool_requires("meson/1.1.1") + self.tool_requires("meson/1.2.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") self.tool_requires("wayland/1.22.0") def layout(self): diff --git a/recipes/wayland-protocols/config.yml b/recipes/wayland-protocols/config.yml index 81aded41c98221..f707ca2da06d2d 100644 --- a/recipes/wayland-protocols/config.yml +++ b/recipes/wayland-protocols/config.yml @@ -1,4 +1,6 @@ versions: + "1.32": + folder: all "1.31": folder: all "1.27": diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py index 4deb10375518e7..7e341eb9914d74 100644 --- a/recipes/wayland/all/conanfile.py +++ b/recipes/wayland/all/conanfile.py @@ -50,7 +50,7 @@ def requirements(self): if self.options.enable_libraries: self.requires("libffi/3.4.4") if self.options.enable_dtd_validation: - self.requires("libxml2/2.11.4") + self.requires("libxml2/2.11.5") self.requires("expat/2.5.0") def validate(self): @@ -58,9 +58,9 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def build_requirements(self): - self.tool_requires("meson/1.1.0") + self.tool_requires("meson/1.3.0") 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 cross_building(self): self.tool_requires(str(self.ref)) diff --git a/recipes/wayland/all/test_package/conanfile.py b/recipes/wayland/all/test_package/conanfile.py index c201ad68aff345..e9a83534cede73 100644 --- a/recipes/wayland/all/test_package/conanfile.py +++ b/recipes/wayland/all/test_package/conanfile.py @@ -21,7 +21,7 @@ def requirements(self): def build_requirements(self): self.tool_requires(self.tested_reference_str) 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") def layout(self): cmake_layout(self) diff --git a/recipes/websocketpp/all/conanfile.py b/recipes/websocketpp/all/conanfile.py index 2e4962181cae1c..8bc3d40999ef3d 100644 --- a/recipes/websocketpp/all/conanfile.py +++ b/recipes/websocketpp/all/conanfile.py @@ -37,12 +37,12 @@ def requirements(self): self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) if self.options.with_zlib: - self.requires("zlib/1.2.13", transitive_headers=True, transitive_libs=True) + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) if self.options.asio == "standalone": - self.requires("asio/1.27.0", transitive_headers=True) + self.requires("asio/1.28.1", transitive_headers=True) elif self.options.asio == "boost": - self.requires("boost/1.81.0", transitive_headers=True) + self.requires("boost/1.83.0", transitive_headers=True) def package_id(self): self.info.clear() diff --git a/recipes/whereami/all/CMakeLists.txt b/recipes/whereami/all/CMakeLists.txt index 9ad1b58bfdd925..4595ccd0654eb5 100644 --- a/recipes/whereami/all/CMakeLists.txt +++ b/recipes/whereami/all/CMakeLists.txt @@ -1,14 +1,11 @@ -cmake_minimum_required(VERSION 3.4.3) +cmake_minimum_required(VERSION 3.12) project(whereami C) -include(conanbuildinfo.cmake) -conan_basic_setup() - if (WIN32 AND BUILD_SHARED_LIBS) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() -set(WHEREAMI_SRC "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder") +set(WHEREAMI_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src") set(SOURCE_FILES ${WHEREAMI_SRC}/src/whereami.c) set(HEADER_FILES ${WHEREAMI_SRC}/src/whereami.h) @@ -17,9 +14,6 @@ add_library(${CMAKE_PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES}) target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${WHEREAMI_SRC}/src) set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY C_STANDARD 99) -install(TARGETS ${CMAKE_PROJECT_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) - +include(GNUInstallDirs) +install(TARGETS ${CMAKE_PROJECT_NAME}) install(FILES ${HEADER_FILES} DESTINATION include) diff --git a/recipes/whereami/all/conanfile.py b/recipes/whereami/all/conanfile.py index 323a8747c8641c..6035268b447eec 100644 --- a/recipes/whereami/all/conanfile.py +++ b/recipes/whereami/all/conanfile.py @@ -1,58 +1,64 @@ -from conans import ConanFile, CMake, tools +import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.53.0" class WhereamiConan(ConanFile): name = "whereami" description = "Locate the current executable and the current module/library on the file system" - topics = ("whereami", "introspection", "getmodulefilename", - "dladdr", "executable-path", "getexecutablepath") + license = ("MIT", "WTFPL") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/gpakosz/whereami" - license = ("MIT", "WTFPL") - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + topics = ("whereami", "introspection", "getmodulefilename", "dladdr", "executable-path", "getexecutablepath") - _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_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC 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 source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + def layout(self): + cmake_layout(self, src_folder="src") - def _configure_cmake(self): - if self._cmake: - return self._cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) 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): diff --git a/recipes/whereami/all/test_package/CMakeLists.txt b/recipes/whereami/all/test_package/CMakeLists.txt index 7c0f4c847fb311..4789557edaa689 100644 --- a/recipes/whereami/all/test_package/CMakeLists.txt +++ b/recipes/whereami/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(whereami REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/whereami/all/test_package/conanfile.py b/recipes/whereami/all/test_package/conanfile.py index 49a3a66ea5bad4..ef5d7042163ecc 100644 --- a/recipes/whereami/all/test_package/conanfile.py +++ b/recipes/whereami/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,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/whereami/all/test_v1_package/CMakeLists.txt b/recipes/whereami/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/whereami/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/whereami/all/test_v1_package/conanfile.py b/recipes/whereami/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/whereami/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/wide-integer/all/conandata.yml b/recipes/wide-integer/all/conandata.yml new file mode 100644 index 00000000000000..8e3a196e3ef2e9 --- /dev/null +++ b/recipes/wide-integer/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20231015": + url: "https://github.com/ckormanyos/wide-integer/archive/4c9711b463431c5b64c680444f35183c053be735.tar.gz" + sha256: "db5e5491d22fb5f1b9dd3ad6839e479e7d26670764d8e629cbc0b6a5f1b8c47d" diff --git a/recipes/wide-integer/all/conanfile.py b/recipes/wide-integer/all/conanfile.py new file mode 100644 index 00000000000000..b8ab834969f4b6 --- /dev/null +++ b/recipes/wide-integer/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +import os + +required_conan_version = ">=1.53.0" + +class WideIntegerConan(ConanFile): + name = "wide-integer" + description = "Wide-Integer implements a generic C++ template for uint128_t, uint256_t, uint512_t, uint1024_t, etc." + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ckormanyos/wide-integer/" + topics = ("arbitary-precision", "multiprecision", "big-integer", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "190", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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 does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE_1_0.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include", "math"), + src=os.path.join(self.source_folder, "math"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/wide-integer/all/test_package/CMakeLists.txt b/recipes/wide-integer/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..8e666755a11350 --- /dev/null +++ b/recipes/wide-integer/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(wide-integer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE wide-integer::wide-integer) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/wide-integer/all/test_package/conanfile.py b/recipes/wide-integer/all/test_package/conanfile.py new file mode 100644 index 00000000000000..e845ae751a3017 --- /dev/null +++ b/recipes/wide-integer/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wide-integer/all/test_package/test_package.cpp b/recipes/wide-integer/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..5b9232349b7ab5 --- /dev/null +++ b/recipes/wide-integer/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +int main(void) { + using math::wide_integer::uint256_t; + + uint256_t a("0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE"); + uint256_t b("0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75"); + + uint256_t c = (a * b); + uint256_t d = (a / b); + + return 0; +} diff --git a/recipes/wide-integer/config.yml b/recipes/wide-integer/config.yml new file mode 100644 index 00000000000000..6fb64b738b18ee --- /dev/null +++ b/recipes/wide-integer/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20231015": + folder: all diff --git a/recipes/wil/all/conandata.yml b/recipes/wil/all/conandata.yml index a123bb6fadf863..f61d76458812ce 100644 --- a/recipes/wil/all/conandata.yml +++ b/recipes/wil/all/conandata.yml @@ -1,4 +1,13 @@ 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" + "1.0.230629.1": + url: "https://github.com/microsoft/wil/archive/refs/tags/v1.0.230629.1.tar.gz" + sha256: "c0d9ad1f295e181aa28d7c9b219e7d530e6bc4b7533317be50e7eae760c8d63f" "1.0.230411.1": url: "https://github.com/microsoft/wil/archive/refs/tags/v1.0.230411.1.tar.gz" sha256: "03742849f5cb458fcfe8d30ff7afb6ff4bd67fe3aee3768cd6fb1140c59fcfd3" diff --git a/recipes/wil/config.yml b/recipes/wil/config.yml index 4e26f7b007f298..f2dcd6f1c34e1e 100644 --- a/recipes/wil/config.yml +++ b/recipes/wil/config.yml @@ -1,4 +1,10 @@ versions: + "1.0.231028.1": + folder: "all" + "1.0.230824.2": + folder: "all" + "1.0.230629.1": + folder: "all" "1.0.230411.1": folder: "all" "1.0.230202.1": diff --git a/recipes/wildmidi/all/conanfile.py b/recipes/wildmidi/all/conanfile.py index 0e6c15d33a72bd..4648d8d359fa37 100644 --- a/recipes/wildmidi/all/conanfile.py +++ b/recipes/wildmidi/all/conanfile.py @@ -15,6 +15,7 @@ class WildmidiConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.mindwerks.net/projects/wildmidi" topics = ("audio", "midi", "multimedia", "music", "softsynth", "sound", "synth") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -72,10 +73,10 @@ def package_info(self): if is_msvc(self): libname = "libWildMidi" if not self.options.shared: - libname += "-static" + libname += "-static" else: libname = "WildMidi" - + self.cpp_info.set_property("cmake_file_name", "WildMidi") self.cpp_info.set_property("cmake_target_name", "WildMidi::libwildmidi") self.cpp_info.set_property("pkg_config_name", "wildmidi") @@ -92,3 +93,5 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "WildMidi" self.cpp_info.components["libwildmidi"].names["cmake_find_package"] = "libwildmidi" self.cpp_info.components["libwildmidi"].names["cmake_find_package_multi"] = "libwildmidi" + self.cpp_info.components["libwildmidi"].set_property("cmake_target_name", "WildMidi::libwildmidi") + self.cpp_info.components["libwildmidi"].set_property("pkg_config_name", "wildmidi") diff --git a/recipes/winflexbison/all/conandata.yml b/recipes/winflexbison/all/conandata.yml index c1a75693f1653c..44c1f53fdafb9d 100644 --- a/recipes/winflexbison/all/conandata.yml +++ b/recipes/winflexbison/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.5.25": + url: "https://github.com/lexxmark/winflexbison/archive/v2.5.25.tar.gz" + sha256: "8e1b71e037b524ba3f576babb0cf59182061df1f19cd86112f085a882560f60b" "2.5.24": url: "https://github.com/lexxmark/winflexbison/archive/v2.5.24.tar.gz" sha256: "a49d6e310636e3487e1e066e411d908cfeae2d5b5fde1f3cf74fe1d6d4301062" @@ -6,6 +9,8 @@ sources: url: "https://github.com/lexxmark/winflexbison/archive/v2.5.22.tar.gz" sha256: "697c2c4af3308625605b75498bd63a9a294660f8e43a4c35452cf4334fa4a530" patches: + "2.5.25": + - patch_file: "patches/0001-2.5.25-mingw-support.patch" "2.5.24": - patch_file: "patches/0001-2.5.24-mingw-support.patch" "2.5.22": diff --git a/recipes/winflexbison/all/patches/0001-2.5.25-mingw-support.patch b/recipes/winflexbison/all/patches/0001-2.5.25-mingw-support.patch new file mode 100644 index 00000000000000..54af813f752634 --- /dev/null +++ b/recipes/winflexbison/all/patches/0001-2.5.25-mingw-support.patch @@ -0,0 +1,177 @@ +--- bison/src/config.h ++++ bison/src/config.h +@@ -1,1 +1,2 @@ ++#pragma once + #define PACKAGE_BUGREPORT "https://github.com/lexxmark/winflexbison/issues" +--- bison/src/conflicts.c ++++ bison/src/conflicts.c +@@ -30,7 +30,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "print-xml.h" + #include "reader.h" + #include "state.h" +--- bison/src/lalr.c ++++ bison/src/lalr.c +@@ -33,7 +33,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "muscle-tab.h" + #include "nullable.h" + #include "reader.h" +--- bison/src/LR0.c ++++ bison/src/LR0.c +@@ -32,7 +32,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "reader.h" + #include "reduce.h" + #include "state.h" +--- bison/src/main.c ++++ bison/src/main.c +@@ -45,7 +45,7 @@ + #include "gram.h" + #include "ielr.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "muscle-tab.h" + #include "nullable.h" + #include "output.h" +--- bison/src/print.c ++++ bison/src/print.c +@@ -35,7 +35,7 @@ + #include "getargs.h" + #include "gram.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "muscle-tab.h" + #include "reader.h" + #include "reduce.h" +--- bison/src/print-graph.c ++++ bison/src/print-graph.c +@@ -31,7 +31,7 @@ + #include "gram.h" + #include "graphviz.h" + #include "lalr.h" +-#include "lr0.h" ++#include "LR0.h" + #include "reader.h" + #include "state.h" + #include "symtab.h" +--- bison/src/print-xml.c ++++ bison/src/print-xml.c +@@ -37,1 +37,1 @@ +-#include "lr0.h" ++#include "LR0.h" +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -2,23 +2,23 @@ + + project (winflexbison) + +-if(NOT MSVC) +- message( FATAL_ERROR "Visual Studio Build supported only" ) ++if(MSVC) ++ add_definitions(-D_CRT_SECURE_NO_WARNINGS) + endif() + +-add_definitions(-D_CRT_SECURE_NO_WARNINGS) ++ + + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-D_DEBUG) + endif() + + # next line needed for compile in C (nor CPP) mode (ucrt headers bug) + add_definitions(-Dinline=__inline) + # next line needed for VS2017 only + add_definitions(-Drestrict=__restrict) + +-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /MD /Od /Zi /EHsc") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /GL /Od /Oi /Gy /Zi /EHsc") ++#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /MD /Od /Zi /EHsc") ++#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /GL /Od /Oi /Gy /Zi /EHsc") + + # Define Release by default. + if(NOT CMAKE_BUILD_TYPE) +--- common/CMakeLists.txt ++++ common/CMakeLists.txt +@@ -4,6 +4,12 @@ + + project(${PROJECT_NAME} C) + ++include(CheckSymbolExists) ++check_symbol_exists(nanouptime "sys/time.h" HAVE_NANOUPTIME) ++check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) ++check_symbol_exists(microuptime "sys/time.h" HAVE_MICROUPTIME) ++check_symbol_exists(timespec_get "time.h" HAVE_TIMESPEC_GET) ++ + # Definition of Macros + add_definitions(-D_LIB) + +@@ -31,3 +37,9 @@ + add_library(${PROJECT_NAME} STATIC + ${SOURCE_FILES} + ) ++target_compile_definitions(${PROJECT_NAME} PRIVATE ++ $<$:HAVE_NANOUPTIME=1> ++ $<$:HAVE_CLOCK_GETTIME=1> ++ $<$:HAVE_MICROUPTIME=1> ++ $<$:HAVE_TIMESPEC_GET=1> ++) +--- common/m4/lib/clean-temp.h ++++ common/m4/lib/clean-temp.h +@@ -137,3 +137,3 @@ +- +-typedef int mode_t; +- ++#if defined _MSC_VER ++typedef int mode_t; ++#endif +--- common/misc/gethrxtime.c ++++ common/misc/gethrxtime.c +@@ -27,6 +27,6 @@ +-//#include + #include "timespec.h" +- ++#if HAVE_CLOCK_GETTIME ++#include ++#endif + /* Get the current time, as a count of the number of nanoseconds since + an arbitrary epoch (e.g., the system boot time). Prefer a +- high-resolution clock that is not subject to resetting or +@@ -49,8 +49,8 @@ + if (clock_gettime (CLOCK_MONOTONIC, &ts) == 0) + return xtime_make (ts.tv_sec, ts.tv_nsec); + } +-# endif +- ++# ++# else + # if HAVE_MICROUPTIME + { + struct timeval tv; +@@ -69,6 +69,6 @@ + } + # endif + # endif ++# endif + } +- + #endif +--- flex/CMakeLists.txt ++++ flex/CMakeLists.txt +@@ -25,1 +25,1 @@ +-target_link_libraries(${PROJECT_NAME} winflexbison_common kernel32.lib user32.lib) ++target_link_libraries(${PROJECT_NAME} winflexbison_common kernel32 user32) diff --git a/recipes/winflexbison/config.yml b/recipes/winflexbison/config.yml index 480280b1fb8e8b..4ae41b917c9169 100644 --- a/recipes/winflexbison/config.yml +++ b/recipes/winflexbison/config.yml @@ -1,4 +1,6 @@ versions: + "2.5.25": + folder: all "2.5.24": folder: all "2.5.22": diff --git a/recipes/winmd/all/conanfile.py b/recipes/winmd/all/conanfile.py index 1882e7a4ae7032..e37dc1cc239fe2 100644 --- a/recipes/winmd/all/conanfile.py +++ b/recipes/winmd/all/conanfile.py @@ -5,10 +5,10 @@ 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 from conan.tools.scm import Version -from conan.tools.microsoft import is_msvc, check_min_vs -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.50.0" class WinMDConan(ConanFile): @@ -18,6 +18,7 @@ class WinMDConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/microsoft/winmd" topics = ("native", "C++", "WinRT", "WinMD") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -30,7 +31,9 @@ def _compilers_minimum_version(self): return { "gcc": "8", "clang": "12", - "apple-clang": "12.0", + "apple-clang": "12", + "Visual Studio": "15", + "msvc": "191", } def layout(self): @@ -40,20 +43,17 @@ def package_id(self): self.info.clear() def validate(self): - # FIXME: `self.settings` is not available in 2.0 but there are plenty of open issues about - # the migration point. For now we are only going to write valid 1.x recipes until we have a proper answer 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 (fully) 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 (fully) support." + ) 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 package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) @@ -65,6 +65,8 @@ def package(self): ) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] if not is_msvc(self): # ignore shadowing errors - self.cpp_info.cppflags = ['-fpermissive'] + self.cpp_info.cxxflags = ['-fpermissive'] diff --git a/recipes/wolfssl/all/conandata.yml b/recipes/wolfssl/all/conandata.yml index 45f769c9058382..07a88deb272d27 100644 --- a/recipes/wolfssl/all/conandata.yml +++ b/recipes/wolfssl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.6.4": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.6.4-stable.tar.gz" + sha256: "031691906794ff45e1e792561cf31759f5d29ac74936bc8dffb8b14f16d820b4" "5.6.3": url: "https://github.com/wolfSSL/wolfssl/archive/v5.6.3-stable.tar.gz" sha256: "2e74a397fa797c2902d7467d500de904907666afb4ff80f6464f6efd5afb114a" diff --git a/recipes/wolfssl/config.yml b/recipes/wolfssl/config.yml index 92091015e6a563..1d558dac0d2325 100644 --- a/recipes/wolfssl/config.yml +++ b/recipes/wolfssl/config.yml @@ -1,4 +1,6 @@ versions: + "5.6.4": + folder: all "5.6.3": folder: all "5.5.1": diff --git a/recipes/wslay/all/patches/0001-msvc-support.patch b/recipes/wslay/all/patches/0001-msvc-support.patch index a689fc2452be18..b8e26fd0b44afc 100644 --- a/recipes/wslay/all/patches/0001-msvc-support.patch +++ b/recipes/wslay/all/patches/0001-msvc-support.patch @@ -44,14 +44,14 @@ index 4af972e..96b5392 100644 if(WSLAY_STATIC) add_library(wslay STATIC ${SOURCES} ${HEADERS}) list(APPEND WSLAY_TARGETS wslay) -+ if(MSVC) ++ if(WIN32) + target_link_libraries(wslay PUBLIC ws2_32) + endif() endif() if(WSLAY_SHARED) add_library(wslay_shared SHARED ${SOURCES} ${HEADERS}) list(APPEND WSLAY_TARGETS wslay_shared) -+ if(MSVC) ++ if(WIN32) + target_link_libraries(wslay_shared PUBLIC ws2_32) + endif() endif() diff --git a/recipes/wt/all/conandata.yml b/recipes/wt/all/conandata.yml index c26a610e865f77..7c33a1e76efa3f 100644 --- a/recipes/wt/all/conandata.yml +++ b/recipes/wt/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.10.1": + url: "https://github.com/emweb/wt/archive/4.10.1.tar.gz" + sha256: "f6d6114416a628604793197cd077066a9d4d98799bbb288b97de42f66705bde5" + "4.10.0": + url: "https://github.com/emweb/wt/archive/4.10.0.tar.gz" + sha256: "7090023d4fc4b6594bf4cb11072d9d3d775269327aece9a8993c7bbe46decb9d" "4.9.1": url: "https://github.com/emweb/wt/archive/4.9.1.tar.gz" sha256: "253c61779623ed125bdd604a7b7fe48e64bd991548d17180f040bfa88ccafd98" @@ -15,6 +21,14 @@ sources: url: "https://github.com/emweb/wt/archive/4.6.0.tar.gz" sha256: "7f709e132d32c4925e6db0a590c7ccc5613344e8b9052676ef891a25ccb550e6" patches: + "4.10.1": + - patch_file: "patches/4.8.0-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" + "4.10.0": + - patch_file: "patches/4.8.0-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" "4.9.1": - patch_file: "patches/4.8.0-0001-use-cci-package.patch" patch_description: "use cci package" diff --git a/recipes/wt/all/conanfile.py b/recipes/wt/all/conanfile.py index 86da6cd03dedb4..fc0eb757303bdc 100644 --- a/recipes/wt/all/conanfile.py +++ b/recipes/wt/all/conanfile.py @@ -1,10 +1,11 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanException, ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.microsoft import is_msvc import os +import sys import shutil required_conan_version = ">=1.54.0" @@ -96,21 +97,21 @@ def requirements(self): if Version(self.version) < "4.9.0": self.requires("boost/1.80.0", transitive_headers = True) else: - self.requires("boost/1.82.0", transitive_headers = True) + self.requires("boost/1.83.0", transitive_headers = True) if self.options.connector_http: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_ssl: self.requires("openssl/[>=1.1 <4]") if self.options.get_safe("with_sqlite"): - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/3.44.2") if self.options.get_safe("with_mysql"): - self.requires("libmysqlclient/8.0.31", transitive_headers=True, transitive_libs=True) + self.requires("libmysqlclient/8.1.0", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_postgres"): - self.requires("libpq/15.3", transitive_headers=True, transitive_libs=True) + self.requires("libpq/15.4", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_mssql") and self.settings.os != "Windows": self.requires("odbc/2.3.11") if self.options.get_safe("with_unwind"): - self.requires("libunwind/1.7.0") + self.requires("libunwind/1.7.2") def validate(self): miss_boost_required_comp = any(self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) @@ -121,6 +122,16 @@ def validate(self): f"{', '.join(self._required_boost_components)}" ) + # FIXME: https://redmine.emweb.be/issues/12073w + if conan_version.major == 2 and Version(self.version) == "4.10.1" and is_msvc(self): + + # FIXME: check_max_cppstd is only available for Conan 2.x. Remove it after dropping support for Conan 1.x + # FIXME: linter complains, but function is there + # https://docs.conan.io/2.0/reference/tools/build.html?highlight=check_min_cppstd#conan-tools-build-check-max-cppstd + check_max_cppstd = getattr(sys.modules['conan.tools.build'], 'check_max_cppstd') + # INFO: error C2661: 'std::to_chars': no overloaded function takes 2 arguments. Removed in C++17. + check_max_cppstd(self, 14) + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -146,7 +157,7 @@ def _get_library_prefix(self): return "" if self.settings.os == "Windows" else "lib" def _cmakify_path_list(self, paths): - return ";".join(paths).replace("\\", "/") + return ";".join([p.replace("\\", "/") for p in paths]) def _find_library(self, libname, dep): for path in self.dependencies[dep].cpp_info.aggregated_components().libdirs: @@ -190,16 +201,16 @@ def generate(self): # FIXME: all this logic coming from upstream custom find module files seems fragile, to improve later ! # we can't even inject cmake_find_package generator, it breaks the all upstream logic - tc.variables["BOOST_PREFIX"] = self._cmakify_path_list(self.dependencies["boost"].package_folder) + tc.variables["BOOST_PREFIX"] = self._cmakify_path_list([self.dependencies["boost"].package_folder]) if self.options.connector_http: - tc.variables["ZLIB_PREFIX"] = self._cmakify_path_list(self.dependencies["zlib"].package_folder) + tc.variables["ZLIB_PREFIX"] = self._cmakify_path_list([self.dependencies["zlib"].package_folder]) if self.options.with_ssl: - tc.variables["SSL_PREFIX"] = self._cmakify_path_list(self.dependencies["openssl"].package_folder) + tc.variables["SSL_PREFIX"] = self._cmakify_path_list([self.dependencies["openssl"].package_folder]) tc.variables["OPENSSL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("openssl")) tc.variables["OPENSSL_INCLUDE_DIR"] = self._cmakify_path_list(self.dependencies["openssl"].cpp_info.aggregated_components().includedirs) tc.variables["OPENSSL_FOUND"] = True if self.options.get_safe("with_sqlite"): - tc.variables["SQLITE3_PREFIX"] = self._cmakify_path_list(self.dependencies["sqlite3"].package_folder) + tc.variables["SQLITE3_PREFIX"] = self._cmakify_path_list([self.dependencies["sqlite3"].package_folder]) if self.options.get_safe("with_mysql"): tc.variables["MYSQL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libmysqlclient")) libmysqlclient_cppinfo = self.dependencies["libmysqlclient"].cpp_info.aggregated_components() @@ -207,17 +218,17 @@ def generate(self): tc.variables["MYSQL_DEFINITIONS"] = ";".join(f"-D{d}" for d in libmysqlclient_cppinfo.defines) tc.variables["MYSQL_FOUND"] = True if self.options.get_safe("with_postgres"): - tc.variables["POSTGRES_PREFIX"] = self._cmakify_path_list(self.dependencies["libpq"].package_folder) + tc.variables["POSTGRES_PREFIX"] = self._cmakify_path_list([self.dependencies["libpq"].package_folder]) tc.variables["POSTGRES_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libpq")) tc.variables["POSTGRES_INCLUDE"] = self._cmakify_path_list(self.dependencies["libpq"].cpp_info.aggregated_components().includedirs) tc.variables["POSTGRES_FOUND"] = True if self.options.get_safe("with_mssql") and self.settings.os != "Windows": - tc.variables["ODBC_PREFIX"] = self._cmakify_path_list(self.dependencies["odbc"].package_folder) + tc.variables["ODBC_PREFIX"] = self._cmakify_path_list([self.dependencies["odbc"].package_folder]) tc.variables["ODBC_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("odbc")) tc.variables["ODBC_INCLUDE"] = self._cmakify_path_list(self.dependencies["odbc"].cpp_info.aggregated_components().includedirs) tc.variables["ODBC_FOUND"] = True if self.options.get_safe("with_unwind"): - tc.variables["UNWIND_PREFIX"] = self._cmakify_path_list(self.dependencies["libunwind"].package_folder) + tc.variables["UNWIND_PREFIX"] = self._cmakify_path_list([self.dependencies["libunwind"].package_folder]) if self.settings.os == "Windows": tc.variables["CONNECTOR_FCGI"] = False tc.variables["CONNECTOR_ISAPI"] = self.options.connector_isapi diff --git a/recipes/wt/config.yml b/recipes/wt/config.yml index d129fd323175f9..fec9d209ef8764 100644 --- a/recipes/wt/config.yml +++ b/recipes/wt/config.yml @@ -1,4 +1,8 @@ versions: + "4.10.1": + folder: all + "4.10.0": + folder: all "4.9.1": folder: all "4.8.0": diff --git a/recipes/wyhash/all/conanfile.py b/recipes/wyhash/all/conanfile.py index 34e8d0350c888c..5ef173786f6ec2 100644 --- a/recipes/wyhash/all/conanfile.py +++ b/recipes/wyhash/all/conanfile.py @@ -4,7 +4,7 @@ import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.50.0" class WyhashConan(ConanFile): name = "wyhash" @@ -13,6 +13,7 @@ class WyhashConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/wangyi-fudan/wyhash" topics = ("bloom-filter", "hash", "random-number-generators", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -23,7 +24,7 @@ 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 package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) diff --git a/recipes/xapian-core/all/conanfile.py b/recipes/xapian-core/all/conanfile.py index f2cc68f3f1bd4e..e5d0241981b9f7 100644 --- a/recipes/xapian-core/all/conanfile.py +++ b/recipes/xapian-core/all/conanfile.py @@ -54,9 +54,9 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.settings.os != "Windows": - self.requires("libuuid/1.0.3") + self.requires("util-linux-libuuid/2.39") def validate(self): if self.options.shared and self.settings.os == "Windows": diff --git a/recipes/xbyak/all/conandata.yml b/recipes/xbyak/all/conandata.yml index 2e045a1c8a0821..a117cdd9c7b95b 100644 --- a/recipes/xbyak/all/conandata.yml +++ b/recipes/xbyak/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "7.00": + url: "https://github.com/herumi/xbyak/archive/v7.00.tar.gz" + sha256: "9bc479d99bb3bbd30669813ca9719126fe93ab1bae857bd799d2b16a1fcb4c32" + "6.73": + url: "https://github.com/herumi/xbyak/archive/v6.73.tar.gz" + sha256: "41f3dc7727a48c751024c92fa4da24a4a1e0ed16b7930c79d05b76960b19562d" "6.62": url: "https://github.com/herumi/xbyak/archive/v6.62.tar.gz" sha256: "fd5f074d64cdfcacad3bbe8664727a8eab569f131cadd725a778c028fa6b0ccd" diff --git a/recipes/xbyak/all/conanfile.py b/recipes/xbyak/all/conanfile.py index 9523784e16e7c5..724743a916f474 100644 --- a/recipes/xbyak/all/conanfile.py +++ b/recipes/xbyak/all/conanfile.py @@ -11,21 +11,21 @@ class XbyakConan(ConanFile): description = "Xbyak is a C++ header library that enables dynamically to " \ "assemble x86(IA32), x64(AMD64, x86-64) mnemonic." license = "BSD-3-Clause" - topics = ("xbyak", "jit", "assembler") - homepage = "https://github.com/herumi/xbyak" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/herumi/xbyak" + topics = ("jit", "assembler", "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 @@ -37,7 +37,6 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "xbyak") self.cpp_info.set_property("cmake_target_name", "xbyak::xbyak") + self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/xbyak/config.yml b/recipes/xbyak/config.yml index 9006396a7028a6..e1673a246df2d1 100644 --- a/recipes/xbyak/config.yml +++ b/recipes/xbyak/config.yml @@ -1,4 +1,8 @@ versions: + "7.00": + folder: all + "6.73": + folder: all "6.62": folder: all "6.61.2": diff --git a/recipes/xege/all/CMakeLists.txt b/recipes/xege/all/CMakeLists.txt deleted file mode 100644 index 0496b298385496..00000000000000 --- a/recipes/xege/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/xege/all/conanfile.py b/recipes/xege/all/conanfile.py index e3d748b348f875..eb147f1dcfc1f2 100644 --- a/recipes/xege/all/conanfile.py +++ b/recipes/xege/all/conanfile.py @@ -1,33 +1,37 @@ -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.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get + +required_conan_version = ">=1.53.0" class XegeConan(ConanFile): name = "xege" + description = "Easy Graphics Engine, a lite graphics library in Windows" license = "LGPLv2.1" url = "https://github.com/conan-io/conan-center-index" homepage = "https://xege.org/" - description = "Easy Graphics Engine, a lite graphics library in Windows" topics = ("ege", "graphics", "gui") - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - exports_sources = ["CMakeLists.txt"] - def configure(self): - if self.settings.os != "Windows": - raise ConanInvalidConfiguration( - "This library is only compatible for Windows") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("This library is only compatible with Windows") 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.generate() def build(self): cmake = CMake(self) @@ -35,24 +39,21 @@ def build(self): cmake.build() def package(self): - self.copy("*.h", dst="include", src=self._source_subfolder+"/src") - self.copy("*.lib", dst="lib", keep_path=False) - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.so", dst="lib", keep_path=False) - self.copy("*.a", dst="lib", keep_path=False) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + 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, "src")) + for pattern in ["*.lib", "*.a"]: + copy(self, pattern, + dst=os.path.join(self.package_folder, "lib"), + src=self.build_folder, + keep_path=False) def package_info(self): if self.settings.arch == "x86_64": self.cpp_info.libs = ["graphics64"] else: self.cpp_info.libs = ["graphics"] - self.cpp_info.system_libs = [ - "gdiplus", - "uuid", - "msimg32", - "gdi32", - "imm32", - "ole32", - "oleaut32" - ] + self.cpp_info.system_libs = ["gdiplus", "uuid", "msimg32", "gdi32", "imm32", "ole32", "oleaut32"] diff --git a/recipes/xege/all/test_package/CMakeLists.txt b/recipes/xege/all/test_package/CMakeLists.txt index dd28555a7ac65c..26ea67c5823c3e 100644 --- a/recipes/xege/all/test_package/CMakeLists.txt +++ b/recipes/xege/all/test_package/CMakeLists.txt @@ -1,12 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(xege REQUIRED CONFIG) -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) - -if(MSYS OR MINGW) - target_link_libraries(example -static-libgcc -static-libstdc++) -endif() +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xege::xege) diff --git a/recipes/xege/all/test_package/conanfile.py b/recipes/xege/all/test_package/conanfile.py index 2011b67ca68a5a..e845ae751a3017 100644 --- a/recipes/xege/all/test_package/conanfile.py +++ b/recipes/xege/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 XegeTestConan(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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) 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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/xege/all/test_package/example.cpp b/recipes/xege/all/test_package/example.cpp deleted file mode 100644 index e167cd38f70ed7..00000000000000 --- a/recipes/xege/all/test_package/example.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -using namespace ege; - -int main() { - initgraph(640, 480); - circle(120, 120, 100); - Sleep(2000); - closegraph(); -} diff --git a/recipes/xege/all/test_package/test_package.cpp b/recipes/xege/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..658780d07761be --- /dev/null +++ b/recipes/xege/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +using namespace ege; + +int main() { + initgraph(640, 480); + circle(120, 120, 100); + Sleep(2000); + closegraph(); +} diff --git a/recipes/xege/all/test_v1_package/CMakeLists.txt b/recipes/xege/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/xege/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/xege/all/test_v1_package/conanfile.py b/recipes/xege/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..423b8142d5f259 --- /dev/null +++ b/recipes/xege/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class XegeTestConan(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/xerces-c/all/conanfile.py b/recipes/xerces-c/all/conanfile.py index 7f0ec271188e7e..ea827bcd4bbeb1 100644 --- a/recipes/xerces-c/all/conanfile.py +++ b/recipes/xerces-c/all/conanfile.py @@ -1,13 +1,12 @@ from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration -from conan.tools.build import can_run 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, rmdir from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.5" class XercesCConan(ConanFile): @@ -42,6 +41,10 @@ class XercesCConan(ConanFile): "mutex_manager": "standard", } + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def export_sources(self): export_conandata_patches(self) @@ -67,9 +70,9 @@ def layout(self): def requirements(self): if "icu" in (self.options.transcoder, self.options.message_loader): - self.requires("icu/72.1", run=can_run(self)) + self.requires("icu/74.1") if self.options.network_accessor == "curl": - self.requires("libcurl/7.88.1") + self.requires("libcurl/[>=7.78.0 <9]") def _validate(self, option, value, host_os): """ @@ -98,8 +101,8 @@ def validate(self): self._validate("mutex_manager", "windows", ("Windows", )) def build_requirements(self): - if self.options.message_loader == "icu" and not can_run(self): - self.tool_requires("icu/72.1") + if self.options.message_loader == "icu" and not self._is_legacy_one_profile: + self.tool_requires("icu/") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -107,7 +110,7 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if can_run(self): + if self.options.message_loader == "icu" and self._is_legacy_one_profile: env = VirtualRunEnv(self) env.generate(scope="build") tc = CMakeToolchain(self) @@ -133,8 +136,8 @@ def build(self): cmake.build() def package(self): - for license in ("LICENSE", "NOTICE"): - copy(self, license, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + for license_file in ("LICENSE", "NOTICE"): + copy(self, license_file, 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, "share")) diff --git a/recipes/xkbcommon/all/conandata.yml b/recipes/xkbcommon/all/conandata.yml index 1c21a5c826ba01..35dd4985bdd4e6 100644 --- a/recipes/xkbcommon/all/conandata.yml +++ b/recipes/xkbcommon/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.0": + url: "https://xkbcommon.org/download/libxkbcommon-1.6.0.tar.xz" + sha256: "0edc14eccdd391514458bc5f5a4b99863ed2d651e4dd761a90abf4f46ef99c2b" "1.5.0": url: "https://xkbcommon.org/download/libxkbcommon-1.5.0.tar.xz" sha256: "560f11c4bbbca10f495f3ef7d3a6aa4ca62b4f8fb0b52e7d459d18a26e46e017" diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 926843dcf8b92f..0de07aab1e6afe 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -65,9 +65,9 @@ def requirements(self): if self.options.with_x11: self.requires("xorg/system") if self.options.get_safe("xkbregistry"): - self.requires("libxml2/2.11.4") + self.requires("libxml2/2.11.5") if self.options.get_safe("with_wayland"): - self.requires("wayland/1.21.0") + self.requires("wayland/1.22.0") if not self._has_build_profile: self.requires("wayland-protocols/1.31") @@ -76,12 +76,12 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} is only compatible with Linux and FreeBSD") def build_requirements(self): - self.tool_requires("meson/1.1.0") + self.tool_requires("meson/1.2.2") 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._has_build_profile and self.options.get_safe("with_wayland"): - self.tool_requires("wayland/1.21.0") + self.tool_requires("wayland/") self.tool_requires("wayland-protocols/1.31") def source(self): @@ -171,9 +171,7 @@ def package_info(self): self.cpp_info.components["xkbcli-interactive-wayland"].requires.append("wayland-protocols::wayland-protocols") if Version(self.version) >= "1.0.0": - bindir = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bindir}") - self.env_info.PATH.append(bindir) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) # unofficial, but required to avoid side effects (libxkbcommon component # "steals" the default global pkg_config name) diff --git a/recipes/xkbcommon/config.yml b/recipes/xkbcommon/config.yml index aa62b1dc6f7812..dc3bda303f68e9 100644 --- a/recipes/xkbcommon/config.yml +++ b/recipes/xkbcommon/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.0": + folder: all "1.5.0": folder: all "1.4.1": diff --git a/recipes/xlsxio/all/conanfile.py b/recipes/xlsxio/all/conanfile.py index f1cc40e63d655d..7724a07d644647 100644 --- a/recipes/xlsxio/all/conanfile.py +++ b/recipes/xlsxio/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps -from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version import os @@ -47,27 +47,32 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + if self.options.with_wide: + self.options["expat"].char_type = "ushort" + if self.options.get_safe("with_minizip_ng"): + self.options["minizip-ng"].mz_compatibility = True + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_libzip: - self.requires("libzip/1.7.3") + self.requires("libzip/1.10.1") elif Version(self.version) >= "0.2.34" and self.options.with_minizip_ng : - self.requires("minizip-ng/3.0.8") + self.requires("minizip-ng/4.0.1") else: - self.requires("minizip/1.2.12") - self.requires("expat/2.4.9") - if self.options.with_wide: - self.options["expat"].char_type="ushort" + self.requires("minizip/1.2.13") + self.requires("expat/2.5.0") + + def validate(self): + if Version(self.version) >= "0.2.34": + if self.options.with_libzip and self.options.with_minizip_ng: + raise ConanInvalidConfiguration("with_libzip and with_minizip_ng are mutually exclusive") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - tc = VirtualBuildEnv(self) - tc.generate() - tc = CMakeToolchain(self) tc.variables["BUILD_STATIC"] = not self.options.shared tc.variables["BUILD_SHARED"] = self.options.shared @@ -75,6 +80,8 @@ def generate(self): if Version(self.version) >= "0.2.34": tc.variables["WITH_MINIZIP_NG"] = self.options.with_minizip_ng tc.variables["WITH_WIDE"] = self.options.with_wide + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() tc = CMakeDeps(self) @@ -99,25 +106,40 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "xlsxio") - self.cpp_info.set_property("cmake_module_file_name", "xlsxio") - self.cpp_info.set_property("pkg_config_name", "xlsxio") + + ziplib = "minizip::minizip" + if self.options.with_libzip: + ziplib = "libzip::libzip" + elif self.options.get_safe("with_minizip_ng"): + ziplib = "minizip-ng::minizip-ng" + + xlsxio_macro = "BUILD_XLSXIO_SHARED" if self.options.shared else "BUILD_XLSXIO_STATIC" self.cpp_info.components["xlsxio_read"].set_property("cmake_target_name", "xlsxio::xlsxio_read") - self.cpp_info.components["xlsxio_read"].set_property("cmake_module_target_name", "xlsxio::xlsxio_read") self.cpp_info.components["xlsxio_read"].set_property("pkg_config_name", "libxlsxio_read") + self.cpp_info.components["xlsxio_read"].libs = ["xlsxio_read"] + self.cpp_info.components["xlsxio_read"].requires = ["expat::expat", ziplib] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["xlsxio_read"].system_libs.append("pthread") + self.cpp_info.components["xlsxio_read"].defines.append(xlsxio_macro) + self.cpp_info.components["xlsxio_write"].set_property("cmake_target_name", "xlsxio::xlsxio_write") - self.cpp_info.components["xlsxio_write"].set_property("cmake_module_target_name", "xlsxio::xlsxio_write") self.cpp_info.components["xlsxio_write"].set_property("pkg_config_name", "libxlsxio_write") + self.cpp_info.components["xlsxio_write"].libs = ["xlsxio_write"] + self.cpp_info.components["xlsxio_write"].requires = ["expat::expat", ziplib] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["xlsxio_write"].system_libs.append("pthread") + self.cpp_info.components["xlsxio_write"].defines.append(xlsxio_macro) + if self.options.with_wide: self.cpp_info.components["xlsxio_readw"].set_property("cmake_target_name", "xlsxio::xlsxio_readw") - self.cpp_info.components["xlsxio_readw"].set_property("cmake_module_target_name", "xlsxio::xlsxio_readw") self.cpp_info.components["xlsxio_readw"].set_property("pkg_config_name", "libxlsxio_readw") - - - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["pthread"] + self.cpp_info.components["xlsxio_readw"].libs = ["xlsxio_readw"] + self.cpp_info.components["xlsxio_readw"].requires = ["expat::expat", ziplib] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["xlsxio_readw"].system_libs.append("pthread") + self.cpp_info.components["xlsxio_readw"].defines.append(xlsxio_macro) # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "xlsxio" diff --git a/recipes/xlsxio/all/patches/0234_cmake.patch b/recipes/xlsxio/all/patches/0234_cmake.patch index 0000f8397c5c4b..ea858da988ead9 100644 --- a/recipes/xlsxio/all/patches/0234_cmake.patch +++ b/recipes/xlsxio/all/patches/0234_cmake.patch @@ -29,7 +29,7 @@ index bf4e9bf..f0d6a0e 100644 - FIND_PACKAGE(minizip${MINIZIP_NG_SUFFIX} REQUIRED) - SET(ANYZIP_INCLUDE_DIRS "${minizip-ng_DIR}/../../../include/minizip${MINIZIP_NG_SUFFIX}") - SET(ANYZIP_LIBRARIES minizip${MINIZIP_NG_SUFFIX}) -+ FIND_PACKAGE(minizip 3 REQUIRED) ++ FIND_PACKAGE(minizip REQUIRED) + IF(minizip_INCLUDE_DIRS) + SET(ANYZIP_INCLUDE_DIRS ${minizip_INCLUDE_DIRS}) + SET(ANYZIP_LIBRARIES ${minizip_LIBRARIES}) diff --git a/recipes/xlsxio/all/test_package/CMakeLists.txt b/recipes/xlsxio/all/test_package/CMakeLists.txt index 67d6a295ac9dce..a6b2c7649a0c8e 100644 --- a/recipes/xlsxio/all/test_package/CMakeLists.txt +++ b/recipes/xlsxio/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package LANGUAGES C) find_package(xlsxio REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) +add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE xlsxio::xlsxio_read) target_link_libraries(${PROJECT_NAME} PRIVATE xlsxio::xlsxio_write) diff --git a/recipes/xlsxio/all/test_package/test_package.c b/recipes/xlsxio/all/test_package/test_package.c new file mode 100644 index 00000000000000..097bd99e0a65d5 --- /dev/null +++ b/recipes/xlsxio/all/test_package/test_package.c @@ -0,0 +1,49 @@ +#include +#include +#include + +int main(int argc, char** argv) { + xlsxiowriter xlsxwrite; + int i; + xlsxioreader xlsxioread; + + // open .xlsx file for writing (will overwrite if it already exists) + if ((xlsxwrite = xlsxiowrite_open("test_package.xlsx", "MySheet")) == NULL) { + fprintf(stderr, "Error creating .xlsx file\n"); + return 1; + } + // set row height + xlsxiowrite_set_row_height(xlsxwrite, 1); + // how many rows to buffer to detect column widths + xlsxiowrite_set_detection_rows(xlsxwrite, 10); + // write column names + xlsxiowrite_add_column(xlsxwrite, "Col1", 0); + xlsxiowrite_add_column(xlsxwrite, "Col2", 21); + xlsxiowrite_add_column(xlsxwrite, "Col3", 0); + xlsxiowrite_add_column(xlsxwrite, "Col4", 2); + xlsxiowrite_add_column(xlsxwrite, "Col5", 0); + xlsxiowrite_add_column(xlsxwrite, "Col6", 0); + xlsxiowrite_add_column(xlsxwrite, "Col7", 0); + xlsxiowrite_next_row(xlsxwrite); + // write data + for (i = 0; i < 1000; i++) { + xlsxiowrite_add_cell_string(xlsxwrite, "Test"); + xlsxiowrite_add_cell_string(xlsxwrite, "A b c d e f\nnew line"); + xlsxiowrite_add_cell_string(xlsxwrite, "&% \"'"); + xlsxiowrite_add_cell_string(xlsxwrite, NULL); + xlsxiowrite_add_cell_int(xlsxwrite, i); + xlsxiowrite_add_cell_datetime(xlsxwrite, time(NULL)); + xlsxiowrite_add_cell_float(xlsxwrite, 3.1415926); + xlsxiowrite_next_row(xlsxwrite); + } + // close .xlsx file + xlsxiowrite_close(xlsxwrite); + + // read .xlsx file + xlsxioread = xlsxioread_open("test_package.xlsx"); + + // close .xlsx file + xlsxioread_close(xlsxioread); + + return 0; +} diff --git a/recipes/xlsxio/all/test_package/test_package.cpp b/recipes/xlsxio/all/test_package/test_package.cpp deleted file mode 100644 index e7ee13469ca6e8..00000000000000 --- a/recipes/xlsxio/all/test_package/test_package.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include - -int main(int argc, char** argv) { - xlsxioreader xlsxioread; - xlsxiowriter xlsxiowrite; - xlsxioreadersheet sheet; - (void)xlsxioread; - (void)sheet; - (void)xlsxiowrite; - return 0; -} diff --git a/recipes/xmlsec/all/conandata.yml b/recipes/xmlsec/all/conandata.yml index 46664dc0decc9f..d74fd9230c88cb 100644 --- a/recipes/xmlsec/all/conandata.yml +++ b/recipes/xmlsec/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.33": + url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.33.tar.gz" + sha256: "26041d35a20a245ed5a2fb9ee075f10825664d274220cb5190340fa87a4d0931" "1.2.32": url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.32.tar.gz" sha256: "e383702853236004e5b08e424b8afe9b53fe9f31aaa7a5382f39d9533eb7c043" diff --git a/recipes/xmlsec/all/conanfile.py b/recipes/xmlsec/all/conanfile.py index 6cbfca0ca36caf..282278b7546cbe 100644 --- a/recipes/xmlsec/all/conanfile.py +++ b/recipes/xmlsec/all/conanfile.py @@ -60,11 +60,11 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.10.4", transitive_headers=True) + self.requires("libxml2/2.11.5", transitive_headers=True) if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]", transitive_headers=True) if self.options.with_xslt: - self.requires("libxslt/1.1.34") + self.requires("libxslt/1.1.37") def validate(self): if self.options.with_nss: @@ -80,7 +80,7 @@ def build_requirements(self): if not is_msvc(self): 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._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): diff --git a/recipes/xmlsec/all/test_package/conanfile.py b/recipes/xmlsec/all/test_package/conanfile.py index e977f9247d9e3b..813061264560dd 100644 --- a/recipes/xmlsec/all/test_package/conanfile.py +++ b/recipes/xmlsec/all/test_package/conanfile.py @@ -14,7 +14,7 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("libxml2/2.10.4") + self.requires("libxml2/2.11.5") def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/xmlsec/config.yml b/recipes/xmlsec/config.yml index be77378a243925..3853f0ae48f16a 100644 --- a/recipes/xmlsec/config.yml +++ b/recipes/xmlsec/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.33": + folder: all "1.2.32": folder: all "1.2.31": diff --git a/recipes/xnnpack/all/conandata.yml b/recipes/xnnpack/all/conandata.yml index 271fcb3d93eebc..97d441c786f9fc 100644 --- a/recipes/xnnpack/all/conandata.yml +++ b/recipes/xnnpack/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230715": + url: "https://github.com/google/XNNPACK/archive/645035286fe31d47eeb07900450f4f6540b75c2c.tar.gz" + sha256: "4c91153dfe4648dc3b325db0b4d6719d6e16f7ce30940b4ceb65abd033e5245e" "cci.20220801": url: "https://github.com/google/XNNPACK/archive/8e3d3359f9bec608e09fac1f7054a2a14b1bd73c.tar.gz" sha256: "c82327543249bd333034bbaa0300ed1fc9c7060fa73673a285042e3f042540e0" diff --git a/recipes/xnnpack/all/conanfile.py b/recipes/xnnpack/all/conanfile.py index 7263f61d28bb8a..5d80f5f3cd1674 100644 --- a/recipes/xnnpack/all/conanfile.py +++ b/recipes/xnnpack/all/conanfile.py @@ -15,11 +15,11 @@ class XnnpackConan(ConanFile): "neural network inference operators for ARM, WebAssembly, " \ "and x86 platforms." license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/XNNPACK" topics = ("neural-network", "inference", "multithreading", "inference-optimization", "matrix-multiplication", "simd") - homepage = "https://github.com/google/XNNPACK" - url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -46,7 +46,6 @@ def config_options(self): 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") @@ -54,9 +53,12 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("cpuinfo/cci.20220228") + if self.version in ["cci.20220801", "cci.20220621", "cci.20211210"]: + self.requires("cpuinfo/cci.20220228") + else: + self.requires("cpuinfo/cci.20230118") self.requires("fp16/cci.20210320") - # https://github.com/google/XNNPACK/blob/ed5f9c0562e016a08b274a4579de5ef500fec134/include/xnnpack.h#L15 + # https://github.com/google/XNNPACK/blob/ed5f9c0562e016a08b274a4579de5ef500fec134/include/xnnpack.h#L15 self.requires("pthreadpool/cci.20210218", transitive_headers=True) self.requires("fxdiv/cci.20200417") @@ -64,13 +66,18 @@ def validate(self): check_min_vs(self, 192) compiler = self.info.settings.compiler compiler_version = Version(compiler.version) - if (compiler == "gcc" and compiler_version < "6") or \ - (compiler == "clang" and compiler_version < "5"): - raise ConanInvalidConfiguration(f"{self.ref} doesn't support {compiler} {compiler.version}") + if self.version < "cci.20230715": + if (compiler == "gcc" and compiler_version < "6") or \ + (compiler == "clang" and compiler_version < "5"): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support {compiler} {compiler.version}") + else: + # since cci.20230715, xnnpack requires avx512 header file + if (compiler == "gcc" and compiler_version < "11") or \ + (compiler == "clang" and compiler_version < "8"): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support {compiler} {compiler.version}") 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) @@ -100,7 +107,7 @@ def generate(self): # The CMake scripts don't use targets prefixed with `namespace::` # so we can coerce CMakeDeps to define the exact target names that # are expected. This works in tandem with the file - # `CMAKE_PROJECT_XNNPACK_INCLUDE` which ensure an early call to + # `CMAKE_PROJECT_XNNPACK_INCLUDE` which ensure an early call to # the relevant `find_package` deps.set_property("cpuinfo", "cmake_target_name", "cpuinfo") deps.set_property("cpuinfo", "cmake_target_aliases", ["clog"] ) diff --git a/recipes/xnnpack/config.yml b/recipes/xnnpack/config.yml index d1b55a81c6c28b..a1c159e3728ee6 100644 --- a/recipes/xnnpack/config.yml +++ b/recipes/xnnpack/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20230715": + folder: all "cci.20220801": folder: all "cci.20220621": 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/xorg-gccmakedep/all/conanfile.py b/recipes/xorg-gccmakedep/all/conanfile.py index 813811cb7758d4..1aafda519a4705 100644 --- a/recipes/xorg-gccmakedep/all/conanfile.py +++ b/recipes/xorg-gccmakedep/all/conanfile.py @@ -29,7 +29,7 @@ def requirements(self): self.requires("xorg-macros/1.19.3") def build_requirements(self): - self.tool_requires("pkgconf/1.7.4") + self.tool_requires("pkgconf/2.0.3") def validate(self): if self.settings.os == "Windows": diff --git a/recipes/xorg-makedepend/all/conanfile.py b/recipes/xorg-makedepend/all/conanfile.py index 6656dcd889cfff..a0024be22451a8 100644 --- a/recipes/xorg-makedepend/all/conanfile.py +++ b/recipes/xorg-makedepend/all/conanfile.py @@ -30,7 +30,7 @@ def requirements(self): self.requires("xorg-proto/2022.2") def build_requirements(self): - self.build_requires("pkgconf/1.7.4") + self.build_requires("pkgconf/2.0.3") def validate(self): if self.settings.os == "Windows": diff --git a/recipes/xorg-proto/all/conanfile.py b/recipes/xorg-proto/all/conanfile.py index b53e7215a23385..f20cc54f7acb5e 100644 --- a/recipes/xorg-proto/all/conanfile.py +++ b/recipes/xorg-proto/all/conanfile.py @@ -34,7 +34,7 @@ def _settings_build(self): def build_requirements(self): self.tool_requires("automake/1.16.5") self.tool_requires("xorg-macros/1.19.3") - 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/xorstr/all/conanfile.py b/recipes/xorstr/all/conanfile.py index 2712a05ac70441..f5d66df51bfdbb 100644 --- a/recipes/xorstr/all/conanfile.py +++ b/recipes/xorstr/all/conanfile.py @@ -15,8 +15,9 @@ class XorstrConan(ConanFile): topics = ("encryption", "string", "vectorized") homepage = "https://github.com/JustasMasiulis/xorstr" url = "https://github.com/conan-io/conan-center-index" - no_copy_source = True + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): @@ -55,8 +56,7 @@ def loose_lt_semver(v1, v2): ) 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 diff --git a/recipes/xpack/all/conanfile.py b/recipes/xpack/all/conanfile.py index 87dad9562235b8..fb4f7dbe93adb5 100644 --- a/recipes/xpack/all/conanfile.py +++ b/recipes/xpack/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile 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 import os @@ -13,6 +13,7 @@ class XpackConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/xyz347/xpack" topics = ("json", "bson", "reflection", "xml", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -27,8 +28,8 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("rapidjson/cci.20220822", transitive_headers=True) - self.requires("rapidxml/1.13", transitive_headers=True) + self.requires("rapidjson/cci.20220822") + self.requires("rapidxml/1.13") def package_id(self): self.info.clear() diff --git a/recipes/xproperty/all/conanfile.py b/recipes/xproperty/all/conanfile.py index f3db566cfff6d7..e6eeff282118e6 100644 --- a/recipes/xproperty/all/conanfile.py +++ b/recipes/xproperty/all/conanfile.py @@ -15,8 +15,9 @@ class XpropertyConan(ConanFile): topics = ("observer", "traitlets") homepage = "https://github.com/jupyter-xeus/xproperty" url = "https://github.com/conan-io/conan-center-index" - no_copy_source = True + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True def layout(self): basic_layout(self, src_folder="src") @@ -32,8 +33,7 @@ def validate(self): check_min_cppstd(self, 14) 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 diff --git a/recipes/xsd/all/conandata.yml b/recipes/xsd/all/conandata.yml index d0b47cfe2aef66..342ac8fd08fed3 100644 --- a/recipes/xsd/all/conandata.yml +++ b/recipes/xsd/all/conandata.yml @@ -5,12 +5,7 @@ sources: patches: "4.0.0": - patch_file: "patches/0002-missing-include.patch" - base_path: "source_subfolder" - patch_file: "patches/0100-C++Parser_Expat_support.patch" - base_path: "source_subfolder" - patch_file: "patches/0105-Fix_path_handling_bug.patch" - base_path: "source_subfolder" - patch_file: "patches/0110-xerces-c3.2.patch" - base_path: "source_subfolder" - patch_file: "patches/0700_hurd_PATH_MAX.patch" - base_path: "source_subfolder" diff --git a/recipes/xsd/all/conanfile.py b/recipes/xsd/all/conanfile.py index 19183a5008e25f..8d9e15a3818f47 100644 --- a/recipes/xsd/all/conanfile.py +++ b/recipes/xsd/all/conanfile.py @@ -1,91 +1,87 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.40.0" +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, chdir, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class ConanXqilla(ConanFile): name = "xsd" - description = ( - "XSD is a W3C XML Schema to C++ translator. It generates vocabulary-specific, statically-typed C++ mappings (also called bindings) from XML Schema definitions. XSD supports two C++ mappings: in-memory C++/Tree and event-driven C++/Parser." + "XSD is a W3C XML Schema to C++ translator. " + "It generates vocabulary-specific, statically-typed C++ mappings (also called bindings) from XML Schema definitions. " + "XSD supports two C++ mappings: in-memory C++/Tree and event-driven C++/Parser." ) - topics = ("xsd", "xml", "c++") + license = ("GPL-2.0", "FLOSSE") url = "https://github.com/conan-io/conan-center-index" homepage = "https://codesynthesis.com/projects/xsd/" - license = ("GPL-2.0","FLOSSE") + topics = ("xml", "c++") + + package_type = "application" settings = "os", "arch", "compiler", "build_type" - exports_sources = "patches/**" + def export_sources(self): + export_conandata_patches(self) - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): self.requires("xerces-c/3.2.3") - @property - def _doc_folder(self): - return os.path.join(self._source_subfolder,"xsd","doc") - - @property - def _make_cmd(self): - return self._gnumake_cmd - - @property - def _make_program(self): - return tools.get_env('CONAN_MAKE_PROGRAM', tools.which('make')) - - @property - def _gnumake_cmd(self): - make_ldflags = "LDFLAGS='{libs} -pthread'".format( - libs=" ".join(["-L{}".format(os.path.join(self.deps_cpp_info["xerces-c"].rootpath, it)) for it in self.deps_cpp_info["xerces-c"].libdirs])) - flags = [] - flags.append(' '.join(["-I{}".format(os.path.join(self.deps_cpp_info["xerces-c"].rootpath, it)) for it in self.deps_cpp_info["xerces-c"].includedirs])) - if self.settings.compiler == "gcc": - flags.append('-std=c++11') - make_ccpflags = "CPPFLAGS='{}'".format(" ".join(flags)) - make_cmd = f'{make_ldflags} {make_ccpflags} {self._make_program} -j{tools.cpu_count()}' - return make_cmd + def package_id(self): + del self.info.settings.compiler def validate(self): - if self.settings.os != "Linux": + if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration("The xsd recipe currently only supports Linux.") if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) - - def package_id(self): - del self.info.settings.compiler + check_min_cppstd(self, 11) 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 = AutotoolsToolchain(self) + tc.extra_cxxflags = ["-std=c++11"] + tc.extra_ldflags = ["-pthread"] + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - with tools.chdir(self._source_subfolder): - self.run(self._make_cmd) + apply_conandata_patches(self) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make() def package(self): - self.copy("LICENSE", dst="licenses", src=os.path.join(self._source_subfolder, "xsd")) - self.copy("GPLv2", dst="licenses", src=os.path.join(self._source_subfolder, "xsd")) - self.copy("FLOSSE", dst="licenses", src=os.path.join(self._source_subfolder, "xsd")) - - with tools.chdir(self._source_subfolder): - self.run(self._make_install_cmd) - - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder, "xsd")) + copy(self, "GPLv2", + dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder, "xsd")) + copy(self, "FLOSSE", + dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder, "xsd")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install(args=[f"install_prefix={self.package_folder}"]) + 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.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.path.append(bin_path) - - @property - def _make_install_cmd(self): - make_install_cmd = f'{self._make_cmd} install_prefix={self.package_folder} install' - return make_install_cmd diff --git a/recipes/xsd/all/test_package/conanfile.py b/recipes/xsd/all/test_package/conanfile.py index 7ea50ba1ad4306..fd802956c6269f 100644 --- a/recipes/xsd/all/test_package/conanfile.py +++ b/recipes/xsd/all/test_package/conanfile.py @@ -1,10 +1,13 @@ -from conans import ConanFile, tools -import os +from conan import ConanFile 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): - if not tools.cross_building(self): - self.run("xsd --help", run_environment=True) + self.run("xsd --help") diff --git a/recipes/xsd/all/test_v1_package/conanfile.py b/recipes/xsd/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7ea50ba1ad4306 --- /dev/null +++ b/recipes/xsd/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("xsd --help", run_environment=True) diff --git a/recipes/xsimd/all/conandata.yml b/recipes/xsimd/all/conandata.yml index 81dd94420426b4..f65775fd15ca51 100644 --- a/recipes/xsimd/all/conandata.yml +++ b/recipes/xsimd/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "12.1.0": + url: "https://github.com/xtensor-stack/xsimd/archive/12.1.0.tar.gz" + sha256: "86b86e0aeba7a85575f6e079728f0c2b65307dddb7210487f2b7cb261ac8a4a2" + "12.0.0": + url: "https://github.com/xtensor-stack/xsimd/archive/12.0.0.tar.gz" + sha256: "6f156ec9bcc602d2581ef023ef0e927e3759c30cf1405028210e8c103a4f846d" + "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..65384140b0d83c 100644 --- a/recipes/xsimd/config.yml +++ b/recipes/xsimd/config.yml @@ -1,4 +1,10 @@ versions: + "12.1.0": + folder: all + "12.0.0": + folder: all + "11.2.0": + folder: all "11.1.0": folder: all "11.0.0": diff --git a/recipes/xtensor/all/conandata.yml b/recipes/xtensor/all/conandata.yml index 40af805ba9e936..c0af344ba276e1 100644 --- a/recipes/xtensor/all/conandata.yml +++ b/recipes/xtensor/all/conandata.yml @@ -1,59 +1,24 @@ sources: - "0.24.3": - url: "https://github.com/xtensor-stack/xtensor/archive/0.24.3.tar.gz" - sha256: "3acde856b9fb8cf4e2a7b66726da541275d40ab9b002e618ad985ab97f08ca4f" - "0.24.2": - url: "https://github.com/xtensor-stack/xtensor/archive/0.24.2.tar.gz" - sha256: "790d9e449add817154177157a850b9afd0260dc0f9df857d8b3a38886a10ef8b" - "0.24.0": - url: "https://github.com/xtensor-stack/xtensor/archive/0.24.0.tar.gz" - sha256: "37738aa0865350b39f048e638735c05d78b5331073b6329693e8b8f0902df713" + "0.24.7": + url: "https://github.com/xtensor-stack/xtensor/archive/0.24.7.tar.gz" + sha256: "0fbbd524dde2199b731b6af99b16063780de6cf1d0d6cb1f3f4d4ceb318f3106" + "0.24.6": + url: "https://github.com/xtensor-stack/xtensor/archive/0.24.6.tar.gz" + sha256: "f87259b51aabafdd1183947747edfff4cff75d55375334f2e81cee6dc68ef655" "0.23.10": url: "https://github.com/xtensor-stack/xtensor/archive/0.23.10.tar.gz" sha256: "2e770a6d636962eedc868fef4930b919e26efe783cd5d8732c11e14cf72d871c" - "0.23.9": - url: "https://github.com/xtensor-stack/xtensor/archive/0.23.9.tar.gz" - sha256: "5bdb9d85ee82c60be0bce32d891b5cc20eb633284a0aabb907f55bbe722cc8e3" "0.21.5": url: "https://github.com/xtensor-stack/xtensor/archive/0.21.5.tar.gz" sha256: "30cb896b6686683ddaefb12c98bf1109fdfe666136dd027aba1a1e9aa825c241" - "0.21.4": - url: "https://github.com/xtensor-stack/xtensor/archive/0.21.4.tar.gz" - sha256: "143ef2536f1671e1c7c7834de4a040f1694112e23222fcd2ae59b0f5e5124b57" - "0.21.3": - url: "https://github.com/xtensor-stack/xtensor/archive/0.21.3.tar.gz" - sha256: "f63c25cafea4bfc268edb26e6f5004a28a2f689e6a852bb3559c553106c8d6bf" - "0.21.2": - url: "https://github.com/xtensor-stack/xtensor/archive/0.21.2.tar.gz" - sha256: "a32490bc8499f59f8e30c288e178ff41c9511cf4959dc59c9628b29b77049a4a" patches: - "0.24.2": - - patch_file: "patches/0.24.0-cxx11-abi.patch" - patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" - patch_type: "bugfix" - patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" - "0.24.0": - - patch_file: "patches/0.24.0-cxx11-abi.patch" - patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" - patch_type: "bugfix" - patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" "0.23.10": - patch_file: "patches/0.23.9-cxx11-abi.patch" patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" patch_type: "bugfix" patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" - "0.23.9": - - patch_file: "patches/0.23.9-cxx11-abi.patch" - patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" - patch_type: "bugfix" - patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" "0.21.5": - patch_file: "patches/0.21.5-cxx11-abi.patch" patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" patch_type: "bugfix" patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" - "0.21.4": - - patch_file: "patches/0.21.4-cxx11-abi.patch" - patch_description: "has_trivial_default_constructor has been removed from libstdc++ since version 7" - patch_type: "bugfix" - patch_source: "https://github.com/xtensor-stack/xtensor/pull/2459" diff --git a/recipes/xtensor/all/conanfile.py b/recipes/xtensor/all/conanfile.py index 9bcb5c8f335ae5..892b72ea174863 100644 --- a/recipes/xtensor/all/conanfile.py +++ b/recipes/xtensor/all/conanfile.py @@ -52,14 +52,14 @@ def layout(self): def requirements(self): self.requires("xtl/0.7.5") - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.3") if self.options.xsimd: if Version(self.version) < "0.24.0": self.requires("xsimd/7.5.0") else: - self.requires("xsimd/10.0.0") + self.requires("xsimd/12.0.0") if self.options.tbb: - self.requires("onetbb/2021.7.0") + self.requires("onetbb/2021.10.0") def package_id(self): self.info.clear() diff --git a/recipes/xtensor/all/patches/0.21.4-cxx11-abi.patch b/recipes/xtensor/all/patches/0.21.4-cxx11-abi.patch deleted file mode 100644 index 785004e7c86cdc..00000000000000 --- a/recipes/xtensor/all/patches/0.21.4-cxx11-abi.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/include/xtensor/xutils.hpp b/include/xtensor/xutils.hpp -index ce3ce72..936d387 100644 ---- a/include/xtensor/xutils.hpp -+++ b/include/xtensor/xutils.hpp -@@ -611,12 +611,16 @@ namespace xt - /******************************************** - * xtrivial_default_construct implemenation * - ********************************************/ -- -+#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7 -+// has_trivial_default_constructor has not been available since libstdc++-7. -+#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 -+#else - #if defined(_GLIBCXX_USE_CXX11_ABI) - #if _GLIBCXX_USE_CXX11_ABI || (defined(_GLIBCXX_USE_DUAL_ABI) && !_GLIBCXX_USE_DUAL_ABI) - #define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 - #endif - #endif -+#endif - - #if !defined(__GNUG__) || defined(_LIBCPP_VERSION) || defined(XTENSOR_GLIBCXX_USE_CXX11_ABI) - diff --git a/recipes/xtensor/all/patches/0.24.0-cxx11-abi.patch b/recipes/xtensor/all/patches/0.24.0-cxx11-abi.patch deleted file mode 100644 index b7c9e2acdedf00..00000000000000 --- a/recipes/xtensor/all/patches/0.24.0-cxx11-abi.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/include/xtensor/xutils.hpp b/include/xtensor/xutils.hpp -index ed8f2ea..ba7ccea 100644 ---- a/include/xtensor/xutils.hpp -+++ b/include/xtensor/xutils.hpp -@@ -637,11 +637,16 @@ namespace xt - * xtrivial_default_construct implemenation * - ********************************************/ - -+#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7 -+// has_trivial_default_constructor has not been available since libstdc++-7. -+#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 -+#else - #if defined(_GLIBCXX_USE_CXX11_ABI) - #if _GLIBCXX_USE_CXX11_ABI || (defined(_GLIBCXX_USE_DUAL_ABI) && !_GLIBCXX_USE_DUAL_ABI) - #define XTENSOR_GLIBCXX_USE_CXX11_ABI 1 - #endif - #endif -+#endif - - #if !defined(__GNUG__) || defined(_LIBCPP_VERSION) || defined(XTENSOR_GLIBCXX_USE_CXX11_ABI) - diff --git a/recipes/xtensor/config.yml b/recipes/xtensor/config.yml index 0077748f19ef00..f1891e507a4291 100644 --- a/recipes/xtensor/config.yml +++ b/recipes/xtensor/config.yml @@ -1,19 +1,9 @@ versions: - "0.24.3": + "0.24.7": folder: all - "0.24.2": - folder: all - "0.24.0": + "0.24.6": folder: all "0.23.10": folder: all - "0.23.9": - folder: all "0.21.5": folder: all - "0.21.4": - folder: all - "0.21.3": - folder: all - "0.21.2": - folder: all diff --git a/recipes/xtr/all/conandata.yml b/recipes/xtr/all/conandata.yml index 73147ae0731499..c4c7a036934fc6 100644 --- a/recipes/xtr/all/conandata.yml +++ b/recipes/xtr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.0": + url: "https://github.com/choll/xtr/archive/refs/tags/2.1.0.tar.gz" + sha256: "5abe2e53d91a893d63998968450d9bbfc23c45f552c81e2b7d17694699ab17c4" "2.0.1": url: "https://github.com/choll/xtr/archive/refs/tags/2.0.1.tar.gz" sha256: "92327264541900a2c9d43aaa3070d143d5e91879737fcea8cbf56065330af059" diff --git a/recipes/xtr/config.yml b/recipes/xtr/config.yml index 066b0d5ac74d1a..ecc6dca2fd252d 100644 --- a/recipes/xtr/config.yml +++ b/recipes/xtr/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.0": + folder: all "2.0.1": folder: all "2.0.0": diff --git a/recipes/xxhash/all/conandata.yml b/recipes/xxhash/all/conandata.yml index a0b4d68deb6b49..06fb02fd0ae832 100644 --- a/recipes/xxhash/all/conandata.yml +++ b/recipes/xxhash/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.2": + url: "https://github.com/Cyan4973/xxHash/archive/v0.8.2.tar.gz" + sha256: "baee0c6afd4f03165de7a4e67988d16f0f2b257b51d0e3cb91909302a26a79c4" "0.8.1": url: "https://github.com/Cyan4973/xxHash/archive/v0.8.1.tar.gz" sha256: "3bb6b7d6f30c591dd65aaaff1c8b7a5b94d81687998ca9400082c739a690436c" @@ -10,7 +13,6 @@ patches: - patch_file: "patches/0.8.1-fix-cmakelists.patch" patch_description: "Update CMakeLists.txt to properly install manuals" patch_type: conan - - patch_file: "patches/0.8.1-fix-static-assert-link-error.patch" patch_source: "https://github.com/Cyan4973/xxHash/commit/6189ecd3d44a693460f86280ccf49d33cb4b18e1" patch_description: "Backport fix for link error" diff --git a/recipes/xxhash/all/conanfile.py b/recipes/xxhash/all/conanfile.py index 7ce90e1beb92a5..3e018a810c976a 100644 --- a/recipes/xxhash/all/conanfile.py +++ b/recipes/xxhash/all/conanfile.py @@ -8,12 +8,12 @@ class XxHashConan(ConanFile): name = "xxhash" + description = "Extremely fast non-cryptographic hash algorithm" + license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Cyan4973/xxHash" - description = "Extremely fast non-cryptographic hash algorithm" topics = ("hash", "algorithm", "fast", "checksum", "hash-functions") - license = "BSD-2-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -43,8 +43,7 @@ def layout(self): cmake_layout(self, src_folder="src") 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/xxhash/config.yml b/recipes/xxhash/config.yml index 20824a4afbb4d3..50595ee5e49136 100644 --- a/recipes/xxhash/config.yml +++ b/recipes/xxhash/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.2": + folder: all "0.8.1": folder: all "0.8.0": diff --git a/recipes/xz_utils/all/conandata.yml b/recipes/xz_utils/all/conandata.yml index da0e232cb7e1ab..09ca27188fcd2a 100644 --- a/recipes/xz_utils/all/conandata.yml +++ b/recipes/xz_utils/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "5.4.5": + url: "https://tukaani.org/xz/xz-5.4.5.tar.xz" + sha256: "da9dec6c12cf2ecf269c31ab65b5de18e8e52b96f35d5bcd08c12b43e6878803" + "5.4.4": + url: "https://tukaani.org/xz/xz-5.4.4.tar.gz" + sha256: "aae39544e254cfd27e942d35a048d592959bd7a79f9a624afb0498bb5613bdf8" "5.4.2": url: "https://tukaani.org/xz/xz-5.4.2.tar.gz" sha256: "87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05" diff --git a/recipes/xz_utils/config.yml b/recipes/xz_utils/config.yml index 326a90e52c8373..d950dab72f7d0c 100644 --- a/recipes/xz_utils/config.yml +++ b/recipes/xz_utils/config.yml @@ -1,4 +1,8 @@ versions: + "5.4.5": + folder: all + "5.4.4": + folder: all "5.4.2": folder: all "5.4.0": diff --git a/recipes/yaclib/all/conanfile.py b/recipes/yaclib/all/conanfile.py index 4c35bd089113e8..49364fbee5eedf 100644 --- a/recipes/yaclib/all/conanfile.py +++ b/recipes/yaclib/all/conanfile.py @@ -1,9 +1,7 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd -from conan.tools.cmake import CMake, CMakeToolchain -from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, export_conandata_patches, apply_conandata_patches, save -from conan.tools.layout import cmake_layout from conan.errors import ConanInvalidConfiguration import os import textwrap @@ -18,6 +16,7 @@ class YACLibConan(ConanFile): homepage = "https://github.com/YACLib/YACLib" license = "MIT" topics = ("async", "parallel", "concurrency") + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" _yaclib_flags = { @@ -64,28 +63,13 @@ def _compilers_minimum_version(self): def export_sources(self): export_conandata_patches(self) - def layout(self): - cmake_layout(self, src_folder="src") - - def generate(self): - tc = CMakeToolchain(self) - tc.variables['YACLIB_INSTALL'] = True - if self.settings.compiler.get_safe("cppstd"): - tc.variables["YACLIB_CXX_STANDARD"] = self.settings.compiler.cppstd - - flags = [] - for flag in self._yaclib_flags: - if self.options.get_safe(flag): - flags.append(flag.upper()) - if flags: - tc.variables["YACLIB_FLAGS"] = ";".join(flags) - - tc.generate() - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + 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) @@ -105,6 +89,22 @@ def loose_lt_semver(v1, v2): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["YACLIB_INSTALL"] = True + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + tc.variables["YACLIB_CXX_STANDARD"] = str(cppstd).replace("gnu", "") + + flags = [] + for flag in self._yaclib_flags: + if self.options.get_safe(flag): + flags.append(flag.upper()) + if flags: + tc.variables["YACLIB_FLAGS"] = ";".join(flags) + + tc.generate() + def build(self): apply_conandata_patches(self) cmake = CMake(self) diff --git a/recipes/yaclib/all/test_v1_package/conanfile.py b/recipes/yaclib/all/test_v1_package/conanfile.py index 20d4d2e28d57e0..22642ac137bfad 100644 --- a/recipes/yaclib/all/test_v1_package/conanfile.py +++ b/recipes/yaclib/all/test_v1_package/conanfile.py @@ -1,5 +1,4 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building +from conans import ConanFile, CMake, tools import os class TestPackageV1Conan(ConanFile): @@ -12,6 +11,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(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/yajl/all/conandata.yml b/recipes/yajl/all/conandata.yml index 21b18ea006ef3d..423a49f097b2ad 100644 --- a/recipes/yajl/all/conandata.yml +++ b/recipes/yajl/all/conandata.yml @@ -2,3 +2,8 @@ sources: "2.1.0": url: "https://github.com/lloyd/yajl/archive/refs/tags/2.1.0.tar.gz" sha256: "3fb73364a5a30efe615046d07e6db9d09fd2b41c763c5f7d3bfb121cd5c5ac5a" +patches: + "2.1.0": + - patch_file: "patches/2.1.0-0001-fix-cmake.patch" + patch_description: "CMake: fix mingw, disable build of doc/test/perf/example, relocatable shared lib for macos, install DLL into bin folder" + patch_type: "conan" diff --git a/recipes/yajl/all/conanfile.py b/recipes/yajl/all/conanfile.py index ba0bf3ca1a52e8..0ce7fb086eb0da 100644 --- a/recipes/yajl/all/conanfile.py +++ b/recipes/yajl/all/conanfile.py @@ -1,7 +1,6 @@ from conan import ConanFile -from conan.tools.files import get, copy, rmdir, rename from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir import os required_conan_version = ">=1.53.0" @@ -25,6 +24,9 @@ class YAJLConan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -46,6 +48,7 @@ def generate(self): tc.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -54,16 +57,18 @@ def package(self): copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "share")) - - # We need to move the dll from lib to bin in order for it to be found later - if self.settings.os == "Windows": - rename(self, os.path.join(self.package_folder, "lib", "yajl.dll"), os.path.join(self.package_folder, "bin", "yajl.dll")) - fix_apple_shared_install_name(self) + # Keep either shared or static lib depending on shared option + if self.options.shared: + rm(self, "*yajl_s.*", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*yajl.*", os.path.join(self.package_folder, "bin")) + rm(self, "*yajl.*", os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.libs = ["yajl"] if self.options.shared else ["yajl_s"] + if self.options.shared: + self.cpp_info.defines.append("YAJL_SHARED") # https://github.com/lloyd/yajl/blob/5e3a7856e643b4d6410ddc3f84bc2f38174f2872/src/CMakeLists.txt#L64 self.cpp_info.set_property("pkg_config_name", "yajl") diff --git a/recipes/yajl/all/patches/2.1.0-0001-fix-cmake.patch b/recipes/yajl/all/patches/2.1.0-0001-fix-cmake.patch new file mode 100644 index 00000000000000..3ef6d80c27339c --- /dev/null +++ b/recipes/yajl/all/patches/2.1.0-0001-fix-cmake.patch @@ -0,0 +1,85 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,10 @@ + # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +-CMAKE_MINIMUM_REQUIRED(VERSION 2.6) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.15) ++if(POLICY CMP0026) ++ cmake_policy(SET CMP0026 OLD) ++endif() + + PROJECT(YetAnotherJSONParser C) + +@@ -26,6 +29,7 @@ IF (NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "Release") + ENDIF (NOT CMAKE_BUILD_TYPE) + ++if(0) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + + IF (WIN32) +@@ -61,16 +65,13 @@ ELSE (WIN32) + SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG -g") + SET(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O2 -Wuninitialized") + ENDIF (WIN32) ++endif() + + + ADD_SUBDIRECTORY(src) +-ADD_SUBDIRECTORY(test) + ADD_SUBDIRECTORY(reformatter) + ADD_SUBDIRECTORY(verify) +-ADD_SUBDIRECTORY(example) +-ADD_SUBDIRECTORY(perf) + +-INCLUDE(YAJLDoc.cmake) + + # a test target + ADD_CUSTOM_TARGET(test +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -25,7 +25,6 @@ SET (PUB_HDRS api/yajl_parse.h api/yajl_gen.h api/yajl_common.h api/yajl_tree.h) + # Ensure defined when building YAJL (as opposed to using it from + # another project). Used to ensure correct function export when + # building win32 DLL. +-ADD_DEFINITIONS(-DYAJL_BUILD) + + # set up some paths + SET (libDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib) +@@ -37,20 +36,19 @@ SET(LIBRARY_OUTPUT_PATH ${libDir}) + + ADD_LIBRARY(yajl_s STATIC ${SRCS} ${HDRS} ${PUB_HDRS}) + ++target_compile_features(yajl_s PRIVATE c_std_99) + ADD_LIBRARY(yajl SHARED ${SRCS} ${HDRS} ${PUB_HDRS}) ++target_compile_features(yajl PRIVATE c_std_99) ++target_compile_definitions(yajl PUBLIC YAJL_SHARED) + + #### setup shared library version number + SET_TARGET_PROPERTIES(yajl PROPERTIES +- DEFINE_SYMBOL YAJL_SHARED ++ DEFINE_SYMBOL YAJL_BUILD ++ C_VISIBILITY_PRESET hidden + SOVERSION ${YAJL_MAJOR} + VERSION ${YAJL_MAJOR}.${YAJL_MINOR}.${YAJL_MICRO}) + + #### ensure a .dylib has correct absolute installation paths upon installation +-IF(APPLE) +- MESSAGE("INSTALL_NAME_DIR: ${CMAKE_INSTALL_PREFIX}/lib") +- SET_TARGET_PROPERTIES(yajl PROPERTIES +- INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") +-ENDIF(APPLE) + + #### build up an sdk as a post build step + +@@ -78,7 +76,7 @@ INCLUDE_DIRECTORIES(${incDir}/..) + # at build time you may specify the cmake variable LIB_SUFFIX to handle + # 64-bit systems which use 'lib64' + INSTALL(TARGETS yajl +- RUNTIME DESTINATION lib${LIB_SUFFIX} ++ RUNTIME DESTINATION bin + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX}) + INSTALL(TARGETS yajl_s ARCHIVE DESTINATION lib${LIB_SUFFIX}) diff --git a/recipes/yaml-cpp/all/conandata.yml b/recipes/yaml-cpp/all/conandata.yml index 59546f980c76eb..542de368538ce3 100644 --- a/recipes/yaml-cpp/all/conandata.yml +++ b/recipes/yaml-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.0": + url: "https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.tar.gz" + sha256: "fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16" "0.7.0": url: "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.7.0.tar.gz" sha256: "43e6a9fcb146ad871515f0d0873947e5d497a1c9c60c58cb102a97b47208b7c3" @@ -8,4 +11,10 @@ sources: patches: "0.7.0": - patch_file: "patches/0001-install-0.7.0.patch" + patch_description: "trigger installation through add_subdirectory from another CMakeLists.txt" + patch_type: "conan" + patch_source: "https://github.com/jbeder/yaml-cpp/pull/847" - patch_file: "patches/0002-libcxx-and-gcc.patch" + patch_description: "Adds assert to enable compilation with libcxx + gcc" + patch_type: "portability" + patch_source: "https://github.com/jbeder/yaml-cpp/pull/947" diff --git a/recipes/yaml-cpp/all/conanfile.py b/recipes/yaml-cpp/all/conanfile.py index 1b66ae0cdf060d..29c95c5649accc 100644 --- a/recipes/yaml-cpp/all/conanfile.py +++ b/recipes/yaml-cpp/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir, save from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os import textwrap @@ -103,15 +104,20 @@ def _module_file_rel_path(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "yaml-cpp") - self.cpp_info.set_property("cmake_target_name", "yaml-cpp") + self.cpp_info.set_property("cmake_target_name", "yaml-cpp::yaml-cpp") + self.cpp_info.set_property("cmake_target_aliases", ["yaml-cpp"]) # CMake imported target before 0.8.0 self.cpp_info.set_property("pkg_config_name", "yaml-cpp") self.cpp_info.libs = collect_libs(self) if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs.append("m") if is_msvc(self): self.cpp_info.defines.append("_NOEXCEPT=noexcept") - if self.options.shared: + if Version(self.version) < "0.8.0": + if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines.append("YAML_CPP_DLL") + else: + if not self.options.shared: + self.cpp_info.defines.append("YAML_CPP_STATIC_DEFINE") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] diff --git a/recipes/yaml-cpp/all/test_package/CMakeLists.txt b/recipes/yaml-cpp/all/test_package/CMakeLists.txt index 1872344e829cbc..293d6d71bbc1c7 100644 --- a/recipes/yaml-cpp/all/test_package/CMakeLists.txt +++ b/recipes/yaml-cpp/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package LANGUAGES CXX) find_package(yaml-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp::yaml-cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/yaml-cpp/config.yml b/recipes/yaml-cpp/config.yml index ecd70890a4473e..3ad5266d60fe22 100644 --- a/recipes/yaml-cpp/config.yml +++ b/recipes/yaml-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.0": + folder: all "0.7.0": folder: all "0.6.3": 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/yas/all/conanfile.py b/recipes/yas/all/conanfile.py index 8cfe2a15884cf5..4b089cd3a4efe2 100644 --- a/recipes/yas/all/conanfile.py +++ b/recipes/yas/all/conanfile.py @@ -1,39 +1,53 @@ -from conans import ConanFile, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class YasConan(ConanFile): name = "yas" description = "Yet Another Serialization" - topics = ("yas", "serialization", "header-only") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/niXman/yas" - license = "BSL-1.0" + topics = ("serialization", "header-only") + + 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 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) 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 _extract_license(self): - header = tools.load(os.path.join( - self.source_folder, self._source_subfolder, - "include", "yas", "binary_oarchive.hpp")) - license_contents = header[:header.find("#")] \ - .replace("//", "").replace("\n ", "\n").lstrip() - tools.save("LICENSE", license_contents) + header = load(self, os.path.join(self.source_folder, "include", "yas", "binary_oarchive.hpp")) + license_contents = header[: header.find("#")].replace("//", "").replace("\n ", "\n").lstrip() + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package(self): self._extract_license() - self.copy("LICENSE", dst="licenses") - self.copy("*", src=os.path.join(self._source_subfolder, "include"), - dst="include") + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/yas/all/test_package/CMakeLists.txt b/recipes/yas/all/test_package/CMakeLists.txt index 641059df6fa465..31c7068ad2a4f0 100644 --- a/recipes/yas/all/test_package/CMakeLists.txt +++ b/recipes/yas/all/test_package/CMakeLists.txt @@ -1,10 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) set(CMAKE_CXX_STANDARD 11) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(yas REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE yas::yas) diff --git a/recipes/yas/all/test_package/conanfile.py b/recipes/yas/all/test_package/conanfile.py index bd7165a553cf41..ef5d7042163ecc 100644 --- a/recipes/yas/all/test_package/conanfile.py +++ b/recipes/yas/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" + 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/yas/all/test_v1_package/CMakeLists.txt b/recipes/yas/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/yas/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/yas/all/test_v1_package/conanfile.py b/recipes/yas/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..7e2dfe859bb27b --- /dev/null +++ b/recipes/yas/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/yder/all/conanfile.py b/recipes/yder/all/conanfile.py index d027f053ed062e..ffe23774e69d2f 100644 --- a/recipes/yder/all/conanfile.py +++ b/recipes/yder/all/conanfile.py @@ -5,7 +5,7 @@ import os import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class YderConan(ConanFile): @@ -15,6 +15,8 @@ class YderConan(ConanFile): topics = ("logging", "stdout", "file", "journald", "systemd") license = "LGPL-2.1-or-later" url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,27 +32,19 @@ class YderConan(ConanFile): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.os != "Linux": del self.options.with_libsystemd 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 requirements(self): self.requires("orcania/2.3.1") if self.options.get_safe("with_libsystemd"): - self.requires("libsystemd/251.4") + self.requires("libsystemd/253.10") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/yoga/all/conandata.yml b/recipes/yoga/all/conandata.yml new file mode 100644 index 00000000000000..17011be7f593da --- /dev/null +++ b/recipes/yoga/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.0.1": + url: "https://github.com/facebook/yoga/archive/refs/tags/v2.0.1.tar.gz" + sha256: "4c80663b557027cdaa6a836cc087d735bb149b8ff27cbe8442fc5e09cec5ed92" + "2.0.0": + url: "https://github.com/facebook/yoga/archive/refs/tags/v2.0.0.tar.gz" + sha256: "29eaf05191dd857f76b6db97c77cce66db3c0067c88bd5e052909386ea66b8c5" +patches: + "2.0.1": + - patch_file: "patches/0001-delete-tests.patch" + patch_description: "Delete test targets from cmake" + patch_type: "conan" + "2.0.0": + - patch_file: "patches/0001-delete-tests.patch" + patch_description: "Delete test targets from cmake" + patch_type: "conan" diff --git a/recipes/yoga/all/conanfile.py b/recipes/yoga/all/conanfile.py new file mode 100644 index 00000000000000..e8249b9860f592 --- /dev/null +++ b/recipes/yoga/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class YogaConan(ConanFile): + name = "yoga" + description = "cross-platform layout engine which implements Flexbox" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://yogalayout.com/" + topics = ("layout engine", "flexbox") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + 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 generate(self): + apply_conandata_patches(self) + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build(target="yogacore") + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["yogacore"] diff --git a/recipes/yoga/all/patches/0001-delete-tests.patch b/recipes/yoga/all/patches/0001-delete-tests.patch new file mode 100644 index 00000000000000..d3a76211634cab --- /dev/null +++ b/recipes/yoga/all/patches/0001-delete-tests.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f4ce73cc..9f414127 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,7 +10,6 @@ set(CMAKE_VERBOSE_MAKEFILE on) + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/project-defaults.cmake) + + add_subdirectory(yoga) +-add_subdirectory(tests) + + # cmake install config + include(GNUInstallDirs) diff --git a/recipes/yoga/all/test_package/CMakeLists.txt b/recipes/yoga/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..4c709290f183be --- /dev/null +++ b/recipes/yoga/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(yoga REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE yoga::yoga) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/yoga/all/test_package/conanfile.py b/recipes/yoga/all/test_package/conanfile.py new file mode 100644 index 00000000000000..02eb5ce439fb40 --- /dev/null +++ b/recipes/yoga/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 + + +# It will become the standard on Conan 2.x +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/yoga/all/test_package/test_package.cpp b/recipes/yoga/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..ce6ef4ea1d25ed --- /dev/null +++ b/recipes/yoga/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include + +int main(void) { + const YGNodeRef root = YGNodeNew(); + YGNodeStyleSetAlignItems(root, YGAlignFlexStart); + YGNodeStyleSetWidth(root, 100); + YGNodeStyleSetHeight(root, 100); + + const YGNodeRef root_child0 = YGNodeNew(); + YGNodeStyleSetWidth(root_child0, 50); + YGNodeStyleSetAspectRatio(root_child0, 1); + YGNodeInsertChild(root, root_child0, 0); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + YGNodeFreeRecursive(root); + + return EXIT_SUCCESS; +} diff --git a/recipes/yoga/config.yml b/recipes/yoga/config.yml new file mode 100644 index 00000000000000..184166496d26e2 --- /dev/null +++ b/recipes/yoga/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.1": + folder: all + "2.0.0": + folder: all diff --git a/recipes/yyjson/all/conandata.yml b/recipes/yyjson/all/conandata.yml index 35f28ce479a2e9..ad21b483cb8407 100644 --- a/recipes/yyjson/all/conandata.yml +++ b/recipes/yyjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.8.0.tar.gz" + sha256: "b2e39ac4c65f9050820c6779e6f7dd3c0d3fed9c6667f91caec0badbedce00f3" "0.7.0": url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.7.0.tar.gz" sha256: "9b91ee48ac1fe5939f747d49f123d9a522b5f4e1e46165c1871936d583628a06" diff --git a/recipes/yyjson/all/conanfile.py b/recipes/yyjson/all/conanfile.py index 041f3c54d28f4d..3574d26b2c7d54 100644 --- a/recipes/yyjson/all/conanfile.py +++ b/recipes/yyjson/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile 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" @@ -18,15 +19,19 @@ class YyjsonConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_utf8_validation": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_utf8_validation": True, } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "0.8.0": + del self.options.with_utf8_validation def configure(self): if self.options.shared: @@ -42,6 +47,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + if Version(self.version) >= "0.8.0": + tc.variables["YYJSON_DISABLE_UTF8_VALIDATION"] = not bool(self.options.with_utf8_validation) tc.generate() def build(self): diff --git a/recipes/yyjson/config.yml b/recipes/yyjson/config.yml index 7a6fcce01199cc..f84f2efec202bb 100644 --- a/recipes/yyjson/config.yml +++ b/recipes/yyjson/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.0": + folder: all "0.7.0": folder: all "0.6.0": 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/zint/all/conanfile.py b/recipes/zint/all/conanfile.py index 61596c6c982a74..f9c54ff2b86cf0 100644 --- a/recipes/zint/all/conanfile.py +++ b/recipes/zint/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class ZintConan(ConanFile): @@ -15,7 +15,7 @@ class ZintConan(ConanFile): homepage = "https://sourceforge.net/p/zint/code" license = "GPL-3.0" topics = ("barcode", "qt") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -39,37 +39,27 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") if not self.options.with_qt: - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_libpng: - self.requires("libpng/1.6.38") - self.requires("zlib/1.2.13") + self.requires("libpng/1.6.40") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_qt: - self.requires("qt/5.15.6") + self.requires("qt/5.15.10") def validate(self): - if self.info.options.with_qt and not self.dependencies["qt"].options.gui: + if self.options.with_qt and not self.dependencies["qt"].options.gui: raise ConanInvalidConfiguration(f"{self.ref} needs qt:gui=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) diff --git a/recipes/zint/all/test_package/CMakeLists.txt b/recipes/zint/all/test_package/CMakeLists.txt index 14bd143a5e4a68..d4ac6daa22c07f 100644 --- a/recipes/zint/all/test_package/CMakeLists.txt +++ b/recipes/zint/all/test_package/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) +enable_testing() + option(ZINT_WITH_QT "Zint has been built with Qt support") if(ZINT_WITH_QT) enable_language(CXX) @@ -8,10 +10,12 @@ endif() find_package(Zint REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Zint::Zint) +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE Zint::Zint) +add_test(NAME test_package COMMAND test_package) if(ZINT_WITH_QT) - add_executable(${PROJECT_NAME}_cpp test_package.cpp) - target_link_libraries(${PROJECT_NAME}_cpp PRIVATE Zint::QZint) + add_executable(test_package_cpp test_package.cpp) + target_link_libraries(test_package_cpp PRIVATE Zint::QZint) + add_test(NAME test_package_cpp COMMAND test_package_cpp) endif() diff --git a/recipes/zint/all/test_package/conanfile.py b/recipes/zint/all/test_package/conanfile.py index 1617e37109bc27..9523fb1ef2b635 100644 --- a/recipes/zint/all/test_package/conanfile.py +++ b/recipes/zint/all/test_package/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -import os +from conan.tools.files import chdir class TestPackageConan(ConanFile): @@ -27,8 +27,5 @@ def build(self): 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") - if self.options["zint"].with_qt: - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") - self.run(bin_path, env="conanrun") + with chdir(self, self.build_folder): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun") diff --git a/recipes/zint/all/test_v1_package/CMakeLists.txt b/recipes/zint/all/test_v1_package/CMakeLists.txt index d155f1e77d4aaf..c23ed5cfe6d983 100644 --- a/recipes/zint/all/test_v1_package/CMakeLists.txt +++ b/recipes/zint/all/test_v1_package/CMakeLists.txt @@ -1,20 +1,10 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_v1_package) -option(ZINT_WITH_QT "Zint has been built with Qt support") -if(ZINT_WITH_QT) - enable_language(CXX) -endif() +enable_testing() include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Zint REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Zint::Zint) - -if(ZINT_WITH_QT) - add_executable(${PROJECT_NAME}_cpp ../test_package/test_package.cpp) - target_link_libraries(${PROJECT_NAME}_cpp PRIVATE Zint::QZint) -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/zint/all/test_v1_package/conanfile.py b/recipes/zint/all/test_v1_package/conanfile.py index 1ce37b6a52e778..723b5e4a6fa800 100644 --- a/recipes/zint/all/test_v1_package/conanfile.py +++ b/recipes/zint/all/test_v1_package/conanfile.py @@ -1,5 +1,4 @@ from conans import ConanFile, CMake, tools -import os class TestPackageConan(ConanFile): @@ -14,8 +13,4 @@ def build(self): 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 self.options["zint"].with_qt: - bin_path = os.path.join("bin", "test_package_cpp") - self.run(bin_path, run_environment=True) + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", run_environment=True) diff --git a/recipes/zlib-ng/all/conandata.yml b/recipes/zlib-ng/all/conandata.yml index 27e5a03a3afe2e..7e85151017f0d7 100644 --- a/recipes/zlib-ng/all/conandata.yml +++ b/recipes/zlib-ng/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.1.5": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.5.tar.gz" + sha256: "3f6576971397b379d4205ae5451ff5a68edf6c103b2f03c4188ed7075fbb5f04" + "2.1.4": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.4.tar.gz" + sha256: "a0293475e6a44a3f6c045229fe50f69dc0eebc62a42405a51f19d46a5541e77a" "2.1.3": url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.3.tar.gz" sha256: "d20e55f89d71991c59f1c5ad1ef944815e5850526c0d9cd8e504eaed5b24491a" diff --git a/recipes/zlib-ng/all/conanfile.py b/recipes/zlib-ng/all/conanfile.py index 2c536695c6f5e3..853a0a0f6a309e 100644 --- a/recipes/zlib-ng/all/conanfile.py +++ b/recipes/zlib-ng/all/conanfile.py @@ -34,7 +34,7 @@ class ZlibNgConan(ConanFile): "fPIC": True, "zlib_compat": False, "with_gzfileop": True, - "with_optim": False, + "with_optim": True, "with_new_strategies": True, "with_native_instructions": False, "with_reduced_mem": False, diff --git a/recipes/zlib-ng/config.yml b/recipes/zlib-ng/config.yml index 96567d37e1ee8d..b48f6e22e71f36 100644 --- a/recipes/zlib-ng/config.yml +++ b/recipes/zlib-ng/config.yml @@ -1,4 +1,8 @@ versions: + "2.1.5": + folder: all + "2.1.4": + folder: all "2.1.3": folder: all "2.1.2": diff --git a/recipes/zlib/all/conandata.yml b/recipes/zlib/all/conandata.yml index 4da75436b4d71c..bcebfb9b13b6d3 100644 --- a/recipes/zlib/all/conandata.yml +++ b/recipes/zlib/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "1.3": + url: + - "https://zlib.net/fossils/zlib-1.3.tar.gz" + - "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" + sha256: "ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e" "1.2.13": url: - "https://zlib.net/fossils/zlib-1.2.13.tar.gz" @@ -11,12 +16,18 @@ sources: url: "https://zlib.net/fossils/zlib-1.2.11.tar.gz" sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" patches: + "1.3": + - patch_file: "patches/1.3/0001-fix-cmake.patch" + patch_description: "separate static/shared builds, disable debug suffix, disable building examples" + patch_type: "conan" "1.2.13": - patch_file: "patches/1.2.13/0001-Fix-cmake.patch" - - patch_file: "patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch" + patch_description: "separate static/shared builds, disable debug suffix, disable building examples" + patch_type: "conan" "1.2.12": - patch_file: "patches/1.2.x/0001-fix-cmake.patch" - - patch_file: "patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch" + patch_description: "separate static/shared builds, disable debug suffix, disable building examples" + patch_type: "conan" - patch_file: "patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch" patch_description: "CVE-2022-37434: Fix a bug when getting a gzip header extra field with inflate()" patch_type: "vulnerability" @@ -29,6 +40,9 @@ patches: sha256: "cdd69eb3251728b1875c8ecae6427b50aa750b4045ef984ab79b6c07b7e6dd3a" "1.2.11": - patch_file: "patches/1.2.x/0001-fix-cmake.patch" - - patch_file: "patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch" - # https://github.com/madler/zlib/issues/268 + patch_description: "separate static/shared builds, disable debug suffix, disable building examples" + patch_type: "conan" - patch_file: "patches/1.2.x/0003-gzguts-fix-widechar-condition.patch" + patch_description: "fix condition for WIDECHAR usage" + patch_type: "portability" + patch_source: "https://github.com/madler/zlib/issues/268" diff --git a/recipes/zlib/all/patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch b/recipes/zlib/all/patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch deleted file mode 100644 index 3f81a6f53a2485..00000000000000 --- a/recipes/zlib/all/patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 4ff188d490445fe7bad629a94d5bf4b641d4ab8d Mon Sep 17 00:00:00 2001 -From: Tim Blechmann -Date: Thu, 2 Jul 2020 12:04:38 +0800 -Subject: [PATCH] xcode12 compile fix - ---- - gzguts.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/gzguts.h b/gzguts.h -index 990a4d2..c78cb40 100644 ---- a/gzguts.h -+++ b/gzguts.h -@@ -26,6 +26,10 @@ - # include - #endif - -+#ifdef __APPLE__ -+#include -+#endif -+ - #ifndef _POSIX_SOURCE - # define _POSIX_SOURCE - #endif --- -2.27.0 - diff --git a/recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch b/recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch index 56b3fbe76ce8eb..3de4978c306617 100644 --- a/recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch +++ b/recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch @@ -1,8 +1,8 @@ diff --git a/gzguts.h b/gzguts.h -index c78cb40..4e9ec4f 100644 +index 990a4d2..6378d46 100644 --- a/gzguts.h +++ b/gzguts.h -@@ -43,7 +43,7 @@ +@@ -39,7 +39,7 @@ # include #endif diff --git a/recipes/zlib/all/patches/1.3/0001-fix-cmake.patch b/recipes/zlib/all/patches/1.3/0001-fix-cmake.patch new file mode 100644 index 00000000000000..b2aa69d0684cf8 --- /dev/null +++ b/recipes/zlib/all/patches/1.3/0001-fix-cmake.patch @@ -0,0 +1,92 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7f1b69f..618ea02 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -57,7 +57,6 @@ endif() + check_include_file(unistd.h Z_HAVE_UNISTD_H) + + if(MSVC) +- set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +@@ -120,7 +119,7 @@ set(ZLIB_SRCS + zutil.c + ) + +-if(NOT MINGW) ++if(MSVC) + set(ZLIB_DLL_SRCS + win32/zlib1.rc # If present will override custom build rule below. + ) +@@ -131,7 +130,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) + string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +-if(MINGW) ++if(WIN32 AND NOT MSVC) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER windres.exe) +@@ -145,12 +144,16 @@ if(MINGW) + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) +-endif(MINGW) ++endif() + ++if(BUILD_SHARED_LIBS) + add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) ++else() ++add_library(zlib STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++endif() + + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version +@@ -163,19 +166,24 @@ if(NOT CYGWIN) + set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) + endif() + +-if(UNIX) ++if(WIN32 AND NOT MINGW) ++ if(BUILD_SHARED_LIBS) ++ set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) ++ endif() ++else() + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +-elseif(BUILD_SHARED_LIBS AND WIN32) ++endif() ++if(BUILD_SHARED_LIBS AND WIN32) + # Creates zlib1.dll when building shared library version +- set_target_properties(zlib PROPERTIES SUFFIX "1.dll") ++ set_target_properties(zlib PROPERTIES PREFIX "" RUNTIME_OUTPUT_NAME "zlib1") + endif() + + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +@@ -193,7 +201,7 @@ endif() + #============================================================================ + # Example binaries + #============================================================================ +- ++if(0) + add_executable(example test/example.c) + target_link_libraries(example zlib) + add_test(example example) +@@ -211,3 +219,4 @@ if(HAVE_OFF64_T) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + endif() ++endif() diff --git a/recipes/zlib/all/patches/1.3/0002-gzguts-xcode12-compile-fix.patch b/recipes/zlib/all/patches/1.3/0002-gzguts-xcode12-compile-fix.patch new file mode 100644 index 00000000000000..d299f4962fa59d --- /dev/null +++ b/recipes/zlib/all/patches/1.3/0002-gzguts-xcode12-compile-fix.patch @@ -0,0 +1,15 @@ +diff --git a/gzguts.h b/gzguts.h +index f937504..c4654b5 100644 +--- a/gzguts.h ++++ b/gzguts.h +@@ -25,6 +25,10 @@ + # include + #endif + ++#ifdef __APPLE__ ++#include ++#endif ++ + #ifndef _POSIX_SOURCE + # define _POSIX_SOURCE + #endif diff --git a/recipes/zlib/config.yml b/recipes/zlib/config.yml index 351c06f68201f8..132003f7c53b57 100644 --- a/recipes/zlib/config.yml +++ b/recipes/zlib/config.yml @@ -1,4 +1,6 @@ versions: + "1.3": + folder: all "1.2.13": folder: all "1.2.12": diff --git a/recipes/zmqpp/all/conandata.yml b/recipes/zmqpp/all/conandata.yml index b8b843edf38c8e..4bc0fe616e5744 100644 --- a/recipes/zmqpp/all/conandata.yml +++ b/recipes/zmqpp/all/conandata.yml @@ -5,5 +5,11 @@ sources: patches: "4.2.0": - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "use cci's zeromq, separate shared and static build" + patch_type: "conan" - patch_file: "patches/0002-missing-includes.patch" + patch_description: "include missing includes" + patch_type: "portability" - patch_file: "patches/0003-Allow-building-with-Werror-undef.patch" + patch_description: "fix WIN32 detection" + patch_type: "portability" diff --git a/recipes/zmqpp/all/conanfile.py b/recipes/zmqpp/all/conanfile.py index 8d4bf7d455227f..a4ed7a7549f25e 100644 --- a/recipes/zmqpp/all/conanfile.py +++ b/recipes/zmqpp/all/conanfile.py @@ -4,20 +4,20 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class ZmqppConan(ConanFile): name = "zmqpp" - homepage = "https://github.com/zeromq/zmqpp" - license = "MPL-2.0" - url = "https://github.com/conan-io/conan-center-index" description = ( "This C++ binding for 0mq/zmq is a 'high-level' library that hides " "most of the c-style interface core 0mq provides." ) + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zeromq/zmqpp" topics = ("zmq", "0mq", "zeromq", "message-queue", "asynchronous") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -28,6 +28,10 @@ class ZmqppConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 11 + def export_sources(self): export_conandata_patches(self) @@ -37,24 +41,20 @@ 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("zeromq/4.3.4") + self.requires("zeromq/4.3.4", transitive_headers=True, transitive_libs=True) def validate(self): if self.info.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) 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/zookeeper-client-c/all/conandata.yml b/recipes/zookeeper-client-c/all/conandata.yml index 5a209ac187af0d..0487be945d8c94 100644 --- a/recipes/zookeeper-client-c/all/conandata.yml +++ b/recipes/zookeeper-client-c/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "3.9.0": + url: "https://archive.apache.org/dist/zookeeper/zookeeper-3.9.0/apache-zookeeper-3.9.0.tar.gz" + sha256: "c7af07e7411c798398bb8cd50f47780d8e014831666c41df6ec6540c143c0da2" "3.8.1": - url: "https://dlcdn.apache.org/zookeeper/zookeeper-3.8.1/apache-zookeeper-3.8.1.tar.gz" + url: "https://archive.apache.org/dist/zookeeper/zookeeper-3.8.1/apache-zookeeper-3.8.1.tar.gz" sha256: "ccc16850c8ab2553583583234d11c813061b5ea5f3b8ff1d740cde6c1fd1e219" patches: + "3.9.0": + - patch_file: "patches/3.8.1-0001-add-install.patch" + patch_description: "add installer, disable cli program" + patch_type: "conan" "3.8.1": - patch_file: "patches/3.8.1-0001-add-install.patch" patch_description: "add installer, disable cli program" diff --git a/recipes/zookeeper-client-c/config.yml b/recipes/zookeeper-client-c/config.yml index f3cf585c380d6d..31b8685d6b74af 100644 --- a/recipes/zookeeper-client-c/config.yml +++ b/recipes/zookeeper-client-c/config.yml @@ -1,3 +1,5 @@ versions: + "3.9.0": + folder: all "3.8.1": folder: all diff --git a/recipes/zopfli/all/conanfile.py b/recipes/zopfli/all/conanfile.py index 1f0b88e5124353..35dd2870f9a777 100644 --- a/recipes/zopfli/all/conanfile.py +++ b/recipes/zopfli/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class ZopfliConan(ConanFile): @@ -16,8 +16,8 @@ class ZopfliConan(ConanFile): "Zopfli Compression Algorithm is a compression library programmed in C " "to perform very good, but slow, deflate or zlib compression." ) - topics = ("zopfli", "compression", "deflate", "gzip", "zlib") - + topics = ("compression", "deflate", "gzip", "zlib") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,25 +34,15 @@ 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") 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/zopfli/all/test_v1_package/CMakeLists.txt b/recipes/zopfli/all/test_v1_package/CMakeLists.txt index 0d2662cb23a483..0d20897301b68b 100644 --- a/recipes/zopfli/all/test_v1_package/CMakeLists.txt +++ b/recipes/zopfli/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Zopfli REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Zopfli::libzopfli) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/zpp_bits/all/conandata.yml b/recipes/zpp_bits/all/conandata.yml index 5c61aeec321eeb..21dad3174e487e 100644 --- a/recipes/zpp_bits/all/conandata.yml +++ b/recipes/zpp_bits/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "4.4.20": + url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.20.tar.gz" + sha256: "13023d3752392d64f89113bf8099a2a50b2602a7e26a2fdf78a27e327104819c" + "4.4.19": + url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.19.tar.gz" + sha256: "1d8f92e616d61cd54cb2582280cc5a28e4457d8d9cfc331137859f8ef29ff637" + "4.4.18": + url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.18.tar.gz" + sha256: "c81a221a3d857218d990aa39f420f4cb5cdbe906672d22286b871355068bc14b" "4.4.17": url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.17.tar.gz" sha256: "e6aacf3fbea7ee16a9b55a8622665d37b157efad321750876aa5c15ed8ac65e6" diff --git a/recipes/zpp_bits/config.yml b/recipes/zpp_bits/config.yml index f68457e0898523..4b6dc9c6883505 100644 --- a/recipes/zpp_bits/config.yml +++ b/recipes/zpp_bits/config.yml @@ -1,4 +1,10 @@ versions: + "4.4.20": + folder: all + "4.4.19": + folder: all + "4.4.18": + folder: all "4.4.17": folder: all "4.4.13": diff --git a/recipes/zpp_throwing/all/conandata.yml b/recipes/zpp_throwing/all/conandata.yml index 063b5be845f319..118abd17e3a227 100644 --- a/recipes/zpp_throwing/all/conandata.yml +++ b/recipes/zpp_throwing/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.1": + url: "https://github.com/eyalz800/zpp_throwing/archive/v1.0.1.tar.gz" + sha256: "c15651ad36f9ddcb51e6244b0a78dbdebf7be8748b3e7ffe1c7339f0e41fd411" "1.0": url: "https://github.com/eyalz800/zpp_throwing/archive/refs/tags/v1.0.tar.gz" sha256: "e02ef0e028e436ed4382b14796550f48c1d2b5ae02910f10b5b9fe097981ea2f" diff --git a/recipes/zpp_throwing/all/conanfile.py b/recipes/zpp_throwing/all/conanfile.py index 6cfaa18e3dd020..7fb36897fcbae1 100644 --- a/recipes/zpp_throwing/all/conanfile.py +++ b/recipes/zpp_throwing/all/conanfile.py @@ -3,11 +3,12 @@ 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 +from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.50.0" + class ZppThrowingConan(ConanFile): name = "zpp_throwing" @@ -16,6 +17,7 @@ class ZppThrowingConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/eyalz800/zpp_throwing" topics = ("coroutines", "exceptions", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -67,7 +69,7 @@ def loose_lt_semver(v1, v2): raise ConanInvalidConfiguration(f"{self.ref} requires libc++ with 'coroutines' supported on your compiler.") 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 package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) diff --git a/recipes/zpp_throwing/config.yml b/recipes/zpp_throwing/config.yml index edab1ee152d366..7b06dd8bf61ea9 100644 --- a/recipes/zpp_throwing/config.yml +++ b/recipes/zpp_throwing/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.1": + folder: all "1.0": folder: all diff --git a/recipes/zstd/all/conandata.yml b/recipes/zstd/all/conandata.yml index 01522ab9511c5a..0deaf672d11b8c 100644 --- a/recipes/zstd/all/conandata.yml +++ b/recipes/zstd/all/conandata.yml @@ -43,6 +43,10 @@ patches: - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" patch_description: "use assembler codes only on x86_64" patch_type: "portability" + - patch_file: "patches/1.5.5-qnx_support.patch" + patch_description: "Add qnx to platform" + patch_type: "portability" + patch_source: "https://github.com/facebook/zstd/pull/3745" "1.5.4": - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" patch_description: "use assembler codes only on x86_64" diff --git a/recipes/zstd/all/conanfile.py b/recipes/zstd/all/conanfile.py index 0b3e82a7fef9c8..5920d507715237 100644 --- a/recipes/zstd/all/conanfile.py +++ b/recipes/zstd/all/conanfile.py @@ -1,12 +1,13 @@ from conan import ConanFile 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, rmdir +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" - class ZstdConan(ConanFile): name = "zstd" url = "https://github.com/conan-io/conan-center-index" @@ -21,11 +22,13 @@ class ZstdConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "threading": [True, False], + "build_programs": [True, False], } default_options = { "shared": False, "fPIC": True, "threading": True, + "build_programs": True, } def export_sources(self): @@ -49,10 +52,14 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["ZSTD_BUILD_PROGRAMS"] = False - tc.variables["ZSTD_BUILD_STATIC"] = not self.options.shared + tc.variables["ZSTD_BUILD_PROGRAMS"] = self.options.build_programs + tc.variables["ZSTD_BUILD_STATIC"] = not self.options.shared or self.options.build_programs tc.variables["ZSTD_BUILD_SHARED"] = self.options.shared tc.variables["ZSTD_MULTITHREAD_SUPPORT"] = self.options.threading + + if not is_msvc(self): + tc.variables["CMAKE_C_FLAGS"] = "-Wno-maybe-uninitialized" + if Version(self.version) < "1.4.3": # Generate a relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" @@ -77,16 +84,30 @@ def package(self): cmake.install() 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")) + + 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, "*_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" self.cpp_info.set_property("cmake_file_name", "zstd") self.cpp_info.set_property("cmake_target_name", f"zstd::{zstd_cmake}") self.cpp_info.set_property("pkg_config_name", "libzstd") - self.cpp_info.components["zstdlib"].set_property("pkg_config_name", "libzstd") - self.cpp_info.components["zstdlib"].names["cmake_find_package"] = zstd_cmake - self.cpp_info.components["zstdlib"].names["cmake_find_package_multi"] = zstd_cmake - self.cpp_info.components["zstdlib"].set_property("cmake_target_name", f"zstd::{zstd_cmake}") self.cpp_info.components["zstdlib"].libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["zstdlib"].system_libs.append("pthread") + + # TODO: Remove after dropping Conan 1.x from ConanCenterIndex + self.cpp_info.components["zstdlib"].names["cmake_find_package"] = zstd_cmake + self.cpp_info.components["zstdlib"].names["cmake_find_package_multi"] = zstd_cmake + self.cpp_info.components["zstdlib"].set_property("cmake_target_name", f"zstd::{zstd_cmake}") + self.cpp_info.components["zstdlib"].set_property("pkg_config_name", "libzstd") + if self.options.build_programs: + bindir = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bindir) diff --git a/recipes/zstd/all/patches/1.5.5-qnx_support.patch b/recipes/zstd/all/patches/1.5.5-qnx_support.patch new file mode 100644 index 00000000000000..ba58a24cceb498 --- /dev/null +++ b/recipes/zstd/all/patches/1.5.5-qnx_support.patch @@ -0,0 +1,11 @@ +--- programs/platform.h 2023-04-04 22:13:52.000000000 +0200 ++++ programs/platform.h 2023-09-03 10:01:58.930595800 +0200 +@@ -89,7 +89,7 @@ + */ + # elif !defined(_WIN32) \ + && ( defined(__unix__) || defined(__unix) \ +- || defined(__midipix__) || defined(__VMS) || defined(__HAIKU__) ) ++ || defined(_QNX_SOURCE) || defined(__midipix__) || defined(__VMS) || defined(__HAIKU__) ) + + # if defined(__linux__) || defined(__linux) || defined(__CYGWIN__) + # ifndef _POSIX_C_SOURCE diff --git a/recipes/zstd/all/test_package/conanfile.py b/recipes/zstd/all/test_package/conanfile.py index 6f307ff1c207f3..5c69b0e8faebe4 100644 --- a/recipes/zstd/all/test_package/conanfile.py +++ b/recipes/zstd/all/test_package/conanfile.py @@ -13,7 +13,7 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) + self.requires(self.tested_reference_str, run=True) def build(self): cmake = CMake(self) @@ -21,7 +21,11 @@ def build(self): cmake.build() def test(self): - if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - png_file = os.path.join(self.source_folder, "logo.png") - self.run(f"{bin_path} {png_file}", env="conanrun") + if not can_run(self): + return + + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + png_file = os.path.join(self.source_folder, "logo.png") + self.run(f"{bin_path} {png_file}", env="conanrun") + + self.run(f"zstd --version", env="conanrun") diff --git a/recipes/zstr/all/conanfile.py b/recipes/zstr/all/conanfile.py index 512be7c200256b..97a53cde0de88b 100644 --- a/recipes/zstr/all/conanfile.py +++ b/recipes/zstr/all/conanfile.py @@ -14,6 +14,7 @@ class ZstrConan(ConanFile): topics = ("zlib", "wrapper", "compression") homepage = "https://github.com/mateidavid/zstr" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -21,7 +22,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def package_id(self): self.info.clear() @@ -31,8 +32,7 @@ def validate(self): check_min_cppstd(self, 11) 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 diff --git a/recipes/zulu-openjdk/all/conandata.yml b/recipes/zulu-openjdk/all/conandata.yml index 4c8a8b5afbd6a1..9e14b09c940cf1 100644 --- a/recipes/zulu-openjdk/all/conandata.yml +++ b/recipes/zulu-openjdk/all/conandata.yml @@ -1,4 +1,42 @@ sources: + "21.0.1": + "Windows": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu21.30.15-ca-jdk21.0.1-win_x64.zip" + sha256: "f6541ceed2eb0b793fd27f22d9f8192ad1c9c4c53e528dd0a1e6ec8d7c3a33d3" + "Linux": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu21.30.15-ca-jdk21.0.1-linux_x64.tar.gz" + sha256: "bf4842dd3a17cfe85523be5848b5ec3bc3d811afc74feab791befa4c895c4449" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu21.30.15-ca-jdk21.0.1-linux_aarch64.tar.gz" + sha256: "00863e2b9910a5ed4f55183b89459d2162147e871d96ab532479ab06d9fae03b" + "Macos": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu21.30.15-ca-jdk21.0.1-macosx_x64.tar.gz" + sha256: "667e3945ffd394317b5faf1f5bd4847d1f1d091f76543df27d9b3a2ee7bf7a7e" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu21.30.15-ca-jdk21.0.1-macosx_aarch64.tar.gz" + sha256: "6e89b6ed60c0efcc1b5bb7c6b36710ce746751b316a16cc3f9915470c4eb2a00" + "17.0.9": + "Windows": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu17.46.19-ca-jdk17.0.9-win_x64.zip" + sha256: "32e110628ea0bd750b84e0f937e7c98874505e76a0590d759565dfa803f89ccf" + "Linux": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu17.46.19-ca-jdk17.0.9-linux_x64.tar.gz" + sha256: "5317630424ee4e4d2c1024240d2e6f94a7c06d17b01dd36859df4a4d679fc287" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu17.46.19-ca-jdk17.0.9-linux_aarch64.tar.gz" + sha256: "90062201e7911696a449431a61dc0a55cd10cda516a9f2db54c410633a79302a" + "Macos": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu17.46.19-ca-jdk17.0.9-macosx_x64.tar.gz" + sha256: "19271b74c3f3b21f4978eda8f09908c063c456cea57265d71475ceefef5aa0ac" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu17.46.19-ca-jdk17.0.9-macosx_aarch64.tar.gz" + sha256: "d6837676e55b97772b6512e253fdaf8ab282bb216c0f8366b6c5905cd02b5056" "11.0.19": "Windows": "x86_64": diff --git a/recipes/zulu-openjdk/all/conanfile.py b/recipes/zulu-openjdk/all/conanfile.py index 1aa178e14ab520..648597913dd658 100644 --- a/recipes/zulu-openjdk/all/conanfile.py +++ b/recipes/zulu-openjdk/all/conanfile.py @@ -44,7 +44,7 @@ def build(self): def package(self): copy(self, pattern="*", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "bin"), - excludes=("msvcp140.dll", "vcruntime140.dll")) + excludes=("msvcp140.dll", "vcruntime140.dll", "vcruntime140_1.dll")) copy(self, 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, "lib"), diff --git a/recipes/zulu-openjdk/config.yml b/recipes/zulu-openjdk/config.yml index a92b329e254ee3..d9b1272d1abe98 100644 --- a/recipes/zulu-openjdk/config.yml +++ b/recipes/zulu-openjdk/config.yml @@ -1,4 +1,8 @@ versions: + "21.0.1": + folder: all + "17.0.9": + folder: all "11.0.19": folder: all "11.0.15": diff --git a/recipes/zxing-cpp/all/conandata.yml b/recipes/zxing-cpp/all/conandata.yml index 52b8beeb98353e..de7e69d1a2cb4a 100644 --- a/recipes/zxing-cpp/all/conandata.yml +++ b/recipes/zxing-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.1": + url: "https://github.com/zxing-cpp/zxing-cpp/archive/v2.2.1.tar.gz" + sha256: "02078ae15f19f9d423a441f205b1d1bee32349ddda7467e2c84e8f08876f8635" "2.1.0": url: "https://github.com/zxing-cpp/zxing-cpp/archive/v2.1.0.tar.gz" sha256: "6d54e403592ec7a143791c6526c1baafddf4c0897bb49b1af72b70a0f0c4a3fe" diff --git a/recipes/zxing-cpp/config.yml b/recipes/zxing-cpp/config.yml index 8e200e12001c53..335926844a15f8 100644 --- a/recipes/zxing-cpp/config.yml +++ b/recipes/zxing-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.1": + folder: all "2.1.0": folder: all "2.0.0": diff --git a/recipes/zyre/all/CMakeLists.txt b/recipes/zyre/all/CMakeLists.txt deleted file mode 100644 index d04be130b6aa2b..00000000000000 --- a/recipes/zyre/all/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -if(NOT BUILD_SHARED_LIBS) - add_definitions(-DZYRE_STATIC) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/zyre/all/conandata.yml b/recipes/zyre/all/conandata.yml index cce2036293068a..9f0637b08d296e 100644 --- a/recipes/zyre/all/conandata.yml +++ b/recipes/zyre/all/conandata.yml @@ -2,19 +2,7 @@ sources: "2.0.1": url: "https://github.com/zeromq/zyre/archive/v2.0.1.tar.gz" sha256: "624d379dc880025144f58d3a7dc35ea1be4a57ba4e2a58c98ec15a60891be12d" - "2.0.0": - url: "https://github.com/zeromq/zyre/archive/v2.0.0.tar.gz" - sha256: "b978a999947ddb6722d956db2427869b313225e50518c4fbbf960a68109e3e91" patches: "2.0.1": - patch_file: "patches/2.0.1-0001-cmake-use-conan-disable-executables.patch" - base_path: "source_subfolder" - patch_file: "patches/2.0.1-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch" - base_path: "source_subfolder" - "2.0.0": - - patch_file: "patches/2.0.0-0001-cmake-use-conan-disable-executables.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.0.0-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.0.0-0003-fix-zyre-self-test-on-windows.patch" - base_path: "source_subfolder" diff --git a/recipes/zyre/all/conanfile.py b/recipes/zyre/all/conanfile.py index 2720136bcd4ee1..bd990107ea3627 100644 --- a/recipes/zyre/all/conanfile.py +++ b/recipes/zyre/all/conanfile.py @@ -1,20 +1,24 @@ -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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + class ZyreConan(ConanFile): name = "zyre" + description = "Local Area Clustering for Peer-to-Peer Applications." license = "MPL-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/zeromq/zyre" - description = "Local Area Clustering for Peer-to-Peer Applications." - topics = ("zyre", "czmq", "zmq", "zeromq", - "message-queue", "asynchronous") + topics = ("czmq", "zmq", "zeromq", "message-queue", "asynchronous") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - generators = ["cmake", "cmake_find_package"] options = { "shared": [True, False], "fPIC": [True, False], @@ -26,18 +30,8 @@ class ZyreConan(ConanFile): "drafts": False, } - @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,47 +39,68 @@ 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("czmq/4.2.0") - self.requires("zeromq/4.3.4") + self.requires("czmq/4.2.1", transitive_headers=True) + self.requires("zeromq/4.3.5") if self.settings.os in ["Linux", "FreeBSD"]: - self.requires("libsystemd/249.7") + self.requires("libsystemd/253.10") 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["ENABLE_DRAFTS"] = self.options.drafts - if tools.Version(self.version) >= "2.0.1": - cmake.definitions["ZYRE_BUILD_SHARED"] = self.options.shared - cmake.definitions["ZYRE_BUILD_STATIC"] = not self.options.shared - cmake.configure(build_dir=self._build_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_DRAFTS"] = self.options.drafts + if Version(self.version) >= "2.0.1": + tc.variables["ZYRE_BUILD_SHARED"] = self.options.shared + tc.variables["ZYRE_BUILD_STATIC"] = not self.options.shared + 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") + deps.set_property("czmq", "cmake_file_name", "CZMQ") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(libzmq REQUIRED)", "find_package(LIBZMQ REQUIRED CONFIG)") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(czmq REQUIRED)", "find_package(CZMQ REQUIRED CONFIG)") def build(self): - for patch in self.conan_data["patches"][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", src=self._source_subfolder, - dst="licenses") - 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", "pkgconfig",)) - tools.rmdir(os.path.join(self.package_folder, "share",)) - tools.rmdir(os.path.join(self.package_folder, "cmake",)) + 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")) def package_info(self): - self.cpp_info.names["pkg_config"] = "libzyre" - - libname = "libzyre" if tools.Version(self.version) >= "2.0.1" and is_msvc(self) and not self.options.shared else "zyre" + 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" + if Version(self.version) >= "2.0.1" and is_msvc(self) and not self.options.shared: + libname = "libzyre" self.cpp_info.libs = [libname] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "dl", "rt", "m"] diff --git a/recipes/zyre/all/patches/2.0.0-0001-cmake-use-conan-disable-executables.patch b/recipes/zyre/all/patches/2.0.0-0001-cmake-use-conan-disable-executables.patch deleted file mode 100644 index 1c404d27e174c5..00000000000000 --- a/recipes/zyre/all/patches/2.0.0-0001-cmake-use-conan-disable-executables.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -107,10 +107,10 @@ set(OPTIONAL_LIBRARIES) - ######################################################################## - # LIBZMQ dependency - ######################################################################## --find_package(libzmq REQUIRED) -+find_package(ZeroMQ REQUIRED) --IF (LIBZMQ_FOUND) -+IF (ZEROMQ_FOUND) -- include_directories(${LIBZMQ_INCLUDE_DIRS}) -- list(APPEND MORE_LIBRARIES ${LIBZMQ_LIBRARIES}) -+ include_directories(${CONAN_INCLUDE_DIRS_LIBZMQ}) -+ list(APPEND MORE_LIBRARIES ZeroMQ::ZeroMQ) - set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq") - ELSE (LIBZMQ_FOUND) - message( FATAL_ERROR "libzmq not found." ) -@@ -121,8 +121,8 @@ ENDIF (LIBZMQ_FOUND) - ######################################################################## - find_package(czmq REQUIRED) - IF (CZMQ_FOUND) -- include_directories(${CZMQ_INCLUDE_DIRS}) -- list(APPEND MORE_LIBRARIES ${CZMQ_LIBRARIES}) -+ include_directories(${CONAN_INCLUDE_DIRS_CZMQ}) -+ list(APPEND MORE_LIBRARIES czmq::czmq) - set(pkg_config_libs_private "${pkg_config_libs_private} -lczmq") - ELSE (CZMQ_FOUND) - message( FATAL_ERROR "czmq not found." ) -@@ -168,7 +168,7 @@ - endif() - add_library(zyre ${zyre_sources}) - set_target_properties(zyre -- PROPERTIES DEFINE_SYMBOL "ZYRE_EXPORTS" -+ PROPERTIES DEFINE_SYMBOL "ZYRE_EXPORTS" LINKER_LANGUAGE CXX - ) - set_target_properties (zyre - PROPERTIES SOVERSION "2.0.0" -@@ -182,9 +182,9 @@ install(TARGETS zyre - ARCHIVE DESTINATION "lib${LIB_SUFFIX}" # .lib file - RUNTIME DESTINATION bin # .dll file - ) -- -+if(BUILD_EXECUTABLES) - include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists-local.txt) # Optional project-local hook -- -+endif() - ######################################################################## - # pkgconfig - ######################################################################## -@@ -211,6 +211,7 @@ install( - ######################################################################## - # executables - ######################################################################## -+if(BUILD_EXECUTABLES) - add_executable( - perf_local - "${SOURCE_DIR}/src/perf_local.c" -@@ -304,7 +305,7 @@ set_target_properties( - zyre_selftest - PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SOURCE_DIR}/src" - ) -- -+endif() - ######################################################################## - # tests - ######################################################################## diff --git a/recipes/zyre/all/patches/2.0.0-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch b/recipes/zyre/all/patches/2.0.0-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch deleted file mode 100644 index 055ebeaf290963..00000000000000 --- a/recipes/zyre/all/patches/2.0.0-0002-zyre-disable-git-escape-CMAKE_BUILD_TYPE.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -22,7 +22,7 @@ - ######################################################################## - # options - ######################################################################## --if (NOT CMAKE_BUILD_TYPE) -+if (0) - if (EXISTS "${SOURCE_DIR}/.git") - set (CMAKE_BUILD_TYPE Debug) - else () -@@ -43,7 +43,7 @@ - endif () - endif () - endif () --if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") -+if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" ON) - else () - OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" OFF) diff --git a/recipes/zyre/all/patches/2.0.0-0003-fix-zyre-self-test-on-windows.patch b/recipes/zyre/all/patches/2.0.0-0003-fix-zyre-self-test-on-windows.patch deleted file mode 100644 index 961bb8d6f2a197..00000000000000 --- a/recipes/zyre/all/patches/2.0.0-0003-fix-zyre-self-test-on-windows.patch +++ /dev/null @@ -1,55 +0,0 @@ -https://github.com/zeromq/czmq/commit/8f8aa86ec1ecf903a614a26aa9e4dd63ace4ffd1 - ---- src/zre_msg.c -+++ src/zre_msg.c -@@ -1766,4 +1766,7 @@ - // @end - -+#ifdef __WINDOWS__ -+ zsys_shutdown(); -+#endif - printf ("OK\n"); - } ---- src/zyre.c -+++ src/zyre.c -@@ -738,6 +738,9 @@ - zyre_destroy (&node2); - // @end -+#ifdef __WINDOWS__ -+ zsys_shutdown(); -+#endif - printf ("OK\n"); - - // zre_msg, zyre_group, zyre_node and zyre_peer are private classes and - // symbols are not exported so the tests can't be run from zyre_selftest, ---- src/zyre_group.c -+++ src/zyre_group.c -@@ -171,5 +171,8 @@ - zhash_destroy (&groups); - zsock_destroy (&mailbox); -+#ifdef __WINDOWS__ -+ zsys_shutdown(); -+#endif - printf ("OK\n"); - } - ---- src/zyre_node.c -+++ src/zyre_node.c -@@ -1022,4 +1022,7 @@ - zsock_destroy (&pipe); - // Node takes ownership of outbox and destroys it -+#ifdef __WINDOWS__ -+ zsys_shutdown(); -+#endif - printf ("OK\n"); - } ---- src/zyre_peer.c -+++ src/zyre_peer.c -@@ -475,4 +475,7 @@ - zsock_destroy (&mailbox); - -+#ifdef __WINDOWS__ -+ zsys_shutdown(); -+#endif - printf ("OK\n"); - } diff --git a/recipes/zyre/all/patches/2.0.1-0001-cmake-use-conan-disable-executables.patch b/recipes/zyre/all/patches/2.0.1-0001-cmake-use-conan-disable-executables.patch index b13f4721e04bfe..156d0f5972669f 100644 --- a/recipes/zyre/all/patches/2.0.1-0001-cmake-use-conan-disable-executables.patch +++ b/recipes/zyre/all/patches/2.0.1-0001-cmake-use-conan-disable-executables.patch @@ -2,51 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index e285ba0..69f3c19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -126,33 +126,23 @@ set(OPTIONAL_LIBRARIES_STATIC) - ######################################################################## - # LIBZMQ dependency - ######################################################################## --find_package(libzmq REQUIRED) --IF (LIBZMQ_FOUND) -- include_directories(${LIBZMQ_INCLUDE_DIRS}) -- list(APPEND MORE_LIBRARIES ${LIBZMQ_LIBRARIES}) -- IF (PC_LIBZMQ_FOUND) -- set(pkg_config_names_private "${pkg_config_names_private} libzmq") -- list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_LIBZMQ_STATIC_LDFLAGS}) -- ELSE (PC_LIBZMQ_FOUND) -- set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq") -- ENDIF (PC_LIBZMQ_FOUND) --ELSE (LIBZMQ_FOUND) -+find_package(ZeroMQ REQUIRED) -+IF (ZEROMQ_FOUND) -+ include_directories(${CONAN_INCLUDE_DIRS_LIBZMQ}) -+ list(APPEND MORE_LIBRARIES ZeroMQ::ZeroMQ) -+ set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq") -+ELSE (ZEROMQ_FOUND) - message( FATAL_ERROR "libzmq not found." ) --ENDIF (LIBZMQ_FOUND) -+ENDIF (ZEROMQ_FOUND) - - ######################################################################## - # CZMQ dependency - ######################################################################## - find_package(czmq REQUIRED) - IF (CZMQ_FOUND) -- include_directories(${CZMQ_INCLUDE_DIRS}) -- list(APPEND MORE_LIBRARIES ${CZMQ_LIBRARIES}) -- IF (PC_CZMQ_FOUND) -- set(pkg_config_names_private "${pkg_config_names_private} libczmq") -- list(APPEND OPTIONAL_LIBRARIES_STATIC ${PC_CZMQ_STATIC_LDFLAGS}) -- ELSE (PC_CZMQ_FOUND) -- set(pkg_config_libs_private "${pkg_config_libs_private} -lczmq") -- ENDIF (PC_CZMQ_FOUND) -+ include_directories(${CONAN_INCLUDE_DIRS_CZMQ}) -+ list(APPEND MORE_LIBRARIES czmq::czmq) -+ set(pkg_config_libs_private "${pkg_config_libs_private} -lczmq") - ELSE (CZMQ_FOUND) - message( FATAL_ERROR "czmq not found." ) - ENDIF (CZMQ_FOUND) -@@ -237,6 +227,7 @@ if (ZYRE_BUILD_SHARED) +@@ -237,6 +237,7 @@ if (ZYRE_BUILD_SHARED) set_target_properties (zyre PROPERTIES PUBLIC_HEADER "${public_headers}" DEFINE_SYMBOL "ZYRE_EXPORTS" @@ -65,7 +21,7 @@ index e285ba0..69f3c19 100644 ######################################################################## # pkgconfig -@@ -360,6 +352,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zyreConfig.cmake +@@ -360,6 +362,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zyreConfig.cmake ######################################################################## # executables ######################################################################## @@ -73,7 +29,7 @@ index e285ba0..69f3c19 100644 add_executable( perf_local "${SOURCE_DIR}/src/perf_local.c" -@@ -491,6 +484,7 @@ target_link_libraries( +@@ -491,6 +494,7 @@ target_link_libraries( ${OPTIONAL_LIBRARIES} ) endif() @@ -81,7 +37,7 @@ index e285ba0..69f3c19 100644 if (NOT TARGET zyre AND TARGET zyre-static) target_link_libraries( zyre_selftest -@@ -501,6 +495,7 @@ target_link_libraries( +@@ -501,6 +515,7 @@ target_link_libraries( ${OPTIONAL_LIBRARIES_STATIC} ) endif() diff --git a/recipes/zyre/all/test_package/CMakeLists.txt b/recipes/zyre/all/test_package/CMakeLists.txt index cb1a41293b4f67..fb8dcf9d495581 100644 --- a/recipes/zyre/all/test_package/CMakeLists.txt +++ b/recipes/zyre/all/test_package/CMakeLists.txt @@ -1,10 +1,12 @@ -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(zyre CONFIG REQUIRED) +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) diff --git a/recipes/zyre/all/test_package/conanfile.py b/recipes/zyre/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/zyre/all/test_package/conanfile.py +++ b/recipes/zyre/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/zyre/all/test_package/test_package.cpp b/recipes/zyre/all/test_package/test_package.cpp index 7e0b34256ef831..1ec72703b4d641 100644 --- a/recipes/zyre/all/test_package/test_package.cpp +++ b/recipes/zyre/all/test_package/test_package.cpp @@ -5,7 +5,7 @@ int main(void) { uint64_t version = zyre_version(); - std::cout << "zyre version : " << version << std::endl; + std::cout << "zyre version : " << version << std::endl; return 0; } diff --git a/recipes/zyre/config.yml b/recipes/zyre/config.yml index 184166496d26e2..bb7eb85dfac498 100644 --- a/recipes/zyre/config.yml +++ b/recipes/zyre/config.yml @@ -1,5 +1,3 @@ versions: "2.0.1": folder: all - "2.0.0": - folder: all diff --git a/recipes/zziplib/all/conanfile.py b/recipes/zziplib/all/conanfile.py index 140fd9378eebde..bb584cb53822b6 100644 --- a/recipes/zziplib/all/conanfile.py +++ b/recipes/zziplib/all/conanfile.py @@ -49,7 +49,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def source(self): get(self, **self.conan_data["sources"][self.version],