diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 36565f4595195..fc765593075be 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 @@ -1162,3 +1133,136 @@ authorized_users: - tristanpenman - schmidjo82 - hiiizxf +- ftena +- tkhyn +- Hagartinger +- perseoGI +- krabbstek +- fcorso2016 +- seboste +- Sa3eedove +- cjbradfield +- ssrobins +- Ohjurot +- nbukuli +- ffabiomar +- 3d4m-volodymyr +- keyboardspecialist +- LvdStokker +- k-wasniowski +- ChrisThrasher +- ViktarHasiul231862 +- Becheler +- jalapenopuzzle +- HalfSweet +- CJCombrink +- nayyden +- wAuner +- m00z +- trns1997 +- GenuineAster +- Nachicle +- TrimbleAg +- ylatuya +- jabbas +- whaliendev +- AleksandraVolosevich-tomtom +- owenkellogg +- AndreaFinazzi +- 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 +- RMZeroFour +- rymut +- MartyMcFlyInTheSky +- piliugin-anton +- Drllap +- i-curve +- Mi-La +- gureedo +- cbaecker +- ErixenCruz +- OrianeGourdyStilla +- nikitasinys +- pgrossomoreira +- wu-vincent +- Inujel +- keszegrobert diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index 0a75bc37e02f5..13d3b1783e5d0 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -1,15 +1,22 @@ required_for_references: +- 7bitconf - 7bitdi +- 7zip - aaf - aaplus - abseil +- absent +- acado +- accellera-uvm-systemc - access_private - acl - ada - ade - aeron - aggeom-agg +- ags - alac +- alembic - alpaca - amgcl - amqp-cpp @@ -22,6 +29,8 @@ required_for_references: - apr - apr-util - apriltag +- aravis +- archicad-apidevkit - arcus - arduinojson - arg_router @@ -31,32 +40,59 @@ required_for_references: - args-parser - argtable2 - argtable3 +- armadillo +- arrow - arsenalgear +- artery-font-format - asio +- asio-grpc - asmjit +- asn1c +- assimp - astc-codec +- astro-informatics-so3 - async_simple +- asyncly - asyncplusplus - audiofile - autoconf +- autoconf-archive - automake +- avahi - avir +- aws-c-auth +- aws-c-cal - aws-c-common - aws-c-compression +- aws-c-event-stream +- 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 @@ -72,14 +108,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 @@ -90,27 +131,38 @@ required_for_references: - c-dbg-macro - c4core - caf +- cairomm - cajun-jsonapi - calceph - canary - canvas_ity - capnproto - capstone +- cargs +- cassandra-cpp-driver - catch2 +- cc65 - ccache - cccl +- ccfits - cctz - cd3-boost-unit-definitions - celero - cereal - ceres-solver +- certify - cfgfile - cfitsio +- cgal - cgif +- cglm +- cgltf - cgns +- chaiscript - charls - chef-fun - chipmunk2d +- choc - cimg - circularbuffer - cista @@ -120,12 +172,19 @@ required_for_references: - clara - 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 @@ -134,38 +193,74 @@ required_for_references: - commata - concurrencpp - concurrentqueue +- console_bridge +- continuable +- coost +- copypp +- corrade +- cose-c +- cotila +- coz - cpp-httplib +- cpp-ipc - cpp-jwt - cpp-lazy - cpp-optparse - cpp-peglib - cpp-sort +- cpp-validator +- cpp_project_framework - cppbenchmark - cppcheck +- cppcmd - cppcodec +- cppcommon +- cppdap - cppfront +- 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 - date - dav1d @@ -173,96 +268,192 @@ required_for_references: - daw_json_link - daw_utf_range - dbcppp +- dbg-macro - dbus +- dcmtk +- debug_assert - decimal_for_cpp +- deco +- dependencies +- detools +- dfp +- di +- dice-template-library +- dime +- directshowbaseclasses +- directx-headers - dirent - discount +- djinni-generator +- djinni-support-lib +- dlib - dlpack - docopt.cpp - doctest - double-conversion - doxygen +- dr_libs - draco - dragonbox - drflac - 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 - exprtk +- extra-cmake-modules - ezc3d - faac - 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 +- flint +- 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 +- gfortran - ghc-filesystem - giflib - ginkgo - 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 @@ -271,360 +462,966 @@ required_for_references: - gstreamer - 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 - highway - 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 +- influxdb-cpp +- 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 +- libelfin +- 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 +- libid3tag +- 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 - libtasn1 - libtiff +- libtins - libtool - libtorrent +- libucl - libudev +- libunistring - libunwind +- liburing - libusb +- libusb-compat - libuuid - libuv - libuvc +- libva +- libvault - libverto - libvips - libvpx +- libwebm - libwebp +- 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 +- lksctp-tools +- 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 +- premake +- 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 - rapidjson - rapidxml - rapidyaml +- raylib - re2 +- re2c +- reactiveplusplus +- read-excel - readerwriterqueue - readline - readosm +- recastnavigation +- reckless +- rectanglebinpack +- rectpack2d +- redboltz-mqtt_cpp +- redis-plus-plus +- refl-cpp +- reflect-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 +- tar - 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 +- watcher +- wavelet_buffer - wayland - wayland-protocols - 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 - xorg @@ -633,22 +1430,45 @@ required_for_references: - xorg-macros - xorg-makedepend - xorg-proto +- xorstr - xoshiro-cpp +- xpack +- xproperty +- xsd - xsimd - xtensor - xtl - xtrans - 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 ce17baffab669..6fd58a85275b0 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 1.59.0 + version: 1.61.0 artifactory: url: "https://c3i.jfrog.io/c3i" @@ -41,7 +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: 900 + large_timeout_references: + - boost + - qt + - llvm + parallel_strategy: unlimited cci: conan_v2_run_export: false write_comments: true @@ -51,25 +59,22 @@ 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 + windows_executors: 4 + open_docs_pull-request: true # 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] hrname: "Linux, GCC" content: - os: ["Linux"] @@ -80,7 +85,6 @@ configurations: compiler.version: ["5", "7", "9", "10", "11"] build_type: ["Release", "Debug"] - id: linux-clang - epochs: [20211221, 20220120] hrname: "Linux, Clang" content: - os: ["Linux"] @@ -91,47 +95,20 @@ configurations: 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] hrname: "macOS, Clang" - content: - - os: [ "Macos" ] - arch: [ "x86_64" ] - compiler: - - "apple-clang": - 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" + arch: "armv8" content: - os: [ "Macos" ] - arch: [ "armv8" ] + arch: [ "x86_64" ] compiler: - "apple-clang": - compiler.version: [ "12.0" ] + compiler.version: [ "13.0" ] compiler.libcxx: [ "libc++" ] build_type: [ "Release", "Debug" ] - id: macos-m1-clang - epochs: [20220120] hrname: "macOS, Clang (M1/arm64)" - build_profile: - os: "Macos" - arch: "x86_64" content: - os: [ "Macos" ] arch: [ "armv8" ] @@ -141,7 +118,6 @@ configurations: compiler.libcxx: [ "libc++" ] build_type: [ "Release", "Debug" ] - id: windows-visual_studio - epochs: [0, 20211221, 20220120] hrname: "Windows, Visual Studio" content: - os: [ "Windows" ] @@ -162,7 +138,7 @@ node_labels: Windows: x86_64: "Visual Studio": - default: "windows20221212" + default: "windows20230531" Macos: x86_64: "apple-clang": @@ -185,9 +161,9 @@ pod_size: # - name/version notation takes preference over the name only one # - Both notations can be combined for the same reference name large: - - "pcl" - "duckdb" - "ceres-solver" xlarge: - "llvm" - "opengv" + - "pcl" diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index 2138c690b60a9..14bd7fa1314b4 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.4 + 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" @@ -11,16 +19,11 @@ artifactory: pull-request_repo_prefix: "c3i_PR-v2" pull-request_permission: "c3i-pr" logs_repo: "misc-v2" - # cache_repo: "cache" github: reviewers: "reviewers.yml" authorized_users: "authorized_users.yml" -#slack: -# credential_success_url: SLACK_SUCCESS_WEBHOOK_URL -# ceredential_errors_url: SLACK_FAILURE_WEBHOOK_URL - # Things related to Jenkins jobs: tasks: automatic_merge: @@ -29,6 +32,16 @@ tasks: access_request: request_issue_url: https://github.com/conan-io/conan-center-index/issues/4 max_inactivity_days: 0 + build_single_reference: + package_id_cache_type: "none" + timeout_minutes: 600 + large_timeout_minutes: 900 + large_timeout_references: + - boost + - qt + - llvm + - gstreamer + parallel_strategy: unlimited cci: conan_v2_run_export: false detailed_status_checks: false @@ -36,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: @@ -47,10 +60,13 @@ tasks: scheduled_export_check: report_issue_url: https://github.com/conan-io/conan-center-index/issues/15557 report_issue_append: false + validate_infrastructure: + macos_executors: 2 + windows_executors: 4 + open_docs_pull-request: false configurations: - id: linux-gcc - epochs: [0, 20211221, 20220120, 20220628] hrname: "Linux, GCC" build_profile: os: "Linux" @@ -63,10 +79,10 @@ configurations: compiler.version: ["11"] build_type: ["Release"] - id: macos-clang - epochs: [0, 20211221, 20220120, 20220628] hrname: "macOS, Clang" build_profile: os: "Macos" + arch: "armv8" content: - os: [ "Macos" ] arch: [ "x86_64" ] @@ -76,11 +92,10 @@ configurations: compiler.libcxx: [ "libc++" ] build_type: [ "Release"] - id: macos-m1-clang - epochs: [0, 20211221, 20220120, 20220628] hrname: "macOS M1, Clang" build_profile: os: "Macos" - arch: "x86_64" + arch: "armv8" content: - os: [ "Macos" ] arch: [ "armv8" ] @@ -90,7 +105,6 @@ configurations: compiler.libcxx: [ "libc++" ] build_type: [ "Release"] - id: windows-msvc - epochs: [0, 20211221, 20220120, 20220628] hrname: "Windows, MSVC" build_profile: os: "Windows" @@ -99,7 +113,7 @@ configurations: arch: [ "x86_64" ] compiler: - "msvc": - compiler.version: [ "192" ] + compiler.version: [ "192", "193" ] build_type: - "Release": compiler.runtime: ["dynamic"] @@ -109,9 +123,10 @@ cppstd: apple-clang: "13": ["17", "gnu17", "20", "gnu20"] gcc: - "11": ["17", "gnu17", "20", "gnu20"] + "11": ["17", "gnu17", "20", "gnu20", "23", "gnu23"] msvc: "192": ["14", "17", "20"] + "193": ["14", "17", "20"] jenkins: url: "http://mb-jenkins-my-bloody-jenkins:8080" @@ -120,7 +135,7 @@ node_labels: Windows: x86_64: "msvc": - default: "windows20221212" + default: "windows20230531" Macos: x86_64: "apple-clang": @@ -134,3 +149,12 @@ node_labels: default: "linux_gcc_${compiler.version}_ubuntu16.04" "clang": default: "linux_clang_${compiler.version}_ubuntu16.04" + + +pod_size: + # Map with references that need special memory resources to compile. + # - Can be only by name or by name/version. + # - name/version notation takes preference over the name only one + # - Both notations can be combined for the same reference name + xlarge: + - "pcl" diff --git a/.c3i/reviewers.yml b/.c3i/reviewers.yml index 6c7ecd5befbc8..3578b7dccdc68 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 7dcd6dc6c89c7..405926199ff5e 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: @@ -381,6 +381,11 @@ jobs: files: "recipes/snappy/*/*" reviewers: "@Hopobcn" + - uses: ./.github/actions/alert-community + with: + files: "recipes/snowhouse/*/*" + reviewers: "@MartinDelille" + - uses: ./.github/actions/alert-community with: files: "recipes/uncrustify/*/*" @@ -425,3 +430,8 @@ jobs: with: files: "recipes/zstd/*/*" reviewers: "@Hopobcn" + + - uses: ./.github/actions/alert-community + with: + files: "recipes/libhal/*/*" + reviewers: "@kammce" diff --git a/.gitignore b/.gitignore index b2733bea8c3a6..4955b6cd850e6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ **/test_package/build-*/ **/test_package/test_output/ conan.lock +conanbuildinfo.cmake conanbuildinfo.txt conaninfo.txt graph_info.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e3e7f52de2da8..6e24832e93e98 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 39acf20a7aebd..0000000000000 --- 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 3f310562fdf6a..409f61c38fc0e 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 e1b7f89ee3173..ed96865802cc0 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 66bd21cf8d8b9..fb7a767a13b95 100644 --- a/docs/adding_packages/conanfile_attributes.md +++ b/docs/adding_packages/conanfile_attributes.md @@ -49,13 +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. -* When no license is provided or it's under the ["public domain"](https://fairuse.stanford.edu/overview/public-domain/welcome/) - these are not a license by itself. Thus, we have [equivalent licenses](https://en.wikipedia.org/wiki/Public-domain-equivalent_license) that should be used instead. If a project falls under these criteria it should be identified as the [Unlicense](https://spdx.org/licenses/Unlicense) license. -* 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 a45c6c0f3c31c..a69f895483ed0 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 0136f36792b5b..b5a51c8d60309 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 66f10a1232726..56ff5130c26e4 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 1f0425119cede..10cbbd6810dde 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,79 @@ # Changelog +### 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. +- [fix] Waiting for Conan 2.x result after building Conan 1.x. +- [fix] Bump version should not be tagged when removing old versions. +- [feature] Improve internal logs to get more information about epochs. +- [feature] Add an option to disable some jobs. +- [feature] Disable branch indexing job runs on cci multibranch job. +- [feature] Enable Conan 2.0.8 + ### 04-May-2023 - 16:05 CEST - [bugfix] Fix cppstd issues when selecting the value to use in profiles. diff --git a/docs/developing_recipes_locally.md b/docs/developing_recipes_locally.md index e34902537f2b6..2d101facc3b5e 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 b84d6e6a09102..8fc8cb331f121 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 0719baa9da770..0d8464ec8e6f0 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 47f9a403b5cf1..9635abc398ca9 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 d742678fc6e67..b1b30db795a84 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 51ea9a72fb954..6e443b6024963 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 ef4bad7fd4d3b..617e18d12f4ad 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 61b7b28c28d9d..8adddf3b7b73c 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 5fd9fc9251d3e..ca164fc1620f8 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 15b25667576d6..69086f9b189e8 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 8a52bdeb5c74f..aa042fd087498 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 55eadf1bd0738..cf9d98f130d9b 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/docs/v2_migration.md b/docs/v2_migration.md index 629cef881ac0e..9139fefbde135 100644 --- a/docs/v2_migration.md +++ b/docs/v2_migration.md @@ -124,18 +124,11 @@ don't listen to `cpp_info`'s ``.names``, ``.filenames`` or ``.build_modules`` at There is a new way of setting the `cpp_info` information with these generators using the ``set_property(property_name, value)`` method. -All the information in the recipes, already set with the current model, should be -translated to the new model. These two models **will live together in recipes** to make -recipes compatible **with both new and current generators** for some time. +Both of these two models **will live together in recipes** to make +recipes compatible for both 1.x and 2.0 users. Deprecated feilds are not to be removed at this time. -We will cover some cases of porting all the information set with the current model to the -new one. To read more about the properties available for each generator and how the -properties model work, please check the [Conan documentation](https://docs.conan.io/1/migrating_to_2.0/properties.html). - -> **Note**: Please, remember that the **new** ``set_property`` and the **current** attributes -> model are *completely independent since Conan 1.43*. Setting ``set_property`` in recipes will -> not affect current CMake 1.X generators (``cmake``, ``cmake_multi``, ``cmake_find_package`` and -> ``cmake_find_package_multi``) at all. +To understand the impact of these and the relation between different generates, refer to the +[migrating properties](https://docs.conan.io/1/migrating_to_2.0/properties.html) documentation. ### Translating .names information to cmake_target_name, cmake_module_target_name and cmake_file_name @@ -147,62 +140,8 @@ As for `filenames`, refer to [this section](https://docs.conan.io/1/migrating_to ### Translating .build_modules to cmake_build_modules -The declared `.build_modules` come from the original package that declares useful CMake functions, variables -etc. We need to use the property `cmake_build_modules` to declare a list of cmake files instead of using `cpp_info.build_modules`: - -```python -class PyBind11Conan(ConanFile): - name = "pybind11" - ... - - def package_info(self): - ... - for generator in ["cmake_find_package", "cmake_find_package_multi"]: - self.cpp_info.components["main"].build_modules[generator].append(os.path.join("lib", "cmake", "pybind11", "pybind11Common.cmake")) - ... - -``` - -To translate this information to the new model we declare the `cmake_build_modules` property in the `root cpp_info` object: - -```python -class PyBind11Conan(ConanFile): - name = "pybind11" - ... - - def package_info(self): - ... - self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "cmake", "pybind11", "pybind11Common.cmake")]) - ... - -``` +The variation of `build_modules` is covered by the [Conan documentation](https://docs.conan.io/1/migrating_to_2.0/properties.html#translating-build-modules-to-cmake-build-modules). ### PkgConfigDeps -The current [pkg_config](https://docs.conan.io/1/reference/generators/pkg_config.html) -generator suports the new ``set_property`` model for most of the properties. Then, the current -model can be translated to the new one without having to leave the old attributes in the -recipes. Let's see an example: - -```python -class AprConan(ConanFile): - name = "apr" - ... - def package_info(self): - self.cpp_info.names["pkg_config"] = "apr-1" - ... -``` - -In this case, you can remove the ``.names`` attribute and just leave: - -```python -class AprConan(ConanFile): - name = "apr" - ... - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "apr-1") - ... -``` - -For more information about properties supported by ``PkgConfigDeps`` generator, please check the [Conan -documentation](https://docs.conan.io/1/reference/conanfile/tools/gnu/pkgconfigdeps.html#properties). +For migrating, `names` used with `pkg_config`, see [Conan documentation](https://docs.conan.io/1/migrating_to_2.0/properties.html#migration-from-names-to-pkg-config-name) diff --git a/linter/check_package_name.py b/linter/check_package_name.py index 9068241f96b18..4c302243ff26c 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 9e7133803906e..51d27b850beec 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 new file mode 100644 index 0000000000000..71f022ca93c84 --- /dev/null +++ b/recipes/7bitconf/all/conandata.yml @@ -0,0 +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 new file mode 100644 index 0000000000000..4865b328bad13 --- /dev/null +++ b/recipes/7bitconf/all/conanfile.py @@ -0,0 +1,139 @@ +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 +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class SevenBitConfConan(ConanFile): + name = "7bitconf" + homepage = "https://github.com/7bitCoder/7bitConf" + description = "7bitConf is a simple C++17 centralized configuration provider library." + topics = ("cpp17", "configuration", "provider", "configuration-files") + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "header_only": [True, False], + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "header_only": False, + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "14", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "10", + } + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def configure(self): + if self.options.get_safe("shared") or self.options.header_only: + self.options.rm_safe("fPIC") + if self.options.header_only: + self.options.rm_safe("shared") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("taocpp-json/1.0.0-beta.14", transitive_headers=True) + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def validate(self): + compiler = self.settings.compiler + compiler_name = str(compiler) + + if compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._minimum_compilers_version.get(compiler_name, False) + if minimum_version and Version(compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"Requires compiler {compiler_name} minimum version: {minimum_version} with C++17 support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not self.options.header_only: + tc = CMakeToolchain(self) + tc.variables["_7BIT_CONF_BUILD_EXAMPLES"] = False + tc.variables["_7BIT_CONF_BUILD_TESTS"] = False + tc.variables["_7BIT_CONF_BUILD_SINGLE_HEADER"] = False + tc.variables["_7BIT_CONF_INSTALL"] = True + tc.variables["_7BIT_CONF_LIBRARY_TYPE"] = self.getSevenBitConfLibraryType() + tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + + def getSevenBitConfLibraryType(self): + if self.options.header_only: + return "HeaderOnly" + if self.options.shared: + return "Shared" + return "Static" + + def build(self): + if not self.options.header_only: + 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, + ) + if self.options.header_only: + copy( + self, + src=os.path.join(self.source_folder, "Include"), + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + ) + else: + 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", "7bitConf") + self.cpp_info.set_property("cmake_target_name", "7bitConf::7bitConf") + self.cpp_info.requires = ["taocpp-json::taocpp-json"] + + if self.options.header_only: + self.cpp_info.libs = [] + self.cpp_info.bindirs = [] + else: + suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["7bitConf" + suffix] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/7bitconf/all/test_package/CMakeLists.txt b/recipes/7bitconf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c27c6a95e062c --- /dev/null +++ b/recipes/7bitconf/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(7bitConf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PUBLIC 7bitConf::7bitConf) + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/7bitconf/all/test_package/conanfile.py b/recipes/7bitconf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49854c6d47088 --- /dev/null +++ b/recipes/7bitconf/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout + + +class TestPackageConan(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") + diff --git a/recipes/7bitconf/all/test_package/test_package.cpp b/recipes/7bitconf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a1d4cb2de73d8 --- /dev/null +++ b/recipes/7bitconf/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include + +int main(int argc, char **argv) { + + auto configuration = sb::cf::ConfigurationBuilder{} + .addAppSettings() + .addCommandLine(argc, argv) + .addJson({{"setting", "value"}}) + .build(); + + std::cout << "7bitconf version: " << _7BIT_CONF_VERSION << std::endl + << "Configuration json: " << std::endl + << *configuration << std::endl; + + return 0; +} diff --git a/recipes/7bitconf/config.yml b/recipes/7bitconf/config.yml new file mode 100644 index 0000000000000..73c245662b08d --- /dev/null +++ b/recipes/7bitconf/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.0": + folder: all + "1.0.0": + folder: all diff --git a/recipes/7bitdi/all/conandata.yml b/recipes/7bitdi/all/conandata.yml index 2bc8fbc5ed01d..d7e7e7fe4e22e 100644 --- a/recipes/7bitdi/all/conandata.yml +++ b/recipes/7bitdi/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v2.0.0.tar.gz" + sha256: "ae6d01c677b928a9c0979b9b2395692f9a3d876e07189d9b191e7b55c13d9ef4" "1.0.0": url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v1.0.0.tar.gz" sha256: "4a5bfc541bf98b9943a54003c7ad1f8a2a3f879143022be805aaa343852d8279" diff --git a/recipes/7bitdi/config.yml b/recipes/7bitdi/config.yml index 40341aa3db6cd..870fb33e55af0 100644 --- a/recipes/7bitdi/config.yml +++ b/recipes/7bitdi/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.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 0d36819b4de39..e62dc40aa34ed 100644 --- a/recipes/7zip/19.00/conandata.yml +++ b/recipes/7zip/19.00/conandata.yml @@ -1,4 +1,16 @@ 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 + - https://sourceforge.net/projects/sevenzip/files/7-Zip/22.01/7z2201-src.tar.xz + sha256: "393098730c70042392af808917e765945dc2437dee7aae3cfcc4966eb920fbc5" "19.00": - url: https://www.7-zip.org/a/7z1900-src.7z + url: + - https://www.7-zip.org/a/7z1900-src.7z + - https://sourceforge.net/projects/sevenzip/files/7-Zip/19.00/7z1900-src.7z sha256: "9ba70a5e8485cf9061b30a2a84fe741de5aeb8dd271aab8889da0e9b3bf1868e" diff --git a/recipes/7zip/19.00/conanfile.py b/recipes/7zip/19.00/conanfile.py index d18ee2242a6e7..b1fa099b52650 100644 --- a/recipes/7zip/19.00/conanfile.py +++ b/recipes/7zip/19.00/conanfile.py @@ -1,20 +1,25 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import download, chdir, replace_in_file -from conans import tools, AutoToolsBuildEnvironment +from conan.tools.files import copy, chdir, download, get, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeToolchain +from conan.tools.scm import Version + import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.55.0" class SevenZipConan(ConanFile): name = "7zip" url = "https://github.com/conan-io/conan-center-index" description = "7-Zip is a file archiver with a high compression ratio" - license = ("LGPL-2.1", "BSD-3-Clause", "Unrar") + license = ("LGPL-2.1-or-later", "BSD-3-Clause", "Unrar") homepage = "https://www.7-zip.org" - topics = ("7zip", "zip", "compression", "decompression") - settings = "os", "arch", "compiler" + topics = ("archive", "compression", "decompression", "zip") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" @property def _settings_build(self): @@ -26,26 +31,42 @@ def validate(self): if self.settings.arch not in ("x86", "x86_64"): raise ConanInvalidConfiguration("Unsupported architecture") + def layout(self): + basic_layout(self, src_folder="src") + def build_requirements(self): - self.build_requires("lzma_sdk/9.20") + if Version(self.version) < "22": + self.build_requires("lzma_sdk/9.20") - if self.settings.compiler != "Visual Studio" and self._settings_build.os == "Windows" and "make" not in os.environ.get("CONAN_MAKE_PROGRAM", ""): + if not is_msvc(self) and self._settings_build.os == "Windows" and "make" not in os.environ.get("CONAN_MAKE_PROGRAM", ""): self.build_requires("make/4.3") def package_id(self): + del self.info.settings.build_type del self.info.settings.compiler - def _uncompress_7z(self, filename): - self.run(f"7zr x {filename}") - def source(self): - from six.moves.urllib.parse import urlparse - url = self.conan_data["sources"][self.version]["url"] - filename = os.path.basename(urlparse(url).path) - sha256 = self.conan_data["sources"][self.version]["sha256"] - download(self, url, filename, sha256) - self._uncompress_7z(filename) - os.unlink(filename) + if Version(self.version) < "22": + item = self.conan_data["sources"][self.version] + filename = "7z-source.7z" + download(self, **item, filename=filename) + sevenzip = os.path.join(self.dependencies.build["lzma_sdk"].package_folder, "bin", "7zr.exe") + self.run(f"{sevenzip} x {filename}") + os.unlink(filename) + else: + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + tc.environment().define("IS_MINGW", "1") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() @property def _msvc_platform(self): @@ -55,47 +76,46 @@ def _msvc_platform(self): }[str(self.settings.arch)] def _build_msvc(self): - with tools.vcvars(self.settings): - with chdir(self, os.path.join("CPP", "7zip")): - self.run(f"nmake /f makefile PLATFORM={self._msvc_platform}") + self.run(f"nmake /f makefile PLATFORM={self._msvc_platform}", cwd=os.path.join(self.source_folder, "CPP", "7zip")) def _build_autotools(self): # TODO: Enable non-Windows methods in configure - autotools = AutoToolsBuildEnvironment(self) - extra_env = {} - if self.settings.os == "Windows" and self.settings.compiler == "gcc": - extra_env["IS_MINGW"] = "1" - with tools.environment_append(extra_env): - with chdir(self, os.path.join("CPP", "7zip", "Bundles", "LzmaCon")): - autotools.make(args=["-f", "makefile.gcc"], target="all") + autotools = Autotools(self) + with chdir(self, os.path.join(self.source_folder, "CPP", "7zip", "Bundles", "LzmaCon")): + autotools.make(args=["-f", "makefile.gcc"], target="all") def _patch_sources(self): - if self.settings.compiler == "Visual Studio": - fn = os.path.join("CPP", "Build.mak") + if is_msvc(self): + fn = os.path.join(self.source_folder, "CPP", "Build.mak") 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() - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self._build_msvc() else: self._build_autotools() def package(self): - self.copy("DOC/License.txt", src="", dst="licenses") - self.copy("DOC/unRarLicense.txt", src="", dst="licenses") + copy(self, "License.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "DOC")) + copy(self, "unRarLicense.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "DOC")) if self.settings.os == "Windows": - self.copy("*.exe", src="CPP/7zip", dst="bin", keep_path=False) - self.copy("*.dll", src="CPP/7zip", dst="bin", keep_path=False) - + copy(self, "*.exe", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "CPP", "7zip"), keep_path=False) + copy(self, "*.dll", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "CPP", "7zip"), keep_path=False) # TODO: Package the libraries: binaries and headers (add the rest of settings) def package_info(self): 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.cpp_info.includedirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/7zip/19.00/test_package/conanfile.py b/recipes/7zip/19.00/test_package/conanfile.py index f6a6ccb388a8e..19851f5658605 100644 --- a/recipes/7zip/19.00/test_package/conanfile.py +++ b/recipes/7zip/19.00/test_package/conanfile.py @@ -1,9 +1,15 @@ -from conans import ConanFile, tools +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): + if can_run(self): self.run("7z.exe") diff --git a/recipes/7zip/19.00/test_v1_package/conanfile.py b/recipes/7zip/19.00/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e5371836902a7 --- /dev/null +++ b/recipes/7zip/19.00/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile +from conan.tools.build import can_run + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if can_run(self): + self.run("7z.exe", run_environment=True) diff --git a/recipes/7zip/config.yml b/recipes/7zip/config.yml index 46489517ceb78..5f2a8f313a5d8 100644 --- a/recipes/7zip/config.yml +++ b/recipes/7zip/config.yml @@ -1,3 +1,7 @@ versions: + "23.01": + folder: "19.00" + "22.01": + folder: "19.00" "19.00": folder: "19.00" diff --git a/recipes/aaf/all/conanfile.py b/recipes/aaf/all/conanfile.py index 358a4f96210ec..ee7906ff05936 100644 --- a/recipes/aaf/all/conanfile.py +++ b/recipes/aaf/all/conanfile.py @@ -18,6 +18,7 @@ class AafConan(ConanFile): ) topics = ("multimedia", "crossplatform") license = "AAFSDKPSL-2.0" + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { @@ -37,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) @@ -84,9 +85,12 @@ def package(self): def package_info(self): if self.settings.os == "Windows": suffix = "D" if self.settings.build_type == "Debug" else "" - self.cpp_info.libs = [f"AAF{suffix}", f"AAFIID{suffix}", "AAFCOAPI"] + self.cpp_info.libs = [f"AAF{suffix}", f"AAFIID{suffix}"] + # The static library loads a DLL at runtime, on Windows it needs to be able + # to find it in PATH, see https://aaf.sourceforge.net/AAFProjectFAQ.html + self.runenv_info.prepend_path("PATH", os.path.join(self.package_folder, "bin")) else: - self.cpp_info.libs = ["aaflib", "aafiid", "com-api"] + self.cpp_info.libs = ["aaflib", "aafiid"] if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["dl"] elif is_apple_os(self): diff --git a/recipes/aaplus/all/conandata.yml b/recipes/aaplus/all/conandata.yml index f1c7c0805bfae..4e0f826f773b4 100644 --- a/recipes/aaplus/all/conandata.yml +++ b/recipes/aaplus/all/conandata.yml @@ -1,7 +1,12 @@ sources: + "2.53": + url: "http://www.naughter.com/download/aaplus_v2.53.zip" + sha256: "8b06f597535c1750dba71186e991561adb6c5e2d9678e258a3f7d6bdd0e4fda6" "2.41": url: "http://www.naughter.com/download/aaplus_v2.41.zip" sha256: "7aede2802f3542c91eeefa0cdd4419911c7547073c84a6faa4bf31f6b6f172da" patches: + "2.53": + - patch_file: "patches/0001-fix-cmake.patch" "2.41": - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/aaplus/config.yml b/recipes/aaplus/config.yml index 9e92b3b5d3553..c2d9de5dda8c1 100644 --- a/recipes/aaplus/config.yml +++ b/recipes/aaplus/config.yml @@ -1,3 +1,5 @@ versions: + "2.53": + folder: all "2.41": folder: all diff --git a/recipes/abseil/all/conandata.yml b/recipes/abseil/all/conandata.yml index 26d7ab5e3cd64..1f04efd630a51 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 1705dce38f64f..b7ffcdd9c1625 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 a3b8fb54c4699..0000000000000 --- 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 b21d60b80ba1b..0000000000000 --- 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 0000000000000..22d29acea39d9 --- /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 00042089d1476..0000000000000 --- 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 cabbdbc8eaa57..0000000000000 --- 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 fab934c4ee8b8..0000000000000 --- 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 0000000000000..fcb5987e76570 --- /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 b44abb830b77f..a5bf2303085d1 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/absent/all/conanfile.py b/recipes/absent/all/conanfile.py index bdc5f5e18836b..89db056b9c57b 100644 --- a/recipes/absent/all/conanfile.py +++ b/recipes/absent/all/conanfile.py @@ -1,8 +1,14 @@ -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 +from conan.tools.files import 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 -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class AbsentConan(ConanFile): @@ -15,13 +21,13 @@ class AbsentConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "MIT" topics = ("nullable-types", "composition", "monadic-interface", "declarative-programming") + package_type = "header-library" no_copy_source = True settings = "os", "arch", "compiler", "build_type" - generators = "cmake" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -29,47 +35,49 @@ def _compilers_minimum_version(self): "gcc": "7", "clang": "5", "apple-clang": "10", - "Visual Studio": "15.7", } - 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] + def layout(self): + cmake_layout(self, src_folder="src") - 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) - ) + 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 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.generate() - def _configure_cmake(self): + def build(self): cmake = CMake(self) - cmake.definitions["BUILD_TESTS"] = "OFF" - cmake.configure(source_folder=self._source_subfolder) - return cmake + cmake.configure() + # header_only - no 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.set_property("cmake_file_name", "absent") self.cpp_info.set_property("cmake_target_name", "rvarago::absent") + self.cpp_info.components["absentlib"].set_property("cmake_target_name", "rvarago::absent") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed self.cpp_info.components["absentlib"].bindirs = [] self.cpp_info.components["absentlib"].frameworkdirs = [] @@ -83,4 +91,3 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "rvarago" self.cpp_info.components["absentlib"].names["cmake_find_package"] = "absent" self.cpp_info.components["absentlib"].names["cmake_find_package_multi"] = "absent" - self.cpp_info.components["absentlib"].set_property("cmake_target_name", "rvarago::absent") diff --git a/recipes/absent/all/test_package/CMakeLists.txt b/recipes/absent/all/test_package/CMakeLists.txt index fe998526125cb..a092e06169aaf 100644 --- a/recipes/absent/all/test_package/CMakeLists.txt +++ b/recipes/absent/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(absent REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/absent/all/test_package/conanfile.py b/recipes/absent/all/test_package/conanfile.py index 38f4483872d47..02eb5ce439fb4 100644 --- a/recipes/absent/all/test_package/conanfile.py +++ b/recipes/absent/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_layout, CMake import os +# It will become the standard on Conan 2.x 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 +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): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/absent/all/test_v1_package/CMakeLists.txt b/recipes/absent/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..fb3acbf709bdb --- /dev/null +++ b/recipes/absent/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(absent 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} rvarago::absent) diff --git a/recipes/aws-c-common/all/test_v1_package/conanfile.py b/recipes/absent/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/aws-c-common/all/test_v1_package/conanfile.py rename to recipes/absent/all/test_v1_package/conanfile.py diff --git a/recipes/acado/all/CMakeLists.txt b/recipes/acado/all/CMakeLists.txt deleted file mode 100644 index bdffdd1faa9c7..0000000000000 --- 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 d944291553890..c37969b71a13d 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 b0f501df26562..648b840430e1f 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 d9e09e4b5548b..96a368dbfe81f 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 0000000000000..fd5828c4a2a61 --- /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 29d9de3546c79..4aa2d543607d9 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 3cdacb96b0c8c..7019a80802df9 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 0000000000000..91630d79f4abb --- /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 0000000000000..e34dbc52de848 --- /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 15689e9fd7ded..edae984b0d813 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 29a5f29bd6062..0dbdd7f01d340 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 7c46504cf008f..ef5d7042163ec 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 db58543c27400..47640ade3dcac 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 0000000000000..91630d79f4abb --- /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 0000000000000..7c46504cf008f --- /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/access_private/all/conanfile.py b/recipes/access_private/all/conanfile.py index da35dc6ea7e6e..f7bfa16e97f6c 100644 --- a/recipes/access_private/all/conanfile.py +++ b/recipes/access_private/all/conanfile.py @@ -11,12 +11,17 @@ class AccessPrivateConan(ConanFile): name = "access_private" description = "Access private members and statics of a C++ class" license = "MIT" - topics = ("access", "private", "header-only") - homepage = "https://github.com/martong/access_private" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martong/access_private" + topics = ("access", "private", "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() @@ -24,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 diff --git a/recipes/access_private/all/test_v1_package/CMakeLists.txt b/recipes/access_private/all/test_v1_package/CMakeLists.txt index 01b3a8050e773..91630d79f4abb 100644 --- a/recipes/access_private/all/test_v1_package/CMakeLists.txt +++ b/recipes/access_private/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(access_private REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE access_private::access_private) -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/ada/all/conandata.yml b/recipes/ada/all/conandata.yml index d0ba115e7230a..e07ea43a3e678 100644 --- a/recipes/ada/all/conandata.yml +++ b/recipes/ada/all/conandata.yml @@ -1,22 +1,37 @@ 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" + "2.5.0": + url: "https://github.com/ada-url/ada/archive/v2.5.0.tar.gz" + sha256: "bf11c9d0cc1ee9e377080bdd8a3b8a8bf736ac7acaedcae882587e21b3e5625c" "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 dcb06ed03de1a..68040e8519671 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 635bf97e9cb5b..e97d7f2aa5a29 100644 --- a/recipes/ada/config.yml +++ b/recipes/ada/config.yml @@ -1,15 +1,25 @@ versions: - "2.4.2": + "2.7.4": + folder: all + "2.7.3": + folder: all + "2.7.2": + folder: all + "2.7.0": folder: all - "2.4.1": + "2.6.10": folder: all - "2.4.0": + "2.6.7": folder: all - "2.3.1": + "2.6.4": folder: all - "2.3.0": + "2.6.2": folder: all - "2.2.0": + "2.6.0": folder: all - "2.0.0": + "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 954c10dfe2c1d..0ce2795d9939c 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/all/conanfile.py b/recipes/ade/all/conanfile.py index 56f8248013585..2e4dc8aa99a3a 100644 --- a/recipes/ade/all/conanfile.py +++ b/recipes/ade/all/conanfile.py @@ -16,6 +16,7 @@ class AdeConan(ConanFile): description = "Graph construction, manipulation, and processing framework" topics = ("graphs", "opencv") + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], diff --git a/recipes/ade/all/test_v1_package/CMakeLists.txt b/recipes/ade/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/ade/all/test_v1_package/CMakeLists.txt +++ b/recipes/ade/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/ade/config.yml b/recipes/ade/config.yml index cbf2f373fb630..922bcf0946745 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 a888d0c721120..c3ee6521cf6a5 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 aef0519cfd69a..813ca895247cd 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 0d20897301b68..91630d79f4abb 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 0c20e51036f8b..9f6aea7a8f54b 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 8b26697b0ef0d..9203b7fc5e424 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 55a67e88a5f75..de0179059224e 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 0d20897301b68..91630d79f4abb 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 cfb13334b8b03..54947af157488 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 80c23a11369cc..85726b0fe607b 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 ce3253516ac16..40fbf18e98b65 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 523fab4f02b6a..1a7621b5c42d8 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 c08206c505563..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..d026b4c142f4c --- /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 a799261020b31..df03f21bccdc5 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/alac/all/conanfile.py b/recipes/alac/all/conanfile.py index 03e8814c8b1fd..852e6b7782c8e 100644 --- a/recipes/alac/all/conanfile.py +++ b/recipes/alac/all/conanfile.py @@ -1,10 +1,9 @@ from conan import ConanFile, conan_version from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get -from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class AlacConan(ConanFile): @@ -12,10 +11,11 @@ class AlacConan(ConanFile): description = "The Apple Lossless Audio Codec (ALAC) is a lossless audio " \ "codec developed by Apple and deployed on all of its platforms and devices." license = "Apache-2.0" - topics = ("alac", "audio-codec") - homepage = "https://macosforge.github.io/alac" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://macosforge.github.io/alac" + topics = ("audio-codec") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -28,7 +28,8 @@ class AlacConan(ConanFile): "utility": True, } - exports_sources = "CMakeLists.txt" + 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": @@ -36,17 +37,13 @@ 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 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,5 +64,8 @@ def package(self): def package_info(self): self.cpp_info.libs = ["alac"] - if Version(conan_version).major < 2 and self.options.utility: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if conan_version.major < 2 and self.options.utility: self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/alac/all/test_v1_package/CMakeLists.txt b/recipes/alac/all/test_v1_package/CMakeLists.txt index 6e042a1c74181..91630d79f4abb 100644 --- a/recipes/alac/all/test_v1_package/CMakeLists.txt +++ b/recipes/alac/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(alac REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE alac::alac) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/alembic/all/conandata.yml b/recipes/alembic/all/conandata.yml index bf7fb209af8bc..cc8bcf0f12467 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 73264829b63a3..81ce4ae17f4f7 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 0000000000000..c048ccd304a2e --- /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 0d20897301b68..b21cc49efde95 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 68197c279a4ee..079098b5ad92b 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/alpaca/all/conanfile.py b/recipes/alpaca/all/conanfile.py index a7227d4427d29..02d46c1a923f7 100644 --- a/recipes/alpaca/all/conanfile.py +++ b/recipes/alpaca/all/conanfile.py @@ -7,17 +7,21 @@ from conan.tools.scm import Version import os - required_conan_version = ">=1.52.0" class AlpacaConan(ConanFile): name = "alpaca" - description = "Serialization library written in C++17 - Pack C++ structs into a compact byte-array without any macros or boilerplate code" + description = ( + "Serialization library written in C++17 - " + "Pack C++ structs into a compact byte-array without any macros or boilerplate code" + ) license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/p-ranav/alpaca" topics = ("reflection", "checksum", "serialization", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -51,7 +55,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/alpaca/all/test_package/test_package.cpp b/recipes/alpaca/all/test_package/test_package.cpp index 0134e1d6e0d2d..c1126e0786194 100644 --- a/recipes/alpaca/all/test_package/test_package.cpp +++ b/recipes/alpaca/all/test_package/test_package.cpp @@ -1,11 +1,11 @@ #include struct Config { - std::string device; - std::pair resolution; - std::array K_matrix; - std::vector distortion_coeffients; - std::map> parameters; + std::string device; + std::pair resolution; + std::array K_matrix; + std::vector distortion_coeffients; + std::map> parameters; }; int main() { @@ -32,4 +32,3 @@ int main() { } return 0; } - diff --git a/recipes/alpaca/all/test_v1_package/CMakeLists.txt b/recipes/alpaca/all/test_v1_package/CMakeLists.txt index 0aeb3e1d92584..91630d79f4abb 100644 --- a/recipes/alpaca/all/test_v1_package/CMakeLists.txt +++ b/recipes/alpaca/all/test_v1_package/CMakeLists.txt @@ -1,6 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES C) # if the project is pure C -project(test_package LANGUAGES CXX) # if the project uses c++ +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) diff --git a/recipes/amqp-cpp/all/conandata.yml b/recipes/amqp-cpp/all/conandata.yml index d5f7ffbc385d2..d9636b6750c96 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 c1e0ec3696e4e..3e26ef28cb261 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 f47d6bd4b19df..0000000000000 --- 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 0000000000000..4fd90bf502649 --- /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 0000000000000..a27f553a66fa5 --- /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 0000000000000..935f6704ae4e7 --- /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 0000000000000..69dd45f821f96 --- /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 3ab0f79114118..0000000000000 --- 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 0000000000000..1e75ea7e91ac0 --- /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 0000000000000..98c5524cc4932 --- /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 31f91dc40c919..3cdf4ddfdb5a3 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/andreasbuhr-cppcoro/all/CMakeLists.txt b/recipes/andreasbuhr-cppcoro/all/CMakeLists.txt deleted file mode 100644 index fe06f4e0b9505..0000000000000 --- a/recipes/andreasbuhr-cppcoro/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/andreasbuhr-cppcoro/all/conandata.yml b/recipes/andreasbuhr-cppcoro/all/conandata.yml index 8db5685072de7..be3ba151d034d 100644 --- a/recipes/andreasbuhr-cppcoro/all/conandata.yml +++ b/recipes/andreasbuhr-cppcoro/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "cci.20210113": - url: "https://github.com/andreasbuhr/cppcoro/archive/7cc9433436fe8f2482138019cfaafce8e1d7a896.zip" - sha256: "5edc72bb19616ae5b794c7d83f9a5d4973f32c966f1966ab81779d3a38b36a2c" + "cci.20230629": + url: "https://github.com/andreasbuhr/cppcoro/archive/a3082f56ba135a659f7386b00ff797ba441207ba.zip" + sha256: "8c3283dd7587cdd18b871b290fda9394f262110140685e6de3760ede3b505736" diff --git a/recipes/andreasbuhr-cppcoro/all/conanfile.py b/recipes/andreasbuhr-cppcoro/all/conanfile.py index 2acc06b34e08b..ecc6306553632 100644 --- a/recipes/andreasbuhr-cppcoro/all/conanfile.py +++ b/recipes/andreasbuhr-cppcoro/all/conanfile.py @@ -1,21 +1,24 @@ import os -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration +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 rmdir, get, copy +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class AndreasbuhrCppCoroConan(ConanFile): name = "andreasbuhr-cppcoro" description = "A library of C++ coroutine abstractions for the coroutines TS" - topics = ("conan", "cpp", "async", "coroutines") + topics = ("cpp", "async", "coroutines") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/andreasbuhr/cppcoro" license = "MIT" settings = "os", "compiler", "build_type", "arch" provides = "cppcoro" - - exports_sources = "CMakeLists.txt" - generators = "cmake" + package_type = "library" options = { "shared": [True, False], @@ -26,87 +29,111 @@ class AndreasbuhrCppCoroConan(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _minimum_compilers_version(self): return { "Visual Studio": "15", + "msvc": "191", "gcc": "10", "clang": "8", "apple-clang": "10", } + @property + def _min_cppstd(self): + # Clang with libstdc++ always requires C++20 + # Clang 17+ always requires C++20 + # Otherwise, require C++17 + compiler = self.settings.compiler + requires_cpp20 = compiler == "clang" and ("libstdc++" in compiler.get_safe("libcxx", "") or compiler.version >= Version("17")) + return 20 if requires_cpp20 else 17 + + def layout(self): + cmake_layout(self, src_folder="src") + def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + # We can't simply check for C++20, because clang and MSVC support the coroutine TS despite not having labeled (__cplusplus macro) C++20 support 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 coroutine TS support. The current compiler {} {} does not support it.".format( - self.name, self.settings.compiler, self.settings.compiler.version)) - - # Currently clang expects coroutine to be implemented in a certain way (under std::experiemental::), while libstdc++ puts them under std:: - # There are also other inconsistencies, see https://bugs.llvm.org/show_bug.cgi?id=48172 - # This should be removed after both gcc and clang implements the final coroutine TS - if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libstdc++": - raise ConanInvalidConfiguration("{} does not support clang with libstdc++. Use libc++ instead.".format(self.name)) + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.name} requires coroutine TS support. The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it." + ) + + # Older versions of clang expects coroutine to be put under std::experimental::, while libstdc++ puts them under std::, + # See https://bugs.llvm.org/show_bug.cgi?id=48172 for more context. + if self.settings.compiler == "clang" and "libstdc++" in self.settings.compiler.get_safe("libcxx", ""): + if self.settings.compiler.version < Version("14"): + raise ConanInvalidConfiguration("{self.name} does not support clang<14 with libstdc++. Use libc++ or upgrade to clang 14+ instead.") + if self.settings.compiler.version == Version("14"): + self.output.warning("This build may fail if using libstdc++13 or greater") 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - if self.settings.os == "Windows" and self.options.shared: - self._cmake.definitions["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = "ON" - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = "ON" + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() 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() - 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.filenames["cmake_find_package"] = "cppcoro" - self.cpp_info.filenames["cmake_find_package_multi"] = "cppcoro" - self.cpp_info.names["cmake_find_package"] = "cppcoro" - self.cpp_info.names["cmake_find_package_multi"] = "cppcoro" + @property + def _needs_fcoroutines_ts_flag(self): + version = Version(self.settings.compiler.version) + if self.settings.compiler == "clang": + # clang 5: Coroutines support added + # somewhere between clang 5 and 11: the requirement to add -fcoroutines-ts was dropped, at least in the context of this recipe. + return version < 11 + elif self.settings.compiler == "apple-clang": + # At some point before apple-clang 13, in the context of this recipe, the requirement for this flag was dropped. + return version < 13 + else: + return False - comp = self.cpp_info.components["cppcoro"] - comp.names["cmake_find_package"] = "cppcoro" - comp.names["cmake_find_package_multi"] = "cppcoro" - comp.libs = ["cppcoro"] + def package_info(self): + self.cpp_info.libs = ["cppcoro"] - if self.settings.os == "Linux" and self.options.shared: - comp.system_libs = ["pthread"] + if self.settings.os in ["Linux", "FreeBSD"] and self.options.shared: + self.cpp_info.system_libs = ["pthread", "m"] if self.settings.os == "Windows": - comp.system_libs = ["synchronization"] + self.cpp_info.system_libs = ["synchronization", "ws2_32", "mswsock"] - if self.settings.compiler == "Visual Studio": - comp.cxxflags.append("/await") + if is_msvc(self): + self.cpp_info.cxxflags.append("/await") elif self.settings.compiler == "gcc": - comp.cxxflags.append("-fcoroutines") - comp.defines.append("CPPCORO_COMPILER_SUPPORTS_SYMMETRIC_TRANSFER=1") - elif self.settings.compiler == "clang" or self.settings.compiler == "apple-clang": - comp.cxxflags.append("-fcoroutines-ts") + self.cpp_info.cxxflags.append("-fcoroutines") + self.cpp_info.defines.append("CPPCORO_COMPILER_SUPPORTS_SYMMETRIC_TRANSFER=1") + elif self._needs_fcoroutines_ts_flag: + self.cpp_info.cxxflags.append("-fcoroutines-ts") + + self.cpp_info.set_property("cmake_file_name", "cppcoro") + self.cpp_info.set_property("cmake_target_name", "cppcoro::cppcoro") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "cppcoro" + self.cpp_info.filenames["cmake_find_package_multi"] = "cppcoro" + self.cpp_info.names["cmake_find_package"] = "cppcoro" + self.cpp_info.names["cmake_find_package_multi"] = "cppcoro" diff --git a/recipes/andreasbuhr-cppcoro/all/test_package/CMakeLists.txt b/recipes/andreasbuhr-cppcoro/all/test_package/CMakeLists.txt index 7c6a625130a35..656a3690c2777 100644 --- a/recipes/andreasbuhr-cppcoro/all/test_package/CMakeLists.txt +++ b/recipes/andreasbuhr-cppcoro/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - find_package(cppcoro CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/andreasbuhr-cppcoro/all/test_package/conanfile.py b/recipes/andreasbuhr-cppcoro/all/test_package/conanfile.py index 910ae60d10438..0a6bc68712d90 100644 --- a/recipes/andreasbuhr-cppcoro/all/test_package/conanfile.py +++ b/recipes/andreasbuhr-cppcoro/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, cmake_layout 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 = "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) @@ -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.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/andreasbuhr-cppcoro/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/aws-c-common/all/test_v1_package/CMakeLists.txt rename to recipes/andreasbuhr-cppcoro/all/test_v1_package/CMakeLists.txt diff --git a/recipes/gli/all/test_v1_package/conanfile.py b/recipes/andreasbuhr-cppcoro/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/gli/all/test_v1_package/conanfile.py rename to recipes/andreasbuhr-cppcoro/all/test_v1_package/conanfile.py diff --git a/recipes/andreasbuhr-cppcoro/config.yml b/recipes/andreasbuhr-cppcoro/config.yml index 1ae5eab0b9b8f..1b221bd98d9e3 100644 --- a/recipes/andreasbuhr-cppcoro/config.yml +++ b/recipes/andreasbuhr-cppcoro/config.yml @@ -1,3 +1,3 @@ versions: - "cci.20210113": + "cci.20230629": folder: "all" diff --git a/recipes/android-ndk/all/conandata.yml b/recipes/android-ndk/all/conandata.yml index 020850fb26202..788c3990884da 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/all/conanfile.py b/recipes/android-ndk/all/conanfile.py index af3c867fd7625..ecf241f5b5a1a 100644 --- a/recipes/android-ndk/all/conanfile.py +++ b/recipes/android-ndk/all/conanfile.py @@ -2,7 +2,6 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.files import get, download, unzip, load, copy, rm from conan.tools.layout import basic_layout -from conan.tools.scm import Version import os import re import shutil @@ -12,16 +11,18 @@ class AndroidNDKConan(ConanFile): name = "android-ndk" - description = "The Android NDK is a toolset that lets you implement parts of your app in native code, using languages such as C and C++" + description = ( + "The Android NDK is a toolset that lets you implement parts of your app " + "in native code, using languages such as C and C++" + ) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://developer.android.com/ndk/" topics = ("android", "ndk", "toolchain", "compiler") - license = "Apache-2.0" - - settings = "os", "arch", "build_type", "compiler" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" short_paths = True - exports_sources = "cmake-wrapper.cmd", "cmake-wrapper" def _is_universal2(self, info=False): settings = self.info.settings if info else self.settings @@ -41,6 +42,10 @@ def _settings_os_supported(self): def _settings_arch_supported(self): return self.conan_data["sources"][self.version].get(str(self.settings.os), {}).get(str(self._arch)) is not None + def export_sources(self): + copy(self, "cmake-wrapper.cmd", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "cmake-wrapper", src=self.recipe_folder, dst=self.export_sources_folder) + def layout(self): basic_layout(self, src_folder="src") @@ -226,7 +231,7 @@ def _cmake_system_processor(self): cmake_system_processor = "armv5te" return cmake_system_processor - def _define_tool_var(self, name, value, bare = False): + def _define_tool_var(self, name, value, bare=False): ndk_bin = os.path.join(self._ndk_root, "bin") path = os.path.join(ndk_bin, self._tool_name(value, bare)) if not os.path.isfile(path): @@ -325,7 +330,7 @@ def package_info(self): self.buildenv_info.define("ANDROID_STL", libcxx_str if libcxx_str.startswith("c++_") else "c++_shared") # TODO: conan v1 stuff to remove later - if Version(conan_version).major < 2: + if conan_version.major < 2: self.env_info.PATH.extend([os.path.join(self.package_folder, "bin"), os.path.join(self._ndk_root, "bin")]) self.env_info.ANDROID_NDK_ROOT = os.path.join(self.package_folder, "bin") self.env_info.ANDROID_NDK_HOME = os.path.join(self.package_folder, "bin") diff --git a/recipes/android-ndk/all/test_v1_package/CMakeLists.txt b/recipes/android-ndk/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/android-ndk/all/test_v1_package/CMakeLists.txt +++ b/recipes/android-ndk/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/android-ndk/all/test_v1_package/conanfile.py b/recipes/android-ndk/all/test_v1_package/conanfile.py index e7a2d6060ddc7..d61cc4e4da75e 100644 --- a/recipes/android-ndk/all/test_v1_package/conanfile.py +++ b/recipes/android-ndk/all/test_v1_package/conanfile.py @@ -7,7 +7,7 @@ class TestPackgeConan(ConanFile): settings = "os", "arch", "compiler", "build_type" test_type = "explicit" - generators = "cmake" + generators = "cmake", "cmake_find_package_multi" def build_requirements(self): self.build_requires(self.tested_reference_str) diff --git a/recipes/android-ndk/config.yml b/recipes/android-ndk/config.yml index abc3839165991..a7fa8c97dd42c 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 1dec7ac1d3e71..edfe7e005b855 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/all/conanfile.py b/recipes/angelscript/all/conanfile.py index 174e1d9732354..88cdd729c8bf1 100644 --- a/recipes/angelscript/all/conanfile.py +++ b/recipes/angelscript/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class AngelScriptConan(ConanFile): @@ -19,6 +19,7 @@ class AngelScriptConan(ConanFile): ) topics = ("angelcode", "embedded", "scripting", "language", "compiler", "interpreter") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [False, True], @@ -42,10 +43,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") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/angelscript/all/test_v1_package/CMakeLists.txt b/recipes/angelscript/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/angelscript/all/test_v1_package/CMakeLists.txt +++ b/recipes/angelscript/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/angelscript/config.yml b/recipes/angelscript/config.yml index 22190418b16a2..f3cbb4fedf454 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 28bc286ec79b5..f6974e320b559 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/all/conanfile.py b/recipes/antlr4-cppruntime/all/conanfile.py index 99a6339b6c746..3aaea8c41d7d7 100644 --- a/recipes/antlr4-cppruntime/all/conanfile.py +++ b/recipes/antlr4-cppruntime/all/conanfile.py @@ -14,12 +14,14 @@ class Antlr4CppRuntimeConan(ConanFile): name = "antlr4-cppruntime" - homepage = "https://github.com/antlr/antlr4/tree/master/runtime/Cpp" description = "C++ runtime support for ANTLR (ANother Tool for Language Recognition)" - topics = ("antlr", "parser", "runtime") - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" - settings = "os", "compiler", "build_type", "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/antlr/antlr4/tree/master/runtime/Cpp" + topics = ("antlr", "parser", "runtime") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], diff --git a/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt b/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt +++ b/recipes/antlr4-cppruntime/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/antlr4-cppruntime/config.yml b/recipes/antlr4-cppruntime/config.yml index 62ba72dbb3e3f..05c77e20051f9 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/any-lite/all/conanfile.py b/recipes/any-lite/all/conanfile.py index 19f65824ca091..ed35a82c05d84 100644 --- a/recipes/any-lite/all/conanfile.py +++ b/recipes/any-lite/all/conanfile.py @@ -8,24 +8,27 @@ class AnyLiteConan(ConanFile): name = "any-lite" + description = ( + "any lite - A C++17-like any, a type-safe container for single values of " + "any type for C++98, C++11 and later in a single-file header-only library" + ) + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinmoene/any-lite" - description = ("any lite - A C++17-like any, a type-safe container for single values of \ - any type for C++98, C++11 and later in a single-file header-only library") - topics = ("cpp11", "cpp14", "cpp17", "any", "any-implementations") - license = "BSL-1.0" + topics = ("cpp11", "cpp14", "cpp17", "any", "any-implementations", "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 diff --git a/recipes/any-lite/all/test_v1_package/CMakeLists.txt b/recipes/any-lite/all/test_v1_package/CMakeLists.txt index 3d223cfc63eee..91630d79f4abb 100644 --- a/recipes/any-lite/all/test_v1_package/CMakeLists.txt +++ b/recipes/any-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(any-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::any-lite) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/anyrpc/all/conanfile.py b/recipes/anyrpc/all/conanfile.py index e5887586c576e..068094058cb31 100644 --- a/recipes/anyrpc/all/conanfile.py +++ b/recipes/anyrpc/all/conanfile.py @@ -15,6 +15,8 @@ class AnyRPCConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/sgieseking/anyrpc" topics = ("rpc",) + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -66,7 +68,10 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) if self.options.with_log4cplus and self.options.with_wchar: - raise ConanInvalidConfiguration(f"{self.ref} can not be built with both log4cplus and wchar, see https://github.com/sgieseking/anyrpc/issues/25") + raise ConanInvalidConfiguration( + f"{self.ref} can not be built with both log4cplus and wchar, see" + " https://github.com/sgieseking/anyrpc/issues/25" + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -105,6 +110,6 @@ def package(self): def package_info(self): self.cpp_info.libs = ["anyrpc"] if not self.options.shared and self.settings.os == "Windows": - self.cpp_info.system_libs.append("ws2_32") + self.cpp_info.system_libs.append("ws2_32") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/anyrpc/all/test_v1_package/CMakeLists.txt b/recipes/anyrpc/all/test_v1_package/CMakeLists.txt index 8272097b5b3da..91630d79f4abb 100644 --- a/recipes/anyrpc/all/test_v1_package/CMakeLists.txt +++ b/recipes/anyrpc/all/test_v1_package/CMakeLists.txt @@ -1,6 +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/) diff --git a/recipes/approvaltests.cpp/all/conanfile.py b/recipes/approvaltests.cpp/all/conanfile.py index a61797eefb14b..167d80165bb6d 100644 --- a/recipes/approvaltests.cpp/all/conanfile.py +++ b/recipes/approvaltests.cpp/all/conanfile.py @@ -40,8 +40,6 @@ def _header_file(self): return "ApprovalTests.hpp" def config_options(self): - if Version(self.version) < "8.6.0": - del self.options.with_boosttest if Version(self.version) < "10.4.0": del self.options.with_cpputest @@ -49,14 +47,14 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - if self.options.get_safe("with_boosttest"): - self.requires("boost/1.81.0") + if self.options.with_boosttest: + self.requires("boost/1.83.0") if self.options.with_catch2: - self.requires("catch2/2.13.10") + self.requires("catch2/3.5.0") if self.options.with_gtest: - self.requires("gtest/1.12.1") + self.requires("gtest/1.14.0") if self.options.with_doctest: - self.requires("doctest/2.4.10") + self.requires("doctest/2.4.11") if self.options.get_safe("with_cpputest"): self.requires("cpputest/4.0") diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py index 86dd0a9fc160c..c6efeb71fc33d 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 0e388265ecf5f..6ce547b4ee2f4 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 f4c6ccd2ff9e6..768365163e373 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 aaa8cad5fb1b4..af5a8560dea48 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.1", transitive_headers=True) + self.requires("libxml2/2.12.3") + 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.3.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.1.0") 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 0000000000000..c4bdecffb39f1 --- /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 0000000000000..3b6fa48c98a4e --- /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 8a5d8c220194f..f8a36c47767ce 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 9a63b9ea3a864..762afa0db71a7 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 0d20897301b68..91630d79f4abb 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 a7431a882c8d4..1aa8532edf0e6 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 55e0ec99e9a6b..2cdfa85c58927 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/arcus/all/conanfile.py b/recipes/arcus/all/conanfile.py index d2e0d9c10f99c..8f6e301a39313 100644 --- a/recipes/arcus/all/conanfile.py +++ b/recipes/arcus/all/conanfile.py @@ -15,15 +15,15 @@ class ArcusConan(ConanFile): "creating a socket in a thread and using this socket to send " \ "and receive messages based on the Protocol Buffers library." license = "LGPL-3.0-or-later" - topics = ("protobuf", "socket", "cura") - homepage = "https://github.com/Ultimaker/libArcus" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Ultimaker/libArcus" + topics = ("protobuf", "socket", "cura") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - } default_options = { "shared": False, diff --git a/recipes/arcus/all/test_v1_package/CMakeLists.txt b/recipes/arcus/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/arcus/all/test_v1_package/CMakeLists.txt +++ b/recipes/arcus/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/arduinojson/all/conandata.yml b/recipes/arduinojson/all/conandata.yml index d44d34b58314d..7cd1210fd6d95 100644 --- a/recipes/arduinojson/all/conandata.yml +++ b/recipes/arduinojson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.21.4": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.4/ArduinoJson-v6.21.4.zip" + sha256: "60a5c4cd28d97047f63a1f9c9e8bd36a72c8b4c86809babcc2bd4b00e0502b9b" "6.21.2": url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.2/ArduinoJson-v6.21.2.zip" sha256: "1dc888061f6e7828f7a0a4e71bf059796e5ce202ce6ddb4e3a2e384d32b5cba0" diff --git a/recipes/arduinojson/all/conanfile.py b/recipes/arduinojson/all/conanfile.py index 74cc1a0a27699..e10c2101ad215 100644 --- a/recipes/arduinojson/all/conanfile.py +++ b/recipes/arduinojson/all/conanfile.py @@ -13,7 +13,7 @@ class ArduinojsonConan(ConanFile): name = "arduinojson" description = "C++ JSON library for IoT. Simple and efficient." homepage = "https://github.com/bblanchon/ArduinoJson" - topics = ("json", "arduino", "iot", "embedded", "esp8266") + topics = ("json", "msgpack", "message-pack", "arduino", "iot", "embedded", "esp8266") license = "MIT" url = "https://github.com/conan-io/conan-center-index" package_type = "header-library" diff --git a/recipes/arduinojson/config.yml b/recipes/arduinojson/config.yml index 3358de6326521..afe4d32db15ff 100644 --- a/recipes/arduinojson/config.yml +++ b/recipes/arduinojson/config.yml @@ -1,4 +1,6 @@ versions: + "6.21.4": + folder: all "6.21.2": folder: all "6.21.0": diff --git a/recipes/argh/all/conanfile.py b/recipes/argh/all/conanfile.py index f6f6a44814ca4..855db0a2a7110 100644 --- a/recipes/argh/all/conanfile.py +++ b/recipes/argh/all/conanfile.py @@ -10,14 +10,19 @@ class ArgparseConan(ConanFile): name = "argh" + description = "Frustration-free command line processing" + license = "BSD-3" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/adishavit/argh" - topics = ("argh", "argument", "parsing") - license = "BSD-3" - description = "Frustration-free command line processing" + topics = ("argument", "parsing", "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() @@ -25,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): pass diff --git a/recipes/argh/all/test_v1_package/CMakeLists.txt b/recipes/argh/all/test_v1_package/CMakeLists.txt index 65e0578c4c0f6..91630d79f4abb 100644 --- a/recipes/argh/all/test_v1_package/CMakeLists.txt +++ b/recipes/argh/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(argh REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE argh) -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/argparse/all/conandata.yml b/recipes/argparse/all/conandata.yml index 18f4555649896..719dc54ae5a72 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/all/conanfile.py b/recipes/argparse/all/conanfile.py index e7e9de237fe52..11300088df46e 100644 --- a/recipes/argparse/all/conanfile.py +++ b/recipes/argparse/all/conanfile.py @@ -11,12 +11,15 @@ class ArgparseConan(ConanFile): name = "argparse" + description = "Argument Parser for Modern C++" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/p-ranav/argparse" - topics = ("argparse", "argument", "parsing") - license = "MIT" - description = "Argument Parser for Modern C++" + topics = ("argument", "parsing", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): @@ -39,6 +42,9 @@ 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 package_id(self): self.info.clear() @@ -54,12 +60,8 @@ def validate(self): if Version(self.version) > "2.1" and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libstdc++": raise ConanInvalidConfiguration("This recipe does not permit >2.1 with clang and stdlibc++. There may be an infrastructure issue in CCI.") - 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) diff --git a/recipes/argparse/all/test_package/CMakeLists.txt b/recipes/argparse/all/test_package/CMakeLists.txt index e8794b9790e15..cc806a824f8c4 100644 --- a/recipes/argparse/all/test_package/CMakeLists.txt +++ b/recipes/argparse/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(argparse REQUIRED CONFIG) diff --git a/recipes/argparse/all/test_v1_package/CMakeLists.txt b/recipes/argparse/all/test_v1_package/CMakeLists.txt index 59cfa3b376305..91630d79f4abb 100644 --- a/recipes/argparse/all/test_v1_package/CMakeLists.txt +++ b/recipes/argparse/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(argparse REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE argparse::argparse) -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/argparse/config.yml b/recipes/argparse/config.yml index 5a743e89da3ef..fef29e0dad433 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 787c510a62b53..427c4c05d81dd 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 08a70490fa0ab..b67bad0e21e0f 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/argtable2/all/conanfile.py b/recipes/argtable2/all/conanfile.py index 4e3ccd375b1a6..8c8e33cf028bd 100644 --- a/recipes/argtable2/all/conanfile.py +++ b/recipes/argtable2/all/conanfile.py @@ -13,10 +13,12 @@ class Argtable2Conan(ConanFile): name = "argtable2" description = "Argtable is an ANSI C library for parsing GNU style command line options with a minimum of fuss." - topics = ("argument", "parsing", "getopt") license = "LGPL-2.0+" - homepage = "http://argtable.sourceforge.net/" url = "https://github.com/conan-io/conan-center-index" + homepage = "http://argtable.sourceforge.net/" + topics = ("argument", "parsing", "getopt") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/argtable2/all/test_v1_package/CMakeLists.txt b/recipes/argtable2/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/argtable2/all/test_v1_package/CMakeLists.txt +++ b/recipes/argtable2/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/argtable3/all/conanfile.py b/recipes/argtable3/all/conanfile.py index 2b2ed84a2b4f5..86aef097f8805 100644 --- a/recipes/argtable3/all/conanfile.py +++ b/recipes/argtable3/all/conanfile.py @@ -7,13 +7,16 @@ required_conan_version = ">=1.53.0" + class Argtable3Conan(ConanFile): name = "argtable3" description = "A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options." license = "BSD-3-clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.argtable.org/" - topics = ("conan", "argtable3", "command", "line", "argument", "parse", "parsing", "getopt") + topics = ("command", "line", "argument", "parse", "parsing", "getopt") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/argtable3/all/test_package/CMakeLists.txt b/recipes/argtable3/all/test_package/CMakeLists.txt index 79004b3e726d4..7d615d10f2ea9 100644 --- a/recipes/argtable3/all/test_package/CMakeLists.txt +++ b/recipes/argtable3/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(Argtable3 REQUIRED CONFIG) diff --git a/recipes/argtable3/all/test_package/conanfile.py b/recipes/argtable3/all/test_package/conanfile.py index 0ab6dbb34f3d6..83621776fedfc 100644 --- a/recipes/argtable3/all/test_package/conanfile.py +++ b/recipes/argtable3/all/test_package/conanfile.py @@ -21,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") - self.run(f"{bin_path} --help", run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} --help", env="conanrun") diff --git a/recipes/argtable3/all/test_v1_package/CMakeLists.txt b/recipes/argtable3/all/test_v1_package/CMakeLists.txt index be00a8c7f57c7..91630d79f4abb 100644 --- a/recipes/argtable3/all/test_v1_package/CMakeLists.txt +++ b/recipes/argtable3/all/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/armadillo/all/conandata.yml b/recipes/armadillo/all/conandata.yml index 91baae076a36f..fafd7b841d70b 100644 --- a/recipes/armadillo/all/conandata.yml +++ b/recipes/armadillo/all/conandata.yml @@ -8,6 +8,12 @@ sources: "11.4.3": url: "https://sourceforge.net/projects/arma/files/armadillo-11.4.3.tar.xz" sha256: "87603263664988af41da2ca4f36205e36ea47a9281fa6cfd463115f3797a1da2" + "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": @@ -22,3 +28,11 @@ patches: - patch_file: "patches/0002-Guard-dependency-discovery-11.4.x.patch" patch_description: "Add find_package statements to inject conan dependencies" patch_type: "conan" + "12.2.0": + - 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 4c814b3794dad..88da815dbce2a 100644 --- a/recipes/armadillo/all/conanfile.py +++ b/recipes/armadillo/all/conanfile.py @@ -2,6 +2,8 @@ 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.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.build import cross_building from conan.errors import ConanInvalidConfiguration import os @@ -26,6 +28,7 @@ class ArmadilloConan(ConanFile): "hdf5", ) settings = "os", "compiler", "build_type", "arch" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -98,6 +101,16 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if self.options.use_blas == "openblas": + # Note that if you're relying on this to build LAPACK, you _must_ have + # a fortran compiler installed. If you don't, OpenBLAS will build successfully but + # without LAPACK support, which isn't obvious. + # This can be achieved by setting the FC environment variable or the conf tools.build:compiler_executables={"fortran": "/path/to/fortran"} + # in your conan profile. + self.options["openblas"].build_lapack = ( + self.options.use_lapack == "openblas" + ) + def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, 11) @@ -110,6 +123,11 @@ def validate(self): "framework_accelerate can only be used on Macos" ) + if self.options.use_hdf5 and Version(self.version) > "12" and cross_building(self): + raise ConanInvalidConfiguration( + "Armadillo does not support cross building with hdf5. Set use_hdf5=False and try again." + ) + for value, options in self._co_dependencies.items(): options_without_value = [ x for x in options if getattr(self.options, x) != value @@ -156,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 @@ -163,19 +184,17 @@ def requirements(self): # TODO: "arpack/1.0" # Pending https://github.com/conan-io/conan-center-index/issues/6755 # TODO: "flexiblas/3.0.4" # Pending https://github.com/conan-io/conan-center-index/issues/6827 - if self.options.use_hdf5: + # The armadillo library no longer takes any responsibility for linking hdf5 as of v12.x. This means + # it will have to be linked manually by consumers if desired. + # 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") - # Note that if you're relying on this to build LAPACK, you _must_ have - # a fortran compiler installed. If you don't, OpenBLAS will build successfully but - # without LAPACK support, which isn't obvious. - # This can be achieved by setting the FC environment variable in your conan profile - self.options["openblas"].build_lapack = ( - self.options.use_lapack == "openblas" - ) + # 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/0001-Guard-dependency-discovery-10.7.x.patch b/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch index 89386d2e8686f..5736e2db0a819 100644 --- a/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch +++ b/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch @@ -1,15 +1,3 @@ -From 48a5162899ebeb0ba3ca3141b587a53d2eda4223 Mon Sep 17 00:00:00 2001 -From: Samuel Dowling -Date: Thu, 30 Sep 2021 23:51:35 +0930 -Subject: [PATCH] Guard dependency discovery - -* Add guards to prevent usage of custom cmake find package scripts. -* Remove ability to inject hdf5 include directory into compiled binary ---- - CMakeLists.txt | 72 ++++++++++++++++++++----- - include/armadillo_bits/config.hpp.cmake | 2 +- - 2 files changed, 60 insertions(+), 14 deletions(-) - diff --git a/CMakeLists.txt b/CMakeLists.txt index 7857f8c..5f87f7e 100644 --- a/CMakeLists.txt diff --git a/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch b/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch index 33fb53382e9ee..26001d6f2f096 100644 --- a/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch +++ b/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch @@ -1,15 +1,3 @@ -From aa49b619333a25d892d119836ca97dd1d833475d Mon Sep 17 00:00:00 2001 -From: Samuel Dowling -Date: Thu, 5 Jan 2023 00:02:06 +1030 -Subject: [PATCH 1/1] Guard dependency discovery - -* Add guards to prevent usage of custom cmake find package scripts. -* Remove ability to inject hdf5 include directory into compiled binary ---- - CMakeLists.txt | 78 ++++++++++++++++++++----- - include/armadillo_bits/config.hpp.cmake | 2 +- - 2 files changed, 64 insertions(+), 16 deletions(-) - diff --git a/CMakeLists.txt b/CMakeLists.txt index da1ff3a..7bdd808 100644 --- a/CMakeLists.txt diff --git a/recipes/armadillo/all/patches/0003-Guard-dependency-discovery-12.2.x.patch b/recipes/armadillo/all/patches/0003-Guard-dependency-discovery-12.2.x.patch new file mode 100644 index 0000000000000..7c8079d507a32 --- /dev/null +++ b/recipes/armadillo/all/patches/0003-Guard-dependency-discovery-12.2.x.patch @@ -0,0 +1,121 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7d21cf2..2669b17 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -270,7 +270,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,") +@@ -285,8 +289,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 "") +@@ -325,19 +337,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}" ) +@@ -449,7 +487,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) +@@ -457,7 +499,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.41.0 + 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 0000000000000..f374782089ebf --- /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/all/test_package/CMakeLists.txt b/recipes/armadillo/all/test_package/CMakeLists.txt index 2ede063cb4884..da38c2d4cf348 100644 --- a/recipes/armadillo/all/test_package/CMakeLists.txt +++ b/recipes/armadillo/all/test_package/CMakeLists.txt @@ -2,7 +2,11 @@ cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) find_package(armadillo CONFIG REQUIRED) +if (LINK_HDF5) + find_package(HDF5) + set(HDF5_TARGETS HDF5::HDF5) +endif() add_executable(example src/example.cpp) -target_link_libraries(example armadillo::armadillo) +target_link_libraries(example armadillo::armadillo ${HDF5_TARGETS}) set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/armadillo/all/test_package/conanfile.py b/recipes/armadillo/all/test_package/conanfile.py index 4a901f505fcdd..2c5aab901d0bf 100644 --- a/recipes/armadillo/all/test_package/conanfile.py +++ b/recipes/armadillo/all/test_package/conanfile.py @@ -1,20 +1,32 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain from conan.tools.build import cross_building +from conan.tools.scm import Version class FooTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" # VirtualBuildEnv and VirtualRunEnv can be avoided if "tools.env.virtualenv:auto_use" is defined # (it will be defined in Conan 2.0) - generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" apply_env = False test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) + tested_version = self.tested_reference_str.split('/')[1].split('@')[0] + # using armadillo > 12.x requires the consumer to explicitly depend on hdf5 + if Version(tested_version) > "12": + self.requires("hdf5/1.14.0") + + def generate(self): + tc = CMakeToolchain(self) + # using armadillo > 12.x requires explicit consumer linkage against hdf5 + explicit_link_condition = Version(self.dependencies["armadillo"].ref.version) > "12" + tc.variables["LINK_HDF5"] = explicit_link_condition + tc.generate() def build(self): cmake = CMake(self) diff --git a/recipes/armadillo/config.yml b/recipes/armadillo/config.yml index 8af743e5561bd..7dfcb07b6f44b 100644 --- a/recipes/armadillo/config.yml +++ b/recipes/armadillo/config.yml @@ -5,3 +5,7 @@ versions: folder: all "11.4.3": 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 0000000000000..1bf900def3e56 --- /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 772cdfef9c3c2..4edf7cbfb21e7 100644 --- a/recipes/arrow/all/conandata.yml +++ b/recipes/arrow/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "14.0.2": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-14.0.2/apache-arrow-14.0.2.tar.gz?action=download" + sha256: "1304dedb41896008b89fe0738c71a95d9b81752efc77fa70f264cb1da15d9bc2" + "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 dcc135335bdb3..dcd80308b7b01 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc_static_runtime, is_msvc, check_min_vs -from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, 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 +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os import glob @@ -18,6 +18,7 @@ class ArrowConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://arrow.apache.org/" topics = ("memory", "gandiva", "parquet", "skyhook", "acero", "hdfs", "csv", "cuda", "gcs", "json", "hive", "s3", "grpc") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -48,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], @@ -98,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, @@ -114,21 +117,29 @@ class ArrowConan(ConanFile): short_paths = True @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): # arrow >= 10.0.0 requires C++17. # https://github.com/apache/arrow/pull/13991 - return 11 if Version(self.version) < "10.0.0" else 17 + return "11" if Version(self.version) < "10.0.0" else "17" @property def _compilers_minimum_version(self): return { - "gcc": "8", - "clang": "7", - "apple-clang": "10", - } + "11": { + "clang": "3.9", + }, + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) 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": @@ -147,99 +158,55 @@ 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") - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, self._minimum_cpp_standard) - - if self._minimum_cpp_standard == 11: - if self.info.settings.compiler == "clang" and self.info.settings.compiler.version <= Version("3.9"): - raise ConanInvalidConfiguration("This recipe does not support this compiler version") - else: - check_min_vs(self, 191) - if not is_msvc(self): - 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.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." - ) - - if self.options.plasma != "deprecated": - self.output.warning("plasma option is deprecated since Arrow 12.0.0, do not use anymore.") - if self.options.shared: - del self.options.fPIC - 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: - raise ConanInvalidConfiguration("CCI has no orc recipe (yet)") - if self.options.with_s3 and not self.options["aws-sdk-cpp"].config: - raise ConanInvalidConfiguration("arrow:with_s3 requires aws-sdk-cpp:config is True.") - - if self.options.shared and self._with_jemalloc(): - if self.options["jemalloc"].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 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()): @@ -248,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) @@ -293,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: @@ -323,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(): - self.requires("protobuf/3.21.4") - if self._with_jemalloc(): + if self.options.with_protobuf: + self.requires("protobuf/3.21.9") + 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.80.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.1s") + self.requires("openssl/1.1.1w") else: - self.requires("openssl/1.1.1s") + 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: @@ -368,29 +337,63 @@ 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 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) + + 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.get_safe("skyhook", False): + raise ConanInvalidConfiguration("CCI has no librados recipe (yet)") + if self.options.with_cuda: + raise ConanInvalidConfiguration("CCI has no cuda recipe (yet)") + if self.options.with_orc: + raise ConanInvalidConfiguration("CCI has no orc recipe (yet)") + 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.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", destination=self.source_folder, strip_root=True) + filename=f"apache-arrow-{self.version}.tar.gz", strip_root=True) def generate(self): - # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist tc = CMakeToolchain(self) if cross_building(self): cmake_system_processor = { "armv8": "aarch64", "armv8.3": "aarch64", }.get(str(self.settings.arch), str(self.settings.arch)) - tc.variables["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor if cmake_system_processor == "aarch64": tc.variables["ARROW_CPU_FLAG"] = "armv8" if is_msvc(self): @@ -398,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) @@ -409,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) @@ -422,35 +425,35 @@ 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(): - tc.variables["ARROW_PROTOBUF_USE_SHARED"] = bool(self.options["protobuf"].shared) + 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(): - tc.variables["ARROW_GRPC_USE_SHARED"] = bool(self.options["grpc"].shared) + 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) tc.variables["brotli_SOURCE"] = "SYSTEM" if self.options.with_brotli: - tc.variables["ARROW_BROTLI_USE_SHARED"] = bool(self.options["brotli"].shared) + tc.variables["ARROW_BROTLI_USE_SHARED"] = bool(self.dependencies["brotli"].options.shared) tc.variables["gflags_SOURCE"] = "SYSTEM" - if self._with_gflags(): - tc.variables["ARROW_GFLAGS_USE_SHARED"] = bool(self.options["gflags"].shared) + 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" if self.options.with_bz2: - tc.variables["ARROW_BZ2_USE_SHARED"] = bool(self.options["bzip2"].shared) + tc.variables["ARROW_BZ2_USE_SHARED"] = bool(self.dependencies["bzip2"].options.shared) tc.variables["ARROW_WITH_LZ4"] = bool(self.options.with_lz4) tc.variables["lz4_SOURCE"] = "SYSTEM" if self.options.with_lz4: - tc.variables["ARROW_LZ4_USE_SHARED"] = bool(self.options["lz4"].shared) + tc.variables["ARROW_LZ4_USE_SHARED"] = bool(self.dependencies["lz4"].options.shared) tc.variables["ARROW_WITH_SNAPPY"] = bool(self.options.with_snappy) tc.variables["RapidJSON_SOURCE"] = "SYSTEM" tc.variables["Snappy_SOURCE"] = "SYSTEM" if self.options.with_snappy: - tc.variables["ARROW_SNAPPY_USE_SHARED"] = bool(self.options["snappy"].shared) + tc.variables["ARROW_SNAPPY_USE_SHARED"] = bool(self.dependencies["snappy"].options.shared) tc.variables["ARROW_WITH_ZLIB"] = bool(self.options.with_zlib) tc.variables["re2_SOURCE"] = "SYSTEM" tc.variables["ZLIB_SOURCE"] = "SYSTEM" @@ -463,20 +466,20 @@ def generate(self): else: tc.variables["ZSTD_SOURCE"] = "SYSTEM" if self.options.with_zstd: - tc.variables["ARROW_ZSTD_USE_SHARED"] = bool(self.options["zstd"].shared) + 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(): - tc.variables["THRIFT_VERSION"] = bool(self.deps_cpp_info["thrift"].version) # a recent thrift does not require boost - tc.variables["ARROW_THRIFT_USE_SHARED"] = bool(self.options["thrift"].shared) - tc.variables["ARROW_USE_OPENSSL"] = self._with_openssl() - if self._with_openssl(): - tc.variables["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath.replace("\\", "/") - tc.variables["ARROW_OPENSSL_USE_SHARED"] = bool(self.options["openssl"].shared) - if self._with_boost(): + 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.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.options.with_boost: tc.variables["ARROW_USE_BOOST"] = True - tc.variables["ARROW_BOOST_USE_SHARED"] = bool(self.options["boost"].shared) + tc.variables["ARROW_BOOST_USE_SHARED"] = bool(self.dependencies["boost"].options.shared) tc.variables["ARROW_S3"] = bool(self.options.with_s3) tc.variables["AWSSDK_SOURCE"] = "SYSTEM" tc.variables["ARROW_BUILD_UTILITIES"] = bool(self.options.cli) @@ -487,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(): - tc.variables["ARROW_UTF8PROC_USE_SHARED"] = bool(self.options["utf8proc"].shared) + 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"] = "MT" in str(self.settings.compiler.runtime) - if self._with_llvm(): - tc.variables["LLVM_DIR"] = self.deps_cpp_info["llvm-core"].rootpath.replace("\\", "/") + tc.variables["ARROW_USE_STATIC_CRT"] = is_msvc_static_runtime(self) + 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) @@ -539,129 +544,107 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - def _lib_name(self, name): - if is_msvc(self) and not self.options.shared: - return "{}_static".format(name) - else: - return "{}".format(name) - - 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 package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "Arrow" - self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow" - self.cpp_info.components["libarrow"].libs = [self._lib_name("arrow")] - self.cpp_info.components["libarrow"].names["cmake_find_package"] = "arrow" - self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = "arrow" - self.cpp_info.components["libarrow"].names["pkg_config"] = "arrow" + # FIXME: fix CMake targets of components + + self.cpp_info.set_property("cmake_file_name", "Arrow") + + suffix = "_static" if is_msvc(self) and not self.options.shared else "" + + self.cpp_info.components["libarrow"].set_property("pkg_config_name", "arrow") + self.cpp_info.components["libarrow"].libs = [f"arrow{suffix}"] if not self.options.shared: self.cpp_info.components["libarrow"].defines = ["ARROW_STATIC"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libarrow"].system_libs = ["pthread", "m", "dl", "rt"] - if self._parquet(): - self.cpp_info.components["libparquet"].libs = [self._lib_name("parquet")] - self.cpp_info.components["libparquet"].names["cmake_find_package"] = "parquet" - self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = "parquet" - self.cpp_info.components["libparquet"].names["pkg_config"] = "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"] if not self.options.shared: self.cpp_info.components["libparquet"].defines = ["PARQUET_STATIC"] - if self.options.get_safe("substrait", False): - self.cpp_info.components["libarrow_substrait"].libs = [self._lib_name("arrow_substrait")] - self.cpp_info.components["libarrow_substrait"].names["cmake_find_package"] = "arrow_substrait" - self.cpp_info.components["libarrow_substrait"].names["cmake_find_package_multi"] = "arrow_substrait" - self.cpp_info.components["libarrow_substrait"].names["pkg_config"] = "arrow_substrait" + if self.options.get_safe("substrait"): + self.cpp_info.components["libarrow_substrait"].set_property("pkg_config_name", "arrow_substrait") + self.cpp_info.components["libarrow_substrait"].libs = [f"arrow_substrait{suffix}"] self.cpp_info.components["libarrow_substrait"].requires = ["libparquet", "dataset"] # Plasma was deprecated in Arrow 12.0.0 del self.options.plasma if self.options.acero: - self.cpp_info.components["libacero"].libs = [self._lib_name("acero")] + self.cpp_info.components["libacero"].libs = [f"arrow_acero{suffix}"] self.cpp_info.components["libacero"].names["cmake_find_package"] = "acero" self.cpp_info.components["libacero"].names["cmake_find_package_multi"] = "acero" self.cpp_info.components["libacero"].names["pkg_config"] = "acero" self.cpp_info.components["libacero"].requires = ["libarrow"] if self.options.gandiva: - self.cpp_info.components["libgandiva"].libs = [self._lib_name("gandiva")] - self.cpp_info.components["libgandiva"].names["cmake_find_package"] = "gandiva" - self.cpp_info.components["libgandiva"].names["cmake_find_package_multi"] = "gandiva" - self.cpp_info.components["libgandiva"].names["pkg_config"] = "gandiva" + self.cpp_info.components["libgandiva"].set_property("pkg_config_name", "gandiva") + self.cpp_info.components["libgandiva"].libs = [f"gandiva{suffix}"] self.cpp_info.components["libgandiva"].requires = ["libarrow"] if not self.options.shared: self.cpp_info.components["libgandiva"].defines = ["GANDIVA_STATIC"] - if self._with_flight_rpc(): - self.cpp_info.components["libarrow_flight"].libs = [self._lib_name("arrow_flight")] - 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" - self.cpp_info.components["libarrow_flight"].names["pkg_config"] = "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"] if self.options.get_safe("with_flight_sql"): - self.cpp_info.components["libarrow_flight_sql"].libs = [self._lib_name("arrow_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" - self.cpp_info.components["libarrow_flight_sql"].names["pkg_config"] = "flight_sql" + self.cpp_info.components["libarrow_flight_sql"].set_property("pkg_config_name", "flight_sql") + 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.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") @@ -685,9 +668,32 @@ 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 + self.cpp_info.filenames["cmake_find_package"] = "Arrow" + 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.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"): + self.cpp_info.components["libarrow_substrait"].names["cmake_find_package"] = "arrow_substrait" + self.cpp_info.components["libarrow_substrait"].names["cmake_find_package_multi"] = "arrow_substrait" + 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.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.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/all/test_package/conanfile.py b/recipes/arrow/all/test_package/conanfile.py index 1111583fea732..a9fb96656f203 100644 --- a/recipes/arrow/all/test_package/conanfile.py +++ b/recipes/arrow/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/arrow/config.yml b/recipes/arrow/config.yml index 06c575d489c3c..c3c169ecfec73 100644 --- a/recipes/arrow/config.yml +++ b/recipes/arrow/config.yml @@ -1,4 +1,14 @@ versions: + "14.0.2": + folder: all + "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/conandata.yml b/recipes/arsenalgear/all/conandata.yml index 3b459d19be1fc..0408a2c5f4e26 100644 --- a/recipes/arsenalgear/all/conandata.yml +++ b/recipes/arsenalgear/all/conandata.yml @@ -8,3 +8,9 @@ sources: "1.2.2": url: "https://github.com/JustWhit3/arsenalgear-cpp/archive/refs/tags/v1.2.2.tar.gz" sha256: "556155d0be0942bcdd5df02fcda258579915e76b5a70e7220de6ef38c8ca7779" +patches: + "2.1.0": + - patch_file: "patches/2.1.0-0001-fix-cmake.patch" + patch_description: "CMake: allow shared, honor compiler.cppstd, avoid to download and build doctest" + patch_type: "conan" + patch_source: "https://github.com/JustWhit3/arsenalgear-cpp/pull/4" diff --git a/recipes/arsenalgear/all/conanfile.py b/recipes/arsenalgear/all/conanfile.py index 94953657bcd46..b33bbef5afbfc 100644 --- a/recipes/arsenalgear/all/conanfile.py +++ b/recipes/arsenalgear/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc -from conan.tools.files import 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 +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 @@ -17,12 +17,14 @@ class ArsenalgearConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/JustWhit3/arsenalgear-cpp" topics = ("constants", "math", "operators", "stream") - package_type = "static-library" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { + "shared": [True, False], "fPIC": [True, False], } default_options = { + "shared": False, "fPIC": True, } @@ -37,10 +39,11 @@ def _compilers_minimum_version(self): "msvc": "192", "gcc": "8", "clang": "7", - "apple-clang": "12.0", + "apple-clang": "12", } def export_sources(self): + export_conandata_patches(self) if Version(self.version) < "2.1.0": copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) @@ -49,7 +52,7 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.get_safe("shared"): + if self.options.shared: self.options.rm_safe("fPIC") def layout(self): @@ -57,16 +60,15 @@ 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 self.requires("exprtk/0.0.2", transitive_headers=True) def validate(self): - # arsenalgear doesn't support Visual Studio(yet). - if is_msvc(self): - raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio(yet)") + if Version(self.version) < "2.1.0" and is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio.") if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) @@ -89,6 +91,7 @@ def generate(self): deps.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) if Version(self.version) < "2.1.0": cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) @@ -104,6 +107,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", "arsenalgear") + self.cpp_info.set_property("cmake_target_name", "arsenalgear::arsenalgear") self.cpp_info.libs = ["arsenalgear"] if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/arsenalgear/all/patches/2.1.0-0001-fix-cmake.patch b/recipes/arsenalgear/all/patches/2.1.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..a54dc4ff14828 --- /dev/null +++ b/recipes/arsenalgear/all/patches/2.1.0-0001-fix-cmake.patch @@ -0,0 +1,45 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,27 +16,26 @@ if( EXISTS "${LOC_PATH}" ) + endif() + + # Set c++ standard options +-set( CMAKE_CXX_STANDARD 17 ) +-set( CMAKE_CXX_STANDARD_REQUIRED ON ) +-set( CMAKE_CXX_EXTENSIONS OFF ) + + # Fetching dependencies +-add_subdirectory( deps ) + + # Include directories + include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include ) + + # Create static library +-add_library( arsenalgear STATIC ++add_library( arsenalgear + src/stream.cpp + src/system.cpp + src/utils.cpp + ) ++set_target_properties(arsenalgear PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) ++target_compile_features(arsenalgear PUBLIC cxx_std_17) + add_library( arsenalgear::arsenalgear ALIAS arsenalgear ) + + # Compile tests + option( ARSENALGEAR_TESTS "Enable / disable tests." ON ) + if( ARSENALGEAR_TESTS ) ++ add_subdirectory( deps ) + add_subdirectory( test ) + else() + message( STATUS "Skipping tests." ) +@@ -57,7 +56,9 @@ install( + install( + TARGETS arsenalgear + EXPORT arsenalgearTargets +- DESTINATION lib ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin + ) + + install( diff --git a/recipes/artery-font-format/all/conanfile.py b/recipes/artery-font-format/all/conanfile.py index a477d0ff0e98a..0b2ff0a648da1 100644 --- a/recipes/artery-font-format/all/conanfile.py +++ b/recipes/artery-font-format/all/conanfile.py @@ -1,6 +1,8 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.files import get, copy +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class ArteryFontFormatConan(ConanFile): @@ -10,18 +12,30 @@ class ArteryFontFormatConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "Artery Atlas Font format library" topics = ("artery", "font", "atlas") - + package_type = "header-library" 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + # header only: no build step + pass def package(self): - self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") - self.copy("*.h", src=self._source_subfolder, dst="include") - self.copy("*.hpp", src=self._source_subfolder, dst="include") + copy(self, pattern="LICENSE.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"), + src=self.source_folder, + ) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) diff --git a/recipes/artery-font-format/all/test_package/CMakeLists.txt b/recipes/artery-font-format/all/test_package/CMakeLists.txt index 454c47bb2cbab..240a8cec38d93 100644 --- a/recipes/artery-font-format/all/test_package/CMakeLists.txt +++ b/recipes/artery-font-format/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) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(artery-font-format 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) +target_link_libraries(${PROJECT_NAME} artery-font-format::artery-font-format) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/artery-font-format/all/test_package/conanfile.py b/recipes/artery-font-format/all/test_package/conanfile.py index c53028872776c..26110ca175735 100644 --- a/recipes/artery-font-format/all/test_package/conanfile.py +++ b/recipes/artery-font-format/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_layout, CMake import os +# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - generators = "cmake" + 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,7 +22,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") arfont = os.path.join(self.source_folder, "example.arfont") - self.run("{} {}".format(bin_path, arfont), run_environment=True) + self.run(f"{bin_path} {arfont}", env="conanrun") diff --git a/recipes/asio-grpc/all/conandata.yml b/recipes/asio-grpc/all/conandata.yml index 67c8b715cb2d3..a64863b4c9e25 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 3bb6966103744..fff2d0aaef3d8 100644 --- a/recipes/asio-grpc/all/conanfile.py +++ b/recipes/asio-grpc/all/conanfile.py @@ -11,13 +11,14 @@ class AsioGrpcConan(ConanFile): name = "asio-grpc" - description = ("Asynchronous gRPC with Asio/unified executors") - homepage = "https://github.com/Tradias/asio-grpc" - url = "https://github.com/conan-io/conan-center-index" + description = "Asynchronous gRPC with Asio/unified executors" license = "Apache-2.0" - topics = ("cpp", "asynchronous", "grpc", "asio", "asynchronous-programming", "cpp17", "coroutine", "cpp20", "executors") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tradias/asio-grpc" + topics = ("cpp", "asynchronous", "grpc", "asio", "asynchronous-programming", "cpp17", "coroutine", "cpp20", "executors", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True options = { "backend": ["boost", "asio", "unifex"], "local_allocator": ["auto", "memory_resource", "boost_container", "recycling_allocator"], @@ -26,6 +27,7 @@ class AsioGrpcConan(ConanFile): "backend": "boost", "local_allocator": "auto", } + no_copy_source = True @property def _min_cppstd(self): @@ -36,20 +38,11 @@ def _compilers_minimum_version(self): return { "gcc": "7", "Visual Studio": "15.7", + "msvc": "191", "clang": "6", "apple-clang": "11", } - 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: - 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(f"{self.name} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") - def configure(self): self._local_allocator_option = self.options.local_allocator if self._local_allocator_option == "auto": @@ -65,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") @@ -78,6 +71,24 @@ def package_id(self): 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: + 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.warning( + 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) @@ -98,8 +109,11 @@ def package(self): rm(self, "asio-grpc*", os.path.join(self.package_folder, "lib", "cmake", "asio-grpc")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + build_modules = [os.path.join("lib", "cmake", "asio-grpc", "AsioGrpcProtobufGenerator.cmake")] - + self.cpp_info.requires = ["grpc::grpc++_unsecure"] if self.options.backend == "boost": self.cpp_info.defines = ["AGRPC_BOOST_ASIO"] diff --git a/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt b/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt index e68b2def0d618..91630d79f4abb 100644 --- a/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt +++ b/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt @@ -1,34 +1,8 @@ -cmake_minimum_required(VERSION 3.14) -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(asio-grpc REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE asio-grpc::asio-grpc) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) - -# See https://github.com/chriskohlhoff/asio/issues/955 -target_compile_definitions(${PROJECT_NAME} - PRIVATE BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC) - -if(${asio-grpc_VERSION} VERSION_GREATER_EQUAL 2) - target_compile_definitions(${PROJECT_NAME} PRIVATE ASIO_GRPC_V2) -endif() - -if(CMAKE_CROSSCOMPILING) - # Assuming protoc plugins needed by `asio_grpc_protobuf_generate` are not - # available when cross compiling - target_compile_definitions(${PROJECT_NAME} PRIVATE CROSSCOMPILING) -else() - asio_grpc_protobuf_generate( - GENERATE_GRPC - TARGET - ${PROJECT_NAME} - OUT_DIR - "${CMAKE_CURRENT_BINARY_DIR}/generated" - PROTOS - "${CMAKE_CURRENT_LIST_DIR}/../test_package/test.proto") -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/asio-grpc/config.yml b/recipes/asio-grpc/config.yml index 25e51279385fd..552070583e67e 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 46bc4f8f41b43..5d0a18b1c54ce 100644 --- a/recipes/asio/all/conandata.yml +++ b/recipes/asio/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.29.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-29-0.tar.gz" + sha256: "44305859b4e6664dbbf853c1ef8ca0259d694f033753ae309fcb2534ca20f721" + "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/all/conanfile.py b/recipes/asio/all/conanfile.py index b96eb6fa96e4a..301282db06249 100644 --- a/recipes/asio/all/conanfile.py +++ b/recipes/asio/all/conanfile.py @@ -8,23 +8,24 @@ class Asio(ConanFile): name = "asio" - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://think-async.com/Asio" description = "Asio is a cross-platform C++ library for network and low-level I/O" - topics = ("asio", "network", "io", "low-level") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://think-async.com/Asio" + topics = ("network", "io", "low-level", "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 diff --git a/recipes/asio/all/test_v1_package/CMakeLists.txt b/recipes/asio/all/test_v1_package/CMakeLists.txt index 0308114c0432b..91630d79f4abb 100644 --- a/recipes/asio/all/test_v1_package/CMakeLists.txt +++ b/recipes/asio/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(asio REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE asio::asio) -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/asio/config.yml b/recipes/asio/config.yml index 06fbadd587b1a..5385ba9219644 100644 --- a/recipes/asio/config.yml +++ b/recipes/asio/config.yml @@ -1,4 +1,10 @@ versions: + "1.29.0": + folder: all + "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 83429575a7f31..c7d26af9b8d79 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 72f86ddd2bed5..e24e73ab351bc 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 534923606ca41..ed96bb307a88d 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 6f021e008adb4..375b192d92523 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 1445d96a11b7c..2797e98541843 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 fdd67862ddb24..27151094d0e71 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 67d2f67fd3661..dedc3847ab7ea 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 2a1e7bc39e620..9642d329d9a0a 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/astc-codec/all/conanfile.py b/recipes/astc-codec/all/conanfile.py index a02aae0b4d930..2fab4a9810372 100644 --- a/recipes/astc-codec/all/conanfile.py +++ b/recipes/astc-codec/all/conanfile.py @@ -9,11 +9,13 @@ class AstcCodecConan(ConanFile): name = "astc-codec" - description = " A software ASTC decoder implementation which supports the ASTC LDR profile" + description = "A software ASTC decoder implementation which supports the ASTC LDR profile" homepage = "https://github.com/google/astc-codec" url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" topics = ("astc", "codec") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/astc-codec/all/test_v1_package/CMakeLists.txt b/recipes/astc-codec/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/astc-codec/all/test_v1_package/CMakeLists.txt +++ b/recipes/astc-codec/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/astro-informatics-so3/all/CMakeLists.txt b/recipes/astro-informatics-so3/all/CMakeLists.txt deleted file mode 100644 index 0496b29838549..0000000000000 --- 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 24be830f3db99..e7486ed5b8c5a 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 aecca63b59f68..6e7e3d57dba81 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 abcaeed3f89b6..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..abcaeed3f89b6 --- /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/async_simple/all/conanfile.py b/recipes/async_simple/all/conanfile.py index cd5c0701011d2..52e7c0ae4b223 100644 --- a/recipes/async_simple/all/conanfile.py +++ b/recipes/async_simple/all/conanfile.py @@ -7,7 +7,6 @@ from conan.tools.layout import basic_layout import os - required_conan_version = ">=1.52.0" @@ -17,7 +16,9 @@ class AsyncSimpleConan(ConanFile): license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/alibaba/async_simple" - topics = ("modules", "asynchronous", "coroutines", "cpp20") + topics = ("modules", "asynchronous", "coroutines", "cpp20", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -61,7 +62,7 @@ def build_requirements(self): 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): apply_conandata_patches(self) diff --git a/recipes/async_simple/all/test_package/CMakeLists.txt b/recipes/async_simple/all/test_package/CMakeLists.txt index 0c557f6f0a457..8b854aa258e40 100644 --- a/recipes/async_simple/all/test_package/CMakeLists.txt +++ b/recipes/async_simple/all/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.15) +project(test_package CXX) -project(test_package CXX) # if the project uses c++ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) + find_package(async_simple REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package target_link_libraries(${PROJECT_NAME} PRIVATE async_simple::async_simple_header_only) diff --git a/recipes/async_simple/all/test_v1_package/CMakeLists.txt b/recipes/async_simple/all/test_v1_package/CMakeLists.txt index d25dca4fa93e5..91630d79f4abb 100644 --- a/recipes/async_simple/all/test_v1_package/CMakeLists.txt +++ b/recipes/async_simple/all/test_v1_package/CMakeLists.txt @@ -1,15 +1,8 @@ cmake_minimum_required(VERSION 3.15) - -project(test_package CXX) # if the project uses c++ -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(async_simple REQUIRED CONFIG) - -# Re-use the same source file from test_package folder -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package -target_link_libraries(${PROJECT_NAME} PRIVATE async_simple::async_simple_header_only) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/asyncly/all/conandata.yml b/recipes/asyncly/all/conandata.yml new file mode 100644 index 0000000000000..e12604057e984 --- /dev/null +++ b/recipes/asyncly/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230420": + url: "https://github.com/goto-opensource/asyncly/archive/e50ce7cf227a86ee0558a89a55f43e34f63e9316.zip" + sha256: "b5d9fcf6baddba48ad5ed5ed6e6ff50ad2ac6340e29c344fe621046e09072357" diff --git a/recipes/asyncly/all/conanfile.py b/recipes/asyncly/all/conanfile.py new file mode 100644 index 0000000000000..35a484db0a6f6 --- /dev/null +++ b/recipes/asyncly/all/conanfile.py @@ -0,0 +1,113 @@ +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 get, copy, rm, 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 PackageConan(ConanFile): + name = "asyncly" + description = "High level concurrency primitives for C++" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/goto-opensource/asyncly" + topics = ("c++", "asynchronous", "communication") + 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 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "13", + "apple-clang": "13", + } + + 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("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): + 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." + ) + 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_TESTING"] = False + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.generate() + tc = CMakeDeps(self) + 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")) + 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")) + + def package_info(self): + self.cpp_info.libs = ["asyncly"] + self.cpp_info.requires = ["boost::headers", "function2::function2", "prometheus-cpp::prometheus-cpp-core"] + + self.cpp_info.set_property("cmake_file_name", "asyncly") + self.cpp_info.set_property("cmake_target_name", "asyncly::asyncly") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "asyncly" + self.cpp_info.filenames["cmake_find_package_multi"] = "asyncly" + self.cpp_info.names["cmake_find_package"] = "asyncly" + self.cpp_info.names["cmake_find_package_multi"] = "asyncly" diff --git a/recipes/asyncly/all/test_package/CMakeLists.txt b/recipes/asyncly/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e1381e7ef86e9 --- /dev/null +++ b/recipes/asyncly/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(asyncly REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE asyncly::asyncly) +target_compile_definitions(${PROJECT_NAME} PRIVATE WIN32_LEAN_AND_MEAN) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/asyncly/all/test_package/conanfile.py b/recipes/asyncly/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/asyncly/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/asyncly/all/test_package/test_package.cpp b/recipes/asyncly/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b5674382d1ec9 --- /dev/null +++ b/recipes/asyncly/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include "asyncly/executor/AsioExecutorController.h" +#include "asyncly/executor/MetricsWrapper.h" +#include "asyncly/executor/ThreadPoolExecutorController.h" + +static void task() +{ +} + +int main() +{ + auto threadPool = asyncly::ThreadPoolExecutorController::create(2); + + threadPool->get_executor()->post([]() { task(); }); + + return 0; +} diff --git a/recipes/asyncly/config.yml b/recipes/asyncly/config.yml new file mode 100644 index 0000000000000..7c6ba2bb8da04 --- /dev/null +++ b/recipes/asyncly/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230420": + folder: all diff --git a/recipes/at-spi2-atk/all/conanfile.py b/recipes/at-spi2-atk/all/conanfile.py index 2fc37026d8c0f..e8f187953a737 100644 --- a/recipes/at-spi2-atk/all/conanfile.py +++ b/recipes/at-spi2-atk/all/conanfile.py @@ -1,5 +1,8 @@ -from conans import ConanFile, Meson, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, rmdir + +from conans import Meson import os required_conan_version = ">=1.33.0" @@ -21,6 +24,7 @@ class AtSPI2AtkConan(ConanFile): "shared": False, "fPIC": True, } + deprecated = "at-spi2-core" _meson = None @@ -48,25 +52,21 @@ def configure(self): del self.options.fPIC del self.settings.compiler.libcxx del self.settings.compiler.cppstd - if self.options.shared: - self.options["at-spi2-core"].shared = True - self.options["atk"].shared = True - self.options["glib"].shared = True def build_requirements(self): - self.build_requires("meson/0.62.2") - self.build_requires('pkgconf/1.7.4') + self.build_requires("meson/1.1.1") + self.build_requires('pkgconf/1.9.3') def requirements(self): self.requires("at-spi2-core/2.44.1") self.requires("atk/2.38.0") - self.requires("glib/2.73.0") - self.requires("libxml2/2.9.14") + self.requires("glib/2.76.3") + self.requires("libxml2/2.11.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, destination=self._source_subfolder) def _configure_meson(self): if self._meson: @@ -85,14 +85,9 @@ def package(self): self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) meson = self._configure_meson() meson.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.libs = tools.collect_libs(self) + self.cpp_info.libs = ['atk-bridge-2.0'] self.cpp_info.includedirs = [os.path.join('include', 'at-spi2-atk', '2.0')] self.cpp_info.names['pkg_config'] = 'atk-bridge-2.0' - - def package_id(self): - self.info.requires["at-spi2-core"].full_package_mode() - self.info.requires["atk"].full_package_mode() - self.info.requires["glib"].full_package_mode() diff --git a/recipes/at-spi2-core/all/conanfile.py b/recipes/at-spi2-core/all/conanfile.py index e6ca0e2427585..32d98e739d744 100644 --- a/recipes/at-spi2-core/all/conanfile.py +++ b/recipes/at-spi2-core/all/conanfile.py @@ -1,5 +1,9 @@ -from conans import ConanFile, Meson, 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, replace_in_file,rmdir +from conan.tools.scm import Version + +from conans import Meson import os @@ -11,6 +15,7 @@ class AtSpi2CoreConan(ConanFile): homepage = "https://gitlab.gnome.org/GNOME/at-spi2-core/" license = "LGPL-2.1-or-later" generators = "pkg_config" + deprecated = "Consumers should migrate to at-spi2-core/[>=2.45.1], which includes atk and at-spi2-atk" settings = "os", "arch", "compiler", "build_type" options = { @@ -35,26 +40,23 @@ def _build_subfolder(self): _meson = None 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 configure(self): if self.options.shared: del self.options.fPIC del self.settings.compiler.libcxx del self.settings.compiler.cppstd - if self.options.shared: - self.options["glib"].shared = True def build_requirements(self): - self.build_requires("meson/0.62.2") - self.build_requires("pkgconf/1.7.4") + self.build_requires("meson/1.1.1") + self.build_requires("pkgconf/1.9.3") def requirements(self): - self.requires("glib/2.73.0") + self.requires("glib/2.76.3") if self.options.with_x11: self.requires("xorg/system") - self.requires("dbus/1.12.20") + self.requires("dbus/1.15.2") def validate(self): if self.options.shared and not self.options["glib"].shared: @@ -65,7 +67,7 @@ def validate(self): raise ConanInvalidConfiguration("only linux is supported by this recipe") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def _configure_meson(self): @@ -84,10 +86,9 @@ def _configure_meson(self): return self._meson def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if tools.Version(self.version) >= "2.42.0": - tools.replace_in_file(os.path.join(self._source_subfolder, "bus", "meson.build"), + apply_conandata_patches(self) + if Version(self.version) >= "2.42.0": + replace_in_file(self, os.path.join(self._source_subfolder, "bus", "meson.build"), "if x11_dep.found()", "if x11_option == 'yes'") meson = self._configure_meson() @@ -97,14 +98,11 @@ def package(self): self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) meson = self._configure_meson() meson.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "etc")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ['atspi'] self.cpp_info.includedirs = ["include/at-spi-2.0"] self.cpp_info.names["pkg_config"] = "atspi-2" - - def package_id(self): - self.info.requires["glib"].full_package_mode() diff --git a/recipes/at-spi2-core/config.yml b/recipes/at-spi2-core/config.yml index f3e69dd713878..f37e219eb66cb 100644 --- a/recipes/at-spi2-core/config.yml +++ b/recipes/at-spi2-core/config.yml @@ -11,13 +11,17 @@ versions: folder: all "2.44.1": folder: all - "2.45.1": - folder: new - "2.45.90": - folder: new "2.46.0": folder: new "2.47.1": folder: new "2.48.0": folder: new + "2.48.3": + folder: new + "2.49.1": + folder: new + "2.50.0": + folder: new + "2.51.0": + folder: new diff --git a/recipes/at-spi2-core/new/conandata.yml b/recipes/at-spi2-core/new/conandata.yml index 1d17c17af2c31..58e8f4f097094 100644 --- a/recipes/at-spi2-core/new/conandata.yml +++ b/recipes/at-spi2-core/new/conandata.yml @@ -1,4 +1,16 @@ sources: + "2.51.0": + sha256: 8dd07c6160e3115f4f77e2205963449def6822a3dc85d495c5db389f56663037 + url: https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.51/at-spi2-core-2.51.0.tar.xz + "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 + "2.48.3": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.48/at-spi2-core-2.48.3.tar.xz" + sha256: "37316df43ca9989ce539d54cf429a768c28bb38a0b34950beadd0421827edf55" "2.48.0": url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.48/at-spi2-core-2.48.0.tar.xz" sha256: "905a5b6f1790b68ee803bffa9f5fab4ceb591fb4fae0b2f8c612c54f1d4e8a30" @@ -8,20 +20,3 @@ sources: "2.46.0": url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.46/at-spi2-core-2.46.0.tar.xz" sha256: "aa0c86c79f7a8d67bae49a5b7a5ab08430c608cffe6e33bf47a72f41ab03c3d0" - "2.45.90": - url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.45/at-spi2-core-2.45.90.tar.xz" - sha256: "e9050ad3c24937548396b2377f2fcdb9321ce2daffad35e7554e8f6ad850ab0d" - "2.45.1": - sha256: "ba95f346e93108fbb3462c62437081d582154db279b4052dedc52a706828b192" - url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.45/at-spi2-core-2.45.1.tar.xz" -patches: - "2.48.0": - - patch_file: "patches/93.patch" - "2.47.1": - - patch_file: "patches/93.patch" - "2.46.0": - - patch_file: "patches/93.patch" - "2.45.90": - - patch_file: "patches/93.patch" - "2.45.1": - - patch_file: "patches/93.patch" diff --git a/recipes/at-spi2-core/new/conanfile.py b/recipes/at-spi2-core/new/conanfile.py index a1cb677e5eea0..02a871957ee4f 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.0") + 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.2") + self.requires("glib/2.78.0") if self.options.with_x11: self.requires("xorg/system") - self.requires("dbus/1.15.2") + 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/patches/93.patch b/recipes/at-spi2-core/new/patches/93.patch deleted file mode 100644 index 7ff4a19473df8..0000000000000 --- a/recipes/at-spi2-core/new/patches/93.patch +++ /dev/null @@ -1,521 +0,0 @@ -From 99a88f23978d668802f63470c7f75ba3886166e1 Mon Sep 17 00:00:00 2001 -From: ericLemanissier -Date: Tue, 5 Jul 2022 10:13:54 +0000 -Subject: [PATCH] add license file - -fixes GNOME/at-spi2-core#78 ---- - COPYING | 502 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 502 insertions(+) - create mode 100644 COPYING - -diff --git a/COPYING b/COPYING -new file mode 100644 -index 00000000..4362b491 ---- /dev/null -+++ b/COPYING -@@ -0,0 +1,502 @@ -+ GNU LESSER GENERAL PUBLIC LICENSE -+ Version 2.1, February 1999 -+ -+ Copyright (C) 1991, 1999 Free Software Foundation, Inc. -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ Everyone is permitted to copy and distribute verbatim copies -+ of this license document, but changing it is not allowed. -+ -+[This is the first released version of the Lesser GPL. It also counts -+ as the successor of the GNU Library Public License, version 2, hence -+ the version number 2.1.] -+ -+ Preamble -+ -+ The licenses for most software are designed to take away your -+freedom to share and change it. By contrast, the GNU General Public -+Licenses are intended to guarantee your freedom to share and change -+free software--to make sure the software is free for all its users. -+ -+ This license, the Lesser General Public License, applies to some -+specially designated software packages--typically libraries--of the -+Free Software Foundation and other authors who decide to use it. You -+can use it too, but we suggest you first think carefully about whether -+this license or the ordinary General Public License is the better -+strategy to use in any particular case, based on the explanations below. -+ -+ When we speak of free software, we are referring to freedom of use, -+not price. Our General Public Licenses are designed to make sure that -+you have the freedom to distribute copies of free software (and charge -+for this service if you wish); that you receive source code or can get -+it if you want it; that you can change the software and use pieces of -+it in new free programs; and that you are informed that you can do -+these things. -+ -+ To protect your rights, we need to make restrictions that forbid -+distributors to deny you these rights or to ask you to surrender these -+rights. These restrictions translate to certain responsibilities for -+you if you distribute copies of the library or if you modify it. -+ -+ For example, if you distribute copies of the library, whether gratis -+or for a fee, you must give the recipients all the rights that we gave -+you. You must make sure that they, too, receive or can get the source -+code. If you link other code with the library, you must provide -+complete object files to the recipients, so that they can relink them -+with the library after making changes to the library and recompiling -+it. And you must show them these terms so they know their rights. -+ -+ We protect your rights with a two-step method: (1) we copyright the -+library, and (2) we offer you this license, which gives you legal -+permission to copy, distribute and/or modify the library. -+ -+ To protect each distributor, we want to make it very clear that -+there is no warranty for the free library. Also, if the library is -+modified by someone else and passed on, the recipients should know -+that what they have is not the original version, so that the original -+author's reputation will not be affected by problems that might be -+introduced by others. -+ -+ Finally, software patents pose a constant threat to the existence of -+any free program. We wish to make sure that a company cannot -+effectively restrict the users of a free program by obtaining a -+restrictive license from a patent holder. Therefore, we insist that -+any patent license obtained for a version of the library must be -+consistent with the full freedom of use specified in this license. -+ -+ Most GNU software, including some libraries, is covered by the -+ordinary GNU General Public License. This license, the GNU Lesser -+General Public License, applies to certain designated libraries, and -+is quite different from the ordinary General Public License. We use -+this license for certain libraries in order to permit linking those -+libraries into non-free programs. -+ -+ When a program is linked with a library, whether statically or using -+a shared library, the combination of the two is legally speaking a -+combined work, a derivative of the original library. The ordinary -+General Public License therefore permits such linking only if the -+entire combination fits its criteria of freedom. The Lesser General -+Public License permits more lax criteria for linking other code with -+the library. -+ -+ We call this license the "Lesser" General Public License because it -+does Less to protect the user's freedom than the ordinary General -+Public License. It also provides other free software developers Less -+of an advantage over competing non-free programs. These disadvantages -+are the reason we use the ordinary General Public License for many -+libraries. However, the Lesser license provides advantages in certain -+special circumstances. -+ -+ For example, on rare occasions, there may be a special need to -+encourage the widest possible use of a certain library, so that it becomes -+a de-facto standard. To achieve this, non-free programs must be -+allowed to use the library. A more frequent case is that a free -+library does the same job as widely used non-free libraries. In this -+case, there is little to gain by limiting the free library to free -+software only, so we use the Lesser General Public License. -+ -+ In other cases, permission to use a particular library in non-free -+programs enables a greater number of people to use a large body of -+free software. For example, permission to use the GNU C Library in -+non-free programs enables many more people to use the whole GNU -+operating system, as well as its variant, the GNU/Linux operating -+system. -+ -+ Although the Lesser General Public License is Less protective of the -+users' freedom, it does ensure that the user of a program that is -+linked with the Library has the freedom and the wherewithal to run -+that program using a modified version of the Library. -+ -+ The precise terms and conditions for copying, distribution and -+modification follow. Pay close attention to the difference between a -+"work based on the library" and a "work that uses the library". The -+former contains code derived from the library, whereas the latter must -+be combined with the library in order to run. -+ -+ GNU LESSER GENERAL PUBLIC LICENSE -+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -+ -+ 0. This License Agreement applies to any software library or other -+program which contains a notice placed by the copyright holder or -+other authorized party saying it may be distributed under the terms of -+this Lesser General Public License (also called "this License"). -+Each licensee is addressed as "you". -+ -+ A "library" means a collection of software functions and/or data -+prepared so as to be conveniently linked with application programs -+(which use some of those functions and data) to form executables. -+ -+ The "Library", below, refers to any such software library or work -+which has been distributed under these terms. A "work based on the -+Library" means either the Library or any derivative work under -+copyright law: that is to say, a work containing the Library or a -+portion of it, either verbatim or with modifications and/or translated -+straightforwardly into another language. (Hereinafter, translation is -+included without limitation in the term "modification".) -+ -+ "Source code" for a work means the preferred form of the work for -+making modifications to it. For a library, complete source code means -+all the source code for all modules it contains, plus any associated -+interface definition files, plus the scripts used to control compilation -+and installation of the library. -+ -+ Activities other than copying, distribution and modification are not -+covered by this License; they are outside its scope. The act of -+running a program using the Library is not restricted, and output from -+such a program is covered only if its contents constitute a work based -+on the Library (independent of the use of the Library in a tool for -+writing it). Whether that is true depends on what the Library does -+and what the program that uses the Library does. -+ -+ 1. You may copy and distribute verbatim copies of the Library's -+complete source code as you receive it, in any medium, provided that -+you conspicuously and appropriately publish on each copy an -+appropriate copyright notice and disclaimer of warranty; keep intact -+all the notices that refer to this License and to the absence of any -+warranty; and distribute a copy of this License along with the -+Library. -+ -+ You may charge a fee for the physical act of transferring a copy, -+and you may at your option offer warranty protection in exchange for a -+fee. -+ -+ 2. You may modify your copy or copies of the Library or any portion -+of it, thus forming a work based on the Library, and copy and -+distribute such modifications or work under the terms of Section 1 -+above, provided that you also meet all of these conditions: -+ -+ a) The modified work must itself be a software library. -+ -+ b) You must cause the files modified to carry prominent notices -+ stating that you changed the files and the date of any change. -+ -+ c) You must cause the whole of the work to be licensed at no -+ charge to all third parties under the terms of this License. -+ -+ d) If a facility in the modified Library refers to a function or a -+ table of data to be supplied by an application program that uses -+ the facility, other than as an argument passed when the facility -+ is invoked, then you must make a good faith effort to ensure that, -+ in the event an application does not supply such function or -+ table, the facility still operates, and performs whatever part of -+ its purpose remains meaningful. -+ -+ (For example, a function in a library to compute square roots has -+ a purpose that is entirely well-defined independent of the -+ application. Therefore, Subsection 2d requires that any -+ application-supplied function or table used by this function must -+ be optional: if the application does not supply it, the square -+ root function must still compute square roots.) -+ -+These requirements apply to the modified work as a whole. If -+identifiable sections of that work are not derived from the Library, -+and can be reasonably considered independent and separate works in -+themselves, then this License, and its terms, do not apply to those -+sections when you distribute them as separate works. But when you -+distribute the same sections as part of a whole which is a work based -+on the Library, the distribution of the whole must be on the terms of -+this License, whose permissions for other licensees extend to the -+entire whole, and thus to each and every part regardless of who wrote -+it. -+ -+Thus, it is not the intent of this section to claim rights or contest -+your rights to work written entirely by you; rather, the intent is to -+exercise the right to control the distribution of derivative or -+collective works based on the Library. -+ -+In addition, mere aggregation of another work not based on the Library -+with the Library (or with a work based on the Library) on a volume of -+a storage or distribution medium does not bring the other work under -+the scope of this License. -+ -+ 3. You may opt to apply the terms of the ordinary GNU General Public -+License instead of this License to a given copy of the Library. To do -+this, you must alter all the notices that refer to this License, so -+that they refer to the ordinary GNU General Public License, version 2, -+instead of to this License. (If a newer version than version 2 of the -+ordinary GNU General Public License has appeared, then you can specify -+that version instead if you wish.) Do not make any other change in -+these notices. -+ -+ Once this change is made in a given copy, it is irreversible for -+that copy, so the ordinary GNU General Public License applies to all -+subsequent copies and derivative works made from that copy. -+ -+ This option is useful when you wish to copy part of the code of -+the Library into a program that is not a library. -+ -+ 4. You may copy and distribute the Library (or a portion or -+derivative of it, under Section 2) in object code or executable form -+under the terms of Sections 1 and 2 above provided that you accompany -+it with the complete corresponding machine-readable source code, which -+must be distributed under the terms of Sections 1 and 2 above on a -+medium customarily used for software interchange. -+ -+ If distribution of object code is made by offering access to copy -+from a designated place, then offering equivalent access to copy the -+source code from the same place satisfies the requirement to -+distribute the source code, even though third parties are not -+compelled to copy the source along with the object code. -+ -+ 5. A program that contains no derivative of any portion of the -+Library, but is designed to work with the Library by being compiled or -+linked with it, is called a "work that uses the Library". Such a -+work, in isolation, is not a derivative work of the Library, and -+therefore falls outside the scope of this License. -+ -+ However, linking a "work that uses the Library" with the Library -+creates an executable that is a derivative of the Library (because it -+contains portions of the Library), rather than a "work that uses the -+library". The executable is therefore covered by this License. -+Section 6 states terms for distribution of such executables. -+ -+ When a "work that uses the Library" uses material from a header file -+that is part of the Library, the object code for the work may be a -+derivative work of the Library even though the source code is not. -+Whether this is true is especially significant if the work can be -+linked without the Library, or if the work is itself a library. The -+threshold for this to be true is not precisely defined by law. -+ -+ If such an object file uses only numerical parameters, data -+structure layouts and accessors, and small macros and small inline -+functions (ten lines or less in length), then the use of the object -+file is unrestricted, regardless of whether it is legally a derivative -+work. (Executables containing this object code plus portions of the -+Library will still fall under Section 6.) -+ -+ Otherwise, if the work is a derivative of the Library, you may -+distribute the object code for the work under the terms of Section 6. -+Any executables containing that work also fall under Section 6, -+whether or not they are linked directly with the Library itself. -+ -+ 6. As an exception to the Sections above, you may also combine or -+link a "work that uses the Library" with the Library to produce a -+work containing portions of the Library, and distribute that work -+under terms of your choice, provided that the terms permit -+modification of the work for the customer's own use and reverse -+engineering for debugging such modifications. -+ -+ You must give prominent notice with each copy of the work that the -+Library is used in it and that the Library and its use are covered by -+this License. You must supply a copy of this License. If the work -+during execution displays copyright notices, you must include the -+copyright notice for the Library among them, as well as a reference -+directing the user to the copy of this License. Also, you must do one -+of these things: -+ -+ a) Accompany the work with the complete corresponding -+ machine-readable source code for the Library including whatever -+ changes were used in the work (which must be distributed under -+ Sections 1 and 2 above); and, if the work is an executable linked -+ with the Library, with the complete machine-readable "work that -+ uses the Library", as object code and/or source code, so that the -+ user can modify the Library and then relink to produce a modified -+ executable containing the modified Library. (It is understood -+ that the user who changes the contents of definitions files in the -+ Library will not necessarily be able to recompile the application -+ to use the modified definitions.) -+ -+ b) Use a suitable shared library mechanism for linking with the -+ Library. A suitable mechanism is one that (1) uses at run time a -+ copy of the library already present on the user's computer system, -+ rather than copying library functions into the executable, and (2) -+ will operate properly with a modified version of the library, if -+ the user installs one, as long as the modified version is -+ interface-compatible with the version that the work was made with. -+ -+ c) Accompany the work with a written offer, valid for at -+ least three years, to give the same user the materials -+ specified in Subsection 6a, above, for a charge no more -+ than the cost of performing this distribution. -+ -+ d) If distribution of the work is made by offering access to copy -+ from a designated place, offer equivalent access to copy the above -+ specified materials from the same place. -+ -+ e) Verify that the user has already received a copy of these -+ materials or that you have already sent this user a copy. -+ -+ For an executable, the required form of the "work that uses the -+Library" must include any data and utility programs needed for -+reproducing the executable from it. However, as a special exception, -+the materials to be distributed need not include anything that is -+normally distributed (in either source or binary form) with the major -+components (compiler, kernel, and so on) of the operating system on -+which the executable runs, unless that component itself accompanies -+the executable. -+ -+ It may happen that this requirement contradicts the license -+restrictions of other proprietary libraries that do not normally -+accompany the operating system. Such a contradiction means you cannot -+use both them and the Library together in an executable that you -+distribute. -+ -+ 7. You may place library facilities that are a work based on the -+Library side-by-side in a single library together with other library -+facilities not covered by this License, and distribute such a combined -+library, provided that the separate distribution of the work based on -+the Library and of the other library facilities is otherwise -+permitted, and provided that you do these two things: -+ -+ a) Accompany the combined library with a copy of the same work -+ based on the Library, uncombined with any other library -+ facilities. This must be distributed under the terms of the -+ Sections above. -+ -+ b) Give prominent notice with the combined library of the fact -+ that part of it is a work based on the Library, and explaining -+ where to find the accompanying uncombined form of the same work. -+ -+ 8. You may not copy, modify, sublicense, link with, or distribute -+the Library except as expressly provided under this License. Any -+attempt otherwise to copy, modify, sublicense, link with, or -+distribute the Library is void, and will automatically terminate your -+rights under this License. However, parties who have received copies, -+or rights, from you under this License will not have their licenses -+terminated so long as such parties remain in full compliance. -+ -+ 9. You are not required to accept this License, since you have not -+signed it. However, nothing else grants you permission to modify or -+distribute the Library or its derivative works. These actions are -+prohibited by law if you do not accept this License. Therefore, by -+modifying or distributing the Library (or any work based on the -+Library), you indicate your acceptance of this License to do so, and -+all its terms and conditions for copying, distributing or modifying -+the Library or works based on it. -+ -+ 10. Each time you redistribute the Library (or any work based on the -+Library), the recipient automatically receives a license from the -+original licensor to copy, distribute, link with or modify the Library -+subject to these terms and conditions. You may not impose any further -+restrictions on the recipients' exercise of the rights granted herein. -+You are not responsible for enforcing compliance by third parties with -+this License. -+ -+ 11. If, as a consequence of a court judgment or allegation of patent -+infringement or for any other reason (not limited to patent issues), -+conditions are imposed on you (whether by court order, agreement or -+otherwise) that contradict the conditions of this License, they do not -+excuse you from the conditions of this License. If you cannot -+distribute so as to satisfy simultaneously your obligations under this -+License and any other pertinent obligations, then as a consequence you -+may not distribute the Library at all. For example, if a patent -+license would not permit royalty-free redistribution of the Library by -+all those who receive copies directly or indirectly through you, then -+the only way you could satisfy both it and this License would be to -+refrain entirely from distribution of the Library. -+ -+If any portion of this section is held invalid or unenforceable under any -+particular circumstance, the balance of the section is intended to apply, -+and the section as a whole is intended to apply in other circumstances. -+ -+It is not the purpose of this section to induce you to infringe any -+patents or other property right claims or to contest validity of any -+such claims; this section has the sole purpose of protecting the -+integrity of the free software distribution system which is -+implemented by public license practices. Many people have made -+generous contributions to the wide range of software distributed -+through that system in reliance on consistent application of that -+system; it is up to the author/donor to decide if he or she is willing -+to distribute software through any other system and a licensee cannot -+impose that choice. -+ -+This section is intended to make thoroughly clear what is believed to -+be a consequence of the rest of this License. -+ -+ 12. If the distribution and/or use of the Library is restricted in -+certain countries either by patents or by copyrighted interfaces, the -+original copyright holder who places the Library under this License may add -+an explicit geographical distribution limitation excluding those countries, -+so that distribution is permitted only in or among countries not thus -+excluded. In such case, this License incorporates the limitation as if -+written in the body of this License. -+ -+ 13. The Free Software Foundation may publish revised and/or new -+versions of the Lesser General Public License from time to time. -+Such new versions will be similar in spirit to the present version, -+but may differ in detail to address new problems or concerns. -+ -+Each version is given a distinguishing version number. If the Library -+specifies a version number of this License which applies to it and -+"any later version", you have the option of following the terms and -+conditions either of that version or of any later version published by -+the Free Software Foundation. If the Library does not specify a -+license version number, you may choose any version ever published by -+the Free Software Foundation. -+ -+ 14. If you wish to incorporate parts of the Library into other free -+programs whose distribution conditions are incompatible with these, -+write to the author to ask for permission. For software which is -+copyrighted by the Free Software Foundation, write to the Free -+Software Foundation; we sometimes make exceptions for this. Our -+decision will be guided by the two goals of preserving the free status -+of all derivatives of our free software and of promoting the sharing -+and reuse of software generally. -+ -+ NO WARRANTY -+ -+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -+ -+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -+DAMAGES. -+ -+ END OF TERMS AND CONDITIONS -+ -+ How to Apply These Terms to Your New Libraries -+ -+ If you develop a new library, and you want it to be of the greatest -+possible use to the public, we recommend making it free software that -+everyone can redistribute and change. You can do so by permitting -+redistribution under these terms (or, alternatively, under the terms of the -+ordinary General Public License). -+ -+ To apply these terms, attach the following notices to the library. It is -+safest to attach them to the start of each source file to most effectively -+convey the exclusion of warranty; and each file should have at least the -+"copyright" line and a pointer to where the full notice is found. -+ -+ -+ Copyright (C) -+ -+ This library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ This 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 -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with this library; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ -+Also add information on how to contact you by electronic and paper mail. -+ -+You should also get your employer (if you work as a programmer) or your -+school, if any, to sign a "copyright disclaimer" for the library, if -+necessary. Here is a sample; alter the names: -+ -+ Yoyodyne, Inc., hereby disclaims all copyright interest in the -+ library `Frob' (a library for tweaking knobs) written by James Random Hacker. -+ -+ , 1 April 1990 -+ Ty Coon, President of Vice -+ -+That's all there is to it! --- -GitLab 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 afa2476357074..0000000000000 --- 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 d4128b0450777..5aab0703e7a4e 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 0000000000000..896df27207865 --- /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 c155308c155ba..284086622ab26 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/atk/all/conanfile.py b/recipes/atk/all/conanfile.py index 851368f9af235..40a2f9c42d3e3 100644 --- a/recipes/atk/all/conanfile.py +++ b/recipes/atk/all/conanfile.py @@ -20,6 +20,7 @@ class AtkConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.atk.org" license = "LGPL-2.1-or-later" + deprecated = "at-spi2-core" settings = "os", "arch", "compiler", "build_type" options = { @@ -43,14 +44,12 @@ def configure(self): self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") - if self.options.shared: - self.options["glib"].shared = True def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.75.2") + self.requires("glib/2.76.3") def validate(self): if self.options.shared and not self.dependencies["glib"].options.shared: @@ -63,11 +62,11 @@ def validate(self): raise ConanInvalidConfiguration("this specific configuration is prevented due to internal c3i limitations") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.1.1") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/1.9.3") if hasattr(self, "settings_build") and cross_building(self): - self.tool_requires("glib/2.75.2") + self.tool_requires("glib/2.76.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/audiofile/all/conandata.yml b/recipes/audiofile/all/conandata.yml index 042cc12d06dd1..288d8a5ec4d8c 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 0d083108cea08..c9bd8f69c8aa3 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 6f7178f4a8927..fab8ac8a0b20c 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 6943fcec35d57..d95bc64031cda 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 60fb00c9f3f14..91630d79f4abb 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 5fc24e2e9c188..1b65530cbacc9 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-archive/all/conandata.yml b/recipes/autoconf-archive/all/conandata.yml index 5443eebf3e116..763c0b5a2581e 100644 --- a/recipes/autoconf-archive/all/conandata.yml +++ b/recipes/autoconf-archive/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "2021.02.19": - url: "https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2021.02.19.tar.xz" - sha256: "e8a6eb9d28ddcba8ffef3fa211653239e9bf239aba6a01a6b7cfc7ceaec69cbd" + "2023.02.20": + url: "https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2023.02.20.tar.xz" + sha256: "71d4048479ae28f1f5794619c3d72df9c01df49b1c628ef85fde37596dc31a33" "2022.09.03": url: "https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2022.09.03.tar.xz" sha256: "e07454f00d8cae7907bed42d0747798927809947684d94c37207a4d63a32f423" + "2021.02.19": + url: "https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2021.02.19.tar.xz" + sha256: "e8a6eb9d28ddcba8ffef3fa211653239e9bf239aba6a01a6b7cfc7ceaec69cbd" diff --git a/recipes/autoconf-archive/config.yml b/recipes/autoconf-archive/config.yml index d6031b4a79015..8168c2f450f36 100644 --- a/recipes/autoconf-archive/config.yml +++ b/recipes/autoconf-archive/config.yml @@ -1,5 +1,7 @@ versions: - "2021.02.19": + "2023.02.20": folder: all "2022.09.03": folder: all + "2021.02.19": + folder: all diff --git a/recipes/autoconf/all/conanfile.py b/recipes/autoconf/all/conanfile.py index 09afbd7d337d1..6030c1664be5b 100644 --- a/recipes/autoconf/all/conanfile.py +++ b/recipes/autoconf/all/conanfile.py @@ -11,7 +11,6 @@ class AutoconfConan(ConanFile): name = "autoconf" - package_type = "application" description = ( "Autoconf is an extensible package of M4 macros that produce shell " "scripts to automatically configure software source code packages" @@ -19,7 +18,9 @@ class AutoconfConan(ConanFile): license = ("GPL-2.0-or-later", "GPL-3.0-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.gnu.org/software/autoconf/" - topics = ("autoconf", "configure", "build") + topics = ("configure", "build") + + package_type = "application" settings = "os", "arch", "compiler", "build_type" @property @@ -33,12 +34,12 @@ def export_sources(self): def layout(self): basic_layout(self, src_folder="src") - def package_id(self): - self.info.clear() - def requirements(self): self.requires("m4/1.4.19") # Needed at runtime by downstream clients as well + def package_id(self): + self.info.clear() + def build_requirements(self): self.tool_requires("m4/1.4.19") if self._settings_build.os == "Windows": @@ -47,8 +48,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) def generate(self): env = VirtualBuildEnv(self) @@ -100,6 +100,7 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "res", "man")) def package_info(self): + self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] self.cpp_info.resdirs = ["res"] @@ -107,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 bb22349ed9696..540a389d38f89 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_package/test_package_cpp.cpp b/recipes/autoconf/all/test_package/test_package_cpp.cpp index e31a5ee3cfefa..01bf15d96515c 100644 --- a/recipes/autoconf/all/test_package/test_package_cpp.cpp +++ b/recipes/autoconf/all/test_package/test_package_cpp.cpp @@ -3,14 +3,14 @@ #include extern "C" { - int hello_from_c(void); +int hello_from_c(void); } void hello_from_cxx() { std::cout << "Hello world (" PACKAGE_NAME ") from c++!\n"; } -int main(int argc, char** argv) { +int main() { hello_from_cxx(); hello_from_c(); return 0; diff --git a/recipes/autoconf/all/test_v1_package/conanfile.py b/recipes/autoconf/all/test_v1_package/conanfile.py index 422d5f44c10cf..7098a4c30759b 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/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index c5504ce85bf9a..1d44aec491a20 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -12,12 +12,16 @@ class AutomakeConan(ConanFile): name = "automake" - package_type = "application" + description = ( + "Automake is a tool for automatically generating Makefile.in files" + " compliant with the GNU Coding Standards." + ) + license = ("GPL-2.0-or-later", "GPL-3.0-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.gnu.org/software/automake/" - description = "Automake is a tool for automatically generating Makefile.in files compliant with the GNU Coding Standards." topics = ("autotools", "configure", "build") - license = ("GPL-2.0-or-later", "GPL-3.0-or-later") + + package_type = "application" settings = "os", "arch", "compiler", "build_type" @property @@ -91,7 +95,7 @@ def _datarootdir(self): def package(self): autotools = Autotools(self) autotools.install() - copy(self, "COPYING*", 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")) rmdir(self, os.path.join(self._datarootdir, "info")) rmdir(self, os.path.join(self._datarootdir, "man")) @@ -114,6 +118,7 @@ def _automake_libdir(self): def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] + self.cpp_info.frameworkdirs = [] self.cpp_info.resdirs = ["res"] # For consumers with new integrations (Conan 1 and 2 compatible): diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index a8b0427416846..26fd488e0e853 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -84,7 +84,7 @@ def build(self): # Build test project autotools = Autotools(self) - autotools.autoreconf(args=['--debug']) + autotools.autoreconf(args=["--debug"]) autotools.configure() autotools.make() diff --git a/recipes/automake/all/test_package/src/test_package.cpp b/recipes/automake/all/test_package/src/test_package.cpp index cd8c2f27c3587..ec5b5ab958cbb 100644 --- a/recipes/automake/all/test_package/src/test_package.cpp +++ b/recipes/automake/all/test_package/src/test_package.cpp @@ -3,7 +3,7 @@ #include #include -int main(int argc, char** argv) { +int main() { std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; return EXIT_SUCCESS; } diff --git a/recipes/automake/all/test_package/test_package.cpp b/recipes/automake/all/test_package/test_package.cpp index cd8c2f27c3587..ec5b5ab958cbb 100644 --- a/recipes/automake/all/test_package/test_package.cpp +++ b/recipes/automake/all/test_package/test_package.cpp @@ -3,7 +3,7 @@ #include #include -int main(int argc, char** argv) { +int main() { std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; return EXIT_SUCCESS; } diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py index 14386077db5e2..fdd5b5034805a 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,6 +74,9 @@ def generate(self): tc.configure_args.append("--disable-python") tc.configure_args.append("--disable-qt5") tc.configure_args.append("--with-systemdsystemunitdir=/lib/systemd/system") + 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() PkgConfigDeps(self).generate() @@ -96,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"] @@ -113,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"] @@ -125,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 fce015c3405a9..595c0faefb42e 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 bae1467c7d687..0b5b2dd52d5e2 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 925ecbe19e448..91630d79f4abb 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/avir/all/conanfile.py b/recipes/avir/all/conanfile.py index 61093399842d4..d6b7ebc73045e 100644 --- a/recipes/avir/all/conanfile.py +++ b/recipes/avir/all/conanfile.py @@ -8,23 +8,24 @@ class AVIRConan(ConanFile): name = "avir" + description = "High-quality pro image resizing / scaling C++ library, image resize" license = "MIT" url = "https://github.com/conan-io/conan-center-index" - description = "High-quality pro image resizing / scaling C++ library, image resize" - topics = ("image-processing", "image-resizer", "lanczos", ) homepage = "https://github.com/avaneev/avir" + topics = ("image-processing", "image-resizer", "lanczos", "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 diff --git a/recipes/avir/all/test_package/CMakeLists.txt b/recipes/avir/all/test_package/CMakeLists.txt index 51fd0e87ec014..b82b306c393cb 100644 --- a/recipes/avir/all/test_package/CMakeLists.txt +++ b/recipes/avir/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(avir CONFIG REQUIRED) diff --git a/recipes/avir/all/test_v1_package/CMakeLists.txt b/recipes/avir/all/test_v1_package/CMakeLists.txt index b53aff65d290e..91630d79f4abb 100644 --- a/recipes/avir/all/test_v1_package/CMakeLists.txt +++ b/recipes/avir/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(avir CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE avir::avir) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/aws-c-auth/all/conandata.yml b/recipes/aws-c-auth/all/conandata.yml index 3f6bee7b4b086..027010126b13f 100644 --- a/recipes/aws-c-auth/all/conandata.yml +++ b/recipes/aws-c-auth/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.7.8": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.7.8.tar.gz" + sha256: "5db8ab91262b5c055e3634f2c9dc2bc1a3285c2dd5513fdcafcb3e79468dc7de" + "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 +20,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 610bd376de920..0181ea2ac5e2c 100644 --- a/recipes/aws-c-auth/all/conanfile.py +++ b/recipes/aws-c-auth/all/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir +from conan.tools.files import get, copy, rmdir, save, export_conandata_patches, apply_conandata_patches from conan.tools.scm import Version import os +import textwrap required_conan_version = ">=1.53.0" @@ -14,7 +15,7 @@ class AwsCAuth(ConanFile): "C99 library implementation of AWS client-side authentication: " "standard credentials providers and signing." ) - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-auth" topics = ("aws", "amazon", "cloud", "authentication", "credentials", "providers", "signing") @@ -29,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 @@ -43,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, transitive_libs=True) - self.requires("aws-c-http/0.6.13", transitive_headers=True, transitive_libs=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, transitive_libs=True) - self.requires("aws-c-http/0.6.22", transitive_headers=True, transitive_libs=True) - if Version(self.version) >= "0.6.5": - self.requires("aws-c-sdkutils/0.1.3", transitive_headers=True, transitive_libs=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) @@ -66,6 +77,7 @@ def generate(self): deps.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -76,25 +88,34 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-auth")) + # 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-auth": "aws-c-auth::aws-c-auth"} + ) + + 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-auth") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-auth") - # TODO: back to global scope once conan v1 support dropped - self.cpp_info.components["aws-c-auth-lib"].libs = ["aws-c-auth"] - self.cpp_info.components["aws-c-auth-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-c-cal::aws-c-cal-lib", - "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-lib", - ] - if Version(self.version) >= "0.6.5": - self.cpp_info.components["aws-c-auth-lib"].requires.append("aws-c-sdkutils::aws-c-sdkutils-lib") - - # TODO: to remove once conan v1 support dropped - self.cpp_info.filenames["cmake_find_package"] = "aws-c-auth" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-auth" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package"] = "aws-c-auth" - self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package_multi"] = "aws-c-auth" - self.cpp_info.components["aws-c-auth-lib"].set_property("cmake_target_name", "AWS::aws-c-auth") + self.cpp_info.libs = ["aws-c-auth"] + if self.options.shared: + self.cpp_info.defines.append("AWS_AUTH_USE_IMPORT_EXPORT") + + # 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-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 0000000000000..bed12b1bd563b --- /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 503ab418198f1..8edcc1ff10f28 100644 --- a/recipes/aws-c-auth/config.yml +++ b/recipes/aws-c-auth/config.yml @@ -1,4 +1,8 @@ versions: + "0.7.8": + folder: all + "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 e1b848e4dfa2d..0bf0d966b7d3a 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 3ed5c70f492e6..de7ce7d5e222d 100644 --- a/recipes/aws-c-cal/all/conanfile.py +++ b/recipes/aws-c-cal/all/conanfile.py @@ -1,11 +1,12 @@ 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 apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save from conan.tools.scm import Version import os +import textwrap -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.53.0" class AwsCCal(ConanFile): @@ -14,7 +15,8 @@ class AwsCCal(ConanFile): topics = ("aws", "amazon", "cloud", "cal", "crypt", ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-cal" - license = "Apache-2.0", + license = "Apache-2.0" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -27,11 +29,10 @@ class AwsCCal(ConanFile): @property def _needs_openssl(self): - return self.settings.os != "Windows" and not is_apple_os(self) + return not (self.settings.os == "Windows" or is_apple_os(self)) 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": @@ -39,30 +40,23 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - 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): - if Version(self.version) <= "0.5.11": - self.requires("aws-c-common/0.6.11") + 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.8.2") + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) if self._needs_openssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <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,30 +78,43 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-cal")) + # 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-cal": "aws-c-cal::aws-c-cal"} + ) + + 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-cal") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-cal") - - self.cpp_info.filenames["cmake_find_package"] = "aws-c-cal" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-cal" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-cal-lib"].names["cmake_find_package"] = "aws-c-cal" - self.cpp_info.components["aws-c-cal-lib"].names["cmake_find_package_multi"] = "aws-c-cal" - self.cpp_info.components["aws-c-cal-lib"].set_property("cmake_target_name", "AWS::aws-c-cal") - - self.cpp_info.components["aws-c-cal-lib"].libs = ["aws-c-cal"] - self.cpp_info.components["aws-c-cal-lib"].requires = ["aws-c-common::aws-c-common-lib"] + self.cpp_info.libs = ["aws-c-cal"] + self.cpp_info.requires = ["aws-c-common::aws-c-common"] + if self.options.shared: + self.cpp_info.defines.append("AWS_CAL_USE_IMPORT_EXPORT") if self.settings.os == "Windows": - self.cpp_info.components["aws-c-cal-lib"].system_libs.append("ncrypt") + self.cpp_info.system_libs.append("ncrypt") elif is_apple_os(self): - self.cpp_info.components["aws-c-cal-lib"].frameworks.extend(["CoreFoundation", "Security"]) + self.cpp_info.frameworks.extend(["CoreFoundation", "Security"]) elif self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.components["aws-c-cal-lib"].system_libs.append("dl") + self.cpp_info.system_libs.append("dl") - self.user_info.with_openssl = self._needs_openssl if self._needs_openssl: - self.cpp_info.components["aws-c-cal-lib"].requires.append("openssl::crypto") + self.cpp_info.requires.append("openssl::crypto") if not self.dependencies["openssl"].options.shared: # aws-c-cal does not statically link to openssl and searches dynamically for openssl symbols . # Mark these as undefined so the linker will include them. @@ -124,5 +131,9 @@ def package_info(self): "HMAC_CTX_init", "HMAC_CTX_cleanup", "HMAC_CTX_reset", ]) crypto_link_flags = "-Wl," + ",".join(f"-u{symbol}" for symbol in crypto_symbols) - self.cpp_info.components["aws-c-cal-lib"].exelinkflags.append(crypto_link_flags) - self.cpp_info.components["aws-c-cal-lib"].sharedlinkflags.append(crypto_link_flags) + self.cpp_info.exelinkflags.append(crypto_link_flags) + self.cpp_info.sharedlinkflags.append(crypto_link_flags) + + # 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-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 0000000000000..616d8257a2980 --- /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 0000000000000..1059e3dd42f14 --- /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/all/test_package/CMakeLists.txt b/recipes/aws-c-cal/all/test_package/CMakeLists.txt index 7ed07f4d9b8e6..a98182dc5ef67 100644 --- a/recipes/aws-c-cal/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-cal/all/test_package/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) find_package(aws-c-cal REQUIRED CONFIG) +find_package(aws-c-common REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal AWS::aws-c-common) diff --git a/recipes/aws-c-cal/all/test_package/conanfile.py b/recipes/aws-c-cal/all/test_package/conanfile.py index 1b3c18ef08ac1..fb5c5c0c1d8f0 100644 --- a/recipes/aws-c-cal/all/test_package/conanfile.py +++ b/recipes/aws-c-cal/all/test_package/conanfile.py @@ -1,4 +1,5 @@ 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, cmake_layout import os @@ -10,6 +11,10 @@ class TestPackageConan(ConanFile): generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" test_type = "explicit" + @property + def _needs_openssl(self): + return not (self.settings.os == "Windows" or is_apple_os(self)) + def layout(self): cmake_layout(self) @@ -25,7 +30,7 @@ def test(self): if can_run(self): stream = io.StringIO() bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(bin_path, env="conanrun", output=stream) + self.run(bin_path, stream, env="conanrun") self.output.info(stream.getvalue()) - if self.deps_user_info["aws-c-cal"].with_openssl == "True": + if self._needs_openssl: assert "found static libcrypto" in stream.getvalue() diff --git a/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt index 8a88842ed46e6..0d20897301b68 100644 --- a/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt +++ b/recipes/aws-c-cal/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-cal REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-cal/all/test_v1_package/conanfile.py b/recipes/aws-c-cal/all/test_v1_package/conanfile.py index ff0f4e1acbd6f..e27da49632915 100644 --- a/recipes/aws-c-cal/all/test_v1_package/conanfile.py +++ b/recipes/aws-c-cal/all/test_v1_package/conanfile.py @@ -1,4 +1,5 @@ from conans import ConanFile, CMake, tools +from conan.tools.apple import is_apple_os import os import io @@ -7,6 +8,10 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" + @property + def _needs_openssl(self): + return not (self.settings.os == "Windows" or is_apple_os(self)) + def build(self): cmake = CMake(self) cmake.configure() @@ -16,7 +21,7 @@ def test(self): if not tools.cross_building(self): stream = io.StringIO() bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True, output=stream) + self.run(bin_path, stream, run_environment=True) self.output.info(stream.getvalue()) - if self.deps_user_info["aws-c-cal"].with_openssl == "True": + if self._needs_openssl: assert "found static libcrypto" in stream.getvalue() diff --git a/recipes/aws-c-cal/config.yml b/recipes/aws-c-cal/config.yml index f969df4acc583..f62f1684b8f2a 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 773702bbe2c98..9261747efd7d9 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 5a8e794412c2f..86ea79fbcf2ff 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 1baf0be5b106a..d936f5ef9af18 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 828f55f643189..a6b8eb1260a1b 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 5a381bb0e6674..aae181600c27e 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 61428e916296b..dd1f6736ca7be 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 25bb2fd989f0a..e7d1df562c48b 100644 --- a/recipes/aws-c-event-stream/all/conanfile.py +++ b/recipes/aws-c-event-stream/all/conanfile.py @@ -1,18 +1,21 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir -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, get, copy, rmdir, save +from conan.tools.scm import Version import os +import textwrap + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.52.0" class AwsCEventStream(ConanFile): name = "aws-c-event-stream" description = "C99 implementation of the vnd.amazon.eventstream content-type" - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-event-stream" topics = ("aws", "eventstream", "content", ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -32,34 +35,30 @@ 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-checksums/0.1.13") - self.requires("aws-c-common/0.8.2") + 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], - 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,21 +79,36 @@ 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-c-event-stream")) + # 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-event-stream": "aws-c-event-stream::aws-c-event-stream"} + ) + + 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-event-stream") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-event-stream") - self.cpp_info.components["aws-c-event-stream-lib"].names["cmake_find_package"] = "aws-c-event-stream" - self.cpp_info.components["aws-c-event-stream-lib"].names["cmake_find_package_multi"] = "aws-c-event-stream" - self.cpp_info.components["aws-c-event-stream-lib"].libs = ["aws-c-event-stream"] - self.cpp_info.components["aws-c-event-stream-lib"].requires = ["aws-c-common::aws-c-common-lib", "aws-checksums::aws-checksums"] - if Version(self.version) >= "0.2": - self.cpp_info.components["aws-c-event-stream-lib"].requires.append("aws-c-io::aws-c-io-lib") + self.cpp_info.libs = ["aws-c-event-stream"] + if self.options.shared: + self.cpp_info.defines.append("AWS_EVENT_STREAM_USE_IMPORT_EXPORT") - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-c-event-stream" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-event-stream" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" + # 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-event-stream/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt index 674dc4a319004..0d20897301b68 100644 --- a/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt +++ b/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-event-stream REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-event-stream) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-event-stream/config.yml b/recipes/aws-c-event-stream/config.yml index 96ac653286f12..38b22762f5273 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 09a36b1a86c13..68fa29d3753e7 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 5f4b5242c4dbe..a9bb3bc67dc42 100644 --- a/recipes/aws-c-http/all/conanfile.py +++ b/recipes/aws-c-http/all/conanfile.py @@ -1,18 +1,21 @@ from conan import ConanFile -from conan.tools.scm import Version -from conan.tools.files import get, copy, rmdir 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 AwsCHttp(ConanFile): name = "aws-c-http" description = "C99 implementation of the HTTP/1.1 and HTTP/2 specifications" - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-http" topics = ("aws", "amazon", "cloud", "http", "http2", ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,33 +32,30 @@ 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-compression/0.2.15") - if Version(self.version) < "0.6.22": - self.requires("aws-c-io/0.10.20") + 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-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.4") + 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], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -76,21 +76,34 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-http")) + # 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-http": "aws-c-http::aws-c-http"} + ) + + 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-http") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-http") + self.cpp_info.libs = ["aws-c-http"] + if self.options.shared: + self.cpp_info.defines.append("AWS_HTTP_USE_IMPORT_EXPORT") - self.cpp_info.filenames["cmake_find_package"] = "aws-c-http" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-http" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - - self.cpp_info.components["aws-c-http-lib"].set_property("cmake_target_name", "AWS::aws-c-http") - self.cpp_info.components["aws-c-http-lib"].names["cmake_find_package"] = "aws-c-http" - self.cpp_info.components["aws-c-http-lib"].names["cmake_find_package_multi"] = "aws-c-http" - self.cpp_info.components["aws-c-http-lib"].libs = ["aws-c-http"] - self.cpp_info.components["aws-c-http-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-c-compression::aws-c-compression-lib", - "aws-c-io::aws-c-io-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-http/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt index b3195e120b0b2..0d20897301b68 100644 --- a/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt +++ b/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.1) - -project(test_package C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-http REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-http) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-http/config.yml b/recipes/aws-c-http/config.yml index ab4b9f0488086..febd9410cb93f 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 4a9102a6ede26..1e15f1d87d7c3 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 84b513c37e69f..36c3965b9abd8 100644 --- a/recipes/aws-c-io/all/conanfile.py +++ b/recipes/aws-c-io/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.52.0" class AwsCIO(ConanFile): name = "aws-c-io" description = "IO and TLS for application protocols" - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-io" topics = ("aws", "amazon", "cloud", "io", "tls",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,18 +32,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") @@ -48,19 +42,18 @@ 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") - self.requires("aws-c-cal/0.5.11") - else: - self.requires("aws-c-common/0.8.2") + 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.15") + self.requires("s2n/1.3.55") 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,24 +74,38 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-io")) + # 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-io": "aws-c-io::aws-c-io"} + ) + + 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-io") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-io") - # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["aws-c-io-lib"].libs = ["aws-c-io"] + self.cpp_info.libs = ["aws-c-io"] + if self.options.shared: + self.cpp_info.defines.append("AWS_IO_USE_IMPORT_EXPORT") if self.settings.os == "Macos": - self.cpp_info.components["aws-c-io-lib"].frameworks.append("Security") + self.cpp_info.frameworks.append("Security") if self.settings.os == "Windows": - self.cpp_info.components["aws-c-io-lib"].system_libs = ["crypt32", "secur32", "shlwapi"] + self.cpp_info.system_libs = ["crypt32", "secur32", "shlwapi"] # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-c-io" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-io" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-io-lib"].names["cmake_find_package"] = "aws-c-io" - self.cpp_info.components["aws-c-io-lib"].names["cmake_find_package_multi"] = "aws-c-io" - self.cpp_info.components["aws-c-io-lib"].set_property("cmake_target_name", "AWS::aws-c-io") - self.cpp_info.components["aws-c-io-lib"].requires = ["aws-c-cal::aws-c-cal-lib", "aws-c-common::aws-c-common-lib"] - if self.settings.os in ["Linux", "FreeBSD", "Android"]: - self.cpp_info.components["aws-c-io-lib"].requires.append("s2n::s2n-lib") + 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-io/config.yml b/recipes/aws-c-io/config.yml index 6dca88e3f0554..8a602cc8c0e60 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 6240cf10ee0f5..275052c56df7c 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 4edb02ac94d9f..d97246f605d3f 100644 --- a/recipes/aws-c-mqtt/all/conanfile.py +++ b/recipes/aws-c-mqtt/all/conanfile.py @@ -1,20 +1,22 @@ 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.47.0" +required_conan_version = ">=1.53.0" class AwsCMQTT(ConanFile): name = "aws-c-mqtt" description = "C99 implementation of the MQTT 3.1.1 specification." - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-mqtt" topics = ("aws", "amazon", "cloud", "mqtt") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -31,34 +33,27 @@ 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-cal/0.5.13") - if Version(self.version) < "0.7.12": - self.requires("aws-c-io/0.10.20") + 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") - self.requires("aws-c-http/0.6.22") - - def layout(self): - cmake_layout(self, src_folder="src") + 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], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -79,22 +74,34 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-mqtt")) + # 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-mqtt": "aws-c-mqtt::aws-c-mqtt"} + ) + + 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-mqtt") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-mqtt") + self.cpp_info.libs = ["aws-c-mqtt"] + if self.options.shared: + self.cpp_info.defines.append("AWS_MQTT_USE_IMPORT_EXPORT") - self.cpp_info.filenames["cmake_find_package"] = "aws-c-mqtt" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-mqtt" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-mqtt-lib"].names["cmake_find_package"] = "aws-c-mqtt" - self.cpp_info.components["aws-c-mqtt-lib"].names["cmake_find_package_multi"] = "aws-c-mqtt" - self.cpp_info.components["aws-c-mqtt-lib"].set_property("cmake_target_name", "AWS::aws-c-mqtt") - - self.cpp_info.components["aws-c-mqtt-lib"].libs = ["aws-c-mqtt"] - self.cpp_info.components["aws-c-mqtt-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-c-cal::aws-c-cal-lib", - "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-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-mqtt/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt index 610e2350e6503..0d20897301b68 100644 --- a/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt +++ b/recipes/aws-c-mqtt/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-mqtt REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-mqtt) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-mqtt/config.yml b/recipes/aws-c-mqtt/config.yml index edbab7e67d700..788eeccfb0963 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 af6e82a742aa6..776d2c58fad6a 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 131627214ba79..4854a0ec7c6d5 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 0778b2e2c7246..0d20897301b68 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 182095498622b..9a2f6a3845f5c 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 7ec4906cf9a7f..4f2cc09884562 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 f2158c8d10fa8..e2bfcefef6878 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 b2ced6f0d7ab7..c2aa05a42982f 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 ddf66e3fcf5ae..989708680b889 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 80a0c88a8c55b..e2711f6d5488f 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 55fedf4c307f5..efe23bdebe7e1 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 0b0f3153a2863..97c0f616bb653 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 6abb33ac667b0..0000000000000 --- 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 3e715c5477031..4be3843841ab1 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 3cdebbedda863..a0653e082edea 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 0286a964caa2c..0000000000000 --- 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 dbfb3fd9c7861..33561c82ed591 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 6fdab74d20c22..e8fb9d03fc8a5 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 fe89810597779..08c9a0b45013e 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 0000000000000..91630d79f4abb --- /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 0000000000000..cba2c258bb2b4 --- /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 e6b575a028845..42adf0e62a4df 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 0000000000000..22a060a14124f --- /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 0000000000000..0b0de62c879d3 --- /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 0000000000000..073c5e204a51e --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..ae80b44bdeccb --- /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 0000000000000..6cead73879d2a --- /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 134b19e72fb91..cdf0ee0dd3198 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 34af13462f44f..1af9ab7c6f511 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 d4128b0450777..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 d19ff91050d95..0000000000000 --- 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 8abd96ad2e0be..5818aef791db0 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 91c2066868882..678d3e32eb8c9 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 5a47717a4552a..9930b981211f6 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 efb9a3d957583..dda85fd047b73 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 dddf745d2e408..37d0edc6941d9 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 38f4483872d47..e845ae751a301 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/doxygen/all/test_v1_package/CMakeLists.txt b/recipes/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/doxygen/all/test_v1_package/CMakeLists.txt rename to recipes/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt diff --git a/recipes/gtsam/all/test_v1_package/conanfile.py b/recipes/aws-sdk-cpp/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/gtsam/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 692bc2ab703fe..92f05a255ac83 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/config.yml b/recipes/b2/config.yml index 8b6a9f5076283..fc7ada07a386e 100644 --- a/recipes/b2/config.yml +++ b/recipes/b2/config.yml @@ -1,49 +1,11 @@ versions: - "4.0.0": - folder: standard - "4.0.1": - folder: standard - "4.1.0": - folder: standard - "4.2.0": - folder: standard - "4.3.0": - folder: portable - "4.4.0": - folder: portable - "4.4.1": - folder: portable - "4.4.2": - folder: portable - "4.5.0": - folder: portable - "4.6.0": - folder: portable - "4.6.1": - folder: portable - "4.7.0": - folder: portable - "4.7.1": - folder: portable - "4.7.2": - folder: portable - "4.8.0": - folder: portable - "4.8.1": - folder: portable "4.8.2": folder: portable - "4.9.0": - folder: portable - "4.9.1": - folder: portable - "4.9.2": - folder: portable - "4.9.3": + "4.9.6": folder: portable - "4.9.4": + "4.10.0": folder: portable - "4.9.5": + "4.10.1": folder: portable - "4.9.6": + "5.0.0": folder: portable diff --git a/recipes/b2/portable/conandata.yml b/recipes/b2/portable/conandata.yml index 00c3852f57248..4bd954865dc3a 100644 --- a/recipes/b2/portable/conandata.yml +++ b/recipes/b2/portable/conandata.yml @@ -1,61 +1,16 @@ sources: - "4.3.0": - sha256: 138c90b66edb0a28e225705a2cbf897a8cef5f87e68befc748f8e6808e21628a - url: https://github.com/bfgroup/b2/archive/4.3.0.tar.gz - "4.4.0": - sha256: fa4079370644110604895ff08057fe2eff3289bcffdaec55fcdf43ea33ff25a8 - url: https://github.com/bfgroup/b2/archive/4.4.0.tar.gz - "4.4.1": - sha256: 4fb15abd994968a24868c13502f080c4a28b20f59831acf9eabd64a3b257554f - url: https://github.com/bfgroup/b2/archive/4.4.1.tar.gz - "4.4.2": - sha256: 575e59b89191a6a6780d7165cae3222b8a7a1e7d5e8165b3524eefe32fc3de46 - url: https://github.com/bfgroup/b2/archive/4.4.2.tar.gz - "4.5.0": - url: "https://github.com/bfgroup/b2/archive/4.5.0.tar.gz" - sha256: "39c3b51bf9c5f32b1c249d2d405274976b166e1bdca1fc5205b595f1cb5dbac3" - "4.6.0": - url: "https://github.com/bfgroup/b2/archive/4.6.0.tar.gz" - sha256: "3a308e0f79a039d8a9495b375f3292f5163000c19caa79c5687e4cb5b1938b49" - "4.6.1": - url: "https://github.com/bfgroup/b2/archive/4.6.1.tar.gz" - sha256: "a3f3323eaeb2c27d7a3ca86842665c6c3bc3d93cc626ba362ae6d0c5a7bfbe2c" - "4.7.0": - url: "https://github.com/bfgroup/b2/archive/4.7.0.tar.gz" - sha256: "82c2eb92d6ab2bd447646568ac8430c316cbd2a1819c108136224498c0abed84" - "4.7.1": - url: "https://github.com/bfgroup/b2/archive/4.7.1.tar.gz" - sha256: "30844184ded3217c090b76e6e051c3ac663ea63bd19e1b727b05c54411cac867" - "4.7.2": - url: "https://github.com/bfgroup/b2/archive/4.7.2.tar.gz" - sha256: "70883f8ed82efc49f425f1961a82e961cefdbca3a28581cb57b405bd7516677f" - "4.8.0": - url: "https://github.com/bfgroup/b2/archive/4.8.0.tar.gz" - sha256: "2f18951d4cc267a810e44fc483b747d489e30ed42ee6d9e7c5e19de750ee5cd2" - "4.8.1": - url: "https://github.com/bfgroup/b2/archive/4.8.1.tar.gz" - sha256: "8ecff1025df9473d91a0d116af3e32be6fba6e57d4ea962e033ff1678609d668" "4.8.2": url: "https://github.com/bfgroup/b2/archive/4.8.2.tar.gz" sha256: "220edfbd5022394c5dc264dfdd8bf6d3ec53b784db87461026bb23ea9d9ec4bd" - "4.9.0": - url: "https://github.com/bfgroup/b2/archive/4.9.0.tar.gz" - sha256: "7c614e41f10e004c7539c75c60f7b2df26a61fe35058e9021f8fd5049c97a255" - "4.9.1": - url: "https://github.com/bfgroup/b2/archive/4.9.1.tar.gz" - sha256: "81e49dc85e956c3e708bdd02fcfe0b9f406fca8edca54c75c94ebd6c322ed587" - "4.9.2": - url: "https://github.com/bfgroup/b2/archive/4.9.2.tar.gz" - sha256: "7e1a135b308999d2a65fce3eba8f4ffb41ca82ae133f8494cc42cbca63c890de" - "4.9.3": - url: "https://github.com/bfgroup/b2/archive/4.9.3.tar.gz" - sha256: "4524b8ecf138a9087aa24b8889c44ea7ae9f2d373acc9535d72fb048c213e1b9" - "4.9.4": - url: "https://github.com/bfgroup/b2/releases/download/4.9.4/b2-4.9.4.tar.bz2" - sha256: "1996d8098955ad3fdecab242d784afaef0fba80dd5d2ef0b3a41592e26772312" - "4.9.5": - url: "https://github.com/bfgroup/b2/releases/download/4.9.5/b2-4.9.5.tar.bz2" - sha256: "f81bea44601613f633d3311341f3f63594608537bf38d7073b877ec1edb2760a" "4.9.6": url: "https://github.com/bfgroup/b2/releases/download/4.9.6/b2-4.9.6.tar.bz2" sha256: "10c1344c751fcf5a1f9ec6f52c02626cfbf78a4806f7817949b115e107bbbc5f" + "4.10.0": + url: "https://github.com/bfgroup/b2/releases/download/4.10.0/b2-4.10.0.tar.bz2" + sha256: "aee0185473141d4acb56e39c78758b1016e66393ea5ca86ef29403bd9258f2e2" + "4.10.1": + url: "https://github.com/bfgroup/b2/releases/download/4.10.1/b2-4.10.1.tar.bz2" + sha256: "d0818276955c3351eac26e4aa1e61046cfded88773232d76f2833c93bb917633" + "5.0.0": + url: "https://github.com/bfgroup/b2/releases/download/5.0.0/b2-5.0.0.tar.bz2" + sha256: "1ef867f7d374345a948baca025ed277dadda05a68439aa383a06aceb9911f7d3" diff --git a/recipes/b2/portable/conanfile.py b/recipes/b2/portable/conanfile.py index dad95965dea31..f93460f8b28cf 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 @@ -62,10 +63,14 @@ def package_id(self): del self.info.options.use_cxx_env del self.info.options.toolset - def validate(self): - if hasattr(self, "settings_build") and cross_building(self): + if self._is_macos_intel_or_arm(self.info.settings): + self.info.settings.arch = "x86_64,armv8" + + def validate_build(self): + if hasattr(self, "settings_build") and cross_building(self) and not self._is_macos_intel_or_arm(self.settings): raise ConanInvalidConfiguration(f"{self.ref} recipe doesn't support cross-build yet") + def validate(self): if (self.options.toolset == 'cxx' or self.options.toolset == 'cross-cxx') and not self.options.use_cxx_env: raise ConanInvalidConfiguration( "Option toolset 'cxx' and 'cross-cxx' requires 'use_cxx_env=True'") @@ -89,6 +94,9 @@ def _b2_output_dir(self): def _pkg_bin_dir(self): return os.path.join(self.package_folder, "bin") + def _is_macos_intel_or_arm(self, settings): + return settings.os == "Macos" and settings.arch in ["x86_64", "armv8"] + @contextmanager def _bootstrap_env(self): saved_env = dict(os.environ) @@ -107,6 +115,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 @@ -138,13 +152,23 @@ def build(self): command += '"'+b2_vcvars+'" && ' command += "build" if use_windows_commands else "./build.sh" + cxxflags = "" + if self._is_macos_intel_or_arm(self.settings): + cxxflags += " -arch arm64 -arch x86_64" + 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") - if cxxflags: - command += f" --cxxflags={cxxflags}" + self._write_project_config(cxx) + + cxxflags_env = envvars.get("CXXFLAGS") + cxxflags = f"{cxxflags} {cxxflags_env}" + + if cxxflags: + command += f' --cxxflags="{cxxflags}"' if b2_toolset != 'auto': command += " "+str(b2_toolset) diff --git a/recipes/backport-cpp/all/conanfile.py b/recipes/backport-cpp/all/conanfile.py index a114a54bf9ff4..7bd9c00c00321 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 6f744e6d9f6c3..66cfef012cf47 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", "backtrace"], - "stack_details" : ["dw", "bfd", "dwarf", "backtrace_symbol"], + "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,16 +37,16 @@ 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 - def _has_stack_walking(self, type): - return self.options.stack_walking == type + def _has_stack_walking(self, method): + return self.options.stack_walking == method - def _has_stack_details(self, type): - return False if self.settings.os == "Windows" else self.options.stack_details == type + def _has_stack_details(self, method): + return False if self.settings.os == "Windows" else self.options.stack_details == method def export_sources(self): export_conandata_patches(self) @@ -57,40 +60,59 @@ 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.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: raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) + if self._has_stack_walking("libunwind"): + if Version(self.version) < "1.6": + raise ConanInvalidConfiguration("Support for libunwind is only available as of 1.6.") + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Support for libunwind is only available on Linux and macOS.") if self.settings.os == "Macos": - if self.settings.arch == "armv8": - raise ConanInvalidConfiguration("Macos M1 not supported yet") + if self.settings.arch == "armv8" and Version(self.version) < "1.6": + raise ConanInvalidConfiguration("Support for Apple Silicon is only available as of 1.6.") if not self._has_stack_details("backtrace_symbol"): - raise ConanInvalidConfiguration("only stack_details=backtrace_symbol" - " is supported on Macos") + raise ConanInvalidConfiguration("Stack details other than backtrace_symbol are not supported on macOS.") 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") tc.variables["STACK_WALKING_BACKTRACE"] = self._has_stack_walking("backtrace") tc.variables["STACK_DETAILS_AUTO_DETECT"] = False tc.variables["STACK_DETAILS_BACKTRACE_SYMBOL"] = self._has_stack_details("backtrace_symbol") @@ -106,32 +128,44 @@ 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") self.cpp_info.set_property("cmake_target_name", "Backward::Backward") - self.cpp_info.defines.append("BACKWARD_HAS_UNWIND={}".format(int(self._has_stack_walking("unwind")))) - self.cpp_info.defines.append("BACKWARD_HAS_BACKTRACE={}".format(int(self._has_stack_walking("backtrace")))) - - self.cpp_info.defines.append("BACKWARD_HAS_BACKTRACE_SYMBOL={}".format(int(self._has_stack_details("backtrace_symbol")))) - self.cpp_info.defines.append("BACKWARD_HAS_DW={}".format(int(self._has_stack_details("dw")))) - self.cpp_info.defines.append("BACKWARD_HAS_BFD={}".format(int(self._has_stack_details("bfd")))) - self.cpp_info.defines.append("BACKWARD_HAS_DWARF={}".format(int(self._has_stack_details("dwarf")))) - self.cpp_info.defines.append("BACKWARD_HAS_PDB_SYMBOL={}".format(int(self.settings.os == "Windows"))) - - self.cpp_info.libs = ["backward"] - if self.settings.os == "Linux": - self.cpp_info.system_libs.extend(["dl"]) + self.cpp_info.defines.append(f"BACKWARD_HAS_UNWIND={int(self._has_stack_walking('unwind'))}") + self.cpp_info.defines.append(f"BACKWARD_HAS_LIBUNWIND={int(self._has_stack_walking('libunwind'))}") + self.cpp_info.defines.append(f"BACKWARD_HAS_BACKTRACE={int(self._has_stack_walking('backtrace'))}") + + self.cpp_info.defines.append(f"BACKWARD_HAS_BACKTRACE_SYMBOL={int(self._has_stack_details('backtrace_symbol'))}") + self.cpp_info.defines.append(f"BACKWARD_HAS_DW={int(self._has_stack_details('dw'))}") + self.cpp_info.defines.append(f"BACKWARD_HAS_BFD={int(self._has_stack_details('bfd'))}") + 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')}") + + 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/backward-cpp/all/patches/backward-cpp-1.5.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.5.patch index 2fa198687d928..7d2e80dfe3661 100644 --- a/recipes/backward-cpp/all/patches/backward-cpp-1.5.patch +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.5.patch @@ -41,11 +41,17 @@ ############################################################################### -@@ -86,6 +86,19 @@ endif() +@@ -86,6 +86,25 @@ endif() add_library(backward ${libtype} backward.cpp) target_compile_definitions(backward PUBLIC ${BACKWARD_DEFINITIONS}) target_include_directories(backward PUBLIC ${BACKWARD_INCLUDE_DIRS}) +target_compile_features(backward PUBLIC cxx_std_11) ++if(STACK_WALKING_LIBUNWIND) ++ if(NOT APPLE) ++ find_package(libunwind REQUIRED CONFIG) ++ target_link_libraries(backward PUBLIC libunwind::libunwind) ++ endif() ++endif() +if(STACK_DETAILS_DW) + find_package(elfutils REQUIRED CONFIG) + target_link_libraries(backward PUBLIC elfutils::libdw) diff --git a/recipes/bandit/all/conanfile.py b/recipes/bandit/all/conanfile.py index 31fd2c6978fa4..5bc2e2513915d 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 6ebaff03fb45d..f8a16e7db8b32 100644 --- a/recipes/base64/all/conandata.yml +++ b/recipes/base64/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.5.2": + url: "https://github.com/aklomp/base64/archive/v0.5.2.tar.gz" + sha256: "723a0f9f4cf44cf79e97bcc315ec8f85e52eb104c8882942c3f2fba95acc080d" + "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 d56ae8c5bcf10..e01cf8be42f58 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 4b833cc2f77c3..27b194373c867 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 195fdf269b250..d13d382a6be8a 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 6c32de99d28f7..0000000000000 --- 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 d13fcfd021b7b..7e8cf882c17d0 100644 --- a/recipes/base64/config.yml +++ b/recipes/base64/config.yml @@ -1,4 +1,8 @@ versions: + "0.5.2": + folder: all + "0.5.1": + folder: all "0.5.0": folder: all "0.4.0": diff --git a/recipes/bazel/all/conandata.yml b/recipes/bazel/all/conandata.yml index 00f7c7d9a52af..243efd0d24b9d 100644 --- a/recipes/bazel/all/conandata.yml +++ b/recipes/bazel/all/conandata.yml @@ -1,10 +1,95 @@ sources: + "7.0.0": + license: + url: "https://raw.githubusercontent.com/bazelbuild/bazel/7.0.0/LICENSE" + sha256: "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + Macos: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-darwin-x86_64" + sha256: "e0b57be60062f36eceed78d672088c6a2e30bd7de8674e2ee4edcd021b131c8c" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-darwin-arm64" + sha256: "b1cf1c5783fa3eac60942bf2ec6169cfccecd2fa5a355587d8d35983bc1e1310" + Linux: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-linux-x86_64" + sha256: "8b24f70542f9736e0ccbf9cb3335cb9f049b5a6787f1e5997ed1da80b9bbd46e" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-linux-arm64" + sha256: "cae101d31581a348774526b9d11811b04cc212c943762e6363a85a15bccfca54" + Windows: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-windows-x86_64.exe" + sha256: "bf4adcd2764dbca6332092950f41c5ae435a38032c1c00a5558ef963b32107a1" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-windows-arm64.exe" + sha256: "7846fc1180c7cf1985f7748db40066590f20a62a9e5c56ee5b1f1f127cb978c5" + + "6.2.0": + license: + url: "https://raw.githubusercontent.com/bazelbuild/bazel/6.2.0/LICENSE" + sha256: "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + Macos: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/6.2.0/bazel-6.2.0-darwin-x86_64" + sha256: "d2356012843ce3a2fbba89f88191673a6ad2f7716cc46ad43ec1bcee78d36b44" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/6.2.0/bazel-6.2.0-darwin-arm64" + sha256: "482957a15c34eb43b1d1ae5e7623444e4783a04d4c618d7c518fe7b3dbf75512" + Linux: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/6.2.0/bazel-6.2.0-linux-x86_64" + sha256: "3d11c26fb9ba12c833844450bb90165b176e8a19cb5cf5923f3cec855837f17c" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/6.2.0/bazel-6.2.0-linux-arm64" + sha256: "16e41fe8fb791ffb9835643435e4828384a1890b0f916fd84b750fa01f783807" + Windows: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/6.2.0/bazel-6.2.0-windows-x86_64.exe" + sha256: "3d119e934ffb26910fcbd44dbc5973761480f58d3a06722cb84a90e16d8c5727" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/6.2.0/bazel-6.2.0-windows-arm64.exe" + sha256: "3c23fccd3815933452c859e8482864598b6903d3143f9f18589915bf2c0dd2d4" + + "5.4.1": + license: + url: "https://raw.githubusercontent.com/bazelbuild/bazel/5.4.1/LICENSE" + sha256: "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + Macos: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-darwin-x86_64" + sha256: "e8f796d67e9e4b54183c465443158dfb38bfe7df3626c1cfa0a6a3d9866047f9" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-darwin-arm64" + sha256: "f2443a2131e832c2f12d448e673be7dad9cd2822066b4e2d4bd2d634bb2495e6" + Linux: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-linux-x86_64" + sha256: "5d90515f84b5ee1fd6ec22ee9e83103e77ed1a907ee5eec198fef3a5b45abf13" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-linux-arm64" + sha256: "431dfaf5c0bd264b5753ae7a57f262137394c214c5e83651218887a9155dd010" + Windows: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-windows-x86_64.exe" + sha256: "f44329c91ee0ca2ea8526f9c0fecb65f1aa483e658f9b09831b16a0e70e16b51" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-windows-arm64.exe" + sha256: "1e273c20dfa8493bf21b002614592a6cb3aa9eabe8b30eda96f8a517fca1a619" + "4.0.0": - - url: "https://raw.githubusercontent.com/bazelbuild/bazel/4.0.0/LICENSE" - sha256: cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 - - url: "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-darwin-x86_64" - sha256: "349f3c9dd24191369c1073c57cc1386fc3c2d4ad7d44135c3d873c9dc67fae1f" - - url: "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-linux-x86_64" - sha256: "7bee349a626281fc8b8d04a7a0b0358492712377400ab12533aeb39c2eb2b901" - - url: "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-windows-x86_64.exe" - sha256: "43930bbbc8b5d618884ee8145e1ec181760bf9eea42d16217a30381d176e4cf6" + license: + url: "https://raw.githubusercontent.com/bazelbuild/bazel/4.0.0/LICENSE" + sha256: "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + Macos: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-darwin-x86_64" + sha256: "349f3c9dd24191369c1073c57cc1386fc3c2d4ad7d44135c3d873c9dc67fae1f" + Linux: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-linux-x86_64" + sha256: "7bee349a626281fc8b8d04a7a0b0358492712377400ab12533aeb39c2eb2b901" + Windows: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-windows-x86_64.exe" + sha256: "43930bbbc8b5d618884ee8145e1ec181760bf9eea42d16217a30381d176e4cf6" diff --git a/recipes/bazel/all/conanfile.py b/recipes/bazel/all/conanfile.py index 710635dca3f71..f765c4a073f3c 100644 --- a/recipes/bazel/all/conanfile.py +++ b/recipes/bazel/all/conanfile.py @@ -1,53 +1,86 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, rename, download + +required_conan_version = ">=1.47.0" + class BazelConan(ConanFile): name = "bazel" + package_type = "application" description = "Bazel is a fast, scalable, multi-language and extensible build system." license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://bazel.build/" - topics = ("test", "build", "automation") - settings = "os", "arch" - no_copy_source = True + topics = ("test", "build", "automation", "pre-built") + settings = "os", "arch", "compiler", "build_type" - @property - def _program_suffix(self): - return ".exe" if self.settings.os == "Windows" else "" + def layout(self): + pass - def _chmod_plus_x(self, name): - os.chmod(name, os.stat(name).st_mode | 0o111) + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type @property - def _bazel_filename(self): - platform = "darwin" if self.settings.os == "Macos" else str(self.settings.os).lower() - return "bazel-{}-{}-{}{}".format(self.version, platform, self.settings.arch, self._program_suffix) + def _binary_info(self): + os = str(self.settings.os) + arch = str(self.settings.arch) + return self.conan_data["sources"][self.version][os].get(arch) def validate(self): - if self.settings.arch != "x86_64": - raise ConanInvalidConfiguration("Only amd64 is supported for this package.") if self.settings.os not in ["Linux", "Macos", "Windows"]: raise ConanInvalidConfiguration("Only Linux, Windows and OSX are supported for this package.") + if self._binary_info is None: + raise ConanInvalidConfiguration( + f"{self.settings.arch} architecture on {self.settings.os} is not supported for this package." + ) + + def source(self): + pass + + @property + def _bazel_filename(self): + return self._binary_info["url"].rsplit("/")[-1] def build(self): - for source in self.conan_data["sources"][self.version]: - url = source["url"] - filename = url[url.rfind("/") + 1:] - if filename in ["LICENSE", self._bazel_filename]: - tools.download(url, filename) - tools.check_sha256(filename, source["sha256"]) + download(self, **self._binary_info, filename=self._bazel_filename) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + @property + def _program_suffix(self): + return ".exe" if self.settings.os == "Windows" else "" + + @staticmethod + def _chmod_plus_x(name): + os.chmod(name, os.stat(name).st_mode | 0o111) def package(self): - self.copy(pattern="LICENSE", dst="licenses") - self.copy(pattern=self._bazel_filename, dst="bin") + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + pattern=self._bazel_filename, + dst=os.path.join(self.package_folder, "bin"), + src=self.source_folder, + ) old_target_filename = os.path.join(self.package_folder, "bin", self._bazel_filename) new_target_filename = os.path.join(self.package_folder, "bin", "bazel" + self._program_suffix) - tools.rename(old_target_filename, new_target_filename) + rename(self, old_target_filename, new_target_filename) self._chmod_plus_x(new_target_filename) def package_info(self): - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable with : {0}".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 = [] + + # 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/bazel/all/test_package/conanfile.py b/recipes/bazel/all/test_package/conanfile.py index 829753e7fee0f..5375af669ee12 100644 --- a/recipes/bazel/all/test_package/conanfile.py +++ b/recipes/bazel/all/test_package/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile +from conan import ConanFile -class TestPackage(ConanFile): - settings = "os", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" - def test(self): - self.run("bazel --version", run_environment=True) + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + def test(self): + self.run("bazel --version") diff --git a/recipes/bazel/config.yml b/recipes/bazel/config.yml index d2be8f453d7c0..e9824e01dcd11 100644 --- a/recipes/bazel/config.yml +++ b/recipes/bazel/config.yml @@ -1,3 +1,9 @@ versions: + "7.0.0": + folder: all + "6.2.0": + folder: all + "5.4.1": + folder: all "4.0.0": folder: all diff --git a/recipes/bdwgc/all/conandata.yml b/recipes/bdwgc/all/conandata.yml index 97d6a0b86b6e9..8dfe6c5a2d882 100644 --- a/recipes/bdwgc/all/conandata.yml +++ b/recipes/bdwgc/all/conandata.yml @@ -8,6 +8,9 @@ sources: "8.2.2": url: "https://github.com/ivmai/bdwgc/releases/download/v8.2.2/gc-8.2.2.tar.gz" sha256: "f30107bcb062e0920a790ffffa56d9512348546859364c23a14be264b38836a0" + "8.2.4": + url: "https://github.com/ivmai/bdwgc/releases/download/v8.2.4/gc-8.2.4.tar.gz" + sha256: "3d0d3cdbe077403d3106bb40f0cbb563413d6efdbb2a7e1cd6886595dec48fc2" patches: "8.0.4": - patch_file: "patches/update-cmake-8_0_4.patch" @@ -15,3 +18,5 @@ patches: - patch_file: "patches/update-cmake-8_0_6.patch" "8.2.2": - patch_file: "patches/update-cmake-8_2_2.patch" + "8.2.4": + - patch_file: "patches/update-cmake-8_2_4.patch" diff --git a/recipes/bdwgc/all/conanfile.py b/recipes/bdwgc/all/conanfile.py index 925a47c27595c..d284939f26c40 100644 --- a/recipes/bdwgc/all/conanfile.py +++ b/recipes/bdwgc/all/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile +from conan.errors import ConanException from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, save, rmdir, load from conan.tools.scm import Version -from conan.tools.files import apply_conandata_patches, get, save, rmdir, copy, load -from conan.errors import ConanException import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class BdwGcConan(ConanFile): @@ -57,8 +57,7 @@ class BdwGcConan(ConanFile): default_options[option] = default 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": @@ -66,28 +65,19 @@ 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 Version(self.version) < "8.2.0": del self.options.throw_bad_alloc_library if not self.options.cplusplus: - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + 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("libatomic_ops/7.6.14") + self.requires("libatomic_ops/7.8.2") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/bdwgc/all/patches/update-cmake-8_2_4.patch b/recipes/bdwgc/all/patches/update-cmake-8_2_4.patch new file mode 100644 index 0000000000000..c2ec8ac9747c1 --- /dev/null +++ b/recipes/bdwgc/all/patches/update-cmake-8_2_4.patch @@ -0,0 +1,15 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -175,6 +175,12 @@ if (enable_threads) + message(STATUS "Thread library: ${CMAKE_THREAD_LIBS_INIT}") + if (without_libatomic_ops OR BORLAND OR MSVC OR WATCOM) + include_directories(libatomic_ops/src) ++ find_package(Atomic_ops CONFIG) ++ if (Atomic_ops_FOUND) ++ get_target_property(AO_INCLUDE_DIRS Atomic_ops::atomic_ops ++ INTERFACE_INCLUDE_DIRECTORIES) ++ include_directories(${AO_INCLUDE_DIRS}) ++ endif() + # Note: alternatively, use CFLAGS_EXTRA to pass -I<...>/libatomic_ops/src. + else() + # Assume the compiler supports GCC atomic intrinsics. diff --git a/recipes/bdwgc/all/test_package/test_package.c b/recipes/bdwgc/all/test_package/test_package.c index b2df5018e2c03..a65be074b3335 100644 --- a/recipes/bdwgc/all/test_package/test_package.c +++ b/recipes/bdwgc/all/test_package/test_package.c @@ -5,17 +5,8 @@ int main() { - int i; - - GC_INIT(); /* Optional on Linux/X86; see below. */ - for (i = 0; i < 10000000; ++i) - { - int **p = (int **) GC_MALLOC(sizeof(int *)); - int *q = (int *) GC_MALLOC_ATOMIC(sizeof(int)); - assert(*p == 0); - *p = (int *) GC_REALLOC(q, 2 * sizeof(int)); - if (i % 100000 == 0) - printf("Heap size = %u\n", (unsigned) GC_get_heap_size()); - } + GC_INIT(); + printf("BDWGC Version: %d", GC_get_version()); + GC_deinit(); return 0; } diff --git a/recipes/bdwgc/config.yml b/recipes/bdwgc/config.yml index a32355f74df3f..b018b2961234b 100644 --- a/recipes/bdwgc/config.yml +++ b/recipes/bdwgc/config.yml @@ -5,3 +5,5 @@ versions: folder: all "8.2.2": folder: all + "8.2.4": + folder: all diff --git a/recipes/beauty/all/conanfile.py b/recipes/beauty/all/conanfile.py index db4a11b8cb724..2c01e08705dd5 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 b417e78a3f997..8a3c24a77b927 100644 --- a/recipes/benchmark/all/conandata.yml +++ b/recipes/benchmark/all/conandata.yml @@ -1,4 +1,13 @@ 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" + "1.8.1": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.1.tar.gz" + sha256: "e9ff65cecfed4f60c893a1e8a1ba94221fad3b27075f2f80f47eb424b0f8c9bd" "1.8.0": url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.0.tar.gz" sha256: "ea2e94c24ddf6594d15c711c06ccd4486434d9cf3eca954e2af8a20c88f9f172" diff --git a/recipes/benchmark/all/conanfile.py b/recipes/benchmark/all/conanfile.py index de0392e20c566..4143dd1a1d5dd 100644 --- a/recipes/benchmark/all/conanfile.py +++ b/recipes/benchmark/all/conanfile.py @@ -25,17 +25,21 @@ class BenchmarkConan(ConanFile): "fPIC": [True, False], "enable_lto": [True, False], "enable_exceptions": [True, False], + "enable_libpfm": [True, False], } default_options = { "shared": False, "fPIC": True, "enable_lto": False, "enable_exceptions": True, + "enable_libpfm": False, } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.os != "Linux" or Version(self.version) < "1.5.4": + del self.options.enable_libpfm def configure(self): if self.options.shared: @@ -49,6 +53,10 @@ def validate(self): if Version(self.version) < "1.7.0" and is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} doesn't support msvc shared builds") + def requirements(self): + if self.options.get_safe("enable_libpfm"): + self.requires("libpfm4/4.13.0") + def build_requirements(self): if Version(self.version) >= "1.7.1": self.tool_requires("cmake/[>=3.16.3 <4]") @@ -62,6 +70,7 @@ def generate(self): tc.variables["BENCHMARK_ENABLE_GTEST_TESTS"] = "OFF" tc.variables["BENCHMARK_ENABLE_LTO"] = self.options.enable_lto tc.variables["BENCHMARK_ENABLE_EXCEPTIONS"] = self.options.enable_exceptions + tc.variables["BENCHMARK_ENABLE_LIBPFM"] = self.options.get_safe("enable_libpfm", False) if Version(self.version) >= "1.6.1": tc.variables["BENCHMARK_ENABLE_WERROR"] = False tc.variables["BENCHMARK_FORCE_WERROR"] = False @@ -102,6 +111,9 @@ def package_info(self): self.cpp_info.components["_benchmark"].system_libs.append("shlwapi") elif self.settings.os == "SunOS": self.cpp_info.components["_benchmark"].system_libs.append("kstat") + if self.options.get_safe("enable_libpfm"): + self.cpp_info.components["_benchmark"].requires.append("libpfm4::libpfm4") + self.cpp_info.components["benchmark_main"].set_property("cmake_target_name", "benchmark::benchmark_main") self.cpp_info.components["benchmark_main"].libs = ["benchmark_main"] diff --git a/recipes/benchmark/config.yml b/recipes/benchmark/config.yml index c75e2eaab25cc..f3ed1f1e95743 100644 --- a/recipes/benchmark/config.yml +++ b/recipes/benchmark/config.yml @@ -1,4 +1,10 @@ versions: + "1.8.3": + folder: all + "1.8.2": + folder: all + "1.8.1": + folder: all "1.8.0": folder: all "1.7.1": diff --git a/recipes/bertrand/all/conanfile.py b/recipes/bertrand/all/conanfile.py index 3e410daba2d59..1373f8df7a23f 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 0000000000000..47606f9539fe5 --- /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 0000000000000..9de812b7f94ea --- /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 0000000000000..2c968e2dda718 --- /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 0000000000000..4e578144a798a --- /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 0000000000000..630c14bc99ec9 --- /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 0000000000000..667976629550a --- /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 0000000000000..056e75eddb91c --- /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 0000000000000..0fa69d015c844 --- /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 4100c3ff4959c..17cae79880122 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 a4c3a01e317b2..92a40425b2590 100644 --- a/recipes/binutils/all/conandata.yml +++ b/recipes/binutils/all/conandata.yml @@ -1,4 +1,10 @@ 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" "2.38": # 2022-02-09 url: "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" sha256: "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" @@ -6,6 +12,14 @@ 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 + patch_description: "disable texinfo" "2.38": - patch_file: "patches/2.38-0001-no-texinfo.patch" patch_type: conan diff --git a/recipes/binutils/all/conanfile.py b/recipes/binutils/all/conanfile.py index 142067bea696e..1e04fbc03a87b 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) @@ -205,7 +205,10 @@ def package_info(self): # Add recipe path to enable running the self test in the test package. # Don't use this property in production code. It's unsupported. self.user_info.recipe_path = os.path.realpath(__file__) - + self.cpp_info.resdirs = ["etc"] + self.buildenv_info.define("GPROFNG_SYSCONFDIR", os.path.join(self.package_folder, "etc")) + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["dl", "rt"] class _ArchOs: def __init__(self, arch: str, os: str, extra: typing.Optional[typing.Dict[str, str]] = None): diff --git a/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch new file mode 100644 index 0000000000000..fbd00f17e49e4 --- /dev/null +++ b/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch @@ -0,0 +1,50 @@ +--- gas/Makefile.in ++++ gas/Makefile.in +@@ -1794,7 +1794,7 @@ + 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 \ +@@ -1870,7 +1870,7 @@ + + info-am: $(INFO_DEPS) info-local + +-install-data-am: install-info-am install-man ++install-data-am: install-man + + install-dvi: install-dvi-recursive + +--- bfd/Makefile.in ++++ bfd/Makefile.in +@@ -266,7 +266,7 @@ + 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 +@@ -2053,7 +2053,7 @@ + check-am: all-am + check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +-all-am: Makefile $(INFO_DEPS) $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) \ ++all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) \ + config.h + installdirs: installdirs-recursive + installdirs-am: +@@ -2122,8 +2122,7 @@ + + 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/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 0000000000000..f6d719e75f24e --- /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/all/test_package/conanfile.py b/recipes/binutils/all/test_package/conanfile.py index 9f4ceaa413255..79dfa71fb4157 100644 --- a/recipes/binutils/all/test_package/conanfile.py +++ b/recipes/binutils/all/test_package/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.layout import basic_layout class TestPackageConan(ConanFile): @@ -21,6 +22,9 @@ def _has_as(self): def _has_ld(self): return self._settings_build.os not in ("Macos",) + def layout(self): + basic_layout(self) + def test(self): binaries = ["ar", "nm", "objcopy", "objdump", "ranlib", "readelf", "strip"] if self._has_as: diff --git a/recipes/binutils/config.yml b/recipes/binutils/config.yml index f7cce7c207880..97d0d2ecab157 100644 --- a/recipes/binutils/config.yml +++ b/recipes/binutils/config.yml @@ -1,4 +1,8 @@ versions: + "2.41": + folder: all + "2.40": + folder: all "2.38": folder: all "2.37": diff --git a/recipes/bison/all/conanfile.py b/recipes/bison/all/conanfile.py index 9a5645894b97c..98dd943f37017 100644 --- a/recipes/bison/all/conanfile.py +++ b/recipes/bison/all/conanfile.py @@ -29,10 +29,6 @@ class BisonConan(ConanFile): 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) @@ -96,8 +92,9 @@ def generate(self): tc.extra_cflags.append("-FS") env = tc.environment() if is_msvc(self): - compile_wrapper = unix_path(self, self._user_info_build["automake"].compile) - ar_wrapper = unix_path(self, self._user_info_build["automake"].ar_lib) + 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") diff --git a/recipes/bit-lite/all/conanfile.py b/recipes/bit-lite/all/conanfile.py index b0529cb7abe9a..9057f4c627521 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 9b5b2264c84bb..1571f9c56284c 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 e4f6815698c02..5acbd3659a4cb 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 31b1805864308..7319ee088f906 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/conandata.yml b/recipes/blaze/all/conandata.yml index a6e5a6aa09753..65e6063976941 100644 --- a/recipes/blaze/all/conandata.yml +++ b/recipes/blaze/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.8.2": + url: "https://bitbucket.org/blaze-lib/blaze/downloads/blaze-3.8.2.tar.gz" + sha256: "4c4e1915971efbedab95790e4c5cf017d8448057fa8f8c62c46e1643bf72cbb1" "3.8": url: "https://bitbucket.org/blaze-lib/blaze/downloads/blaze-3.8.tar.gz" sha256: "dfaae1a3a9fea0b3cc92e78c9858dcc6c93301d59f67de5d388a3a41c8a629ae" diff --git a/recipes/blaze/all/conanfile.py b/recipes/blaze/all/conanfile.py index a5d62edf842a5..576d457372823 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/blaze/config.yml b/recipes/blaze/config.yml index df754600895a3..7b9eb7695fc4e 100644 --- a/recipes/blaze/config.yml +++ b/recipes/blaze/config.yml @@ -1,4 +1,6 @@ versions: + "3.8.2": + folder: all "3.8": folder: all "3.7": diff --git a/recipes/blend2d/all/conandata.yml b/recipes/blend2d/all/conandata.yml index a8918f809e2b0..06ef79b273e89 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 4c280dceae1ea..adbef317cace4 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 0000000000000..29e6457e6c6f5 --- /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 0000000000000..fb535df020d2b --- /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 bf1e95c0dd1d1..219f4d22f536c 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 312d87af87164..d7d42e0dd8b35 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 b9eaad3c63e47..6aee6c7437722 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 81ce02efd2b42..6a4836cd7d3f2 100644 --- a/recipes/boost-ext-ut/all/conandata.yml +++ b/recipes/boost-ext-ut/all/conandata.yml @@ -1,12 +1,18 @@ sources: - "1.1.8": - url: "https://github.com/boost-ext/ut/archive/v1.1.8.tar.gz" - sha256: "3cc426dcf38397637e889efd9567b06d55dd23fb4e65cc0381eb8103a411d104" + "2.0.1": + url: "https://github.com/boost-ext/ut/archive/v2.0.1.tar.gz" + sha256: "1e43be17045a881c95cedc843d72fe9c1e53239b02ed179c1e39e041ebcd7dad" + "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 bce6579a06de7..a73d7aef01853 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 968159344a038..c1e4e8bebed11 100644 --- a/recipes/boost-ext-ut/config.yml +++ b/recipes/boost-ext-ut/config.yml @@ -1,5 +1,9 @@ versions: - "1.1.8": + "2.0.1": + folder: "all" + "2.0.0": folder: "all" "1.1.9": folder: "all" + "1.1.8": + folder: "all" diff --git a/recipes/boost-leaf/all/conandata.yml b/recipes/boost-leaf/all/conandata.yml index 42c2ccab24961..593e982ab983b 100644 --- a/recipes/boost-leaf/all/conandata.yml +++ b/recipes/boost-leaf/all/conandata.yml @@ -2,3 +2,9 @@ sources: "1.81.0": url: "https://github.com/boostorg/leaf/archive/refs/tags/1.81.0.tar.gz" sha256: "6a2bfa8727891e844f1f95c9c68af192f4c5f53b1707acce54290932118b48c0" + "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 80eea4560f825..7468e5b299833 100644 --- a/recipes/boost-leaf/config.yml +++ b/recipes/boost-leaf/config.yml @@ -1,3 +1,7 @@ versions: "1.81.0": 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 2be1304335523..3ffdd91d528ab 100644 --- a/recipes/boost/all/conandata.yml +++ b/recipes/boost/all/conandata.yml @@ -1,4 +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" "1.81.0": url: - "https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2" @@ -53,6 +63,18 @@ 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" + - patch_file: "patches/1.83.0-locale-msvc.patch" + patch_description: "Fix compilation on windows when NOMINMAX is not defined" + patch_type: "official" + patch_source: "https://github.com/boostorg/locale/pull/189" + "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" + patch_type: "conan" "1.81.0": - patch_file: "patches/boost_1_77_mpi_check.patch" patch_description: "Fails the build when mpi is not configured" diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index d845fca4e54da..5bab9c6c7ebdd 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.82.0.yml b/recipes/boost/all/dependencies/dependencies-1.82.0.yml new file mode 100644 index 0000000000000..02d6958cfca28 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.82.0.yml @@ -0,0 +1,280 @@ +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: + - chrono + - system + 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.82.0 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 0000000000000..7200adb04009d --- /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/patches/1.82.0-locale-iconv-library-option.patch b/recipes/boost/all/patches/1.82.0-locale-iconv-library-option.patch new file mode 100644 index 0000000000000..80b22dd54b0e1 --- /dev/null +++ b/recipes/boost/all/patches/1.82.0-locale-iconv-library-option.patch @@ -0,0 +1,12 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index f1321db3..36899cdc 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -22,6 +22,7 @@ project /boost/locale + # Features + + feature.feature boost.locale.iconv : on off : optional propagated ; ++feature.feature boost.locale.iconv.lib : libc libiconv : optional propagated ; + feature.feature boost.locale.icu : on off : optional propagated ; + feature.feature boost.locale.posix : on off : optional propagated ; + feature.feature boost.locale.std : on off : optional propagated ; diff --git a/recipes/boost/all/patches/1.83.0-locale-msvc.patch b/recipes/boost/all/patches/1.83.0-locale-msvc.patch new file mode 100644 index 0000000000000..acb9510e6eb2f --- /dev/null +++ b/recipes/boost/all/patches/1.83.0-locale-msvc.patch @@ -0,0 +1,22 @@ +From 0552ffc29ff11e4fe130b7143ea6ac2bee7b15c6 Mon Sep 17 00:00:00 2001 +From: wevsty +Date: Sat, 12 Aug 2023 22:13:48 +0800 +Subject: [PATCH] fix build error on MSVC + +--- + boost/locale/util/string.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/locale/util/string.hpp b/boost/locale/util/string.hpp +index 9ab9521c..ba066bd4 100644 +--- a/boost/locale/util/string.hpp ++++ b/boost/locale/util/string.hpp +@@ -38,7 +38,7 @@ namespace boost { namespace locale { namespace util { + /// Cast an unsigned char to a (possibly signed) char avoiding implementation defined behavior + constexpr char to_char(unsigned char c) + { +- return static_cast((c - std::numeric_limits::min()) + std::numeric_limits::min()); ++ return static_cast((c - (std::numeric_limits::min)()) + (std::numeric_limits::min)()); + } + + }}} // namespace boost::locale::util diff --git a/recipes/boost/all/rebuild-dependencies.py b/recipes/boost/all/rebuild-dependencies.py index 05a14b8375a05..94a81a8173490 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 2ce47c1e59d7e..f81f4b5e8e72b 100644 --- a/recipes/boost/config.yml +++ b/recipes/boost/config.yml @@ -1,4 +1,8 @@ versions: + "1.83.0": + folder: all + "1.82.0": + folder: all "1.81.0": folder: all "1.80.0": diff --git a/recipes/boostdep/all/CMakeLists.txt b/recipes/boostdep/all/CMakeLists.txt deleted file mode 100644 index 5e53cb70bdf38..0000000000000 --- 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 3831a32bc89c9..943785c9b1d4a 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 01a84ccc90d69..bd8dd57eb93dc 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 190cc18502e11..2b15ef763d620 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 0000000000000..190cc18502e11 --- /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 640761587c2ae..1cbe5a69a954f 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/breakpad/all/conandata.yml b/recipes/breakpad/all/conandata.yml index 0037ecfc65960..da051fdc78d51 100644 --- a/recipes/breakpad/all/conandata.yml +++ b/recipes/breakpad/all/conandata.yml @@ -6,3 +6,4 @@ patches: "cci.20210521": - patch_file: "patches/0001-Use_conans_lss.patch" - patch_file: "patches/0002-Remove-hardcoded-fpic.patch" + - patch_file: "patches/0003-Fix-gcc11-compilation.patch" diff --git a/recipes/breakpad/all/conanfile.py b/recipes/breakpad/all/conanfile.py index f4cdf5d9940e4..e9de3c6e8371e 100644 --- a/recipes/breakpad/all/conanfile.py +++ b/recipes/breakpad/all/conanfile.py @@ -31,7 +31,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("linux-syscall-support/cci.20200813") + self.requires("linux-syscall-support/cci.20200813", transitive_headers=True) def validate(self): if self.settings.os != "Linux": diff --git a/recipes/breakpad/all/patches/0003-Fix-gcc11-compilation.patch b/recipes/breakpad/all/patches/0003-Fix-gcc11-compilation.patch new file mode 100644 index 0000000000000..4ce40736676ee --- /dev/null +++ b/recipes/breakpad/all/patches/0003-Fix-gcc11-compilation.patch @@ -0,0 +1,11 @@ +--- a/src/client/linux/handler/exception_handler.cc ++++ b/src/client/linux/handler/exception_handler.cc +@@ -138,7 +138,7 @@ + // SIGSTKSZ may be too small to prevent the signal handlers from overrunning + // the alternative stack. Ensure that the size of the alternative stack is + // large enough. +- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); ++ static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); + + // Only set an alternative stack if there isn't already one, or if the current + // one is too small. diff --git a/recipes/brigand/all/conanfile.py b/recipes/brigand/all/conanfile.py index d205988b4830f..21dde9eb4313f 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 c664dae35678e..35c9587456f43 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 5ba9ac6bd939f..47e559afcc649 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 0000000000000..0c9b697569cec --- /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 8339b11b6d1f4..00f09fcd40122 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 39d54f0009ed0..f4b59633d9f83 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 0000000000000..8a8c640caa115 --- /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 0000000000000..d437851b72dc5 --- /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 0000000000000..addcf9825b6ba --- /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 0000000000000..d0055137f9a83 --- /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 0000000000000..b78a5ce662490 --- /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 0000000000000..cec4a0e274d89 --- /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 0000000000000..f9b1ede7bb029 --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..6be850a9c3ae9 --- /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 0000000000000..579cbcab9768e --- /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/conandata.yml b/recipes/bshoshany-thread-pool/all/conandata.yml index 34ca195ae9b51..dee19ad62ca27 100644 --- a/recipes/bshoshany-thread-pool/all/conandata.yml +++ b/recipes/bshoshany-thread-pool/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.5.0": + sha256: "d3efd5c434f6e99f4cff7b8219cbb586dc06bc0aeaf17cd174813a2333961306" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v3.5.0.tar.gz" "3.4.0": sha256: "b282149693534934d29c3e6eb563a668b04d6abc53ff013bbe608d96741eddb2" url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v3.4.0.tar.gz" diff --git a/recipes/bshoshany-thread-pool/all/conanfile.py b/recipes/bshoshany-thread-pool/all/conanfile.py index 15c03a2e73fb9..3da6e90d6c057 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,26 +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, "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) @@ -62,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 ef975b6d66e03..28d8252a78110 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 a154ce8fd694e..b16654fc86e82 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 0ad87e39bce01..be00a8c7f57c7 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 e3619171241a6..2fc6ad2a6a2ba 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/bshoshany-thread-pool/config.yml b/recipes/bshoshany-thread-pool/config.yml index 1bf5f1f671b5c..cabaf98e03ae7 100644 --- a/recipes/bshoshany-thread-pool/config.yml +++ b/recipes/bshoshany-thread-pool/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.0": + folder: all "3.4.0": folder: all "3.3.0": diff --git a/recipes/btyacc/all/CMakeLists.txt b/recipes/btyacc/all/CMakeLists.txt deleted file mode 100644 index b598faf845d1a..0000000000000 --- 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 392605b08cf53..d34d04d75a89b 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 80f7ff14861ac..d2daa6eb3e652 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 84bba6ad911d3..fe825a55c4c79 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 0000000000000..c23ed5cfe6d98 --- /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 0000000000000..1b50aeffd40ff --- /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 ac8c63a98f38c..7786a8fb5c6c8 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 7914baa434398..d3dd545ae68ba 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/bzip2/all/conanfile.py b/recipes/bzip2/all/conanfile.py index 9bba05c82a828..2a39045a8299d 100644 --- a/recipes/bzip2/all/conanfile.py +++ b/recipes/bzip2/all/conanfile.py @@ -11,7 +11,7 @@ class Bzip2Conan(ConanFile): name = "bzip2" url = "https://github.com/conan-io/conan-center-index" - homepage = "http://www.bzip.org" + homepage = "https://sourceware.org/bzip2" license = "bzip2-1.0.8" description = "bzip2 is a free and open-source file compression program that uses the Burrows Wheeler algorithm." topics = ("data-compressor", "file-compression") diff --git a/recipes/bzip3/all/conandata.yml b/recipes/bzip3/all/conandata.yml index 4bb5f34796c3f..47c1259bdc988 100644 --- a/recipes/bzip3/all/conandata.yml +++ b/recipes/bzip3/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.4.0": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.4.0/bzip3-1.4.0.tar.xz" + sha256: "516489784351abe027dc8b4bcad74d12937c5668d317e27de8c5cebc4d7884dc" + "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" "1.3.0": url: "https://github.com/kspalaiologos/bzip3/releases/download/1.3.0/bzip3-1.3.0.tar.xz" sha256: "72fca01d9030e9c260e2ff8fe9d2e9f6261ea28e86adabeb6a8af3300ec390ef" @@ -15,23 +24,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" - "1.1.4": - - patch_file: "patches/1.1.4-0001-make-restrict-alias.patch" - - patch_file: "patches/1.1.4-0002-export-symbols.patch" + 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 484c139e122f3..2102c952e4cf1 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 20195b834da7b..0000000000000 --- 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 3bdf13582cc59..0000000000000 --- 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 e76dc6e0d184e..0000000000000 --- 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/all/test_package/conanfile.py b/recipes/bzip3/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/bzip3/all/test_package/conanfile.py +++ b/recipes/bzip3/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/bzip3/config.yml b/recipes/bzip3/config.yml index 8395bf34db523..75a3fe45d3d11 100644 --- a/recipes/bzip3/config.yml +++ b/recipes/bzip3/config.yml @@ -1,4 +1,10 @@ versions: + "1.4.0": + folder: all + "1.3.2": + folder: all + "1.3.1": + folder: all "1.3.0": folder: all "1.2.3": @@ -11,11 +17,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 e654988836336..71897bd8283d0 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 402bb147b757b..fcaa857492587 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 c8c0ea232bc21..a47eb694abb4a 100644 --- a/recipes/c-blosc/all/conandata.yml +++ b/recipes/c-blosc/all/conandata.yml @@ -1,4 +1,10 @@ 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" "1.21.3": url: "https://github.com/Blosc/c-blosc/archive/v1.21.3.tar.gz" sha256: "941016c4564bca662080bb01aea74f06630bd665e598c6f6967fd91b2e2e0bb6" @@ -24,6 +30,14 @@ 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" + patch_type: "conan" "1.21.3": - patch_file: "patches/cmake-dependencies-1.21.2+.patch" patch_description: "use cci package" diff --git a/recipes/c-blosc/all/conanfile.py b/recipes/c-blosc/all/conanfile.py index a349a37babbd2..9f604b7efb491 100644 --- a/recipes/c-blosc/all/conanfile.py +++ b/recipes/c-blosc/all/conanfile.py @@ -12,10 +12,10 @@ class CbloscConan(ConanFile): name = "c-blosc" description = "An extremely fast, multi-threaded, meta-compressor library." license = "BSD-3-Clause" - topics = ("c-blosc", "blosc", "compression") - homepage = "https://github.com/Blosc/c-blosc" + topics = ("blosc", "compression") url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/Blosc/c-blosc" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -58,15 +58,14 @@ def requirements(self): if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_snappy: - self.requires("snappy/1.1.9") + 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.2") + self.requires("zstd/1.5.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): tc = CMakeToolchain(self) diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.21.4+.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.21.4+.patch new file mode 100644 index 0000000000000..0b293b6c2c49e --- /dev/null +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.21.4+.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f726a0a..1dbcdc4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -140,7 +140,8 @@ include(GNUInstallDirs) + + if(NOT DEACTIVATE_LZ4) + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND TRUE) + else() + message(STATUS "Using LZ4 internal sources.") + endif() +@@ -162,7 +163,6 @@ endif() + if(NOT DEACTIVATE_ZLIB) + # import the ZLIB_ROOT environment variable to help finding the zlib library + if(PREFER_EXTERNAL_ZLIB) +- set(ZLIB_ROOT $ENV{ZLIB_ROOT}) + find_package(ZLIB) + if(NOT ZLIB_FOUND ) + message(STATUS "No zlib found. Using internal sources.") +@@ -177,7 +177,7 @@ endif() + + if(NOT DEACTIVATE_ZSTD) + if(PREFER_EXTERNAL_ZSTD) +- find_package(Zstd) ++ find_package(zstd REQUIRED CONFIG) + else() + message(STATUS "Using ZSTD internal sources.") + endif() +diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt +index ceb27b8..36c5777 100644 +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -88,7 +88,7 @@ endif(WIN32) + + if(NOT DEACTIVATE_LZ4) + if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) + else(LZ4_FOUND) + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${LZ4_FILES}) +@@ -98,7 +98,7 @@ endif(NOT DEACTIVATE_LZ4) + + if(NOT DEACTIVATE_SNAPPY) + if(SNAPPY_FOUND) +- set(LIBS ${LIBS} ${SNAPPY_LIBRARY}) ++ set(LIBS ${LIBS} "Snappy::snappy") + else(SNAPPY_FOUND) + file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc) + set(SOURCES ${SOURCES} ${SNAPPY_FILES}) +@@ -108,7 +108,7 @@ endif(NOT DEACTIVATE_SNAPPY) + + if(NOT DEACTIVATE_ZLIB) + if(ZLIB_FOUND) +- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) ++ set(LIBS ${LIBS} "ZLIB::ZLIB") + else(ZLIB_FOUND) + file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${ZLIB_FILES}) +@@ -118,7 +118,7 @@ endif(NOT DEACTIVATE_ZLIB) + + if (NOT DEACTIVATE_ZSTD) + if (ZSTD_FOUND) +- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) + else (ZSTD_FOUND) + # 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-blosc/config.yml b/recipes/c-blosc/config.yml index 5798e3590a6d3..cd2301b24b5b4 100644 --- a/recipes/c-blosc/config.yml +++ b/recipes/c-blosc/config.yml @@ -1,4 +1,8 @@ versions: + "1.21.5": + folder: all + "1.21.4": + folder: all "1.21.3": folder: all "1.21.1": diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 4e49e406144c5..610af582fe0d6 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "2.12.0": + url: "https://github.com/Blosc/c-blosc2/archive/v2.12.0.tar.gz" + sha256: "b8fa07ab0627c19fb652e08a5ada197eb0939b75e97e2fb76bbee145eaedc6e9" + "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" "2.8.0": url: "https://github.com/Blosc/c-blosc2/archive/v2.8.0.tar.gz" sha256: "be608cdf68deb02e0d3ee62e183942a0fe5d5d3185375b9b6566e2ae35a9bdbd" @@ -11,16 +32,35 @@ 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.12.0": + - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "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" + patch_type: "conan" "2.8.0": - patch_file: "patches/2.8.0-0001-fix-cmake.patch" patch_description: "use cci package" @@ -37,15 +77,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 95efd9dcbcb1d..7d0ee7490f4cd 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.0.6") + self.requires("zlib-ng/2.1.6") 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.4") + 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"]: @@ -143,4 +152,4 @@ def package_info(self): prefix = "lib" if is_msvc(self) and not self.options.shared else "" self.cpp_info.libs = [f"{prefix}blosc2"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["rt", "m", "pthread"] + self.cpp_info.system_libs = ["rt", "m", "pthread", "dl"] 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 new file mode 100644 index 0000000000000..17ad6d731a77c --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.10.0-0001-fix-cmake.patch @@ -0,0 +1,106 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85d1e03..00e6cad 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 a6d566d..ba65bae 100644 +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -18,8 +18,8 @@ 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.4) + set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_LOCAL_DIR}) +@@ -37,8 +37,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.5) + set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} +@@ -100,8 +100,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) + set(SOURCES ${SOURCES} ${LZ4_FILES}) +@@ -109,8 +109,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() +@@ -122,8 +122,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.10.2-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.10.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..fb1f3b574be59 --- /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 0000000000000..743a69c503d24 --- /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 0000000000000..5a88b5696c4af --- /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 cef3c154b1ab2..0000000000000 --- 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 4ca392bba22b4..a0812cb90ffab 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 4c05452a0a1c9..acf966bc19e73 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,4 +1,18 @@ versions: + "2.12.0": + folder: all + "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": folder: all "2.6.1": @@ -7,9 +21,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 45fc29f13df14..795f25ff9b207 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 d30bb72e433f7..96423bd2a8bac 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 08b0f78e6b940..d0a1927baa811 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/4.0.0", transitive_headers=True) + self.requires("fast_float/6.0.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 71354ad6bae80..4b177005e2f51 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 7a5cb98c5ded6..08713d4f8b3b0 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 0000000000000..3ad9d6d3ba42f --- /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 1e73f6993a454..548a9345742d5 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 1ee19505ae145..1e8675e64a203 100644 --- a/recipes/cairo/all/conanfile.py +++ b/recipes/cairo/all/conanfile.py @@ -26,10 +26,11 @@ class CairoConan(ConanFile): name = "cairo" description = "Cairo is a 2D graphics library with support for multiple output devices" - topics = ("cairo", "graphics") + topics = ("graphics") url = "https://github.com/conan-io/conan-center-index" homepage = "https://cairographics.org/" license = ("LGPL-2.1-only", "MPL-1.1") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -85,15 +86,15 @@ def requirements(self): if self.options.get_safe("with_freetype", True): self.requires("freetype/2.13.0") if self.options.get_safe("with_fontconfig", False): - self.requires("fontconfig/2.13.93") + self.requires("fontconfig/2.14.2") if self.settings.os == "Linux": 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.1") + 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 248b8521fe8ea..8e74221deaa9f 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 da5f931250975..278a3653016c5 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 9eb330e00f07b..76c7813fd5b69 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): @@ -88,43 +80,37 @@ def configure(self): self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") - if self.options.with_glib and self.options.shared: - self.options["glib"].shared = True 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.13.93") + self.requires("fontconfig/2.14.2", transitive_headers=True, transitive_libs=True) if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_glib: - self.requires("glib/2.76.1") - 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") - - def package_id(self): - if self.info.options.with_glib and not self.dependencies["glib"].options.shared: - self.info.requires["glib"].full_package_mode() + 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"): @@ -141,9 +127,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.0.0") + 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) @@ -164,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")) @@ -193,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" @@ -257,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") @@ -321,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 4f33d55898eb2..83adc4effa23e 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 692a4909c85a7..91630d79f4abb 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 e9529d1b4235f..9763146e05947 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 8a403a49b992b..96f403d024d1e 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 f5fcae443d2f0..0000000000000 --- 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 5d6cd671de960..0000000000000 --- 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 366e829c2704c..ede33192a05dc 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 a691174f8ed16..ef5d7042163ec 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 d802e56f01bd2..5033103959269 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 0000000000000..91630d79f4abb --- /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 0000000000000..a691174f8ed16 --- /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 cc2573070ee79..debfb8cd30b0a 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 55cd07447203f..4c40bccc4e945 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 1a102a8feb035..a8399d13089c4 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 b4527ac4677c7..9b0e2c5ceee1d 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 8a6eeaab5a8d1..e635b41da8f05 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 f101073a53368..591f5effa85d6 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 0000000000000..38c9dd1ee414b --- /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 89d97bce3d850..887e41e533af8 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/capstone/all/conandata.yml b/recipes/capstone/all/conandata.yml index 7e93927333e67..b49957e5739d0 100644 --- a/recipes/capstone/all/conandata.yml +++ b/recipes/capstone/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "5.0.1": + url: "https://github.com/capstone-engine/capstone/archive/refs/tags/5.0.1.tar.gz" + sha256: "2b9c66915923fdc42e0e32e2a9d7d83d3534a45bb235e163a70047951890c01a" + "5.0": + url: "https://github.com/capstone-engine/capstone/archive/refs/tags/5.0.tar.gz" + sha256: "df24344407baa7415eeb006f742afc9b92cd33abf2c4c120a6e97cfb376882dc" "4.0.2": url: "https://github.com/capstone-engine/capstone/archive/refs/tags/4.0.2.tar.gz" sha256: "7c81d798022f81e7507f1a60d6817f63aa76e489aa4e7055255f21a22f5e526a" +patches: + "5.0.1": + - patch_file: "patches/5.0-0001-disable-warning-flags.patch" + patch_description: "disable warning flags for older compilers" + patch_type: "portability" + "5.0": + - patch_file: "patches/5.0-0001-disable-warning-flags.patch" + patch_description: "disable warning flags for older compilers" + patch_type: "portability" diff --git a/recipes/capstone/all/conanfile.py b/recipes/capstone/all/conanfile.py index 148a51bb1323b..416470d00874e 100644 --- a/recipes/capstone/all/conanfile.py +++ b/recipes/capstone/all/conanfile.py @@ -1,7 +1,8 @@ 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, rmdir, export_conandata_patches, apply_conandata_patches 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" @@ -9,20 +10,20 @@ class CapstoneConan(ConanFile): name = "capstone" - license = "BSD-3-Clause" - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://www.capstone-engine.org" description = ( "Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, " "EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, " "TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings." ) + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.capstone-engine.org" topics = ( "reverse-engineering", "disassembler", "security", "framework", "arm", "arm64", "x86", "sparc", "powerpc", "mips", "x86-64", "ethereum", "systemz", "webassembly", "m68k", "m0s65xx", "m680x", "tms320c64x", "bpf", "riscv", ) - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -39,6 +40,9 @@ class CapstoneConan(ConanFile): options.update({a: [True, False] for a in _archs}) default_options.update({a: True for a in _archs}) + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -53,23 +57,27 @@ 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.variables["CAPSTONE_BUILD_STATIC"] = not self.options.shared - tc.variables["CAPSTONE_BUILD_SHARED"] = self.options.shared + if Version(self.version) < "5.0": + tc.variables["CAPSTONE_BUILD_STATIC"] = not self.options.shared + tc.variables["CAPSTONE_BUILD_SHARED"] = self.options.shared tc.variables["CAPSTONE_BUILD_TESTS"] = False tc.variables["CAPSTONE_BUILD_CSTOOL"] = False tc.variables["CAPSTONE_ARCHITECUTRE_DEFAULT"] = False - tc.variables["CAPSTONE_USE_SYS_DYN_MEM"] = self.options.use_default_alloc + if Version(self.version) < "5.0": + tc.variables["CAPSTONE_USE_SYS_DYN_MEM"] = self.options.use_default_alloc + else: + tc.variables["CAPSTONE_USE_DEFAULT_ALLOC"] = self.options.use_default_alloc for a in self._archs: tc.variables[f"CAPSTONE_{a.upper()}_SUPPORT"] = self.options.get_safe(a) tc.variables["CAPSTONE_BUILD_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -78,9 +86,11 @@ def package(self): 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")) def package_info(self): - suffix = "_dll" if is_msvc(self) and self.options.shared else "" + suffix = "_dll" if is_msvc(self) and self.options.shared and Version(self.version) < "5.0" else "" self.cpp_info.libs = [f"capstone{suffix}"] if self.options.shared: self.cpp_info.defines.append("CAPSTONE_SHARED") diff --git a/recipes/capstone/all/patches/5.0-0001-disable-warning-flags.patch b/recipes/capstone/all/patches/5.0-0001-disable-warning-flags.patch new file mode 100644 index 0000000000000..95cad95e403d9 --- /dev/null +++ b/recipes/capstone/all/patches/5.0-0001-disable-warning-flags.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7a986a0..3da94ff 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,13 +25,6 @@ project(capstone + VERSION 5.0 + ) + +-if (MSVC) +- add_compile_options(/W1 /w14189) +-else() +- add_compile_options(-Wmissing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context) +-endif() +- +- + # to configure the options specify them in in the command line or change them in the cmake UI. + # Don't edit the makefile! + option(BUILD_SHARED_LIBS "Build shared library" OFF) diff --git a/recipes/capstone/config.yml b/recipes/capstone/config.yml index 6ce0808b6e1f0..77f1d8f750fd6 100644 --- a/recipes/capstone/config.yml +++ b/recipes/capstone/config.yml @@ -1,3 +1,7 @@ versions: + "5.0.1": + folder: "all" + "5.0": + folder: "all" "4.0.2": folder: "all" diff --git a/recipes/cargs/all/CMakeLists.txt b/recipes/cargs/all/CMakeLists.txt deleted file mode 100644 index 42d6e7408fb33..0000000000000 --- 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/conandata.yml b/recipes/cargs/all/conandata.yml index 21e38ee9fe720..01238c00f6a56 100644 --- a/recipes/cargs/all/conandata.yml +++ b/recipes/cargs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/likle/cargs/archive/v1.1.0.tar.gz" + sha256: "87e7da5b539f574d48529870cb0620ef5a244a5ee2eac73cc7559dedc04128ca" "1.0.3": url: "https://github.com/likle/cargs/archive/v1.0.3.tar.gz" sha256: "ddba25bd35e9c6c75bc706c126001b8ce8e084d40ef37050e6aa6963e836eb8b" diff --git a/recipes/cargs/all/conanfile.py b/recipes/cargs/all/conanfile.py index 6aeeae1d3b488..6de6ac89acce0 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 f6bb6f79f518f..2d259c06a7d89 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 4903f1a7e8fa0..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..6c9d5dba712c7 --- /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/cargs/config.yml b/recipes/cargs/config.yml index 63312af6d65c1..24b8d6fbb0acc 100644 --- a/recipes/cargs/config.yml +++ b/recipes/cargs/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "1.0.3": folder: all "1.0.1": diff --git a/recipes/cassandra-cpp-driver/all/CMakeLists.txt b/recipes/cassandra-cpp-driver/all/CMakeLists.txt deleted file mode 100644 index 7f03984bd9149..0000000000000 --- 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 0ca8371b0b30f..169437d0e897c 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 76b1d99adf12b..5cfe8683bd139 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 0000000000000..64a29de126f9f --- /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 191d2eb7e8174..9406ccc60d7aa 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 7c7b5d16994d7..91811710ffbe4 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 0000000000000..216ee8df654e9 --- /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 0000000000000..5a69b0d7d12b1 --- /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 1a95218e3d7a5..4d590e1005c29 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 0399475aec987..a9fb96656f203 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/imgui/all/test_v1_package/CMakeLists.txt b/recipes/cassandra-cpp-driver/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/imgui/all/test_v1_package/CMakeLists.txt rename to recipes/cassandra-cpp-driver/all/test_v1_package/CMakeLists.txt 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 9792bd17fcc93..c8b1c8ef4703a 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 27ebedcdcb791..f42fcf13ad368 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -1,4 +1,13 @@ sources: + "3.5.1": + url: "https://github.com/catchorg/Catch2/archive/v3.5.1.tar.gz" + sha256: "49c3ca7a68f1c8ec71307736bc6ed14fec21631707e1be9af45daf4037e75a08" + "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" "3.3.2": url: "https://github.com/catchorg/Catch2/archive/v3.3.2.tar.gz" sha256: "8361907f4d9bff3ae7c1edb027f813659f793053c99b67837a0c0375f065bae2" diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index 5cab4a772bfb6..1e105253d64f9 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -1,4 +1,10 @@ versions: + "3.5.1": + folder: 3.x.x + "3.5.0": + folder: 3.x.x + "3.4.0": + folder: 3.x.x "3.3.2": folder: 3.x.x "3.3.1": diff --git a/recipes/cc65/all/conandata.yml b/recipes/cc65/all/conandata.yml index 0c7a25432a083..720b04e88ab10 100644 --- a/recipes/cc65/all/conandata.yml +++ b/recipes/cc65/all/conandata.yml @@ -8,11 +8,7 @@ sources: patches: "2.18": - patch_file: "patches/2.18-0001-no-embedded-paths-makefile.patch" - base_path: "source_subfolder" - patch_file: "patches/2.18-0002-libsrc-use-extension.patch" - base_path: "source_subfolder" "2.19": - patch_file: "patches/2.19-0001-no-embedded-paths-makefile.patch" - base_path: "source_subfolder" - patch_file: "patches/2.19-0002-libsrc-use-extension.patch" - base_path: "source_subfolder" diff --git a/recipes/cc65/all/conanfile.py b/recipes/cc65/all/conanfile.py index 242c1cf9eee44..360eeaca72cba 100644 --- a/recipes/cc65/all/conanfile.py +++ b/recipes/cc65/all/conanfile.py @@ -1,163 +1,150 @@ -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.build import can_run +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuild, is_msvc, msvs_toolset, MSBuildToolchain + +required_conan_version = ">=1.53.0" + class Cc65Conan(ConanFile): name = "cc65" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://cc65.github.io/" description = "A freeware C compiler for 6502 based systems" license = "Zlib" - topics = ("conan", "cc65", "compiler", "cmos", "6502", "8bit") - exports_sources = "patches/**" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://cc65.github.io/" + topics = ("compiler", "cmos", "6502", "8bit") + package_type = "application" settings = "os", "arch", "compiler", "build_type" - _autotools = None - _source_subfolder = "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - if self.settings.compiler == "Visual Studio": - if self.settings.arch not in ("x86", "x86_64"): - raise ConanInvalidConfiguration("Invalid arch") + 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): + if is_msvc(self.info): + if self.info.settings.arch == "x86_64": + self.info.settings.arch = "x86" + del self.info.settings.compiler + + def validate(self): + if not can_run(self): + raise ConanInvalidConfiguration( + f"Compiling for {self.settings.arch} is not supported. " + "cc65 needs to be able to run the built executables during the build process" + ) + if is_msvc(self): + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.settings.arch} is not supported on MSVC") if self.settings.arch == "x86_64": self.output.info("This recipe will build x86 instead of x86_64 (the binaries are compatible)") def build_requirements(self): - if self.settings.compiler == "Visual Studio" and not tools.which("make"): - self.build_requires("make/4.2.1") + if is_msvc(self): + self.tool_requires("make/4.4") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - @property - def _datadir(self): - return os.path.join(self.package_folder, "bin", "share", "cc65") - - @property - def _samplesdir(self): - return os.path.join(self.package_folder, "samples") - - def _build_msvc(self): - msbuild = MSBuild(self) - msvc_platforms = { - "x86": "Win32", - } - arch = str(self.settings.arch) - if arch != "x86": - self.output.warn("{} detected: building x86 instead".format(self.settings.arch)) - arch = "x86" - - msbuild.build(os.path.join(self._source_subfolder, "src", "cc65.sln"), - build_type="Debug" if self.settings.build_type == "Debug" else "Release", - arch=arch, platforms=msvc_platforms) - autotools = self._configure_autotools() - with tools.chdir(os.path.join(self._source_subfolder, "libsrc")): - autotools.make() - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - return self._autotools - - @property - def _make_args(self): - datadir = self._datadir - prefix = self.package_folder - samplesdir = self._samplesdir - if tools.os_info.is_windows: - datadir = tools.unix_path(datadir) - prefix = tools.unix_path(prefix) - samplesdir = tools.unix_path(samplesdir) - args = [ - "PREFIX={}".format(prefix), - "datadir={}".format(datadir), - "samplesdir={}".format(samplesdir), + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.generate() + tc = AutotoolsToolchain(self) + tc.make_args += [ + "PREFIX=/", + "datadir=/bin/share/cc65", + "samplesdir=/samples", ] if self.settings.os == "Windows": - args.append("EXE_SUFFIX=.exe") - return args - - def _build_autotools(self): - autotools = self._configure_autotools() - with tools.chdir(os.path.join(self._source_subfolder)): - autotools.make(args=self._make_args) + tc.make_args.append("EXE_SUFFIX=.exe") + tc.generate() def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - if self.settings.compiler == "Visual Studio": - with tools.chdir(os.path.join(self._source_subfolder, "src")): - for fn in os.listdir("."): - if not fn.endswith(".vcxproj"): - continue - tools.replace_in_file(fn, "v141", tools.msvs_toolset(self)) - tools.replace_in_file(fn, "10.0.16299.0", "") + apply_conandata_patches(self) + if is_msvc(self): + for vcxproj in self.source_path.joinpath("src").rglob("*.vcxproj"): + replace_in_file(self, vcxproj, "v141", msvs_toolset(self)) + replace_in_file(self, vcxproj, "10.0.16299.0", "") if self.settings.os == "Windows": # Add ".exe" suffix to calls from cl65 to other utilities - for fn, var in (("cc65", "CC65"), ("ca65", "CA65"), ("co65", "CO65"), ("ld65", "LD65"), ("grc65", "GRC")): - v = "{},".format(var).ljust(5) - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "cl65", "main.c"), - "CmdInit (&{v} CmdPath, \"{n}\");".format(v=v, n=fn), - "CmdInit (&{v} CmdPath, \"{n}.exe\");".format(v=v, n=fn)) + for fn, var in [ + ("cc65", "CC65"), + ("ca65", "CA65"), + ("co65", "CO65"), + ("ld65", "LD65"), + ("grc65", "GRC"), + ]: + v = f"{var},".ljust(5) + replace_in_file(self, os.path.join(self.source_folder, "src", "cl65", "main.c"), + f'CmdInit (&{v} CmdPath, "{fn}");', + f'CmdInit (&{v} CmdPath, "{fn}.exe");') + # Fix mkdir failing on Windows due to -p being unavailable there + # https://github.com/conan-io/conan-center-index/pull/18873#issuecomment-1841989876 + replace_in_file(self, os.path.join(self.source_folder, "libsrc", "Makefile"), + r'MKDIR = mkdir $(subst /,\,$1)', + r'MKDIR = if not exist "$(subst /,\,$1)" mkdir "$(subst /,\,$1)"') def build(self): self._patch_sources() - if self.settings.compiler == "Visual Studio": - self._build_msvc() + if is_msvc(self): + msbuild = MSBuild(self) + msbuild.platform = "Win32" + msbuild.build_type = "Debug" if self.settings.build_type == "Debug" else "Release" + msbuild.build(sln=os.path.join(self.source_folder, "src", "cc65.sln")) + with chdir(self, os.path.join(self.source_folder, "libsrc")): + autotools = Autotools(self) + autotools.make() else: - self._build_autotools() - - def _package_msvc(self): - self.copy("*.exe", src=os.path.join(self._source_subfolder, "bin"), dst=os.path.join(self.package_folder, "bin"), keep_path=False) - for dir in ("asminc", "cfg", "include", "lib", "target"): - self.copy("*", src=os.path.join(self._source_subfolder, dir), dst=os.path.join(self._datadir, dir)) - - def _package_autotools(self): - autotools = self._configure_autotools() - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): - autotools.install(args=self._make_args) - - tools.rmdir(self._samplesdir) - tools.rmdir(os.path.join(self.package_folder, "share")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - if self.settings.compiler == "Visual Studio": - self._package_msvc() + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "*.exe", + dst=os.path.join(self.package_folder, "bin"), + src=os.path.join(self.source_folder, "bin"), + keep_path=False) + for folder in ("asminc", "cfg", "include", "lib", "target"): + copy(self, "*", + dst=os.path.join(self.package_folder, "bin", "share", "cc65", folder), + src=os.path.join(self.source_folder, folder)) else: - self._package_autotools() - - def package_id(self): - del self.info.settings.compiler - if self.settings.compiler == "Visual Studio": - if self.settings.arch == "x86_64": - self.info.settings.arch = "x86" + with chdir(self, os.path.join(self.source_folder)): + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_path, "samples")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: %s" % bindir) - self.env_info.PATH.append(bindir) - - self.output.info("Seting CC65_HOME environment variable: %s" % self._datadir) - self.env_info.CC65_HOME = self._datadir + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] bin_ext = ".exe" if self.settings.os == "Windows" else "" + bindir = os.path.join(self.package_folder, "bin") + self.buildenv_info.define_path("CC65_HOME", os.path.join(self.package_folder, "bin", "share", "cc65")) + self.buildenv_info.define_path("CC65", os.path.join(bindir, "cc65" + bin_ext)) + self.buildenv_info.define_path("AS65", os.path.join(bindir, "ca65" + bin_ext)) + self.buildenv_info.define_path("LD65", os.path.join(bindir, "cl65" + bin_ext)) - cc65_cc = os.path.join(bindir, "cc65" + bin_ext) - self.output.info("Seting CC65 environment variable: {}".format(cc65_cc)) - self.env_info.CC65 = cc65_cc - - cc65_as = os.path.join(bindir, "ca65" + bin_ext) - self.output.info("Seting AS65 environment variable: {}".format(cc65_as)) - self.env_info.AS65 = cc65_as - - cc65_ld = os.path.join(bindir, "cl65" + bin_ext) - self.output.info("Seting LD65 environment variable: {}".format(cc65_ld)) - self.env_info.LD65 = cc65_ld + # TODO: Legacy, to be removed on Conan 2.0 + self.env_info.PATH.append(bindir) + self.env_info.CC65_HOME = os.path.join(self.package_folder, "bin", "share", "cc65") + self.env_info.CC65 = os.path.join(bindir, "cc65" + bin_ext) + self.env_info.AS65 = os.path.join(bindir, "ca65" + bin_ext) + self.env_info.LD65 = os.path.join(bindir, "cl65" + bin_ext) diff --git a/recipes/cc65/all/test_package/conanfile.py b/recipes/cc65/all/test_package/conanfile.py index b930a6b2cce7f..d7ddd1a009806 100644 --- a/recipes/cc65/all/test_package/conanfile.py +++ b/recipes/cc65/all/test_package/conanfile.py @@ -1,33 +1,39 @@ -from conans import ConanFile, tools import os import shutil +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.files import mkdir, rm +from conan.tools.layout import basic_layout + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - - exports_sources = "hello.c", "text.s" + generators = "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" _targets = ("c64", "apple2") + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + def build(self): - if not tools.cross_building(self.settings): - for src in self.exports_sources: + if can_run(self): + for src in ["hello.c", "text.s"]: shutil.copy(os.path.join(self.source_folder, src), os.path.join(self.build_folder, src)) for target in self._targets: - output = "hello_{}".format(target) - tools.mkdir(target) - try: - # Try removing the output file to give confidence it is created by cc65 - os.unlink(output) - except FileNotFoundError: - pass - self.run("{p} -O -t {t} hello.c -o {t}/hello.s".format(p=os.environ["CC65"], t=target)) - self.run("{p} -t {t} {t}/hello.s -o {t}/hello.o".format(p=os.environ["AS65"], t=target)) - self.run("{p} -t {t} text.s -o {t}/text.o".format(p=os.environ["AS65"], t=target)) - self.run("{p} -o {o} -t {t} {t}/hello.o {t}/text.o {t}.lib".format(o=output, p=os.environ["LD65"], t=target)) + output = f"hello_{target}" + mkdir(self, target) + rm(self, output, self.build_folder) + self.run(f"cc65 -O -t {target} hello.c -o {target}/hello.s") + self.run(f"ca65 -t {target} {target}/hello.s -o {target}/hello.o") + self.run(f"ca65 -t {target} text.s -o {target}/text.o") + self.run(f"ld65 -o {output} -t {target} {target}/hello.o {target}/text.o {target}.lib") def test(self): - if not tools.cross_building(self.settings): + if can_run(self): for target in self._targets: - assert os.path.isfile("hello_{}".format(target)) + assert os.path.isfile(f"hello_{target}") diff --git a/recipes/ccache/all/conandata.yml b/recipes/ccache/all/conandata.yml index 4e411c4409cdf..ca431f6e0685b 100644 --- a/recipes/ccache/all/conandata.yml +++ b/recipes/ccache/all/conandata.yml @@ -1,4 +1,10 @@ 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" "4.8.1": url: "https://github.com/ccache/ccache/releases/download/v4.8.1/ccache-4.8.1.tar.xz" sha256: "87959b6819530b3dcaeb39992f585b9fc2c7120302809741378097774919fb6f" @@ -9,15 +15,35 @@ 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" + patch_type: "conan" "4.8.1": - patch_file: "patches/4.8-cmake-msvc-runtime.patch" patch_description: "fixup MSVC runtime" patch_type: "conan" + - patch_file: "patches/4.7.4-use-intrinsics-if-msbuild.patch" + patch_description: "fix build issue when using Visual Studio generator" + patch_type: "backport" + patch_source: "https://github.com/ccache/ccache/commit/350787245e7e894c8a472b176545f59a10e9dadb" "4.8": - patch_file: "patches/4.8-cmake-msvc-runtime.patch" patch_description: "fixup MSVC runtime" patch_type: "conan" + - patch_file: "patches/4.7.4-use-intrinsics-if-msbuild.patch" + patch_description: "fix build issue when using Visual Studio generator" + patch_type: "backport" + patch_source: "https://github.com/ccache/ccache/commit/350787245e7e894c8a472b176545f59a10e9dadb" "4.7.4": - patch_file: "patches/4.7.4-cmake-msvc-runtime.patch" patch_description: "fixup MSVC runtime" patch_type: "conan" + - patch_file: "patches/4.7.4-use-intrinsics-if-msbuild.patch" + patch_description: "fix build issue when using Visual Studio generator" + patch_type: "backport" + patch_source: "https://github.com/ccache/ccache/commit/350787245e7e894c8a472b176545f59a10e9dadb" diff --git a/recipes/ccache/all/conanfile.py b/recipes/ccache/all/conanfile.py index d2852b89b924b..8234bde469ffe 100644 --- a/recipes/ccache/all/conanfile.py +++ b/recipes/ccache/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.5") if self.options.redis_storage_backend: self.requires("hiredis/1.1.0") @@ -67,7 +67,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires C++ filesystem library, that is not supported by Clang 11 + libstdc++.") def build_requirements(self): - self.tool_requires("cmake/3.25.3") + self.tool_requires("cmake/[>=3.15 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -77,6 +77,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["REDIS_STORAGE_BACKEND"] = self.options.redis_storage_backend tc.variables["HIREDIS_FROM_INTERNET"] = False + tc.variables["ZSTD_FROM_INTERNET"] = False tc.variables["ENABLE_DOCUMENTATION"] = False tc.variables["ENABLE_TESTING"] = False tc.generate() @@ -85,6 +86,7 @@ def generate(self): deps.set_property("hiredis", "cmake_target_name", "HIREDIS::HIREDIS") deps.set_property("hiredis", "cmake_find_mode", "module") deps.set_property("zstd", "cmake_target_name", "ZSTD::ZSTD") + deps.set_property("zstd", "cmake_find_mode", "module") deps.generate() def build(self): diff --git a/recipes/ccache/all/patches/4.7.4-use-intrinsics-if-msbuild.patch b/recipes/ccache/all/patches/4.7.4-use-intrinsics-if-msbuild.patch new file mode 100644 index 0000000000000..f55e169ebc167 --- /dev/null +++ b/recipes/ccache/all/patches/4.7.4-use-intrinsics-if-msbuild.patch @@ -0,0 +1,34 @@ +From 350787245e7e894c8a472b176545f59a10e9dadb Mon Sep 17 00:00:00 2001 +From: Rafael Kitover +Date: Mon, 22 May 2023 22:13:19 +0000 +Subject: [PATCH] fix: Disable masm on msbuild for blake3 with VS + +Because of some bug with either msbuild or the cmake generator, the C +compiler flags are passed to the masm assembler making it fail. + +Use the C intrinsic versions for blake3 when msbuild is in use. + +Fix #1278 + +Signed-off-by: Rafael Kitover +--- + src/third_party/blake3/CMakeLists.txt | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/third_party/blake3/CMakeLists.txt b/src/third_party/blake3/CMakeLists.txt +index a30342d5d3..1e30eb3cfe 100644 +--- a/src/third_party/blake3/CMakeLists.txt ++++ b/src/third_party/blake3/CMakeLists.txt +@@ -27,7 +27,11 @@ function(add_source_if_enabled feature msvc_flags others_flags intrinsic) + + # First check if it's possible to use the assembler variant for the feature. + string(TOUPPER "have_asm_${feature}" have_feature) +- if(NOT DEFINED "${have_feature}" AND CMAKE_SIZEOF_VOID_P EQUAL 8) ++ if(NOT DEFINED "${have_feature}" AND CMAKE_SIZEOF_VOID_P EQUAL 8 ++# Force intrinsic version for msbuild because of a bug in the cmake generator ++# or msbuild itself with masm flags. ++ AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") ++ + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Performing Test ${have_feature}") + endif() diff --git a/recipes/ccache/config.yml b/recipes/ccache/config.yml index 6bdb34d995150..98dd3df9a94de 100644 --- a/recipes/ccache/config.yml +++ b/recipes/ccache/config.yml @@ -1,4 +1,8 @@ versions: + "4.8.3": + folder: all + "4.8.2": + folder: all "4.8.1": folder: all "4.8": diff --git a/recipes/ccfits/all/conanfile.py b/recipes/ccfits/all/conanfile.py index c9d53caa2f748..ddf9d5732efd3 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 20c81e8e8eb12..0d20897301b68 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 23bdb146d0b4e..2b48b57aef4a1 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 7523bebc550cf..c0fce5f2a6d25 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 d120a992c06a6..0a6bc68712d90 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 47afe48e93634..7118801d3af54 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 e4ca7cba349d0..b676ebea4436f 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 0000000000000..aabc47a84c955 --- /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 0000000000000..2978c914e5d8d --- /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 95ff77359ef24..c6e7e2c924085 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 86be0e74f0cf1..89408b2501d3b 100644 --- a/recipes/certify/all/conanfile.py +++ b/recipes/certify/all/conanfile.py @@ -1,23 +1,29 @@ -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 + +required_conan_version = ">=1.52.0" class CertifyConan(ConanFile): name = "certify" description = "Platform-specific TLS keystore abstraction for use with Boost.ASIO and OpenSSL" - topics = ("boost", "asio", "tls", "ssl", "https") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/djarek/certify" - license = "BSL-1.0" + topics = ("boost", "asio", "tls", "ssl", "https", "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 @property def _compilers_minimum_version(self): @@ -28,17 +34,19 @@ def _compilers_minimum_version(self): "apple-clang": "11", } - @property - def _min_cppstd(self): - return "17" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.79.0") - self.requires("openssl/1.1.1q") + self.requires("boost/1.83.0") + self.requires("openssl/[>=1.1 <4]") + + 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) def lazy_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -48,29 +56,38 @@ def lazy_lt_semver(v1, v2): 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.output.warning( + f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17." + ) 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)) - - def package_id(self): - self.info.header_only() + raise ConanInvalidConfiguration( + f"{self.name} requires C++17, 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_1_0.txt", dst="licenses", - src=self._source_subfolder) - self.copy(pattern="*", dst="include", - src=os.path.join(self._source_subfolder, "include")) + 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.set_property("cmake_file_name", "certify") self.cpp_info.set_property("cmake_target_name", "certify::core") - self.cpp_info.components["_certify"].requires = ["boost::boost", "openssl::openssl"] + self.cpp_info.components["_certify"].requires = ["boost::boost", "openssl::openssl"] self.cpp_info.components["_certify"].names["cmake_find_package"] = "core" self.cpp_info.components["_certify"].names["cmake_find_package_multi"] = "core" + self.cpp_info.names["cmake_find_package"] = "certify" self.cpp_info.names["cmake_find_package_multi"] = "certify" diff --git a/recipes/certify/all/test_package/CMakeLists.txt b/recipes/certify/all/test_package/CMakeLists.txt index 37373018e655a..2d5f2ce7457e3 100644 --- a/recipes/certify/all/test_package/CMakeLists.txt +++ b/recipes/certify/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(certify REQUIRED CONFIG) diff --git a/recipes/certify/all/test_package/conanfile.py b/recipes/certify/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/certify/all/test_package/conanfile.py +++ b/recipes/certify/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/certify/all/test_package/test_package.cpp b/recipes/certify/all/test_package/test_package.cpp index 28f4c97339bb8..6e95446160938 100644 --- a/recipes/certify/all/test_package/test_package.cpp +++ b/recipes/certify/all/test_package/test_package.cpp @@ -6,15 +6,15 @@ #include int main() { - boost::asio::io_context ioc{1}; - boost::asio::ssl::context context{boost::asio::ssl::context_base::method::tls_client}; - boost::asio::ssl::stream stream(ioc, context); - constexpr auto hostname = "example.com"; + boost::asio::io_context ioc{1}; + boost::asio::ssl::context context{boost::asio::ssl::context_base::method::tls_client}; + boost::asio::ssl::stream stream(ioc, context); + constexpr auto hostname = "example.com"; - BOOST_TEST(boost::certify::sni_hostname(stream).empty()); - boost::certify::sni_hostname(stream, hostname); - BOOST_TEST(boost::certify::sni_hostname(stream) == hostname); - std::cout << boost::report_errors(); + BOOST_TEST(boost::certify::sni_hostname(stream).empty()); + boost::certify::sni_hostname(stream, hostname); + BOOST_TEST(boost::certify::sni_hostname(stream) == hostname); + std::cout << boost::report_errors(); - return 0; + return 0; } diff --git a/recipes/cfitsio/all/conandata.yml b/recipes/cfitsio/all/conandata.yml index 4b0ca8e449091..6b0480fb20585 100644 --- a/recipes/cfitsio/all/conandata.yml +++ b/recipes/cfitsio/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.3.1": + url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.3.1.tar.gz" + sha256: "2332b965d327a15c103a7d31d6d1afaf775d00e9785dd25332ae76b9725351e4" + "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 +24,12 @@ sources: url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.47.tar.gz" sha256: "985606e058403c073a68d95be74e9696f0ded9414520784457a1d4cba8cca7e2" patches: + "4.3.1": + - patch_file: "patches/windows-use-strtok_s.patch" + - patch_file: "patches/fix-cmake-4.2.0.patch" + "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 b5849b0ae2946..782f21cb2a73b 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 cfbf4d00aea10..644678fbd04e4 100644 --- a/recipes/cfitsio/config.yml +++ b/recipes/cfitsio/config.yml @@ -1,4 +1,8 @@ versions: + "4.3.1": + folder: all + "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 a9e86a3361343..eda02a9fb3ec4 100644 --- a/recipes/cgal/all/conandata.yml +++ b/recipes/cgal/all/conandata.yml @@ -1,13 +1,4 @@ sources: - "5.0.4": - sha256: e82096c03ccb31200f02a5b9bd0a5e9ea07840351987dca55aae99a8d5823f59 - url: https://github.com/CGAL/cgal/releases/download/v5.0.4/CGAL-5.0.4.tar.xz - "5.1.5": - sha256: b1bb8a6053aa12baa5981aef20a542cd3e617a86826963fb8fb6852b1a0da97c - url: https://github.com/CGAL/cgal/releases/download/v5.1.5/CGAL-5.1.5.tar.xz - "5.2.4": - sha256: 7f792c59d067e41a073bcee5d615f4276f9ccd2b5e7d359093cc36149fda14c3 - url: https://github.com/CGAL/cgal/releases/download/v5.2.4/CGAL-5.2.4.tar.xz "5.3.2": sha256: af917dbc550388ebcb206f774e610fbdb914d95a4b2932fa952279129103852b url: https://github.com/CGAL/cgal/releases/download/v5.3.2/CGAL-5.3.2.tar.xz @@ -17,3 +8,38 @@ sources: "5.5.1": sha256: 091630def028facdcaf00eb5b68ad79eddac1b855cca6e87eef18a031566edfc url: https://github.com/CGAL/cgal/releases/download/v5.5.1/CGAL-5.5.1.tar.xz + "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" + patch_type: bugfix + patch_source: https://github.com/CGAL/cgal/pull/7502 + patch_description: Fix Eigen3 support in CGAL + "5.5": + - 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 + "5.5.1": + - 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 + "5.5.2": + - 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 + "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 47cc7c6fa95ce..2d4d74dba1bec 100644 --- a/recipes/cgal/all/conanfile.py +++ b/recipes/cgal/all/conanfile.py @@ -1,8 +1,11 @@ import os +import textwrap from conan import ConanFile -from conan.tools import files -from conan.tools import scm -from conans import CMake +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, replace_in_file, rmdir, rm, copy, save, export_conandata_patches, patch +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration required_conan_version = ">=1.50.0" @@ -14,63 +17,171 @@ class CgalConan(ConanFile): description = "C++ library that provides easy access to efficient and reliable algorithms"\ " in computational geometry." topics = ("cgal", "geometry", "algorithms") + package_type = "header-library" settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - exports_sources = "CMakeLists.txt" + generators = "CMakeDeps" short_paths = True - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "14" @property - def _build_subfolder(self): - return "build_subfolder" + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["CGAL_HEADER_ONLY"] = "TRUE" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def export_sources(self): + export_conandata_patches(self) - def _patch_sources(self): - if scm.Version(self.version) < "5.3": - files.replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), - "CMAKE_SOURCE_DIR", "CMAKE_CURRENT_SOURCE_DIR") - else: - files.replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), - "if(NOT PROJECT_NAME)", "if(TRUE)") + 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.82.0") + self.requires("eigen/3.4.0") self.requires("mpfr/4.1.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._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 _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "if(NOT PROJECT_NAME)", "if(1)", strict=False) + for it in self.conan_data.get("patches", {}).get(self.version, []): + patch(self, **it, strip=2) + def source(self): - files.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.generate() 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 = CMake(self) cmake.install() - files.rmdir(self, os.path.join(self.package_folder, "share")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - files.rmdir(self, os.path.join(self.package_folder, "bin")) + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "bin")) + rm(self, "*Config*.cmake", os.path.join(self.package_folder, "lib", "cmake", "CGAL")) + rm(self, "Find*.cmake", os.path.join(self.package_folder, "lib", "cmake", "CGAL")) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._cmake_module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + ''' + CGAL requires C++14, and specific compilers flags to enable the possibility to set FPU rounding modes. + This CMake module, from the upsream CGAL pull-request https://github.com/CGAL/cgal/pull/7512, takes + care of all the known compilers CGAL has ever supported. + ''' + content = textwrap.dedent('''\ +function(CGAL_setup_CGAL_flags target) + # CGAL now requires C++14. `decltype(auto)` is used as a marker of + # C++14. + target_compile_features(${target} INTERFACE cxx_decltype_auto) + + if(MSVC) + target_compile_options(${target} INTERFACE + "-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS") + if(CMAKE_VERSION VERSION_LESS 3.11) + target_compile_options(${target} INTERFACE + /fp:strict + /fp:except- + /wd4503 # Suppress warnings C4503 about "decorated name length exceeded" + /bigobj # Use /bigobj by default + ) + else() + # The MSVC generator supports `$` since CMake 3.11. + target_compile_options(${target} INTERFACE + $<$:/fp:strict> + $<$:/fp:except-> + $<$:/wd4503> # Suppress warnings C4503 about "decorated name length exceeded" + $<$:/bigobj> # Use /bigobj by default + ) + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3) + message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected") + message(STATUS "Boost MP is turned off for all Apple Clang versions below 11.0.3!") + target_compile_options(${target} INTERFACE "-DCGAL_DO_NOT_USE_BOOST_MP") + endif() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + message( STATUS "Using Intel Compiler. Adding -fp-model strict" ) + if(WIN32) + target_compile_options(${target} INTERFACE "/fp:strict") + else() + target_compile_options(${target} INTERFACE "-fp-model" "strict") + endif() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro") + message( STATUS "Using SunPro compiler, using STLPort 4." ) + target_compile_options(${target} INTERFACE + "-features=extensions;-library=stlport4;-D_GNU_SOURCE") + target_link_libraries(${target} INTERFACE "-library=stlport4") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + if ( RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE ) + target_compile_options(${target} INTERFACE "-Wall") + endif() + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3) + message( STATUS "Using gcc version 4 or later. Adding -frounding-math" ) + if(CMAKE_VERSION VERSION_LESS 3.3) + target_compile_options(${target} INTERFACE "-frounding-math") + else() + target_compile_options(${target} INTERFACE "$<$:-frounding-math>") + endif() + endif() + if ( "${GCC_VERSION}" MATCHES "^4.2" ) + message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" ) + target_compile_options(${target} INTERFACE "-fno-strict-aliasing" ) + endif() + if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha" ) + message( STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d" ) + target_compile_options(${target} INTERFACE "-mieee" "-mfp-rounding-mode=d" ) + endif() + endif() +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) + + @property + def _cmake_module_file_rel_path(self): + return os.path.join("lib", "cmake", "CGAL", f"conan-official-{self.name}-variables.cmake") + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake", "CGAL") def package_info(self): - self.cpp_info.names["cmake_find_package"] = "CGAL" - self.cpp_info.names["cmake_find_package_multi"] = "CGAL" if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - self.cpp_info.defines.append("CGAL_HEADER_ONLY=1") + self.cpp_info.builddirs.append(self._module_subfolder) + self.cpp_info.set_property("cmake_find_package", "CGAL") + self.cpp_info.set_property("cmake_target_name", "CGAL::CGAL") + self.cpp_info.set_property("cmake_build_modules", [self._cmake_module_file_rel_path]) diff --git a/recipes/cgal/all/patches/0001-fix-for-conan.patch b/recipes/cgal/all/patches/0001-fix-for-conan.patch new file mode 100644 index 0000000000000..9f5f7328fbcd1 --- /dev/null +++ b/recipes/cgal/all/patches/0001-fix-for-conan.patch @@ -0,0 +1,22 @@ +diff --git a/Installation/cmake/modules/CGAL_Eigen3_support.cmake b/Installation/cmake/modules/CGAL_Eigen3_support.cmake +index cc0df0fad10..bfcf56c7c2f 100644 +--- a/Installation/cmake/modules/CGAL_Eigen3_support.cmake ++++ b/Installation/cmake/modules/CGAL_Eigen3_support.cmake +@@ -1,9 +1,14 @@ +-if(EIGEN3_FOUND AND NOT TARGET CGAL::Eigen3_support) ++if((EIGEN3_FOUND OR Eigen3_FOUND) AND NOT TARGET CGAL::Eigen3_support) + if(NOT TARGET Threads::Threads) + find_package(Threads REQUIRED) + endif() + add_library(CGAL::Eigen3_support INTERFACE IMPORTED) + set_target_properties(CGAL::Eigen3_support PROPERTIES +- INTERFACE_COMPILE_DEFINITIONS "CGAL_EIGEN3_ENABLED" +- INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}") ++ INTERFACE_COMPILE_DEFINITIONS "CGAL_EIGEN3_ENABLED") ++ if(TARGET Eigen3::Eigen) ++ target_link_libraries(CGAL::Eigen3_support INTERFACE Eigen3::Eigen) ++ else() ++ set_target_properties(CGAL::Eigen3_support PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}") ++ endif() + endif() diff --git a/recipes/cgal/all/test_package/CMakeLists.txt b/recipes/cgal/all/test_package/CMakeLists.txt index c5080a4f875bc..f704ccdcb3f0e 100644 --- a/recipes/cgal/all/test_package/CMakeLists.txt +++ b/recipes/cgal/all/test_package/CMakeLists.txt @@ -1,9 +1,10 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.10) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(CGAL REQUIRED) +find_package(Eigen3 REQUIRED) +include(CGAL_Eigen3_support) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE CGAL::CGAL) +target_link_libraries(${PROJECT_NAME} PRIVATE CGAL::Eigen3_support) diff --git a/recipes/cgal/all/test_package/conanfile.py b/recipes/cgal/all/test_package/conanfile.py index 2b959f9f04238..539dd819448cb 100644 --- a/recipes/cgal/all/test_package/conanfile.py +++ b/recipes/cgal/all/test_package/conanfile.py @@ -1,20 +1,26 @@ import os from conan import ConanFile -from conan.tools import build -from conans import CMake - +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" + + def requirements(self): + self.requires("eigen/3.4.0") + 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 build.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/cgal/config.yml b/recipes/cgal/config.yml index 72209e170658c..3d807cdb944c7 100644 --- a/recipes/cgal/config.yml +++ b/recipes/cgal/config.yml @@ -1,13 +1,13 @@ versions: - "5.0.4": - folder: all - "5.1.5": - folder: all - "5.2.4": - folder: all "5.3.2": folder: all "5.5": folder: all "5.5.1": 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 f6abd559f85fb..6cfe1b1bc6c90 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 ef47a850d95dc..0f4eab97dfc4f 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 d126790212e0c..be2ba90eb4dc7 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 3a14ce35d533b..0000000000000 --- 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 d63882c55fca8..59f16765ad5b3 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 023c54a31f51b..26cabc85e9ca1 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 511cf63c2b9e2..a77b4ddd27299 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 38f4483872d47..bd5b26ca954ad 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 0000000000000..9735bda16bdf4 --- /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 dacc103c54543..7b9de138a3994 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 083b3a7d15fec..86b1d0c12f541 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 bc0e435d4c8c5..df487c5e826cd 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 5f056d0a34a03..ca0a3cec6c73e 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 ea57a464900be..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..84ee68733e516 --- /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/chaiscript/all/CMakeLists.txt b/recipes/chaiscript/all/CMakeLists.txt deleted file mode 100644 index a7a84f24be646..0000000000000 --- a/recipes/chaiscript/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(WIN32 AND BUILD_SHARED_LIBS) - -add_subdirectory("source_subfolder") diff --git a/recipes/chaiscript/all/conanfile.py b/recipes/chaiscript/all/conanfile.py index 00f73ebe996c7..84875e933945e 100644 --- a/recipes/chaiscript/all/conanfile.py +++ b/recipes/chaiscript/all/conanfile.py @@ -1,16 +1,24 @@ -from conans import ConanFile, CMake, tools +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, rmdir, collect_libs +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 ChaiScriptConan(ConanFile): name = "chaiscript" homepage = "https://github.com/ChaiScript/ChaiScript" description = "Embedded Scripting Language Designed for C++." - topics = ("conan", "embedded-scripting-language", "language") + topics = ("embedded-scripting-language", "language") url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" exports_sources = ["CMakeLists.txt"] - generators = "cmake" settings = "os", "compiler", "build_type", "arch" options = {"fPIC": [True, False], "dyn_load": [True, False], "use_std_make_shared": [True, False], "multithread_support": [True, False], @@ -21,60 +29,80 @@ class ChaiScriptConan(ConanFile): "header_only": True} @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property - def _build_subfolder(self): - return "build_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "ChaiScript-" + self.version - os.rename(extracted_dir, self._source_subfolder) + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15.0", + "msvc": "191", + } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTING"] = False - cmake.definitions["BUILD_SAMPLES"] = False - cmake.definitions["BUILD_MODULES"] = True - cmake.definitions["USE_STD_MAKE_SHARED"] = self.options.use_std_make_shared - cmake.definitions["DYNLOAD_ENABLED"] = self.options.dyn_load - cmake.definitions["MULTITHREAD_SUPPORT_ENABLED"] = self.options.multithread_support - cmake.configure(build_folder=self._build_subfolder) - return cmake + 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): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_SAMPLES"] = False + tc.variables["BUILD_MODULES"] = True + tc.variables["USE_STD_MAKE_SHARED"] = self.options.use_std_make_shared + tc.variables["DYNLOAD_ENABLED"] = self.options.dyn_load + tc.variables["MULTITHREAD_SUPPORT_ENABLED"] = self.options.multithread_support + 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", dst="licenses", src=self._source_subfolder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if self.options.header_only: - self.copy(pattern="*.hpp", dst="include", - src=os.path.join(self._source_subfolder, 'include')) + copy(self, pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_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")) - 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_id(self): - if self.options.header_only: - self.info.header_only() + if self.info.options.header_only: + self.info.clear() def package_info(self): if not self.options.header_only: - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.options.use_std_make_shared: self.cpp_info.defines.append("CHAISCRIPT_USE_STD_MAKE_SHARED") - if self.settings.os == "Linux": - self.cpp_info.system_libs = ["dl"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("dl") if self.options.multithread_support: self.cpp_info.system_libs.append("pthread") diff --git a/recipes/chaiscript/all/test_package/CMakeLists.txt b/recipes/chaiscript/all/test_package/CMakeLists.txt index 8ff036c8cd891..e3d7046fa8301 100644 --- a/recipes/chaiscript/all/test_package/CMakeLists.txt +++ b/recipes/chaiscript/all/test_package/CMakeLists.txt @@ -1,13 +1,11 @@ -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(chaiscript REQUIRED CONFIG) -# TEST_PACKAGE ################################################################# - -add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) -target_link_libraries(${CMAKE_PROJECT_NAME} CONAN_PKG::chaiscript) -set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 14) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} chaiscript::chaiscript) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + target_compile_options(${PROJECT_NAME} PRIVATE /bigobj) +endif() diff --git a/recipes/chaiscript/all/test_package/conanfile.py b/recipes/chaiscript/all/test_package/conanfile.py index 4d0099777a2a9..963c088e08a5c 100644 --- a/recipes/chaiscript/all/test_package/conanfile.py +++ b/recipes/chaiscript/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.build import can_run import os -from conans import ConanFile, CMake class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package_multi", "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) @@ -12,4 +21,6 @@ def build(self): cmake.build() def test(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/charls/all/conandata.yml b/recipes/charls/all/conandata.yml index 44bdf87dad81c..3f80f816193ca 100644 --- a/recipes/charls/all/conandata.yml +++ b/recipes/charls/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.2": + url: "https://github.com/team-charls/charls/archive/2.4.2.tar.gz" + sha256: "d1c2c35664976f1e43fec7764d72755e6a50a80f38eca70fcc7553cad4fe19d9" "2.4.1": url: "https://github.com/team-charls/charls/archive/2.4.1.tar.gz" sha256: "f313f556b5acb9215961d9718c21235aafcd43bce6b357bf66f772e5692bba75" diff --git a/recipes/charls/all/conanfile.py b/recipes/charls/all/conanfile.py index 97d9f69aa36d4..90461d15285bf 100644 --- a/recipes/charls/all/conanfile.py +++ b/recipes/charls/all/conanfile.py @@ -63,7 +63,10 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["CHARLS_INSTALL"] = True + tc.cache_variables["CHARLS_BUILD_FUZZ_TEST"] = False + tc.cache_variables["CHARLS_BUILD_SAMPLES"] = False + tc.cache_variables["CHARLS_BUILD_TESTS"] = False + tc.cache_variables["CHARLS_INSTALL"] = True tc.generate() def build(self): diff --git a/recipes/charls/config.yml b/recipes/charls/config.yml index 96f2c11fde345..f31161f1acff8 100644 --- a/recipes/charls/config.yml +++ b/recipes/charls/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.2": + folder: all "2.4.1": folder: all "2.4.0": diff --git a/recipes/chef-fun/all/conandata.yml b/recipes/chef-fun/all/conandata.yml index b1d88fa4a923c..9532bc9181c94 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 e764b383caf1b..8958e9403c1fa 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 48499fa0989d9..e845ae751a301 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 d8a13868268e6..715e55357a17b 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 72a9a9cadd3ff..785d8d95d890d 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 0000000000000..c9e73e3a7173c --- /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 0000000000000..c7f6cc492b72b --- /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 0000000000000..3d6e4b5e02fcd --- /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 0000000000000..e845ae751a301 --- /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 0000000000000..e7b235a639ba2 --- /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 0000000000000..55bc2cddc1b4a --- /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 eea92963062f7..96bd683acd199 100644 --- a/recipes/cimg/all/conandata.yml +++ b/recipes/cimg/all/conandata.yml @@ -1,22 +1,19 @@ sources: - "3.2.0": - url: "https://cimg.eu/files/CImg_3.2.0.zip" - sha256: "7a923357c3127d8839696c7b0f4eb4c23982c090d3f49fb133f2c8556ca74a88" + "3.3.2": + url: "https://cimg.eu/files/CImg_3.3.2.zip" + sha256: "d49ecd63b46f53ddcee5c7695ddb0fe8b07e033bb81b5ed075cfe352462c5f73" + "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 4c4d65c0ab3d8..b626bca664ae6 100644 --- a/recipes/cimg/all/conanfile.py +++ b/recipes/cimg/all/conanfile.py @@ -11,11 +11,11 @@ class CImgConan(ConanFile): name = "cimg" description = "The CImg Library is a small and open-source C++ toolkit for image processing" - homepage = "http://cimg.eu" - topics = ("physics", "simulation", "robotics", "kinematics", "engine") license = "CeCILL V2" url = "https://github.com/conan-io/conan-center-index" - + homepage = "http://cimg.eu" + topics = ("physics", "simulation", "robotics", "kinematics", "engine") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "enable_fftw": [True, False], @@ -64,17 +64,20 @@ def layout(self): def requirements(self): if self.options.enable_fftw: - self.requires("fftw/3.3.9") + self.requires("fftw/3.3.10") if self.options.enable_jpeg: self.requires("libjpeg/9e") if self.options.enable_openexr: - self.requires("openexr/2.5.7") + self.requires("openexr/3.2.1") if self.options.enable_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.enable_tiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.6.0") if self.options.enable_ffmpeg: - self.requires("ffmpeg/5.0") + if self.options.enable_opencv: + self.requires("ffmpeg/4.4") + else: + self.requires("ffmpeg/5.1") if self.options.enable_opencv: self.requires("opencv/4.5.5") if self.options.enable_magick: @@ -93,8 +96,7 @@ def validate(self): raise ConanInvalidConfiguration("xshm not available in CCI yet") 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/cimg/config.yml b/recipes/cimg/config.yml index 570cd2f89fed4..70cd903d901e9 100644 --- a/recipes/cimg/config.yml +++ b/recipes/cimg/config.yml @@ -1,15 +1,13 @@ versions: - "3.2.0": + "3.3.2": folder: all - "3.0.2": - folder: all - "3.0.0": + "3.3.0": folder: all - "2.9.9": + "3.2.6": folder: all - "2.9.4": + "3.0.2": folder: all - "2.9.2": + "2.9.9": folder: all "2.8.3": folder: all diff --git a/recipes/circularbuffer/all/conanfile.py b/recipes/circularbuffer/all/conanfile.py index c3948bef41ba8..695a6ea119334 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 d331e75f3a1ad..933c1c7ab13f6 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 3ddfb18ba1fed..0d20897301b68 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 0a93a273ba575..90eb89e3f2f46 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 c9d59e4b258c6..0000000000000 --- 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/conandata.yml b/recipes/cista/all/conandata.yml index 1547b3bc2b229..dddca09a6246d 100644 --- a/recipes/cista/all/conandata.yml +++ b/recipes/cista/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "0.14": + - url: "https://github.com/felixguendling/cista/releases/download/v0.14/cista.h" + sha256: "078933804966439ae105a6a748aa027a2f197351d735712b1efca0453340562d" + - url: "https://raw.githubusercontent.com/felixguendling/cista/v0.14/LICENSE" + sha256: "fcd47e35fd6dc22feec454c5c1e572ccb7587dedd91d824528ebbb00a7f37c56" "0.11": - url: "https://github.com/felixguendling/cista/releases/download/v0.11/cista.h" sha256: "e2e37fa1f7278e7f1a8dab7d84b6b00f5a0a4fb48f42fbe5761b7ddd0d07314c" diff --git a/recipes/cista/all/conanfile.py b/recipes/cista/all/conanfile.py index a5a461c964a04..98e6da7d482b1 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 d120a992c06a6..0a6bc68712d90 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/cista/config.yml b/recipes/cista/config.yml index ac2c19b16c278..4390251f71953 100644 --- a/recipes/cista/config.yml +++ b/recipes/cista/config.yml @@ -1,4 +1,6 @@ versions: + "0.14": + folder: all "0.11": folder: all "0.10": diff --git a/recipes/cityhash/all/conandata.yml b/recipes/cityhash/all/conandata.yml index 77c6f2317b0e8..35df63b093df5 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 489bded5765de..6e8b7ecbe183c 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 4d048e6a27d5b..b393da542821b 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/cjson/all/conandata.yml b/recipes/cjson/all/conandata.yml index 397bb216165bb..98903aa382fd7 100644 --- a/recipes/cjson/all/conandata.yml +++ b/recipes/cjson/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.7.17": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.17.tar.gz" + sha256: "c91d1eeb7175c50d49f6ba2a25e69b46bd05cffb798382c19bfb202e467ec51c" + "1.7.16": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.16.tar.gz" + sha256: "451131a92c55efc5457276807fc0c4c2c2707c9ee96ef90c47d68852d5384c6c" "1.7.15": url: "https://github.com/DaveGamble/cJSON/archive/v1.7.15.tar.gz" sha256: "5308fd4bd90cef7aa060558514de6a1a4a0819974a26e6ed13973c5f624c24b2" diff --git a/recipes/cjson/config.yml b/recipes/cjson/config.yml index 894ac0453b1d4..8dc9df22965bb 100644 --- a/recipes/cjson/config.yml +++ b/recipes/cjson/config.yml @@ -1,4 +1,8 @@ versions: + "1.7.17": + folder: all + "1.7.16": + folder: all "1.7.15": folder: all "1.7.14": diff --git a/recipes/clhep/all/conandata.yml b/recipes/clhep/all/conandata.yml index 2745e50b6c689..0b47cdc0ae08e 100644 --- a/recipes/clhep/all/conandata.yml +++ b/recipes/clhep/all/conandata.yml @@ -1,9 +1,41 @@ sources: + "2.4.7.1": + url: "https://proj-clhep.web.cern.ch/proj-clhep/dist1/clhep-2.4.7.1.tgz" + sha256: "1c8304a7772ac6b99195f1300378c6e3ddf4ad07c85d64a04505652abb8a55f9" + "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.7.1": + - 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.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 0000000000000..7137344105ea3 --- /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 0000000000000..ab753ce5e9b81 --- /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 e3d64184919ef..87edeeec0d29b 100644 --- a/recipes/clhep/config.yml +++ b/recipes/clhep/config.yml @@ -1,3 +1,7 @@ versions: + "2.4.7.1": + folder: all + "2.4.6.4": + folder: all "2.4.1.3": folder: all diff --git a/recipes/cli11/all/conanfile.py b/recipes/cli11/all/conanfile.py index 6ccc240eeda4f..e28dd119e7d21 100644 --- a/recipes/cli11/all/conanfile.py +++ b/recipes/cli11/all/conanfile.py @@ -8,26 +8,31 @@ class CLI11Conan(ConanFile): name = "cli11" - homepage = "https://github.com/CLIUtils/CLI11" description = "A command line parser for C++11 and beyond." - topics = "cli-parser", "cpp11", "no-dependencies", "cli", "header-only" - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" - settings = "os", "compiler", "build_type", "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/CLIUtils/CLI11" + topics = "cli-parser", "cpp11", "no-dependencies", "cli", "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): + cmake_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 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) @@ -50,10 +55,10 @@ def package(self): # since 2.1.1 rmdir(self, os.path.join(self.package_folder, "share")) - 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", "CLI11") self.cpp_info.set_property("cmake_target_name", "CLI11::CLI11") self.cpp_info.set_property("pkg_config_name", "CLI11") diff --git a/recipes/cli11/all/test_package/CMakeLists.txt b/recipes/cli11/all/test_package/CMakeLists.txt index 0b06b681b8997..340e598340044 100644 --- a/recipes/cli11/all/test_package/CMakeLists.txt +++ b/recipes/cli11/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(CLI11 REQUIRED CONFIG) diff --git a/recipes/clickhouse-cpp/all/conandata.yml b/recipes/clickhouse-cpp/all/conandata.yml new file mode 100644 index 0000000000000..16d1b5fbe21b5 --- /dev/null +++ b/recipes/clickhouse-cpp/all/conandata.yml @@ -0,0 +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 new file mode 100644 index 0000000000000..4f321b7e267a7 --- /dev/null +++ b/recipes/clickhouse-cpp/all/conanfile.py @@ -0,0 +1,123 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain,CMakeDeps, cmake_layout +from conan.tools.files import copy, get +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class ClickHouseCppConan(ConanFile): + name = "clickhouse-cpp" + 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], + "with_openssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": False, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "6", + } + + @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 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("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], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + 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) + cd.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() + + def package_info(self): + self.cpp_info.libs.append("clickhouse-cpp-lib") + self.cpp_info.set_property("cmake_target_name", "clickhouse-cpp-lib::clickhouse-cpp-lib") + + if self._requires_compiler_rt: + ldflags = ["--rtlib=compiler-rt"] + self.cpp_info.exelinkflags = ldflags + 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" diff --git a/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt b/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ede8071f6e744 --- /dev/null +++ b/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +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) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/clickhouse-cpp/all/test_package/conanfile.py b/recipes/clickhouse-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6d529581ba2f5 --- /dev/null +++ b/recipes/clickhouse-cpp/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, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/clickhouse-cpp/all/test_package/test_package.cpp b/recipes/clickhouse-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..475e89847d23f --- /dev/null +++ b/recipes/clickhouse-cpp/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include +#include +#include +#include + +#include +#include +using namespace clickhouse; + +int main() +{ + const auto localHostEndpoint = ClientOptions() + .SetHost( "localhost") + .SetPort(9000) + .SetUser("default") + .SetPassword("") + .SetDefaultDatabase("default"); + + try { + Client client(localHostEndpoint); + } + catch (const std::exception &ex) + { + std::cout << "not connected but works" << std::endl; + } + + return 0; +} diff --git a/recipes/gli/all/test_v1_package/CMakeLists.txt b/recipes/clickhouse-cpp/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/gli/all/test_v1_package/CMakeLists.txt rename to recipes/clickhouse-cpp/all/test_v1_package/CMakeLists.txt diff --git a/recipes/openjpeg/all/test_v1_package/conanfile.py b/recipes/clickhouse-cpp/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/openjpeg/all/test_v1_package/conanfile.py rename to recipes/clickhouse-cpp/all/test_v1_package/conanfile.py diff --git a/recipes/clickhouse-cpp/config.yml b/recipes/clickhouse-cpp/config.yml new file mode 100644 index 0000000000000..b99c6305af105 --- /dev/null +++ b/recipes/clickhouse-cpp/config.yml @@ -0,0 +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 0000000000000..3299b8b622e6d --- /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 0000000000000..28bed6034cb23 --- /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 0000000000000..9f99123d7753c --- /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 0000000000000..2d472ecc585a3 --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..8244a75adf815 --- /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 0000000000000..a020f54c411ba --- /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 2a4b7c31a6543..772d6c4ae0f5d 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 829b5ca81b9ce..a7580c7f51d5d 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 70924c438164e..81d4d29e64c73 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/gtsam/all/test_v1_package/CMakeLists.txt b/recipes/clipp/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/gtsam/all/test_v1_package/CMakeLists.txt rename to recipes/clipp/all/test_v1_package/CMakeLists.txt diff --git a/recipes/sentry-native/all/test_v1_package/conanfile.py b/recipes/clipp/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/sentry-native/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 0000000000000..317fd4373a1de --- /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 0000000000000..fe88fd67b3e80 --- /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 0000000000000..4f4848313e076 --- /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 0000000000000..bdf115e1c468c --- /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 0000000000000..6b34466183083 --- /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 0000000000000..87531c64cc6a2 --- /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 0000000000000..f8b893dade24d --- /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 0000000000000..3713bf124619a --- /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 0000000000000..49b239cf22a6f --- /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 8be6c1dd9a952..b80516fa1a975 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 48ff824f79074..e5228fd78f381 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/3.x.x/conandata.yml b/recipes/cmake/3.x.x/conandata.yml index 54adb8af58aa6..da33ab402ca26 100644 --- a/recipes/cmake/3.x.x/conandata.yml +++ b/recipes/cmake/3.x.x/conandata.yml @@ -20,3 +20,6 @@ sources: "3.25.2": url: "https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz" sha256: "c026f22cb931dd532f648f087d587f07a1843c6e66a3dfca4fb0ea21944ed33c" + "3.26.4": + url: "https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4.tar.gz" + sha256: "313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208" diff --git a/recipes/cmake/binary/conandata.yml b/recipes/cmake/binary/conandata.yml index 00a43300159e0..312a7c7d57530 100644 --- a/recipes/cmake/binary/conandata.yml +++ b/recipes/cmake/binary/conandata.yml @@ -1,23 +1,156 @@ sources: - "3.26.3": + "3.28.1": Linux: armv8: - url: "https://cmake.org/files/v3.26/cmake-3.26.3-linux-aarch64.tar.gz" - sha256: "7a4fbe374475db1a098b632b54e3c9180973e8a791c700deabe5408ae23ea3ce" + url: "https://cmake.org/files/v3.28/cmake-3.28.1-linux-aarch64.tar.gz" + sha256: "e84d88e46ed8c85fbe259bcd4ca07df7a928df87e84013e0da34d91b01a25d71" x86_64: - url: "https://cmake.org/files/v3.26/cmake-3.26.3-linux-x86_64.tar.gz" - sha256: "28d4d1d0db94b47d8dfd4f7dec969a3c747304f4a28ddd6fd340f553f2384dc2" + url: "https://cmake.org/files/v3.28/cmake-3.28.1-linux-x86_64.tar.gz" + sha256: "f76398c24362ad87bad1a3d6f1e8f4377632b5b1c360c4ba1fd7cd205fd9d8d4" Macos: universal: - url: "https://cmake.org/files/v3.26/cmake-3.26.3-macos10.10-universal.tar.gz" - sha256: "b0d39ae9ddec3f193f50ff549edb30d0b35acb6c95c12f7611dbc8afc52c8ab6" + url: "https://cmake.org/files/v3.28/cmake-3.28.1-macos10.10-universal.tar.gz" + sha256: "f2d296294921b209d9c7edbc12ce175e00644fcabba362b6a24c32b0a4624a9a" Windows: armv8: - url: "https://cmake.org/files/v3.26/cmake-3.26.3-windows-arm64.zip" - sha256: "fd1d908ea54a081a092bc7f9dad0a6ba90fc5aa2644ee5cef901e3f925fce3d8" + url: "https://cmake.org/files/v3.28/cmake-3.28.1-windows-arm64.zip" + sha256: "a839b8d32c11b24f078142b5b8c3361a955ebc65788f0f0353b2121fe2f74e49" x86_64: - url: "https://cmake.org/files/v3.26/cmake-3.26.3-windows-x86_64.zip" - sha256: "91a418595cc9a97d5f679e36728dfec79ee52980f51e8814ec7b05b890708523" + url: "https://cmake.org/files/v3.28/cmake-3.28.1-windows-x86_64.zip" + sha256: "671332249bc7cc7424523d6c2b5edd3e3de90a43b8b82e8782f42da4fe4c562d" + "3.27.9": + Linux: + armv8: + 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.27/cmake-3.27.9-linux-x86_64.tar.gz" + sha256: "72b01478eeb312bf1a0136208957784fe55a7b587f8d9f9142a7fc9b0b9e9a28" + Macos: + universal: + 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.27/cmake-3.27.9-windows-arm64.zip" + sha256: "bca795134956264ede142f79aa513476985f4f410f6501a727d602760e9212dd" + x86_64: + 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 a504377b77d5d..7ce9e3ce4a58b 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,17 +1,31 @@ versions: - "3.19.8": + "3.28.1": folder: "binary" - "3.20.6": + "3.27.9": folder: "binary" - "3.21.7": + "3.27.7": folder: "binary" - "3.22.6": + "3.27.6": folder: "binary" - "3.23.5": + "3.27.5": folder: "binary" - "3.24.4": + "3.27.4": + folder: "binary" + "3.26.6": + folder: "binary" + "3.26.5": folder: "binary" "3.25.3": folder: "binary" - "3.26.3": + "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 a1da35f69dd6a..e6918dedc922a 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 fa33c20512fe4..cc33b8b3543ef 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 db7d5f7ac5bc3..434bb3861fb76 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 124290cb0ab4b..0d20897301b68 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/cmocka/all/conandata.yml b/recipes/cmocka/all/conandata.yml index d9ca5bcc54526..e378971eb0634 100644 --- a/recipes/cmocka/all/conandata.yml +++ b/recipes/cmocka/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.7": + url: "https://cmocka.org/files/1.1/cmocka-1.1.7.tar.xz" + sha256: "810570eb0b8d64804331f82b29ff47c790ce9cd6b163e98d47a4807047ecad82" "1.1.5": url: "https://cmocka.org/files/1.1/cmocka-1.1.5.tar.xz" sha256: "f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6" diff --git a/recipes/cmocka/all/conanfile.py b/recipes/cmocka/all/conanfile.py index 2c0c2ed7806b8..3cba1fe3283f8 100644 --- a/recipes/cmocka/all/conanfile.py +++ b/recipes/cmocka/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, save +from conan.tools.scm import Version import os import textwrap @@ -95,7 +96,10 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "cmocka") self.cpp_info.set_property("pkg_config_name", "cmocka") self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) - self.cpp_info.libs = ["cmocka{}".format("" if self.options.shared else "-static")] + lib_suffix = "" + if Version(self.version) < "1.1.7" and not self.options.shared: + lib_suffix = "-static" + self.cpp_info.libs = ["cmocka" + lib_suffix] # 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/cmocka/config.yml b/recipes/cmocka/config.yml index e48685771bd64..3996fe27c952c 100644 --- a/recipes/cmocka/config.yml +++ b/recipes/cmocka/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.7": + folder: all "1.1.5": folder: all diff --git a/recipes/cn-cbor/all/CMakeLists.txt b/recipes/cn-cbor/all/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9..0000000000000 --- 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 74e90a06cc919..91eccd3167699 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 33ae887aa6aea..50e6a7de0b4ea 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 933dbf96533ae..fae501d0afb9e 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 0000000000000..91630d79f4abb --- /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 0000000000000..9de3689208f00 --- /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 93cc4c7d5cadc..f6babc5b8b09b 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 217d2d1b7c4e1..1209ab9f83764 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 5fc7e9f24039c..9cf464447df6f 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 8da58a4cb0487..df23309955a25 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 af1af0ebb3d7f..7ab87ca07735c 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 e6b0fdb8110e8..b3607270e232e 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 c588b8cdfa767..19787257e6449 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 94e548dfba655..7d2a72db5923b 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 160bdaf5610e0..f085dad93e383 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 9b15feda1ca30..6b31eec8506a4 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-lemon/all/conandata.yml b/recipes/coin-lemon/all/conandata.yml index f00f950c896c3..9db91250ca346 100644 --- a/recipes/coin-lemon/all/conandata.yml +++ b/recipes/coin-lemon/all/conandata.yml @@ -4,5 +4,12 @@ sources: sha256: "71b7c725f4c0b4a8ccb92eb87b208701586cf7a96156ebd821ca3ed855bad3c8" patches: "1.3.1": - - patch_file: "patches/cmake-add-runtime-destination_1.3.1.patch" - - patch_file: "patches/0001-remove-register-keyword.patch" + - patch_file: "patches/0001-cmake-add-runtime-destination.patch" + patch_description: "Fix install destination of dll" + patch_type: "conan" + - patch_file: "patches/0002-cpp17-compat-remove-register-keyword.patch" + patch_description: "C++17 compatibility: remove register keyword" + patch_type: "portability" + - patch_file: "patches/0003-cpp20-compat-alloc.patch" + patch_description: "C++20 compatibility: remove usage of std::allocator::construct & destroy" + patch_type: "portability" diff --git a/recipes/coin-lemon/all/patches/cmake-add-runtime-destination_1.3.1.patch b/recipes/coin-lemon/all/patches/0001-cmake-add-runtime-destination.patch similarity index 100% rename from recipes/coin-lemon/all/patches/cmake-add-runtime-destination_1.3.1.patch rename to recipes/coin-lemon/all/patches/0001-cmake-add-runtime-destination.patch diff --git a/recipes/coin-lemon/all/patches/0001-remove-register-keyword.patch b/recipes/coin-lemon/all/patches/0002-cpp17-compat-remove-register-keyword.patch similarity index 100% rename from recipes/coin-lemon/all/patches/0001-remove-register-keyword.patch rename to recipes/coin-lemon/all/patches/0002-cpp17-compat-remove-register-keyword.patch diff --git a/recipes/coin-lemon/all/patches/0003-cpp20-compat-alloc.patch b/recipes/coin-lemon/all/patches/0003-cpp20-compat-alloc.patch new file mode 100644 index 0000000000000..9aa9db47a396b --- /dev/null +++ b/recipes/coin-lemon/all/patches/0003-cpp20-compat-alloc.patch @@ -0,0 +1,199 @@ +--- a/lemon/bits/array_map.h ++++ b/lemon/bits/array_map.h +@@ -88,7 +88,11 @@ namespace lemon { + Item it; + for (nf->first(it); it != INVALID; nf->next(it)) { + int id = nf->id(it);; ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::construct(allocator, &(values[id]), Value()); ++#else + allocator.construct(&(values[id]), Value()); ++#endif + } + } + +@@ -102,7 +106,11 @@ namespace lemon { + Item it; + for (nf->first(it); it != INVALID; nf->next(it)) { + int id = nf->id(it);; ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::construct(allocator, &(values[id]), value); ++#else + allocator.construct(&(values[id]), value); ++#endif + } + } + +@@ -121,7 +129,11 @@ namespace lemon { + Item it; + for (nf->first(it); it != INVALID; nf->next(it)) { + int id = nf->id(it);; ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::construct(allocator, &(values[id]), copy.values[id]); ++#else + allocator.construct(&(values[id]), copy.values[id]); ++#endif + } + } + +@@ -218,15 +230,24 @@ namespace lemon { + for (nf->first(it); it != INVALID; nf->next(it)) { + int jd = nf->id(it);; + if (id != jd) { ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::construct(allocator, &(new_values[jd]), values[jd]); ++ std::allocator_traits::destroy(allocator, &(values[jd])); ++#else + allocator.construct(&(new_values[jd]), values[jd]); + allocator.destroy(&(values[jd])); ++#endif + } + } + if (capacity != 0) allocator.deallocate(values, capacity); + values = new_values; + capacity = new_capacity; + } ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::construct(allocator, &(values[id]), Value()); ++#else + allocator.construct(&(values[id]), Value()); ++#endif + } + + // \brief Adds more new keys to the map. +@@ -260,8 +281,13 @@ namespace lemon { + } + } + if (found) continue; ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::construct(allocator, &(new_values[id]), values[id]); ++ std::allocator_traits::destroy(allocator, &(values[id])); ++#else + allocator.construct(&(new_values[id]), values[id]); + allocator.destroy(&(values[id])); ++#endif + } + if (capacity != 0) allocator.deallocate(values, capacity); + values = new_values; +@@ -269,7 +295,11 @@ namespace lemon { + } + for (int i = 0; i < int(keys.size()); ++i) { + int id = nf->id(keys[i]); ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::construct(allocator, &(values[id]), Value()); ++#else + allocator.construct(&(values[id]), Value()); ++#endif + } + } + +@@ -279,7 +309,11 @@ namespace lemon { + // and it overrides the erase() member function of the observer base. + virtual void erase(const Key& key) { + int id = Parent::notifier()->id(key); ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::destroy(allocator, &(values[id])); ++#else + allocator.destroy(&(values[id])); ++#endif + } + + // \brief Erase more keys from the map. +@@ -289,7 +323,11 @@ namespace lemon { + virtual void erase(const std::vector& keys) { + for (int i = 0; i < int(keys.size()); ++i) { + int id = Parent::notifier()->id(keys[i]); ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::destroy(allocator, &(values[id])); ++#else + allocator.destroy(&(values[id])); ++#endif + } + } + +@@ -303,7 +341,11 @@ namespace lemon { + Item it; + for (nf->first(it); it != INVALID; nf->next(it)) { + int id = nf->id(it);; ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::construct(allocator, &(values[id]), Value()); ++#else + allocator.construct(&(values[id]), Value()); ++#endif + } + } + +@@ -317,7 +359,11 @@ namespace lemon { + Item it; + for (nf->first(it); it != INVALID; nf->next(it)) { + int id = nf->id(it); ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits::destroy(allocator, &(values[id])); ++#else + allocator.destroy(&(values[id])); ++#endif + } + allocator.deallocate(values, capacity); + capacity = 0; +--- a/lemon/path.h ++++ b/lemon/path.h +@@ -582,7 +582,11 @@ namespace lemon { + void clear() { + while (first != 0) { + last = first->next; ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits>::destroy(alloc, first); ++#else + alloc.destroy(first); ++#endif + alloc.deallocate(first, 1); + first = last; + } +@@ -596,7 +600,11 @@ namespace lemon { + /// \brief Add a new arc before the current path + void addFront(const Arc& arc) { + Node *node = alloc.allocate(1); ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits>::construct(alloc, node, Node()); ++#else + alloc.construct(node, Node()); ++#endif + node->prev = 0; + node->next = first; + node->arc = arc; +@@ -617,7 +625,11 @@ namespace lemon { + } else { + last = 0; + } ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits>::destroy(alloc, node); ++#else + alloc.destroy(node); ++#endif + alloc.deallocate(node, 1); + } + +@@ -629,7 +641,11 @@ namespace lemon { + /// \brief Add a new arc behind the current path. + void addBack(const Arc& arc) { + Node *node = alloc.allocate(1); ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits>::construct(alloc, node, Node()); ++#else + alloc.construct(node, Node()); ++#endif + node->next = 0; + node->prev = last; + node->arc = arc; +@@ -650,7 +666,11 @@ namespace lemon { + } else { + first = 0; + } ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L) ++ std::allocator_traits>::destroy(alloc, node); ++#else + alloc.destroy(node); ++#endif + alloc.deallocate(node, 1); + } + diff --git a/recipes/coin-lemon/all/test_package/CMakeLists.txt b/recipes/coin-lemon/all/test_package/CMakeLists.txt index 5343530b3b283..2230f5888e397 100644 --- a/recipes/coin-lemon/all/test_package/CMakeLists.txt +++ b/recipes/coin-lemon/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES CXX) find_package(LEMON CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE LEMON::LEMON) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/coin-osi/all/conanfile.py b/recipes/coin-osi/all/conanfile.py index af104a9d3fcbb..25195bd85f4c6 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 af1af0ebb3d7f..7ab87ca07735c 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 e6b0fdb8110e8..b3607270e232e 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 d4916f7c0bcc0..b7e4e62e0653d 100644 --- a/recipes/coin-utils/all/conandata.yml +++ b/recipes/coin-utils/all/conandata.yml @@ -1,4 +1,10 @@ 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" "2.11.6": url: "https://github.com/coin-or/CoinUtils/archive/releases/2.11.6.tar.gz" sha256: "6ea31d5214f7eb27fa3ffb2bdad7ec96499dd2aaaeb4a7d0abd90ef852fc79ca" @@ -6,6 +12,16 @@ 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" + patch_description: "C++17 compatibility" + patch_type: "portability" "2.11.6": - patch_file: "patches/0001-no-check-pkgconfig.patch" - patch_file: "patches/0002-cpp17-compat.patch" diff --git a/recipes/coin-utils/all/conanfile.py b/recipes/coin-utils/all/conanfile.py index e953f7c06f675..98f96c3d12201 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/patches/0003-cpp17-compat.patch b/recipes/coin-utils/all/patches/0003-cpp17-compat.patch new file mode 100644 index 0000000000000..355ff4f097705 --- /dev/null +++ b/recipes/coin-utils/all/patches/0003-cpp17-compat.patch @@ -0,0 +1,55 @@ +--- a/CoinUtils/src/CoinOslC.h ++++ b/CoinUtils/src/CoinOslC.h +@@ -34,30 +34,30 @@ + extern "C" { + #endif + +-int c_ekkbtrn(register const EKKfactinfo *fact, ++int c_ekkbtrn(const EKKfactinfo *fact, + double *dwork1, + int *mpt, int first_nonzero); +-int c_ekkbtrn_ipivrw(register const EKKfactinfo *fact, ++int c_ekkbtrn_ipivrw(const EKKfactinfo *fact, + double *dwork1, + int *mpt, int ipivrw, int *spare); + +-int c_ekketsj(register /*const*/ EKKfactinfo *fact, ++int c_ekketsj(/*const*/ EKKfactinfo *fact, + double *dwork1, + int *mpt2, double dalpha, int orig_nincol, + int npivot, int *nuspikp, + const int ipivrw, int *spare); +-int c_ekkftrn(register const EKKfactinfo *fact, ++int c_ekkftrn(const EKKfactinfo *fact, + double *dwork1, + double *dpermu, int *mpt, int numberNonZero); + +-int c_ekkftrn_ft(register EKKfactinfo *fact, ++int c_ekkftrn_ft(EKKfactinfo *fact, + double *dwork1, int *mpt, int *nincolp); +-void c_ekkftrn2(register EKKfactinfo *fact, double *dwork1, ++void c_ekkftrn2(EKKfactinfo *fact, double *dwork1, + double *dpermu1, int *mpt1, int *nincolp, + double *dwork1_ft, int *mpt_ft, int *nincolp_ft); + +-int c_ekklfct(register EKKfactinfo *fact); +-int c_ekkslcf(register const EKKfactinfo *fact); ++int c_ekklfct(EKKfactinfo *fact); ++int c_ekkslcf(const EKKfactinfo *fact); + inline void c_ekkscpy(int n, const int *marr1, int *marr2) + { + CoinMemcpyN(marr1, n, marr2); +--- a/CoinUtils/src/CoinOslFactorization2.cpp ++++ b/CoinUtils/src/CoinOslFactorization2.cpp +@@ -21,9 +21,9 @@ + extern int ets_count; + extern int ets_check; + #endif +-#define COIN_REGISTER register ++#define COIN_REGISTER + #define COIN_REGISTER2 +-#define COIN_REGISTER3 register ++#define COIN_REGISTER3 + #ifdef COIN_USE_RESTRICT + #define COIN_RESTRICT2 __restrict + #else diff --git a/recipes/coin-utils/all/test_package/conanfile.py b/recipes/coin-utils/all/test_package/conanfile.py index af1af0ebb3d7f..7ab87ca07735c 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 e6b0fdb8110e8..b3607270e232e 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 a116e38afc5df..3e9050a77e486 100644 --- a/recipes/coin-utils/config.yml +++ b/recipes/coin-utils/config.yml @@ -1,4 +1,8 @@ versions: + "2.11.10": + folder: "all" + "2.11.9": + folder: "all" "2.11.6": folder: "all" "2.11.4": diff --git a/recipes/commata/all/conandata.yml b/recipes/commata/all/conandata.yml index d18c4f077249e..2f4d1cb571d15 100644 --- a/recipes/commata/all/conandata.yml +++ b/recipes/commata/all/conandata.yml @@ -1,7 +1,22 @@ sources: - "0.2.4": - url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.4.tar.gz" - sha256: "2d154c1ed7bbf6551729bcc5baf581613f6605df080ada35a9e107648d255e2e" - "0.2.3": - url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.3.tar.gz" - sha256: "47521aa27b26fe650bd985c4e07df44453f9d09ab0d61ee98dd6877afe4c25a0" + "0.2.8": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.8.tar.gz" + sha256: "a762ec3ef1549aa5aebef78a160a40ee16d396fd976154f1f5c160837d145c8a" + "0.2.7": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.7.tar.gz" + sha256: "3feeeea8eafa67a0f328382380f193df9a798665e10333e9e5b6db5fe1794283" + "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" +patches: + "0.2.7": + - patch_file: "patches/0.2.7-0001-include-optional.patch" + patch_description: "include header" + patch_type: "portability" + patch_source: "https://github.com/furfurylic/commata/pull/2" diff --git a/recipes/commata/all/conanfile.py b/recipes/commata/all/conanfile.py index bde274af4ceeb..6ca8695676403 100644 --- a/recipes/commata/all/conanfile.py +++ b/recipes/commata/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 get, copy +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches from conan.tools.layout import basic_layout from conan.tools.scm import Version import os @@ -19,7 +19,6 @@ class CommataConan(ConanFile): topics = ("csv", "parser", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True @property def _min_cppstd(self): @@ -35,6 +34,9 @@ def _compilers_minimum_version(self): "apple-clang": "12", } + def export_sources(self): + export_conandata_patches(self) + def layout(self): basic_layout(self, src_folder="src") @@ -53,6 +55,9 @@ 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( diff --git a/recipes/commata/all/patches/0.2.7-0001-include-optional.patch b/recipes/commata/all/patches/0.2.7-0001-include-optional.patch new file mode 100644 index 0000000000000..3ad57ce44c1c1 --- /dev/null +++ b/recipes/commata/all/patches/0.2.7-0001-include-optional.patch @@ -0,0 +1,12 @@ +diff --git a/include/commata/typing_aid.hpp b/include/commata/typing_aid.hpp +index adf9c6e..c1365d4 100644 +--- a/include/commata/typing_aid.hpp ++++ b/include/commata/typing_aid.hpp +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + namespace commata::detail { + diff --git a/recipes/commata/all/test_package/CMakeLists.txt b/recipes/commata/all/test_package/CMakeLists.txt index f69f5f2677dd5..71a8908c0e315 100644 --- a/recipes/commata/all/test_package/CMakeLists.txt +++ b/recipes/commata/all/test_package/CMakeLists.txt @@ -6,3 +6,7 @@ find_package(commata REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE commata::commata) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +if (commata_VERSION VERSION_LESS "0.2.7") + target_compile_definitions(${PROJECT_NAME} PRIVATE "COMMATA_VERSION_LESS_0_2_7") +endif() diff --git a/recipes/commata/all/test_package/test_package.cpp b/recipes/commata/all/test_package/test_package.cpp index 5221c81aef901..bb1415b5814ab 100644 --- a/recipes/commata/all/test_package/test_package.cpp +++ b/recipes/commata/all/test_package/test_package.cpp @@ -50,7 +50,11 @@ int main(void) { std::vector> field_values; test_collector collector(field_values); +#ifdef COMMATA_VERSION_LESS_0_2_7 commata::parse_csv(&buf, collector); +#else + commata::parse_csv(buf, collector); +#endif std::cout << field_values.size() << '\n'; diff --git a/recipes/commata/config.yml b/recipes/commata/config.yml index 199edf0f60679..613aa17053d3e 100644 --- a/recipes/commata/config.yml +++ b/recipes/commata/config.yml @@ -1,5 +1,11 @@ versions: - "0.2.4": + "0.2.8": folder: all - "0.2.3": + "0.2.7": + folder: all + "0.2.6-bug1": + folder: all + "0.2.6": + folder: all + "0.2.5": folder: all diff --git a/recipes/concurrencpp/all/conandata.yml b/recipes/concurrencpp/all/conandata.yml index 10f8a2f01e821..65da3e9e96d97 100644 --- a/recipes/concurrencpp/all/conandata.yml +++ b/recipes/concurrencpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.7": + url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.7.tar.gz" + sha256: "049f3e83ad1828e0b8b518652de1a3160d5849fdff03d521d0a5af0167338e89" "0.1.6": url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.6.tar.gz" sha256: "e7d5c23a73ff1d7199d361d3402ad2a710dfccf7630b622346df94a7532b4221" @@ -9,6 +12,9 @@ sources: url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.4.tar.gz" sha256: "3ad9424f975b766accc6eaedf4acfe1a20b5fdbb57fa3ae71f400e13d471e86f" patches: + "0.1.7": + - patch_file: "patches/cmake-min-version.patch" + - patch_file: "patches/directory-name-0.1.6.patch" "0.1.6": - patch_file: "patches/cmake-min-version.patch" - patch_file: "patches/directory-name-0.1.6.patch" diff --git a/recipes/concurrencpp/all/conanfile.py b/recipes/concurrencpp/all/conanfile.py index 64da9a5493cb8..63a26ab91e6ec 100644 --- a/recipes/concurrencpp/all/conanfile.py +++ b/recipes/concurrencpp/all/conanfile.py @@ -38,6 +38,7 @@ def _minimum_compilers_version(self): "Visual Studio": "16", "msvc": "192", "clang": "11", + "gcc": "13", } def export_sources(self): @@ -60,7 +61,7 @@ def validate(self): if Version(self.version) <= "0.1.5" and self.options.shared and is_msvc(self): # see https://github.com/David-Haim/concurrencpp/issues/75 raise ConanInvalidConfiguration(f"{self.ref} does not support shared builds with Visual Studio") - if self.settings.compiler == "gcc": + if Version(self.version) <= "0.1.6" and self.settings.compiler == "gcc": raise ConanInvalidConfiguration("gcc is not supported by concurrencpp") if Version(self.version) >= "0.1.5" and self.settings.compiler == "apple-clang": # apple-clang does not seem to support the C++20 synchronization library which concurrencpp 0.1.5 depends on diff --git a/recipes/concurrencpp/config.yml b/recipes/concurrencpp/config.yml index 8388e594bacff..d1f158a132019 100644 --- a/recipes/concurrencpp/config.yml +++ b/recipes/concurrencpp/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.7": + folder: all "0.1.6": folder: all "0.1.5": diff --git a/recipes/concurrentqueue/all/conandata.yml b/recipes/concurrentqueue/all/conandata.yml index 4a3b84f1e1032..01e2ad199f983 100644 --- a/recipes/concurrentqueue/all/conandata.yml +++ b/recipes/concurrentqueue/all/conandata.yml @@ -1,10 +1,13 @@ sources: + "1.0.4": + url: "https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.4.tar.gz" + sha256: "87fbc9884d60d0d4bf3462c18f4c0ee0a9311d0519341cac7cbd361c885e5281" "1.0.3": - url: https://github.com/cameron314/concurrentqueue/archive/v1.0.3.zip - sha256: 5e9e229a1791e8299dcd4bd73ac1be1953424a903818feb7afd929eb16094ef5 + url: "https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.3.tar.gz" + sha256: "eb37336bf9ae59aca7b954db3350d9b30d1cab24b96c7676f36040aa76e915e8" "1.0.2": - url: https://github.com/cameron314/concurrentqueue/archive/v1.0.2.zip - sha256: 6dc85de0e38a014471fe3c653e3e21dc38a5f069cfc031a90fa59f0a45f7584f + url: "https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.2.tar.gz" + sha256: "c3aeb97c97169f743a53ca33812ea2ab61dd06dfd28319ca3f0a0771372fc7fc" "1.0.1": - url: https://github.com/cameron314/concurrentqueue/archive/v1.0.1.zip - sha256: b31dca11745ef331756109af838e3689462fbbc2c52dda9f7e1c416778f1f35b + url: "https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.1.tar.gz" + sha256: "7e715c793001e01851448320e8a416b80342b2e75db46d4c978e990a506060e6" diff --git a/recipes/concurrentqueue/all/conanfile.py b/recipes/concurrentqueue/all/conanfile.py index 866dbaf480b38..fe58e688dd504 100644 --- a/recipes/concurrentqueue/all/conanfile.py +++ b/recipes/concurrentqueue/all/conanfile.py @@ -9,27 +9,31 @@ class ConcurrentqueueConan(ConanFile): name = "concurrentqueue" + description = "A fast multi-producer, multi-consumer lock-free concurrent queue for C++11" + license = ["BSD-2-Clause", "BSL-1.0"] url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/cameron314/concurrentqueue" - description = "A fast multi-producer, multi-consumer lock-free concurrent queue for C++11" topics = ("cpp11", "cpp14", "cpp17", "queue", "lock-free") - license = ["BSD-2-Clause", "BSL-1.0"] + 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, 11) - - def layout(self): - basic_layout(self, src_folder="src") + 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 @@ -44,8 +48,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "concurrentqueue::concurrentqueue") self.cpp_info.includedirs.append(os.path.join("include", "moodycamel")) 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 = ["pthread"] diff --git a/recipes/concurrentqueue/all/test_package/conanfile.py b/recipes/concurrentqueue/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/concurrentqueue/all/test_package/conanfile.py +++ b/recipes/concurrentqueue/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/concurrentqueue/config.yml b/recipes/concurrentqueue/config.yml index df27cd90727cc..ba8a25151dfc3 100644 --- a/recipes/concurrentqueue/config.yml +++ b/recipes/concurrentqueue/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.4": + folder: all "1.0.3": folder: all "1.0.2": diff --git a/recipes/console_bridge/all/conandata.yml b/recipes/console_bridge/all/conandata.yml new file mode 100644 index 0000000000000..b08e5584e75a4 --- /dev/null +++ b/recipes/console_bridge/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.2": + url: "https://github.com/ros/console_bridge/archive/refs/tags/1.0.2.tar.gz" + sha256: "303a619c01a9e14a3c82eb9762b8a428ef5311a6d46353872ab9a904358be4a4" diff --git a/recipes/console_bridge/all/conanfile.py b/recipes/console_bridge/all/conanfile.py new file mode 100644 index 0000000000000..489534f60bd16 --- /dev/null +++ b/recipes/console_bridge/all/conanfile.py @@ -0,0 +1,79 @@ +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 copy, get, rm, rmdir + +required_conan_version = ">=1.53.0" + + +class PackageConan(ConanFile): + name = "console_bridge" + description = "A ROS-independent library for logging that seamlessly pipes into rosconsole/rosout for ROS-dependent packages" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ros/console_bridge" + topics = ("logging", "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 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): + pass + + 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() + CMakeDeps(self).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() + + rm(self, "*.pdb", os.path.join(self.package_folder)) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "console_bridge")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + + def package_info(self): + self.cpp_info.libs = ["console_bridge"] + + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/console_bridge/all/test_package/CMakeLists.txt b/recipes/console_bridge/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c15ea1a1502bc --- /dev/null +++ b/recipes/console_bridge/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(console_bridge REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE console_bridge::console_bridge) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/console_bridge/all/test_package/conanfile.py b/recipes/console_bridge/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/console_bridge/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/console_bridge/all/test_package/test_package.cpp b/recipes/console_bridge/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1c02a2b52e784 --- /dev/null +++ b/recipes/console_bridge/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + console_bridge::setLogLevel(console_bridge::CONSOLE_BRIDGE_LOG_DEBUG); + CONSOLE_BRIDGE_logInform("CONSOLE_BRIDGE_logInform() ran successfully"); + return EXIT_SUCCESS; +} diff --git a/recipes/console_bridge/config.yml b/recipes/console_bridge/config.yml new file mode 100644 index 0000000000000..8457ca9a4a8cd --- /dev/null +++ b/recipes/console_bridge/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.2": + folder: all diff --git a/recipes/continuable/all/conandata.yml b/recipes/continuable/all/conandata.yml index 13887549bde39..15db65fb152ed 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 7a8754a12145a..2713e8d38ceb7 100644 --- a/recipes/continuable/all/conanfile.py +++ b/recipes/continuable/all/conanfile.py @@ -1,35 +1,33 @@ 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.28.0" +required_conan_version = ">=1.52.0" class ContinuableConan(ConanFile): name = "continuable" - description = "C++14 asynchronous allocation aware futures (supporting then, exception handling, coroutines and connections)" - topics = "asynchronous", "future", "coroutines", "header-only" + description = ( + "C++14 asynchronous allocation aware futures " + "(supporting then, exception handling, coroutines and connections)" + ) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Naios/continuable" - license = "MIT" - settings = "os", "compiler" - no_copy_source = True - requires = ( - "function2/4.1.0", - ) + topics = ("asynchronous", "future", "coroutines", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" options = { - # Exceptions are disabled and `std::error_condition` is used as error_type. See tutorial-chaining-continuables-fail for details. "no_exceptions": [True, False], - # Exceptions are disabled and the type defined by `CONTINUABLE_WITH_CUSTOM_ERROR_TYPE` is used as error_type. - # See tutorial-chaining-continuables-fail for details. "custom_error_type": [True, False], - # Allows unhandled exceptions in asynchronous call hierarchies. See tutorial-chaining-continuables-fail for details. "unhandled_exceptions": [True, False], - # Allows to customize the final callback which can be used to implement custom unhandled asynchronous exception handlers. "custom_final_callback": [True, False], - # Don"t decorate the used type erasure, which is done to keep type names minimal for better error messages in debug builds. "immediate_types": [True, False], } default_options = { @@ -37,44 +35,84 @@ class ContinuableConan(ConanFile): "custom_error_type": False, "unhandled_exceptions": False, "custom_final_callback": False, - "immediate_types": False + "immediate_types": False, + } + options_description = { + "no_exceptions": ( + "Exceptions are disabled and `std::error_condition` is used as error_type. " + "See tutorial-chaining-continuables-fail for details." + ), + "custom_error_type": ( + "Exceptions are disabled and the type defined by `CONTINUABLE_WITH_CUSTOM_ERROR_TYPE` " + "is used as error_type. See tutorial-chaining-continuables-fail for details." + ), + "unhandled_exceptions": ( + "Allows unhandled exceptions in asynchronous call hierarchies. " + "See tutorial-chaining-continuables-fail for details." + ), + "custom_final_callback": ( + "Allows to customize the final callback which can be used to implement custom unhandled" + " asynchronous exception handlers." + ), + "immediate_types": ( + "Don't decorate the used type erasure, " + "which is done to keep type names minimal for better error messages in debug builds." + ), } + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 14 - def validate(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": "14" + "Visual Studio": "14", } - 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): + self.requires("function2/4.2.4") + + 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): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "continuable-" + 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(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst=os.path.join("include", "continuable"), src=os.path.join(self._source_subfolder, "include", "continuable")) + 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", "continuable"), + src=os.path.join(self.source_folder, "include", "continuable"), + ) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os == "Linux": self.cpp_info.system_libs.append("pthread") if self.options.no_exceptions: @@ -87,6 +125,3 @@ def package_info(self): self.cpp_info.defines.append("CONTINUABLE_WITH_CUSTOM_FINAL_CALLBACK") if self.options.immediate_types: self.cpp_info.defines.append("CONTINUABLE_WITH_IMMEDIATE_TYPES") - - def package_id(self): - self.info.header_only() diff --git a/recipes/continuable/all/test_package/CMakeLists.txt b/recipes/continuable/all/test_package/CMakeLists.txt index 7dd0ea22e1254..9a7b7e199f5b8 100644 --- a/recipes/continuable/all/test_package/CMakeLists.txt +++ b/recipes/continuable/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() +find_package(continuable REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -set_target_properties( - ${PROJECT_NAME} PROPERTIES - - CXX_STANDARD 14 +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON ) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE continuable::continuable) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/continuable/all/test_package/conanfile.py b/recipes/continuable/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/continuable/all/test_package/conanfile.py +++ b/recipes/continuable/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/continuable/all/test_package/test_package.cpp b/recipes/continuable/all/test_package/test_package.cpp index b26567acd4b10..92cb7db2c14ee 100644 --- a/recipes/continuable/all/test_package/test_package.cpp +++ b/recipes/continuable/all/test_package/test_package.cpp @@ -2,7 +2,7 @@ #include "continuable/continuable.hpp" -int main(int, char**) { +int main() { cti::make_ready_continuable("..."); return 0; diff --git a/recipes/continuable/config.yml b/recipes/continuable/config.yml index 52fa67bcd41e8..955cd0773fc58 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 0000000000000..4e8bd45da11a5 --- /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 0000000000000..6b2e612afc5c5 --- /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 0000000000000..f7ac5b551babf --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..46b92d23f6830 --- /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 0000000000000..a300de211104b --- /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/copypp/all/conandata.yml b/recipes/copypp/all/conandata.yml new file mode 100644 index 0000000000000..0570d8ac5e9f4 --- /dev/null +++ b/recipes/copypp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.3.0": + url: "https://github.com/i-curve/copypp/archive/v0.3.0.tar.gz" + sha256: "390dc010597f372015a708d7d37e3d06fdf6a4fe90fb1c0077b45b6da5cb38a2" diff --git a/recipes/copypp/all/conanfile.py b/recipes/copypp/all/conanfile.py new file mode 100644 index 0000000000000..9f6b782973eb5 --- /dev/null +++ b/recipes/copypp/all/conanfile.py @@ -0,0 +1,69 @@ +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.52.0" + + +class BasicConanfile(ConanFile): + name = "copypp" + homepage = "https://github.com/i-curve/copypp" + description = "support field copy in different c++ struct." + topics = ("copy", "struct", "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 + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "15", + "clang": "13", + "gcc": "11", + "msvc": "19.3", + "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"): + 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): + pass + + 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, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "copypp") + self.cpp_info.set_property("cmake_target_name", "icurve::copypp") + self.cpp_info.set_property("pkg_config_name", "copypp") diff --git a/recipes/copypp/all/test_package/CMakeLists.txt b/recipes/copypp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3e0159dd016c1 --- /dev/null +++ b/recipes/copypp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(copypp CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE icurve::copypp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/copypp/all/test_package/conanfile.py b/recipes/copypp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/copypp/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/copypp/all/test_package/test_package.cpp b/recipes/copypp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2cdae31b2fc4b --- /dev/null +++ b/recipes/copypp/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include +#include +#include "icurve/copypp.hh" + +class A { +public: + int id; + std::string name; + bool sex; + +public: + A() = default; + A(int id, std::string name, bool sex) : id(id), name(name), sex(sex) {} +}; + +class B { +public: + int id; + std::string name; + bool sex; + +public: + B() = default; + B(int id, std::string name, bool sex) : id(id), name(name), sex(sex) {} +}; + +COPYPP_FIELDS_NON_INTRUSIVE(B, A, id, name, sex) + +int main(void) { + A a(1, "curve", true); + B b; + icurve::copy(b, a); + assert(a.id == b.id); + assert(a.name == b.name); + assert(a.sex == b.sex); + std::cout << "copypp ok" << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/copypp/config.yml b/recipes/copypp/config.yml new file mode 100644 index 0000000000000..d126790212e0c --- /dev/null +++ b/recipes/copypp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.0": + folder: all diff --git a/recipes/corrade/all/CMakeLists.txt b/recipes/corrade/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- 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 4b0cd1b7fd3fb..82a5660e74950 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 dcff18b711642..347781614d5e3 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 e4c1f34b721de..94206f42ad33e 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 be914f107e121..9c0893a63e85b 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 8f5dc321a44de..c0e1a6d7932b2 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 6ba47d078b389..0000000000000 --- 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 19b29a5db955d..b9c689437dd44 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 35e896e14c7d9..a6fffdcbbb029 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 0c13544696d16..0000000000000 --- 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 fcda1859bb610..c29edc1ca6a27 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 aab3b289eb8cf..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..6dffe66394a26 --- /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 6a4771df04b83..b452f13eb25c1 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 eb47a8c74e0c9..cbc8f6be75064 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 fb76dc36e1dc6..cf3db6db5cc45 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 e1ab7e3d234d6..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..e1ab7e3d234d6 --- /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/coz/all/CMakeLists.txt b/recipes/coz/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb9..0000000000000 --- a/recipes/coz/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/coz/all/conanfile.py b/recipes/coz/all/conanfile.py index 525f92fcfbd9c..b3da8b64ac09e 100644 --- a/recipes/coz/all/conanfile.py +++ b/recipes/coz/all/conanfile.py @@ -1,61 +1,76 @@ 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.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 get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class CozConan(ConanFile): name = "coz" - description = """Causal profiler, uses performance experiments - to predict the effect of optimizations""" + description = "Causal profiler, uses performance experiments to predict the effect of optimizations" + license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "http://coz-profiler.org" - license = "BSD-2-Clause" - topics = ("conan", "coz", "profiler", "causal") + topics = ("profiler", "causal") + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" - requires = "libelfin/0.3" - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type - _source_subfolder = "source_subfolder" + def requirements(self): + self.requires("libelfin/0.3") def validate(self): - compiler = self.settings.compiler - compiler_version = tools.Version(self.settings.compiler.version) - if self.settings.os == "Macos" or compiler == "Visual Studio" or ( - compiler == "gcc" and compiler_version < "5.0"): - raise ConanInvalidConfiguration( - "coz doesn't support compiler: {} on OS: {}.".format( - self.settings.compiler, self.settings.os)) if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, 11) + compiler_version = Version(self.settings.compiler.version) + if self.settings.compiler == "gcc" and compiler_version < "5.0": + raise ConanInvalidConfiguration("coz requires GCC >= 5.0") + if is_apple_os(self) or is_msvc(self): + raise ConanInvalidConfiguration(f"coz doesn't support {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) - _cmake = None - - 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() + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + 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): + # https://github.com/plasma-umass/coz/#cmake + self.cpp_info.set_property("cmake_file_name", "coz-profiler") + self.cpp_info.set_property("cmake_target_name", "coz::coz") + + self.cpp_info.libs = ["coz"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "dl", "pthread", "rt"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "coz-profiler" self.cpp_info.filenames["cmake_find_package_multi"] = "coz-profiler" self.cpp_info.names["cmake_find_package"] = "coz" diff --git a/recipes/coz/all/test_package/CMakeLists.txt b/recipes/coz/all/test_package/CMakeLists.txt index 7b9b613cbb24a..d7ea7e2a51ab7 100644 --- a/recipes/coz/all/test_package/CMakeLists.txt +++ b/recipes/coz/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(coz-profiler REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE coz::coz) diff --git a/recipes/coz/all/test_package/conanfile.py b/recipes/coz/all/test_package/conanfile.py index ad479949b486f..fe45f480669f3 100644 --- a/recipes/coz/all/test_package/conanfile.py +++ b/recipes/coz/all/test_package/conanfile.py @@ -1,19 +1,40 @@ -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.files import chdir + 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, build_type="RelWithDebInfo") # To work properly Coz tool requires debug information https://github.com/plasma-umass/coz + cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if tools.cross_building(self.settings): + if self.settings.build_type not in ["Debug", "RelWithDebInfo"]: + self.output.info(f"Skipping coz test because {self.settings.build_type} " + "build type does not contain debug information") return - bin_path = os.path.join("bin", "test_package") - self.run("coz run --- " + bin_path, run_environment=True) - print(open("profile.coz").read()) + if self.settings.os == "Linux": + perf_even_paranoid = int(open("/proc/sys/kernel/perf_event_paranoid").read()) + is_root = os.geteuid() == 0 + if perf_even_paranoid > 2 and not is_root: + self.output.info("Skipping coz test because /proc/sys/kernel/perf_event_paranoid value " + f"must be <= 2 (currently {perf_even_paranoid}) and not running as root") + return + if can_run(self): + with chdir(self, self.cpp.build.bindir): + self.run("coz run --- ./test_package", env="conanrun") + print(open("profile.coz").read()) diff --git a/recipes/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml index 9933170ac8517..8c153c2fe947f 100644 --- a/recipes/cpp-httplib/all/conandata.yml +++ b/recipes/cpp-httplib/all/conandata.yml @@ -1,43 +1,28 @@ sources: - "0.12.3": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.3.tar.gz" - sha256: "175ced3c9cdaf221e9edf210297568d8f7d402a41d6db01254ac9e0b25487c54" - "0.12.2": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.2.tar.gz" - sha256: "a7897d052de8fae75817e7a261ae37b89dc4cb8ac74b74458a1f2d2e707cfd03" - "0.12.1": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.1.tar.gz" - sha256: "0e56c25c63e730ebd42e2beda6e7cb1b950131d8fc00d3158b1443a8d76f41ca" - "0.12.0": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.0.tar.gz" - sha256: "423900c9a124b88c406cd34aba08c9e60742e477a02bd29051cf0ecbf9ef0c65" + "0.14.3": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.14.3.tar.gz" + sha256: "dcf6486d9030937636d8a4f820ca9531808fd7edb283893dddbaa05f99357e63" + "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" + "0.12.6": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.6.tar.gz" + sha256: "24bc594a9efcc08a5a6f3928e848d046d411a88b07bcd6f7f3851227a1f0133e" "0.11.4": url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.4.tar.gz" sha256: "28f76b875a332fb80972c3212980c963f0a7d2e11a8fe94a8ed0d847b9a2256f" - "0.11.3": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.3.tar.gz" - sha256: "799b2daa0441d207f6cd1179ae3a34869722084a434da6614978be1682c1e12d" - "0.11.2": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.2.tar.gz" - sha256: "e620d030215733c4831fdc7813d5eb37a6fd599f8192a730662662e1748a741b" - "0.11.1": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.1.tar.gz" - sha256: "1ce2f0393ba779ec34885c5cd937141b4b5b730e2bc2efc34eb8554289c24d61" - "0.11.0": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.0.tar.gz" - sha256: "9f533b0aa67066bd8f049e080eef75ad710a2f3ba3d80edbb13957389a5eeca7" "0.10.9": url: "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.10.9.tar.gz" sha256: "95ac0740ef760829a079c01a44164fd74af3fdc0748a40fc6beefd0276fd2345" - "0.9.10": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.9.10.tar.gz" - sha256: "49dfa101ced75f8536ec7c865f872ab8fca157c8b49e29be5ef2d2aa11f716e8" - "0.8.9": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.8.9.tar.gz" - sha256: "3c5e0d6784d04b0b3d10f60fa2a26ef2a968fb80f434c4d117c2811f9e3a5ed7" - "0.7.18": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.7.18.tar.gz" - sha256: "ed90e670a39fcacfb670f51b619e670dafe419bca74f8a50fb3c31bb46be8b23" - "0.6.6": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.6.6.tar.gz" - sha256: "35bcc6a3f9612feb92b2153c5e56389ccc1ab46c7ba8781b873a5c2e249eb610" diff --git a/recipes/cpp-httplib/all/conanfile.py b/recipes/cpp-httplib/all/conanfile.py index fafe791af7015..7ecbe0a2931e5 100644 --- a/recipes/cpp-httplib/all/conanfile.py +++ b/recipes/cpp-httplib/all/conanfile.py @@ -2,7 +2,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.scm import Version import os required_conan_version = ">=1.50.0" @@ -29,17 +28,13 @@ class CpphttplibConan(ConanFile): } no_copy_source = True - def config_options(self): - if Version(self.version) < "0.7.2": - del self.options.with_brotli - 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") - if self.options.get_safe("with_brotli"): - self.requires("brotli/1.0.9") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_brotli: + self.requires("brotli/1.1.0") def package_id(self): self.info.clear() @@ -71,7 +66,7 @@ def package_info(self): self.cpp_info.defines.append("CPPHTTPLIB_OPENSSL_SUPPORT") if self.options.with_zlib: self.cpp_info.defines.append("CPPHTTPLIB_ZLIB_SUPPORT") - if self.options.get_safe("with_brotli"): + if self.options.with_brotli: self.cpp_info.defines.append("CPPHTTPLIB_BROTLI_SUPPORT") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/cpp-httplib/all/test_package/test_package.cpp b/recipes/cpp-httplib/all/test_package/test_package.cpp index 3e9fe638f7b17..197dc1388d9c9 100644 --- a/recipes/cpp-httplib/all/test_package/test_package.cpp +++ b/recipes/cpp-httplib/all/test_package/test_package.cpp @@ -1,20 +1,6 @@ #include int main() { - httplib::Server svr; - - svr.Get("/hi", [](const httplib::Request& req, httplib::Response& res) { - res.set_content("Hello World!", "text/plain"); - }); - - svr.Get(R"(/numbers/(\d+))", [&](const httplib::Request& req, httplib::Response& res) { - auto numbers = req.matches[1]; - res.set_content(numbers, "text/plain"); - }); - - svr.Get("/stop", [&](const httplib::Request& req, httplib::Response& res) { - svr.stop(); - }); - + httplib::Request request; return 0; } diff --git a/recipes/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml index 6ad1768ae264f..7415ed1d11703 100644 --- a/recipes/cpp-httplib/config.yml +++ b/recipes/cpp-httplib/config.yml @@ -1,29 +1,19 @@ versions: - "0.12.3": + "0.14.3": folder: all - "0.12.2": + "0.14.2": folder: all - "0.12.1": + "0.14.1": folder: all - "0.12.0": + "0.14.0": folder: all - "0.11.4": - folder: all - "0.11.3": + "0.13.3": folder: all - "0.11.2": + "0.13.1": folder: all - "0.11.1": + "0.12.6": folder: all - "0.11.0": + "0.11.4": folder: all "0.10.9": folder: all - "0.9.10": - folder: all - "0.8.9": - folder: all - "0.7.18": - folder: all - "0.6.6": - folder: all diff --git a/recipes/cpp-ipc/all/CMakeLists.txt b/recipes/cpp-ipc/all/CMakeLists.txt deleted file mode 100644 index e17d82eddcc5d..0000000000000 --- 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 c463e509b6004..d1b80928e2b24 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 b11041af3f594..5baa058938b2b 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 c258338b9324e..ad0594de35161 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 49a3a66ea5bad..fae501d0afb9e 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 797b8dd014054..3d3b2788da655 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 a9da0afcb17e4..0fc99db4a9b5a 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 431ebcb132c22..eff5d319df990 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 d7a924b2af542..22a7588040467 100644 --- a/recipes/cpp-peglib/1.x.x/conandata.yml +++ b/recipes/cpp-peglib/1.x.x/conandata.yml @@ -1,4 +1,10 @@ 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" "1.8.3": url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.3.tar.gz" sha256: "3de8aeb44a262f9c2478e2a7e7bc2bb9426a2bdd176cf0654ff5a3d291c77b73" @@ -20,18 +26,3 @@ sources: "1.5.0": url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.5.0.tar.gz" sha256: "45a02b749556af6ab0abf78c4c1d1afe02f17705b1c51f5820e957616f453b33" - "1.4.2": - url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.4.2.tar.gz" - sha256: "28a09c1bee50608733a989cd5b62368a767a66f9e1a39654c0342e9698c479ca" - "1.4.1": - url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.4.1.tar.gz" - sha256: "3784039727f8317cd5e202c5a2d142584bf48a311910643298dc4ba9083424e7" - "1.3.10": - url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.3.10.tar.gz" - sha256: "9c79abd8a304d163d176918b74d7ab272e6ab1405af2dd699b6b7ae1b5605b09" - "1.3.9": - url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.3.9.tar.gz" - sha256: "0d14fcbf7ed4409699fff70867c5776a2219e38547de5bf0bf689ba0d58c0d7f" - "1.3.8": - url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.3.8.tar.gz" - sha256: "6d266806825ec491f1e3d1eb8a2163114f328a691f7c9fbce7bb3edf2f42074c" diff --git a/recipes/cpp-peglib/1.x.x/conanfile.py b/recipes/cpp-peglib/1.x.x/conanfile.py index c700cd876b542..7d5fb5e5104a5 100644 --- a/recipes/cpp-peglib/1.x.x/conanfile.py +++ b/recipes/cpp-peglib/1.x.x/conanfile.py @@ -73,6 +73,12 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + + # Since 1.8.4, cpp-peglib is named as peglib + if Version(self.version) >= "1.8.4": + self.cpp_info.set_property("cmake_file_name", "peglib") + self.cpp_info.set_property("cmake_target_name", "peglib") + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] self.cpp_info.cxxflags.append("-pthread") diff --git a/recipes/cpp-peglib/1.x.x/test_package/CMakeLists.txt b/recipes/cpp-peglib/1.x.x/test_package/CMakeLists.txt index de79c59d80c35..b4be9dd643afb 100644 --- a/recipes/cpp-peglib/1.x.x/test_package/CMakeLists.txt +++ b/recipes/cpp-peglib/1.x.x/test_package/CMakeLists.txt @@ -1,8 +1,15 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -find_package(cpp-peglib CONFIG REQUIRED) +find_package(cpp-peglib CONFIG) +if (NOT TARGET cpp-peglib::cpp-peglib) + find_package(peglib REQUIRED CONFIG) +endif() add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE cpp-peglib::cpp-peglib) +if (TARGET cpp-peglib::cpp-peglib) + target_link_libraries(${PROJECT_NAME} PRIVATE cpp-peglib::cpp-peglib) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE peglib) +endif() target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cpp-peglib/config.yml b/recipes/cpp-peglib/config.yml index 923bbafb7c017..e7a9a93559bfa 100644 --- a/recipes/cpp-peglib/config.yml +++ b/recipes/cpp-peglib/config.yml @@ -1,4 +1,8 @@ versions: + "1.8.5": + folder: "1.x.x" + "1.8.4": + folder: "1.x.x" "1.8.3": folder: "1.x.x" "1.8.2": @@ -13,15 +17,5 @@ versions: folder: "1.x.x" "1.5.0": folder: "1.x.x" - "1.4.2": - folder: "1.x.x" - "1.4.1": - folder: "1.x.x" - "1.3.10": - folder: "1.x.x" - "1.3.9": - folder: "1.x.x" - "1.3.8": - folder: "1.x.x" "0.1.13": folder: "0.x.x" diff --git a/recipes/cpp-sort/all/conandata.yml b/recipes/cpp-sort/all/conandata.yml index 092fe59db4a19..48e5289632674 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 cfda199bf6a78..8dec2c54472db 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") @@ -54,25 +54,14 @@ def loose_lt_semver(v1, v2): min_length = min(len(lv1), len(lv2)) return lv1[:min_length] < lv2[:min_length] - compiler = str(self.settings.compiler) - version = str(self.settings.compiler.version) - try: - 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"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" + 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." ) - 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 c097db627e415..acbaa54fefe9c 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 0000000000000..77d92b9be932b --- /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 0000000000000..664a6a31ab470 --- /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.2.0") + + 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 0000000000000..aaf79983c7d60 --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..9b71de3f6c7ab --- /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 0000000000000..7f57148a20478 --- /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 5a2a5fe5679e4..00ce6a88bd921 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 d3c22a987a39d..9edc8bb602af7 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 ed8a4e73713c6..c31dc0dd89d14 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 0000000000000..91630d79f4abb --- /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 0000000000000..0761aa549fc91 --- /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 2873a6dc352ca..798d4ebbff0a7 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 d05d94032be0f..6a65865cd6cb1 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 f9dabdc5e5fa6..d0f5a27793e17 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -1,28 +1,35 @@ sources: + "2.13": + url: "https://github.com/danmar/cppcheck/archive/2.13.0.tar.gz" + sha256: "8229afe1dddc3ed893248b8a723b428dc221ea014fbc76e6289840857c03d450" + "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.10.3": - - patch_file: "patches/0001-cli-remove-dmake-cmake-2.10.patch" - patch_description: "Remove dmake tool from target ALL" + "2.12": + - patch_file: "patches/0004-pcre-debuglib-name-2.12.patch" + patch_description: "Consider the Debug suffix for Windows" 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" @@ -39,16 +46,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/conanfile.py b/recipes/cppcheck/all/conanfile.py index 734ffc6f84fd2..fa5b72926399e 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, 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" @@ -36,6 +37,8 @@ def generate(self): tc.variables["HAVE_RULES"] = self.options.get_safe("have_rules", False) tc.variables["USE_MATCHCOMPILER"] = "Auto" tc.variables["ENABLE_OSS_FUZZ"] = False + if Version(self.version) >= "2.11.0": + tc.variables["DISABLE_DMAKE"] = True tc.variables["FILESDIR"] = "bin" tc.generate() diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch deleted file mode 100644 index fa8b46fd1608e..0000000000000 --- a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/cmake/findDependencies.cmake 2022-04-15 20:23:30.000000000 +0200 -+++ b/cmake/findDependencies.cmake 2022-11-24 13:57:22.099453500 +0100 -@@ -16,7 +16,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() -@@ -24,16 +24,8 @@ - - if (USE_Z3) - find_package(Z3 QUIET) -- if (NOT Z3_FOUND) - find_library(Z3_LIBRARIES z3) -- if (NOT Z3_LIBRARIES) -- message(FATAL_ERROR "z3 dependency has not been found") -- endif() - find_path(Z3_CXX_INCLUDE_DIRS z3++.h PATH_SUFFIXES "z3") -- if (NOT Z3_CXX_INCLUDE_DIRS) -- message(FATAL_ERROR "z3++.h has not been found") -- endif() -- endif() - endif() - - set(CMAKE_INCLUDE_CURRENT_DIR ON) 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 0000000000000..7f30a7cb1d7d4 --- /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 77ce70296b493..654cfb904a00d 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -1,11 +1,15 @@ versions: - "2.10.3": + "2.13": folder: all - "2.10": + "2.12.1": folder: all - "2.9.3": + "2.12": + folder: all + "2.11.1": folder: all - "2.9.2": + "2.10.3": + folder: all + "2.9.3": folder: all "2.8.2": folder: all diff --git a/recipes/cppcmd/all/conanfile.py b/recipes/cppcmd/all/conanfile.py index f83b9294d4efa..8e60072bb9375 100644 --- a/recipes/cppcmd/all/conanfile.py +++ b/recipes/cppcmd/all/conanfile.py @@ -1,7 +1,13 @@ +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 +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from glob import glob + + +required_conan_version = ">=1.52.0" class CppCmdConan(ConanFile): @@ -11,57 +17,57 @@ class CppCmdConan(ConanFile): homepage = "https://github.com/remysalim/cppcmd" url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "header-library" settings = "os", "compiler", "arch", "build_type" - generators = "cmake" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 17 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): return { "Visual Studio": "15.7", + "msvc": "192", "gcc": "8", "clang": "7", "apple-clang": "10.2", } - def configure(self): - if self.settings.get_safe("compiler.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++17 support. The current compiler {} {} does not support it.".format( - self.name, self.settings.compiler, self.settings.compiler.version)) + 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 does not support." + ) + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob("cppcmd-*")[0] - 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.variables["BUILD_TESTS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + # header_only - no build def package(self): - self.copy(pattern="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.definitions["BUILD_TESTS"] = "OFF" - cmake.configure(source_folder=self._source_subfolder, - build_folder=self._build_subfolder) cmake.install() - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cppcmd/all/test_package/CMakeLists.txt b/recipes/cppcmd/all/test_package/CMakeLists.txt index 1ecd7e0a81c7b..9c5302dc6f47d 100644 --- a/recipes/cppcmd/all/test_package/CMakeLists.txt +++ b/recipes/cppcmd/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.5) -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(cppcmd REQUIRED CONFIG) add_executable(${PROJECT_NAME} main.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} cppcmd::cppcmd) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cppcmd/all/test_package/conanfile.py b/recipes/cppcmd/all/test_package/conanfile.py index bd7165a553cf4..3a91c9439218e 100644 --- a/recipes/cppcmd/all/test_package/conanfile.py +++ b/recipes/cppcmd/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 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", "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/cppcmd/all/test_package/main.cpp b/recipes/cppcmd/all/test_package/main.cpp index 186e15bf7de57..94c409d3743fc 100644 --- a/recipes/cppcmd/all/test_package/main.cpp +++ b/recipes/cppcmd/all/test_package/main.cpp @@ -1,5 +1,7 @@ #include +#include +#include #include using namespace cppcmd; diff --git a/recipes/cppcodec/all/conanfile.py b/recipes/cppcodec/all/conanfile.py index 59f96dbe4a59f..abb2abaee1872 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/CMakeLists.txt b/recipes/cppcommon/all/CMakeLists.txt deleted file mode 100644 index 6ba47d078b389..0000000000000 --- a/recipes/cppcommon/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/cppcommon/all/conandata.yml b/recipes/cppcommon/all/conandata.yml index c69e434893cba..0a74dfd6a553f 100644 --- a/recipes/cppcommon/all/conandata.yml +++ b/recipes/cppcommon/all/conandata.yml @@ -1,43 +1,86 @@ 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" + "1.0.2.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.2.0.tar.gz" + sha256: "1a748159ab5d0eb74a6c7b110606718caa779cdf17b3e91bf0dbd0e297823dec" + "1.0.1.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.1.0.tar.gz" + sha256: "974ac65c72bb57bc6cbe825990e595fd40ead8c1e66e00c1206b19f749697878" "1.0.0.0": url: "https://github.com/chronoxor/CppCommon/archive/1.0.0.0.tar.gz" sha256: "d6124dd4cd430e5f10c2942ff02a95636369875b652e66a499b01f1fb3ecfd6d" "cci.20201104": url: "https://github.com/chronoxor/CppCommon/archive/cacfa9554d367467808663d9d5a695933ae566bb.tar.gz" sha256: "d2e717798e1668c831ee977763eaff7413ef48e6e0914a6322c9918016092048" - "1.0.1.0": - url: "https://github.com/chronoxor/CppCommon/archive/1.0.1.0.tar.gz" - sha256: "974ac65c72bb57bc6cbe825990e595fd40ead8c1e66e00c1206b19f749697878" - "1.0.2.0": - url: "https://github.com/chronoxor/CppCommon/archive/1.0.2.0.tar.gz" - sha256: "1a748159ab5d0eb74a6c7b110606718caa779cdf17b3e91bf0dbd0e297823dec" - "1.0.3.0": - url: "https://github.com/chronoxor/CppCommon/archive/1.0.3.0.tar.gz" - sha256: "af530d3550a050d4ed73a680b016e043ea6f4f56e11163226f2a6e24d9eae4ca" - 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" + patch_type: "conan" + - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" + patch_description: "define _WIN32_WINNT" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + "1.0.2.0": + - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" + patch_description: "define _WIN32_WINNT" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + "1.0.1.0": + - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" + patch_description: "define _WIN32_WINNT" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + - patch_file: "patches/0005-include-mutex-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" "1.0.0.0": - patch_file: "patches/0001-update-cmakelists-1-0-0-0.patch" - base_path: "source_subfolder" + patch_description: "use cci packages" + patch_type: "conan" - patch_file: "patches/0002-fix-cross-platform-issues.patch" - base_path: "source_subfolder" + patch_description: "fix platform problems" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + - patch_file: "patches/0005-include-mutex-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" "cci.20201104": - patch_file: "patches/0001-update-cmakelists-1-0-0-0.patch" - base_path: "source_subfolder" + patch_description: "use cci packages" + patch_type: "conan" - patch_file: "patches/0003-define-win32-winnt-cci-20201104.patch" - base_path: "source_subfolder" - "1.0.1.0": - - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" - base_path: "source_subfolder" - - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" - base_path: "source_subfolder" - "1.0.2.0": - - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" - base_path: "source_subfolder" - - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" - base_path: "source_subfolder" - "1.0.3.0": - - patch_file: "patches/0001-update-cmakelists-1-0-3-0.patch" - base_path: "source_subfolder" - - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" - base_path: "source_subfolder" + patch_description: "define _WIN32_WINNT" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + - patch_file: "patches/0005-include-mutex-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" diff --git a/recipes/cppcommon/all/conanfile.py b/recipes/cppcommon/all/conanfile.py index aa3040d536ba0..9677a5747f306 100644 --- a/recipes/cppcommon/all/conanfile.py +++ b/recipes/cppcommon/all/conanfile.py @@ -1,33 +1,38 @@ -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 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.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -import glob +required_conan_version = ">=1.53.0" class CppCommon(ConanFile): name = "cppcommon" - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/chronoxor/CppCommon" description = "C++ Common Library contains reusable components and patterns" \ " for error and exceptions handling, filesystem manipulations, math," \ " string format and encoding, shared memory, threading, time management" \ " and others." - topics = ("conan", "utils", "library") - settings = "os", "compiler", "build_type", "arch" - options = {"fPIC": [True, False], "shared": [True, False]} - default_options = {"fPIC": True, "shared": False} - exports_sources = ["patches/**", "CMakeLists.txt"] - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/chronoxor/CppCommon" + topics = ("utils", "filesystem", "uuid", "synchronization", "queue") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -36,64 +41,74 @@ def _compilers_minimum_version(self): "clang": 6, "gcc": 7, "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.settings.compiler == "Visual Studio" and self.settings.arch == "x86": - raise ConanInvalidConfiguration("Visual Studio x86 builds are not supported.") - if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "17") - - 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("cppcommon requires C++17, which your compiler does not support.") - else: - self.output.warn("cppcommon requires C++17. Your compiler is unknown. Assuming it supports C++17.") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/8.0.0") + if Version(self.version) < "1.0.3" or self.version == "cci.20201104": + self.requires("fmt/8.1.1") + else: + self.requires("fmt/10.2.0", transitive_headers=True) if self.settings.os == "Linux": - self.requires("libuuid/1.0.3") + 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) + 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.settings.arch == "x86": + raise ConanInvalidConfiguration("Visual Studio x86 builds are not supported.") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.20 <4]") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("CppCommon-*")[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["CPPCOMMON_MODULE"] = "OFF" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CPPCOMMON_MODULE"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + dpes = CMakeDeps(self) + dpes.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() - self.copy(pattern="*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy(pattern="*.inl", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy(pattern="*.h", dst=os.path.join("include", "plugins"), src=os.path.join(self._source_subfolder, "plugins")) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.inl", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include", "plugins"), src=os.path.join(self.source_folder, "plugins")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) - self.cpp_info.includedirs.append(os.path.join("include", "plugins")) - if self.settings.os == "Linux": + self.cpp_info.libs = ["cppcommon", "plugin-function", "plugin-interface"] + self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "plugins")) + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "rt", "dl", "m"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["userenv", "rpcrt4"] diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch index 4429b5fee77ed..db56e91ef6951 100644 --- a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index dcd57785b..2dde9577f 100644 +index dcd5778..160fc09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -18,13 +18,13 @@ if(DOXYGEN_FOUND) +@@ -18,30 +18,30 @@ if(DOXYGEN_FOUND) endif() # CMake module path @@ -20,8 +20,9 @@ index dcd57785b..2dde9577f 100644 +# include(SystemInformation) # External packages ++find_package(fmt REQUIRED) find_package(Threads REQUIRED) -@@ -32,16 +32,15 @@ if(UNIX AND NOT APPLE AND NOT MSYS) + if(UNIX AND NOT APPLE AND NOT MSYS) find_package(LibBFD) find_package(LibDL) find_package(LibRT) @@ -40,12 +41,12 @@ index dcd57785b..2dde9577f 100644 # Link libraries list(APPEND LINKLIBS Threads::Threads) -@@ -49,17 +48,18 @@ if(UNIX AND NOT APPLE AND NOT MSYS) +@@ -49,17 +49,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 CONAN_PKG::libuuid) ++ list(APPEND LINKLIBS libuuid::libuuid) endif() if(WIN32 OR MSYS) list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) @@ -62,7 +63,7 @@ index dcd57785b..2dde9577f 100644 include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") # Library -@@ -68,8 +68,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl") +@@ -68,8 +69,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl") file(GLOB_RECURSE LIB_SOURCE_FILES "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") @@ -70,11 +71,11 @@ index dcd57785b..2dde9577f 100644 -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} CONAN_PKG::fmt) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) -@@ -91,7 +92,7 @@ if(NOT CPPCOMMON_MODULE) +@@ -91,7 +93,7 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS_PDB ${PLUGIN_TARGET}) endforeach() @@ -83,7 +84,7 @@ index dcd57785b..2dde9577f 100644 file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") -@@ -105,8 +106,8 @@ if(NOT CPPCOMMON_MODULE) +@@ -105,8 +107,8 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) endforeach() @@ -94,7 +95,7 @@ index dcd57785b..2dde9577f 100644 file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") -@@ -120,8 +121,8 @@ if(NOT CPPCOMMON_MODULE) +@@ -120,8 +122,8 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) endforeach() @@ -105,7 +106,7 @@ index dcd57785b..2dde9577f 100644 file(GLOB TESTS_HEADER_FILES "tests/*.h") file(GLOB TESTS_INLINE_FILES "tests/*.inl") file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") -@@ -136,15 +137,15 @@ if(NOT CPPCOMMON_MODULE) +@@ -136,15 +138,15 @@ if(NOT CPPCOMMON_MODULE) # CTest enable_testing() add_test(cppcommon-tests cppcommon-tests --durations yes --order lex) diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch index c7b2d0bf5679b..650b9b1d05898 100644 --- a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch @@ -1,17 +1,14 @@ -From 85122652b618951f1b8fe91d8804d92a74d971be Mon Sep 17 00:00:00 2001 -From: Alejandro Colomar -Date: Mon, 7 Jun 2021 10:27:46 +0200 -Subject: [PATCH] update cmakelists - ---- - CMakeLists.txt | 42 +++++++++++++++++++----------------------- - 1 file changed, 19 insertions(+), 23 deletions(-) - diff --git a/CMakeLists.txt b/CMakeLists.txt -index aa5447a8..10a0065b 100644 +index aa5447a..19b3564 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -17,49 +17,36 @@ if(DOXYGEN_FOUND) +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.6) ++cmake_minimum_required(VERSION 3.8) + + # Global properties + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +@@ -17,49 +17,37 @@ if(DOXYGEN_FOUND) endif() endif() @@ -26,6 +23,7 @@ index aa5447a8..10a0065b 100644 - # External packages find_package(Threads REQUIRED) ++find_package(fmt REQUIRED) if(UNIX AND NOT APPLE AND NOT MSYS) find_package(LibBFD) find_package(LibDL) @@ -49,7 +47,7 @@ index aa5447a8..10a0065b 100644 list(APPEND LINKLIBS ${LIBDL_LIBRARIES}) list(APPEND LINKLIBS ${LIBRT_LIBRARIES}) - list(APPEND LINKLIBS ${LIBUUID_LIBRARIES}) -+ list(APPEND LINKLIBS CONAN_PKG::libuuid) ++ list(APPEND LINKLIBS libuuid::libuuid) endif() if(WIN32 OR MSYS) list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) @@ -65,7 +63,7 @@ index aa5447a8..10a0065b 100644 include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") # Library -@@ -68,8 +55,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") +@@ -68,8 +56,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") @@ -73,11 +71,11 @@ index aa5447a8..10a0065b 100644 -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} CONAN_PKG::fmt) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) -@@ -92,6 +80,7 @@ if(NOT CPPCOMMON_MODULE) +@@ -92,6 +81,7 @@ if(NOT CPPCOMMON_MODULE) endforeach() # Examples @@ -85,7 +83,7 @@ index aa5447a8..10a0065b 100644 file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") -@@ -105,8 +94,10 @@ if(NOT CPPCOMMON_MODULE) +@@ -105,8 +95,10 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) endforeach() @@ -96,7 +94,7 @@ index aa5447a8..10a0065b 100644 file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") -@@ -120,8 +111,10 @@ if(NOT CPPCOMMON_MODULE) +@@ -120,8 +112,10 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) endforeach() @@ -107,7 +105,7 @@ index aa5447a8..10a0065b 100644 file(GLOB TESTS_HEADER_FILES "tests/*.h") file(GLOB TESTS_INLINE_FILES "tests/*.inl") file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") -@@ -132,19 +125,22 @@ if(NOT CPPCOMMON_MODULE) +@@ -132,19 +126,22 @@ if(NOT CPPCOMMON_MODULE) target_link_libraries(cppcommon-tests ${LINKLIBS}) list(APPEND INSTALL_TARGETS cppcommon-tests) list(APPEND INSTALL_TARGETS_PDB cppcommon-tests) @@ -134,6 +132,3 @@ index aa5447a8..10a0065b 100644 foreach(INSTALL_TARGET_PDB ${INSTALL_TARGETS_PDB}) install(FILES $ DESTINATION "${PROJECT_SOURCE_DIR}/bin") endforeach() --- -2.31.1.498.g6c1eba8ee3d - diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch index 83cb81ebe9a49..6a01d828cbe86 100644 --- a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch @@ -1,14 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index aa5447a8..10a0065b 100644 +index 7ce5f63..be39a51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.20) -+cmake_minimum_required(VERSION 3.18.2) - - # Global properties - set_property(GLOBAL PROPERTY USE_FOLDERS ON) -@@ -17,49 +17,36 @@ if(DOXYGEN_FOUND) +@@ -17,49 +17,37 @@ if(DOXYGEN_FOUND) endif() endif() @@ -23,6 +17,7 @@ index aa5447a8..10a0065b 100644 - # External packages find_package(Threads REQUIRED) ++find_package(fmt REQUIRED) if(UNIX AND NOT APPLE AND NOT MSYS) find_package(LibBFD) find_package(LibDL) @@ -46,7 +41,7 @@ index aa5447a8..10a0065b 100644 list(APPEND LINKLIBS ${LIBDL_LIBRARIES}) list(APPEND LINKLIBS ${LIBRT_LIBRARIES}) - list(APPEND LINKLIBS ${LIBUUID_LIBRARIES}) -+ list(APPEND LINKLIBS CONAN_PKG::libuuid) ++ list(APPEND LINKLIBS libuuid::libuuid) endif() if(WIN32 OR MSYS) list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) @@ -62,7 +57,7 @@ index aa5447a8..10a0065b 100644 include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") # Library -@@ -68,8 +55,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") +@@ -68,8 +56,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") @@ -70,11 +65,11 @@ index aa5447a8..10a0065b 100644 -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} CONAN_PKG::fmt) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) -@@ -92,6 +80,7 @@ if(NOT CPPCOMMON_MODULE) +@@ -92,6 +81,7 @@ if(NOT CPPCOMMON_MODULE) endforeach() # Examples @@ -82,7 +77,7 @@ index aa5447a8..10a0065b 100644 file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") -@@ -105,8 +94,10 @@ if(NOT CPPCOMMON_MODULE) +@@ -105,8 +95,10 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) endforeach() @@ -93,7 +88,7 @@ index aa5447a8..10a0065b 100644 file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") -@@ -120,8 +111,10 @@ if(NOT CPPCOMMON_MODULE) +@@ -120,8 +112,10 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) endforeach() @@ -104,7 +99,7 @@ index aa5447a8..10a0065b 100644 file(GLOB TESTS_HEADER_FILES "tests/*.h") file(GLOB TESTS_INLINE_FILES "tests/*.inl") file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") -@@ -132,19 +125,22 @@ if(NOT CPPCOMMON_MODULE) +@@ -132,19 +126,22 @@ if(NOT CPPCOMMON_MODULE) target_link_libraries(cppcommon-tests ${LINKLIBS}) list(APPEND INSTALL_TARGETS cppcommon-tests) list(APPEND INSTALL_TARGETS_PDB cppcommon-tests) 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 0000000000000..0d4c06013abe8 --- /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-1-0.patch b/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch index 3b9099c8f0c45..b85cb3d5f9ed0 100644 --- a/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch +++ b/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch @@ -17,7 +17,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 10a0065b..2ed1668c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -61,6 +61,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) +@@ -62,6 +62,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) 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 0000000000000..076bc12bf2beb --- /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/all/patches/0003-define-win32-winnt-cci-20201104.patch b/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch index 83c8b1f1eb2c9..61af4f0ef8364 100644 --- a/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch +++ b/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch @@ -4,11 +4,13 @@ https://github.com/chronoxor/CppCMakeScripts/blob/1.0.0.0/SetPlatformFeatures.cm Even if it sets _WIN32_WINNT to _WIN32_WINNT_WIN10, here a less strict definiton is chosen (_WIN32_WINNT_VISTA). +--- + diff --git a/CMakeLists.txt b/CMakeLists.txt -index ad3d53aa8..d4dcbf8b5 100644 +index 160fc09..5eeddd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -74,6 +74,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) +@@ -75,6 +75,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) @@ -18,4 +20,4 @@ index ad3d53aa8..d4dcbf8b5 100644 + # Additional module components: benchmarks, examples, plugins, tests, tools and install if(NOT CPPCOMMON_MODULE) - + diff --git a/recipes/cppcommon/all/patches/0004-include-cstdint-1-0-0.patch b/recipes/cppcommon/all/patches/0004-include-cstdint-1-0-0.patch new file mode 100644 index 0000000000000..ac9007806f716 --- /dev/null +++ b/recipes/cppcommon/all/patches/0004-include-cstdint-1-0-0.patch @@ -0,0 +1,49 @@ +diff --git a/include/common/reader.h b/include/common/reader.h +index b3bba38..39f1f87 100644 +--- a/include/common/reader.h ++++ b/include/common/reader.h +@@ -11,6 +11,7 @@ + + #include + #include ++#include + + namespace CppCommon { + +diff --git a/include/string/string_utils.inl b/include/string/string_utils.inl +index 1315e63..1a225c8 100644 +--- a/include/string/string_utils.inl ++++ b/include/string/string_utils.inl +@@ -6,6 +6,8 @@ + \copyright MIT License + */ + ++#include ++ + namespace CppCommon { + + inline bool StringUtils::IsBlank(char ch) +diff --git a/include/system/uuid.h b/include/system/uuid.h +index bc3c2ea..cf768ea 100644 +--- a/include/system/uuid.h ++++ b/include/system/uuid.h +@@ -13,6 +13,7 @@ + + #include + #include ++#include + + namespace CppCommon { + +diff --git a/source/string/encoding.cpp b/source/string/encoding.cpp +index 5a0e633..65dc7e6 100644 +--- a/source/string/encoding.cpp ++++ b/source/string/encoding.cpp +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + namespace CppCommon { + diff --git a/recipes/cppcommon/all/patches/0005-include-mutex-1-0-0.patch b/recipes/cppcommon/all/patches/0005-include-mutex-1-0-0.patch new file mode 100644 index 0000000000000..bca5eaf100bb2 --- /dev/null +++ b/recipes/cppcommon/all/patches/0005-include-mutex-1-0-0.patch @@ -0,0 +1,12 @@ +diff --git a/source/cache/filecache.cpp b/source/cache/filecache.cpp +index 0c22f50..2bfb3a1 100644 +--- a/source/cache/filecache.cpp ++++ b/source/cache/filecache.cpp +@@ -7,6 +7,7 @@ + */ + + #include "cache/filecache.h" ++#include + + namespace CppCommon { + diff --git a/recipes/cppcommon/all/test_package/CMakeLists.txt b/recipes/cppcommon/all/test_package/CMakeLists.txt index ba1e21ea8636c..0c4ae375149ae 100644 --- a/recipes/cppcommon/all/test_package/CMakeLists.txt +++ b/recipes/cppcommon/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -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() +find_package(cppcommon REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -conan_target_link_libraries(${PROJECT_NAME}) - +target_link_libraries(${PROJECT_NAME} PRIVATE cppcommon::cppcommon) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) diff --git a/recipes/cppcommon/all/test_package/conanfile.py b/recipes/cppcommon/all/test_package/conanfile.py index 4903f1a7e8fa0..ef5d7042163ec 100644 --- a/recipes/cppcommon/all/test_package/conanfile.py +++ b/recipes/cppcommon/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/cppcommon/config.yml b/recipes/cppcommon/config.yml index 17d2cd502269e..dfd13b4693a86 100644 --- a/recipes/cppcommon/config.yml +++ b/recipes/cppcommon/config.yml @@ -1,11 +1,13 @@ versions: - "1.0.0.0": + "1.0.4.0": folder: all - "cci.20201104": + "1.0.3.0": + folder: all + "1.0.2.0": folder: all "1.0.1.0": folder: all - "1.0.2.0": + "1.0.0.0": folder: all - "1.0.3.0": + "cci.20201104": folder: all diff --git a/recipes/cppdap/all/conandata.yml b/recipes/cppdap/all/conandata.yml new file mode 100644 index 0000000000000..81a6d395b6748 --- /dev/null +++ b/recipes/cppdap/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "cci.20230526": + url: "https://github.com/google/cppdap/archive/03cc18678ed2ed8b2424ec99dee7e4655d876db5.tar.gz" + sha256: "b1de5020fdb3ab429973545f3f869cab909c0f81151242e694f6f7c1f9b32d2d" +patches: + "cci.20230526": + - patch_file: "patches/0001-build-cmake-use-min-CMake-version-prior-to-project-c.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "conan" + patch_source: "https://github.com/google/cppdap/pull/112" diff --git a/recipes/cppdap/all/conanfile.py b/recipes/cppdap/all/conanfile.py new file mode 100644 index 0000000000000..01e7b35399573 --- /dev/null +++ b/recipes/cppdap/all/conanfile.py @@ -0,0 +1,99 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class PackageConan(ConanFile): + name = "cppdap" + description = "Debug Adapter Protocol SDK" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/cppdap" + topics = ("debug", "adapter", "protocol", "dap") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_json": ["jsoncpp", "nlohmann_json", "rapidjson"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_json": "nlohmann_json", + } + + @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 self.options.with_json == "jsoncpp": + self.requires("jsoncpp/1.9.5") + elif self.options.with_json == "rapidjson": + self.requires("rapidjson/cci.20220822") + elif self.options.with_json == "nlohmann_json": + self.requires("nlohmann_json/3.11.2") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + if 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["CPPDAP_USE_EXTERNAL_JSONCPP_PACKAGE"] = self.options.with_json == "jsoncpp" + tc.variables["CPPDAP_USE_EXTERNAL_RAPIDJSON_PACKAGE"] = self.options.with_json == "rapidjson" + tc.variables["CPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE"] = self.options.with_json == "nlohmann_json" + 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")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["cppdap"] + + self.cpp_info.set_property("cmake_file_name", "cppdap") + self.cpp_info.set_property("cmake_target_name", "cppdap::cppdap") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + if self.settings.os in ["Windows"]: + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/cppdap/all/patches/0001-build-cmake-use-min-CMake-version-prior-to-project-c.patch b/recipes/cppdap/all/patches/0001-build-cmake-use-min-CMake-version-prior-to-project-c.patch new file mode 100644 index 0000000000000..4afee12c43400 --- /dev/null +++ b/recipes/cppdap/all/patches/0001-build-cmake-use-min-CMake-version-prior-to-project-c.patch @@ -0,0 +1,33 @@ +From ab76a207761b02e169f3ace39e3beb126b39fe9e Mon Sep 17 00:00:00 2001 +From: Gregor Jasny +Date: Mon, 5 Jun 2023 08:01:43 +0200 +Subject: [PATCH] build(cmake): use min CMake version prior to project call + +The [CMake documentation](https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html) +mandates that `cmake_minimum_required` should be called early +in the `CMakeLists.txt` prior to any `project()` command. +--- + CMakeLists.txt | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f111f1a..717f02e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,11 +12,10 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-cmake_policy(SET CMP0048 NEW) +-project(cppdap VERSION 1.59.0 LANGUAGES CXX C) +- + cmake_minimum_required(VERSION 3.13) + ++project(cppdap VERSION 1.59.0 LANGUAGES CXX C) ++ + set (CMAKE_CXX_STANDARD 11) + + include(GNUInstallDirs) +-- +2.40.1 + diff --git a/recipes/cppdap/all/test_package/CMakeLists.txt b/recipes/cppdap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4175e2067e663 --- /dev/null +++ b/recipes/cppdap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(cppdap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cppdap::cppdap) diff --git a/recipes/cppdap/all/test_package/conanfile.py b/recipes/cppdap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/cppdap/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/cppdap/all/test_package/test_package.cpp b/recipes/cppdap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8b914589b185d --- /dev/null +++ b/recipes/cppdap/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include "dap/dap.h" + +int main() { + + dap::initialize(); + dap::terminate(); + + return EXIT_SUCCESS; +} diff --git a/recipes/cppdap/config.yml b/recipes/cppdap/config.yml new file mode 100644 index 0000000000000..4dde24d181aa0 --- /dev/null +++ b/recipes/cppdap/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230526": + folder: all diff --git a/recipes/cppfront/all/conandata.yml b/recipes/cppfront/all/conandata.yml index 3db3937d63c0d..4a9575e4249b6 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 50c5629b6e025..5474e123fd52d 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 b8a68ed038695..0337148504871 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 585bcc850ce23..d59270a8f393a 100644 --- a/recipes/cppitertools/all/conanfile.py +++ b/recipes/cppitertools/all/conanfile.py @@ -1,65 +1,75 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +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 -required_conan_version = ">=1.32.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): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._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" } - compiler = str(self.settings.compiler) - compiler_version = tools.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, tools.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): - self.copy("*.hpp", dst=os.path.join("include", "cppitertools"), src=self._source_subfolder, excludes=('examples/**', 'test/**')) - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + 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.names["cmake_find_package"] = "cppitertools" - self.cpp_info.names["cmake_find_package_multi"] = "cppitertools" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "cppitertools") + self.cpp_info.set_property("cmake_target_name", "cppitertools::cppitertools") - def package_id(self): - self.info.header_only() diff --git a/recipes/cppitertools/all/test_package/CMakeLists.txt b/recipes/cppitertools/all/test_package/CMakeLists.txt index 76d1d8411383a..18b263b57ca6f 100644 --- a/recipes/cppitertools/all/test_package/CMakeLists.txt +++ b/recipes/cppitertools/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.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 92e1d0d57881c..fac50abb3d577 100644 --- a/recipes/cppitertools/all/test_package/conanfile.py +++ b/recipes/cppitertools/all/test_package/conanfile.py @@ -1,23 +1,38 @@ import os -from conans import ConanFile, CMake, tools + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain, CMakeDeps +from conan.tools.build import can_run class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + test_type = "explicit" + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ZIP_LONGEST"] = self.dependencies["cppitertools"].options.zip_longest + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) - if self.options["cppitertools"].zip_longest: - cmake.definitions["ZIP_LONGEST"] = True 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) + def layout(self): + cmake_layout(self) - if self.options["cppitertools"].zip_longest: - bin_path = os.path.join("bin", "test_zip_longest") - self.run(bin_path, run_environment=True) + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") + # sense if it was built because we don't have access to: + # self.dependencies["cppitertools"].options.zip_longest + cmd = os.path.join(self.cpp.build.bindir, "test_zip_longest") + if os.path.exists(cmd): + self.run(cmd, env="conanrun") diff --git a/recipes/cpprestsdk/all/conandata.yml b/recipes/cpprestsdk/all/conandata.yml index 5216074c76f9d..632826ffef040 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 467c812235f66..c75c41fcad7c4 100644 --- a/recipes/cpprestsdk/all/conanfile.py +++ b/recipes/cpprestsdk/all/conanfile.py @@ -1,6 +1,9 @@ from conan import ConanFile -from conan.tools import files 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, rmdir +) import os required_conan_version = ">=1.53.0" @@ -12,9 +15,9 @@ class CppRestSDKConan(ConanFile): "C++ API design" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Microsoft/cpprestsdk" - topics = ("cpprestsdk", "rest", "client", "http", "https") + topics = ("rest", "client", "http", "https") license = "MIT" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,7 +39,7 @@ class CppRestSDKConan(ConanFile): } def export_sources(self): - files.export_conandata_patches(self) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -50,23 +53,19 @@ 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("boost/1.80.0") - self.requires("openssl/1.1.1s") + 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") - def package_id(self): - self.info.requires["boost"].minor_mode() - - def layout(self): - cmake_layout(self, src_folder="src") - def source(self): - files.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) @@ -90,22 +89,22 @@ def generate(self): def _patch_clang_libcxx(self): if self.settings.compiler == 'clang' and str(self.settings.compiler.libcxx) in ['libstdc++', 'libstdc++11']: - files.replace_in_file(self, os.path.join(self.source_folder, 'Release', 'CMakeLists.txt'), + replace_in_file(self, os.path.join(self.source_folder, 'Release', 'CMakeLists.txt'), 'libc++', 'libstdc++') def build(self): - files.apply_conandata_patches(self) + apply_conandata_patches(self) self._patch_clang_libcxx() cmake = CMake(self) cmake.configure() cmake.build() def package(self): - files.copy(self, "license.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "license.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "cpprestsdk")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cpprestsdk")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "cpprestsdk") @@ -120,7 +119,7 @@ def package_info(self): self.cpp_info.components["cpprestsdk_openssl_internal"].requires = ["openssl::openssl"] # cpprest self.cpp_info.components["cpprest"].set_property("cmake_target_name", "cpprestsdk::cpprest") - self.cpp_info.components["cpprest"].libs = files.collect_libs(self) + self.cpp_info.components["cpprest"].libs = collect_libs(self) self.cpp_info.components["cpprest"].requires = ["cpprestsdk_boost_internal", "cpprestsdk_openssl_internal"] if self.settings.os == "Linux": self.cpp_info.components["cpprest"].system_libs.append("pthread") diff --git a/recipes/cpprestsdk/all/test_package/CMakeLists.txt b/recipes/cpprestsdk/all/test_package/CMakeLists.txt index b305f36beee8f..c83f3ebd18fed 100644 --- a/recipes/cpprestsdk/all/test_package/CMakeLists.txt +++ b/recipes/cpprestsdk/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(cpprestsdk REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} cpprestsdk::cpprest) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE cpprestsdk::cpprest) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpprestsdk/config.yml b/recipes/cpprestsdk/config.yml index d4be51c9a70c3..00ffc5b18bc36 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 0000000000000..d032d0a5a873d --- /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 0000000000000..f96b276006f6d --- /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 0000000000000..5268df0edea76 --- /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 0000000000000..70f3a48f3de5a --- /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 0000000000000..d75b21cd35c7f --- /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 0000000000000..413751877cee8 --- /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 0000000000000..1e7a9ff877d53 --- /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 0000000000000..bc640e59ffc24 --- /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 0000000000000..c4a25b816da1e --- /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/cpputest/all/test_package/CMakeLists.txt b/recipes/cpputest/all/test_package/CMakeLists.txt index be713b804677f..d28cda840f45c 100644 --- a/recipes/cpputest/all/test_package/CMakeLists.txt +++ b/recipes/cpputest/all/test_package/CMakeLists.txt @@ -5,8 +5,5 @@ find_package(CppUTest REQUIRED CONFIG) add_executable(test_package test_package.cpp) target_link_libraries(test_package PRIVATE CppUTest) +target_compile_definitions(test_package PRIVATE $<$:WITH_EXTENSIONS>) -if(WITH_EXTENSIONS) - add_executable(test_package_with_extensions test_package_with_extensions.cpp) - target_link_libraries(test_package_with_extensions PRIVATE CppUTestExt) -endif() diff --git a/recipes/cpputest/all/test_package/conanfile.py b/recipes/cpputest/all/test_package/conanfile.py index f422d1c08f29f..c743b7456a139 100644 --- a/recipes/cpputest/all/test_package/conanfile.py +++ b/recipes/cpputest/all/test_package/conanfile.py @@ -17,7 +17,7 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["WITH_EXTENSIONS"] = self.dependencies["cpputest"].options.with_extensions + tc.cache_variables["WITH_EXTENSIONS"] = self.dependencies["cpputest"].options.with_extensions tc.generate() def build(self): @@ -29,6 +29,3 @@ 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["cpputest"].with_extensions: - bin_extensions_path = os.path.join(self.cpp.build.bindirs[0], "test_package_with_extensions") - self.run(bin_extensions_path, env="conanrun") diff --git a/recipes/cpputest/all/test_package/test_package.cpp b/recipes/cpputest/all/test_package/test_package.cpp index 2675c3b7d443a..4ba22fc9a1637 100644 --- a/recipes/cpputest/all/test_package/test_package.cpp +++ b/recipes/cpputest/all/test_package/test_package.cpp @@ -1,6 +1,9 @@ #include #include #include +#if defined(WITH_EXTENSIONS) +#include // Only found if extensions enabled +#endif TEST_GROUP(FirstTestGroup) { diff --git a/recipes/cpputest/all/test_package/test_package_with_extensions.cpp b/recipes/cpputest/all/test_package/test_package_with_extensions.cpp deleted file mode 100644 index df94dae2d50a1..0000000000000 --- a/recipes/cpputest/all/test_package/test_package_with_extensions.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -#include -#include // Only found if extensions enabled - -TEST_GROUP(FirstTestGroup) -{ -}; - -TEST(FirstTestGroup, FirstTest) -{ - CHECK_TRUE(true); -} - -int main(int argc, const char** argv) -{ - CommandLineTestRunner runner(argc, argv, TestRegistry::getCurrentRegistry()); - return runner.runAllTestsMain(); -} diff --git a/recipes/cpputest/all/test_v1_package/conanfile.py b/recipes/cpputest/all/test_v1_package/conanfile.py index cce86300f1595..32e223569cdb0 100644 --- a/recipes/cpputest/all/test_v1_package/conanfile.py +++ b/recipes/cpputest/all/test_v1_package/conanfile.py @@ -16,6 +16,3 @@ 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["cpputest"].with_extensions: - bin_extensions_path = os.path.join("bin", "test_package_with_extensions") - self.run(bin_extensions_path, run_environment=True) diff --git a/recipes/cppzmq/all/conandata.yml b/recipes/cppzmq/all/conandata.yml index 263917af47c65..4bfaa1bc9f316 100644 --- a/recipes/cppzmq/all/conandata.yml +++ b/recipes/cppzmq/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.10.0": + url: "https://github.com/zeromq/cppzmq/archive/refs/tags/v4.10.0.tar.gz" + sha256: "c81c81bba8a7644c84932225f018b5088743a22999c6d82a2b5f5cd1e6942b74" "4.9.0": url: "https://github.com/zeromq/cppzmq/archive/v4.9.0.tar.gz" sha256: "3fdf5b100206953f674c94d40599bdb3ea255244dcc42fab0d75855ee3645581" diff --git a/recipes/cppzmq/all/conanfile.py b/recipes/cppzmq/all/conanfile.py index 44e3718dd5de3..5a976b586d2ff 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/cppzmq/config.yml b/recipes/cppzmq/config.yml index a52b8593d6634..e5b938c02e62a 100644 --- a/recipes/cppzmq/config.yml +++ b/recipes/cppzmq/config.yml @@ -1,4 +1,6 @@ versions: + "4.10.0": + folder: all "4.9.0": folder: all "4.8.1": diff --git a/recipes/cpr/all/conandata.yml b/recipes/cpr/all/conandata.yml index 4be23150be0d1..02059bab669a9 100644 --- a/recipes/cpr/all/conandata.yml +++ b/recipes/cpr/all/conandata.yml @@ -1,37 +1,25 @@ sources: - "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" + "1.10.5": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.5.tar.gz" + sha256: "c8590568996cea918d7cf7ec6845d954b9b95ab2c4980b365f582a665dea08d8" + "1.10.4": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.4.tar.gz" + sha256: "88462d059cd3df22c4d39ae04483ed50dfd2c808b3effddb65ac3b9aa60b542d" "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.1": + "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.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" @@ -42,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" @@ -69,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 f9ec63a80be5a..b2e254935a1fd 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,24 +82,12 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libcurl/7.87.0", transitive_headers=True, transitive_libs=True) - - # 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] + 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]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -151,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( @@ -188,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 42f7f34ab13fe..0000000000000 --- 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 61ba93886b977..0000000000000 --- 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 b4fe11b69536a..0000000000000 --- 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 fda5c28eafd1d..0000000000000 --- 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 04da489547e84..0000000000000 --- 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 f20781e9ef90e..0000000000000 --- 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 51dcfd080e779..48b580f3173d9 100644 --- a/recipes/cpr/config.yml +++ b/recipes/cpr/config.yml @@ -1,19 +1,11 @@ versions: - "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 f1d8d20922d76..cfb3a6e0339a8 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 05121b9bfe414..81c78689deb64 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 51cf79f1d6887..ef5d7042163ec 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 479e221b8ea06..e8aaee04efe2b 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 0000000000000..91630d79f4abb --- /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/cprocessing/all/test_v1_package/conanfile.py b/recipes/cprocessing/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cprocessing/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/cpu_features/all/conandata.yml b/recipes/cpu_features/all/conandata.yml index 8e0a68b98fb04..b0a209ae1c3e8 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 a4fbe67cb54a0..7f1513eea2fa9 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 6231a9e8c3b97..5d3ebdc36307e 100644 --- a/recipes/cpuinfo/all/conandata.yml +++ b/recipes/cpuinfo/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "cci.20231129": + url: "https://github.com/pytorch/cpuinfo/archive/9d809924011af8ff49dadbda1499dc5193f1659c.tar.gz" + sha256: "0d769b7e3cc7d16205f4cc8988f869910db19f2d274db005c1ed74e961936d34" + "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 3a1f62573cb43..24edf5382c77c 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 f7fd88969d977..96ba94c8edef5 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 0a6bc68712d90..2690818e47570 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 38f4483872d47..ea57bb8b3a514 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 a6383a8ac8924..a71ccd412f08d 100644 --- a/recipes/cpuinfo/config.yml +++ b/recipes/cpuinfo/config.yml @@ -1,4 +1,10 @@ versions: + "cci.20231129": + folder: all + "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 09ada265a5657..ae324a0321c62 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 4ccb993ef97a2..c77936e91ebea 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 d41bc6dd30265..ba67401c34bcc 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 34a0bcae95438..0a6bc68712d90 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/openjpeg/all/test_v1_package/CMakeLists.txt b/recipes/crc_cpp/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/openjpeg/all/test_v1_package/CMakeLists.txt rename to recipes/crc_cpp/all/test_v1_package/CMakeLists.txt diff --git a/recipes/crc_cpp/all/test_v1_package/conanfile.py b/recipes/crc_cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/crc_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/crc_cpp/config.yml b/recipes/crc_cpp/config.yml index 0d463a277e732..de59a653e157c 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 3bee38ab2012d..ee05f9df79b21 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 52e6fe840c8e2..e4d468f0643af 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) @@ -39,7 +39,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="create-dmg", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "res", "create-dmg", "support"), src=os.path.join(self.source_folder, "support")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "res"), src=os.path.join(self.source_folder, "support")) rmdir(self, os.path.join(self.package_folder, "share")) 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 0000000000000..8befadff184bc --- /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 d8aafe5a32208..cc3bbf3e41e1f 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/croncpp/all/CMakeLists.txt b/recipes/croncpp/all/CMakeLists.txt deleted file mode 100644 index 46247ce0c956e..0000000000000 --- a/recipes/croncpp/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(conan_wrapper CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_CXX_STANDARD 11) - -add_subdirectory(source_subfolder) diff --git a/recipes/croncpp/all/conanfile.py b/recipes/croncpp/all/conanfile.py index cecf595a5a249..ffab100ea6a29 100644 --- a/recipes/croncpp/all/conanfile.py +++ b/recipes/croncpp/all/conanfile.py @@ -1,45 +1,57 @@ import os -import functools -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, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir + +required_conan_version = ">=1.52.0" + class CroncppConan(ConanFile): name = "croncpp" description = "A C++11/14/17 header-only cross-platform library for handling CRON expressions" - topics = ("cron", "header-only") license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mariusbancila/croncpp/" + topics = ("cron", "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 _min_cppstd(self): + return 11 - def export_sources(self): - self.copy("CMakeLists.txt") + def layout(self): + cmake_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 generate(self): + tc = CMakeToolchain(self) + tc.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): cmake = CMake(self) cmake.configure() - return cmake + cmake.build() def package(self): - self.copy("LICENSE*", "licenses", 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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/croncpp/all/test_package/CMakeLists.txt b/recipes/croncpp/all/test_package/CMakeLists.txt index 1bb4c146bf257..0377a66e57597 100644 --- a/recipes/croncpp/all/test_package/CMakeLists.txt +++ b/recipes/croncpp/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(croncpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/croncpp/all/test_package/conanfile.py b/recipes/croncpp/all/test_package/conanfile.py index 6cae150e6701a..fae501d0afb9e 100644 --- a/recipes/croncpp/all/test_package/conanfile.py +++ b/recipes/croncpp/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 CroncppConan(ConanFile): + +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) @@ -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/crossguid/all/conandata.yml b/recipes/crossguid/all/conandata.yml new file mode 100644 index 0000000000000..2fdb90ed9775b --- /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 0000000000000..562232c007b4a --- /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 0000000000000..c3a387902568c --- /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 0000000000000..d114028593025 --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..1fcc33b8fd5e8 --- /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 0000000000000..cd4b8da537c38 --- /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 001767af2d0fd..ff4bbd7ba2b66 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 3022a3897300e..6fce18aff0519 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 f36a181c680d3..0000000000000 --- 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 47bad60429553..d25975ebafd93 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 12b7d953de0b6..b4e3943149076 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 e7c0d678e7363..3ca6e7dc9287c 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 f9ceeed7804cb..fdb362acfd0cf 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 19e6a0c06e3d8..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 2bc29cced3bfe..6ca47dae24406 100644 --- a/recipes/cryptopp/all/conandata.yml +++ b/recipes/cryptopp/all/conandata.yml @@ -1,4 +1,18 @@ sources: + "8.9.0": + source: + url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_9_0.tar.gz" + sha256: "ab5174b9b5c6236588e15a1aa1aaecb6658cdbe09501c7981ac8db276a24d9ab" + cmake: + url: "https://github.com/abdes/cryptopp-cmake/archive/CRYPTOPP_8_9_0.tar.gz" + sha256: "191d69061c56602de1610ebf03b44dcf75636006e7e60ef8105bee6472ec0caf" + "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 f16bdf4f4f23d..d61c97a23b4e4 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 0cf6dab66b6c7..f7be670f19b31 100644 --- a/recipes/cryptopp/config.yml +++ b/recipes/cryptopp/config.yml @@ -1,4 +1,8 @@ versions: + "8.9.0": + folder: "all" + "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 6464993e20067..da0b7dc222888 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 39578ddadb423..7a321e4ffe729 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 942362a3d6c93..e039584f8837c 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 3812708448a9a..4e032190639fa 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 49542ed86e55c..821a19ed46096 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 0000000000000..49dc0097b55ed --- /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 0000000000000..3cf7e23d7eec7 --- /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 0000000000000..0fedcbfdc5199 --- /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 0000000000000..e845ae751a301 --- /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 0000000000000..561e9a5d45e57 --- /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 0000000000000..52ddbe7872fd0 --- /dev/null +++ b/recipes/cthash/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20231025": + folder: all diff --git a/recipes/ctml/all/conanfile.py b/recipes/ctml/all/conanfile.py index b5c3dd7c38f7d..bb07e06f8fb0b 100644 --- a/recipes/ctml/all/conanfile.py +++ b/recipes/ctml/all/conanfile.py @@ -1,7 +1,12 @@ import os -from conans import ConanFile, tools -required_conan_version = ">=1.43.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 CtmlLibrariesConan(ConanFile): name = "ctml" @@ -9,33 +14,41 @@ class CtmlLibrariesConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tinfoilboy/CTML" - topics = ("generator", "html", ) - settings = "os", "arch", "compiler", "build_type", - generators = "cmake", + topics = ("generator", "html", "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 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 package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("ctml.hpp", "include", os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "ctml.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", "CTML") self.cpp_info.set_property("cmake_target_name", "CTML::CTML") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "CTML" self.cpp_info.filenames["cmake_find_package_multi"] = "CTML" self.cpp_info.names["cmake_find_package"] = "CTML" diff --git a/recipes/ctml/all/test_package/CMakeLists.txt b/recipes/ctml/all/test_package/CMakeLists.txt index 1df60de830867..d4e16fb2704c6 100644 --- a/recipes/ctml/all/test_package/CMakeLists.txt +++ b/recipes/ctml/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(CTML CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/ctml/all/test_package/conanfile.py b/recipes/ctml/all/test_package/conanfile.py index 270a1ae971491..fae501d0afb9e 100644 --- a/recipes/ctml/all/test_package/conanfile.py +++ b/recipes/ctml/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 TestWrapperConan(ConanFile): + +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) @@ -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/ctpg/all/conandata.yml b/recipes/ctpg/all/conandata.yml index e352628a7b1dd..35ba92c0e0475 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 bd69eefe8c5a2..6e511a34160b5 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 b09bb90b2f88d..72fdf15fd58d7 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 34c01340114ef..c5591f2deebdb 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 bcd377f23cbd8..0d99b97395ccd 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 0000000000000..91630d79f4abb --- /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 0000000000000..90eb89e3f2f46 --- /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 3da45bc778250..fba76735a9013 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 0cbb6fc297fa1..c31706ca559c2 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 4a9068c2ee4fe..7170bf3ad6425 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 791985db54420..02f3f62c0a451 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/conandata.yml b/recipes/cub/all/conandata.yml new file mode 100644 index 0000000000000..b266ef302799f --- /dev/null +++ b/recipes/cub/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.17.2": + url: "https://github.com/NVIDIA/cub/archive/refs/tags/1.17.2.tar.gz" + sha256: "1013a595794548c359f22c07e1f8c620b97e3a577f7e8496d9407f74566a3e2a" diff --git a/recipes/cub/all/conanfile.py b/recipes/cub/all/conanfile.py new file mode 100644 index 0000000000000..c19b0eb6a8902 --- /dev/null +++ b/recipes/cub/all/conanfile.py @@ -0,0 +1,80 @@ +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 CubConan(ConanFile): + name = "cub" + description = "Cooperative primitives for CUDA C++" + license = "BSD 3-Clause" + url = "https://github.com/conan-io/conan-center-index" + 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 + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "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, "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") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "cub" + self.cpp_info.filenames["cmake_find_package_multi"] = "cub" + self.cpp_info.names["cmake_find_package"] = "CUB" + self.cpp_info.names["cmake_find_package_multi"] = "CUB" diff --git a/recipes/cub/all/test_package/CMakeLists.txt b/recipes/cub/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..da40597464dd4 --- /dev/null +++ b/recipes/cub/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cub REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE CUB::CUB) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cub/all/test_package/conanfile.py b/recipes/cub/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cub/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/cub/all/test_package/test_package.cpp b/recipes/cub/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..60b6a6e4b6475 --- /dev/null +++ b/recipes/cub/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + +int main() { + std::cout << "CUB version: " << + CUB_MAJOR_VERSION << "." << CUB_MINOR_VERSION << "." << CUB_SUBMINOR_VERSION << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/cub/config.yml b/recipes/cub/config.yml new file mode 100644 index 0000000000000..bcae7d8610bb8 --- /dev/null +++ b/recipes/cub/config.yml @@ -0,0 +1,3 @@ +versions: + "1.17.2": + folder: all diff --git a/recipes/cubicinterpolation/all/CMakeLists.txt b/recipes/cubicinterpolation/all/CMakeLists.txt deleted file mode 100644 index 0ed622c3eb5d7..0000000000000 --- 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 722cbaa5424a1..2525795c99b74 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 b98fa443a5368..0ce4681457d9e 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 5185d65a2df90..5c83127c63d75 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 new file mode 100644 index 0000000000000..0a04efd212109 --- /dev/null +++ b/recipes/cuda-api-wrappers/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.7-b1": + 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/all/conanfile.py b/recipes/cuda-api-wrappers/all/conanfile.py new file mode 100644 index 0000000000000..bca11c0ee8633 --- /dev/null +++ b/recipes/cuda-api-wrappers/all/conanfile.py @@ -0,0 +1,49 @@ +import os + +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 CudaApiWrappersConan(ConanFile): + name = "cuda-api-wrappers" + description = "Thin, unified, C++-flavored wrappers for the CUDA APIs" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eyalroz/cuda-api-wrappers" + topics = ("gpgpu", "cuda", "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, + pattern="LICENSE", + 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, "src"), + ) + + 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/cuda-api-wrappers/all/test_package/CMakeLists.txt b/recipes/cuda-api-wrappers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..60f8a4074a3bc --- /dev/null +++ b/recipes/cuda-api-wrappers/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cuda-api-wrappers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cuda-api-wrappers::cuda-api-wrappers) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +target_compile_definitions(${PROJECT_NAME} PRIVATE + CUDA_API_WRAPPERS_VERSION=\"${cuda-api-wrappers_VERSION_STRING}\") diff --git a/recipes/cuda-api-wrappers/all/test_package/conanfile.py b/recipes/cuda-api-wrappers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cuda-api-wrappers/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-api-wrappers/all/test_package/test_package.cpp b/recipes/cuda-api-wrappers/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b0369aaadec26 --- /dev/null +++ b/recipes/cuda-api-wrappers/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include + +CUDA_FH void test() { + std::cout << "cuda-api-wrappers v" << CUDA_API_WRAPPERS_VERSION << std::endl; +} + +int main() { + test(); + return 0; +} diff --git a/recipes/cuda-api-wrappers/config.yml b/recipes/cuda-api-wrappers/config.yml new file mode 100644 index 0000000000000..326304241de6f --- /dev/null +++ b/recipes/cuda-api-wrappers/config.yml @@ -0,0 +1,5 @@ +versions: + "0.7-b1": + folder: all + "0.6.3": + folder: all diff --git a/recipes/cuda-kat/all/conanfile.py b/recipes/cuda-kat/all/conanfile.py index dfc221ba485b8..127039e3f143a 100644 --- a/recipes/cuda-kat/all/conanfile.py +++ b/recipes/cuda-kat/all/conanfile.py @@ -1,26 +1,30 @@ -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 get, copy +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.52.0" + class CudaKatConan(ConanFile): name = "cuda-kat" - homepage = "https://github.com/eyalroz/cuda-kat" description = "CUDA kernel author's tools" - topics = ("gpgpu", "cuda", "cuda-kat", "header-only") - 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/eyalroz/cuda-kat" + topics = ("gpgpu", "cuda", "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.header_only() + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -29,26 +33,47 @@ def _compilers_minimum_version(self): "Visual Studio": "15", "clang": "5", "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 == "Windows": - raise ConanInvalidConfiguration("CUDA-kat library are not compatible on Windows") if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} 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 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*", src=self._source_subfolder, dst="licenses") - self.copy("*", src=os.path.join(self._source_subfolder, "src"), dst="include") + copy( + self, + pattern="LICENSE", + 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, "src"), + ) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "cuda-kat" - self.cpp_info.names["cmake_find_package_multi"] = "cuda-kat" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if is_msvc(self): + # Required for C++ version checks to work at + # https://github.com/eyalroz/cuda-kat/blob/44d381b/src/kat/detail/constexpr_by_cpp_version.hpp + # Otherwise MSVC will always report __cplusplus as 199711L + self.cpp_info.cxxflags.append("/Zc:__cplusplus") diff --git a/recipes/cuda-kat/all/test_package/CMakeLists.txt b/recipes/cuda-kat/all/test_package/CMakeLists.txt index a6fd14216f176..85ab0da0a3d69 100644 --- a/recipes/cuda-kat/all/test_package/CMakeLists.txt +++ b/recipes/cuda-kat/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.15) +project(test_package LANGUAGES CXX) find_package(cuda-kat REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} cuda-kat::cuda-kat) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE cuda-kat::cuda-kat) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cuda-kat/all/test_package/conanfile.py b/recipes/cuda-kat/all/test_package/conanfile.py index 49a3a66ea5bad..3a91c9439218e 100644 --- a/recipes/cuda-kat/all/test_package/conanfile.py +++ b/recipes/cuda-kat/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 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cuda-samples/all/conandata.yml b/recipes/cuda-samples/all/conandata.yml new file mode 100644 index 0000000000000..0fc2e78f080c8 --- /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 0000000000000..aa2ee3b794d8a --- /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 0000000000000..fc3bd6fda4c9c --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..041e701c086ac --- /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 0000000000000..0cc56090a313f --- /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/cunit/all/conandata.yml b/recipes/cunit/all/conandata.yml index dc0e653a838f3..ab63da567e039 100644 --- a/recipes/cunit/all/conandata.yml +++ b/recipes/cunit/all/conandata.yml @@ -5,6 +5,11 @@ sources: patches: "2.1-3": - patch_file: "patches/0001-configure-in-msvc-shortcuts.patch" - base_path: "source_subfolder" + patch_description: "configure snprintf for msvc" + patch_type: "conan" - patch_file: "patches/0002-snprintf-msvc.patch" - base_path: "source_subfolder" + patch_description: "only set snprintf for older VS compiler" + patch_type: "conan" + - patch_file: "patches/0003-fix-copy-docs.patch" + patch_description: "use correct docs dir for install docs" + patch_type: "conan" diff --git a/recipes/cunit/all/conanfile.py b/recipes/cunit/all/conanfile.py index a7c3f16aa1cdc..ee93d94bc50b0 100644 --- a/recipes/cunit/all/conanfile.py +++ b/recipes/cunit/all/conanfile.py @@ -1,9 +1,16 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from contextlib import contextmanager +from pathlib import Path + +from conan import ConanFile +from conan.tools.microsoft import is_msvc, unix_path, check_min_vs +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, chdir, rename, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.env import VirtualBuildEnv +from conan.errors import ConanInvalidConfiguration import glob import os +from conan.tools.layout import basic_layout -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.57.0" class CunitConan(ConanFile): @@ -13,7 +20,7 @@ class CunitConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "http://cunit.sourceforge.net/" license = "BSD-3-Clause" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -30,116 +37,112 @@ class CunitConan(ConanFile): "enable_console": True, "with_curses": False, } - exports_sources = "patches/**" - _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 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): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_curses == "ncurses": - self.requires("ncurses/6.2") + self.requires("ncurses/6.4") + + def validate(self): + if self.options.shared and not self.options.with_curses: + # For shared builds we always need to depend on ncurses, since otherwise we get undefined + # symbols, like: + # /usr/bin/ld: package/9333ccd2ec7e28099e1c04b315e2384b012b7a19/lib/libcunit.so: undefined reference to `echo' + # /usr/bin/ld: package/9333ccd2ec7e28099e1c04b315e2384b012b7a19/lib/libcunit.so: undefined reference to `wattr_on' + # /usr/bin/ld: package/9333ccd2ec7e28099e1c04b315e2384b012b7a19/lib/libcunit.so: undefined reference to `acs_map' + # /usr/bin/ld: package/9333ccd2ec7e28099e1c04b315e2384b012b7a19/lib/libcunit.so: undefined reference to `cbreak' + raise ConanInvalidConfiguration("cunit package is built with shared, which requires " + "cunit:with_curses=ncurses option") @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def build_requirements(self): - self.build_requires("libtool/2.4.6") - 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 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], strip_root=True, destination=self._source_subfolder) - with tools.chdir(self._source_subfolder): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + with chdir(self, self.source_folder): for f in glob.glob("*.c"): os.chmod(f, 0o644) - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) - - @contextmanager - def _build_context(self): - env = {} - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - env.update({ - "AR": "{} lib".format(tools.unix_path(self._user_info_build["automake"].ar_lib)), - "CC": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "NM": "dumpbin -symbols", - "OBJDUMP": ":", - "RANLIB": ":", - "STRIP": ":", - }) - with tools.environment_append(env): - yield - else: - with tools.environment_append(env): - 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 = [] - host, build = None, None - if self.settings.compiler == "Visual Studio": - self._autotools.flags.append("-FS") - # MSVC canonical names aren't understood - host, build = False, False - conf_args = [ - "--datarootdir={}".format(os.path.join(self.package_folder, "bin", "share").replace("\\", "/")), - "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug", - "--enable-automated" if self.options.enable_automated else "--disable-automated", - "--enable-basic" if self.options.enable_basic else "--disable-basic", - "--enable-console" if self.options.enable_console else "--disable-console", - "--enable-curses" if self.options.with_curses != False else "--disable-curses", - ] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(args=conf_args, host=host, build=build) - return self._autotools + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.configure_args.append("--datarootdir=${prefix}/bin/share") + tc.configure_args.append("--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug") + tc.configure_args.append("--enable-automated" if self.options.enable_automated else "--disable-automated") + tc.configure_args.append("--enable-basic" if self.options.enable_basic else "--disable-basic") + tc.configure_args.append("--enable-console" if self.options.enable_console else "--disable-console") + tc.configure_args.append("--disable-curses" if not self.options.with_curses else + "--enable-curses") + + env = tc.environment() + + if is_msvc(self): + automake_info = self.dependencies.build["automake"].conf_info + env.append("CC", f'{unix_path(self, automake_info.get("user.automake:compile-wrapper", check_type=str))} cl -nologo') + env.append("CXX", f'{unix_path(self, automake_info.get("user.automake:compile-wrapper", check_type=str))} cl -nologo') + env.append("AR", f'{unix_path(self, automake_info.get("user.automake:lib-wrapper", check_type=str))} lib') + env.define("LD", "link -nologo") + env.append("NM", "dumpbin -symbols") + env.append("OBJDUMP", ":") + env.append("RANLIB", ":") + env.append("STRIP", ":") + tc.generate(env) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with self._build_context(): - 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.make() + apply_conandata_patches(self) + + # Clean up makefiles from source folder + os.unlink(Path(self.source_folder) / "config.status") + os.unlink(Path(self.source_folder) / "config.log") + os.unlink(Path(self.source_folder) / "Makefile") + + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - autotools.install() - - if self.settings.compiler == "Visual Studio" and self.options.shared: - tools.rename(os.path.join(self.package_folder, "lib", "cunit.dll.lib"), - os.path.join(self.package_folder, "lib", "cunit.lib")) - - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "bin", "share", "man")) - tools.rmdir(os.path.join(self.package_folder, "doc")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) + autotools.install() + + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "cunit.dll.lib"), + os.path.join(self.package_folder, "lib", "cunit.lib")) + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "bin", "share", "man")) + rmdir(self, os.path.join(self.package_folder, "doc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.names["cmake_find_package"] = "CUnit" diff --git a/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch b/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch index f934c96f0e8b0..60ee6889637dd 100644 --- a/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch +++ b/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch @@ -1,22 +1,39 @@ --- configure.in +++ configure.in -@@ -26,7 +26,7 @@ - +@@ -2,6 +2,7 @@ + + AC_INIT(CUnit, 2.1-3) + AM_INIT_AUTOMAKE(CUnit, 2.1-3) ++LT_INIT + + dnl Package version information + PACKAGE=CUnit +@@ -26,7 +27,7 @@ + TOPDIR=`pwd` - + -CFLAGS="$CFLAGS -DRELEASE=@RELEASE@ -Wall -W -pedantic -Wshadow -ansi -I${PWD}/CUnit/Headers -std=c99" +CFLAGS="$CFLAGS -DRELEASE=@RELEASE@ -pedantic -ansi -I${PWD}/CUnit/Headers -std=c99" LDFLAGS="$LDFLAGS -L${PWD}/CUnit/Sources" - + AC_ARG_ENABLE(debug, -@@ -186,13 +186,13 @@ +@@ -158,7 +159,7 @@ + AC_PROG_CC + AC_PROG_INSTALL + AC_PROG_MAKE_SET +-AC_PROG_LIBTOOL ++#AC_PROG_LIBTOOL + + dnl Check for libraries + AC_CHECK_LIB(c, main) +@@ -186,13 +187,13 @@ AC_CHECK_FUNC(calloc, [], [echo calloc not found; exit 1]) AC_CHECK_FUNC(realloc, [], [echo realloc not found; exit 1]) - + -AC_CHECK_FUNC(strcpy, [], [echo strcpy not found; exit 1]) +dnl AC_CHECK_FUNC(strcpy, [], [echo strcpy not found; exit 1]) AC_CHECK_FUNC(strerror, [], [echo strerror not found; exit 1]) - + AC_CHECK_FUNC(fopen, [], [echo fopen not found; exit 1]) AC_CHECK_FUNC(fclose, [], [echo fclose not found; exit 1]) -AC_CHECK_FUNC(fprintf, [], [echo fprintf not found; exit 1]) @@ -24,7 +41,7 @@ +dnl AC_CHECK_FUNC(fprintf, [], [echo fprintf not found; exit 1]) +dnl AC_CHECK_FUNC(snprintf, [], [echo snprintf not found; exit 1]) AC_CHECK_FUNC(setvbuf, [], [echo setvbuf not found; exit 1]) - + AC_CHECK_FUNC(time, [], [echo time not found; exit 1]) --- CUnit/Sources/Makefile.am +++ CUnit/Sources/Makefile.am diff --git a/recipes/cunit/all/patches/0003-fix-copy-docs.patch b/recipes/cunit/all/patches/0003-fix-copy-docs.patch new file mode 100644 index 0000000000000..6dc9a36c9301d --- /dev/null +++ b/recipes/cunit/all/patches/0003-fix-copy-docs.patch @@ -0,0 +1,9 @@ +--- doc/headers/Makefile.am ++++ doc/headers/Makefile.am +@@ -23,5 +23,6 @@ + + copy_headers: + cp -f $(top_srcdir)/CUnit/Headers/*.h . ++ cp -f $(top_builddir)/CUnit/Headers/*.h . + cp -f $(top_srcdir)/CUnit/Sources/Win/Win.h . + diff --git a/recipes/cunit/all/test_package/CMakeLists.txt b/recipes/cunit/all/test_package/CMakeLists.txt index 34af13462f44f..b32c10a586ed8 100644 --- a/recipes/cunit/all/test_package/CMakeLists.txt +++ b/recipes/cunit/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cunit CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} cunit::cunit) diff --git a/recipes/cunit/all/test_package/conanfile.py b/recipes/cunit/all/test_package/conanfile.py index d4128b0450777..7c46f27b018cf 100644 --- a/recipes/cunit/all/test_package/conanfile.py +++ b/recipes/cunit/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "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) @@ -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/cute_headers/all/conanfile.py b/recipes/cute_headers/all/conanfile.py index 2aeb5719c6df9..5845ff0bcc925 100644 --- a/recipes/cute_headers/all/conanfile.py +++ b/recipes/cute_headers/all/conanfile.py @@ -1,39 +1,46 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import get, copy, load, save +from conan.tools.layout import basic_layout import os -import glob + + +required_conan_version = ">=1.52.0" class CuteHeadersConan(ConanFile): name = "cute_headers" description = "Various single-file cross-platform C/C++ headers implementing self-contained libraries." - topics = ("conan", "various", "pure-c") + topics = ("various", "pure-c") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/RandyGaul/cute_headers" license = "Unlicense" + package_type = "header-library" no_copy_source = True def _extract_license(self): - file = os.path.join(self.package_folder, "include/cute_math2d.h") - file_content = tools.load(file) + file = os.path.join(self.package_folder, "include", "cute_math2d.h") + file_content = load(self, file) return file_content[file_content.rfind('/*'):] - @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 = 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( + copy( + self, pattern="*.h", - dst="include", - src=self._source_subfolder, + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, excludes=("examples_cute_*", "test_cute_*") ) - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) def package_id(self): - self.info.header_only() + self.info.clear() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cute_headers/all/test_package/CMakeLists.txt b/recipes/cute_headers/all/test_package/CMakeLists.txt index b9be759ce7016..766b80640f9c1 100644 --- a/recipes/cute_headers/all/test_package/CMakeLists.txt +++ b/recipes/cute_headers/all/test_package/CMakeLists.txt @@ -1,11 +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(cute_headers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries( - ${PROJECT_NAME} - ${CONAN_LIBS} -) +target_link_libraries(${PROJECT_NAME} PRIVATE cute_headers::cute_headers) diff --git a/recipes/cute_headers/all/test_package/conanfile.py b/recipes/cute_headers/all/test_package/conanfile.py index b63178709d69f..9be22ab3d97f8 100644 --- a/recipes/cute_headers/all/test_package/conanfile.py +++ b/recipes/cute_headers/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" + 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,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/cvplot/all/conanfile.py b/recipes/cvplot/all/conanfile.py index 49ceaeafa285e..4984563ed0526 100644 --- a/recipes/cvplot/all/conanfile.py +++ b/recipes/cvplot/all/conanfile.py @@ -1,35 +1,59 @@ -from conans import ConanFile, tools import os -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 CvPlotConan(ConanFile): name = "cvplot" - description = "fast modular opencv plotting library" + description = "Fast modular OpenCV plotting library" license = "MIT" - topics = ("plot", "opencv", "diagram", "plotting") - homepage = "https://github.com/Profactor/cv-plot" url = "https://github.com/conan-io/conan-center-index" - requires = "opencv/4.5.3" + homepage = "https://github.com/Profactor/cv-plot" + topics = ("plot", "opencv", "diagram", "plotting", "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 requirements(self): + self.requires("opencv/4.5.5") + + def package_id(self): + 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(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "CvPlot", "inc")) - - 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="*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "CvPlot", "inc"), + ) + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "CvPlot") + self.cpp_info.set_property("cmake_target_name", "CvPlot::CvPlot") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.defines.append("CVPLOT_HEADER_ONLY") - self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.names["cmake_find_package"] = "CvPlot" self.cpp_info.names["cmake_find_package_multi"] = "CvPlot" diff --git a/recipes/cvplot/all/test_package/CMakeLists.txt b/recipes/cvplot/all/test_package/CMakeLists.txt index b75c35da97dea..209693284dcea 100644 --- a/recipes/cvplot/all/test_package/CMakeLists.txt +++ b/recipes/cvplot/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(CvPlot CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/cvplot/all/test_package/conanfile.py b/recipes/cvplot/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/cvplot/all/test_package/conanfile.py +++ b/recipes/cvplot/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/cvplot/all/test_package/test_package.cpp b/recipes/cvplot/all/test_package/test_package.cpp index 0592129b4a676..da5278d1f8f60 100644 --- a/recipes/cvplot/all/test_package/test_package.cpp +++ b/recipes/cvplot/all/test_package/test_package.cpp @@ -3,7 +3,7 @@ using namespace CvPlot; int main() { - Axes axes = plot(std::vector{ 3, 3, 4, 6, 4, 3 }, "-o"); - cv::Mat mat = axes.render(400, 600); + Axes axes = plot(std::vector{3, 3, 4, 6, 4, 3}, "-o"); + cv::Mat mat = axes.render(400, 600); return 0; } diff --git a/recipes/cxxopts/all/conanfile.py b/recipes/cxxopts/all/conanfile.py index 03ec452dcf0b8..face2572c75dd 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 0000000000000..a399ac1aa2efe --- /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 0000000000000..46c0203bb55c2 --- /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 0000000000000..723b2660aff69 --- /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 0000000000000..4092a05fa5b94 --- /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 0000000000000..46b201f63a878 --- /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 0000000000000..50b7ececfcd17 --- /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 0000000000000..2bc38e32ae1ab --- /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 0000000000000..b4cf37cb3f9e2 --- /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 0000000000000..87e6038632c05 --- /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 0000000000000..19242c4dfa87c --- /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 d4037567cc2c5..8d9fa515082f8 100644 --- a/recipes/cyclonedds/all/conandata.yml +++ b/recipes/cyclonedds/all/conandata.yml @@ -1,8 +1,22 @@ 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" "0.10.2": 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" + patch_type: "conan" "0.10.2": - 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 28044cd38689c..18f0542a85ec8 100644 --- a/recipes/cyclonedds/all/conanfile.py +++ b/recipes/cyclonedds/all/conanfile.py @@ -26,6 +26,7 @@ class CycloneDDSConan(ConanFile): "with_ssl": [True, False], "with_shm" : [True, False], "enable_security" : [True, False], + "enable_discovery" : [True, False], } default_options = { "shared": False, @@ -33,6 +34,7 @@ class CycloneDDSConan(ConanFile): "with_ssl": False, "with_shm": False, "enable_security": False, + "enable_discovery": True, } short_paths = True @@ -51,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): @@ -69,9 +77,9 @@ def layout(self): def requirements(self): if self.options.with_shm: - self.requires("iceoryx/2.0.2") + self.requires("iceoryx/2.0.5") if self.options.with_ssl: - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.options.enable_security and not self.options.shared: @@ -85,20 +93,8 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - def _cmake_new_enough(self, required_version): - try: - import re - from io import StringIO - output = StringIO() - self.run("cmake --version", output=output) - m = re.search(r"cmake version (\d+\.\d+\.\d+)", output.getvalue()) - return Version(m.group(1)) >= required_version - except: - return False - def build_requirements(self): - if not self._cmake_new_enough("3.16"): - self.tool_requires("cmake/3.25.2") + self.tool_requires("cmake/[>=3.16 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -106,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 @@ -117,6 +111,8 @@ def generate(self): tc.variables["ENABLE_SSL"] = self.options.with_ssl tc.variables["ENABLE_SHM"] = self.options.with_shm tc.variables["ENABLE_SECURITY"] = self.options.enable_security + tc.variables["ENABLE_TYPE_DISCOVERY"] = self.options.enable_discovery + tc.variables["ENABLE_TOPIC_DISCOVERY"] = self.options.enable_discovery tc.generate() cd = CMakeDeps(self) @@ -134,16 +130,17 @@ 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") - self.cpp_info.set_property("cmake_target_name", "CycloneDDS::ddsc") + self.cpp_info.set_property("cmake_target_name", "CycloneDDS::CycloneDDS") self.cpp_info.set_property("pkg_config_name", "CycloneDDS") # TODO: back to global scope in conan v2 self.cpp_info.components["CycloneDDS"].libs = ["ddsc"] @@ -163,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" @@ -170,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 f30c0b29578a0..c780bdda5e0ab 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 422a7d5c03da2..913d902444f12 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 0000000000000..74667e344bd06 --- /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 0000000000000..9aceea2e838b4 --- /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 6c8041d964ef5..b770b06071265 100644 --- a/recipes/cyclonedds/config.yml +++ b/recipes/cyclonedds/config.yml @@ -1,3 +1,7 @@ versions: + "0.10.4": + folder: all + "0.10.3": + folder: all "0.10.2": folder: all diff --git a/recipes/cyrus-sasl/all/conandata.yml b/recipes/cyrus-sasl/all/conandata.yml index 0fe894820dcdf..d24e3377974b4 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 53ce502733557..d9623fba3aec4 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 d7a18807b4494..85cdd658d0407 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 88618f4797ed7..7b0ce0b66f5a1 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 daa1ee060995e..f4f5540f11df5 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 e2bd672a9b3d1..c4021d403c55f 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 63e11b22a301b..3913723472269 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 84f49b2850870..f10766e09880a 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/darknet/all/conandata.yml b/recipes/darknet/all/conandata.yml index f7382d7a3ec4c..f0ab72430d98e 100644 --- a/recipes/darknet/all/conandata.yml +++ b/recipes/darknet/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: cci.20180914: - patch_file: "patches/include_conan_flags.patch" - base_path: "source_subfolder" diff --git a/recipes/darknet/all/conanfile.py b/recipes/darknet/all/conanfile.py index 5e49bf67b81ff..11a96d6b05dda 100644 --- a/recipes/darknet/all/conanfile.py +++ b/recipes/darknet/all/conanfile.py @@ -1,32 +1,39 @@ 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.apple import fix_apple_shared_install_name +from conan.tools.build import stdcpp_library +from conan.tools.files import ( + apply_conandata_patches, + chdir, + copy, + export_conandata_patches, + get, + replace_in_file, +) +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout class DarknetConan(ConanFile): name = "darknet" + description = "Darknet is a neural network frameworks written in C" license = "YOLO" url = "https://github.com/conan-io/conan-center-index" homepage = "http://pjreddie.com/darknet/" - description = "Darknet is a neural network frameworks written in C" - topics = ("darknet", "neural network", "deep learning") + topics = ("neural network", "deep learning") settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], "fPIC": [True, False], - "with_opencv": [True, False] + "with_opencv": [True, False], } default_options = { "shared": False, "fPIC": True, "with_opencv": False, } - exports_sources = ['patches/*'] - generators = "pkg_config" - - @property - def _source_subfolder(self): - return "source_subfolder" @property def _lib_to_compile(self): @@ -43,56 +50,87 @@ def _shared_lib_extension(self): return ".so" def _patch_sources(self): - for patch in self.conan_data["patches"].get(self.version, []): - tools.patch(**patch) - tools.replace_in_file( - os.path.join(self._source_subfolder, "Makefile"), + apply_conandata_patches(self) + replace_in_file( + self, + os.path.join(self.source_folder, "Makefile"), "SLIB=libdarknet.so", - "SLIB=libdarknet" + self._shared_lib_extension + f"SLIB=libdarknet{self._shared_lib_extension}", ) - tools.replace_in_file( - os.path.join(self._source_subfolder, "Makefile"), + replace_in_file( + self, + os.path.join(self.source_folder, "Makefile"), "all: obj backup results $(SLIB) $(ALIB) $(EXEC)", - "all: obj backup results " + self._lib_to_compile + f"all: obj backup results {self._lib_to_compile}", ) + def export_sources(self): + export_conandata_patches(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 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 requirements(self): if self.options.with_opencv: + # Requires OpenCV 2.x self.requires("opencv/2.4.13.7") + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("This library 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) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.fpic = self.options.get_safe("fPIC", True) + tc.make_args = ["OPENCV={}".format("1" if self.options.with_opencv else "0")] + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() def build(self): - self._patch_sources() - with tools.chdir(self._source_subfolder): - with tools.environment_append({"PKG_CONFIG_PATH": self.build_folder}): - args = ["OPENCV={}".format("1" if self.options.with_opencv else "0")] - env_build = AutoToolsBuildEnvironment(self) - env_build.fpic = self.options.get_safe("fPIC", True) - env_build.make(args=args) + with chdir(self, self.source_folder): + self._patch_sources() + autotools = Autotools(self) + autotools.make() def package(self): - self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*.so", dst="lib", keep_path=False) - self.copy("*.dylib", dst="lib", keep_path=False) - 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, + "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + for pattern in ["*.so", "*.dylib", "*.a"]: + copy( + self, + pattern, + 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 = ["darknet"] - if self.settings.os == "Linux": + if self.options.with_opencv: + # For https://github.com/pjreddie/darknet/blob/61c9d02ec461e30d55762ec7669d6a1d3c356fb2/include/darknet.h#L757 + self.cpp_info.defines.append("OPENCV=1") + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m", "pthread"] - 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/darknet/all/test_package/CMakeLists.txt b/recipes/darknet/all/test_package/CMakeLists.txt index e651ebaf233a3..7e2c525014053 100644 --- a/recipes/darknet/all/test_package/CMakeLists.txt +++ b/recipes/darknet/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(darknet CONFIG REQUIRED) add_executable(${PROJECT_NAME} example.cpp) diff --git a/recipes/darknet/all/test_package/conanfile.py b/recipes/darknet/all/test_package/conanfile.py index ffafc9bf4fa15..ef5d7042163ec 100644 --- a/recipes/darknet/all/test_package/conanfile.py +++ b/recipes/darknet/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 DarknetTestConan(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) @@ -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/dataframe/all/conandata.yml b/recipes/dataframe/all/conandata.yml index 16ec52d345ce0..8299cf452cbdd 100644 --- a/recipes/dataframe/all/conandata.yml +++ b/recipes/dataframe/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.3.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/v2.3.0.tar.gz" + sha256: "d671a3d47c2ef250cadddbae545b1b7bee51f9411836b627b7860e187c868a72" + "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" "2.0.0": url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/2.0.0.tar.gz" sha256: "df46ab60153f75ef0a1ab269e6b107ec34fdc467993c3984029d7deb5e0fab6c" @@ -17,21 +26,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 95fdd9bafb34a..f523ba86724db 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 = { @@ -51,17 +50,38 @@ class DataFrameConan(ConanFile): @property def _min_cppstd(self): - return "17" + if Version(self.version) < "2.1.0": + return "17" + elif Version(self.version) <= "2.2.0": + return "20" + else: + return "23" @property def _minimum_compilers_version(self): return { - "Visual Studio": "15", - "msvc": "191", - "gcc": "7", - "clang": "6", - "apple-clang": "10.0", - } + "17": { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "6", + "apple-clang": "10.0", + }, + "20": { + "Visual Studio": "16", + "msvc": "192", + "gcc": "11", + "clang": "12", + "apple-clang": "13", + }, + "23": { + "Visual Studio": "17", + "msvc": "192", + "gcc": "13", + "clang": "15", + "apple-clang": "15", + }, + }.get(self._min_cppstd, {}) def export_sources(self): export_conandata_patches(self) @@ -83,13 +103,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 4c82a6b1a8874..f0af8e717acbf 100644 --- a/recipes/dataframe/all/test_package/CMakeLists.txt +++ b/recipes/dataframe/all/test_package/CMakeLists.txt @@ -1,8 +1,15 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.12) project(test_package LANGUAGES CXX) find_package(DataFrame REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE DataFrame::DataFrame) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if (DataFrame_VERSION VERSION_GREATER_EQUAL "2.1.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() +if (DataFrame_VERSION VERSION_GREATER_EQUAL "2.3.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23) +endif() diff --git a/recipes/dataframe/config.yml b/recipes/dataframe/config.yml index db87f49d71721..aca71224e11e1 100644 --- a/recipes/dataframe/config.yml +++ b/recipes/dataframe/config.yml @@ -1,4 +1,10 @@ versions: + "2.3.0": + folder: all + "2.2.0": + folder: all + "2.1.0": + folder: all "2.0.0": folder: all "1.22.0": @@ -11,13 +17,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 a42b06fc8f951..315ca73f8ae1f 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 960fc25c0f85a..a478887dc4fcc 100644 --- a/recipes/dav1d/all/conandata.yml +++ b/recipes/dav1d/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.3.0": + url: "http://ftp.videolan.org/pub/videolan/dav1d/1.3.0/dav1d-1.3.0.tar.xz" + sha256: "6d8be2741c505c47f8f1ced3c9cc427759243436553d01d1acce201f87b39e71" + "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 8a1651ceed708..5882f930a7dbd 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 1807dabd0bac4..21233fe470f83 100644 --- a/recipes/dav1d/config.yml +++ b/recipes/dav1d/config.yml @@ -1,4 +1,8 @@ versions: + "1.3.0": + folder: "all" + "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 235989d757184..e2ae0afea2244 100644 --- a/recipes/daw_header_libraries/all/conandata.yml +++ b/recipes/daw_header_libraries/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "2.98.5": + url: "https://github.com/beached/header_libraries/archive/v2.98.5.tar.gz" + sha256: "2d548a6f7a860917e2f743ee75e82733cbf0d3720b7296da023c5a17a9010c9a" + "2.97.0": + url: "https://github.com/beached/header_libraries/archive/v2.97.0.tar.gz" + sha256: "993cda7ff505e80f54322ce544b8a7b02bfef9673d980e43dafcbd3a9a3228d3" + "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" "2.92.0": url: "https://github.com/beached/header_libraries/archive/v2.92.0.tar.gz" sha256: "96835f0ff4d3082a38b4ef4c14653c88e193cd26a08cd406fdbfadcfd654d136" @@ -20,18 +35,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 622972bcce45d..a97facd0bf9ff 100644 --- a/recipes/daw_header_libraries/config.yml +++ b/recipes/daw_header_libraries/config.yml @@ -1,4 +1,14 @@ versions: + "2.98.5": + folder: all + "2.97.0": + folder: all + "2.96.1": + folder: all + "2.95.0": + folder: all + "2.93.1": + folder: all "2.92.0": folder: all "2.88.0": @@ -13,13 +23,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 34917b7868c4b..3262aaa6ca666 100644 --- a/recipes/daw_json_link/all/conandata.yml +++ b/recipes/daw_json_link/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "3.17.2": + url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.17.2.tar.gz" + sha256: "6f74d386c842d83f32798f4e4cf812da9872cf4fe3565393443fc3be1a06a8ae" "3.17.1": url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.17.1.tar.gz" sha256: "a29c6bcb7856ac0217fa36873af007f619fd467097488746f29a6a332616a829" @@ -20,24 +32,3 @@ sources: "3.11.1": url: "https://github.com/beached/daw_json_link/archive/v3.11.1.tar.gz" sha256: "d2b5cb221892c6b1ecd30fd2e45d168d6b378e97d134e75349703104c5882309" - "3.10.0": - url: "https://github.com/beached/daw_json_link/archive/v3.10.0.tar.gz" - sha256: "8a2e635e695d57eb147815f516c56d48360b103fbefc06f720607e8cf93c2937" - "3.8.1": - url: "https://github.com/beached/daw_json_link/archive/v3.8.1.tar.gz" - sha256: "b0f20310d1e295babaca62b83488b22f438cc4aacf8a7a47dcc92ad7386baaec" - "3.5.0": - url: "https://github.com/beached/daw_json_link/archive/v3.5.0.tar.gz" - sha256: "d1643725711b4564fb166f1f4bac0acb386fbbdb761f822c99a4ef585d8bdd71" - "3.4.1": - url: "https://github.com/beached/daw_json_link/archive/v3.4.1.tar.gz" - sha256: "3f57ccc936a9999b5c8c5684b2b3b8b989f50ef6e1ea8dce7bc311d1c77195ac" - "3.3.0": - url: "https://github.com/beached/daw_json_link/archive/v3.3.0.tar.gz" - sha256: "fd806245fc8b944e613b29da5ef0570c0e6881b6049a7bf65eb0285c58848f40" - "3.1.1": - url: "https://github.com/beached/daw_json_link/archive/v3.1.1.tar.gz" - sha256: "7d340886898b2ea3c595f0f871c81e4c7382fe53d22d80edc5629768e49fa634" - "2.15.3": - url: "https://github.com/beached/daw_json_link/archive/v2.15.3.tar.gz" - sha256: "ec0457a5682a76c5aec709f2d6959ef7bafa0b54c5e7740f911d97991188ee84" diff --git a/recipes/daw_json_link/all/conanfile.py b/recipes/daw_json_link/all/conanfile.py index b573c7276e333..a22aa6b41c06b 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.92.0") + 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 b6d705def5e3f..cd93a25c55255 100644 --- a/recipes/daw_json_link/config.yml +++ b/recipes/daw_json_link/config.yml @@ -1,4 +1,12 @@ versions: + "3.23.0": + folder: "all" + "3.20.1": + folder: "all" + "3.19.0": + folder: "all" + "3.17.2": + folder: "all" "3.17.1": folder: "all" "3.16.0": @@ -13,17 +21,3 @@ versions: folder: "all" "3.11.1": folder: "all" - "3.10.0": - folder: "all" - "3.8.1": - folder: "all" - "3.5.0": - folder: "all" - "3.4.1": - folder: "all" - "3.3.0": - folder: "all" - "3.1.1": - folder: "all" - "2.15.3": - folder: "all" diff --git a/recipes/daw_utf_range/all/conanfile.py b/recipes/daw_utf_range/all/conanfile.py index f289799db1a13..23fff04d5723f 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.92.0") + self.requires("daw_header_libraries/2.96.1") def package_id(self): self.info.clear() diff --git a/recipes/dbcppp/all/conanfile.py b/recipes/dbcppp/all/conanfile.py index 3a0d9d2ce43eb..2c148eca60aad 100644 --- a/recipes/dbcppp/all/conanfile.py +++ b/recipes/dbcppp/all/conanfile.py @@ -1,6 +1,6 @@ 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.microsoft import check_min_vs, is_msvc from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir from conan.tools.build import check_min_cppstd from conan.tools.scm import Version @@ -16,14 +16,13 @@ class DBCpppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/xR3b0rn/dbcppp" topics = ("can", "dbc", "network") + package_type = "static-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, } @@ -48,12 +47,11 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.shared: + if self.options.get_safe("shared"): self.options.rm_safe("fPIC") - self.options["boost"].header_only = True def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_tools: @@ -61,9 +59,6 @@ def requirements(self): self.requires("boost/1.80.0") def validate(self): - if self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} does not currently support {self.ref}:shared=True") - if self.info.settings.compiler.cppstd: check_min_cppstd(self, self._minimum_cpp_standard) check_min_vs(self, 191) @@ -75,12 +70,10 @@ def validate(self): ) def source(self): - get(self, **self.conan_data["sources"][str(self.version)],destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][str(self.version)], strip_root=True) def generate(self): tc = CMakeToolchain(self) - if is_msvc(self): - tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) tc.variables["build_tests"] = False tc.variables["build_examples"] = False tc.variables["build_tools"] = self.options.with_tools @@ -108,4 +101,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["libdbcppp"] - self.env_info.path.append(os.path.join(self.package_folder, "bin")) + if self.options.with_tools: + self.env_info.path.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/dbg-macro/all/conandata.yml b/recipes/dbg-macro/all/conandata.yml index 695393e722d3f..3c855c0c75125 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 49d4fa65df8ac..c4b00757159da 100644 --- a/recipes/dbg-macro/all/conanfile.py +++ b/recipes/dbg-macro/all/conanfile.py @@ -1,43 +1,58 @@ 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 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 = ("conan", "debugging", "macro", "pretty-printing", "header-only") - settings = ("compiler", ) + topics = ("debugging", "macro", "pretty-printing", "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 source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + @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 configure(self): - minimal_cpp_standard = "11" - if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, minimal_cpp_standard) + def validate(self): + if self.settings.compiler.get_safe('cppstd'): + check_min_cppstd(self, self._min_cppstd) - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + 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( - "dbg-mcro can't be used by {0} {1}".format( - self.settings.compiler, - self.settings.compiler.version - ) + 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("dbg.h", dst="include", src=self._source_subfolder) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + 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.header_only() + 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 33ae887aa6aea..535b1e583d6c5 100644 --- a/recipes/dbg-macro/all/test_package/CMakeLists.txt +++ b/recipes/dbg-macro/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(dbg-macro 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) +target_link_libraries(${PROJECT_NAME} PRIVATE dbg-macro::dbg-macro) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/dbg-macro/all/test_package/conanfile.py b/recipes/dbg-macro/all/test_package/conanfile.py index a1606e05e0271..2ee2f747a7393 100644 --- a/recipes/dbg-macro/all/test_package/conanfile.py +++ b/recipes/dbg-macro/all/test_package/conanfile.py @@ -1,18 +1,26 @@ 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 TestPackageConan(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 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): - tools.mkdir("logs/") - 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/dbg-macro/all/test_v1_package/CMakeLists.txt b/recipes/dbg-macro/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /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 0000000000000..e9e25c6e641af --- /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 da269653d6e6b..e820923f0c236 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 20ee5e48052c8..04a0982deff4b 100644 --- a/recipes/dbus/1.x.x/conandata.yml +++ b/recipes/dbus/1.x.x/conandata.yml @@ -1,16 +1,16 @@ 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" "1.15.2": url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.15.2.tar.xz" sha256: "7e640803084af59f5e477b7ded11fd888b5380910a895c51ca3aedd63c0626ca" "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" @@ -22,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 00b0dc44a35ef..c20fd3f03b189 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -1,9 +1,8 @@ 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, rm, rmdir, save +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 from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain @@ -21,12 +20,14 @@ 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 = { - "system_socket": ["ANY"], - "system_pid_file": ["ANY"], + "shared": [True, False], + "fPIC": [True, False], + "system_socket": [None, "ANY"], + "system_pid_file": [None, "ANY"], "with_x11": [True, False], "with_glib": [True, False], "with_systemd": [True, False], @@ -34,8 +35,10 @@ class DbusConan(ConanFile): "session_socket_dir": ["ANY"], } default_options = { - "system_socket": "", - "system_pid_file": "", + "shared": False, + "fPIC": True, + "system_socket": None, + "system_pid_file": None, "with_x11": False, "with_glib": False, "with_systemd": False, @@ -43,54 +46,45 @@ 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") if self.options.with_glib: - self.requires("glib/2.76.0") + self.requires("glib/2.77.0") if self.options.get_safe("with_systemd"): - self.requires("libsystemd/252.4") + self.requires("libsystemd/253.6") if self.options.with_selinux: self.requires("libselinux/3.3") if self.options.get_safe("with_x11"): 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.0.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.3") + 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,73 +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["session_socket_dir"] = str(self.options.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 - - # 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.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: - 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")) @@ -176,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( @@ -215,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 2d00f57d33527..0000000000000 --- 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 7c60bf52d5ec2..0000000000000 --- 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 cc866e2f4cf3b..a6d5fb2e5d5f7 100644 --- a/recipes/dbus/config.yml +++ b/recipes/dbus/config.yml @@ -1,9 +1,9 @@ versions: - "1.15.2": + "1.15.8": folder: 1.x.x - "1.15.0": + "1.15.6": folder: 1.x.x - "1.14.0": + "1.15.2": folder: 1.x.x - "1.12.20": + "1.15.0": folder: 1.x.x diff --git a/recipes/dcmtk/all/CMakeLists.txt b/recipes/dcmtk/all/CMakeLists.txt deleted file mode 100644 index 56b7606e716f9..0000000000000 --- 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 7e3e0a0cc6e01..7ae433b2e0c08 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 286fb28a07048..6980bbc99c18d 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 0e7d266d097c2..0000000000000 --- 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 d566a50607ec7..0000000000000 --- 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 0000000000000..264a486b31bc6 --- /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 0000000000000..a3f1d5ac2c44b --- /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 b10d0378042ba..0000000000000 --- 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 b3dafcdddcb7d..4e506092ed288 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 c5fa77486cfa5..0a6bc68712d90 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 0000000000000..be00a8c7f57c7 --- /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 0000000000000..38f4483872d47 --- /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 81e7bce3c7d99..8e28175b23370 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/debug_assert/all/conanfile.py b/recipes/debug_assert/all/conanfile.py index 7c5ec7a1005be..6ffe03cd97e25 100644 --- a/recipes/debug_assert/all/conanfile.py +++ b/recipes/debug_assert/all/conanfile.py @@ -1,35 +1,50 @@ -from conans import ConanFile, tools import os -class DebugAssert(ConanFile): - name = 'debug_assert' - description = 'Simple, flexible and modular assertion macro' - url = 'https://github.com/conan-io/conan-center-index' - homepage = 'http://foonathan.net/blog/2016/09/16/assertions.html' - license = 'Zlib' - topics = 'conan', 'assert', 'debugging', 'utilities' +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" - settings = 'compiler' +class DebugAssert(ConanFile): + name = "debug_assert" + description = "Simple, flexible and modular assertion macro" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://foonathan.net/blog/2016/09/16/assertions.html" + topics = ("assert", "debugging", "utilities", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _source_subfolder = 'source_subfolder' @property - def _repo_folder(self): - return os.path.join(self.source_folder, self._source_subfolder) + def _min_cppstd(self): + return 11 - 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 layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() - def configure(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, '11') + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) - def package(self): - self.copy("*LICENSE", dst="licenses", keep_path=False) - self.copy("debug_assert.hpp", src=self._repo_folder, dst='include/') + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def package_id(self): - self.info.header_only() + def package(self): + copy(self, "*LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, keep_path=False) + copy(self, "debug_assert.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/debug_assert/all/test_package/CMakeLists.txt b/recipes/debug_assert/all/test_package/CMakeLists.txt index 33ae887aa6aea..57219dd9b2fc5 100644 --- a/recipes/debug_assert/all/test_package/CMakeLists.txt +++ b/recipes/debug_assert/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(debug_assert REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE debug_assert::debug_assert) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/debug_assert/all/test_package/conanfile.py b/recipes/debug_assert/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/debug_assert/all/test_package/conanfile.py +++ b/recipes/debug_assert/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" + 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/decimal_for_cpp/all/conanfile.py b/recipes/decimal_for_cpp/all/conanfile.py index 3e6a2b2a8d7a3..52caed052e558 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 d120a992c06a6..0a6bc68712d90 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 99324bd86f533..be00a8c7f57c7 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 3760e5bb68e07..29a4d2480e3aa 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 00c3587be1a63..c3b92714405e8 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 f735734fbcfa9..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..f64055b093b4d --- /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 0000000000000..b54b3a369232f --- /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 0000000000000..f0b08ddbf4d87 --- /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 0000000000000..9164a4171506f --- /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 0000000000000..2e6b30b92c133 --- /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 d0a389940b0bf..1b6ae8a07224a 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 0c05a6fd77b19..5ae9db2bb11c9 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 2b8703a181ae6..d6cf90deef7f6 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 4e6b7c3b6cba8..0b2e88f45d6b3 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 add2424f12959..ef5d7042163ec 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 e96fd3f5f3d9a..7567264b2867b 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 0cb36a4c86d32..d1a25da138f0d 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 08643cd4c3e75..00fec6778e9bc 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 6d72096230585..7bea0de65a209 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 6b89b27839454..9dd543efc7ceb 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 43240d491944c..beb314f8f339d 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 0000000000000..91630d79f4abb --- /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 0000000000000..43240d491944c --- /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 0000000000000..ef5dd3970cc87 --- /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 0000000000000..93d025c258e68 --- /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 0000000000000..0fc7fa3dfb5a0 --- /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 0000000000000..32f908420470d --- /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 0000000000000..69d2647abc971 --- /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 0000000000000..8457ca9a4a8cd --- /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 36b7cd93cdfba..0000000000000 --- 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/conandata.yml b/recipes/di/all/conandata.yml index 0dd2a459aba98..36983ad396050 100644 --- a/recipes/di/all/conandata.yml +++ b/recipes/di/all/conandata.yml @@ -5,3 +5,6 @@ sources: "1.2.0": url: https://github.com/boost-ext/di/archive/v1.2.0.tar.gz sha256: 47ed660a1198f61394d30890cbb9a68b0fd6d17f41283e1de0036d10c1d24a55 + "1.3.0": + url: "https://github.com/boost-ext/di/archive/v1.3.0.tar.gz" + sha256: "853e02ade9bf39f2863b470350c3ef55caffc3090d7d9a503724ff480c8d7eff" diff --git a/recipes/di/all/conanfile.py b/recipes/di/all/conanfile.py index 5ccda35c324e5..25630735095f5 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 44d785353d02d..4ead030531af2 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 8d63f059b4cdc..8d52b7021efe1 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 0000000000000..91630d79f4abb --- /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 0000000000000..da134b42a75e3 --- /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/di/config.yml b/recipes/di/config.yml index 246aedabf295f..1ff0ab25aeeea 100644 --- a/recipes/di/config.yml +++ b/recipes/di/config.yml @@ -3,3 +3,5 @@ versions: folder: all "1.2.0": folder: all + "1.3.0": + folder: all diff --git a/recipes/dice-template-library/all/CMakeLists.txt b/recipes/dice-template-library/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/dice-template-library/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/dice-template-library/all/conandata.yml b/recipes/dice-template-library/all/conandata.yml index a56456e70c621..59191b2c39484 100644 --- a/recipes/dice-template-library/all/conandata.yml +++ b/recipes/dice-template-library/all/conandata.yml @@ -1,10 +1,19 @@ sources: - "0.1.0": - url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.1.0.tar.gz" - sha256: "1d682283c4a54c4495fc65caa6f9a7674739156ce851227980430052120b2c29" - "0.2.0": - url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.2.0.tar.gz" - sha256: "0f981aeb5604eb305a190d3aef6625032bbb2a34a0bcd17f17ae0cef19fac384" + "1.2.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.2.0.tar.gz" + sha256: "9b21793e158af3ee81ceec827a1a43a87e309e2f7bf0be8ace0f538a95f4865a" + "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: "d0c75ec4861e2480dc7d6533125f9c2dfb3574fc2cffd15c66665b1cdfa66561" "0.3.0": url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.3.0.tar.gz" sha256: "2c02278f86c7b5fe1c684f5126f30529952a03784fa7c883cc4fd44965b3c33e" + "0.2.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.2.0.tar.gz" + sha256: "0f981aeb5604eb305a190d3aef6625032bbb2a34a0bcd17f17ae0cef19fac384" + "0.1.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.1.0.tar.gz" + sha256: "1d682283c4a54c4495fc65caa6f9a7674739156ce851227980430052120b2c29" diff --git a/recipes/dice-template-library/all/conanfile.py b/recipes/dice-template-library/all/conanfile.py index d7cce02ca9aa4..9b90b9971293f 100644 --- a/recipes/dice-template-library/all/conanfile.py +++ b/recipes/dice-template-library/all/conanfile.py @@ -1,23 +1,32 @@ 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.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 DiceTemplateLibrary(ConanFile): name = "dice-template-library" - description = "This template library is a collection of handy template-oriented code that we, the Data Science Group at UPB, found pretty handy." - homepage = "https://dice-research.org/" - url = "https://github.com/conan-io/conan-center-index" + description = ("This template library is a collection of handy template-oriented code that we, " + "the Data Science Group at UPB, found pretty handy.") license = "MIT" - topics = ("template", "template-library", "compile-time", "switch", "integral-tuple") - settings = "build_type", "compiler", "os", "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dice-group/dice-template-library/" + topics = ("template", "template-library", "compile-time", "switch", "integral-tuple", "header-only") + + 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): @@ -26,44 +35,46 @@ def _compilers_minimum_version(self): "clang": "12", } + 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._min_cppstd) if self.settings.compiler == "apple-clang": raise ConanInvalidConfiguration("apple-clang is not supported because a full concept implementation is needed") - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("MSVC is not supported because a full concept implementation is needed") - 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: - self.output.warn("{} {} requires C++20. Your compiler is unknown. Assuming it supports C++20.".format(self.name, self.version)) - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("{} {} requires C++20, which your compiler does not support.".format(self.name, self.version)) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - @property - def _source_subfolder(self): - return "source_subfolder" + 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], 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")) - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - - 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, "COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + 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_target_name", self.name) - self.cpp_info.set_property("cmake_target_aliases", ["{0}::{0}".format(self.name)]) + self.cpp_info.set_property("cmake_target_aliases", [f"{self.name}::{self.name}"]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = self.name self.cpp_info.names["cmake_find_package_multi"] = self.name diff --git a/recipes/dice-template-library/all/test_package/CMakeLists.txt b/recipes/dice-template-library/all/test_package/CMakeLists.txt index 6fcf6dde0f94e..554ae3cf16e97 100644 --- a/recipes/dice-template-library/all/test_package/CMakeLists.txt +++ b/recipes/dice-template-library/all/test_package/CMakeLists.txt @@ -1,12 +1,12 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED True) +find_package(dice-template-library REQUIRED CONFIG) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(dice-template-library REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE dice-template-library::dice-template-library) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +if(dice-template-library_VERSION VERSION_GREATER_EQUAL "1.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE DICE_TEMPLATE_LIBRARY_1_0_0_LATER) +endif() diff --git a/recipes/dice-template-library/all/test_package/conanfile.py b/recipes/dice-template-library/all/test_package/conanfile.py index 9d8f35201d56c..fae501d0afb9e 100644 --- a/recipes/dice-template-library/all/test_package/conanfile.py +++ b/recipes/dice-template-library/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", "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/dice-template-library/all/test_package/test_package.cpp b/recipes/dice-template-library/all/test_package/test_package.cpp index 49e49454d63d0..0b8175abb07cc 100644 --- a/recipes/dice-template-library/all/test_package/test_package.cpp +++ b/recipes/dice-template-library/all/test_package/test_package.cpp @@ -1,11 +1,41 @@ -#include - #include #include -template struct Wrapper { static constexpr int i = N; }; +#include + +#ifdef DICE_TEMPLATE_LIBRARY_1_0_0_LATER +template +struct int_array : std::array { +private: + template + int_array(int value, std::index_sequence) : std::array{((void) IDs, value)...} {} + +public: + int_array() = default; + int_array(int value) : int_array(value, std::make_index_sequence{}) {} +}; + +template +std::ostream &operator<<(std::ostream &os, int_array const &arr) { + if (N == 0) { return os << "0: []"; } + os << N << ": ["; + for (std::size_t i = 0; i < N - 1; ++i) { os << arr[i] << ", "; } + return os << arr[N - 1] << ']'; +} + +int main() { + dice::template_library::integral_template_tuple<5UL, 8, int_array> itt; + std::cout << " " << itt.template get<5>() << '\n'; +} + +#else + +template struct Wrapper { + static constexpr int i = N; +}; int main() { dice::template_library::integral_template_tuple tup; std::cout << std::boolalpha << "tup.get<3>().i == 3: " << (tup.get<3>().i == 3) << std::endl; } +#endif diff --git a/recipes/dice-template-library/all/test_v1_package/CMakeLists.txt b/recipes/dice-template-library/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/dice-template-library/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/dice-template-library/all/test_v1_package/conanfile.py b/recipes/dice-template-library/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fd66d89b7cd91 --- /dev/null +++ b/recipes/dice-template-library/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", "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/dice-template-library/config.yml b/recipes/dice-template-library/config.yml index b657866f6cca6..569143d81f56c 100644 --- a/recipes/dice-template-library/config.yml +++ b/recipes/dice-template-library/config.yml @@ -1,7 +1,13 @@ versions: - "0.1.0": + "1.2.0": folder: all - "0.2.0": + "1.1.0": + folder: all + "1.0.0": folder: all "0.3.0": folder: all + "0.2.0": + folder: all + "0.1.0": + folder: all diff --git a/recipes/dime/all/CMakeLists.txt b/recipes/dime/all/CMakeLists.txt deleted file mode 100644 index 8977c3f43d6f8..0000000000000 --- 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 4c72fb275c245..a157a6f7cfc1a 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 78a1ddc2ab6be..419ecb0dafce7 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 17d1e9ed261a6..f8b1e56816775 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 0000000000000..91630d79f4abb --- /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 0000000000000..c1e0ae2f456f0 --- /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 bb980e8f92249..f15c0b39a2b26 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 4f42eddc66a52..e71fc156ca323 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 196188113685c..888739db919db 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 b88a6525524a6..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..a9a22676d134f --- /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 0000000000000..6289c24e10856 --- /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 0000000000000..773848c7bfa5b --- /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 0000000000000..5aab0703e7a4e --- /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 0000000000000..76e32d2ca901b --- /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 0000000000000..274bb2436bb72 --- /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 0000000000000..15678ab870488 --- /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 41d2c31a73c7a..30637c5892d6d 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 6086eb1e0524d..bb0674fda16d8 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 f0faa524fc522..3079ff3808154 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 ae2c62ed78bb5..f6319f3914356 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 456428a9a8670..7d899a138c0dd 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 0000000000000..456428a9a8670 --- /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 47d0ee6875d8a..c523a45caabe7 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 0afabb3cbe2e0..0000000000000 --- 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 d35c553da9ba8..10c1b916311e1 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 61920459f5086..ef96684a7eec4 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 0000000000000..03996b5c26511 --- /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 6c1d84c7e3d82..b118a50a53af8 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 ed8aa8b7e0ebb..ef5d7042163ec 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 9228c8f56407e..acdc2e577622c 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 0000000000000..91630d79f4abb --- /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 0000000000000..c534d392ac09f --- /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 0afabb3cbe2e0..0000000000000 --- 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 dea5fe156fcc1..fae655bf2e6d5 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 97c05458fb360..0957b9e7315cf 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 33ae887aa6aea..67f60b7a2aed7 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 ed8aa8b7e0ebb..ef5d7042163ec 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 9228c8f56407e..acdc2e577622c 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 0000000000000..91630d79f4abb --- /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 0000000000000..c534d392ac09f --- /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 1c22f04937945..0000000000000 --- 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 8896193f464de..845293d979b05 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 a15a2fc95a7d5..bad5b166dc9bf 100644 --- a/recipes/dlib/all/conanfile.py +++ b/recipes/dlib/all/conanfile.py @@ -1,10 +1,14 @@ +from conan import ConanFile +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 conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.45.0" + +required_conan_version = ">=1.53.0" class DlibConan(ConanFile): @@ -14,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], @@ -43,151 +47,166 @@ 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): - return tools.Version(self.version) >= "19.24" + return Version(self.version) >= "19.24" 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: self.requires("giflib/5.2.1") 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") if self.options.get_safe("with_webp"): - self.requires("libwebp/1.2.2") + self.requires("libwebp/1.3.2") if self.options.with_sqlite3: - self.requires("sqlite3/3.38.5") + self.requires("sqlite3/3.44.2") if self.options.with_openblas: - self.requires("openblas/0.3.17") + 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): - 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): - 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"), os.path.join("include", "dlib", "cmake_utils"), os.path.join("include", "dlib", "external", "pybind11", "tools") ]: - tools.rmdir(os.path.join(self.package_folder, dir_to_remove)) + 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 50caaa372ec83..a2e5f6c5bb3a5 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 38f4483872d47..ef5d7042163ec 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 0000000000000..be00a8c7f57c7 --- /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 0000000000000..e0660e0801b96 --- /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 4d03ed4f4b36d..8c827a6db181e 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 0745cc959331b..f91d97fba0892 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 b6735dc89d517..32fdd824d1e93 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 7b30ce53b0060..e3bd611aea91d 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 0000000000000..39ee763500256 --- /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 0000000000000..9bd67ebc094cd --- /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 0000000000000..c32eb98953039 --- /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 0000000000000..6a3bb24247325 --- /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 0000000000000..699ac1e93addc --- /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 0000000000000..c8e1489aa5a64 --- /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 f0e28d12efb4d..0000000000000 --- 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 0bcb6db477b62..17e0d51d2d0e2 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 4caefdf4a378f..0000000000000 --- 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 d659dafd309f3..0000000000000 --- 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/dr_libs/all/conandata.yml b/recipes/dr_libs/all/conandata.yml new file mode 100644 index 0000000000000..3781cb3dd93e8 --- /dev/null +++ b/recipes/dr_libs/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230529": + url: "https://github.com/mackron/dr_libs/archive/dbbd08d81fd2b084c5ae931531871d0c5fd83b87.tar.gz" + sha256: "9e8d488092c9a0a6b08d9aafc631b1c8d75e707bc10a56a5f4bb1709213702c1" diff --git a/recipes/dr_libs/all/conanfile.py b/recipes/dr_libs/all/conanfile.py new file mode 100644 index 0000000000000..a0572bd8f2cdd --- /dev/null +++ b/recipes/dr_libs/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.tools.files import get, copy +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 +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.52.0" + + +class DrLibsConan(ConanFile): + name = "dr_libs" + description = "Public domain, single file audio decoding libraries for C and C++." + license = ("Unlicense", "MIT-0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mackron/dr_libs" + topics = ("audio", "encoding", "header-only") + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + package_type = "header-library" + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "4.7", + "clang": "3.4", + "apple-clang": "6", + } + + def validate(self): + if self.settings.get_safe("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." + ) + + 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, 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=self.source_folder, + excludes=("old/*", "wip/*", "tests/*") + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/dr_libs/all/test_package/CMakeLists.txt b/recipes/dr_libs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ebee798816d9d --- /dev/null +++ b/recipes/dr_libs/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_DrLibs LANGUAGES CXX) +find_package(dr_libs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dr_libs::dr_libs) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/dr_libs/all/test_package/conanfile.py b/recipes/dr_libs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..70d86ba6525a6 --- /dev/null +++ b/recipes/dr_libs/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 TestDrLibsConan(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_DrLibs") + self.run(bin_path, env="conanrun") diff --git a/recipes/dr_libs/all/test_package/test_package.cpp b/recipes/dr_libs/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..eca29117d03db --- /dev/null +++ b/recipes/dr_libs/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#define DR_WAV_IMPLEMENTATION +#include "dr_wav.h" +#include +#include +#include + +#define BUFFER_SIZE 255 + +int main() { + srand(time(NULL)); + + // Create fake PCM data + std::vector buffer(BUFFER_SIZE); + for (size_t i = 0; i < BUFFER_SIZE; i++) + buffer[i] = rand() % std::numeric_limits::max(); + + // Convert it to 32-bit floating point + std::vector asFloat(buffer.size()); + drwav_s16_to_f32(asFloat.data(), buffer.data(), buffer.size()); + + // If we get here with no issues, then it's a success + std::cout << "Test success!" << std::endl; + return DRWAV_SUCCESS; +} diff --git a/recipes/dr_libs/config.yml b/recipes/dr_libs/config.yml new file mode 100644 index 0000000000000..612a58a0b962e --- /dev/null +++ b/recipes/dr_libs/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230529": + folder: all diff --git a/recipes/drflac/all/conandata.yml b/recipes/drflac/all/conandata.yml index 4b8f26778e5b0..a2e60990c6f30 100644 --- a/recipes/drflac/all/conandata.yml +++ b/recipes/drflac/all/conandata.yml @@ -1,9 +1,11 @@ sources: # NOTE: https://github.com/mackron/dr_libs/blob/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb/dr_flac.h#L3 + "0.12.42": + url: "https://github.com/mackron/dr_libs/archive/a4b73d3d423e1cea0652b76d0806e7620337a40f.zip" + sha256: "89729a85f092a81eb6e646c1580525c7738c4780bc59890c908b9582e8e9312b" "0.12.39": - url: https://github.com/mackron/dr_libs/archive/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb.zip + url: "https://github.com/mackron/dr_libs/archive/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb.zip" sha256: "077d6b29a78da5132065fcc9b44ca50e7e168b94250f2c25614101d3f808bcc1" - # NOTE: https://github.com/mackron/dr_libs/blob/089deaa62268e6dacf2026754b1b228e54eb3993/dr_flac.h#L3 "0.12.38": - url: https://github.com/mackron/dr_libs/archive/089deaa62268e6dacf2026754b1b228e54eb3993.zip + url: "https://github.com/mackron/dr_libs/archive/089deaa62268e6dacf2026754b1b228e54eb3993.zip" sha256: "1b9fa02c56c2b42c99dd070c7dc3d4e8dee6a4e49139055e7f79e21aa88070d7" diff --git a/recipes/drflac/config.yml b/recipes/drflac/config.yml index f7ff0941f9f1b..75c09924cb231 100644 --- a/recipes/drflac/config.yml +++ b/recipes/drflac/config.yml @@ -1,4 +1,6 @@ versions: + "0.12.42": + folder: all "0.12.39": folder: all "0.12.38": diff --git a/recipes/drmp3/all/conandata.yml b/recipes/drmp3/all/conandata.yml index a26d9e9dbb871..58d5499fc9714 100644 --- a/recipes/drmp3/all/conandata.yml +++ b/recipes/drmp3/all/conandata.yml @@ -1,9 +1,11 @@ sources: # NOTE: https://github.com/mackron/dr_libs/blob/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb/dr_mp3.h#L3 + "0.6.38": + url: "https://github.com/mackron/dr_libs/archive/01d23df76776faccee3bc456f685900dcc273b4c.zip" + sha256: "fe82eac7a30c01679ddfdf1d51d1829d72a78b6ec236c47eb03abc089a4457ab" "0.6.34": - url: https://github.com/mackron/dr_libs/archive/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb.zip + url: "https://github.com/mackron/dr_libs/archive/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb.zip" sha256: "077d6b29a78da5132065fcc9b44ca50e7e168b94250f2c25614101d3f808bcc1" - # NOTE: https://github.com/mackron/dr_libs/blob/9497270f581f43e6b795ce5d98d8764861fb6a50/dr_mp3.h#L3 "0.6.32": - url: https://github.com/mackron/dr_libs/archive/9497270f581f43e6b795ce5d98d8764861fb6a50.zip + url: "https://github.com/mackron/dr_libs/archive/9497270f581f43e6b795ce5d98d8764861fb6a50.zip" sha256: "572b59ec9719cf8f4938f982bc1f2e52689a3fbf6cceb4f27478942d7e35456b" diff --git a/recipes/drmp3/all/conanfile.py b/recipes/drmp3/all/conanfile.py index 5ff9719fea314..4e596641bffba 100644 --- a/recipes/drmp3/all/conanfile.py +++ b/recipes/drmp3/all/conanfile.py @@ -9,7 +9,7 @@ class Drmp3Conan(ConanFile): name = "drmp3" description = "MP3 audio decoder." - homepage = "https://mackron.github.io/" + homepage = "https://github.com/mackron/dr_libs" topics = ("audio", "mp3", "sound") license = ("Unlicense", "MIT-0") url = "https://github.com/conan-io/conan-center-index" diff --git a/recipes/drmp3/config.yml b/recipes/drmp3/config.yml index dda44114b507b..cd9d5736792a2 100644 --- a/recipes/drmp3/config.yml +++ b/recipes/drmp3/config.yml @@ -1,4 +1,6 @@ versions: + "0.6.38": + folder: all "0.6.34": folder: all "0.6.32": diff --git a/recipes/drogon/all/conandata.yml b/recipes/drogon/all/conandata.yml index 3d2e4a7aaaaea..746215039912d 100644 --- a/recipes/drogon/all/conandata.yml +++ b/recipes/drogon/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "1.9.1": + url: "https://github.com/drogonframework/drogon/archive/v1.9.1.tar.gz" + sha256: "0f8bab22e02681d05787c88cbef5d04b105f6644ebf7cf29898d0a52ebe959e4" + "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" "1.8.3": url: "https://github.com/drogonframework/drogon/archive/v1.8.3.tar.gz" sha256: "db6d92a0c40ec52d5704fb4128860b9eecdc284653e8d85113b4219b96dc7129" @@ -12,6 +30,58 @@ sources: url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.7.5.tar.gz" sha256: "e2af7c55dcabafef16f26f5b3242692f5a2b54c19b7b626840bf9132d24766f6" patches: + "1.9.1": + - 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.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" + patch_type: "conan" + - patch_file: "patches/1.8.4-0002-find-package-jsoncpp.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" + - patch_file: "patches/1.8.4-0003-find-package-sqlite.patch" + patch_description: "Fix sqlite cmake target name" + patch_type: "conan" + - 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\ @@ -23,7 +93,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\ @@ -35,7 +108,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" @@ -46,7 +122,9 @@ patches: - patch_file: "patches/1.8.0-0003-find-package-sqlite.patch" patch_description: "Fix sqlite cmake target name" patch_type: "conan" - + - patch_file: "patches/1.8.0-0004-remove-msvc-check.patch" + patch_description: "remove msvc check for C++17 support" + patch_type: "portability" "1.7.5": - patch_file: "patches/1.7.5-0001-disable_trantor.patch" patch_description: "Consume Trantor package from Conan instead of using the subproject" @@ -60,3 +138,6 @@ patches: - patch_file: "patches/1.7.5-0004-find-package-jsoncpp.patch" patch_description: "Fix jsoncpp cmake target name" patch_type: "conan" + - patch_file: "patches/1.7.5-0005-remove-msvc-check.patch" + patch_description: "remove msvc check for C++17 support" + patch_type: "portability" diff --git a/recipes/drogon/all/conanfile.py b/recipes/drogon/all/conanfile.py index 05e8a3e45cfa1..89a3a646123b9 100644 --- a/recipes/drogon/all/conanfile.py +++ b/recipes/drogon/all/conanfile.py @@ -1,20 +1,24 @@ +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_layout, CMakeToolchain, CMakeDeps, CMake from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, rmdir -from conan.tools.build import check_min_cppstd from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration -import os +from conan.tools.microsoft import is_msvc required_conan_version = ">=1.53.0" + 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], @@ -24,6 +28,7 @@ class DrogonConan(ConanFile): "with_orm": [True, False], "with_profile": [True, False], "with_brotli": [True, False], + "with_yaml_cpp": [True, False], "with_postgres": [True, False], "with_postgres_batch": [True, False], "with_mysql": [True, False], @@ -38,6 +43,7 @@ class DrogonConan(ConanFile): "with_orm": True, "with_profile": False, "with_brotli": False, + "with_yaml_cpp": False, "with_postgres": False, "with_postgres_batch": False, "with_mysql": False, @@ -51,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: @@ -71,27 +79,26 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): - if Version(self.version) < "1.8.2": - return { + return { + "14": { "Visual Studio": "15", "msvc": "191", "gcc": "6", "clang": "5", "apple-clang": "10", - } - else: - return { + }, + "17": { "Visual Studio": "16", "msvc": "192", "gcc": "8", "clang": "7", "apple-clang": "12", } + }.get(str(self._min_cppstd), {}) def validate(self): - if self.info.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.info.settings.compiler), False) if minimum_version: if Version(self.info.settings.compiler.version) < minimum_version: @@ -99,30 +106,35 @@ def validate(self): else: self.output.warn(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") + if self.settings.compiler.get_safe("cppstd") == "14" and not self.options.with_boost: + raise ConanInvalidConfiguration(f"{self.ref} requires boost on C++14") + def requirements(self): - self.requires("trantor/1.5.8") - self.requires("jsoncpp/1.9.5") - self.requires("openssl/1.1.1s") - self.requires("zlib/1.2.13") + self.requires("trantor/1.5.15", 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.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.81.0") + 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.5") + self.requires("libpq/15.4") if self.options.get_safe("with_mysql"): - self.requires("libmysqlclient/8.0.30") + self.requires("libmysqlclient/8.1.0") if self.options.get_safe("with_sqlite"): - self.requires("sqlite3/3.40.0") + self.requires("sqlite3/3.44.2") if self.options.get_safe("with_redis"): - self.requires("hiredis/1.1.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], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def layout(self): cmake_layout(self, src_folder="src") @@ -136,11 +148,16 @@ 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.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) tc.variables["BUILD_SQLITE"] = self.options.get_safe("with_sqlite", False) tc.variables["BUILD_REDIS"] = self.options.get_safe("with_redis", False) + if is_msvc(self): + tc.variables["CMAKE_CXX_FLAGS"] = "/Zc:__cplusplus /EHsc" + if Version(self.version) >= "1.8.4": + tc.variables["USE_SUBMODULE"] = False tc.generate() tc = CMakeDeps(self) tc.generate() diff --git a/recipes/drogon/all/patches/1.7.5-0005-remove-msvc-check.patch b/recipes/drogon/all/patches/1.7.5-0005-remove-msvc-check.patch new file mode 100644 index 0000000000000..61bc8404888cc --- /dev/null +++ b/recipes/drogon/all/patches/1.7.5-0005-remove-msvc-check.patch @@ -0,0 +1,92 @@ +diff --git a/lib/inc/drogon/utils/any.h b/lib/inc/drogon/utils/any.h +index 63abd2e..8ac74d8 100644 +--- a/lib/inc/drogon/utils/any.h ++++ b/lib/inc/drogon/utils/any.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -21,7 +21,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::any; + using std::any_cast; + #else +diff --git a/lib/inc/drogon/utils/optional.h b/lib/inc/drogon/utils/optional.h +index 2dde172..297a819 100644 +--- a/lib/inc/drogon/utils/optional.h ++++ b/lib/inc/drogon/utils/optional.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -21,9 +21,9 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::optional; + #else + using boost::optional; + #endif +-} // namespace drogon +\ No newline at end of file ++} // namespace drogon +diff --git a/lib/inc/drogon/utils/string_view.h b/lib/inc/drogon/utils/string_view.h +index a2362b7..074d05f 100644 +--- a/lib/inc/drogon/utils/string_view.h ++++ b/lib/inc/drogon/utils/string_view.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -25,7 +25,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::string_view; + #else + using boost::string_view; +@@ -40,10 +40,10 @@ inline LogStream &operator<<(LogStream &ls, const drogon::string_view &v) + } + } // namespace trantor + +-#if __cplusplus < 201703L && !(defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus < 201703L + namespace drogon + { +-#ifndef _MSC_VER ++#if 1 + template + struct StringViewHasher; + +@@ -319,7 +319,7 @@ struct hash + size_t operator()(const drogon::string_view &__str) const noexcept + { + // MSVC is having problems with non-aligned strings +-#ifndef _MSC_VER ++#if 1 + return drogon::StringViewHasher()(__str); + #else + return drogon::ShortStringViewHasher(__str); diff --git a/recipes/drogon/all/patches/1.8.0-0004-remove-msvc-check.patch b/recipes/drogon/all/patches/1.8.0-0004-remove-msvc-check.patch new file mode 100644 index 0000000000000..5b0923c887cc6 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.0-0004-remove-msvc-check.patch @@ -0,0 +1,117 @@ +diff --git a/lib/inc/drogon/utils/any.h b/lib/inc/drogon/utils/any.h +index 63abd2e..8ac74d8 100644 +--- a/lib/inc/drogon/utils/any.h ++++ b/lib/inc/drogon/utils/any.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -21,7 +21,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::any; + using std::any_cast; + #else +diff --git a/lib/inc/drogon/utils/apply.h b/lib/inc/drogon/utils/apply.h +index a9049af..97d55b7 100644 +--- a/lib/inc/drogon/utils/apply.h ++++ b/lib/inc/drogon/utils/apply.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -29,7 +29,7 @@ constexpr decltype(auto) apply_impl(F &&f, Tuple &&t, std::index_sequence) + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::apply; + #else + template +@@ -42,4 +42,4 @@ constexpr decltype(auto) apply(F &&f, Tuple &&t) + std::tuple_size >::value>{}); + } + #endif +-} // namespace drogon +\ No newline at end of file ++} // namespace drogon +diff --git a/lib/inc/drogon/utils/optional.h b/lib/inc/drogon/utils/optional.h +index 19ced06..c049553 100644 +--- a/lib/inc/drogon/utils/optional.h ++++ b/lib/inc/drogon/utils/optional.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -21,7 +21,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::nullopt; + using std::optional; + #else +diff --git a/lib/inc/drogon/utils/string_view.h b/lib/inc/drogon/utils/string_view.h +index a2362b7..074d05f 100644 +--- a/lib/inc/drogon/utils/string_view.h ++++ b/lib/inc/drogon/utils/string_view.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -25,7 +25,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::string_view; + #else + using boost::string_view; +@@ -40,10 +40,10 @@ inline LogStream &operator<<(LogStream &ls, const drogon::string_view &v) + } + } // namespace trantor + +-#if __cplusplus < 201703L && !(defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus < 201703L + namespace drogon + { +-#ifndef _MSC_VER ++#if 1 + template + struct StringViewHasher; + +@@ -319,7 +319,7 @@ struct hash + size_t operator()(const drogon::string_view &__str) const noexcept + { + // MSVC is having problems with non-aligned strings +-#ifndef _MSC_VER ++#if 1 + return drogon::StringViewHasher()(__str); + #else + return drogon::ShortStringViewHasher(__str); 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 0000000000000..477d23fb1fd63 --- /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.4-0001-remove-shared-libs.patch b/recipes/drogon/all/patches/1.8.4-0001-remove-shared-libs.patch new file mode 100644 index 0000000000000..f51304849a04f --- /dev/null +++ b/recipes/drogon/all/patches/1.8.4-0001-remove-shared-libs.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4406362..c346e60 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,6 @@ option(BUILD_CTL "Build drogon_ctl" ${BUILD_PROGRAMS}) + option(BUILD_EXAMPLES "Build examples" ${BUILD_PROGRAMS}) + 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.4-0002-find-package-jsoncpp.patch b/recipes/drogon/all/patches/1.8.4-0002-find-package-jsoncpp.patch new file mode 100644 index 0000000000000..362fa96c66cc6 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.4-0002-find-package-jsoncpp.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c346e60..e561e5c 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,9 +206,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) diff --git a/recipes/drogon/all/patches/1.8.4-0003-find-package-sqlite.patch b/recipes/drogon/all/patches/1.8.4-0003-find-package-sqlite.patch new file mode 100644 index 0000000000000..6f97d35a4d314 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.4-0003-find-package-sqlite.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e561e5c..993b21a 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -437,7 +437,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) diff --git a/recipes/drogon/all/patches/1.8.4-0004-find-package-yaml-cpp.patch b/recipes/drogon/all/patches/1.8.4-0004-find-package-yaml-cpp.patch new file mode 100644 index 0000000000000..a9fca7863aea7 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.4-0004-find-package-yaml-cpp.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44063629..c18c86db 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -215,7 +215,7 @@ if(BUILD_YAML_CONFIG) + find_package(yaml-cpp QUIET) + if(yaml-cpp_FOUND) + message(STATUS "yaml-cpp found") +- target_link_libraries(${PROJECT_NAME} PUBLIC ${YAML_CPP_LIBRARIES}) ++ target_link_libraries(${PROJECT_NAME} PUBLIC yaml-cpp) + target_compile_definitions(${PROJECT_NAME} PUBLIC HAS_YAML_CPP) + else() + message(STATUS "yaml-cpp not used") 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 0000000000000..9920eee534139 --- /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 0000000000000..8bf9e60842f93 --- /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 0000000000000..3da404b88ccc2 --- /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 0000000000000..cf206b982069b --- /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 0ab8881109d24..82e0951737eeb 100644 --- a/recipes/drogon/config.yml +++ b/recipes/drogon/config.yml @@ -1,4 +1,16 @@ versions: + "1.9.1": + folder: "all" + "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": folder: "all" "1.8.2": diff --git a/recipes/drwav/all/conandata.yml b/recipes/drwav/all/conandata.yml index 449e35d180bee..7757121179bae 100644 --- a/recipes/drwav/all/conandata.yml +++ b/recipes/drwav/all/conandata.yml @@ -1,9 +1,14 @@ sources: - # NOTE: https://github.com/mackron/dr_libs/blob/4f6da71ed357ade92dc91f00e6be7301ec9a82a3/dr_wav.h#L3 + # NOTE: https://github.com/mackron/dr_libs/blob/d35a3bc5efd02455d98cbe12b94647136f09b42d/dr_wav.h#L3 + "0.13.14": + url: "https://github.com/mackron/dr_libs/archive/a4b73d3d423e1cea0652b76d0806e7620337a40f.zip" + sha256: "89729a85f092a81eb6e646c1580525c7738c4780bc59890c908b9582e8e9312b" + "0.13.12": + url: "https://github.com/mackron/dr_libs/archive/d35a3bc5efd02455d98cbe12b94647136f09b42d.zip" + sha256: "4886462b8ed26f12b8bceccb80f1447075ed5e73240089f2a78e0c32b444b370" "0.13.7": - url: https://github.com/mackron/dr_libs/archive/4f6da71ed357ade92dc91f00e6be7301ec9a82a3.zip + url: "https://github.com/mackron/dr_libs/archive/4f6da71ed357ade92dc91f00e6be7301ec9a82a3.zip" sha256: "0a77850ca558633e0516a68383481fb36823064256f2c50911056714420bc5b1" - # NOTE: https://github.com/mackron/dr_libs/blob/15f37e3ab01654c1a3bc98cff2a9ca64e8296fa9/dr_wav.h#L3 "0.13.6": - url: https://github.com/mackron/dr_libs/archive/15f37e3ab01654c1a3bc98cff2a9ca64e8296fa9.zip + url: "https://github.com/mackron/dr_libs/archive/15f37e3ab01654c1a3bc98cff2a9ca64e8296fa9.zip" sha256: "39ea8c1f9b60a945735dfe4a2e0a2a6bd3bc921619fa7d2612dbc284b68c2419" diff --git a/recipes/drwav/all/conanfile.py b/recipes/drwav/all/conanfile.py index 893c882ec028c..29de2c8e01806 100644 --- a/recipes/drwav/all/conanfile.py +++ b/recipes/drwav/all/conanfile.py @@ -9,7 +9,7 @@ class DrwavConan(ConanFile): name = "drwav" description = "WAV audio loader and writer." - homepage = "https://mackron.github.io/dr_wav" + homepage = "https://github.com/mackron/dr_libs" topics = ("audio", "wav", "wave", "sound") license = ("Unlicense", "MIT-0") url = "https://github.com/conan-io/conan-center-index" diff --git a/recipes/drwav/config.yml b/recipes/drwav/config.yml index 6c8f065f79d49..35331ff9db236 100644 --- a/recipes/drwav/config.yml +++ b/recipes/drwav/config.yml @@ -1,4 +1,8 @@ versions: + "0.13.14": + folder: all + "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 0000000000000..17f324a8e1446 --- /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 0000000000000..d4ef17870d051 --- /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 0000000000000..cece818ce0db2 --- /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 0000000000000..e16d647a99e9c --- /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 0000000000000..f823007a47a74 --- /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 0000000000000..922d35b61f37a --- /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 0000000000000..10690f2821e16 --- /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 0000000000000..d7e185cf9c964 --- /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 6d45ac4104004..c53d228db8921 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 9710bb88ce36c..f8aa0df23cba2 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 49a3a66ea5bad..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 034e9d6c571e6..82ad639285d87 100644 --- a/recipes/duckdb/all/conandata.yml +++ b/recipes/duckdb/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "0.8.0": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.8.0.tar.gz" + sha256: "df3b8e0b72bce38914f0fb1cd02235d8b616df9209beb14beb06bfbcaaf2e97f" "0.7.1": url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.7.1.tar.gz" sha256: "67f840f861e5ffbe137d65a8543642d016f900b89dd035492d562ad11acf0e1e" @@ -12,13 +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" + "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" "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" @@ -26,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" @@ -33,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 34aad40c19a16..2010b8b18210e 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.8.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.8.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..6daffba956a1a --- /dev/null +++ b/recipes/duckdb/all/patches/0.8.0-0001-fix-cmake.patch @@ -0,0 +1,86 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 0200c15..4a59ae6 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -75,23 +75,27 @@ 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) +- ++ else() + 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) ++ endif() + ++ if(BUILD_SHARED_LIBS) + target_include_directories( + duckdb PUBLIC $ + $) +- ++ else() + target_include_directories( + duckdb_static PUBLIC $ + $) ++ endif() + + install( + DIRECTORY "${PROJECT_SOURCE_DIR}/src/include/duckdb" +@@ -104,9 +108,18 @@ else() + + 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 8f13cfe..6755894 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -53,6 +53,14 @@ 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 d46c676..93a1875 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -19,7 +19,7 @@ if(NOT AMALGAMATION_BUILD) + endif() + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32) ++if(BUILD_SHARED_LIBS AND NOT WIN32) + 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) diff --git a/recipes/duckdb/all/patches/0.8.1-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.8.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..5cd9417ef53c9 --- /dev/null +++ b/recipes/duckdb/all/patches/0.8.1-0001-fix-cmake.patch @@ -0,0 +1,87 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 0200c15..008c20e 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -75,24 +75,26 @@ 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) +- ++ else() + 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) +- ++ endif() ++ if(BUILD_SHARED_LIBS) + target_include_directories( + duckdb PUBLIC $ + $) +- ++ else() + target_include_directories( + duckdb_static PUBLIC $ + $) +- ++ endif() + install( + DIRECTORY "${PROJECT_SOURCE_DIR}/src/include/duckdb" + DESTINATION "${INSTALL_INCLUDE_DIR}" +@@ -104,9 +106,18 @@ else() + + 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 8f13cfe..6755894 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -53,6 +53,14 @@ 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 84ac539..f5597a4 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,7 +26,7 @@ if(NOT AMALGAMATION_BUILD) + endif() + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32) ++if(BUILD_SHARED_LIBS AND NOT WIN32) + 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) 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 0000000000000..40ae0d24ebe51 --- /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 0000000000000..c7d4c07c092db --- /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 c1b25ce335aee..77e20cf10a797 100644 --- a/recipes/duckdb/config.yml +++ b/recipes/duckdb/config.yml @@ -1,4 +1,12 @@ versions: + "0.9.2": + folder: "all" + "0.9.0": + folder: "all" + "0.8.1": + folder: "all" + "0.8.0": + folder: "all" "0.7.1": folder: "all" "0.6.1": diff --git a/recipes/duktape/all/CMakeLists.txt b/recipes/duktape/all/CMakeLists.txt index 76bab4dba57c0..cc4f8cfa2df77 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 3e582932bd595..588a96a8c0f57 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 526e8d40c66a2..e6adea9e794dd 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 ca9da95670911..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..d47b5097e761e --- /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 0000000000000..c085d1577b105 --- /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 0000000000000..d607d4cbb0520 --- /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 0000000000000..b3c80ba7c695b --- /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 0000000000000..ad30644323b26 --- /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 0000000000000..01f9e4b14bcb1 --- /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 0000000000000..a816d92f78ee3 --- /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 23791142acadb..c1034e73dab2e 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 4a460cc9a3c99..c341471bb32de 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 0246d899d7bc9..12503ced11f45 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 0357a45cbaadf..a8c92dea63335 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/eastl/all/CMakeLists.txt b/recipes/eastl/all/CMakeLists.txt deleted file mode 100644 index 9533e6887cb91..0000000000000 --- a/recipes/eastl/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -set(CMAKE_CXX_STANDARD 14) - -add_subdirectory(source_subfolder) diff --git a/recipes/eastl/all/conandata.yml b/recipes/eastl/all/conandata.yml index f1c15b1dc7308..fbaa385964645 100644 --- a/recipes/eastl/all/conandata.yml +++ b/recipes/eastl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.21.12": + url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.21.12.tar.gz" + sha256: "2a4d77e5eda23ec52fea8b22abbf2ea8002f38396d2a3beddda3ff2e17f7db2e" "3.18.00": url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.18.00.tar.gz" sha256: "a3c5b970684be02e81fb16fbf92ed2584e055898704fde87c72d0331afdea12b" @@ -21,30 +24,51 @@ sources: url: "https://github.com/electronicarts/EASTL/archive/3.15.00.tar.gz" sha256: "1578a2935ca490920b96c960fb570dab025280bb978fba40c88eb9ac74760c14" patches: + "3.21.12": + - patch_file: "patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" + - patch_file: "patches/3.21.12-0003-rename_reference.patch" + patch_description: "use eastl::remove_reference instead of std::remove_reference" + patch_type: "portability" + patch_source: "https://github.com/electronicarts/EASTL/issues/512" "3.18.00": - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" - base_path: "source_subfolder" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" "3.17.06": - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" - base_path: "source_subfolder" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" "3.17.03": - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" - base_path: "source_subfolder" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" "3.16.07": - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" "3.16.05": - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" "3.16.01": - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" "3.15.00": - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" diff --git a/recipes/eastl/all/conanfile.py b/recipes/eastl/all/conanfile.py index faccbd629bec0..0e2ac3111ed3a 100644 --- a/recipes/eastl/all/conanfile.py +++ b/recipes/eastl/all/conanfile.py @@ -1,20 +1,36 @@ -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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + replace_in_file, + rmdir, +) +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class EastlConan(ConanFile): name = "eastl" - description = "EASTL stands for Electronic Arts Standard Template Library. " \ - "It is an extensive and robust implementation that has an " \ - "emphasis on high performance." + description = ( + "EASTL stands for Electronic Arts Standard Template Library. " + "It is an extensive and robust implementation that has an " + "emphasis on high performance." + ) topics = ("eastl", "stl", "high-performance") license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/electronicarts/EASTL" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,34 +41,22 @@ class EastlConan(ConanFile): "fPIC": True, } - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 14 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): return { "Visual Studio": "14", - "gcc": "5", + "msvc": "190", + "gcc": "5" if Version(self.version) < "3.21.12" else "6", "clang": "3.2", "apple-clang": "4.3", } 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": @@ -60,57 +64,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("eabase/2.09.06") + self.requires("eabase/2.09.12", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) - - mininum_compiler_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if mininum_compiler_version and tools.Version(self.settings.compiler.version) < mininum_compiler_version: - raise ConanInvalidConfiguration("Compiler is too old for c++ {}".format(self._minimum_cpp_standard)) + 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 check_min_vs(self, "193", raise_invalid=False) and Version(self.version) < "3.21.12": + raise ConanInvalidConfiguration(f"{self.ref} is not compatible with Visual Studio 2022, please use version >= 3.21.12") 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["EASTL_BUILD_BENCHMARK"] = False - self._cmake.definitions["EASTL_BUILD_TESTS"] = 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["EASTL_BUILD_BENCHMARK"] = False + tc.variables["EASTL_BUILD_TESTS"] = False + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.generate() + CMakeDeps(self).generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - tools.replace_path_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "include(CommonCppFlags)", - "") + apply_conandata_patches(self) + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "include(CommonCppFlags)", + "", + ) 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") - self.copy("3RDPARTYLICENSES.TXT", 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, + "3RDPARTYLICENSES.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, "doc")) def package_info(self): self.cpp_info.libs = ["EASTL"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["m", "pthread"]) if self.options.shared: self.cpp_info.defines.append("EA_DLL") - # Do not use these names in set_property, it was a mistake, eastl doesn't export its target + self.cpp_info.set_property("cmake_file_name", "EASTL") + self.cpp_info.set_property("cmake_target_name", "EASTL::EASTL") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "EASTL" + self.cpp_info.filenames["cmake_find_package_multi"] = "EASTL" self.cpp_info.names["cmake_find_package"] = "EASTL" self.cpp_info.names["cmake_find_package_multi"] = "EASTL" diff --git a/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch b/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch index 8b004f0ee5054..cb7647d7b88ea 100644 --- a/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch +++ b/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch @@ -1,11 +1,12 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -46,5 +46,18 @@ target_include_directories(EASTL PUBLIC include) +@@ -46,5 +46,19 @@ target_include_directories(EASTL PUBLIC include) #------------------------------------------------------------------------------------------- # Dependencies #------------------------------------------------------------------------------------------- -target_link_libraries(EASTL EABase) -+target_link_libraries(EASTL CONAN_PKG::eabase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) +if(BUILD_SHARED_LIBS) + target_compile_definitions(EASTL PUBLIC EASTL_DLL) diff --git a/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch b/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch index 05c5b0bd39e41..8e8ec2ed77d6e 100644 --- a/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch +++ b/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -47,8 +47,21 @@ +@@ -47,8 +47,22 @@ # Dependencies #------------------------------------------------------------------------------------------- if (NOT TARGET EABase) @@ -9,7 +9,8 @@ endif() -target_link_libraries(EASTL EABase) -+target_link_libraries(EASTL CONAN_PKG::eabase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) +if(BUILD_SHARED_LIBS) + target_compile_definitions(EASTL PUBLIC EASTL_DLL) diff --git a/recipes/eastl/all/patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch b/recipes/eastl/all/patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch new file mode 100644 index 0000000000000..475e12111343c --- /dev/null +++ b/recipes/eastl/all/patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e3eb444..f033794 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,11 +59,22 @@ target_include_directories(EASTL PUBLIC include) + #------------------------------------------------------------------------------------------- + # Dependencies + #------------------------------------------------------------------------------------------- +-if (NOT TARGET EABase) +- add_subdirectory(test/packages/EABase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) ++ ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() + endif() + +-target_link_libraries(EASTL EABase) ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) + + #------------------------------------------------------------------------------------------- + # Installation diff --git a/recipes/eastl/all/patches/3.21.12-0003-rename_reference.patch b/recipes/eastl/all/patches/3.21.12-0003-rename_reference.patch new file mode 100644 index 0000000000000..686977d001a8d --- /dev/null +++ b/recipes/eastl/all/patches/3.21.12-0003-rename_reference.patch @@ -0,0 +1,13 @@ +diff --git a/include/EASTL/internal/type_transformations.h b/include/EASTL/internal/type_transformations.h +index 5454cfa..54a1c14 100644 +--- a/include/EASTL/internal/type_transformations.h ++++ b/include/EASTL/internal/type_transformations.h +@@ -497,7 +497,7 @@ namespace eastl + namespace internal + { + template +- auto try_add_pointer(int) -> type_identity::type*>; ++ auto try_add_pointer(int) -> type_identity::type*>; + template + auto try_add_pointer(...) -> type_identity; + } diff --git a/recipes/eastl/all/test_package/CMakeLists.txt b/recipes/eastl/all/test_package/CMakeLists.txt index 3300ff7750277..8223214fdc1fe 100644 --- a/recipes/eastl/all/test_package/CMakeLists.txt +++ b/recipes/eastl/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 CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(EASTL REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} EASTL::EASTL) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/eastl/all/test_package/conanfile.py b/recipes/eastl/all/test_package/conanfile.py index 5c09494bc67c0..ef5d7042163ec 100644 --- a/recipes/eastl/all/test_package/conanfile.py +++ b/recipes/eastl/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 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/eastl/all/test_package/test_package.cpp b/recipes/eastl/all/test_package/test_package.cpp index 3f5332883d4d5..433ff947f053b 100644 --- a/recipes/eastl/all/test_package/test_package.cpp +++ b/recipes/eastl/all/test_package/test_package.cpp @@ -1,9 +1,16 @@ -#include -#include +#include +#include -int main() -{ - std::vector vec; - eastl::max_element(vec.begin(), vec.end()); +// https://github.com/electronicarts/EASTL/blob/master/doc/FAQ.md#info15-how-hard-is-it-to-incorporate-eastl-into-my-project +void *operator new[](size_t size, const char *pName, int flags, unsigned debugFlags, const char *file, int line) { + return new uint8_t[size]; +} +void *operator new[](size_t size, size_t alignment, size_t alignmentOffset, const char *pName, int flags, unsigned debugFlags, const char *file, int line) { + return new uint8_t[size]; +} + +int main() { + eastl::hash_map map; + map[0] = 1; return 0; } diff --git a/recipes/eastl/config.yml b/recipes/eastl/config.yml index bfb95b02f09c0..0cd35fae8664c 100644 --- a/recipes/eastl/config.yml +++ b/recipes/eastl/config.yml @@ -1,4 +1,6 @@ versions: + "3.21.12": + folder: "all" "3.18.00": folder: "all" "3.17.06": diff --git a/recipes/easyloggingpp/all/CMakeLists.txt b/recipes/easyloggingpp/all/CMakeLists.txt deleted file mode 100644 index f6fc5c33e69b0..0000000000000 --- 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 5649e78f158cc..83345fd6f0b12 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 b5d1f9b44e060..7cacb1c38e312 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 e515e14d7e6ad..a353807cafd1f 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 49a3a66ea5bad..ef5d7042163ec 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 9f1fc4b8dad34..da48715e9c0a2 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 8f835ce7bab04..b4a91abbf7181 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 8b2a23892d7de..0000000000000 --- 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 ce63d9a78cbcc..80c52f3ee8642 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 5e527b6090911..46a81f3f9abbc 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 34af13462f44f..6e6b478dec699 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 4903f1a7e8fa0..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..6c9d5dba712c7 --- /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/ecos/all/conandata.yml b/recipes/ecos/all/conandata.yml index 3034805590c75..d01723bbcc421 100644 --- a/recipes/ecos/all/conandata.yml +++ b/recipes/ecos/all/conandata.yml @@ -1,8 +1,13 @@ sources: + "2.0.10": + url: "https://github.com/embotech/ecos/archive/refs/tags/v2.0.10.tar.gz" + sha256: "1aa24b5782b84fa33df2987510fb8f60f5f999cc2d3a5c73cfc3eb5e5f3b46af" "2.0.8": url: "https://github.com/embotech/ecos/archive/refs/tags/v2.0.8.tar.gz" sha256: "d905d16599efd927a75b29852c3476ff1ffd0b97ab27d5b8ad63bb4ff2ad8130" patches: + "2.0.10": + - patch_file: "patches/0001-fix-cmake.patch" "2.0.8": - patch_file: "patches/0001-fix-cmake.patch" - patch_file: "patches/0002-missing-include.patch" diff --git a/recipes/ecos/config.yml b/recipes/ecos/config.yml index ebde7c07fe491..c6ba7fd0862f2 100644 --- a/recipes/ecos/config.yml +++ b/recipes/ecos/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.10": + folder: all "2.0.8": folder: all diff --git a/recipes/effolkronium-random/all/conandata.yml b/recipes/effolkronium-random/all/conandata.yml index caf25d2461065..93228f36e51e4 100644 --- a/recipes/effolkronium-random/all/conandata.yml +++ b/recipes/effolkronium-random/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.0": + url: "https://github.com/effolkronium/random/archive/v1.5.0.tar.gz" + sha256: "c05a042f8daf54913e3a836e10a213bbbeaf09a89630649bd0011fe65eff50d9" "1.4.1": url: "https://github.com/effolkronium/random/archive/v1.4.1.tar.gz" sha256: "ec6beb67496ad2ce722d311d3fa5efb7e847dac5fd1c16b8920b51562fe20f53" diff --git a/recipes/effolkronium-random/all/conanfile.py b/recipes/effolkronium-random/all/conanfile.py index 1c77e0e87ce24..3b1d45a29a7e9 100644 --- a/recipes/effolkronium-random/all/conanfile.py +++ b/recipes/effolkronium-random/all/conanfile.py @@ -1,31 +1,55 @@ import os -from conans 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.52.0" + class RandomConan(ConanFile): name = "effolkronium-random" description = "Random for modern C++ with convenient API." license = "MIT" - topics = ("conan", "random", "header-only") - homepage = "https://github.com/effolkronium/random" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/effolkronium/random" + topics = ("random", "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]) - os.rename("random-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE.MIT", dst="licenses", src=self._source_subfolder) - self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE.MIT", 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", "effolkronium_random") + self.cpp_info.set_property("cmake_target_name", "effolkronium_random") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "effolkronium_random" self.cpp_info.names["cmake_find_package_multi"] = "effolkronium_random" diff --git a/recipes/effolkronium-random/all/test_package/CMakeLists.txt b/recipes/effolkronium-random/all/test_package/CMakeLists.txt index 33ae887aa6aea..186757f8c1657 100644 --- a/recipes/effolkronium-random/all/test_package/CMakeLists.txt +++ b/recipes/effolkronium-random/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(effolkronium_random REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE effolkronium_random) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/effolkronium-random/all/test_package/conanfile.py b/recipes/effolkronium-random/all/test_package/conanfile.py index ea57a464900be..fae501d0afb9e 100644 --- a/recipes/effolkronium-random/all/test_package/conanfile.py +++ b/recipes/effolkronium-random/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" + 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/effolkronium-random/config.yml b/recipes/effolkronium-random/config.yml index c0455a0dac1c9..81a82b944153f 100644 --- a/recipes/effolkronium-random/config.yml +++ b/recipes/effolkronium-random/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.0": + folder: "all" "1.4.1": folder: "all" "1.4.0": diff --git a/recipes/egl-headers/all/conanfile.py b/recipes/egl-headers/all/conanfile.py index 5f6e1786a60cb..d9fb3976353e3 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 8c6a625d847ec..26e09ca1aa867 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 f57351ff19434..fec8473460a71 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 eef05956d7282..db0b0c7ba0af5 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 6fa586f7cb943..50113becf9a2c 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 387fbf23f814b..2d1b3203b5c13 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 85717c37cac04..69b00d0652d9d 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 caefeb2a118b9..7d15bdd2937ed 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 332c215103f1f..0000000000000 --- 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 0000000000000..a5b39f30d22c8 --- /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 789694c1fe951..0000000000000 --- 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 0000000000000..0cf39dab8bc5b --- /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 0000000000000..ae598f96a0713 --- /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 7b9b613cbb24a..5caca1b8ef2e8 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 3a92de2cf5935..ffc4801c9d705 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/sentry-native/all/test_v1_package/CMakeLists.txt b/recipes/elfutils/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/sentry-native/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 0000000000000..a4c0641d885f0 --- /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 837391aa2d05d..2b63e87901919 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 0000000000000..6638694bdd2b6 --- /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 0000000000000..6df20cbf9a5ef --- /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 0000000000000..3d3e19b6eb19b --- /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 0000000000000..27b09cd59a901 --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..c8563d402b2b7 --- /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 0000000000000..97f7bce9d3b04 --- /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 0000000000000..123dfa0258590 --- /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 0000000000000..177f5ad4ff785 --- /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 0000000000000..ac26e4c63d05b --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..c12de1cdf78c1 --- /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 0000000000000..d2eb4ed4a511f --- /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 new file mode 100644 index 0000000000000..9c81336117348 --- /dev/null +++ b/recipes/emio/all/conandata.yml @@ -0,0 +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/all/conanfile.py b/recipes/emio/all/conanfile.py new file mode 100644 index 0000000000000..8eb00bd9ec66b --- /dev/null +++ b/recipes/emio/all/conanfile.py @@ -0,0 +1,62 @@ +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 +import os + +required_conan_version = ">=1.50.0" + + +class EmioConan(ConanFile): + name = "emio" + description = "A character input/output library for embedded systems." + topics = ("format", "scan", "header-only") + homepage = "https://github.com/viatorus/emio" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + package_type = "header-library" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "14", + "apple-clang": "14", + } + + @property + def _min_cppstd(self): + return 20 + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC.") + + 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 package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include")) diff --git a/recipes/emio/all/test_package/CMakeLists.txt b/recipes/emio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f5509edbbb4df --- /dev/null +++ b/recipes/emio/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(emio REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE emio::emio) +target_compile_features(test_package PRIVATE cxx_std_20) diff --git a/recipes/emio/all/test_package/conanfile.py b/recipes/emio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/emio/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/emio/all/test_package/test_package.cpp b/recipes/emio/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..efef6cc4e862d --- /dev/null +++ b/recipes/emio/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +int main() { + std::string s = emio::format("{}", 1); + if (s == "1") { + return EXIT_SUCCESS; + } + return EXIT_FAILURE; +} diff --git a/recipes/emio/config.yml b/recipes/emio/config.yml new file mode 100644 index 0000000000000..01ed4761ab018 --- /dev/null +++ b/recipes/emio/config.yml @@ -0,0 +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 8a32427b651c2..09c67e41502df 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 82752e0f1209d..3fd73e6da5530 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 5c44e31e17e0f..ef18304559574 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 0e74282d629d1..6da09cd5f8f1b 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 de37d8e54862f..4ccf80abd3897 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 71e01b224abd1..ee49a56d76d67 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 a8c92dea63335..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..a8c92dea63335 --- /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-generic_serialization/all/conanfile.py b/recipes/enhex-generic_serialization/all/conanfile.py index 9dbb338a5b3f4..f9f7cc76df650 100644 --- a/recipes/enhex-generic_serialization/all/conanfile.py +++ b/recipes/enhex-generic_serialization/all/conanfile.py @@ -1,50 +1,76 @@ -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 EnhexGenericserializationConan(ConanFile): name = "enhex-generic_serialization" - license = "MIT" description = "Lightweight and extensible generic serialization library" - topics = ("serialization") - homepage = "https://github.com/Enhex/generic_serialization" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Enhex/generic_serialization" + topics = ("serialization", "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, "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/enhex-generic_serialization/all/test_package/CMakeLists.txt b/recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt index 60c63e2f06ba6..cca2369654837 100644 --- a/recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt +++ b/recipes/enhex-generic_serialization/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-generic_serialization CONFIG REQUIRED) +find_package(enhex-generic_serialization REQUIRED CONFIG) add_executable(example example.cpp) target_link_libraries(example enhex-generic_serialization::enhex-generic_serialization) diff --git a/recipes/enhex-generic_serialization/all/test_package/conanfile.py b/recipes/enhex-generic_serialization/all/test_package/conanfile.py index 6ab1666628a5d..e0f447388fa1b 100644 --- a/recipes/enhex-generic_serialization/all/test_package/conanfile.py +++ b/recipes/enhex-generic_serialization/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 EnhexGenericserializationTestConan(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-generic_serialization/all/test_v1_package/CMakeLists.txt b/recipes/enhex-generic_serialization/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/enhex-generic_serialization/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-generic_serialization/all/test_v1_package/conanfile.py b/recipes/enhex-generic_serialization/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6ab1666628a5d --- /dev/null +++ b/recipes/enhex-generic_serialization/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class EnhexGenericserializationTestConan(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/enhex-strong_type/all/conanfile.py b/recipes/enhex-strong_type/all/conanfile.py index 40601c5f9d3e8..8b4ea08eec845 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 ee8f5992e5656..51d45c127f722 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 c48d1d23bfccd..8d52b7021efe1 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 0000000000000..91630d79f4abb --- /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 0000000000000..c48d1d23bfccd --- /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 9d48e327cd88a..0000000000000 --- 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 172ca8e02037d..8af63eb0a3f23 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 30e76e5090606..a986c4e5f3431 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 4a5eb7410ea85..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..4a5eb7410ea85 --- /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 c986d294c7547..0000000000000 --- 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 9604c7fcf2b72..197355c129edc 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 3a8bf5c9e920b..6149fad91345f 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 0a43979813c18..0000000000000 --- 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 33ae887aa6aea..2c29974d55284 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 32e9e0cb58ab6..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..910ae60d10438 --- /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 0000000000000..a566be23b4893 --- /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 0000000000000..7b6250290ad81 --- /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 0000000000000..be7bc25d1dfa3 --- /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 0000000000000..9cfc468cba5a7 --- /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 0000000000000..264f137bd0657 --- /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 0000000000000..3af3934850762 --- /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/conandata.yml b/recipes/entt/3.x.x/conandata.yml index b55145bf44224..24bd7f949e5dc 100644 --- a/recipes/entt/3.x.x/conandata.yml +++ b/recipes/entt/3.x.x/conandata.yml @@ -1,67 +1,19 @@ sources: + "3.12.2": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.12.2.tar.gz" + sha256: "3F3E43988218DAECC0530CCAF45E960F7F7416E1FCF2C69799160C18B6A2FEE3" "3.11.1": url: "https://github.com/skypjack/entt/archive/refs/tags/v3.11.1.tar.gz" sha256: "0ac010f232d3089200c5e545bcbd6480cf68b705de6930d8ff7cdb0a29f5b47b" - "3.11.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.11.0.tar.gz" - sha256: "7cca2bd4d4aeef6c5bdbe06b9e047e7f2519ebaff901207cc81ac71a2bbe185e" "3.10.3": url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.3.tar.gz" sha256: "315918fc678e89a326ce1c13b0e9d3e53882dd9c58a63fef413325917a5c753b" - "3.10.1": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.1.tar.gz" - sha256: "f7031545130bfc06f5fe6b2f8c87dcbd4c1254fab86657e2788b70dfeea57965" - "3.10.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.0.tar.gz" - sha256: "4c716cebf4f2964824da158dd58cc81d9f1e056a083538e22fb03ae2d64805ee" - "3.9.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.9.0.tar.gz" - sha256: "1b06f1f6627c3702486855877bdeab6885f5d821d3dd78862126d4308c627c23" - "3.8.1": - url: "https://github.com/skypjack/entt/archive/v3.8.1.tar.gz" - sha256: "a2b767f06bca67a73a4d71fb9ebb6ed823bb5146faad3c282b9dbbbdae1aa01b" - "3.8.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.8.0.tar.gz" - sha256: "71c8ff5a604e8e214571a8b2218dfeaf61be59e2fe2ff5b550b4810c37d4da3c" - "3.7.1": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.7.1.tar.gz" - sha256: "fe3ce773c17797c0c57ffa97f73902854fcc8e7afc7e09bea373e0c64fa24a23" - "3.7.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.7.0.tar.gz" - sha256: "39ad5c42acf3434f8c37e0baa18a8cb562c0845383a6b4da17fdbacc9f0a7695" - "3.6.0": - url: "https://github.com/skypjack/entt/archive/v3.6.0.tar.gz" - sha256: "94b7dc874acd0961cfc28cf6b0342eeb0b7c58250ddde8bdc6c101e84b74c190" - "3.5.2": - url: "https://github.com/skypjack/entt/archive/v3.5.2.tar.gz" - sha256: "f9271293c44518386c402c9a2188627819748f66302df48af4f6d08e30661036" - "3.5.1": - url: "https://github.com/skypjack/entt/archive/v3.5.1.tar.gz" - sha256: "f442ece6881ec24863e7f0fbdc4bf641e01b0f87955f49dc4687b2fa564e9c83" - "3.5.0": - url: "https://github.com/skypjack/entt/archive/v3.5.0.tar.gz" - sha256: "89cba5ddf90bcec0dcf8d9554d9acf5ad86f5ce305e3acacf795007ee65c93f8" - "3.4.0": - url: "https://github.com/skypjack/entt/archive/v3.4.0.tar.gz" - sha256: "07086b8c5b1d84a1b76b39b0ce257c36c4f1521b77e664368b3d5ca7c00264e2" - "3.3.2": - url: "https://github.com/skypjack/entt/archive/v3.3.2.tar.gz" - sha256: "150cd89b45bffbcd7643d39bbce282e8fa38307bb5ed25567b79e337376ba1c7" - "3.3.1": - url: "https://github.com/skypjack/entt/archive/v3.3.1.tar.gz" - sha256: "432f31a80fb0463960dfd36e103c206dd67f1bfa91fc48408594c28aa790a3f5" - "3.3.0": - url: "https://github.com/skypjack/entt/archive/v3.3.0.tar.gz" - sha256: "d21a45df4960adc86a8f23a8c3c0cea6d2cecc4ef6946a8040e336d8e5266ab3" - "3.2.2": - url: "https://github.com/skypjack/entt/archive/v3.2.2.tar.gz" - sha256: "94592270b6750dd0b057a4af9d2c1ea8798369b3bb127927a8f70db232808f93" patches: - "3.11.1": - - patch_file: "patches/0001-3.11.0-fix-gcc-7.0-7.3.patch" + "3.12.2": + - patch_file: "patches/0002-3.12.1-fix-gcc-7.0-7.3.patch" patch_description: "Fix GCC 7.0 to 7.3" patch_type: "portability" - "3.11.0": + "3.11.1": - patch_file: "patches/0001-3.11.0-fix-gcc-7.0-7.3.patch" patch_description: "Fix GCC 7.0 to 7.3" patch_type: "portability" diff --git a/recipes/entt/3.x.x/conanfile.py b/recipes/entt/3.x.x/conanfile.py index bcce48c1ce46c..3247530d794dc 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/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch b/recipes/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch new file mode 100644 index 0000000000000..d3cb85f5fbcc6 --- /dev/null +++ b/recipes/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch @@ -0,0 +1,20 @@ +--- a/src/entt/meta/meta.hpp ++++ b/src/entt/meta/meta.hpp +@@ -1688,7 +1688,7 @@ public: + using reference = value_type; + using iterator_category = std::input_iterator_tag; + +- constexpr meta_iterator() noexcept ++ meta_iterator() noexcept + : ctx{}, + vtable{}, + handle{} {} +@@ -1782,7 +1782,7 @@ public: + using reference = value_type; + using iterator_category = std::input_iterator_tag; + +- constexpr meta_iterator() noexcept ++ meta_iterator() noexcept + : ctx{}, + vtable{}, + handle{} {} diff --git a/recipes/entt/config.yml b/recipes/entt/config.yml index 0000b93d983f2..3eaedc6257e18 100644 --- a/recipes/entt/config.yml +++ b/recipes/entt/config.yml @@ -1,39 +1,7 @@ versions: - "3.11.1": + "3.12.2": folder: 3.x.x - "3.11.0": + "3.11.1": folder: 3.x.x "3.10.3": folder: 3.x.x - "3.10.1": - folder: 3.x.x - "3.10.0": - folder: 3.x.x - "3.9.0": - folder: 3.x.x - "3.8.1": - folder: 3.x.x - "3.8.0": - folder: 3.x.x - "3.7.1": - folder: 3.x.x - "3.7.0": - folder: 3.x.x - "3.6.0": - folder: 3.x.x - "3.5.2": - folder: 3.x.x - "3.5.1": - folder: 3.x.x - "3.5.0": - folder: 3.x.x - "3.4.0": - folder: 3.x.x - "3.3.2": - folder: 3.x.x - "3.3.1": - folder: 3.x.x - "3.3.0": - folder: 3.x.x - "3.2.2": - folder: 3.x.x diff --git a/recipes/enum-flags/all/conanfile.py b/recipes/enum-flags/all/conanfile.py index 81ac78601093a..5d86c60a02e47 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 c986d294c7547..0000000000000 --- 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 c09fa8bdc3d9b..a0bae7c1226dd 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 4a9a0df7d2266..0293dc8b7a996 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 aede60e3b1e4a..174341b077e2c 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 4903f1a7e8fa0..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..6c9d5dba712c7 --- /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 fd3a53c2138bb..e5e54e89f5ce3 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 8d5920de9d2e0..332722f9d1b68 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 e900db203f73f..be00a8c7f57c7 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 0000000000000..90bf836e839d3 --- /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 0000000000000..b8c0665ba0213 --- /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 0000000000000..5a5d08dd645f7 --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..da1378296d29d --- /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 0000000000000..715e55357a17b --- /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 8cb6346b5426d..74e149bfbcab5 100644 --- a/recipes/etl/all/conandata.yml +++ b/recipes/etl/all/conandata.yml @@ -1,4 +1,37 @@ sources: + "20.38.10": + url: "https://github.com/ETLCPP/etl/archive/20.38.10.tar.gz" + sha256: "562f9b5d9e6786350b09d87be9c5f030073e34d7bf0a975de3e91476ddd471a3" + "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" + "20.37.0": + url: "https://github.com/ETLCPP/etl/archive/20.37.0.tar.gz" + sha256: "94ffb30dc38b9f40566ba7c4ef0c233bca23cfcb4e6c400fcf981729a46413eb" + "20.36.0": + url: "https://github.com/ETLCPP/etl/archive/20.36.0.tar.gz" + sha256: "bcab607d619008c7e3942ecc9cb429e17deb553c81bc5f1fd013fbc1e17f1344" "20.35.14": url: "https://github.com/ETLCPP/etl/archive/20.35.14.tar.gz" sha256: "6af1baf039d38f405f932451615f9bcf227f5767b463f33e17fcbbbc02e4632e" @@ -11,27 +44,6 @@ sources: "20.35.7": url: "https://github.com/ETLCPP/etl/archive/20.35.7.tar.gz" sha256: "20127e36c12a33142645dd5ec0a08d12b34ce9b33986847eeaa8c4201e025895" - "20.35.5": - url: "https://github.com/ETLCPP/etl/archive/20.35.5.tar.gz" - sha256: "d67aead4f1c023eaeb9ae67b62b0aed76138aa1b7dac48f627530ab3ea366281" - "20.35.0": - url: "https://github.com/ETLCPP/etl/archive/20.35.0.tar.gz" - sha256: "1bfbc5679bce41625add0e5d7354ab8521dc4811f13e1627a9816af65f49f42b" "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" - "20.31.3": - url: "https://github.com/ETLCPP/etl/archive/20.31.3.tar.gz" - sha256: "dabfeaec4e0aaee6920ee429ab262959595b78d65ef7846df13b5fe68ea85f4b" - "20.30.1": - url: "https://github.com/ETLCPP/etl/archive/20.30.1.tar.gz" - sha256: "10b50ca3ae406ae379e85504546843fc9d97be18924e71d8eb7e8e5a418e91cd" - "20.29.3": - url: "https://github.com/ETLCPP/etl/archive/20.29.3.tar.gz" - sha256: "8a0df2b475ea99bb27dd4ee04c39bda69e29be93b3709a1e243dcc2599e92ff4" diff --git a/recipes/etl/all/conanfile.py b/recipes/etl/all/conanfile.py index 2eacebb25e1f6..a1737588ee965 100644 --- a/recipes/etl/all/conanfile.py +++ b/recipes/etl/all/conanfile.py @@ -1,5 +1,6 @@ from conan import ConanFile from conan.tools.files import get, copy, save +from conan.tools.layout import basic_layout import os import textwrap @@ -18,12 +19,14 @@ class EmbeddedTemplateLibraryConan(ConanFile): 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], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass @@ -57,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 5755c51bbf480..abf67a0fae7ee 100644 --- a/recipes/etl/all/test_package/CMakeLists.txt +++ b/recipes/etl/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(etl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -target_link_libraries(${PROJECT_NAME} etl) +target_link_libraries(${PROJECT_NAME} PRIVATE etl::etl) diff --git a/recipes/etl/all/test_package/conanfile.py b/recipes/etl/all/test_package/conanfile.py index 220ec13c13be3..ef412253ccf80 100644 --- a/recipes/etl/all/test_package/conanfile.py +++ b/recipes/etl/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/etl/all/test_v1_package/CMakeLists.txt b/recipes/etl/all/test_v1_package/CMakeLists.txt index b8e7ad788b821..19dd51b438baa 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 8fa9e8f7bd7b9..57618035ca09f 100644 --- a/recipes/etl/config.yml +++ b/recipes/etl/config.yml @@ -1,25 +1,33 @@ versions: - "20.35.14": + "20.38.10": folder: all - "20.35.11": + "20.38.7": folder: all - "20.35.8": + "20.38.6": folder: all - "20.35.7": + "20.38.4": folder: all - "20.35.5": + "20.38.3": folder: all - "20.35.0": + "20.38.0": folder: all - "20.34.0": + "20.37.3": + folder: all + "20.37.2": + folder: all + "20.37.1": folder: all - "20.33.0": + "20.37.0": folder: all - "20.32.1": + "20.36.0": folder: all - "20.31.3": + "20.35.14": + folder: all + "20.35.11": folder: all - "20.30.1": + "20.35.8": folder: all - "20.29.3": + "20.35.7": + folder: all + "20.34.0": folder: all diff --git a/recipes/evmc/all/conandata.yml b/recipes/evmc/all/conandata.yml new file mode 100644 index 0000000000000..89f67a9cea549 --- /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 0000000000000..13c6e5da4cc78 --- /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 0000000000000..d3cab735f84a2 --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..2810a6cfce945 --- /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 0000000000000..78558509f0505 --- /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 63e5ef9836649..55858f820d83f 100644 --- a/recipes/exiv2/all/conandata.yml +++ b/recipes/exiv2/all/conandata.yml @@ -1,21 +1,14 @@ sources: + "0.28.1": + url: "https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.1.tar.gz" + sha256: "3078651f995cb6313b1041f07f4dd1bf0e9e4d394d6e2adc6e92ad0b621291fa" + "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" - "0.27.4": - url: "https://github.com/Exiv2/exiv2/releases/download/v0.27.4/exiv2-0.27.4-Source.tar.gz" - sha256: "84366dba7c162af9a7603bcd6c16f40fe0e9af294ba2fd2f66ffffb9fbec904e" patches: "0.27.5": - patch_file: "patches/0001-link-0.27.5.patch" - patch_file: "patches/0003-fix-ios.patch" - - patch_file: "patches/0004-find-expat.patch" - patch_description: "enforce usage of FindEXPAT.cmake" - patch_type: "conan" - "0.27.4": - - patch_file: "patches/0001-link.patch" - - patch_file: "patches/0002-fpic.patch" - - patch_file: "patches/0003-fix-ios.patch" - - patch_file: "patches/0004-find-expat.patch" - patch_description: "enforce usage of FindEXPAT.cmake" - patch_type: "conan" diff --git a/recipes/exiv2/all/conanfile.py b/recipes/exiv2/all/conanfile.py index 34ee99761cacc..8957750b23fe0 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.files import get, copy, rmdir, save, export_conandata_patches, apply_conandata_patches, replace_in_file +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,19 +128,33 @@ 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): tc.variables["EXIV2_ENABLE_DYNAMIC_RUNTIME"] = not is_msvc_static_runtime(self) - # set PIC manually because of object target exiv2_int + # set PIC manually because of the internal static library exiv2_int tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = bool(self.options.get_safe("fPIC", True)) tc.generate() deps = CMakeDeps(self) deps.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "POSITION_INDEPENDENT_CODE ON", "") + # Enforce usage of FindEXPAT.cmake + replace_in_file(self, os.path.join(self.source_folder, "cmake", "findDependencies.cmake"), + "find_package(EXPAT REQUIRED)", "find_package(EXPAT REQUIRED MODULE)") + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -145,6 +203,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 +216,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.27.5.patch b/recipes/exiv2/all/patches/0001-link-0.27.5.patch index b94b7e7a8c10c..54a08d019d541 100644 --- a/recipes/exiv2/all/patches/0001-link-0.27.5.patch +++ b/recipes/exiv2/all/patches/0001-link-0.27.5.patch @@ -1,19 +1,3 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 26e5a951..141211ef 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -142,11 +142,6 @@ 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}) - target_include_directories(exiv2lib SYSTEM PRIVATE diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt index a22698fb..9ef87970 100644 --- a/xmpsdk/CMakeLists.txt diff --git a/recipes/exiv2/all/patches/0001-link.patch b/recipes/exiv2/all/patches/0001-link.patch deleted file mode 100644 index fd93d6c5c3698..0000000000000 --- a/recipes/exiv2/all/patches/0001-link.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index c52b352f..2c270c5f 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -215,7 +215,7 @@ else() - endif() - - if( EXIV2_ENABLE_PNG ) -- target_link_libraries( exiv2lib PRIVATE $) -+ target_link_libraries( exiv2lib PRIVATE ZLIB::ZLIB) - endif() - - if( EXIV2_ENABLE_NLS ) -diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt -index a22698fb..9ef87970 100644 ---- a/xmpsdk/CMakeLists.txt -+++ b/xmpsdk/CMakeLists.txt -@@ -28,7 +28,7 @@ add_library(exiv2-xmp STATIC - - target_link_libraries(exiv2-xmp - PRIVATE -- $ -+ EXPAT::EXPAT - ) - - target_include_directories(exiv2-xmp diff --git a/recipes/exiv2/all/patches/0002-fpic.patch b/recipes/exiv2/all/patches/0002-fpic.patch deleted file mode 100644 index 680f251bd8de4..0000000000000 --- a/recipes/exiv2/all/patches/0002-fpic.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index c52b352f..92fcd847 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -142,11 +142,6 @@ 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 --) -- - target_include_directories(exiv2lib_int PRIVATE ${ZLIB_INCLUDE_DIR}) - target_include_directories(exiv2lib PRIVATE - $ diff --git a/recipes/exiv2/all/patches/0004-find-expat.patch b/recipes/exiv2/all/patches/0004-find-expat.patch deleted file mode 100644 index 5bb571eb0f807..0000000000000 --- a/recipes/exiv2/all/patches/0004-find-expat.patch +++ /dev/null @@ -1,15 +0,0 @@ -Ensure to use FindEXPAT.cmake instead of expat-config.cmake -(side effect of CMAKE_FIND_PACKAGE_PREFER_CONFIG ON, see https://github.com/conan-io/conan/issues/10387) -diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake -index ec3a43f5..27bf42d3 100644 ---- a/cmake/findDependencies.cmake -+++ b/cmake/findDependencies.cmake -@@ -42,7 +42,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 () diff --git a/recipes/exiv2/all/test_package/CMakeLists.txt b/recipes/exiv2/all/test_package/CMakeLists.txt index 3bd4318c428ba..69bbd22508c9b 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 470d3a327a30b..d503f95292a28 100644 --- a/recipes/exiv2/config.yml +++ b/recipes/exiv2/config.yml @@ -1,5 +1,7 @@ versions: - "0.27.5": + "0.28.1": + folder: all + "0.28.0": folder: all - "0.27.4": + "0.27.5": folder: all diff --git a/recipes/expat/all/conanfile.py b/recipes/expat/all/conanfile.py index 36b0654037e28..baaf7c03c6cca 100644 --- a/recipes/expat/all/conanfile.py +++ b/recipes/expat/all/conanfile.py @@ -20,11 +20,13 @@ class ExpatConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "char_type": ["char", "wchar_t", "ushort"], + "large_size": [True, False], } default_options = { "shared": False, "fPIC": True, "char_type": "char", + "large_size": False, } def export_sources(self): @@ -57,6 +59,7 @@ def generate(self): if is_msvc(self): tc.variables["EXPAT_MSVC_STATIC_CRT"] = is_msvc_static_runtime(self) tc.variables["EXPAT_BUILD_PKGCONFIG"] = False + tc.variables["EXPAT_LARGE_SIZE"] = self.options.large_size tc.generate() def build(self): @@ -88,6 +91,8 @@ def package_info(self): self.cpp_info.defines.append("XML_UNICODE") elif self.options.get_safe("char_type") == "wchar_t": self.cpp_info.defines.append("XML_UNICODE_WCHAR_T") + if self.options.large_size: + self.cpp_info.defines.append("XML_LARGE_SIZE") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/expected-lite/all/conanfile.py b/recipes/expected-lite/all/conanfile.py index d5786a1bd1873..591dbe00d1ead 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 c1c71096d72a6..1879a975409f5 100644 --- a/recipes/extra-cmake-modules/all/conandata.yml +++ b/recipes/extra-cmake-modules/all/conandata.yml @@ -1,13 +1,22 @@ 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.113.0": + url: "https://download.kde.org/stable/frameworks/5.113/extra-cmake-modules-5.113.0.tar.xz" + sha256: "265e5440eebeca07351a469e617a4bf35748927bd907b00ace9c018392bb3bc4" + "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 260ac51ba3a9a..21a22cc3ddea8 100644 --- a/recipes/extra-cmake-modules/all/conanfile.py +++ b/recipes/extra-cmake-modules/all/conanfile.py @@ -1,56 +1,71 @@ 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 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" - generators = "cmake" - no_copy_source = False + package_type = "build-scripts" + settings = "os", "arch", "compiler", "build_type" + short_paths = True + + def layout(self): + cmake_layout(self, src_folder="src") - _cmake = None + def package_id(self): + self.info.clear() - @property - def _source_subfolder(self): - return "source_subfolder" + def build_requirements(self): + if Version(self.version) >= "5.84.0": + self.tool_requires("cmake/[>=3.16 <4]") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("extra-cmake-modules-{}".format(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 + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_HTML_DOCS"] = False + tc.cache_variables["BUILD_QTHELP_DOCS"] = False + tc.cache_variables["BUILD_MAN_DOCS"] = False + tc.cache_variables["BUILD_TESTING"] = False - # KB-H016: do not install Find*.cmake - tools.replace_path_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "install(FILES ${installFindModuleFiles} DESTINATION ${FIND_MODULES_INSTALL_DIR})", "") + if self.package_folder is None: + share_folder = "res" + else: + share_folder = os.path.join(self.package_folder, "res").replace("\\", "/") - self._cmake = CMake(self) - self._cmake.definitions["BUILD_HTML_DOCS"] = False - self._cmake.definitions["BUILD_QTHELP_DOCS"] = False - self._cmake.definitions["BUILD_MAN_DOCS"] = False - self._cmake.definitions["SHARE_INSTALL_DIR"] = os.path.join(self.package_folder, "res") - self._cmake.configure(source_folder=os.path.join(self.source_folder, self._source_subfolder)) - return self._cmake + tc.cache_variables["SHARE_INSTALL_DIR"] = share_folder + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + 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() - self.copy("testhelper.h", src=os.path.join(self.source_folder, self._source_subfolder, "tests/ECMAddTests"), dst="res/tests") - self.copy("*", src=os.path.join(self.source_folder, self._source_subfolder, "LICENSES"), dst="licenses") def package_info(self): - self.cpp_info.resdirs = ["res"] - self.cpp_info.builddirs = ["res/ECM/cmake", "res/ECM/kde-modules", "res/ECM/modules", "res/ECM/test-modules", "res/ECM/toolchain"] - - def package_id(self): - self.info.header_only() + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.set_property("cmake_find_mode", "none") + for dirname in ["cmake", "find-modules", "kde-modules", "toolchain", + "modules", "test-modules"]: + self.cpp_info.builddirs.append(os.path.join("res", "ECM", dirname)) diff --git a/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt b/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt index 96f9cb73534c7..fa47b1a420453 100644 --- a/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt +++ b/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(ECM REQUIRED NO_MODULE) @@ -17,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 1ffe0933a5715..c8c6fef7966a6 100644 --- a/recipes/extra-cmake-modules/all/test_package/conanfile.py +++ b/recipes/extra-cmake-modules/all/test_package/conanfile.py @@ -1,9 +1,25 @@ -from conans import ConanFile, CMake, tools +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" - generators = "cmake" + +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) @@ -11,7 +27,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/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 c17f03346f04f..789c28809f9ae 100644 --- a/recipes/extra-cmake-modules/config.yml +++ b/recipes/extra-cmake-modules/config.yml @@ -1,9 +1,15 @@ versions: - "5.75.0": + "5.113.0": folder: "all" - "5.80.0": + "5.111.0": folder: "all" - "5.84.0": + "5.108.0": folder: "all" "5.93.0": folder: "all" + "5.84.0": + folder: "all" + "5.80.0": + folder: "all" + "5.75.0": + folder: "all" diff --git a/recipes/ezc3d/all/conandata.yml b/recipes/ezc3d/all/conandata.yml index 7c22e7d856992..4d18399acd0fa 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 3d5d9b1cd1d49..9f04ee1babe86 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 101a73acd4cc4..5fff9951f937e 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 821c0ce34e387..93fa295330a4d 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 bc2658ff1b34e..6beebe71b3c83 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 6a9ba77868449..021355947389f 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 c39c56b44ddc4..be8d79ee8f187 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 0000000000000..40b2a62ac988a --- /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 3a437b366c3c4..f7a2f9396b6e8 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 3527dfb5e8511..9cc6db5bd0315 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 f20fc50349a4e..8073da0d1b137 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 ca068b831644c..ef08a7439d5d1 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 c53b3fb245385..be00a8c7f57c7 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 b9e90bef53612..ab4d2d857dbe4 100644 --- a/recipes/fast-dds/all/conandata.yml +++ b/recipes/fast-dds/all/conandata.yml @@ -1,4 +1,13 @@ 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" "2.3.4": url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.3.4.tar.gz" sha256: "b1b2322de0ca55a16495666e3fbda8aca32b888bbfaecda29f2ffc4b072ef7ac" @@ -9,6 +18,18 @@ 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" + patch_description: "Fixup find asio and tinyxml2" "2.3.4": - patch_file: "patches/2.3.X-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 f65eb37516bb2..e8ad7b42a13f0 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,12 +71,11 @@ def layout(self): def requirements(self): self.requires("tinyxml2/9.0.0") - self.requires("asio/1.21.0") - self.requires("fast-cdr/1.0.26", transitive_headers=True, transitive_libs=True) + 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") - self.requires("boost/1.75.0") # boost/1.76 is required by version 2.3.2, boost/1.75.0 required for 2.3.3 by Windows if self.options.with_ssl: - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.compiler.cppstd: @@ -91,6 +92,10 @@ def validate(self): # linking dynamic '*.dll' and static MT runtime raise ConanInvalidConfiguration("Mixing a dll {} library with a static runtime is a bad idea".format(self.name)) + def build_requirements(self): + if Version(self.version) >= "2.7.0": + self.tool_requires("cmake/[>=3.16.3 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -163,7 +168,6 @@ def package_info(self): "asio::asio", "tinyxml2::tinyxml2", "foonathan-memory::foonathan-memory", - "boost::boost", ] if self.settings.os in ["Linux", "FreeBSD", "Neutrino"]: self.cpp_info.components["fastrtps"].system_libs.append("pthread") diff --git a/recipes/fast-dds/all/patches/2.10.1-0001-fix-find-asio-and-tinyxml2.patch b/recipes/fast-dds/all/patches/2.10.1-0001-fix-find-asio-and-tinyxml2.patch new file mode 100644 index 0000000000000..bada751126e81 --- /dev/null +++ b/recipes/fast-dds/all/patches/2.10.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/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 0000000000000..bada751126e81 --- /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 e8d99700ff1a0..1a933c21ca9ca 100644 --- a/recipes/fast-dds/config.yml +++ b/recipes/fast-dds/config.yml @@ -1,4 +1,10 @@ versions: + "2.11.2": + folder: all + "2.11.1": + folder: all + "2.10.1": + folder: all "2.3.4": folder: all "2.3.3": diff --git a/recipes/fast_double_parser/all/conanfile.py b/recipes/fast_double_parser/all/conanfile.py index a704c8e783d7f..872d82f578707 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 c3fef89b2a998..291d202302e37 100644 --- a/recipes/fast_float/all/conandata.yml +++ b/recipes/fast_float/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "6.0.0": + url: "https://github.com/fastfloat/fast_float/archive/v6.0.0.tar.gz" + sha256: "7e98671ef4cc7ed7f44b3b13f80156c8d2d9244fac55deace28bd05b0a2c7c8e" + "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" + "5.1.0": + url: "https://github.com/fastfloat/fast_float/archive/v5.1.0.tar.gz" + sha256: "37a0de5473ed6b9617ea4c199c2d5bda45ab027dbe72220fe36cf3000f9f23bf" + "5.0.0": + url: "https://github.com/fastfloat/fast_float/archive/v5.0.0.tar.gz" + sha256: "86645ab4af22d21d4ba2d980572dfb74faf90c20c52240d7d8d2201f3eaf4252" "4.0.0": url: "https://github.com/fastfloat/fast_float/archive/v4.0.0.tar.gz" sha256: "9470f229b9ea8d116af7c92f2ab8e8ae6b3c3225d15081b859634328f28d4664" diff --git a/recipes/fast_float/all/conanfile.py b/recipes/fast_float/all/conanfile.py index dd07baab915bd..ec98c563d0552 100644 --- a/recipes/fast_float/all/conanfile.py +++ b/recipes/fast_float/all/conanfile.py @@ -10,8 +10,8 @@ class FastFloatConan(ConanFile): name = "fast_float" description = "Fast and exact implementation of the C++ from_chars " \ "functions for float and double types." - license = ("Apache-2.0", "MIT") - topics = ("fast_float", "conversion", "from_chars", "header-only") + license = ("Apache-2.0", "MIT", "BSL-1.0") + topics = ("conversion", "from_chars", "header-only") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/fastfloat/fast_float" package_type = "header-library" diff --git a/recipes/fast_float/config.yml b/recipes/fast_float/config.yml index 853456106d279..4e03f0967676d 100644 --- a/recipes/fast_float/config.yml +++ b/recipes/fast_float/config.yml @@ -1,4 +1,14 @@ versions: + "6.0.0": + folder: all + "5.3.0": + folder: all + "5.2.0": + folder: all + "5.1.0": + folder: all + "5.0.0": + folder: all "4.0.0": folder: all "3.11.0": diff --git a/recipes/fastgltf/all/conandata.yml b/recipes/fastgltf/all/conandata.yml new file mode 100644 index 0000000000000..7785359a1abd0 --- /dev/null +++ b/recipes/fastgltf/all/conandata.yml @@ -0,0 +1,21 @@ +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" + "0.4.0": + 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" + patch_type: "conan" + patch_source: "https://github.com/spnda/fastgltf/issues/22" diff --git a/recipes/fastgltf/all/conanfile.py b/recipes/fastgltf/all/conanfile.py new file mode 100644 index 0000000000000..9eda29e2b49eb --- /dev/null +++ b/recipes/fastgltf/all/conanfile.py @@ -0,0 +1,110 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +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 + +import os + +required_conan_version = ">=1.59.0" + + +class fastgltf(ConanFile): + name = "fastgltf" + 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" + topics = ("gltf", "simd", "cpp17") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "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 + 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 + + 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") + + def layout(self): + cmake_layout(self, src_folder='src') + + def requirements(self): + self.requires("simdjson/3.2.0") + + 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 generate(self): + tc = CMakeToolchain(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() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["fastgltf"] diff --git a/recipes/fastgltf/all/patches/0.5.0-0001-find_package-simdjson.patch b/recipes/fastgltf/all/patches/0.5.0-0001-find_package-simdjson.patch new file mode 100644 index 0000000000000..488ed53394d16 --- /dev/null +++ b/recipes/fastgltf/all/patches/0.5.0-0001-find_package-simdjson.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f76a8d8..27c1d1a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,6 +74,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/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 0000000000000..d3ad49785a09a --- /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/all/test_package/CMakeLists.txt b/recipes/fastgltf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7718a933cdc53 --- /dev/null +++ b/recipes/fastgltf/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(fastgltf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fastgltf::fastgltf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(fastgltf_VERSION VERSION_GREATER_EQUAL "0.5.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE FASTGLTF_0_5_0_LATER) +endif() diff --git a/recipes/fastgltf/all/test_package/conanfile.py b/recipes/fastgltf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/fastgltf/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/fastgltf/all/test_package/test_package.cpp b/recipes/fastgltf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1e9f5938b4446 --- /dev/null +++ b/recipes/fastgltf/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#ifdef FASTGLTF_0_5_0_LATER +# include +#else +# include +#endif + +#include +#include + +int main() { +#ifdef FASTGLTF_0_5_0_LATER + // gcc < 11 uses pthread_once for std::call_once. + // there is an known bug about pthread_once with older glibc. + // This is workaround for that. + // see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60662 + std::this_thread::sleep_for(std::chrono::milliseconds(1)); +#endif + + fastgltf::Parser parser; + printf("Version: " FASTGLTF_QUOTE(FASTGLTF_VERSION) "\n"); + printf("C++17: " FASTGLTF_QUOTE(FASTGLTF_CPP_17) "\n"); + printf("C++20: " FASTGLTF_QUOTE(FASTGLTF_CPP_20) "\n"); +} diff --git a/recipes/fastgltf/all/test_v1_package/CMakeLists.txt b/recipes/fastgltf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/fastgltf/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/soplex/all/test_v1_package/conanfile.py b/recipes/fastgltf/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/soplex/all/test_v1_package/conanfile.py rename to recipes/fastgltf/all/test_v1_package/conanfile.py diff --git a/recipes/fastgltf/config.yml b/recipes/fastgltf/config.yml new file mode 100644 index 0000000000000..355c180a5e90b --- /dev/null +++ b/recipes/fastgltf/config.yml @@ -0,0 +1,7 @@ +versions: + "0.6.1": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/fastnoise2/all/conandata.yml b/recipes/fastnoise2/all/conandata.yml new file mode 100644 index 0000000000000..63afd14b04674 --- /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 0000000000000..15602b9b08499 --- /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 0000000000000..4c5f6ffc5d5fe --- /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 0000000000000..f5cf204295e19 --- /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 0000000000000..0dd8b950d971d --- /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 0000000000000..a75277535cb78 --- /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 c83ba01f89440..5c6a15b03e066 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 48499fa0989d9..e845ae751a301 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/fernandovelcic-hexdump/all/conanfile.py b/recipes/fernandovelcic-hexdump/all/conanfile.py index 0f297f7cfa6c3..5497ae1f74ccd 100644 --- a/recipes/fernandovelcic-hexdump/all/conanfile.py +++ b/recipes/fernandovelcic-hexdump/all/conanfile.py @@ -1,24 +1,46 @@ -from conans import ConanFile, tools +import os + +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 FernandoVelcicHexdumpConan(ConanFile): name = "fernandovelcic-hexdump" description = "A header-only hexdump library." license = ["BSD-3-Clause"] - topics = ("hexadecimal", "hexdump", "inspection", "debug") - homepage = "https://github.com/FernandoVelcic/hexdump" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/FernandoVelcic/hexdump" + topics = ("hexadecimal", "hexdump", "inspection", "debug", "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], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - self.copy(pattern="hexdump.hpp", dst="include", src=self._source_subfolder) + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="hexdump.hpp", dst=os.path.join(self.package_folder, "include"), 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/fernandovelcic-hexdump/all/test_package/CMakeLists.txt b/recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt index 5e81affac8e80..3d3b2a5ec56bc 100644 --- a/recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt +++ b/recipes/fernandovelcic-hexdump/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(fernandovelcic-hexdump CONFIG REQUIRED) diff --git a/recipes/fernandovelcic-hexdump/all/test_package/conanfile.py b/recipes/fernandovelcic-hexdump/all/test_package/conanfile.py index 84ee68733e516..ef5d7042163ec 100644 --- a/recipes/fernandovelcic-hexdump/all/test_package/conanfile.py +++ b/recipes/fernandovelcic-hexdump/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/fernandovelcic-hexdump/all/test_package/test_package.cpp b/recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp index d9f8d0c243fcc..878b57bcdb438 100644 --- a/recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp +++ b/recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp @@ -29,6 +29,6 @@ int main(int argc, char **argv) testCustomHexdumpBase(); testCustomHexdumpBase(); testCustomHexdumpBase(); - + return 0; } diff --git a/recipes/fernandovelcic-hexdump/all/test_v1_package/CMakeLists.txt b/recipes/fernandovelcic-hexdump/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/fernandovelcic-hexdump/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/fernandovelcic-hexdump/all/test_v1_package/conanfile.py b/recipes/fernandovelcic-hexdump/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..84ee68733e516 --- /dev/null +++ b/recipes/fernandovelcic-hexdump/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/fff/all/conanfile.py b/recipes/fff/all/conanfile.py index b4367b0a79cab..04306861f2e25 100644 --- a/recipes/fff/all/conanfile.py +++ b/recipes/fff/all/conanfile.py @@ -1,26 +1,46 @@ -from conans import ConanFile, tools import os -class TypeSafe(ConanFile): - name = 'fff' - description = 'A testing micro framework for creating function test doubles' - url = 'https://github.com/conan-io/conan-center-index' - homepage = 'https://github.com/meekrosoft/fff' - license = 'MIT' - topics = 'conan', 'c', 'c++', 'embedded', 'tdd', 'micro-framework', 'fake-functions' +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 FffConan(ConanFile): + name = "fff" + description = "A testing micro framework for creating function test doubles" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/meekrosoft/fff" + topics = ("c", "c++", "embedded", "tdd", "micro-framework", "fake-functions", "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], strip_root=True, destination=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("fff.h", dst="include", src=self._source_subfolder) + copy( + self, + "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + "fff.h", + dst=os.path.join(self.package_folder, "include"), + 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/fff/all/test_package/CMakeLists.txt b/recipes/fff/all/test_package/CMakeLists.txt index 196188113685c..7547d9c0590d3 100644 --- a/recipes/fff/all/test_package/CMakeLists.txt +++ b/recipes/fff/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(fff REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE fff::fff) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fff/all/test_package/conanfile.py b/recipes/fff/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/fff/all/test_package/conanfile.py +++ b/recipes/fff/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/fff/all/test_package/test_package.cpp b/recipes/fff/all/test_package/test_package.cpp index 80fdb032c8ac4..fabe3f8985bb5 100644 --- a/recipes/fff/all/test_package/test_package.cpp +++ b/recipes/fff/all/test_package/test_package.cpp @@ -1,16 +1,16 @@ -#include -#include "fff.h" +#include + +#include DEFINE_FFF_GLOBALS; FAKE_VOID_FUNC(TestFunction, uint32_t, uint8_t); -int main() -{ - RESET_FAKE(TestFunction); - FFF_RESET_HISTORY(); - - TestFunction(8, 16); - - return 0; +int main() { + RESET_FAKE(TestFunction); + FFF_RESET_HISTORY(); + + TestFunction(8, 16); + + return 0; } diff --git a/recipes/ffmpeg/all/conandata.yml b/recipes/ffmpeg/all/conandata.yml index 89651174ed1ed..83ed14628cf42 100644 --- a/recipes/ffmpeg/all/conandata.yml +++ b/recipes/ffmpeg/all/conandata.yml @@ -1,10 +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 b68accaf3f292..b62169338c0de 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.1") + 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.0") + 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 c829a400b90aa..0ea4ae6cca888 100644 --- a/recipes/ffmpeg/config.yml +++ b/recipes/ffmpeg/config.yml @@ -1,8 +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 633f3bfb2dc71..ef1e6d55efb6e 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 3943d935ac8c2..e2445bdf7545e 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 ae78315e3f3d3..bf64344b75e94 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 b098fdf9507b1..41b92c011b487 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 0608a56e96b9b..bc42b2f516ea2 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/fire-hpp/all/conanfile.py b/recipes/fire-hpp/all/conanfile.py index e2770d10a2f50..79b1be52cfefe 100644 --- a/recipes/fire-hpp/all/conanfile.py +++ b/recipes/fire-hpp/all/conanfile.py @@ -1,43 +1,54 @@ -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 copy, get, rmdir + +required_conan_version = ">=1.52.0" + + class FireHppConan(ConanFile): name = "fire-hpp" - homepage = "https://github.com/kongaskristjan/fire-hpp" - url = "https://github.com/conan-io/conan-center-index" description = "Fire for C++: Create fully functional CLIs using function signatures" - topics = ("command-line", "argument", "parser") license = "BSL-1.0" - no_copy_source = True - settings = "os", "arch", "compiler", "build_type" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kongaskristjan/fire-hpp" + topics = ("command-line", "argument", "parser", "header-only") - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" - _cmake = None + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" def configure(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + + def layout(self): + cmake_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 = "{}-{}".format(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["FIRE_EXAMPLES"] = False - self._cmake.definitions["FIRE_UNIT_TESTS"] = False - self._cmake.configure(source_folder=self._source_subfolder, 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["FIRE_EXAMPLES"] = False + tc.variables["FIRE_UNIT_TESTS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("LICENCE", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "lib")) + copy(self, "LICENCE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + rmdir(self, os.path.join(self.package_folder, "lib")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fire-hpp/all/test_package/CMakeLists.txt b/recipes/fire-hpp/all/test_package/CMakeLists.txt index 520f51ea73d4a..8068292a31341 100644 --- a/recipes/fire-hpp/all/test_package/CMakeLists.txt +++ b/recipes/fire-hpp/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() - -find_package(fire-hpp REQUIRED) +find_package(fire-hpp REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE fire-hpp::fire-hpp) diff --git a/recipes/fire-hpp/all/test_package/conanfile.py b/recipes/fire-hpp/all/test_package/conanfile.py index b6680c7d91280..1d145d1d569ec 100644 --- a/recipes/fire-hpp/all/test_package/conanfile.py +++ b/recipes/fire-hpp/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" + 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.settings): - bin_path = os.path.join("bin", "test_package") - bin_args = "-x=1 -y=2" - self.run("{} {}".format(bin_path, bin_args), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} -x=1 -y=2", env="conanrun") diff --git a/recipes/fire-hpp/all/test_package/test_package.cpp b/recipes/fire-hpp/all/test_package/test_package.cpp index 614e5b1984d23..39e02ea0720f9 100644 --- a/recipes/fire-hpp/all/test_package/test_package.cpp +++ b/recipes/fire-hpp/all/test_package/test_package.cpp @@ -2,8 +2,8 @@ #include int fired_main(int x = fire::arg("-x"), int y = fire::arg("-y")) { - std::cout << x + y << std::endl; - return 0; + std::cout << x + y << std::endl; + return 0; } FIRE(fired_main) diff --git a/recipes/flac/all/conandata.yml b/recipes/flac/all/conandata.yml index b0d1e5271b850..e2b6d7651827c 100644 --- a/recipes/flac/all/conandata.yml +++ b/recipes/flac/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.3": + url: "https://github.com/xiph/flac/releases/download/1.4.3/flac-1.4.3.tar.xz" + sha256: "6c58e69cd22348f441b861092b825e591d0b822e106de6eb0ee4d05d27205b70" "1.4.2": url: "https://github.com/xiph/flac/releases/download/1.4.2/flac-1.4.2.tar.xz" sha256: "e322d58a1f48d23d9dd38f432672865f6f79e73a6f9cc5a5f57fcaa83eb5a8e4" @@ -6,10 +9,6 @@ sources: url: "https://github.com/xiph/flac/archive/1.3.3.tar.gz" sha256: "668cdeab898a7dd43cf84739f7e1f3ed6b35ece2ef9968a5c7079fe9adfe1689" patches: - "1.4.2": - - patch_file: "patches/fix-cmake-1.4.2.patch" - patch_description: "Adapts find_package commands and install destination paths in CMakeLists.txt files." - patch_type: "conan" "1.3.3": - patch_file: "patches/fix-cmake-1.3.3.patch" patch_description: "Various adaptations in CMakeLists.txt files to improve compatibility with Conan." diff --git a/recipes/flac/all/conanfile.py b/recipes/flac/all/conanfile.py index e8e39c9a71f0a..e8bc14ed2a18c 100644 --- a/recipes/flac/all/conanfile.py +++ b/recipes/flac/all/conanfile.py @@ -1,7 +1,7 @@ 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, export_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir, replace_in_file from conan.tools.scm import Version import os @@ -63,8 +63,13 @@ def generate(self): envbuild = VirtualBuildEnv(self) envbuild.generate(scope="build") - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "src", "share", "getopt", "CMakeLists.txt"), + "find_package(Intl)", "") + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/flac/all/patches/fix-cmake-1.3.3.patch b/recipes/flac/all/patches/fix-cmake-1.3.3.patch index ec7db2f2d00aa..3c5a864e8bbd4 100644 --- a/recipes/flac/all/patches/fix-cmake-1.3.3.patch +++ b/recipes/flac/all/patches/fix-cmake-1.3.3.patch @@ -1,14 +1,5 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -13,7 +13,7 @@ option(BUILD_EXAMPLES "Build and install examples" ON) - option(WITH_OGG "ogg support (default: test for libogg)" ON) - - if(WITH_OGG) -- find_package(OGG REQUIRED) -+ find_package(Ogg REQUIRED CONFIG) - endif() - - if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") @@ -25,9 +25,6 @@ endif() if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef") @@ -55,12 +46,3 @@ install(TARGETS metaflac EXPORT targets - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + DESTINATION "${CMAKE_INSTALL_BINDIR}") ---- a/src/share/getopt/CMakeLists.txt -+++ b/src/share/getopt/CMakeLists.txt -@@ -1,6 +1,5 @@ - check_include_file("string.h" HAVE_STRING_H) - --find_package(Intl) - - add_library(getopt STATIC getopt.c getopt1.c) - diff --git a/recipes/flac/all/patches/fix-cmake-1.4.2.patch b/recipes/flac/all/patches/fix-cmake-1.4.2.patch deleted file mode 100644 index bd5a0ebdb6997..0000000000000 --- a/recipes/flac/all/patches/fix-cmake-1.4.2.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -43,7 +43,7 @@ if(WITH_OGG) - endif() - else() - if(NOT TARGET Ogg::ogg) -- find_package(Ogg REQUIRED) -+ find_package(Ogg REQUIRED CONFIG) - else() - set(OGG_FOUND 1 CACHE INTERNAL "ogg has already been built") - endif() ---- a/src/flac/CMakeLists.txt -+++ b/src/flac/CMakeLists.txt -@@ -21,4 +21,4 @@ target_link_libraries(flacapp - utf8) - - install(TARGETS flacapp EXPORT targets -- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") -+ DESTINATION "${CMAKE_INSTALL_BINDIR}") ---- a/src/metaflac/CMakeLists.txt -+++ b/src/metaflac/CMakeLists.txt -@@ -14,4 +14,4 @@ add_executable(metaflac - target_link_libraries(metaflac FLAC getopt utf8) - - install(TARGETS metaflac EXPORT targets -- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") -+ DESTINATION "${CMAKE_INSTALL_BINDIR}") ---- a/src/share/getopt/CMakeLists.txt -+++ b/src/share/getopt/CMakeLists.txt -@@ -1,8 +1,7 @@ - check_include_file("string.h" HAVE_STRING_H) - - if(NOT WIN32) -- find_package(Intl) - endif() - - add_library(getopt STATIC getopt.c getopt1.c) - diff --git a/recipes/flac/config.yml b/recipes/flac/config.yml index fac8ae5f33f51..05362b19fb86b 100644 --- a/recipes/flac/config.yml +++ b/recipes/flac/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.3": + folder: all "1.4.2": folder: all "1.3.3": diff --git a/recipes/flatbuffers/all/conandata.yml b/recipes/flatbuffers/all/conandata.yml index 8ec1c3ec389ea..bff177589ebd1 100644 --- a/recipes/flatbuffers/all/conandata.yml +++ b/recipes/flatbuffers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "23.5.26": + url: "https://github.com/google/flatbuffers/archive/v23.5.26.tar.gz" + sha256: "1cce06b17cddd896b6d73cc047e36a254fb8df4d7ea18a46acf16c4c0cd3f3f3" "23.3.3": url: "https://github.com/google/flatbuffers/archive/v23.3.3.tar.gz" sha256: "8aff985da30aaab37edf8e5b02fda33ed4cbdd962699a8e2af98fdef306f4e4d" diff --git a/recipes/flatbuffers/config.yml b/recipes/flatbuffers/config.yml index a6c4efcf09db7..58021445a86c5 100644 --- a/recipes/flatbuffers/config.yml +++ b/recipes/flatbuffers/config.yml @@ -1,4 +1,6 @@ versions: + "23.5.26": + folder: all "23.3.3": folder: all "23.1.21": diff --git a/recipes/flatbush/all/conandata.yml b/recipes/flatbush/all/conandata.yml index 3d50fc3bd1efd..f43d2fb04fed7 100644 --- a/recipes/flatbush/all/conandata.yml +++ b/recipes/flatbush/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/chusitoo/flatbush/archive/refs/tags/v1.2.0.zip" + sha256: "d8d0471ad6aba1e4b1160abc38a0fe21a35e3ea1c2a9509ce9910072f7fc24bb" "1.1.0": url: "https://github.com/chusitoo/flatbush/archive/refs/tags/v1.1.0.zip" sha256: "3ef034110b0ea6f7514d3cdc362976e2a9ab321cc9e4b2c847167ad26df0c0f1" diff --git a/recipes/flatbush/all/conanfile.py b/recipes/flatbush/all/conanfile.py index c9dd4bc6e1a67..b97d78e5d781a 100644 --- a/recipes/flatbush/all/conanfile.py +++ b/recipes/flatbush/all/conanfile.py @@ -1,25 +1,49 @@ -from conans import ConanFile, tools +import os + +from conan import ConanFile +from conan.tools.build import valid_min_cppstd, check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class FlatbushConan(ConanFile): name = "flatbush" - license = "MIT" - homepage = "https://github.com/chusitoo/flatbush" description = "Flatbush for C++" - topics = ("header-only", "flatbush", "r-tree", "hilbert", "zero-copy", "spatial-index") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/chusitoo/flatbush" + topics = ("header-only", "r-tree", "hilbert", "zero-copy", "spatial-index") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True) + @property + def _min_cppstd(self): + return 11 - def package(self): - self.copy(pattern="LICENSE", dst="licenses") - self.copy(pattern="flatbush.h", dst="include") + 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) + + 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, "flatbush.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) def package_info(self): - if not tools.valid_min_cppstd(self, "20"): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if not valid_min_cppstd(self, "20"): self.cpp_info.defines = ["FLATBUSH_SPAN"] diff --git a/recipes/flatbush/all/test_package/CMakeLists.txt b/recipes/flatbush/all/test_package/CMakeLists.txt index 6ad4f7bcfdd6b..96d337017953c 100644 --- a/recipes/flatbush/all/test_package/CMakeLists.txt +++ b/recipes/flatbush/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -project(test_package VERSION 1.0.0 LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) -find_package(flatbush CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} "test_package.cpp") +find_package(flatbush REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} flatbush::flatbush) - set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/flatbush/all/test_package/conanfile.py b/recipes/flatbush/all/test_package/conanfile.py index 5b0ef1df32f11..fae501d0afb9e 100644 --- a/recipes/flatbush/all/test_package/conanfile.py +++ b/recipes/flatbush/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools -from conans.tools import Version +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/flatbush/all/test_package/test_package.cpp b/recipes/flatbush/all/test_package/test_package.cpp index 36860193e4ed8..1db2b51eded51 100644 --- a/recipes/flatbush/all/test_package/test_package.cpp +++ b/recipes/flatbush/all/test_package/test_package.cpp @@ -24,8 +24,7 @@ SOFTWARE. #include "flatbush.h" -int main(int argc, char** argv) -{ +int main() { flatbush::FlatbushBuilder wBuilder; wBuilder.add({ 0, 0, 0, 0 }); auto wIndex = wBuilder.finish(); diff --git a/recipes/flatbush/all/test_v1_package/CMakeLists.txt b/recipes/flatbush/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/flatbush/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/flatbush/all/test_v1_package/conanfile.py b/recipes/flatbush/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5b0ef1df32f11 --- /dev/null +++ b/recipes/flatbush/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +from conans.tools import Version +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/flatbush/config.yml b/recipes/flatbush/config.yml index 11b7aff3a5ac4..2424e32f70b3e 100644 --- a/recipes/flatbush/config.yml +++ b/recipes/flatbush/config.yml @@ -1,3 +1,5 @@ versions: + "1.2.0": + folder: "all" "1.1.0": folder: "all" diff --git a/recipes/flecs/all/conandata.yml b/recipes/flecs/all/conandata.yml index d95e9e88c952a..aa41772cdfb91 100644 --- a/recipes/flecs/all/conandata.yml +++ b/recipes/flecs/all/conandata.yml @@ -1,4 +1,10 @@ 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" "3.1.4": url: "https://github.com/SanderMertens/flecs/archive/v3.1.4.tar.gz" sha256: "cc73d529ddc47891fc16c7dd965ca9c4239d1caccae024c81364bf3d49286fe0" diff --git a/recipes/flecs/config.yml b/recipes/flecs/config.yml index 6dd38fdadfe17..df52862429336 100644 --- a/recipes/flecs/config.yml +++ b/recipes/flecs/config.yml @@ -1,4 +1,8 @@ versions: + "3.2.8": + folder: all + "3.2.4": + folder: all "3.1.4": folder: all "3.1.3": diff --git a/recipes/flint/all/CMakeLists.txt b/recipes/flint/all/CMakeLists.txt deleted file mode 100644 index c986d294c7547..0000000000000 --- a/recipes/flint/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/flint/all/conandata.yml b/recipes/flint/all/conandata.yml index ca7fe5127f757..9430f00dbd6c3 100644 --- a/recipes/flint/all/conandata.yml +++ b/recipes/flint/all/conandata.yml @@ -1,18 +1,20 @@ sources: - "2.8.1": - url: "https://github.com/wbhart/flint2/archive/refs/tags/v2.8.1.tar.gz" - sha256: "93c4d6acd46d7a4357a2abe313e5f0625fa7e94a1a0e53048f9066f55a7acd49" + "3.0.1": + url: "https://github.com/flintlib/flint/releases/download/v3.0.1/flint-3.0.1.tar.xz" + sha256: "de9ada43c94a69de2e78a5241dc183a1c1ece11e45fe565da7272cf8ed818dd6" + "2.9.0": + url: "https://github.com/wbhart/flint2/archive/v2.9.0.tar.gz" + sha256: "624e0fc343b27a156c0e3bb48d2a644a1ac387aa66217f6753c03a02c80bbf6f" + "2.8.5": + url: "https://github.com/wbhart/flint2/archive/refs/tags/v2.8.5.tar.gz" + sha256: "4d5377e7432e67b0f34f95059a01d243ef29208da86ba3e812d312d323db0d8e" "2.7.1": url: "https://github.com/wbhart/flint2/archive/refs/tags/v2.7.1.tar.gz" - sha256: "bcadc2252e61092a9b3a3198b337e20abeac56078eaa19793ab99ff7a987efb7" + sha256: "80f1b7240f1ee5d15952c33cb0aa27b6395993fe897bc279ad984f4fc2743bd4" patches: - "2.8.1": - - patch_file: "patches/0001-cmake-2.8.1.patch" - base_path: "source_subfolder" + "2.9.0": + - patch_file: "patches/0002-msvc-alloca.patch" + "2.8.5": - patch_file: "patches/0002-msvc-alloca.patch" - base_path: "source_subfolder" "2.7.1": - - patch_file: "patches/0001-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-msvc-alloca.patch" - base_path: "source_subfolder" diff --git a/recipes/flint/all/conanfile.py b/recipes/flint/all/conanfile.py index 29a0ae933dc5f..ef8d2e43bc72f 100644 --- a/recipes/flint/all/conanfile.py +++ b/recipes/flint/all/conanfile.py @@ -1,19 +1,24 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +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, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class FlintConan(ConanFile): name = "flint" description = "FLINT (Fast Library for Number Theory)" license = "LGPL-2.1-or-later" - topics = ("math", "numerical") - homepage = "https://www.flintlib.org" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" + homepage = "https://www.flintlib.org" + topics = ("math", "numerical") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,15 +29,8 @@ class FlintConan(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": @@ -40,52 +38,71 @@ 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("gmp/6.2.1") - self.requires("mpfr/4.1.0") - if self.settings.compiler == "Visual Studio": + self.requires("gmp/6.3.0", transitive_headers=True, transitive_libs=True) + self.requires("mpfr/4.2.1", transitive_headers=True, transitive_libs=True) + if is_msvc(self): self.requires("pthreads4w/3.0.0") def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() - cmake.build() + 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.definitions["BUILD_DOCS"] = False - self._cmake.definitions["WITH_NTL"] = False + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["BUILD_DOCS"] = False + tc.cache_variables["WITH_NTL"] = False # IPO/LTO breaks clang builds - self._cmake.definitions["IPO_SUPPORTED"] = False + tc.cache_variables["IPO_SUPPORTED"] = False # No BLAS yet - self._cmake.definitions["CMAKE_DISABLE_FIND_PACKAGE_CBLAS"] = True + tc.cache_variables["CMAKE_DISABLE_FIND_PACKAGE_CBLAS"] = True # handle run in a cross-build - if tools.cross_building(self): - self._cmake.definitions["FLINT_USES_POPCNT_EXITCODE"] = "1" - self._cmake.definitions["FLINT_USES_POPCNT_EXITCODE__TRYRUN_OUTPUT"] = "" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + if cross_building(self): + tc.cache_variables["FLINT_USES_POPCNT_EXITCODE"] = "1" + tc.cache_variables["FLINT_USES_POPCNT_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.generate() + + deps = CMakeDeps(self) + if Version(self.version) <= "3.0.1": + deps.set_property("pthreads4w", "cmake_file_name", "PThreads") + else: + # https://github.com/flintlib/flint/commit/c6cc1078cb55903b0853fb1b6dc660887842dadf + deps.set_property("pthreads4w", "cmake_file_name", "PThreads4W") + deps.set_property("pthreads4w", "cmake_target_name", "PThreads4W::PThreads4W") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "MPFR_", "mpfr_") + + def build(self): + 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() def package_info(self): - self.cpp_info.names["cmake_find_package"] = "libflint" - self.cpp_info.names["cmake_find_package_multi"] = "libflint" + self.cpp_info.set_property("cmake_file_name", "libflint") + self.cpp_info.set_property("cmake_target_name", "libflint::libflint") if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["pthread", "m"] self.cpp_info.includedirs.append(os.path.join("include", "flint")) - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["flint"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "libflint" + self.cpp_info.names["cmake_find_package_multi"] = "libflint" diff --git a/recipes/flint/all/patches/0001-cmake-2.8.1.patch b/recipes/flint/all/patches/0001-cmake-2.8.1.patch deleted file mode 100644 index bfb50ddd978c7..0000000000000 --- a/recipes/flint/all/patches/0001-cmake-2.8.1.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2616d0669..6fa4cf5f7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -46,7 +46,10 @@ endif() - # pthread configuration - - if(MSVC) -- find_package(PThreads REQUIRED) -+ #find_package(PThreads REQUIRED) -+ set(PThreads_FOUND TRUE) -+ set(PThreads_LIBRARIES "${CONAN_LIBS_PTHREADS4W}") -+ set(PThreads_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_PTHREADS4W}") - set(FLINT_USES_PTHREAD ON CACHE BOOL "Use POSIX Threads.") - else() - option(CMAKE_THREAD_PREFER_PTHREAD "Prefer pthreads" yes) -@@ -101,9 +104,9 @@ set(HEADERS - ) - - foreach (build_dir IN LISTS BUILD_DIRS TEMPLATE_DIRS) -- file(GLOB TEMP RELATIVE "${CMAKE_SOURCE_DIR}" "${build_dir}/*.c") -+ file(GLOB TEMP RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${build_dir}/*.c") - list(APPEND SOURCES ${TEMP}) -- file(GLOB TEMP RELATIVE "${CMAKE_SOURCE_DIR}" "${build_dir}/*.h") -+ file(GLOB TEMP RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${build_dir}/*.h") - list(APPEND HEADERS ${TEMP}) - endforeach () - -@@ -112,7 +115,7 @@ execute_process( - " - from os.path import join - --with open(join('${CMAKE_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin: -+with open(join('${CMAKE_CURRENT_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin: - with open('CPimport.h.in', 'w+') as fout: - while True: - l = fin.readline() -@@ -212,14 +215,14 @@ endif() - set(TEMP ${HEADERS}) - set(HEADERS ) - foreach(header IN LISTS TEMP) -- if(EXISTS ${CMAKE_SOURCE_DIR}/${header}) -+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${header}) - list(APPEND HEADERS ${header}) - else() -- list(APPEND HEADERS ${CMAKE_BINARY_DIR}/${header}) -+ list(APPEND HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${header}) - endif() - endforeach() - --file(GLOB TEMP "${CMAKE_SOURCE_DIR}/*.h") -+file(GLOB TEMP "${CMAKE_CURRENT_SOURCE_DIR}/*.h") - list(APPEND HEADERS ${TEMP}) - - add_library(flint ${SOURCES}) -@@ -236,6 +239,7 @@ endif() - target_include_directories(flint PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} ${GMP_INCLUDE_DIRS} ${MPFR_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} ${PThreads_INCLUDE_DIRS} -+ ${CMAKE_BINARY_DIR} - ${NTL_INCLUDE_DIR} - ) - diff --git a/recipes/flint/all/patches/0001-cmake.patch b/recipes/flint/all/patches/0001-cmake.patch deleted file mode 100644 index 9e5780c52e94b..0000000000000 --- a/recipes/flint/all/patches/0001-cmake.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 11ff789a7..80a45f90f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -46,7 +46,10 @@ endif() - # pthread configuration - - if(MSVC) -- find_package(PThreads REQUIRED) -+ #find_package(PThreads REQUIRED) -+ set(PThreads_FOUND TRUE) -+ set(PThreads_LIBRARIES "${CONAN_LIBS_PTHREADS4W}") -+ set(PThreads_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_PTHREADS4W}") - set(FLINT_USES_PTHREAD ON CACHE BOOL "Use POSIX Threads.") - else() - option(CMAKE_THREAD_PREFER_PTHREAD "Prefer pthreads" yes) -@@ -99,9 +102,9 @@ set(HEADERS - ) - - foreach (build_dir IN LISTS BUILD_DIRS TEMPLATE_DIRS) -- file(GLOB TEMP RELATIVE "${CMAKE_SOURCE_DIR}" "${build_dir}/*.c") -+ file(GLOB TEMP RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${build_dir}/*.c") - list(APPEND SOURCES ${TEMP}) -- file(GLOB TEMP RELATIVE "${CMAKE_SOURCE_DIR}" "${build_dir}/*.h") -+ file(GLOB TEMP RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${build_dir}/*.h") - list(APPEND HEADERS ${TEMP}) - endforeach () - -@@ -110,7 +113,7 @@ execute_process( - " - from os.path import join - --with open(join('${CMAKE_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin: -+with open(join('${CMAKE_CURRENT_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin: - with open('CPimport.h.in', 'w+') as fout: - while True: - l = fin.readline() -@@ -210,14 +213,14 @@ endif() - set(TEMP ${HEADERS}) - set(HEADERS ) - foreach(header IN LISTS TEMP) -- if(EXISTS ${CMAKE_SOURCE_DIR}/${header}) -+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${header}) - list(APPEND HEADERS ${header}) - else() -- list(APPEND HEADERS ${CMAKE_BINARY_DIR}/${header}) -+ list(APPEND HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${header}) - endif() - endforeach() - --file(GLOB TEMP "${CMAKE_SOURCE_DIR}/*.h") -+file(GLOB TEMP "${CMAKE_CURRENT_SOURCE_DIR}/*.h") - list(APPEND HEADERS ${TEMP}) - - add_library(flint ${SOURCES}) -@@ -234,6 +237,7 @@ endif() - target_include_directories(flint PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} ${GMP_INCLUDE_DIRS} ${MPFR_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} ${PThreads_INCLUDE_DIRS} -+ ${CMAKE_BINARY_DIR} - ${NTL_INCLUDE_DIR} - ) - diff --git a/recipes/flint/all/test_package/CMakeLists.txt b/recipes/flint/all/test_package/CMakeLists.txt index e0200ac7628d3..735196242a02e 100644 --- a/recipes/flint/all/test_package/CMakeLists.txt +++ b/recipes/flint/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(libflint REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/flint/all/test_package/conanfile.py b/recipes/flint/all/test_package/conanfile.py index b6a26067f365d..ef5d7042163ec 100644 --- a/recipes/flint/all/test_package/conanfile.py +++ b/recipes/flint/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/flint/all/test_v1_package/CMakeLists.txt b/recipes/flint/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/flint/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/flint/all/test_v1_package/conanfile.py b/recipes/flint/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b6a26067f365d --- /dev/null +++ b/recipes/flint/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/flint/config.yml b/recipes/flint/config.yml index fed2a63c4da2b..db7f74434bfa0 100644 --- a/recipes/flint/config.yml +++ b/recipes/flint/config.yml @@ -1,5 +1,9 @@ versions: - "2.8.1": + "3.0.1": + folder: all + "2.9.0": + folder: all + "2.8.5": folder: all "2.7.1": folder: all diff --git a/recipes/fltk/all/CMakeLists.txt b/recipes/fltk/all/CMakeLists.txt deleted file mode 100644 index 60dd71d7363c3..0000000000000 --- 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 1b3f085545004..680f83f1fe74a 100644 --- a/recipes/fltk/all/conandata.yml +++ b/recipes/fltk/all/conandata.yml @@ -1,13 +1,16 @@ sources: + "1.3.9": + url: "https://github.com/fltk/fltk/archive/refs/tags/release-1.3.9.tar.gz" + sha256: "f30661851a61f1931eaaceb9ef4005584c85cb07fd7ffc38a645172b8e4eb3df" "1.3.8": url: "https://github.com/fltk/fltk/archive/refs/tags/release-1.3.8.tar.gz" sha256: "abddf697bf1b0a59462a0d2ec57557f4bfb9c634627e6fa50d8c664112642811" patches: + "1.3.9": + - patch_file: "patches/1.3.8-0001-remove-fluid.patch" + - patch_file: "patches/1.3.8-0003-build-static-only-on-static.patch" "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 0533063aab585..98a5fa5237529 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,93 @@ 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.8") 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.variables["OPTION_USE_SYSTEM_LIBJPEG"] = True + tc.variables["OPTION_USE_SYSTEM_ZLIB"] = True + tc.variables["OPTION_USE_SYSTEM_LIBPNG"] = True - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(self, **patch) + tc.generate() + tc = CMakeDeps(self) + tc.generate() - cmake = self._configure_cmake() + def build(self): + 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 a163bc26a443b..cf30c297c5531 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 a500b98343c74..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..a500b98343c74 --- /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/fltk/config.yml b/recipes/fltk/config.yml index 76eba86fa7f6d..358eb3f39989f 100644 --- a/recipes/fltk/config.yml +++ b/recipes/fltk/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.9": + folder: "all" "1.3.8": folder: "all" diff --git a/recipes/fmi1/all/conandata.yml b/recipes/fmi1/all/conandata.yml new file mode 100644 index 0000000000000..3605e7f8bb5d7 --- /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 0000000000000..e0cf988f8107d --- /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 0000000000000..7e700e5046782 --- /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 0000000000000..e730ad6dc0dfc --- /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 0000000000000..96872e2ca1ec7 --- /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 0000000000000..715e55357a17b --- /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 0000000000000..ca22c244cd704 --- /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 0000000000000..816be50f782af --- /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 0000000000000..7332dbc8b5197 --- /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 0000000000000..e730ad6dc0dfc --- /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 0000000000000..ec96970349ed1 --- /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 0000000000000..1f2301f1f0282 --- /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 0000000000000..b12c4c988ee8b --- /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 0000000000000..3d5c1d773f7ef --- /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 0000000000000..24b88e3db471d --- /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 0000000000000..e730ad6dc0dfc --- /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 0000000000000..ea4bf3fd0194a --- /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 0000000000000..f1eca9cdf76de --- /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 2125f36949279..1c4bb54e9bf65 100644 --- a/recipes/fmt/all/conandata.yml +++ b/recipes/fmt/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "10.2.1": + url: "https://github.com/fmtlib/fmt/releases/download/10.2.1/fmt-10.2.1.zip" + sha256: "312151a2d13c8327f5c9c586ac6cf7cddc1658e8f53edae0ec56509c8fa516c9" + "10.2.0": + url: "https://github.com/fmtlib/fmt/releases/download/10.2.0/fmt-10.2.0.zip" + sha256: "8a942861a94f8461a280f823041cde8f620a6d8b0e0aacc98c15bb5a9dd92399" + "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 862834c358047..fb9118c45657f 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -95,7 +95,10 @@ def build(self): cmake.build() def package(self): - copy(self, pattern="*LICENSE.rst", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) < "10.2.0": + copy(self, pattern="*LICENSE.rst", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if self.options.header_only: copy(self, pattern="*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) else: @@ -118,9 +121,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 44e12e4e3ddc7..fdd60b40c6f86 100644 --- a/recipes/fmt/config.yml +++ b/recipes/fmt/config.yml @@ -1,4 +1,12 @@ versions: + "10.2.1": + folder: all + "10.2.0": + folder: all + "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 e1fd99b8fca24..9bc3a7f6a4839 100644 --- a/recipes/fmtlog/all/conanfile.py +++ b/recipes/fmtlog/all/conanfile.py @@ -8,7 +8,7 @@ import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class PackageConan(ConanFile): @@ -17,7 +17,8 @@ class PackageConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/MengRao/fmtlog" - topics = ("logging", "low-latency", "topic3") + topics = ("logging", "low-latency") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -53,10 +54,11 @@ 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.options.header_only: + self.package_type = "header-library" + self.options.rm_safe("fPIC") + self.options.rm_safe("shared") def layout(self): if self.options.header_only: @@ -65,14 +67,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/9.1.0") + self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) def package_id(self): - if self.options.header_only: + if self.info.options.header_only: self.info.clear() def validate(self): - # FIXME: self.info.settings.compiler does not work with header-only packages if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) @@ -80,8 +81,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 generate(self): if self.options.header_only: @@ -112,6 +112,8 @@ def package(self): def package_info(self): if self.options.header_only: self.cpp_info.defines.append("FMTLOG_HEADER_ONLY") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] else: self.cpp_info.libs = ["fmtlog-shared" if self.options.shared else "fmtlog-static"] diff --git a/recipes/fontconfig/all/conanfile.py b/recipes/fontconfig/all/conanfile.py index c44276116659f..ddc997bea245a 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/config.yml b/recipes/fontconfig/config.yml index a3042d0ed624f..41c4db45e111e 100644 --- a/recipes/fontconfig/config.yml +++ b/recipes/fontconfig/config.yml @@ -1,4 +1,6 @@ versions: + "2.15.0": + folder: meson "2.14.2": folder: meson "2.13.93": diff --git a/recipes/fontconfig/meson/conandata.yml b/recipes/fontconfig/meson/conandata.yml index e2b11bfd27f49..6691cd7b19491 100644 --- a/recipes/fontconfig/meson/conandata.yml +++ b/recipes/fontconfig/meson/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.15.0": + url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.15.0.tar.xz" + sha256: "63a0658d0e06e0fa886106452b58ef04f21f58202ea02a94c39de0d3335d7c0e" "2.14.2": url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.14.2.tar.xz" sha256: "dba695b57bce15023d2ceedef82062c2b925e51f5d4cc4aef736cf13f60a468b" diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py index 7effda31e1c9d..550cc9984a1bb 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.0.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/forestdb/all/CMakeLists.txt b/recipes/forestdb/all/CMakeLists.txt deleted file mode 100644 index 78b537ac50f88..0000000000000 --- a/recipes/forestdb/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/forestdb/all/conandata.yml b/recipes/forestdb/all/conandata.yml index 935f0559af335..e15581c6eba7e 100644 --- a/recipes/forestdb/all/conandata.yml +++ b/recipes/forestdb/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "cci.20220727": - patch_file: "patches/0001-proper-cxx-std-flag.patch" - base_path: "source_subfolder" diff --git a/recipes/forestdb/all/conanfile.py b/recipes/forestdb/all/conanfile.py index 526ab2f1f2069..fd380e2335813 100644 --- a/recipes/forestdb/all/conanfile.py +++ b/recipes/forestdb/all/conanfile.py @@ -1,8 +1,13 @@ 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, copy, export_conandata_patches, get + +required_conan_version = ">=1.53.0" + class ForestDBConan(ConanFile): name = "forestdb" @@ -11,12 +16,13 @@ class ForestDBConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ForestDB-KVStore/forestdb" topics = ("kv-store", "mvcc", "wal") - settings = "os", "arch", "compiler", "build_type" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "with_snappy": [True, False] + "with_snappy": [True, False], } default_options = { "shared": False, @@ -24,64 +30,65 @@ class ForestDBConan(ConanFile): "with_snappy": False, } - generators = "cmake" + def export_sources(self): + export_conandata_patches(self) - @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 in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_snappy: - self.requires("snappy/1.1.9") + self.requires("snappy/1.1.10") def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration("Windows Builds Unsupported") if self.settings.compiler == "clang": - if self.settings.compiler.libcxx == "libc++" and self.options.shared == False: + if self.settings.compiler.libcxx == "libc++" and not self.options.shared: raise ConanInvalidConfiguration("LibC++ Static Builds Unsupported") if self.settings.compiler.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) + 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) - cmake = CMake(self) - cmake.definitions["SNAPPY_OPTION"] = "Disable" + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SNAPPY_OPTION"] = "Disable" if self.options.with_snappy: - cmake.definitions["SNAPPY_OPTION"] = "Enable" - cmake.configure() + tc.variables["SNAPPY_OPTION"] = "Enable" + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) lib_target = "forestdb" if not self.options.shared: lib_target = "static_lib" + cmake = CMake(self) + cmake.configure() cmake.build(target=lib_target) 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) # Parent Build system does not support library type selection # and will only install the shared object from cmake; so we must # handpick our libraries. - self.copy("*.a*", dst="lib", src="lib") - self.copy("*.lib", dst="lib", src="lib") - self.copy("*.so*", dst="lib", src="lib", symlinks=True) - self.copy("*.dylib*", dst="lib", src="lib", symlinks=True) - self.copy("*.dll*", dst="lib", src="lib") - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include"), keep_path=True) + for pattern in ["*.a*", "*.lib", "*.so*", "*.dylib*", "*.dll*"]: + copy(self, pattern, + dst=os.path.join(self.package_folder, "lib"), + src=self.build_folder) + copy(self, "*.h", + 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.libs = ["forestdb"] - self.cpp_info.system_libs.extend(["pthread", "m", "dl"]) - if self.settings.os == "Linux": - self.cpp_info.system_libs.extend(["rt"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m", "dl", "rt"] diff --git a/recipes/forestdb/all/test_package/CMakeLists.txt b/recipes/forestdb/all/test_package/CMakeLists.txt index 9912b39ed8da5..44b53f97f3be5 100644 --- a/recipes/forestdb/all/test_package/CMakeLists.txt +++ b/recipes/forestdb/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(forestdb REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/forestdb/all/test_package/conanfile.py b/recipes/forestdb/all/test_package/conanfile.py index 751b9d5bc7b9c..fae501d0afb9e 100644 --- a/recipes/forestdb/all/test_package/conanfile.py +++ b/recipes/forestdb/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -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 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/forestdb/all/test_v1_package/CMakeLists.txt b/recipes/forestdb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/forestdb/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/forestdb/all/test_v1_package/conanfile.py b/recipes/forestdb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..751b9d5bc7b9c --- /dev/null +++ b/recipes/forestdb/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools, RunEnvironment +from conan.tools.build import cross_building +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/foxglove-schemas-protobuf/all/CMakeLists.txt b/recipes/foxglove-schemas-protobuf/all/CMakeLists.txt new file mode 100644 index 0000000000000..a8497dc9f144a --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 3.15) +project(Foxglove-Schemas CXX) + +find_package(Protobuf 3 REQUIRED) + +FILE(GLOB all_protos "schemas/proto/foxglove/*.proto") + +# Create lists of all the generated headers and sources +FOREACH(f ${all_protos}) + file(RELATIVE_PATH f ${CMAKE_CURRENT_SOURCE_DIR}/schemas/proto ${f}) + STRING(REGEX REPLACE "\\.proto$" "" f ${f}) + LIST(APPEND proto_headers "${CMAKE_CURRENT_SOURCE_DIR}/autogenerated/${f}.pb.h") + LIST(APPEND proto_sources "${CMAKE_CURRENT_SOURCE_DIR}/autogenerated/${f}.pb.cc") +ENDFOREACH(f) + +LIST(APPEND proto_sources ${proto_headers}) + +# Create a directory for the generated files +FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/autogenerated) + +# Execute the protoc compiler +add_custom_command( + OUTPUT ${proto_sources} + COMMAND ${CMAKE_COMMAND} -E make_directory autogenerated + COMMAND ${Protobuf_PROTOC_EXECUTABLE} --proto_path=${CMAKE_CURRENT_SOURCE_DIR}/schemas/proto --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/autogenerated ${all_protos} +) + +add_library(foxglove_schemas_protobuf ${proto_sources}) + +target_include_directories(foxglove_schemas_protobuf PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/autogenerated) + +target_link_libraries(foxglove_schemas_protobuf PUBLIC protobuf::libprotobuf) + +set_property(TARGET foxglove_schemas_protobuf PROPERTY CXX_STANDARD 17) + + +# Set all the headers as public so they are installed and add the proto files since they should also be installed in the include directory +LIST(APPEND proto_headers ${all_protos}) +set_target_properties(foxglove_schemas_protobuf PROPERTIES PUBLIC_HEADER "${proto_headers}" ) + + +install(TARGETS foxglove_schemas_protobuf + LIBRARY DESTINATION lib + PUBLIC_HEADER DESTINATION include/foxglove) diff --git a/recipes/foxglove-schemas-protobuf/all/conandata.yml b/recipes/foxglove-schemas-protobuf/all/conandata.yml new file mode 100644 index 0000000000000..658f5043f7c66 --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 0.1.0: + url: https://github.com/foxglove/schemas/archive/refs/tags/releases/python/foxglove-schemas-protobuf/v0.1.0.tar.gz + sha256: 42153b62000c0c614301ecd2b9173c69f467dd543db3328a1b0491bce8ee5594 diff --git a/recipes/foxglove-schemas-protobuf/all/conanfile.py b/recipes/foxglove-schemas-protobuf/all/conanfile.py new file mode 100644 index 0000000000000..5a5291f2d6ec4 --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.microsoft import check_min_vs +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class FoxgloveSchemasProtobufConan(ConanFile): + name = "foxglove-schemas-protobuf" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/foxglove/schemas" + description = "Protobuf schemas for Foxglove" + license = "MIT" + topics = ("foxglove", "protobuf", "schemas") + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps" + package_type = "library" + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "msvc": "191", + "gcc": "9", + "clang": "9", + "apple-clang": "12", + } + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=(self.export_sources_folder + "/src")) + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, self._compilers_minimum_version["msvc"]) + 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("Windows shared builds are not supported yet.") + + def build_requirements(self): + self.tool_requires("protobuf/3.21.9") + + def requirements(self): + self.requires("protobuf/3.21.9", transitive_headers=True, transitive_libs=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + 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 build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.configure() + cmake.install() + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.libs = ["foxglove_schemas_protobuf"] diff --git a/recipes/foxglove-schemas-protobuf/all/test_package/CMakeLists.txt b/recipes/foxglove-schemas-protobuf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..793bfe03abb6b --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(foxglove-schemas-protobuf CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} foxglove-schemas-protobuf::foxglove-schemas-protobuf) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) diff --git a/recipes/foxglove-schemas-protobuf/all/test_package/conanfile.py b/recipes/foxglove-schemas-protobuf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8d2d8af87e4f6 --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.build import can_run +import os + + +class TestPackageConan(ConanFile): + settings = ("os", "arch", "compiler", "build_type") + 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 can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/foxglove-schemas-protobuf/all/test_package/test_package.cpp b/recipes/foxglove-schemas-protobuf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..264f429e55dee --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + + +int main() { + foxglove::SceneUpdate msg; + auto* entity = msg.add_entities(); + return 0; +} diff --git a/recipes/foxglove-schemas-protobuf/config.yml b/recipes/foxglove-schemas-protobuf/config.yml new file mode 100644 index 0000000000000..684647742e06b --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/config.yml @@ -0,0 +1,3 @@ +versions: + 0.1.0: + folder: all diff --git a/recipes/foxglove-websocket/all/conandata.yml b/recipes/foxglove-websocket/all/conandata.yml index 30a26f91bb4d6..697b11f6c928c 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 60557d9c03f13..666816b0d5820 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 3e794e52e592a..6f923ecb4a132 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 75666c9f3bd71..92f6f21bd74b0 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 89315a6f71ce4..0ed9b7cc136ee 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 b9e1ea43fa34a..5d2f0cf538ac5 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 2d7e6737381f9..7013b94735f0f 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 3f4a9f50f389e..ef5d7042163ec 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 43bf51fe320f0..d9d39d7a4b608 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 0000000000000..91630d79f4abb --- /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 0000000000000..3f4a9f50f389e --- /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 ec935d5cf64ff..2786096f9ff86 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 0000000000000..ef306da4b0649 --- /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 0000000000000..2369b2e58e6b6 --- /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 0000000000000..1476da8811ce6 --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..8e359fe8da319 --- /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 0000000000000..426a0e4c79e9b --- /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 11a3b438484c7..7b598ff9ef76d 100644 --- a/recipes/freeimage/all/conanfile.py +++ b/recipes/freeimage/all/conanfile.py @@ -67,19 +67,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_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: self.requires("openjpeg/2.5.0") if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_webp: - self.requires("libwebp/1.3.0") + 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.4.0") + 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 ba0c7f323c387..8e6b6b6c5bfe8 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 907eedb701583..1415f8ffb0446 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -64,13 +64,13 @@ def layout(self): def requirements(self): if self.options.with_png: - self.requires("libpng/1.6.39") + 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 03088d905ff89..a1ef7bebb603a 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 1ded763735f94..9d309ba6c3c0d 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 794b52fdc98a5..6f97355b38f7c 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 0000000000000..80cf36670487d --- /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 06269eb399e91..e78a14da43e74 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 08937af14f728..281ca46617df0 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 0867aa984f255..4c363828a67c8 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 1a912a9e71c6e..88a69bbd50016 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 5db89f0f8f389..2fda8019e9353 100644 --- a/recipes/frugally-deep/all/conandata.yml +++ b/recipes/frugally-deep/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.15.29": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.29.tar.gz" + sha256: "032cd525d4a7b9b3ebe28fd5e3984ac3e569da496f65d52c81030aabd9d0c52e" + "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 2588afa778f5b..45f4704b4ab53 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 a8c615c1776b8..b64a8f93f961f 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 38f4483872d47..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 5b45f70613267..071eb4ceec642 100644 --- a/recipes/frugally-deep/config.yml +++ b/recipes/frugally-deep/config.yml @@ -1,4 +1,10 @@ versions: + "0.15.29": + folder: all + "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 39e570bb06b3a..9ad222d0dcc88 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 684a4c74b2542..63afa5b5e5a82 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 11d1d96f36866..c3fe801d090c2 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 3a86cd556cb4a..9297683794c7e 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 da7d45af31ef5..d071a67caf36c 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 0000000000000..2c48aab90b45b --- /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 96df426708fff..56009c498942c 100644 --- a/recipes/ftxui/all/conandata.yml +++ b/recipes/ftxui/all/conandata.yml @@ -1,4 +1,10 @@ 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" "4.1.0": url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v4.1.0.tar.gz" sha256: "6f03f5917b44c9bc12335ad891a93813bbb6e738e0bd0c44f97bcc6077c45980" @@ -12,6 +18,10 @@ sources: url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v2.0.0.tar.gz" sha256: "d891695ef22176f0c09f8261a37af9ad5b262dd670a81e6b83661a23abc2c54f" patches: + "4.1.1": + - patch_file: "patches/4.1.1-0002-install-dll.patch" + patch_description: "add runtime destionation for windows shared build" + patch_type: "conan" "4.1.0": - patch_file: "patches/4.0.0-0002-install-dll.patch" patch_description: "add runtime destionation for windows shared build" diff --git a/recipes/ftxui/all/conanfile.py b/recipes/ftxui/all/conanfile.py index 04120e770fee3..2f4a068d989e3 100644 --- a/recipes/ftxui/all/conanfile.py +++ b/recipes/ftxui/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc_static_runtime, is_msvc -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, rm from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout @@ -94,6 +94,8 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) if Version(self.version) >= "4.1.0": rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if Version(self.version) >= "4.1.1": + rm(self, "ftxui.pc", os.path.join(self.package_folder, "lib"), ) def package_info(self): self.cpp_info.set_property("cmake_file_name", "ftxui") diff --git a/recipes/ftxui/all/patches/4.1.1-0002-install-dll.patch b/recipes/ftxui/all/patches/4.1.1-0002-install-dll.patch new file mode 100644 index 0000000000000..6acb41d9c736a --- /dev/null +++ b/recipes/ftxui/all/patches/4.1.1-0002-install-dll.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/ftxui_install.cmake b/cmake/ftxui_install.cmake +index d6de491..c5c4f66 100644 +--- a/cmake/ftxui_install.cmake ++++ b/cmake/ftxui_install.cmake +@@ -11,6 +11,7 @@ include(CMakePackageConfigHelpers) + install( + TARGETS screen dom component + EXPORT ftxui-targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) diff --git a/recipes/ftxui/config.yml b/recipes/ftxui/config.yml index a7509144ae93e..7747269b92a0d 100644 --- a/recipes/ftxui/config.yml +++ b/recipes/ftxui/config.yml @@ -1,4 +1,8 @@ versions: + "5.0.0": + folder: all + "4.1.1": + folder: all "4.1.0": folder: all "4.0.0": diff --git a/recipes/function2/all/conandata.yml b/recipes/function2/all/conandata.yml index 4a8c1d45eb5f5..ae317e99a1e7e 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 955cd0773fc58..a3a96ea0ace3a 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 ca33489d4d5de..3d3543e65247e 100644 --- a/recipes/functionalplus/all/conandata.yml +++ b/recipes/functionalplus/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.2.22": + url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.22.tar.gz" + sha256: "79378668dff6ffa8abc1abde2c2fe37dc6fe1ac040c55d5ee7886924fa6a1376" + "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 e87d42e53ba37..53628cdcaf152 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 42d00dd1c341a..a822e05fbaecb 100644 --- a/recipes/functionalplus/config.yml +++ b/recipes/functionalplus/config.yml @@ -1,4 +1,8 @@ versions: + "0.2.22": + folder: all + "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 c921d02a0d877..0000000000000 --- 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 c01327cda0d09..0f463b674b8cc 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 96389274771c4..859f3f1596a4e 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 0000000000000..869e28e535811 --- /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 0000000000000..661786756beb5 --- /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 0000000000000..974fed8146e70 --- /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 d4b4a2212f334..5126c69942f53 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 38f4483872d47..ef5d7042163ec 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 c7f13630776fb..45091dac1186f 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 661f0d421c545..95ef7fe563895 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 f23b9daa7e874..36394b1187d48 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 00168e2e07000..03f33e510f02d 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 46d9d6bbaf311..23d14d1e4b9f6 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 0000000000000..91630d79f4abb --- /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 0000000000000..46d9d6bbaf311 --- /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 1ad5a5433b5fb..d0c122e1d915c 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 0452fc2e8e027..08a72fff292b3 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 58f1cc5b754a9..5aa429fe457fd 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 90bc15dd9edc5..a5ff425216138 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 cc18649bfe195..f63fe5ab6f014 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 3a324b7465d34..a2ce278d92965 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 c0e666f41f1de..7c7f67a48db89 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 2dbc2d17b374f..6ac086393ccfd 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 d03de4e5125cc..3e0847981c026 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 0000000000000..34401a53eae6d --- /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 4ca595dd10256..49983edc62730 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 7ecdfb6713c6a..65bbd7d92d812 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 974146f6a3f7a..0000000000000 --- 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 308c1bca0a4c0..0000000000000 --- 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 c52f9dff53382..0000000000000 --- 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 aa86489f0296b..0000000000000 --- 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 8b08760381794..0000000000000 --- 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 c0201f8dc9cd8..0000000000000 --- 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 e88043df4189f..0000000000000 --- 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 aa86489f0296b..0000000000000 --- 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 8b08760381794..0000000000000 --- 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 e23b85d35a16a..0000000000000 --- 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" + - patch_file: "patches/0004-3.0.20-find-expat.patch" + patch_description: "enforce usage of FindEXPAT.cmake" + patch_type: "conan" + - patch_file: "patches/0005-3.0.20-openssl.patch" + patch_description: "skip check_cxx_source_compiles usage for openssl" + patch_type: "conan" + - patch_file: "patches/0006-json.patch" + patch_description: "skip check_cxx_source_compiles usage for json-c" + patch_type: "conan" + - patch_file: "patches/0007-3.0.20-find-json.patch" + patch_description: "fix find_package for json-c" + patch_type: "conan" + - patch_file: "patches/0008-3.0.20-find-libuuid.patch" + patch_description: "fix find_package for libuuid" + patch_type: "conan" "3.0.21": - - 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" @@ -32,9 +81,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 +104,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 f32e56dd3a6fd..5a0b267df427d 100644 --- a/recipes/gdcm/all/conanfile.py +++ b/recipes/gdcm/all/conanfile.py @@ -27,17 +27,19 @@ class GDCMConan(ConanFile): "fPIC": [True, False], "with_json": [True, False], "with_openssl": [True, False], + "with_zlibng": [True, False], } default_options = { "shared": False, "fPIC": True, "with_json": True, "with_openssl": True, + "with_zlibng": False, } @property def _min_cppstd(self): - return 11 + return 14 def export_sources(self): export_conandata_patches(self) @@ -54,15 +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") - self.requires("zlib/1.2.13") + if self.options.with_zlibng: + self.requires("zlib-ng/2.1.6") + else: + 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]") @@ -71,6 +77,10 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) if is_msvc_static_runtime(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} does not support shared and static runtime together.") + if self.info.options.with_zlibng: + zlib_ng = self.dependencies["zlib-ng"] + if not zlib_ng.options.zlib_compat: + raise ConanInvalidConfiguration(f"{self.ref} requires the dependency option zlib-ng:zlib_compat=True") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -80,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 @@ -89,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() @@ -185,8 +203,7 @@ def _gdcm_build_modules(self): @property def _gdcm_libraries(self): - gdcm_libs = ["gdcmcharls", - "gdcmCommon", + gdcm_libs = ["gdcmCommon", "gdcmDICT", "gdcmDSED", "gdcmIOD", @@ -222,19 +239,23 @@ def package_info(self): if self.options.with_openssl: self.cpp_info.components["gdcmCommon"].requires.append("openssl::openssl") - self.cpp_info.components["gdcmDSED"].requires.extend(["gdcmCommon", "zlib::zlib"]) + + def zlib(): + return "zlib-ng::zlib-ng" if self.options.with_zlibng else "zlib::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 0000000000000..c30995e540d0b --- /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 0000000000000..c4dfe79c81524 --- /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 57df8966f04ba..0000000000000 --- 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/patches/0002-3.0.23-openjpeg.patch b/recipes/gdcm/all/patches/0002-3.0.23-openjpeg.patch new file mode 100644 index 0000000000000..eeab7fc906123 --- /dev/null +++ b/recipes/gdcm/all/patches/0002-3.0.23-openjpeg.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -361,7 +361,7 @@ endif() + + if(GDCM_USE_SYSTEM_OPENJPEG) + find_package(OpenJPEG 2.0.0 REQUIRED) +- set(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) ++ set(GDCM_OPENJPEG_LIBRARIES ${OpenJPEG_LIBRARIES}) + else() + set(GDCM_OPENJPEG_LIBRARIES gdcmopenjp2) + endif() +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -161,7 +161,7 @@ else() + ) + endif() + if(GDCM_USE_SYSTEM_OPENJPEG) +- include_directories(${OPENJPEG_INCLUDE_DIRS} ) ++ include_directories(${OpenJPEG_INCLUDE_DIRS} ) + else() + include_directories( + "${GDCM_BINARY_DIR}/Utilities/gdcmopenjpeg" diff --git a/recipes/gdcm/all/patches/0004-3.0.23-find-expat.patch b/recipes/gdcm/all/patches/0004-3.0.23-find-expat.patch new file mode 100644 index 0000000000000..17f0337ed9cbf --- /dev/null +++ b/recipes/gdcm/all/patches/0004-3.0.23-find-expat.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -420,7 +420,7 @@ endif() + + if(GDCM_USE_SYSTEM_EXPAT) + # If user say so, then this is a requirement ! +- find_package(EXPAT REQUIRED) ++ find_package(EXPAT REQUIRED MODULE) + set(GDCM_EXPAT_LIBRARIES ${EXPAT_LIBRARIES}) + else() + set(GDCM_EXPAT_LIBRARIES "gdcmexpat") diff --git a/recipes/gdcm/all/patches/0007-3.0.23-find-json.patch b/recipes/gdcm/all/patches/0007-3.0.23-find-json.patch new file mode 100644 index 0000000000000..0dc527b8151cf --- /dev/null +++ b/recipes/gdcm/all/patches/0007-3.0.23-find-json.patch @@ -0,0 +1,45 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -427,7 +427,7 @@ else() + endif() + + if(GDCM_USE_SYSTEM_JSON) +- find_package(JSON REQUIRED) ++ find_package(json-c REQUIRED CONFIG) + endif() + if(GDCM_USE_SYSTEM_PAPYRUS3) + find_package(PAPYRUS3 REQUIRED) +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -187,11 +187,6 @@ else() + ) + set(GDCMUUID gdcmuuid) + endif() +-if(GDCM_USE_SYSTEM_JSON) +- include_directories( +- ${JSON_INCLUDE_DIRS} +- ) +-endif() + + add_library(gdcmMSFF ${MSFF_SRCS}) + # gdcmPVRGCodec calls gdcmjpeg +@@ -226,7 +221,7 @@ else() + target_link_libraries(gdcmMSFF LINK_PRIVATE ${GDCMUUID}) + endif() + if(GDCM_USE_SYSTEM_JSON) +- target_link_libraries(gdcmMSFF LINK_PRIVATE ${JSON_LIBRARIES}) ++ target_link_libraries(gdcmMSFF PRIVATE json-c::json-c) + endif() + if(UNIX) + find_package(Iconv) +--- a/Source/MediaStorageAndFileFormat/gdcmJSON.cxx ++++ b/Source/MediaStorageAndFileFormat/gdcmJSON.cxx +@@ -18,7 +18,7 @@ + #include "gdcmSystem.h" + + #ifdef GDCM_USE_SYSTEM_JSON +-#include ++#include + #endif + + #ifdef GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX diff --git a/recipes/gdcm/all/patches/0008-3.0.23-find-libuuid.patch b/recipes/gdcm/all/patches/0008-3.0.23-find-libuuid.patch new file mode 100644 index 0000000000000..25a30c12ea4d4 --- /dev/null +++ b/recipes/gdcm/all/patches/0008-3.0.23-find-libuuid.patch @@ -0,0 +1,40 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -412,7 +412,7 @@ endif() + + if(GDCM_USE_SYSTEM_UUID) + # If user say so, then this is a requirement ! +- find_package(UUID REQUIRED) ++ find_package(libuuid REQUIRED) + set(GDCM_UUID_LIBRARIES ${UUID_LIBRARIES}) + else() + set(GDCM_UUID_LIBRARIES "gdcmuuid") +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -176,17 +176,6 @@ if(NOT GDCM_USE_SYSTEM_ZLIB) + "${GDCM_BINARY_DIR}/Utilities/gdcmzlib" + ) + endif() +-if(GDCM_USE_SYSTEM_UUID) +- include_directories( +- ${UUID_INCLUDE_DIR} +- ) +- set(GDCMUUID ${UUID_LIBRARIES}) +-else() +- include_directories( +- "${GDCM_BINARY_DIR}/Utilities/gdcmuuid" # uuid_mangle.h +- ) +- set(GDCMUUID gdcmuuid) +-endif() + + add_library(gdcmMSFF ${MSFF_SRCS}) + # gdcmPVRGCodec calls gdcmjpeg +@@ -218,7 +207,7 @@ if(WIN32) + target_link_libraries(gdcmMSFF LINK_PRIVATE rpcrt4) + #endif() + else() +- target_link_libraries(gdcmMSFF LINK_PRIVATE ${GDCMUUID}) ++ target_link_libraries(gdcmMSFF LINK_PRIVATE libuuid::libuuid) + endif() + if(GDCM_USE_SYSTEM_JSON) + target_link_libraries(gdcmMSFF PRIVATE json-c::json-c) diff --git a/recipes/gdcm/all/test_package/CMakeLists.txt b/recipes/gdcm/all/test_package/CMakeLists.txt index 5465ea8e54b6d..b8df0da5056db 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 1f94130dd62ec..68791e0d3201c 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 0d20897301b68..b21cc49efde95 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/gdcm/config.yml b/recipes/gdcm/config.yml index 868e7933ac4a6..2cf37e22fa2ab 100644 --- a/recipes/gdcm/config.yml +++ b/recipes/gdcm/config.yml @@ -1,4 +1,8 @@ versions: + "3.0.23": + folder: "all" + "3.0.22": + folder: "all" "3.0.21": folder: "all" "3.0.20": diff --git a/recipes/gdk-pixbuf/all/conanfile.py b/recipes/gdk-pixbuf/all/conanfile.py index fe76b0dd2bad4..4f44d797427e7 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/conandata.yml b/recipes/gegles-spdlog_setup/all/conandata.yml new file mode 100644 index 0000000000000..f836eaeba60c2 --- /dev/null +++ b/recipes/gegles-spdlog_setup/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "1.1.0": + url: + - "https://github.com/gegles/spdlog_setup/archive/v1.1.0.tar.gz" + sha256: "80a37463a1cd2735f6f7af0b0dfb01a1ecc0a271b33fb29966564b9758f7c309" diff --git a/recipes/gegles-spdlog_setup/all/conanfile.py b/recipes/gegles-spdlog_setup/all/conanfile.py new file mode 100644 index 0000000000000..9df1297d17bd7 --- /dev/null +++ b/recipes/gegles-spdlog_setup/all/conanfile.py @@ -0,0 +1,78 @@ +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 SpdlogSetupConan(ConanFile): + name = "gegles-spdlog_setup" + description = "Setup spdlog via a TOML config file" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gegles/spdlog_setup" + topics = ('spdlog', 'logging', 'header-only', 'toml', 'cpptoml') + 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 { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("cpptoml/0.1.1") + self.requires("spdlog/1.12.0") + self.requires("fmt/10.2.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 = [] + self.cpp_info.set_property("cmake_file_name", "spdlog_setup") + self.cpp_info.set_property("cmake_target_name", "spdlog_setup::spdlog_setup") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + # This is needed since we prefixed the package name with the author name + self.cpp_info.names["cmake_find_package"] = "SPDLOG_SETUP" + self.cpp_info.names["cmake_find_package_multi"] = "spdlog_setup" diff --git a/recipes/gegles-spdlog_setup/all/test_package/CMakeLists.txt b/recipes/gegles-spdlog_setup/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f3c223fadf1f3 --- /dev/null +++ b/recipes/gegles-spdlog_setup/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(spdlog_setup REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE spdlog_setup::spdlog_setup) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/gegles-spdlog_setup/all/test_package/conanfile.py b/recipes/gegles-spdlog_setup/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/gegles-spdlog_setup/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/gegles-spdlog_setup/all/test_package/test_package.cpp b/recipes/gegles-spdlog_setup/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..19eff1dcb9934 --- /dev/null +++ b/recipes/gegles-spdlog_setup/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include +#include + +int main(void) { + std::cout << "Welcome to spdlog_setup!\n"; + return 123 == spdlog_setup::details::parse_max_size("123") ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/gegles-spdlog_setup/config.yml b/recipes/gegles-spdlog_setup/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/gegles-spdlog_setup/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/geographiclib/all/conandata.yml b/recipes/geographiclib/all/conandata.yml index d77a331b2e16a..1f35984a98249 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 d3a9097b7417e..0fb1787e60859 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 203a1711939ec..0000000000000 --- 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 7f25113816c11..0000000000000 --- 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 0000000000000..5edf6ebaedf2a --- /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 0a6bc68712d90..fafba71d30d56 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 6c3b63fe79e7e..23b0bc998f804 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 dce86864c12ad..cce81a5d0af84 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 7238296e0a1c1..5bfc63783c7e5 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 0000000000000..d0abdd50a8211 --- /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 aad029ca82e11..bbc8ab7daf85c 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 72a7afc2b30cc..433bf975c1087 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/gfortran/all/conanfile.py b/recipes/gfortran/all/conanfile.py index 209997c47d1fa..2b4c0cbc0e73f 100644 --- a/recipes/gfortran/all/conanfile.py +++ b/recipes/gfortran/all/conanfile.py @@ -15,6 +15,8 @@ class GFortranConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True short_paths = True + + deprecated = "gcc" def validate(self): if self.settings.arch != "x86_64": @@ -24,7 +26,7 @@ def validate(self): def build_requirements(self): if self.settings.os == "Windows": - self.tool_requires("7zip/19.00") + self.tool_requires("7zip/22.01") def build(self): if self.settings.os == "Windows": diff --git a/recipes/gfortran/all/test_package/conanfile.py b/recipes/gfortran/all/test_package/conanfile.py index 9d3aaf213929b..e0f64282eb4bd 100644 --- a/recipes/gfortran/all/test_package/conanfile.py +++ b/recipes/gfortran/all/test_package/conanfile.py @@ -11,4 +11,4 @@ def build_requirements(self): def test(self): if can_run(self): - self.run("gfortran --version", env="conanrun") + self.run("gfortran --version") diff --git a/recipes/ghc-filesystem/all/conanfile.py b/recipes/ghc-filesystem/all/conanfile.py index e7b402102ac33..0f9f45315ad03 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 1b82b82c2ec35..8927c006e472b 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 89838bc8bd072..89bbd2a608d1e 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 0000000000000..81e20b2bc3b95 --- /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 25c9b4921636c..4283c517286f9 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 165fceb314bfd..5df1ea4417f3b 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,56 +1,55 @@ sources: - "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.3.5": - url: "https://github.com/stephenberry/glaze/archive/v0.3.5.tar.gz" - sha256: "4a3e81a4862b57a21b03ed6d5b823397291e50e7b7d24944cc4932c5ae256cf7" - "0.3.2": - url: "https://github.com/stephenberry/glaze/archive/v0.3.2.tar.gz" - sha256: "41f19b1b4872a637ecb63bccb07578255f54c8842faf1bab78779e6342b2fa7e" - "0.2.2": - url: "https://github.com/stephenberry/glaze/archive/v0.2.2.tar.gz" - sha256: "d0d2edcc546b0ebb4bedaeedfb4a54aa678a6fdffa6b20dd6b252ef6325a9e75" - "0.2.1": - url: "https://github.com/stephenberry/glaze/archive/v0.2.1.tar.gz" - sha256: "dcf9ddf51b186dbc4cfd3b9324f9ee238cc1ba46fc2a62effa9293971ac4d1d4" - "0.2.0": - url: "https://github.com/stephenberry/glaze/archive/v0.2.0.tar.gz" - sha256: "2ad0d91f89465eac94efbeb91e435a5b36b7d54c9d8d6ccfb0708f6c6c0c5f87" - "0.1.8": - url: "https://github.com/stephenberry/glaze/archive/v0.1.8.tar.gz" - sha256: "8268ec2a8e0f2d9de2e65830ad9f7a623577c7bd47d465d4c6e4bed9d266ad48" - "0.1.7": - url: "https://github.com/stephenberry/glaze/archive/v0.1.7.tar.gz" - sha256: "7dc31ceaa444fd92339a48a69be638e92daa2858c3228f347b1df54a824b8f62" - "0.1.4": - url: "https://github.com/stephenberry/glaze/archive/v0.1.4.tar.gz" - sha256: "dd46e77973fe5b3cf4cd68fd597ba6b1010ecffd3e10cd8ccbd6cd615e6ffaff" - "0.0.7": - url: "https://github.com/stephenberry/glaze/archive/refs/tags/v0.0.7.tar.gz" - sha256: "124f7e8fea58c012b548ba1b643684fe428c7dbfeb8d8a5f701eb7db4356a759" + "2.0.6": + url: "https://github.com/stephenberry/glaze/archive/v2.0.6.tar.gz" + sha256: "aa5d4921382e9781998ebbf6d36964556daa3367a2aef5ca814122502b450abc" + "2.0.5": + url: "https://github.com/stephenberry/glaze/archive/v2.0.5.tar.gz" + sha256: "a826c823dd125e25ecd29881775df5db07ccacd5358a04efba2b290eb6c945eb" + "2.0.3": + url: "https://github.com/stephenberry/glaze/archive/v2.0.3.tar.gz" + sha256: "7e155d2970329ff4a13fe1d4c4e4b63509405a984b4f37ef9f92b8756bb3c8ce" + "2.0.2": + url: "https://github.com/stephenberry/glaze/archive/v2.0.2.tar.gz" + sha256: "af65752fb523c82313bfbe9c04ab47e332d881154f06c63967b973ee51e5923d" + "2.0.1": + url: "https://github.com/stephenberry/glaze/archive/v2.0.1.tar.gz" + sha256: "0f515588189796696a802c88b0308b5386376d202c7ff1875683f38316f09c90" + "2.0.0": + url: "https://github.com/stephenberry/glaze/archive/v2.0.0.tar.gz" + sha256: "8553ade81a20b1a7c8398f95490ab540f34a78f226f7fe5555dfcbbaf216e108" + "1.9.9": + url: "https://github.com/stephenberry/glaze/archive/v1.9.9.tar.gz" + sha256: "7e2605046742a89ec455887a5a0d6b3188ed5c14ea309c5eb9814848c26bedca" + "1.9.8.1": + url: "https://github.com/stephenberry/glaze/archive/v1.9.8.1.tar.gz" + sha256: "f1dd8d93440096d186695814848c9cd350a9ec5b0e114e933579ef2467a35558" + "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" patches: - "0.2.2": - - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" - patch_description: "use cci's frozen" - patch_type: "conan" - "0.2.1": - - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" - patch_description: "use cci's frozen" - patch_type: "conan" - "0.2.0": - - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" - patch_description: "use cci's frozen" - patch_type: "conan" + "1.9.8.1": + - patch_file: "patches/1.9.8.1-0001-fix-msvc-bug.patch" + patch_description: "workaround MSVC compilation error for some versions" + patch_type: "portability" + patch_source: "https://github.com/stephenberry/glaze/pull/653" diff --git a/recipes/glaze/all/conanfile.py b/recipes/glaze/all/conanfile.py index 7f723fc2acd6a..3e5f358c8c908 100644 --- a/recipes/glaze/all/conanfile.py +++ b/recipes/glaze/all/conanfile.py @@ -19,16 +19,16 @@ class GlazeConan(ConanFile): settings = "os", "arch", "compiler", "build_type" @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 20 @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", } @@ -38,33 +38,16 @@ def export_sources(self): def layout(self): basic_layout(self, src_folder="src") - def requirements(self): - if Version(self.version) < "0.2.4": - self.requires("fmt/9.1.0") - self.requires("frozen/1.1.1") - self.requires("nanorange/cci.20200706") - if Version(self.version) < "0.2.3": - self.requires("fast_float/4.0.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._minimum_cpp_standard) - - 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): + if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - f"{self.name} {self.version} 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): @@ -74,11 +57,10 @@ 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 01b0c786fa02b..0000000000000 --- 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/patches/1.9.8.1-0001-fix-msvc-bug.patch b/recipes/glaze/all/patches/1.9.8.1-0001-fix-msvc-bug.patch new file mode 100644 index 0000000000000..c1c12e5675383 --- /dev/null +++ b/recipes/glaze/all/patches/1.9.8.1-0001-fix-msvc-bug.patch @@ -0,0 +1,13 @@ +diff --git a/include/glaze/csv/write.hpp b/include/glaze/csv/write.hpp +index 4c2c24b..68b513a 100644 +--- a/include/glaze/csv/write.hpp ++++ b/include/glaze/csv/write.hpp +@@ -205,7 +205,7 @@ namespace glz + using Element = glaze_tuple_element; + static constexpr size_t member_index = Element::member_index; + +- using item_type = std::decay_t; ++ using item_type = typename std::decay::type; + using value_type = typename item_type::value_type; + + static constexpr sv key = key_name; diff --git a/recipes/glaze/all/test_package/CMakeLists.txt b/recipes/glaze/all/test_package/CMakeLists.txt index 11ef3b807bd40..4811c5114c3c2 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 779e5b74adbe2..74e4ebae7e752 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,29 +1,33 @@ versions: - "1.2.3": + "2.0.6": folder: all - "1.2.2": + "2.0.5": folder: all - "1.2.0": + "2.0.3": folder: all - "1.1.2": + "2.0.2": folder: all - "0.3.6": + "2.0.1": folder: all - "0.3.5": + "2.0.0": folder: all - "0.3.2": + "1.9.9": folder: all - "0.2.2": + "1.9.8.1": folder: all - "0.2.1": + "1.9.5": folder: all - "0.2.0": + "1.8.5": folder: all - "0.1.8": + "1.8.4": folder: all - "0.1.7": + "1.8.3": folder: all - "0.1.4": + "1.8.2": folder: all - "0.0.7": + "1.8.1": + folder: all + "1.7.0": + folder: all + "1.6.1": folder: all diff --git a/recipes/glew/all/conanfile.py b/recipes/glew/all/conanfile.py index 75e5f17da8e37..3aaec716377cb 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 f7e367639f538..116694086f70b 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/glext/all/conanfile.py b/recipes/glext/all/conanfile.py index 746356cd3af89..3cbf2eff985c1 100644 --- a/recipes/glext/all/conanfile.py +++ b/recipes/glext/all/conanfile.py @@ -1,35 +1,51 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import copy, download, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.37.0" class GlextConan(ConanFile): name = "glext" + description = "OpenGL 1.2 and above compatibility profile and extension interfaces" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.khronos.org/registry/OpenGL/index_gl.php" - description = "OpenGL 1.2 and above compatibility profile and extension interfaces" - topics = ("opengl", "gl", "glext") + topics = ("opengl", "gl", "glext", "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): self.requires("opengl/system") self.requires("khrplatform/cci.20200529") + def package_id(self): + self.info.clear() + def source(self): - tools.download(filename="glext.h", **self.conan_data["sources"][self.version]) + download(self, filename="glext.h", **self.conan_data["sources"][self.version]) - def package(self): - self.copy(pattern="glext.h", dst=os.path.join("include", "GL")) - license_data = tools.load(os.path.join(self.source_folder, "glext.h")) + def _extract_license(self): + license_data = load(self, os.path.join(self.source_folder, "glext.h")) begin = license_data.find("/*") + len("/*") end = license_data.find("*/") license_data = license_data[begin:end] license_data = license_data.replace("**", "") - tools.save("LICENSE", license_data) - self.copy("LICENSE", dst="licenses") + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_data) - def package_id(self): - self.info.header_only() + def package(self): + self._extract_license() + copy(self, "glext.h", + dst=os.path.join(self.package_folder, "include", "GL"), + src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/glext/all/test_package/CMakeLists.txt b/recipes/glext/all/test_package/CMakeLists.txt index b455e673a3ef0..02474af2d5d00 100644 --- a/recipes/glext/all/test_package/CMakeLists.txt +++ b/recipes/glext/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() - find_package(glext REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/glext/all/test_package/conanfile.py b/recipes/glext/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/glext/all/test_package/conanfile.py +++ b/recipes/glext/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/glfw/all/conandata.yml b/recipes/glfw/all/conandata.yml index 43e8790efbe29..bb5660da3ad7d 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 f7a8579bcc74f..c27f9801a9ee6 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 0000000000000..c2db9f04c4980 --- /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 0000000000000..9ad41b0f7b967 --- /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 0000000000000..a07360f22d403 --- /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 7eb260e9e7202..0cb3644185589 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 f7789e29322d3..928ba41028f6b 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 86a2b24a9d299..826e4f114106f 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -1,40 +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 95fb7a1a6aec3..6ccdcc81fb42a 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 c46f5e071d71c..0000000000000 --- 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 0000000000000..0df94096d0615 --- /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 0000000000000..17083da96cd17 --- /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 2f5458641d6f7..168cdc2e86991 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 ed236807fcf7e..3247118701674 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 362adfbe65783..f0bd1289c0ca6 100644 --- a/recipes/glib/config.yml +++ b/recipes/glib/config.yml @@ -1,23 +1,19 @@ versions: - "2.76.3": - folder: all - "2.76.2": - folder: all - "2.76.1": + "2.78.3": folder: all - "2.76.0": + "2.78.1": folder: all - "2.75.3": + "2.78.0": folder: all - "2.75.2": + "2.77.3": folder: all - "2.75.1": + "2.77.2": folder: all - "2.75.0": + "2.77.1": 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 df88638f61d35..a6d3f4c904bd4 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 b86499dcc4c3d..468e10f82d8df 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 f0db480178e58..7e06e74b5074e 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/glpk/all/conanfile.py b/recipes/glpk/all/conanfile.py index e03f104fe6d73..7c7e12af60356 100644 --- a/recipes/glpk/all/conanfile.py +++ b/recipes/glpk/all/conanfile.py @@ -1,10 +1,15 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conan.tools.files import rename -from conan.tools.microsoft import is_msvc -from contextlib import contextmanager +from conan import ConanFile, conan_version +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 copy, get, rename, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version import os -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.54.0" class GlpkConan(ConanFile): @@ -14,137 +19,98 @@ class GlpkConan(ConanFile): topics = ("linear", "programming", "simplex", "solver") url = "https://github.com/conan-io/conan-center-index" license = "GPL-3.0-or-later" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], } - default_options = { "shared": False, "fPIC": True, } - _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): - 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 - 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 layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): - self.build_requires("libtool/2.4.6") - 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 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], strip_root=True, - destination=self._source_subfolder) + 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") - @contextmanager - def _build_context(self): + tc = AutotoolsToolchain(self) if is_msvc(self): - with tools.vcvars(self): - env = { - "CC": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "CXX": "{} 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)), - "AR": "{} lib".format(tools.unix_path(self._user_info_build["automake"].ar_lib)), - } - with tools.environment_append(env): - yield - else: - yield - - def _patch_source(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, run_environment=True) - tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), - r"-install_name \$rpath/", - "-install_name @rpath/") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - - self._autotools.libs = [] - 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)), - "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))) - ] + tc.extra_defines.append("__WOE__") + if (Version(conan_version).major < "2" and self.settings.compiler == "Visual Studio" \ + and Version(self.settings.compiler.version) >= "12") or \ + (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"): + tc.extra_cflags.append("-FS") + tc.generate() if is_msvc(self): - self._autotools.defines.append("__WOE__") - if self.settings.compiler == "Visual Studio" and \ - tools.Version(self.settings.compiler.version) >= "12": - self._autotools.flags.append("-FS") - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools + 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 build(self): - #self._patch_source() - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) if is_msvc(self) and self.options.shared: pjoin = lambda p: os.path.join(self.package_folder, "lib", p) rename(self, pjoin("glpk.dll.lib"), pjoin("glpk.lib")) def package_info(self): - self.cpp_info.set_property("cmake_find_mode", "both") - self.cpp_info.set_property("cmake_file_name", "glpk") - self.cpp_info.set_property("cmake_target_name", "glpk::glpk") - self.cpp_info.set_property("pkg_config_name", "glpk") - - self.cpp_info.components["libglpk"].set_property("cmake_target_name", "glpk::glpk") - self.cpp_info.components["libglpk"].libs = ["glpk"] - - if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.components["libglpk"].system_libs = ["m"] - - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment var: {}".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"] = "glpk" - self.cpp_info.names["cmake_find_package_multi"] = "glpk" - self.cpp_info.components["libglpk"].names["cmake_find_package"] = "glpk" - self.cpp_info.components["libglpk"].names["cmake_find_package_multi"] = "glpk" - + self.cpp_info.libs = ["glpk"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/glpk/all/test_package/CMakeLists.txt b/recipes/glpk/all/test_package/CMakeLists.txt index 3258d5f78ee30..b283b9e10c4e0 100644 --- a/recipes/glpk/all/test_package/CMakeLists.txt +++ b/recipes/glpk/all/test_package/CMakeLists.txt @@ -1,10 +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(TARGETS) - -find_package(glpk CONFIG REQUIRED) +find_package(glpk REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE glpk::glpk) diff --git a/recipes/glpk/all/test_package/conanfile.py b/recipes/glpk/all/test_package/conanfile.py index 66177d47bc143..0a6bc68712d90 100644 --- a/recipes/glpk/all/test_package/conanfile.py +++ b/recipes/glpk/all/test_package/conanfile.py @@ -1,17 +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 GlpkTestConan(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 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 requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -19,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/glpk/all/test_package/test_package.c b/recipes/glpk/all/test_package/test_package.c index 965bd82a292c4..4c43ab6e7eb91 100644 --- a/recipes/glpk/all/test_package/test_package.c +++ b/recipes/glpk/all/test_package/test_package.c @@ -11,44 +11,43 @@ int main(void) { glp_prob *lp; int ia[1+1000], ja[1+1000]; double ar[1+1000], z, x1, x2, x3; -s1: lp = glp_create_prob(); -s2: glp_set_prob_name(lp, "sample"); -s3: glp_set_obj_dir(lp, GLP_MAX); -s4: glp_add_rows(lp, 3); -s5: glp_set_row_name(lp, 1, "p"); -s6: glp_set_row_bnds(lp, 1, GLP_UP, 0.0, 100.0); -s7: glp_set_row_name(lp, 2, "q"); -s8: glp_set_row_bnds(lp, 2, GLP_UP, 0.0, 600.0); -s9: glp_set_row_name(lp, 3, "r"); -s10: glp_set_row_bnds(lp, 3, GLP_UP, 0.0, 300.0); -s11: glp_add_cols(lp, 3); -s12: glp_set_col_name(lp, 1, "x1"); -s13: glp_set_col_bnds(lp, 1, GLP_LO, 0.0, 0.0); -s14: glp_set_obj_coef(lp, 1, 10.0); -s15: glp_set_col_name(lp, 2, "x2"); -s16: glp_set_col_bnds(lp, 2, GLP_LO, 0.0, 0.0); -s17: glp_set_obj_coef(lp, 2, 6.0); -s18: glp_set_col_name(lp, 3, "x3"); -s19: glp_set_col_bnds(lp, 3, GLP_LO, 0.0, 0.0); -s20: glp_set_obj_coef(lp, 3, 4.0); -s21: ia[1] = 1, ja[1] = 1, ar[1] = 1.0; /* a[1,1] = 1 */ -s22: ia[2] = 1, ja[2] = 2, ar[2] = 1.0; /* a[1,2] = 1 */ -s23: ia[3] = 1, ja[3] = 3, ar[3] = 1.0; /* a[1,3] = 1 */ -s24: ia[4] = 2, ja[4] = 1, ar[4] = 10.0; /* a[2,1] = 10 */ -s25: ia[5] = 3, ja[5] = 1, ar[5] = 2.0; /* a[3,1] = 2 */ -s26: ia[6] = 2, ja[6] = 2, ar[6] = 4.0; /* a[2,2] = 4 */ -s27: ia[7] = 3, ja[7] = 2, ar[7] = 2.0; /* a[3,2] = 2 */ -s28: ia[8] = 2, ja[8] = 3, ar[8] = 5.0; /* a[2,3] = 5 */ -s29: ia[9] = 3, ja[9] = 3, ar[9] = 6.0; /* a[3,3] = 6 */ -s30: glp_load_matrix(lp, 9, ia, ja, ar); -s31: glp_simplex(lp, NULL); -s32: z = glp_get_obj_val(lp); -s33: x1 = glp_get_col_prim(lp, 1); -s34: x2 = glp_get_col_prim(lp, 2); -s35: x3 = glp_get_col_prim(lp, 3); -s36: printf("\nz = %g; x1 = %g; x2 = %g; x3 = %g\n", + lp = glp_create_prob(); + glp_set_prob_name(lp, "sample"); + glp_set_obj_dir(lp, GLP_MAX); + glp_add_rows(lp, 3); + glp_set_row_name(lp, 1, "p"); + glp_set_row_bnds(lp, 1, GLP_UP, 0.0, 100.0); + glp_set_row_name(lp, 2, "q"); + glp_set_row_bnds(lp, 2, GLP_UP, 0.0, 600.0); + glp_set_row_name(lp, 3, "r"); + glp_set_row_bnds(lp, 3, GLP_UP, 0.0, 300.0); + glp_add_cols(lp, 3); + glp_set_col_name(lp, 1, "x1"); + glp_set_col_bnds(lp, 1, GLP_LO, 0.0, 0.0); + glp_set_obj_coef(lp, 1, 10.0); + glp_set_col_name(lp, 2, "x2"); + glp_set_col_bnds(lp, 2, GLP_LO, 0.0, 0.0); + glp_set_obj_coef(lp, 2, 6.0); + glp_set_col_name(lp, 3, "x3"); + glp_set_col_bnds(lp, 3, GLP_LO, 0.0, 0.0); + glp_set_obj_coef(lp, 3, 4.0); + ia[1] = 1, ja[1] = 1, ar[1] = 1.0; /* a[1,1] = 1 */ + ia[2] = 1, ja[2] = 2, ar[2] = 1.0; /* a[1,2] = 1 */ + ia[3] = 1, ja[3] = 3, ar[3] = 1.0; /* a[1,3] = 1 */ + ia[4] = 2, ja[4] = 1, ar[4] = 10.0; /* a[2,1] = 10 */ + ia[5] = 3, ja[5] = 1, ar[5] = 2.0; /* a[3,1] = 2 */ + ia[6] = 2, ja[6] = 2, ar[6] = 4.0; /* a[2,2] = 4 */ + ia[7] = 3, ja[7] = 2, ar[7] = 2.0; /* a[3,2] = 2 */ + ia[8] = 2, ja[8] = 3, ar[8] = 5.0; /* a[2,3] = 5 */ + ia[9] = 3, ja[9] = 3, ar[9] = 6.0; /* a[3,3] = 6 */ + glp_load_matrix(lp, 9, ia, ja, ar); + glp_simplex(lp, NULL); + z = glp_get_obj_val(lp); + x1 = glp_get_col_prim(lp, 1); + x2 = glp_get_col_prim(lp, 2); + x3 = glp_get_col_prim(lp, 3); + printf("\nz = %g; x1 = %g; x2 = %g; x3 = %g\n", z, x1, x2, x3); -s37: glp_delete_prob(lp); + glp_delete_prob(lp); return 0; } - diff --git a/recipes/glpk/all/test_v1_package/CMakeLists.txt b/recipes/glpk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b21cc49efde95 --- /dev/null +++ b/recipes/glpk/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/glpk/all/test_v1_package/conanfile.py b/recipes/glpk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/glpk/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/glshaderpp/all/conanfile.py b/recipes/glshaderpp/all/conanfile.py index 5f5d7e6cc487c..047572c5d5dc7 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 7f0e01ff5256f..36af631b4dd6a 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 b5aad28ecae40..8141b9ee65dbb 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 eb8a668f50e89..0000000000000 --- 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 0000000000000..e8dce6ff7068b --- /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 0000000000000..91630d79f4abb --- /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 0000000000000..6e16e1852823f --- /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 023f135034eed..0000000000000 --- 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 5246438fdf67a..20c1af33fc98d 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 5332dc62195c9..4eb7c82e9db86 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 126cafe808e38..4cff2f8c273e9 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 ab40ee8b181e8..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..5ff327440fd86 --- /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 008d442d385b9..783fc3e71ba44 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 9266fcde97cc7..2590ca2c5c73a 100644 --- a/recipes/gmp/all/conandata.yml +++ b/recipes/gmp/all/conandata.yml @@ -1,6 +1,13 @@ 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://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2" + url: + - "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.bz2" + - "https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2" sha256: "eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c" "6.2.0": url: "https://gmplib.org/download/gmp/gmp-6.2.0.tar.bz2" @@ -9,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 eae86d9dc3505..13d9a9a41b8c1 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 0000000000000..290382628e9ed --- /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 0000000000000..a73a98ce168ce --- /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 7beafba5ffe63..4be5637d7da8f 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 21b5d5bd14970..ad0c56aabe7bd 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/conandata.yml b/recipes/gnutls/all/conandata.yml index ffbcf3dfbc66a..bdde34580468c 100644 --- a/recipes/gnutls/all/conandata.yml +++ b/recipes/gnutls/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.8.2": + url: + - "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-3.8.2.tar.xz" + - "http://www.ring.gr.jp/pub/net/gnupg/gnutls/v3.8/gnutls-3.8.2.tar.xz" + - "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.8/gnutls-3.8.2.tar.xz" + sha256: "e765e5016ffa9b9dd243e363a0460d577074444ee2491267db2e96c9c2adef77" "3.7.8": url: - "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz" diff --git a/recipes/gnutls/all/conanfile.py b/recipes/gnutls/all/conanfile.py index 9f3b2e2521c51..4f1bb9180932b 100644 --- a/recipes/gnutls/all/conanfile.py +++ b/recipes/gnutls/all/conanfile.py @@ -65,15 +65,15 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("nettle/3.8.1") - self.requires("gmp/6.2.1") + self.requires("nettle/3.9.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.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/gnutls/config.yml b/recipes/gnutls/config.yml index c993c311a349d..4a62e6bbb26e7 100644 --- a/recipes/gnutls/config.yml +++ b/recipes/gnutls/config.yml @@ -1,3 +1,5 @@ versions: + "3.8.2": + folder: "all" "3.7.8": folder: "all" diff --git a/recipes/godot_headers/all/conandata.yml b/recipes/godot_headers/all/conandata.yml index 8764611b2ac9a..8f004a1d2a043 100644 --- a/recipes/godot_headers/all/conandata.yml +++ b/recipes/godot_headers/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.5.3": + url: "https://github.com/godotengine/godot-headers/archive/godot-3.5.3-stable.tar.gz" + sha256: "98bf368ab07cac91b864e983bffa50757aabf2a8156d3e9f4d81ecbcea77ebd7" + "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 0a0d46219f9db..ed0b3120bd04c 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 643dedc50d02a..de3b75d9538de 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 3ded438e58f33..6aadd92e7a3d8 100644 --- a/recipes/godot_headers/config.yml +++ b/recipes/godot_headers/config.yml @@ -1,4 +1,8 @@ versions: + "3.5.3": + folder: all + "3.5.2": + folder: all "3.5.1": folder: all "3.4.4": diff --git a/recipes/google-cloud-cpp/2.x/components_2_12_0.py b/recipes/google-cloud-cpp/2.x/components_2_12_0.py new file mode 100644 index 0000000000000..943f3345fcb41 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/components_2_12_0.py @@ -0,0 +1,411 @@ +# 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'], + "cloud_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', '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'], + "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'], + "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'], + "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'], + "cloud_dialogflow_v2_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_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'], + "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'], + "gameservices_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'], + "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', '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'], + "iot_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'], + "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_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'], + "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'], + "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'], + "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', 'protobuf::libprotobuf', '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'], + "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_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'], + "cloud_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'], + "cloud_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'], + "devtools_cloudtrace_v2_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'], + "devtools_cloudtrace_v2_tracing_protos": ['api_client_protos', 'api_field_behavior_protos', 'devtools_cloudtrace_v2_trace_protos', 'devtools_cloudtrace_v2_trace_protos', 'rpc_status_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_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", + "bigtable_protos", + "billing_protos", + "binaryauthorization_protos", + "certificatemanager_protos", + "channel_protos", + "cloud_bigquery_protos", + "cloud_common_common_protos", + "cloud_dialogflow_v2_protos", + "cloud_speech_protos", + "cloud_texttospeech_protos", + "cloudbuild_protos", + "composer_protos", + "confidentialcomputing_protos", + "connectors_protos", + "contactcenterinsights_protos", + "container_protos", + "containeranalysis_protos", + "contentwarehouse_protos", + "datacatalog_protos", + "datamigration_protos", + "dataplex_protos", + "dataproc_protos", + "datastream_protos", + "deploy_protos", + "devtools_cloudtrace_v2_trace_protos", + "devtools_cloudtrace_v2_tracing_protos", + "devtools_source_v1_source_context_protos", + "dialogflow_cx_protos", + "dlp_protos", + "documentai_protos", + "domains_protos", + "edgecontainer_protos", + "essentialcontacts_protos", + "eventarc_protos", + "filestore_protos", + "functions_protos", + "gameservices_protos", + "gkebackup_protos", + "gkehub_protos", + "gkemulticloud_protos", + "grafeas_protos", + "iam_protos", + "iam_v1_iam_policy_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + "iap_protos", + "ids_protos", + "iot_protos", + "kms_protos", + "language_protos", + "logging_protos", + "logging_type_type_protos", + "longrunning_operations_protos", + "managedidentities_protos", + "memcache_protos", + "monitoring_protos", + "networkconnectivity_protos", + "networkmanagement_protos", + "networkservices_protos", + "notebooks_protos", + "optimization_protos", + "orgpolicy_protos", + "osconfig_protos", + "oslogin_protos", + "policytroubleshooter_protos", + "privateca_protos", + "profiler_protos", + "pubsub_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", + "storage_protos", + "storageinsights_protos", + "storagetransfer_protos", + "support_protos", + "talent_protos", + "tasks_protos", + "timeseriesinsights_protos", + "tpu_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", + "composer", + "confidentialcomputing", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "contentwarehouse", + "datacatalog", + "datamigration", + "dataplex", + "dataproc", + "datastream", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "dlp", + "documentai", + "domains", + "edgecontainer", + "essentialcontacts", + "eventarc", + "filestore", + "functions", + "gameservices", + "gkebackup", + "gkehub", + "gkemulticloud", + "iam", + "iap", + "ids", + "iot", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "monitoring", + "networkconnectivity", + "networkmanagement", + "networkservices", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "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/components_2_15_1.py b/recipes/google-cloud-cpp/2.x/components_2_15_1.py new file mode 100644 index 0000000000000..6de02bc36704b --- /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/components_2_5_0.py b/recipes/google-cloud-cpp/2.x/components_2_5_0.py new file mode 100644 index 0000000000000..9244c68af5641 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/components_2_5_0.py @@ -0,0 +1,364 @@ +# 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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "accesscontextmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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'], + "apigateway_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "appengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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_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_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_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_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_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_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_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_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_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_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_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_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "connectors_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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_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_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'], + "datacatalog_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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'], + "datamigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "dataplex_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "datastream_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "debugger_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'devtools_source_v1_source_context_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "deploy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "cloud_dialogflow_v2_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dialogflow_cx_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dlp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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'], + "edgecontainer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "eventarc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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_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'], + "gameservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "iap_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iot_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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'], + "kms_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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', '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_type_protos": ['api_annotations_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "managedidentities_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_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_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_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_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', '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_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_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "policytroubleshooter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "privateca_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "pubsub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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_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_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_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_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_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_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_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', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "servicedirectory_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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_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_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'], + "cloud_speech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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'], + "storagetransfer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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'], + "talent_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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'], + "cloud_texttospeech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "tpu_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "devtools_cloudtrace_v2_trace_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "videointelligence_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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_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_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_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_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "websecurityscanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_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_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'], + "devtools_cloudtrace_v2_tracing_protos": ['api_client_protos', 'api_field_behavior_protos', 'devtools_cloudtrace_v2_trace_protos', 'devtools_cloudtrace_v2_trace_protos', 'rpc_status_protos'], +} + +PROTO_COMPONENTS = { + "accessapproval_protos", + "accesscontextmanager_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_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", + "appengine_protos", + "artifactregistry_protos", + "asset_protos", + "assuredworkloads_protos", + "automl_protos", + "baremetalsolution_protos", + "batch_protos", + "beyondcorp_protos", + "bigtable_protos", + "billing_protos", + "binaryauthorization_protos", + "certificatemanager_protos", + "channel_protos", + "cloud_bigquery_protos", + "cloud_common_common_protos", + "cloud_dialogflow_v2_protos", + "cloud_speech_protos", + "cloud_texttospeech_protos", + "cloudbuild_protos", + "composer_protos", + "connectors_protos", + "contactcenterinsights_protos", + "container_protos", + "containeranalysis_protos", + "datacatalog_protos", + "datamigration_protos", + "dataplex_protos", + "dataproc_protos", + "datastream_protos", + "debugger_protos", + "deploy_protos", + "devtools_cloudtrace_v2_trace_protos", + "devtools_cloudtrace_v2_tracing_protos", + "devtools_source_v1_source_context_protos", + "dialogflow_cx_protos", + "dlp_protos", + "documentai_protos", + "edgecontainer_protos", + "eventarc_protos", + "filestore_protos", + "functions_protos", + "gameservices_protos", + "gkehub_protos", + "grafeas_protos", + "iam_protos", + "iam_v1_iam_policy_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + "iap_protos", + "ids_protos", + "iot_protos", + "kms_protos", + "language_protos", + "logging_protos", + "logging_type_type_protos", + "longrunning_operations_protos", + "managedidentities_protos", + "memcache_protos", + "monitoring_protos", + "networkconnectivity_protos", + "networkmanagement_protos", + "notebooks_protos", + "optimization_protos", + "orgpolicy_protos", + "osconfig_protos", + "oslogin_protos", + "policytroubleshooter_protos", + "privateca_protos", + "profiler_protos", + "pubsub_protos", + "recommender_protos", + "redis_protos", + "resourcemanager_protos", + "resourcesettings_protos", + "retail_protos", + "rpc_code_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", + "storage_protos", + "storagetransfer_protos", + "talent_protos", + "tasks_protos", + "tpu_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_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" +} + +COMPONENTS = { + "accessapproval", + "accesscontextmanager", + "apigateway", + "apigeeconnect", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "composer", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "datacatalog", + "datamigration", + "dataplex", + "dataproc", + "datastream", + "debugger", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "dlp", + "documentai", + "edgecontainer", + "eventarc", + "filestore", + "functions", + "gameservices", + "gkehub", + "iam", + "iap", + "ids", + "iot", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "monitoring", + "networkconnectivity", + "networkmanagement", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "storage", + "storagetransfer", + "talent", + "tasks", + "texttospeech", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows" +} diff --git a/recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake b/recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake deleted file mode 100644 index 17098fdadc87d..0000000000000 --- a/recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake +++ /dev/null @@ -1,10 +0,0 @@ -find_package(googleapis CONFIG REQUIRED) -if (NOT ("${googleapis_RES_DIRS_RELEASE}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_RELEASE}") -elseif (NOT ("${googleapis_RES_DIRS_RELWITHDEBINFO}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_RELWITHDEBINFO}") -elseif (NOT ("${googleapis_RES_DIRS_MINSIZEREL}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_MINSIZEREL}") -elseif (NOT ("${googleapis_RES_DIRS_DEBUG}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_DEBUG}") -endif () diff --git a/recipes/google-cloud-cpp/2.x/conandata.yml b/recipes/google-cloud-cpp/2.x/conandata.yml index 94473c6cb2ac9..dfb3c94da034e 100644 --- a/recipes/google-cloud-cpp/2.x/conandata.yml +++ b/recipes/google-cloud-cpp/2.x/conandata.yml @@ -2,11 +2,14 @@ sources: "2.5.0": url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.5.0.tar.gz" sha256: "ac93ef722d08bfb220343bde2f633c7c11f15e34ec3ecd0a57dbd3ff729cc3a6" + "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/001-use-googleapis-conan-package.patch" - patch_description: "Use Conan package for googleapis" - patch_type: conan - patch_file: "patches/2.5.0/002-interface-library-properties.patch" patch_source: https://github.com/googleapis/google-cloud-cpp/pull/10636 patch_description: "Fix problems with INTERFACE proto libraries" @@ -14,3 +17,23 @@ patches: - patch_file: "patches/2.5.0/003-use-conan-msvc-runtime.patch" patch_description: "Let Conan select the MSVC runtime" patch_type: conan + - patch_file: "patches/2.5.0/004-remove-duplicate-protos.patch" + patch_source: https://github.com/googleapis/google-cloud-cpp/pull/10486 + patch_description: "Some libraries defined had duplicate symbols" + patch_type: backport + - patch_file: "patches/2.5.0/005-interface-library-properties.patch" + 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 0da218c665ea2..e3b497dfc81db 100644 --- a/recipes/google-cloud-cpp/2.x/conanfile.py +++ b/recipes/google-cloud-cpp/2.x/conanfile.py @@ -3,12 +3,26 @@ 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 from conan.errors import ConanInvalidConfiguration +# Load the generated component dependency information. +# +# `google-cloud-cpp` has well over 200 components. Conan cannot use the CMake +# files generated by `google-cloud-cpp`. Manually maintaining this dependency +# information is error prone and fairly tedious. A helper script in this +# directory reproduces the algorithms used by `google-cloud-cpp` to generate its +# dependency information. With each new revision of `google-cloud-cpp` the +# script will be used to generate a new file with the component dependency +# information. The expectation is that maintaining this script will be easier +# 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" @@ -31,11 +45,34 @@ class GoogleCloudCppConan(ConanFile): settings = "os", "arch", "compiler", "build_type" options = {"shared": [True, False], "fPIC": [True, False]} 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 + _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 = { + "bigquery", "bigtable", "iam", "pubsub", "spanner", "storage", + } + 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) def config_options(self): @@ -46,8 +83,6 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") self.options["protobuf"].shared = True - self.options["googleapis"].shared = True - self.options["grpc-proto"].shared = True self.options["grpc"].shared = True def validate(self): @@ -64,6 +99,21 @@ def validate(self): "Recipe not prepared for cross-building (yet)" ) + if self.version not in self._GA_COMPONENTS: + raise ConanInvalidConfiguration( + "The components are unknown for version %s" % self.version + ) + + if self.version not in self._PROTO_COMPONENTS: + raise ConanInvalidConfiguration( + "The proto components are unknown for version %s" % self.version + ) + + if self.version not in self._PROTO_COMPONENT_DEPENDENCIES: + raise ConanInvalidConfiguration( + "The inter-component dependencies are unknown for version %s" % self.version + ) + if ( self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "6.0" @@ -81,14 +131,10 @@ def validate(self): if self.info.options.shared and \ (not self.dependencies["protobuf"].options.shared or \ - not self.dependencies["googleapis"].options.shared or \ - not self.dependencies["grpc-proto"].options.shared or \ not self.dependencies["grpc"].options.shared): raise ConanInvalidConfiguration( - "If built as shared, protobuf, googleapis, grpc-proto, and grpc must be shared as well." - " Please, use `protobuf/*:shared=True`, `googleapis/*:shared=True`, `grpc-proto/*:shared=True`," - " and `grpc/*:shared=True`", - ) + "If built as shared, protobuf, and grpc must be shared as well." + " Please, use `protobuf/*:shared=True`, and `grpc/*:shared=True`.") def layout(self): cmake_layout(self, src_folder="src") @@ -97,31 +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") - # `google-cloud-cpp` contains code generated from the proto files. - # Working with older versions of these protos almost always will fail, as - # at least some of the RPCs included in the GRPC-generator stubs will be - # missing. - # Working with newer versions of these protos almost always will work. There - # are very few breaking changes on the proto files. - self.requires(f"googleapis/{self._GOOGLEAPIS_VERSIONS[self.version]}", transitive_headers=True) + 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.cache_variables["CMAKE_PROJECT_google-cloud-cpp_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") 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") @@ -137,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() @@ -147,124 +193,49 @@ def build(self): cmake.configure() cmake.build() - _GOOGLEAPIS_VERSIONS = { - "2.5.0": "cci.20221108", - } - - _GA_COMPONENTS_BASE = {"bigquery", "bigtable", "iam", "pubsub", "spanner", "storage"} - _GA_COMPONENTS_VERSION = { - '2.5.0': { - "accessapproval", - "accesscontextmanager", - "apigateway", - "apigeeconnect", - "appengine", - "artifactregistry", - "asset", - "assuredworkloads", - "automl", - "baremetalsolution", - "batch", - "beyondcorp", - "billing", - "binaryauthorization", - "certificatemanager", - "channel", - "cloudbuild", - "composer", - "connectors", - "contactcenterinsights", - "container", - "containeranalysis", - "datacatalog", - "datamigration", - "dataplex", - "dataproc", - "datastream", - "debugger", - "deploy", - "dialogflow_cx", - "dialogflow_es", - "dlp", - "documentai", - "edgecontainer", - "eventarc", - "filestore", - "functions", - "gameservices", - "gkehub", - "iap", - "ids", - "iot", - "kms", - "language", - "logging", - "managedidentities", - "memcache", - "monitoring", - "networkconnectivity", - "networkmanagement", - "notebooks", - "optimization", - "orgpolicy", - "osconfig", - "oslogin", - "policytroubleshooter", - "privateca", - "profiler", - "recommender", - "redis", - "resourcemanager", - "resourcesettings", - "retail", - "run", - "scheduler", - "secretmanager", - "securitycenter", - "servicecontrol", - "servicedirectory", - "servicemanagement", - "serviceusage", - "shell", - "speech", - "storagetransfer", - "talent", - "tasks", - "texttospeech", - "tpu", - "trace", - "translate", - "video", - "videointelligence", - "vision", - "vmmigration", - "vmwareengine", - "vpcaccess", - "webrisk", - "websecurityscanner", - "workflows", - }, + def _generate_proto_requires(self, component): + deps = self._PROTO_COMPONENT_DEPENDENCIES.get(self.version, dict()) + return deps.get(component, []) + + _SKIPPED_COMPONENTS = { + # Some protos do not compile due to inconvenient system macros clashing + # with proto enum values. Protobuf can workaround these problems, but + # the current version in Conan index (protobuf/3.21.4) do not contain + # the fixes for these cases. + # TODO - review after protobuf >= 4.23.x + 'asset', + 'channel', + 'storagetransfer', + # TODO - certificatemanager crashes the gRPC code generator. Add it back + # after gRPC >= 1.53.x + 'certificatemanager', } def _components(self): - result = self._GA_COMPONENTS_BASE - for v in sorted(self._GA_COMPONENTS_VERSION.keys()): - if v > Version(self): - break - result = result.union(self._GA_COMPONENTS_VERSION[v]) - # Some protos do not compile due to inconvenient system macros clashing with proto enum values. - # Protobuf can workaround these problems, but the current version in Conan index (protobuf/3.21.4) - # do not contain the fixes for these cases. - # TODO - review after protobuf >= 3.22.x - result.remove('asset') - result.remove('channel') - result.remove('storagetransfer') - # Some of the macros are platform specific. + result = self._GA_COMPONENTS.get(self.version, []).copy() + for c in self._SKIPPED_COMPONENTS: + result.remove(c) + # TODO - these do not build on Android due to conflicts between OS + # macros and Proto enums. Revisit after Protobuf >= 4.23.x if self.settings.os == "Android": result.remove('accesscontextmanager') result.remove('talent') - # TODO - certificatemanager crashes the gRPC code generator. Add it back after gRPC >= 1.53.x - result.remove('certificatemanager') + return result + + def _proto_components(self): + result = self._PROTO_COMPONENTS.get(self.version, []).copy() + for c in self._SKIPPED_COMPONENTS: + result.remove(c + '_protos') + # TODO - these do not build on Android due to conflicts between OS + # macros and Proto enums. Revisit after Protobuf >= 4.23.x + 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): @@ -275,8 +246,7 @@ def package(self): rmdir(self, path=os.path.join(self.package_folder, "lib", "pkgconfig")) def _add_proto_component(self, component): - PROTOS_SHARED_REQUIRES=["googleapis::googleapis", "grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf"] - self.cpp_info.components[component].requires = PROTOS_SHARED_REQUIRES + self.cpp_info.components[component].requires = self._generate_proto_requires(component) self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" @@ -296,36 +266,75 @@ def package_info(self): self.cpp_info.components["rest_internal"].names["pkg_config"] = "google_cloud_cpp_common" # A small number of gRPC-generated stubs are used directly in the common components - # shared by all gRPC-based libraries. These bust be defined without reference to `grpc_utils`. - GRPC_UTILS_REQUIRED_PROTOS=["iam_protos", "longrunning_operations_protos", "rpc_error_details_protos", "rpc_status_protos"] + # shared by all gRPC-based libraries. These must be defined without reference to `grpc_utils`. + 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) - self.cpp_info.components["grpc_utils"].requires = GRPC_UTILS_REQUIRED_PROTOS + ["common", "abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "grpc::grpc++", "grpc::_grpc"] + self.cpp_info.components["grpc_utils"].requires = list(GRPC_UTILS_REQUIRED_PROTOS) + ["common", "abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "grpc::grpc++", "grpc::_grpc"] self.cpp_info.components["grpc_utils"].libs = ["google_cloud_cpp_grpc_utils"] 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 + 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 != 'storage' and component not in GRPC_UTILS_REQUIRED_PROTOS: - self._add_proto_component(protos) - # The components in self._GA_COMPONENTS_BASE are hand-crafted and need custom - # definitions (see below) - if component in self._GA_COMPONENTS_BASE: + 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 new file mode 100755 index 0000000000000..a957a6eca412b --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/extract_dependencies.py @@ -0,0 +1,375 @@ +#!/usr/bin/env python3 + +import argparse +import glob +import os + +"""Extract google-cloud-cpp's component dependency info for use in Conan. + +google-cloud-cpp builds a number (about 100) of libraries from proto files. +These libraries have dependencies between them. In Conan, one cannot use the +dependencies preserved in the *-config.cmake files generated by the package, so +we have to reconstruct the dependencies here. + +Fortunately, google-cloud-cpp uses a number of *.deps files to keep these +dependencies. We just need to reimplement their algorithm to load these files +and convert them to CMake dependencies. + +The *.deps files themselves are generated (and committed to GitHub) from +Bazel rules. +""" + +# Used in _generate_proto_requires(): common requirements +_PROTO_DEPS_COMMON_REQUIRES = {"grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf"} + +# Used in _generate_proto_requires(): the *.deps files are generated from +# Bazel and contain a few targets that do not exit (nor do they need to +# exist) in CMake. +_PROTO_DEPS_REMOVED_TARGETS = { + "cloud_kms_v1_kms_protos", + "cloud_orgpolicy_v1_orgpolicy_protos", + "cloud_oslogin_common_common_protos", + "cloud_recommender_v1_recommender_protos", + "identity_accesscontextmanager_type_type_protos", +} + +# Used in _generate_proto_requires(): the *.deps files are generated from +# Bazel and contain a few targets that have incorrect names for CMake. +_PROTO_DEPS_REPLACED_TARGETS = { + "grafeas_v1_grafeas_protos": "grafeas_protos", + "identity_accesscontextmanager_v1_accesscontextmanager_protos": "accesscontextmanager_protos", + "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", +} + +# A few *.deps files are not used. +_PROTO_DEPS_UNUSED = { + "iam_policy", +} + +# A few _protos libraries were introduced before `google-cloud-cpp` adopted +# more consistent naming. +_PROTO_BASE_COMPONENTS = { + "api_service_protos", + "api_visibility_protos", + "api_monitoring_protos", + "type_date_protos", + "api_control_protos", + "api_client_protos", + "api_annotations_protos", + "api_httpbody_protos", + "iam_v1_policy_protos", + "api_auth_protos", + "api_resource_protos", + "api_billing_protos", + "api_quota_protos", + "api_source_info_protos", + "api_backend_protos", + "type_datetime_protos", + "iam_v1_options_protos", + "api_endpoint_protos", + "api_launch_stage_protos", + "api_documentation_protos", + "devtools_source_v1_source_context_protos", + "type_color_protos", + "api_distribution_protos", + "api_config_change_protos", + "iam_v1_iam_policy_protos", + "type_expr_protos", + "api_routing_protos", + "api_usage_protos", + "type_calendar_period_protos", + "rpc_code_protos", + "api_system_parameter_protos", + "cloud_common_common_protos", + "type_postal_address_protos", + "type_latlng_protos", + "type_dayofweek_protos", + "api_monitored_resource_protos", + "type_money_protos", + "api_metric_protos", + "api_label_protos", + "api_log_protos", + "grafeas_protos", + "api_http_protos", + "type_timeofday_protos", + "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 +# provide an easy-to-use list. +_DEFAULT_EXPERIMENTAL_COMPONENTS = { + "apikeys", + "pubsublite", +} + +# A list of components used when `google-cloud-cpp` does not provide an +# easy-to-use list. +_DEFAULT_COMPONENTS = { + "accessapproval", + "accesscontextmanager", + "apigateway", + "apigeeconnect", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "composer", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "datacatalog", + "datamigration", + "dataplex", + "dataproc", + "datastream", + "debugger", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "dlp", + "documentai", + "edgecontainer", + "eventarc", + "filestore", + "functions", + "gameservices", + "gkehub", + "iam", + "iap", + "ids", + "iot", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "monitoring", + "networkconnectivity", + "networkmanagement", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "storage", + "storagetransfer", + "talent", + "tasks", + "texttospeech", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows", +} + +# `google-cloud-cpp` managems these dependencies using CMake code. +_HARD_CODED_DEPENDENCIES = { + "api_annotations_protos": ["api_http_protos"], + "api_auth_protos": ["api_annotations_protos"], + "api_client_protos": ["api_launch_stage_protos"], + "api_metric_protos": ["api_launch_stage_protos", "api_label_protos"], + "api_billing_protos": ["api_annotations_protos", "api_metric_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_monitored_resource_protos": ["api_launch_stage_protos", "api_label_protos"], + "api_monitoring_protos": ["api_annotations_protos"], + "api_quota_protos": ["api_annotations_protos"], + "api_usage_protos": ["api_annotations_protos", "api_visibility_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", + ], + "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", + "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", + ], +} + + +def _components(source_folder): + libraries = os.path.join(source_folder, "libraries.bzl") + # Use the hard-coded list because the `google-cloud-cpp` does not provide + # an easy way to get all the components. + if not os.path.exists(libraries): + return _DEFAULT_COMPONENTS + # The `libraries.bzl` file is a Starlark file that simply defines some + # variables listing all GA, experimental, and "transition", components. + # We want both the GA and transition components, the latter are components + # that recently transitioned from experimental to GA. + g = dict() + with open(libraries) as f: + exec(compile(f.read(), libraries, "exec"), g) + return ( + g["GOOGLE_CLOUD_CPP_GA_LIBRARIES"] + g["GOOGLE_CLOUD_CPP_TRANSITION_LIBRARIES"] + ) + + +def _experimental_components(source_folder): + libraries = os.path.join(source_folder, "libraries.bzl") + # Use the hard-coded list because the `google-cloud-cpp` does not provide + # an easy way to get all the components. + if not os.path.exists(libraries): + return _DEFAULT_EXPERIMENTAL_COMPONENTS + # The `libraries.bzl` file is a Starlark file that simply defines some + # variables listing all GA, experimental, and "transition", components. + # We want to return any experimental components, the caller will skip them + # as they are not built by Conan. + g = dict() + with open(libraries) as f: + exec(compile(f.read(), libraries, "exec"), g) + return g["GOOGLE_CLOUD_CPP_EXPERIMENTAL_LIBRARIES"] + + +def _generate_proto_requires(depfile): + """Load the dependencies for a single google-cloud-cpp::*-protos library.""" + requires = [] + with open(depfile, "r", encoding="utf-8") as f: + for line in f.readlines(): + line = line.strip() + line = line.replace(":", "_") + line = line.replace("_proto", "_protos") + line = line.replace("@com_google_googleapis//", "") + line = line.replace("google/", "") + line = line.replace("/", "_") + if line in _PROTO_DEPS_REMOVED_TARGETS: + continue + line = _PROTO_DEPS_REPLACED_TARGETS.get(line, line) + requires.append(line) + return list(_PROTO_DEPS_COMMON_REQUIRES) + requires + + +def main(): + """Generate a python file representing the google-cloud-cpp proto deps.""" + parser = argparse.ArgumentParser(description=(__doc__)) + parser.add_argument( + "-s", + "--source-folder", + help="a directory where `google-cloud-cpp` source has been extracted", + ) + args = parser.parse_args() + source_folder = vars(args)["source_folder"] + deps_folder = os.path.join(source_folder, "external", "googleapis", "protodeps") + print("# Automatically generated by %s DO NOT EDIT" % __file__) + print("DEPENDENCIES = {") + proto_components = _PROTO_BASE_COMPONENTS.copy() + files = sorted(glob.glob(os.path.join(deps_folder, "*.deps"))) + experimental = set(_experimental_components(source_folder)) + for filename in files: + component = os.path.basename(filename).replace(".deps", "") + component = _PROTO_DEPS_REPLACED_NAMES.get(component, component) + if component in experimental or component in _PROTO_DEPS_UNUSED: + # Experimental components have an associated *_protos, component. + # The Conan package only compiles the GA components, so we need + # to skip these. + continue + component = component + "_protos" + deps = _generate_proto_requires(filename) + proto_components.add(component) + proto_components.update(deps) + print(f' "{component}": {sorted(deps)},') + for component in sorted(_HARD_CODED_DEPENDENCIES.keys()): + deps = _HARD_CODED_DEPENDENCIES[component] + proto_components.add(component) + proto_components.update(deps) + print(f' "{component}": {sorted(deps)},') + print("}") + proto_components = proto_components - _PROTO_DEPS_COMMON_REQUIRES + names = ['"%s"' % c for c in proto_components] + joined = ",\n ".join(sorted(names)) + print(f"\nPROTO_COMPONENTS = {{\n {joined}\n}}") + names = ['"%s"' % c for c in _components(source_folder)] + joined = ",\n ".join(sorted(names)) + print(f"\nCOMPONENTS = {{\n {joined}\n}}") + + +if __name__ == "__main__": + main() diff --git a/recipes/google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch b/recipes/google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch new file mode 100644 index 0000000000000..bfefce3078428 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index faab325a..657abd4c 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 0cb7a9ae..d9016a0b 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -14,9 +14,6 @@ + # limitations under the License. + # ~~~ + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + add_executable(gcs2cbt gcs2cbt.cc) + target_link_libraries(gcs2cbt google-cloud-cpp::bigtable + google-cloud-cpp::storage google-cloud-cpp::grpc_utils) +diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt +index 03535ff8..2b05c214 100644 +--- a/external/googleapis/CMakeLists.txt ++++ b/external/googleapis/CMakeLists.txt +@@ -157,8 +157,6 @@ if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") + endif () + +-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.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 0000000000000..f1d07df826202 --- /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/001-use-googleapis-conan-package.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/001-use-googleapis-conan-package.patch deleted file mode 100644 index 44737240ad451..0000000000000 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/001-use-googleapis-conan-package.patch +++ /dev/null @@ -1,1279 +0,0 @@ -diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake -index 366edba..4eb5ea3 100644 ---- a/cmake/CompileProtos.cmake -+++ b/cmake/CompileProtos.cmake -@@ -362,20 +362,10 @@ function (google_cloud_cpp_proto_library libname) - return() - endif () - -- if (${_opt_LOCAL_INCLUDE}) -- google_cloud_cpp_generate_proto( -- proto_sources ${_opt_UNPARSED_ARGUMENTS} LOCAL_INCLUDE -- PROTO_PATH_DIRECTORIES ${_opt_PROTO_PATH_DIRECTORIES}) -- else () -- google_cloud_cpp_generate_proto( -- proto_sources ${_opt_UNPARSED_ARGUMENTS} PROTO_PATH_DIRECTORIES -- ${_opt_PROTO_PATH_DIRECTORIES}) -- endif () -- - add_library(${libname} ${proto_sources}) - set_property(TARGET ${libname} PROPERTY PROTO_SOURCES - ${_opt_UNPARSED_ARGUMENTS}) -- target_link_libraries(${libname} PUBLIC gRPC::grpc++ gRPC::grpc -+ target_link_libraries(${libname} PUBLIC gRPC::grpc++ gRPC::grpc googleapis::googleapis - protobuf::libprotobuf) - # We want to treat the generated code as "system" headers so they get - # ignored by the more aggressive warnings. -diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt -index ad2bd4b..28bf016 100644 ---- a/external/googleapis/CMakeLists.txt -+++ b/external/googleapis/CMakeLists.txt -@@ -16,24 +16,6 @@ - - include(GoogleapisConfig) - --set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL -- "https://github.com/googleapis/googleapis/archive/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}.tar.gz" -- "https://storage.googleapis.com/cloud-cpp-community-archive/com_google_googleapis/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}.tar.gz" --) --set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH -- "${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256}") --if (GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL) -- set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL -- ${GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL}) --endif () --if (GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL_HASH) -- set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH -- "${GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL_HASH}") --endif () -- --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") -- - set(EXTERNAL_GOOGLEAPIS_PROTO_FILES - # cmake-format: sort - "google/api/annotations.proto" -@@ -113,32 +95,6 @@ foreach (file IN LISTS protolists) - endforeach () - endforeach () - --include(ExternalProject) -- --externalproject_add( -- googleapis_download -- EXCLUDE_FROM_ALL ON -- PREFIX "${PROJECT_BINARY_DIR}/external/googleapis" -- URL ${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL} -- URL_HASH SHA256=${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH} -- PATCH_COMMAND -- "" -- # ~~~ -- # Scaffolding for patching googleapis after download. For example: -- # PATCH_COMMAND -- # patch -- # -p1 -- # --input=/workspace/external/googleapis.patch -- # NOTE: This should only be used while developing with a new -- # protobuf message. No changes to `PATCH_COMMAND` should ever be -- # committed to the main branch. -- # ~~~ -- CONFIGURE_COMMAND "" -- BUILD_COMMAND "" -- INSTALL_COMMAND "" -- BUILD_BYPRODUCTS ${EXTERNAL_GOOGLEAPIS_BYPRODUCTS} -- LOG_DOWNLOAD OFF) -- - # Sometimes (this happens often with vcpkg) protobuf is installed in a non- - # standard directory. We need to find out where, and then add that directory to - # the search path for protos. -@@ -187,7 +143,6 @@ function (external_googleapis_add_library proto) - endfunction () - - function (external_googleapis_set_version_and_alias short_name) -- add_dependencies("google_cloud_cpp_${short_name}" googleapis_download) - set_target_properties( - "google_cloud_cpp_${short_name}" - PROPERTIES EXPORT_NAME google-cloud-cpp::${short_name} -diff --git a/google/cloud/accessapproval/CMakeLists.txt b/google/cloud/accessapproval/CMakeLists.txt -index 43af932..e297251 100644 ---- a/google/cloud/accessapproval/CMakeLists.txt -+++ b/google/cloud/accessapproval/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::accessapproval_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/accesscontextmanager/CMakeLists.txt b/google/cloud/accesscontextmanager/CMakeLists.txt -index 9ff4ce8..3c96472 100644 ---- a/google/cloud/accesscontextmanager/CMakeLists.txt -+++ b/google/cloud/accesscontextmanager/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::accesscontextmanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/apigateway/CMakeLists.txt b/google/cloud/apigateway/CMakeLists.txt -index 5764bd3..517eb1e 100644 ---- a/google/cloud/apigateway/CMakeLists.txt -+++ b/google/cloud/apigateway/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apigateway_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/apigeeconnect/CMakeLists.txt b/google/cloud/apigeeconnect/CMakeLists.txt -index 17bd60f..af353aa 100644 ---- a/google/cloud/apigeeconnect/CMakeLists.txt -+++ b/google/cloud/apigeeconnect/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apigeeconnect_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/apikeys/CMakeLists.txt b/google/cloud/apikeys/CMakeLists.txt -index 9359474..6410175 100644 ---- a/google/cloud/apikeys/CMakeLists.txt -+++ b/google/cloud/apikeys/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apikeys_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/appengine/CMakeLists.txt b/google/cloud/appengine/CMakeLists.txt -index 154a058..6136505 100644 ---- a/google/cloud/appengine/CMakeLists.txt -+++ b/google/cloud/appengine/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::appengine_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/artifactregistry/CMakeLists.txt b/google/cloud/artifactregistry/CMakeLists.txt -index 43d5f07..53184d4 100644 ---- a/google/cloud/artifactregistry/CMakeLists.txt -+++ b/google/cloud/artifactregistry/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::artifactregistry_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/asset/CMakeLists.txt b/google/cloud/asset/CMakeLists.txt -index dc33c07..6924523 100644 ---- a/google/cloud/asset/CMakeLists.txt -+++ b/google/cloud/asset/CMakeLists.txt -@@ -31,8 +31,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/assuredworkloads/CMakeLists.txt b/google/cloud/assuredworkloads/CMakeLists.txt -index a081c00..01332c6 100644 ---- a/google/cloud/assuredworkloads/CMakeLists.txt -+++ b/google/cloud/assuredworkloads/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::assuredworkloads_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/automl/CMakeLists.txt b/google/cloud/automl/CMakeLists.txt -index c890e5e..f711f54 100644 ---- a/google/cloud/automl/CMakeLists.txt -+++ b/google/cloud/automl/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::automl_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/baremetalsolution/CMakeLists.txt b/google/cloud/baremetalsolution/CMakeLists.txt -index df02616..f4cbee4 100644 ---- a/google/cloud/baremetalsolution/CMakeLists.txt -+++ b/google/cloud/baremetalsolution/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::baremetalsolution_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/batch/CMakeLists.txt b/google/cloud/batch/CMakeLists.txt -index 03a1a3d..9645386 100644 ---- a/google/cloud/batch/CMakeLists.txt -+++ b/google/cloud/batch/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::batch_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/beyondcorp/CMakeLists.txt b/google/cloud/beyondcorp/CMakeLists.txt -index e8eea05..24b9a98 100644 ---- a/google/cloud/beyondcorp/CMakeLists.txt -+++ b/google/cloud/beyondcorp/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::beyondcorp_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/billing/CMakeLists.txt b/google/cloud/billing/CMakeLists.txt -index 54c45e6..4c928e6 100644 ---- a/google/cloud/billing/CMakeLists.txt -+++ b/google/cloud/billing/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::billing_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/binaryauthorization/CMakeLists.txt b/google/cloud/binaryauthorization/CMakeLists.txt -index 9f8cd45..48363e2 100644 ---- a/google/cloud/binaryauthorization/CMakeLists.txt -+++ b/google/cloud/binaryauthorization/CMakeLists.txt -@@ -32,8 +32,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/certificatemanager/CMakeLists.txt b/google/cloud/certificatemanager/CMakeLists.txt -index 84a25b0..f4bae6d 100644 ---- a/google/cloud/certificatemanager/CMakeLists.txt -+++ b/google/cloud/certificatemanager/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::certificatemanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/channel/CMakeLists.txt b/google/cloud/channel/CMakeLists.txt -index ed6967b..ac19559 100644 ---- a/google/cloud/channel/CMakeLists.txt -+++ b/google/cloud/channel/CMakeLists.txt -@@ -35,8 +35,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::channel_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/cloudbuild/CMakeLists.txt b/google/cloud/cloudbuild/CMakeLists.txt -index 8f30f40..04d6a82 100644 ---- a/google/cloud/cloudbuild/CMakeLists.txt -+++ b/google/cloud/cloudbuild/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::cloudbuild_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/composer/CMakeLists.txt b/google/cloud/composer/CMakeLists.txt -index cde8542..c9af9d1 100644 ---- a/google/cloud/composer/CMakeLists.txt -+++ b/google/cloud/composer/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::composer_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/connectors/CMakeLists.txt b/google/cloud/connectors/CMakeLists.txt -index aef9110..cfd986f 100644 ---- a/google/cloud/connectors/CMakeLists.txt -+++ b/google/cloud/connectors/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::connectors_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/contactcenterinsights/CMakeLists.txt b/google/cloud/contactcenterinsights/CMakeLists.txt -index 03b74ed..3f8831c 100644 ---- a/google/cloud/contactcenterinsights/CMakeLists.txt -+++ b/google/cloud/contactcenterinsights/CMakeLists.txt -@@ -30,8 +30,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/container/CMakeLists.txt b/google/cloud/container/CMakeLists.txt -index 20a6c8b..dedca21 100644 ---- a/google/cloud/container/CMakeLists.txt -+++ b/google/cloud/container/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::container_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/containeranalysis/CMakeLists.txt b/google/cloud/containeranalysis/CMakeLists.txt -index 7548de3..e2486d2 100644 ---- a/google/cloud/containeranalysis/CMakeLists.txt -+++ b/google/cloud/containeranalysis/CMakeLists.txt -@@ -30,8 +30,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/datacatalog/CMakeLists.txt b/google/cloud/datacatalog/CMakeLists.txt -index 7e80060..dd20ab2 100644 ---- a/google/cloud/datacatalog/CMakeLists.txt -+++ b/google/cloud/datacatalog/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datacatalog_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/datamigration/CMakeLists.txt b/google/cloud/datamigration/CMakeLists.txt -index ee95f1a..1772e90 100644 ---- a/google/cloud/datamigration/CMakeLists.txt -+++ b/google/cloud/datamigration/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datamigration_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dataplex/CMakeLists.txt b/google/cloud/dataplex/CMakeLists.txt -index c83e390..079242e 100644 ---- a/google/cloud/dataplex/CMakeLists.txt -+++ b/google/cloud/dataplex/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dataplex_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dataproc/CMakeLists.txt b/google/cloud/dataproc/CMakeLists.txt -index ed180ca..e8c5912 100644 ---- a/google/cloud/dataproc/CMakeLists.txt -+++ b/google/cloud/dataproc/CMakeLists.txt -@@ -32,8 +32,6 @@ find_package(absl CONFIG REQUIRED) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/datastream/CMakeLists.txt b/google/cloud/datastream/CMakeLists.txt -index 7ecfd1f..2a7c100 100644 ---- a/google/cloud/datastream/CMakeLists.txt -+++ b/google/cloud/datastream/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datastream_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/debugger/CMakeLists.txt b/google/cloud/debugger/CMakeLists.txt -index 8c299f3..3fae60d 100644 ---- a/google/cloud/debugger/CMakeLists.txt -+++ b/google/cloud/debugger/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::debugger_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/deploy/CMakeLists.txt b/google/cloud/deploy/CMakeLists.txt -index 73c0d68..9181cb8 100644 ---- a/google/cloud/deploy/CMakeLists.txt -+++ b/google/cloud/deploy/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::deploy_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dialogflow_cx/CMakeLists.txt b/google/cloud/dialogflow_cx/CMakeLists.txt -index 90c70e3..4aead59 100644 ---- a/google/cloud/dialogflow_cx/CMakeLists.txt -+++ b/google/cloud/dialogflow_cx/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dialogflow_cx_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dialogflow_es/CMakeLists.txt b/google/cloud/dialogflow_es/CMakeLists.txt -index 0ddf345..fad8716 100644 ---- a/google/cloud/dialogflow_es/CMakeLists.txt -+++ b/google/cloud/dialogflow_es/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dialogflow_es_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dlp/CMakeLists.txt b/google/cloud/dlp/CMakeLists.txt -index 67c6329..f6eaa27 100644 ---- a/google/cloud/dlp/CMakeLists.txt -+++ b/google/cloud/dlp/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dlp_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/documentai/CMakeLists.txt b/google/cloud/documentai/CMakeLists.txt -index 00bc94b..42fd1e1 100644 ---- a/google/cloud/documentai/CMakeLists.txt -+++ b/google/cloud/documentai/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::documentai_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/edgecontainer/CMakeLists.txt b/google/cloud/edgecontainer/CMakeLists.txt -index 4cacb9a..08a2f2e 100644 ---- a/google/cloud/edgecontainer/CMakeLists.txt -+++ b/google/cloud/edgecontainer/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::edgecontainer_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/eventarc/CMakeLists.txt b/google/cloud/eventarc/CMakeLists.txt -index d5e2854..fe37f94 100644 ---- a/google/cloud/eventarc/CMakeLists.txt -+++ b/google/cloud/eventarc/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::eventarc_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/filestore/CMakeLists.txt b/google/cloud/filestore/CMakeLists.txt -index 1f5a0e8..0ae2d00 100644 ---- a/google/cloud/filestore/CMakeLists.txt -+++ b/google/cloud/filestore/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::filestore_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/functions/CMakeLists.txt b/google/cloud/functions/CMakeLists.txt -index ec9ebcd..50d9fc7 100644 ---- a/google/cloud/functions/CMakeLists.txt -+++ b/google/cloud/functions/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::functions_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/gameservices/CMakeLists.txt b/google/cloud/gameservices/CMakeLists.txt -index 30d81ff..0b9cf8c 100644 ---- a/google/cloud/gameservices/CMakeLists.txt -+++ b/google/cloud/gameservices/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::gameservices_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/gkehub/CMakeLists.txt b/google/cloud/gkehub/CMakeLists.txt -index 1747a18..d71c854 100644 ---- a/google/cloud/gkehub/CMakeLists.txt -+++ b/google/cloud/gkehub/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::gkehub_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/grafeas/CMakeLists.txt b/google/cloud/grafeas/CMakeLists.txt -index 2ed9350..33ba5fd 100644 ---- a/google/cloud/grafeas/CMakeLists.txt -+++ b/google/cloud/grafeas/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::grafeas_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/iap/CMakeLists.txt b/google/cloud/iap/CMakeLists.txt -index a22e9b0..4c78edb 100644 ---- a/google/cloud/iap/CMakeLists.txt -+++ b/google/cloud/iap/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::iap_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/ids/CMakeLists.txt b/google/cloud/ids/CMakeLists.txt -index 4724bf2..fc73ea3 100644 ---- a/google/cloud/ids/CMakeLists.txt -+++ b/google/cloud/ids/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::ids_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/iot/CMakeLists.txt b/google/cloud/iot/CMakeLists.txt -index 3619b82..1874025 100644 ---- a/google/cloud/iot/CMakeLists.txt -+++ b/google/cloud/iot/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::iot_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/kms/CMakeLists.txt b/google/cloud/kms/CMakeLists.txt -index 14a2ef3..59a3596 100644 ---- a/google/cloud/kms/CMakeLists.txt -+++ b/google/cloud/kms/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::kms_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/language/CMakeLists.txt b/google/cloud/language/CMakeLists.txt -index 123ef3c..add8dbc 100644 ---- a/google/cloud/language/CMakeLists.txt -+++ b/google/cloud/language/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::language_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/managedidentities/CMakeLists.txt b/google/cloud/managedidentities/CMakeLists.txt -index 674ce03..b5e4bfa 100644 ---- a/google/cloud/managedidentities/CMakeLists.txt -+++ b/google/cloud/managedidentities/CMakeLists.txt -@@ -31,8 +31,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::managedidentities_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/memcache/CMakeLists.txt b/google/cloud/memcache/CMakeLists.txt -index 8a0ad6b..2fafadc 100644 ---- a/google/cloud/memcache/CMakeLists.txt -+++ b/google/cloud/memcache/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::memcache_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/monitoring/CMakeLists.txt b/google/cloud/monitoring/CMakeLists.txt -index e021974..346a1a6 100644 ---- a/google/cloud/monitoring/CMakeLists.txt -+++ b/google/cloud/monitoring/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::monitoring_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/networkconnectivity/CMakeLists.txt b/google/cloud/networkconnectivity/CMakeLists.txt -index 4ca5e45..ffe44d2 100644 ---- a/google/cloud/networkconnectivity/CMakeLists.txt -+++ b/google/cloud/networkconnectivity/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::networkconnectivity_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/networkmanagement/CMakeLists.txt b/google/cloud/networkmanagement/CMakeLists.txt -index 3fe12a5..d94db72 100644 ---- a/google/cloud/networkmanagement/CMakeLists.txt -+++ b/google/cloud/networkmanagement/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::networkmanagement_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/notebooks/CMakeLists.txt b/google/cloud/notebooks/CMakeLists.txt -index 4cc76ea..2508e4b 100644 ---- a/google/cloud/notebooks/CMakeLists.txt -+++ b/google/cloud/notebooks/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::notebooks_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/optimization/CMakeLists.txt b/google/cloud/optimization/CMakeLists.txt -index 474c28a..e37eb3f 100644 ---- a/google/cloud/optimization/CMakeLists.txt -+++ b/google/cloud/optimization/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::optimization_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/orgpolicy/CMakeLists.txt b/google/cloud/orgpolicy/CMakeLists.txt -index b6935e6..8fe4286 100644 ---- a/google/cloud/orgpolicy/CMakeLists.txt -+++ b/google/cloud/orgpolicy/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::orgpolicy_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/osconfig/CMakeLists.txt b/google/cloud/osconfig/CMakeLists.txt -index 7b5dfe5..19f88a1 100644 ---- a/google/cloud/osconfig/CMakeLists.txt -+++ b/google/cloud/osconfig/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::osconfig_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/oslogin/CMakeLists.txt b/google/cloud/oslogin/CMakeLists.txt -index 1092f6f..87410cf 100644 ---- a/google/cloud/oslogin/CMakeLists.txt -+++ b/google/cloud/oslogin/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::oslogin_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/policytroubleshooter/CMakeLists.txt b/google/cloud/policytroubleshooter/CMakeLists.txt -index aa934d5..9f0bb42 100644 ---- a/google/cloud/policytroubleshooter/CMakeLists.txt -+++ b/google/cloud/policytroubleshooter/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::policytroubleshooter_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/privateca/CMakeLists.txt b/google/cloud/privateca/CMakeLists.txt -index 5ba62ac..b47750d 100644 ---- a/google/cloud/privateca/CMakeLists.txt -+++ b/google/cloud/privateca/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::privateca_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/profiler/CMakeLists.txt b/google/cloud/profiler/CMakeLists.txt -index b1388dc..d2fe3b2 100644 ---- a/google/cloud/profiler/CMakeLists.txt -+++ b/google/cloud/profiler/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::profiler_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/pubsublite/CMakeLists.txt b/google/cloud/pubsublite/CMakeLists.txt -index 12b2b33..2ec80d0 100644 ---- a/google/cloud/pubsublite/CMakeLists.txt -+++ b/google/cloud/pubsublite/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::pubsublite_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/recommender/CMakeLists.txt b/google/cloud/recommender/CMakeLists.txt -index b44cd96..26fdfb5 100644 ---- a/google/cloud/recommender/CMakeLists.txt -+++ b/google/cloud/recommender/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::recommender_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/redis/CMakeLists.txt b/google/cloud/redis/CMakeLists.txt -index 9387bbd..c3bbd0e 100644 ---- a/google/cloud/redis/CMakeLists.txt -+++ b/google/cloud/redis/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::redis_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/resourcemanager/CMakeLists.txt b/google/cloud/resourcemanager/CMakeLists.txt -index d445a8f..2689c33 100644 ---- a/google/cloud/resourcemanager/CMakeLists.txt -+++ b/google/cloud/resourcemanager/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::resourcemanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/resourcesettings/CMakeLists.txt b/google/cloud/resourcesettings/CMakeLists.txt -index afac58e..c0b4359 100644 ---- a/google/cloud/resourcesettings/CMakeLists.txt -+++ b/google/cloud/resourcesettings/CMakeLists.txt -@@ -32,8 +32,6 @@ find_package(absl CONFIG REQUIRED) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/retail/CMakeLists.txt b/google/cloud/retail/CMakeLists.txt -index cbda24a..da3b066 100644 ---- a/google/cloud/retail/CMakeLists.txt -+++ b/google/cloud/retail/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::retail_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/run/CMakeLists.txt b/google/cloud/run/CMakeLists.txt -index f771798..7906713 100644 ---- a/google/cloud/run/CMakeLists.txt -+++ b/google/cloud/run/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::run_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/scheduler/CMakeLists.txt b/google/cloud/scheduler/CMakeLists.txt -index d4e2310..eeaae20 100644 ---- a/google/cloud/scheduler/CMakeLists.txt -+++ b/google/cloud/scheduler/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::scheduler_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/secretmanager/CMakeLists.txt b/google/cloud/secretmanager/CMakeLists.txt -index f33f9bf..949f929 100644 ---- a/google/cloud/secretmanager/CMakeLists.txt -+++ b/google/cloud/secretmanager/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::secretmanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/securitycenter/CMakeLists.txt b/google/cloud/securitycenter/CMakeLists.txt -index e482223..bad25ac 100644 ---- a/google/cloud/securitycenter/CMakeLists.txt -+++ b/google/cloud/securitycenter/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::securitycenter_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/servicecontrol/CMakeLists.txt b/google/cloud/servicecontrol/CMakeLists.txt -index b2f6362..c1c55f3 100644 ---- a/google/cloud/servicecontrol/CMakeLists.txt -+++ b/google/cloud/servicecontrol/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicecontrol_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/servicedirectory/CMakeLists.txt b/google/cloud/servicedirectory/CMakeLists.txt -index a66c216..527201a 100644 ---- a/google/cloud/servicedirectory/CMakeLists.txt -+++ b/google/cloud/servicedirectory/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicedirectory_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/servicemanagement/CMakeLists.txt b/google/cloud/servicemanagement/CMakeLists.txt -index 96b1a0b..c9981ae 100644 ---- a/google/cloud/servicemanagement/CMakeLists.txt -+++ b/google/cloud/servicemanagement/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicemanagement_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/serviceusage/CMakeLists.txt b/google/cloud/serviceusage/CMakeLists.txt -index f9b199a..fddb936 100644 ---- a/google/cloud/serviceusage/CMakeLists.txt -+++ b/google/cloud/serviceusage/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::serviceusage_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/shell/CMakeLists.txt b/google/cloud/shell/CMakeLists.txt -index 178b8bc..a7181f6 100644 ---- a/google/cloud/shell/CMakeLists.txt -+++ b/google/cloud/shell/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::shell_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt -index 4cc2e0a..3f52437 100644 ---- a/google/cloud/speech/CMakeLists.txt -+++ b/google/cloud/speech/CMakeLists.txt -@@ -39,8 +39,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::speech_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/storagetransfer/CMakeLists.txt b/google/cloud/storagetransfer/CMakeLists.txt -index fd8a5ae..163e9b4 100644 ---- a/google/cloud/storagetransfer/CMakeLists.txt -+++ b/google/cloud/storagetransfer/CMakeLists.txt -@@ -38,8 +38,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::storagetransfer_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/talent/CMakeLists.txt b/google/cloud/talent/CMakeLists.txt -index 574023e..405dc48 100644 ---- a/google/cloud/talent/CMakeLists.txt -+++ b/google/cloud/talent/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::talent_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/tasks/CMakeLists.txt b/google/cloud/tasks/CMakeLists.txt -index 3b5678e..026f9b1 100644 ---- a/google/cloud/tasks/CMakeLists.txt -+++ b/google/cloud/tasks/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::tasks_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/texttospeech/CMakeLists.txt b/google/cloud/texttospeech/CMakeLists.txt -index 0fdc54a..840e8d4 100644 ---- a/google/cloud/texttospeech/CMakeLists.txt -+++ b/google/cloud/texttospeech/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::texttospeech_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/tpu/CMakeLists.txt b/google/cloud/tpu/CMakeLists.txt -index 2666b6b..cdaf519 100644 ---- a/google/cloud/tpu/CMakeLists.txt -+++ b/google/cloud/tpu/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::tpu_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/trace/CMakeLists.txt b/google/cloud/trace/CMakeLists.txt -index 99a04f5..80d4c1b 100644 ---- a/google/cloud/trace/CMakeLists.txt -+++ b/google/cloud/trace/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::trace_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/translate/CMakeLists.txt b/google/cloud/translate/CMakeLists.txt -index f8a0394..6a44718 100644 ---- a/google/cloud/translate/CMakeLists.txt -+++ b/google/cloud/translate/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::translate_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/video/CMakeLists.txt b/google/cloud/video/CMakeLists.txt -index b1b2628..df98ae4 100644 ---- a/google/cloud/video/CMakeLists.txt -+++ b/google/cloud/video/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::video_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/videointelligence/CMakeLists.txt b/google/cloud/videointelligence/CMakeLists.txt -index 1963d27..4638ddc 100644 ---- a/google/cloud/videointelligence/CMakeLists.txt -+++ b/google/cloud/videointelligence/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::videointelligence_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vision/CMakeLists.txt b/google/cloud/vision/CMakeLists.txt -index b23e737..004b803 100644 ---- a/google/cloud/vision/CMakeLists.txt -+++ b/google/cloud/vision/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vision_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vmmigration/CMakeLists.txt b/google/cloud/vmmigration/CMakeLists.txt -index aa88701..e799a3b 100644 ---- a/google/cloud/vmmigration/CMakeLists.txt -+++ b/google/cloud/vmmigration/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vmmigration_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vmwareengine/CMakeLists.txt b/google/cloud/vmwareengine/CMakeLists.txt -index 55adb2f..79c0f53 100644 ---- a/google/cloud/vmwareengine/CMakeLists.txt -+++ b/google/cloud/vmwareengine/CMakeLists.txt -@@ -38,8 +38,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vmwareengine_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vpcaccess/CMakeLists.txt b/google/cloud/vpcaccess/CMakeLists.txt -index 5ce47b7..dc7454e 100644 ---- a/google/cloud/vpcaccess/CMakeLists.txt -+++ b/google/cloud/vpcaccess/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vpcaccess_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/webrisk/CMakeLists.txt b/google/cloud/webrisk/CMakeLists.txt -index 5be0ce7..5d3123f 100644 ---- a/google/cloud/webrisk/CMakeLists.txt -+++ b/google/cloud/webrisk/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::webrisk_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/websecurityscanner/CMakeLists.txt b/google/cloud/websecurityscanner/CMakeLists.txt -index e21608e..c95230e 100644 ---- a/google/cloud/websecurityscanner/CMakeLists.txt -+++ b/google/cloud/websecurityscanner/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::websecurityscanner_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/workflows/CMakeLists.txt b/google/cloud/workflows/CMakeLists.txt -index 76c239a..aef6492 100644 ---- a/google/cloud/workflows/CMakeLists.txt -+++ b/google/cloud/workflows/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::workflows_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch index 6800c78c11f3e..4099fd00cae2f 100644 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch @@ -1,5 +1,5 @@ diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake -index 4eb5ea3..9de47cd 100644 +index 366edba..74c27bf 100644 --- a/cmake/CompileProtos.cmake +++ b/cmake/CompileProtos.cmake @@ -315,6 +315,10 @@ include(GNUInstallDirs) @@ -25,10 +25,10 @@ index 4eb5ea3..9de47cd 100644 foreach (header ${target_protos}) # Skip anything that is not a header file. diff --git a/google/cloud/dialogflow_es/CMakeLists.txt b/google/cloud/dialogflow_es/CMakeLists.txt -index fad8716..cc44723 100644 +index 0ddf345..2a00f2d 100644 --- a/google/cloud/dialogflow_es/CMakeLists.txt +++ b/google/cloud/dialogflow_es/CMakeLists.txt -@@ -35,7 +35,12 @@ endif () +@@ -37,7 +37,12 @@ endif () include(CompileProtos) add_library(google_cloud_cpp_dialogflow_es_protos INTERFACE) diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch index 875dd10498af2..f021f480b2dd1 100644 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch @@ -39,10 +39,10 @@ index 0cb7a9a..d9016a0 100644 target_link_libraries(gcs2cbt google-cloud-cpp::bigtable google-cloud-cpp::storage google-cloud-cpp::grpc_utils) diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt -index 28bf016..c281ce8 100644 +index ad2bd4b..cd1eb3a 100644 --- a/external/googleapis/CMakeLists.txt +++ b/external/googleapis/CMakeLists.txt -@@ -103,8 +103,6 @@ if (PROTO_INCLUDE_DIR) +@@ -147,8 +147,6 @@ if (PROTO_INCLUDE_DIR) list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") endif () diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/004-remove-duplicate-protos.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/004-remove-duplicate-protos.patch new file mode 100644 index 0000000000000..3bae252294281 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/004-remove-duplicate-protos.patch @@ -0,0 +1,108 @@ +diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt +index 4cc2e0a..59546c7 100644 +--- a/google/cloud/speech/CMakeLists.txt ++++ b/google/cloud/speech/CMakeLists.txt +@@ -46,19 +46,18 @@ if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") + endif () + +-include(CompileProtos) +-google_cloud_cpp_load_protolist( +- proto_list +- "${PROJECT_SOURCE_DIR}/external/googleapis/protolists/speech.list") +-google_cloud_cpp_load_protodeps( +- proto_deps +- "${PROJECT_SOURCE_DIR}/external/googleapis/protodeps/speech.deps") +-google_cloud_cpp_grpcpp_library( +- google_cloud_cpp_speech_protos # cmake-format: sort +- ${proto_list} PROTO_PATH_DIRECTORIES "${EXTERNAL_GOOGLEAPIS_SOURCE}" +- "${PROTO_INCLUDE_DIR}") +-external_googleapis_set_version_and_alias(speech_protos) +-target_link_libraries(google_cloud_cpp_speech_protos PUBLIC ${proto_deps}) ++add_library(google_cloud_cpp_speech_protos INTERFACE) ++target_link_libraries(google_cloud_cpp_speech_protos ++ INTERFACE google-cloud-cpp::cloud_speech_protos) ++set_target_properties( ++ google_cloud_cpp_speech_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::speech_protos ++ VERSION "${PROJECT_VERSION}" ++ SOVERSION "${PROJECT_VERSION_MAJOR}") ++target_compile_options(google_cloud_cpp_speech_protos ++ INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) ++add_library(google-cloud-cpp::speech_protos ALIAS ++ google_cloud_cpp_speech_protos) + + file( + GLOB source_files +diff --git a/google/cloud/texttospeech/CMakeLists.txt b/google/cloud/texttospeech/CMakeLists.txt +index 0fdc54a..c43aa51 100644 +--- a/google/cloud/texttospeech/CMakeLists.txt ++++ b/google/cloud/texttospeech/CMakeLists.txt +@@ -36,19 +36,18 @@ if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") + endif () + +-include(CompileProtos) +-google_cloud_cpp_load_protolist( +- proto_list +- "${PROJECT_SOURCE_DIR}/external/googleapis/protolists/texttospeech.list") +-google_cloud_cpp_load_protodeps( +- proto_deps +- "${PROJECT_SOURCE_DIR}/external/googleapis/protodeps/texttospeech.deps") +-google_cloud_cpp_grpcpp_library( +- google_cloud_cpp_texttospeech_protos # cmake-format: sort +- ${proto_list} PROTO_PATH_DIRECTORIES "${EXTERNAL_GOOGLEAPIS_SOURCE}" +- "${PROTO_INCLUDE_DIR}") +-external_googleapis_set_version_and_alias(texttospeech_protos) +-target_link_libraries(google_cloud_cpp_texttospeech_protos PUBLIC ${proto_deps}) ++add_library(google_cloud_cpp_texttospeech_protos INTERFACE) ++target_link_libraries(google_cloud_cpp_texttospeech_protos ++ INTERFACE google-cloud-cpp::cloud_texttospeech_protos) ++set_target_properties( ++ google_cloud_cpp_texttospeech_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::texttospeech_protos ++ VERSION "${PROJECT_VERSION}" ++ SOVERSION "${PROJECT_VERSION_MAJOR}") ++target_compile_options(google_cloud_cpp_texttospeech_protos ++ INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) ++add_library(google-cloud-cpp::texttospeech_protos ALIAS ++ google_cloud_cpp_texttospeech_protos) + + file( + GLOB source_files +diff --git a/google/cloud/trace/CMakeLists.txt b/google/cloud/trace/CMakeLists.txt +index 99a04f5..0afc230 100644 +--- a/google/cloud/trace/CMakeLists.txt ++++ b/google/cloud/trace/CMakeLists.txt +@@ -35,18 +35,19 @@ if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") + endif () + +-include(CompileProtos) +-google_cloud_cpp_load_protolist( +- proto_list +- "${PROJECT_SOURCE_DIR}/external/googleapis/protolists/trace.list") +-google_cloud_cpp_load_protodeps( +- proto_deps "${PROJECT_SOURCE_DIR}/external/googleapis/protodeps/trace.deps") +-google_cloud_cpp_grpcpp_library( +- google_cloud_cpp_trace_protos # cmake-format: sort +- ${proto_list} PROTO_PATH_DIRECTORIES "${EXTERNAL_GOOGLEAPIS_SOURCE}" +- "${PROTO_INCLUDE_DIR}") +-external_googleapis_set_version_and_alias(trace_protos) +-target_link_libraries(google_cloud_cpp_trace_protos PUBLIC ${proto_deps}) ++add_library(google_cloud_cpp_trace_protos INTERFACE) ++target_link_libraries( ++ google_cloud_cpp_trace_protos ++ INTERFACE google-cloud-cpp::devtools_cloudtrace_v2_trace_protos ++ google-cloud-cpp::devtools_cloudtrace_v2_tracing_protos) ++set_target_properties( ++ google_cloud_cpp_trace_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::trace_protos ++ VERSION "${PROJECT_VERSION}" ++ SOVERSION "${PROJECT_VERSION_MAJOR}") ++target_compile_options(google_cloud_cpp_trace_protos ++ INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) ++add_library(google-cloud-cpp::trace_protos ALIAS google_cloud_cpp_trace_protos) + + file( + GLOB source_files diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/005-interface-library-properties.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/005-interface-library-properties.patch new file mode 100644 index 0000000000000..4ecbc354da0bd --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/005-interface-library-properties.patch @@ -0,0 +1,51 @@ +diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt +index 59546c7..51bc0b6 100644 +--- a/google/cloud/speech/CMakeLists.txt ++++ b/google/cloud/speech/CMakeLists.txt +@@ -49,11 +49,8 @@ endif () + add_library(google_cloud_cpp_speech_protos INTERFACE) + target_link_libraries(google_cloud_cpp_speech_protos + INTERFACE google-cloud-cpp::cloud_speech_protos) +-set_target_properties( +- google_cloud_cpp_speech_protos +- PROPERTIES EXPORT_NAME google-cloud-cpp::speech_protos +- VERSION "${PROJECT_VERSION}" +- SOVERSION "${PROJECT_VERSION_MAJOR}") ++set_target_properties(google_cloud_cpp_speech_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::speech_protos) + target_compile_options(google_cloud_cpp_speech_protos + INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) + add_library(google-cloud-cpp::speech_protos ALIAS +diff --git a/google/cloud/texttospeech/CMakeLists.txt b/google/cloud/texttospeech/CMakeLists.txt +index c43aa51..3041dac 100644 +--- a/google/cloud/texttospeech/CMakeLists.txt ++++ b/google/cloud/texttospeech/CMakeLists.txt +@@ -41,9 +41,7 @@ target_link_libraries(google_cloud_cpp_texttospeech_protos + INTERFACE google-cloud-cpp::cloud_texttospeech_protos) + set_target_properties( + google_cloud_cpp_texttospeech_protos +- PROPERTIES EXPORT_NAME google-cloud-cpp::texttospeech_protos +- VERSION "${PROJECT_VERSION}" +- SOVERSION "${PROJECT_VERSION_MAJOR}") ++ PROPERTIES EXPORT_NAME google-cloud-cpp::texttospeech_protos) + target_compile_options(google_cloud_cpp_texttospeech_protos + INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) + add_library(google-cloud-cpp::texttospeech_protos ALIAS +diff --git a/google/cloud/trace/CMakeLists.txt b/google/cloud/trace/CMakeLists.txt +index 0afc230..828603d 100644 +--- a/google/cloud/trace/CMakeLists.txt ++++ b/google/cloud/trace/CMakeLists.txt +@@ -40,11 +40,8 @@ target_link_libraries( + google_cloud_cpp_trace_protos + INTERFACE google-cloud-cpp::devtools_cloudtrace_v2_trace_protos + google-cloud-cpp::devtools_cloudtrace_v2_tracing_protos) +-set_target_properties( +- google_cloud_cpp_trace_protos +- PROPERTIES EXPORT_NAME google-cloud-cpp::trace_protos +- VERSION "${PROJECT_VERSION}" +- SOVERSION "${PROJECT_VERSION_MAJOR}") ++set_target_properties(google_cloud_cpp_trace_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::trace_protos) + target_compile_options(google_cloud_cpp_trace_protos + INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) + add_library(google-cloud-cpp::trace_protos ALIAS google_cloud_cpp_trace_protos) 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 0000000000000..ef18553443bda --- /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 90eb7ac7b97bc..ad2df7e79e43a 100644 --- a/recipes/google-cloud-cpp/config.yml +++ b/recipes/google-cloud-cpp/config.yml @@ -11,3 +11,7 @@ versions: folder: "all" "2.5.0": 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 c1eae06780f75..7d10eb1883d33 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 58019cb35dee5..bb39603872037 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 new file mode 100644 index 0000000000000..16ebb90c2322f --- /dev/null +++ b/recipes/gperftools/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.15": + url: "https://github.com/gperftools/gperftools/releases/download/gperftools-2.15/gperftools-2.15.tar.gz" + sha256: "c69fef855628c81ef56f12e3c58f2b7ce1f326c0a1fe783e5cae0b88cbbe9a80" + "2.14.0": + url: "https://github.com/gperftools/gperftools/releases/download/gperftools-2.14/gperftools-2.14.tar.gz" + sha256: "6b561baf304b53d0a25311bd2e29bc993bed76b7c562380949e7cb5e3846b299" + "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 new file mode 100644 index 0000000000000..d1bcecf43d394 --- /dev/null +++ b/recipes/gperftools/all/conanfile.py @@ -0,0 +1,236 @@ +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, 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()" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gperftools/gperftools" + topics = ("memory", "allocator", "tcmalloc", "google-perftools") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_cpu_profiler": [True, False], + "build_heap_profiler": [True, False], + "build_heap_checker": [True, False], + "build_debugalloc": [True, False], + "dynamic_sized_delete_support": [True, False], + "emergency_malloc": [None, True, False], + "enable_aggressive_decommit_by_default": [True, False], + "enable_frame_pointers": [True, False], + "enable_large_alloc_report": [True, False], + "enable_libunwind": [True, False], + "enable_stacktrace_via_backtrace": [None, True, False], + "sized_delete": [True, False], + "tcmalloc_alignment": [None, "ANY"], + "tcmalloc_pagesize": [None, "ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "build_cpu_profiler": False, + "build_heap_profiler": False, + "build_heap_checker": False, + "build_debugalloc": False, + "dynamic_sized_delete_support": False, + "emergency_malloc": None, + "enable_aggressive_decommit_by_default": False, + "enable_frame_pointers": False, + "enable_large_alloc_report": False, + "enable_libunwind": True, + "enable_stacktrace_via_backtrace": False, + "sized_delete": False, + "tcmalloc_alignment": None, + "tcmalloc_pagesize": None, + } + + @property + def _min_cppstd(self): + return 11 + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + @property + def _build_minimal(self): + # Corresponds to the gperftools build_minimal option + return not ( + self.options.build_cpu_profiler + or self.options.build_heap_profiler + or self.options.build_heap_checker + ) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self._build_minimal: + # Minimal build does not include stack trace support, so these options are irrelevant + self.options.rm_safe("enable_libunwind") + self.options.rm_safe("enable_frame_pointers") + self.options.rm_safe("enable_stacktrace_via_backtrace") + self.options.rm_safe("emergency_malloc") + elif self.options.enable_libunwind: + # enable_stacktrace_via_backtrace has no effect if libunwind is enabled + self.options.rm_safe("enable_stacktrace_via_backtrace") + + 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( + f"{self.ref} does not currently support Windows. Contributions are welcome." + ) + + def requirements(self): + if self.options.get_safe("enable_libunwind", False): + self.requires("libunwind/1.6.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + args = {} + args["prefix"] = "" + args["enable-cpu-profiler"] = self.options.build_cpu_profiler + args["enable-heap-profiler"] = self.options.build_heap_profiler + args["enable-heap-checker"] = self.options.build_heap_checker + args["enable-debugalloc"] = self.options.build_debugalloc + args["enable-minimal"] = self._build_minimal + args["enable-dynamic-sized-delete-support"] = self.options.dynamic_sized_delete_support + args["enable-sized-delete"] = self.options.sized_delete + args["enable-large-alloc-report"] = self.options.enable_large_alloc_report + args["enable-aggressive-decommit-by-default"] = self.options.enable_aggressive_decommit_by_default + if self._build_minimal: + # No stack trace support will be built + args["enable-libunwind"] = False + args["enable-frame-pointers"] = False + args["enable-stacktrace-via-backtrace"] = False + args["enable-emergency-malloc"] = False + else: + args["enable-libunwind"] = self.options.enable_libunwind + args["enable-frame-pointers"] = self.options.enable_frame_pointers + args["enable-stacktrace-via-backtrace"] = self.options.get_safe( + "enable_stacktrace_via_backtrace", False + ) + args["enable-emergency-malloc"] = self.options.emergency_malloc + args["with-tcmalloc-alignment"] = self.options.tcmalloc_alignment + args["with-tcmalloc-pagesize"] = self.options.tcmalloc_pagesize + + # Based on https://github.com/conan-io/conan-center-index/blob/c647b1/recipes/libx264/all/conanfile.py#L94 + if is_apple_os(self) and self.settings.arch == "armv8": + args["host"] = "aarch64-apple-darwin" + tc.extra_asflags = ["-arch arm64"] + tc.extra_ldflags = ["-arch arm64"] + if self.settings.os != "Macos": + xcrun = XCRun(self) + platform_flags = ["-isysroot", xcrun.sdk_path] + apple_min_version_flag = AutotoolsToolchain(self).apple_min_version_flag + if apple_min_version_flag: + platform_flags.append(apple_min_version_flag) + tc.extra_asflags.extend(platform_flags) + tc.extra_cflags.extend(platform_flags) + tc.extra_ldflags.extend(platform_flags) + + for k, v in args.items(): + if v in [True, False]: + v = "yes" if v else "no" + if v is not None: + tc.configure_args.append(f"--{k}={v}") + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def _patch_sources(self): + # Disable building of tests and benchmarks in Makefile + for pattern in ["noinst_PROGRAMS = ", "TESTS = "]: + replace_in_file( + self, + os.path.join(self.source_folder, "Makefile.in"), + pattern, + f"{pattern}\n_{pattern}", + ) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy( + self, + pattern="COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=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", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def _add_component(self, lib): + self.cpp_info.components[lib].libs = [lib] + + def package_info(self): + self._add_component("tcmalloc_minimal") + if self.options.build_debugalloc: + self._add_component("tcmalloc_minimal_debug") + if self.options.build_heap_profiler or self.options.build_heap_checker: + self._add_component("tcmalloc") + if self.options.build_debugalloc: + self._add_component("tcmalloc_debug") + if self.options.build_cpu_profiler: + self._add_component("profiler") + if "tcmalloc" in self.cpp_info.components: + self._add_component("tcmalloc_and_profiler") + + for component in self.cpp_info.components.values(): + if self.settings.os in ["Linux", "FreeBSD"]: + component.system_libs.extend(["pthread", "m"]) + if self.options.get_safe("enable_libunwind"): + component.requires.append("libunwind::libunwind") + + # Select the preferred library to link against by default + main_component = self.cpp_info.components["gperftools"] + for lib in [ + "tcmalloc_and_profiler", + "tcmalloc", + "tcmalloc_debug", + "tcmalloc_minimal_debug", + "tcmalloc_minimal", + ]: + if lib in self.cpp_info.components: + main_component.requires = [lib] + if lib != "tcmalloc_and_profiler" and "profiler" in self.cpp_info.components: + main_component.requires.append("profiler") + break diff --git a/recipes/gperftools/all/test_package/CMakeLists.txt b/recipes/gperftools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0f311015a73f5 --- /dev/null +++ b/recipes/gperftools/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +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/all/test_package/conanfile.py b/recipes/gperftools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f5cf204295e19 --- /dev/null +++ b/recipes/gperftools/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/gperftools/all/test_package/test_package.cpp b/recipes/gperftools/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ee9b96dfbc3cd --- /dev/null +++ b/recipes/gperftools/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include +#include +#include + +int main() { + void *p = tc_malloc(100); + tc_free(p); + std::cout << TC_VERSION_STRING << std::endl; + return p == 0 ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/recipes/gperftools/config.yml b/recipes/gperftools/config.yml new file mode 100644 index 0000000000000..09354ab2fb826 --- /dev/null +++ b/recipes/gperftools/config.yml @@ -0,0 +1,13 @@ +versions: + "2.15": + folder: all + "2.14.0": + folder: all + "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 39254a6f16cdf..8f5581630fd90 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/graphthewy/all/conanfile.py b/recipes/graphthewy/all/conanfile.py index 87bfe2e73e236..a57627cf2f7dd 100644 --- a/recipes/graphthewy/all/conanfile.py +++ b/recipes/graphthewy/all/conanfile.py @@ -1,55 +1,63 @@ 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 GraphthewyConan(ConanFile): name = "graphthewy" + description = "Simple header-only C++ Library for graph modelling (directed or not) and graph cycle detection. " license = "EUPL-1.2" - homepage = "https://github.com/alex-87/graphthewy" url = "https://github.com/conan-io/conan-center-index" - description = "Simple header-only C++ Library for graph modelling (directed or not) and graph cycle detection. " + homepage = "https://github.com/alex-87/graphthewy" topics = ("graph", "algorithm", "modelling", "header-only") - settings = "compiler" + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + @property + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): return { "Visual Studio": "15.7", + "msvc": "191", "gcc": "7", "clang": "7", "apple-clang": "10" - } - - @property - def _source_subfolder(self): - return "source_subfolder" + } - def configure(self): - if self.settings.compiler.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 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("graphthewy requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("graphthewy requires C++17, which your compiler does not support.") + 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): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.hpp", dst=os.path.join("include", "graphthewy"), 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", "graphthewy"), 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/graphthewy/all/test_package/CMakeLists.txt b/recipes/graphthewy/all/test_package/CMakeLists.txt index 4f4089cf5e4ec..3883365747974 100644 --- a/recipes/graphthewy/all/test_package/CMakeLists.txt +++ b/recipes/graphthewy/all/test_package/CMakeLists.txt @@ -1,10 +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(graphthewy REQUIRED CONFIG) add_executable(test_package test_package.cpp) -target_link_libraries(test_package ${CONAN_LIBS}) - +target_link_libraries(test_package PRIVATE graphthewy::graphthewy) set_property(TARGET test_package PROPERTY CXX_STANDARD 17) diff --git a/recipes/graphthewy/all/test_package/conanfile.py b/recipes/graphthewy/all/test_package/conanfile.py index 1d8d5788c2d75..fae501d0afb9e 100644 --- a/recipes/graphthewy/all/test_package/conanfile.py +++ b/recipes/graphthewy/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 GraphthewyTestConan(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", "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/graphthewy/all/test_package/test_package.cpp b/recipes/graphthewy/all/test_package/test_package.cpp index 10db9f97c57c1..c60ac86359e1d 100644 --- a/recipes/graphthewy/all/test_package/test_package.cpp +++ b/recipes/graphthewy/all/test_package/test_package.cpp @@ -1,7 +1,7 @@ #include #include -int main(int argc, char** arvg) +int main() { graphthewy::UndirectedGraph(g); g.addVertex(1); @@ -11,7 +11,7 @@ int main(int argc, char** arvg) g.link(2, 3); g.link(3, 1); - graphthewy::GraphCyclegc(g); + graphthewy::GraphCycle gc(g); return (gc.hasCycle() == true ? 0 : -1); } diff --git a/recipes/graphthewy/all/test_v1_package/CMakeLists.txt b/recipes/graphthewy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/graphthewy/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/graphthewy/all/test_v1_package/conanfile.py b/recipes/graphthewy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3c2537c3ee226 --- /dev/null +++ b/recipes/graphthewy/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class GraphthewyTestConan(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/greatest/all/conanfile.py b/recipes/greatest/all/conanfile.py index cda1c077e6c1d..24675294fec7f 100644 --- a/recipes/greatest/all/conanfile.py +++ b/recipes/greatest/all/conanfile.py @@ -1,4 +1,10 @@ -from conans import ConanFile, tools +import os + +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 GreatestConan(ConanFile): @@ -8,19 +14,24 @@ class GreatestConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/silentbicycle/greatest" topics = ("testing", "testing-framework", "unit-testing", "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 package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("greatest.h", dst="include", src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "greatest.h", dst=os.path.join(self.package_folder, "include"), 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/greatest/all/test_package/CMakeLists.txt b/recipes/greatest/all/test_package/CMakeLists.txt index a5ffd526aaea7..7ddc15d912feb 100644 --- a/recipes/greatest/all/test_package/CMakeLists.txt +++ b/recipes/greatest/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(greatest REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.c) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${CMAKE_PROJECT_NAME} greatest::greatest) diff --git a/recipes/greatest/all/test_package/conanfile.py b/recipes/greatest/all/test_package/conanfile.py index d4128b0450777..fae501d0afb9e 100644 --- a/recipes/greatest/all/test_package/conanfile.py +++ b/recipes/greatest/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" + 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/grpc-proto/all/conanfile.py b/recipes/grpc-proto/all/conanfile.py index 5ab0a942ba98e..e0de5ab7f7c55 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/conan_cmake_project_include.cmake b/recipes/grpc/all/conan_cmake_project_include.cmake index 0036126a38780..0d23c71e319ad 100644 --- a/recipes/grpc/all/conan_cmake_project_include.cmake +++ b/recipes/grpc/all/conan_cmake_project_include.cmake @@ -1,17 +1,3 @@ -find_package(grpc-proto CONFIG REQUIRED) -find_package(googleapis CONFIG REQUIRED) - -set(googleapis_RES_DIRS - $<$:${googleapis_RES_DIRS_RELEASE}> - $<$:${googleapis_RES_DIRS_RELWITHDEBINFO}> - $<$:${googleapis_RES_DIRS_MINSIZEREL}> - $<$:${googleapis_RES_DIRS_DEBUG}>) -set(grpc-proto_RES_DIRS - $<$:${grpc-proto_RES_DIRS_RELEASE}> - $<$:${grpc-proto_RES_DIRS_RELWITHDEBINFO}> - $<$:${grpc-proto_RES_DIRS_MINSIZEREL}> - $<$:${grpc-proto_RES_DIRS_DEBUG}>) - # TODO: move to a patch? It avoids link errors while resolving abseil symbols with gcc if (TARGET check_epollexclusive) set_target_properties(check_epollexclusive PROPERTIES LINKER_LANGUAGE CXX) diff --git a/recipes/grpc/all/conandata.yml b/recipes/grpc/all/conandata.yml index 80e0a549aa77c..02c1ca609ebd2 100644 --- a/recipes/grpc/all/conandata.yml +++ b/recipes/grpc/all/conandata.yml @@ -1,29 +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" - - patch_file: "patches/v1.50.x/002-consume-protos-from-requirements.patch" "1.50.0": - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" - - patch_file: "patches/v1.50.x/002-consume-protos-from-requirements.patch" - "1.48.0": + "1.48.4": - patch_file: "patches/v1.48.x/001-disable-cppstd-override.patch" - - patch_file: "patches/v1.48.x/002-consume-protos-from-requirements.patch" - "1.47.1": - - patch_file: "patches/v1.47.x/001-disable-cppstd-override.patch" - - patch_file: "patches/v1.47.x/002-consume-protos-from-requirements.patch" - "1.46.3": - - patch_file: "patches/v1.46.x/001-disable-cppstd-override.patch" - - patch_file: "patches/v1.46.x/002-consume-protos-from-requirements.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 bdae7abad302a..998e680f1000a 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 @@ -77,8 +76,6 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") self.options["protobuf"].shared = True - self.options["googleapis"].shared = True - self.options["grpc-proto"].shared = True if cross_building(self): self.options["grpc"].shared = True @@ -88,17 +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("googleapis/cci.20230501") - self.requires("grpc-proto/cci.20220627") + 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 @@ -115,15 +113,15 @@ def validate(self): check_min_cppstd(self, self._cxxstd_required) if self.options.shared and \ - (not self.dependencies["protobuf"].options.shared or not self.dependencies["googleapis"].options.shared or not self.dependencies["grpc-proto"].options.shared): + (not self.dependencies["protobuf"].options.shared): raise ConanInvalidConfiguration( - "If built as shared, protobuf, googleapis and grpc-proto must be shared as well. " - "Please, use `protobuf:shared=True` and `googleapis:shared=True` and `grpc-proto:shared=True`", + "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("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}") @@ -149,7 +147,7 @@ def generate(self): tc.cache_variables["gRPC_BUILD_CODEGEN"] = self.options.codegen tc.cache_variables["gRPC_BUILD_CSHARP_EXT"] = self.options.csharp_ext - tc.cache_variables["gRPC_BUILD_TESTS"] = False + tc.cache_variables["gRPC_BUILD_TESTS"] = "OFF" # We need the generated cmake/ files (bc they depend on the list of targets, which is dynamic) tc.cache_variables["gRPC_INSTALL"] = True @@ -190,16 +188,6 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - # Clean existing proto files, they will be taken from requirements - shutil.rmtree(os.path.join(self.source_folder, "src", "proto", "grpc")) - - if Version(self.version) >= "1.47": - # Take googleapis from requirement instead of vendored/hardcoded version - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googleapis)", - "if (FALSE) # Do not download, it is provided by Conan" - ) - # On macOS if all the following are true: # - protoc from protobuf has shared library dependencies # - grpc_cpp_plugin has shared library deps (when crossbuilding) @@ -323,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(), }, @@ -388,12 +377,12 @@ def corefoundation(): components.update({ "grpc++_reflection": { "lib": "grpc++_reflection", - "requires": ["grpc++", "protobuf::libprotobuf", "grpc-proto::grpc-proto", "googleapis::googleapis"], + "requires": ["grpc++", "protobuf::libprotobuf"], "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), }, "grpcpp_channelz": { "lib": "grpcpp_channelz", - "requires": ["grpc++", "protobuf::libprotobuf", "grpc-proto::grpc-proto", "googleapis::googleapis"], + "requires": ["grpc++", "protobuf::libprotobuf"], "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 a260124675947..0000000000000 --- 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.46.x/002-consume-protos-from-requirements.patch b/recipes/grpc/all/patches/v1.46.x/002-consume-protos-from-requirements.patch deleted file mode 100644 index ff27fa43b34ea..0000000000000 --- a/recipes/grpc/all/patches/v1.46.x/002-consume-protos-from-requirements.patch +++ /dev/null @@ -1,290 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2db10e5..612d2cf 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -329,7 +329,7 @@ function(protobuf_generate_grpc_cpp) - return() - endif() - -- set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) -+ set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR} -I ${googleapis_RES_DIRS} -I ${grpc-proto_RES_DIRS}) - foreach(FIL ${ARGN}) - get_filename_component(ABS_FIL ${FIL} ABSOLUTE) - get_filename_component(FIL_WE ${FIL} NAME_WE) -@@ -348,18 +348,15 @@ function(protobuf_generate_grpc_cpp) - OUTPUT "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc" - "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h" - "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" -- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" -- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" - COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} - ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} -- --cpp_out=${_gRPC_PROTO_GENS_DIR} - --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN} - ${_protobuf_include_path} -- ${REL_FIL} -- DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} ${_gRPC_CPP_PLUGIN} -+ ${FIL} -+ DEPENDS ${_gRPC_PROTOBUF_PROTOC} ${_gRPC_CPP_PLUGIN} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Running gRPC C++ protocol buffer compiler on ${FIL}" -- VERBATIM) -+ ) - endforeach() - endfunction() - -@@ -413,178 +410,28 @@ add_custom_target(tools - DEPENDS tools_c tools_cxx) - - protobuf_generate_grpc_cpp( -- src/proto/grpc/channelz/channelz.proto -+ grpc/channelz/v1/channelz.proto - ) - protobuf_generate_grpc_cpp( -- src/proto/grpc/core/stats.proto -+ grpc/core/stats.proto - ) - protobuf_generate_grpc_cpp( -- src/proto/grpc/health/v1/health.proto -+ grpc/health/v1/health.proto - ) - protobuf_generate_grpc_cpp( -- src/proto/grpc/lb/v1/load_balancer.proto -+ grpc/lb/v1/load_balancer.proto - ) - protobuf_generate_grpc_cpp( -- src/proto/grpc/lookup/v1/rls.proto -+ grpc/lookup/v1/rls.proto - ) - protobuf_generate_grpc_cpp( -- src/proto/grpc/lookup/v1/rls_config.proto -+ grpc/lookup/v1/rls_config.proto - ) - protobuf_generate_grpc_cpp( -- src/proto/grpc/reflection/v1alpha/reflection.proto -+ grpc/reflection/v1alpha/reflection.proto - ) - protobuf_generate_grpc_cpp( -- src/proto/grpc/status/status.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/benchmark_service.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/control.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/duplicate/echo_duplicate.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/echo.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/echo_messages.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/empty.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/messages.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/payloads.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/report_qps_scenario_service.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/simple_messages.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/stats.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/test.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/worker_service.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/ads_for_test.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/cds_for_test.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/eds_for_test.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/lds_rds_for_test.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/lrs_for_test.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/address.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/ads.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/aggregate_cluster.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/base.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/cluster.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/config_dump.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/config_source.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/csds.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/discovery.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/endpoint.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/expr.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/extension.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/fault.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/fault_common.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/http_connection_manager.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/http_filter_rbac.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/listener.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/load_report.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/lrs.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/metadata.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/orca_load_report.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/orca_service.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/path.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/percent.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/protocol.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/range.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/rbac.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/regex.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/route.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/router.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/string.proto --) --protobuf_generate_grpc_cpp( -- src/proto/grpc/testing/xds/v3/tls.proto -+ grpc/status/status.proto - ) - protobuf_generate_grpc_cpp( - test/core/tsi/alts/fake_handshaker/handshaker.proto -@@ -3275,10 +3122,8 @@ endif() - - if(gRPC_BUILD_CODEGEN) - add_library(grpc++_reflection -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.h -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h -+ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.cc -+ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.h - src/cpp/ext/proto_server_reflection.cc - src/cpp/ext/proto_server_reflection_plugin.cc - ) -@@ -3317,6 +3162,7 @@ target_link_libraries(grpc++_reflection - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ -+ grpc-proto::grpc-proto - ) - - foreach(_hdr -@@ -3872,10 +3718,8 @@ endif() - # See https://github.com/grpc/grpc/issues/19473 - if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) - add_library(grpcpp_channelz -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h -+ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.cc -+ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.h - src/cpp/server/channelz/channelz_service.cc - src/cpp/server/channelz/channelz_service_plugin.cc - ) -@@ -3914,6 +3758,7 @@ target_link_libraries(grpcpp_channelz - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ -+ grpc-proto::grpc-proto - ) - - foreach(_hdr -diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h -index 04f1e63..82837e8 100644 ---- a/src/cpp/ext/proto_server_reflection.h -+++ b/src/cpp/ext/proto_server_reflection.h -@@ -24,7 +24,7 @@ - - #include - --#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h" -+#include "grpc/reflection/v1alpha/reflection.grpc.pb.h" - - namespace grpc { - -diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h -index 824f0a9..bfa31a1 100644 ---- a/src/cpp/server/channelz/channelz_service.h -+++ b/src/cpp/server/channelz/channelz_service.h -@@ -23,7 +23,7 @@ - - #include - --#include "src/proto/grpc/channelz/channelz.grpc.pb.h" -+#include "grpc/channelz/v1/channelz.grpc.pb.h" - - namespace grpc { - 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 0ba329e6480bc..0000000000000 --- 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.47.x/002-consume-protos-from-requirements.patch b/recipes/grpc/all/patches/v1.47.x/002-consume-protos-from-requirements.patch deleted file mode 100644 index 9ead7f09de502..0000000000000 --- a/recipes/grpc/all/patches/v1.47.x/002-consume-protos-from-requirements.patch +++ /dev/null @@ -1,309 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c1eaeba..706e6d1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -445,7 +445,7 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM - endif() - - # Sets the include path for ProtoBuf files -- set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) -+ set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR} -I ${googleapis_RES_DIRS} -I ${grpc-proto_RES_DIRS}) - # The absolute path of the expected place for the input proto file - # For example, health proto has package name grpc.health.v1, it's expected to be: - # ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1/health.proto -@@ -470,8 +470,8 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM - # path. For example, health proto has package name grpc.health.v1, the bash - # equivalent would be: - # cp src/proto/grpc/health/v1/health.proto ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1 -- file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) -- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) -+ # file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) -+ # file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) - - #if cross-compiling, find host plugin - if(CMAKE_CROSSCOMPILING) -@@ -484,18 +484,15 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM - OUTPUT "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc" - "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h" - "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" -- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" -- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" - COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} - ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} -- --cpp_out=${_gRPC_PROTO_GENS_DIR} - --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN} - ${_protobuf_include_path} -- ${REL_FIL} -- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin -+ ${FILE_LOCATION} -+ DEPENDS ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin - WORKING_DIRECTORY ${_gRPC_PROTO_SRCS_DIR} -- COMMENT "Running gRPC C++ protocol buffer compiler for ${IMPORT_PATH}" -- VERBATIM) -+ COMMENT "Running gRPC C++ protocol buffer compiler for ${FILE_LOCATION}" -+ ) - endfunction() - - # These options allow users to enable or disable the building of the various -@@ -548,181 +545,28 @@ add_custom_target(tools - DEPENDS tools_c tools_cxx) - - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/channelz/channelz.proto src/proto/grpc/channelz/channelz.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/core/stats.proto src/proto/grpc/core/stats.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/health/v1/health.proto src/proto/grpc/health/v1/health.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/lb/v1/load_balancer.proto src/proto/grpc/lb/v1/load_balancer.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/lookup/v1/rls.proto src/proto/grpc/lookup/v1/rls.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/lookup/v1/rls_config.proto src/proto/grpc/lookup/v1/rls_config.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/reflection/v1alpha/reflection.proto src/proto/grpc/reflection/v1alpha/reflection.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/status/status.proto src/proto/grpc/status/status.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/benchmark_service.proto src/proto/grpc/testing/benchmark_service.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/control.proto src/proto/grpc/testing/control.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/duplicate/echo_duplicate.proto src/proto/grpc/testing/duplicate/echo_duplicate.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/echo.proto src/proto/grpc/testing/echo.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/echo_messages.proto src/proto/grpc/testing/echo_messages.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/empty.proto src/proto/grpc/testing/empty.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/messages.proto src/proto/grpc/testing/messages.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/payloads.proto src/proto/grpc/testing/payloads.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/report_qps_scenario_service.proto src/proto/grpc/testing/report_qps_scenario_service.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/simple_messages.proto src/proto/grpc/testing/simple_messages.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/stats.proto src/proto/grpc/testing/stats.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/test.proto src/proto/grpc/testing/test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/worker_service.proto src/proto/grpc/testing/worker_service.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/ads_for_test.proto src/proto/grpc/testing/xds/ads_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/cds_for_test.proto src/proto/grpc/testing/xds/cds_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/eds_for_test.proto src/proto/grpc/testing/xds/eds_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/lds_rds_for_test.proto src/proto/grpc/testing/xds/lds_rds_for_test.proto -+ grpc/channelz/v1/channelz.proto grpc/channelz/v1/channelz.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/lrs_for_test.proto src/proto/grpc/testing/xds/lrs_for_test.proto -+ grpc/core/stats.proto grpc/core/stats.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/address.proto src/proto/grpc/testing/xds/v3/address.proto -+ grpc/health/v1/health.proto grpc/health/v1/health.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/ads.proto src/proto/grpc/testing/xds/v3/ads.proto -+ grpc/lb/v1/load_balancer.proto grpc/lb/v1/load_balancer.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/aggregate_cluster.proto src/proto/grpc/testing/xds/v3/aggregate_cluster.proto -+ grpc/lookup/v1/rls.proto grpc/lookup/v1/rls.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/base.proto src/proto/grpc/testing/xds/v3/base.proto -+ grpc/lookup/v1/rls_config.proto grpc/lookup/v1/rls_config.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/cluster.proto src/proto/grpc/testing/xds/v3/cluster.proto -+ grpc/reflection/v1alpha/reflection.proto grpc/reflection/v1alpha/reflection.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/config_dump.proto src/proto/grpc/testing/xds/v3/config_dump.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/config_source.proto src/proto/grpc/testing/xds/v3/config_source.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/csds.proto src/proto/grpc/testing/xds/v3/csds.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/discovery.proto src/proto/grpc/testing/xds/v3/discovery.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/endpoint.proto src/proto/grpc/testing/xds/v3/endpoint.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/expr.proto src/proto/grpc/testing/xds/v3/expr.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/extension.proto src/proto/grpc/testing/xds/v3/extension.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/fault.proto src/proto/grpc/testing/xds/v3/fault.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/fault_common.proto src/proto/grpc/testing/xds/v3/fault_common.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/http_connection_manager.proto src/proto/grpc/testing/xds/v3/http_connection_manager.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/http_filter_rbac.proto src/proto/grpc/testing/xds/v3/http_filter_rbac.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/listener.proto src/proto/grpc/testing/xds/v3/listener.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/load_report.proto src/proto/grpc/testing/xds/v3/load_report.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/lrs.proto src/proto/grpc/testing/xds/v3/lrs.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/metadata.proto src/proto/grpc/testing/xds/v3/metadata.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/orca_load_report.proto src/proto/grpc/testing/xds/v3/orca_load_report.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/orca_service.proto src/proto/grpc/testing/xds/v3/orca_service.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/outlier_detection.proto src/proto/grpc/testing/xds/v3/outlier_detection.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/path.proto src/proto/grpc/testing/xds/v3/path.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/percent.proto src/proto/grpc/testing/xds/v3/percent.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/protocol.proto src/proto/grpc/testing/xds/v3/protocol.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/range.proto src/proto/grpc/testing/xds/v3/range.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/rbac.proto src/proto/grpc/testing/xds/v3/rbac.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/regex.proto src/proto/grpc/testing/xds/v3/regex.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/route.proto src/proto/grpc/testing/xds/v3/route.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/router.proto src/proto/grpc/testing/xds/v3/router.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/string.proto src/proto/grpc/testing/xds/v3/string.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/tls.proto src/proto/grpc/testing/xds/v3/tls.proto -+ grpc/status/status.proto grpc/status/status.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( - test/core/tsi/alts/fake_handshaker/handshaker.proto test/core/tsi/alts/fake_handshaker/handshaker.proto -@@ -3446,10 +3290,8 @@ endif() - - if(gRPC_BUILD_CODEGEN) - add_library(grpc++_reflection -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.h -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h -+ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.cc -+ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.h - src/cpp/ext/proto_server_reflection.cc - src/cpp/ext/proto_server_reflection_plugin.cc - ) -@@ -3488,6 +3330,7 @@ target_link_libraries(grpc++_reflection - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ -+ grpc-proto::grpc-proto - ) - - foreach(_hdr -@@ -4076,10 +3919,8 @@ endif() - # See https://github.com/grpc/grpc/issues/19473 - if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) - add_library(grpcpp_channelz -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h -+ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.cc -+ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.h - src/cpp/server/channelz/channelz_service.cc - src/cpp/server/channelz/channelz_service_plugin.cc - ) -@@ -4118,6 +3959,7 @@ target_link_libraries(grpcpp_channelz - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ -+ grpc-proto::grpc-proto - ) - - foreach(_hdr -diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h -index a9b5db0..528e75b 100644 ---- a/src/cpp/ext/proto_server_reflection.h -+++ b/src/cpp/ext/proto_server_reflection.h -@@ -29,8 +29,8 @@ - #include - #include - --#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h" --#include "src/proto/grpc/reflection/v1alpha/reflection.pb.h" -+#include "grpc/reflection/v1alpha/reflection.grpc.pb.h" -+#include "grpc/reflection/v1alpha/reflection.pb.h" - - namespace grpc { - -diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h -index 91936da..a84c57a 100644 ---- a/src/cpp/server/channelz/channelz_service.h -+++ b/src/cpp/server/channelz/channelz_service.h -@@ -24,8 +24,8 @@ - #include - #include - --#include "src/proto/grpc/channelz/channelz.grpc.pb.h" --#include "src/proto/grpc/channelz/channelz.pb.h" -+#include "grpc/channelz/v1/channelz.grpc.pb.h" -+#include "grpc/channelz/v1/channelz.pb.h" - - namespace grpc { - 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 65b655ba1f8b5..dee7836ac518b 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.48.x/002-consume-protos-from-requirements.patch b/recipes/grpc/all/patches/v1.48.x/002-consume-protos-from-requirements.patch deleted file mode 100644 index 5fd52235a25e3..0000000000000 --- a/recipes/grpc/all/patches/v1.48.x/002-consume-protos-from-requirements.patch +++ /dev/null @@ -1,327 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7d23aa5..457188b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -451,7 +451,7 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM - endif() - - # Sets the include path for ProtoBuf files -- set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) -+ set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR} -I ${googleapis_RES_DIRS} -I ${grpc-proto_RES_DIRS}) - # The absolute path of the expected place for the input proto file - # For example, health proto has package name grpc.health.v1, it's expected to be: - # ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1/health.proto -@@ -476,8 +476,8 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM - # path. For example, health proto has package name grpc.health.v1, the bash - # equivalent would be: - # cp src/proto/grpc/health/v1/health.proto ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1 -- file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) -- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) -+ # file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) -+ # file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) - - #if cross-compiling, find host plugin - if(CMAKE_CROSSCOMPILING) -@@ -490,18 +490,15 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM - OUTPUT "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc" - "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h" - "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" -- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" -- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" - COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} - ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} -- --cpp_out=${_gRPC_PROTO_GENS_DIR} - --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN} - ${_protobuf_include_path} -- ${REL_FIL} -- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin -+ ${FILE_LOCATION} -+ DEPENDS ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin - WORKING_DIRECTORY ${_gRPC_PROTO_SRCS_DIR} -- COMMENT "Running gRPC C++ protocol buffer compiler for ${IMPORT_PATH}" -- VERBATIM) -+ COMMENT "Running gRPC C++ protocol buffer compiler for ${FILE_LOCATION}" -+ ) - endfunction() - - # These options allow users to enable or disable the building of the various -@@ -554,199 +551,28 @@ add_custom_target(tools - DEPENDS tools_c tools_cxx) - - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/channelz/channelz.proto src/proto/grpc/channelz/channelz.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/core/stats.proto src/proto/grpc/core/stats.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/health/v1/health.proto src/proto/grpc/health/v1/health.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/lb/v1/load_balancer.proto src/proto/grpc/lb/v1/load_balancer.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/lookup/v1/rls.proto src/proto/grpc/lookup/v1/rls.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/lookup/v1/rls_config.proto src/proto/grpc/lookup/v1/rls_config.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/reflection/v1alpha/reflection.proto src/proto/grpc/reflection/v1alpha/reflection.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/status/status.proto src/proto/grpc/status/status.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/benchmark_service.proto src/proto/grpc/testing/benchmark_service.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/control.proto src/proto/grpc/testing/control.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/duplicate/echo_duplicate.proto src/proto/grpc/testing/duplicate/echo_duplicate.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/echo.proto src/proto/grpc/testing/echo.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/echo_messages.proto src/proto/grpc/testing/echo_messages.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/empty.proto src/proto/grpc/testing/empty.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/istio_echo.proto src/proto/grpc/testing/istio_echo.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/messages.proto src/proto/grpc/testing/messages.proto -+ grpc/channelz/v1/channelz.proto grpc/channelz/v1/channelz.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/payloads.proto src/proto/grpc/testing/payloads.proto -+ grpc/core/stats.proto grpc/core/stats.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/report_qps_scenario_service.proto src/proto/grpc/testing/report_qps_scenario_service.proto -+ grpc/health/v1/health.proto grpc/health/v1/health.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/simple_messages.proto src/proto/grpc/testing/simple_messages.proto -+ grpc/lb/v1/load_balancer.proto grpc/lb/v1/load_balancer.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/stats.proto src/proto/grpc/testing/stats.proto -+ grpc/lookup/v1/rls.proto grpc/lookup/v1/rls.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/test.proto src/proto/grpc/testing/test.proto -+ grpc/lookup/v1/rls_config.proto grpc/lookup/v1/rls_config.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/worker_service.proto src/proto/grpc/testing/worker_service.proto -+ grpc/reflection/v1alpha/reflection.proto grpc/reflection/v1alpha/reflection.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/ads_for_test.proto src/proto/grpc/testing/xds/ads_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/cds_for_test.proto src/proto/grpc/testing/xds/cds_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/eds_for_test.proto src/proto/grpc/testing/xds/eds_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/lds_rds_for_test.proto src/proto/grpc/testing/xds/lds_rds_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/lrs_for_test.proto src/proto/grpc/testing/xds/lrs_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/address.proto src/proto/grpc/testing/xds/v3/address.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/ads.proto src/proto/grpc/testing/xds/v3/ads.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/aggregate_cluster.proto src/proto/grpc/testing/xds/v3/aggregate_cluster.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/base.proto src/proto/grpc/testing/xds/v3/base.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/cluster.proto src/proto/grpc/testing/xds/v3/cluster.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/config_dump.proto src/proto/grpc/testing/xds/v3/config_dump.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/config_source.proto src/proto/grpc/testing/xds/v3/config_source.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/csds.proto src/proto/grpc/testing/xds/v3/csds.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/discovery.proto src/proto/grpc/testing/xds/v3/discovery.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/endpoint.proto src/proto/grpc/testing/xds/v3/endpoint.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/expr.proto src/proto/grpc/testing/xds/v3/expr.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/extension.proto src/proto/grpc/testing/xds/v3/extension.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/fault.proto src/proto/grpc/testing/xds/v3/fault.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/fault_common.proto src/proto/grpc/testing/xds/v3/fault_common.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/http_connection_manager.proto src/proto/grpc/testing/xds/v3/http_connection_manager.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/http_filter_rbac.proto src/proto/grpc/testing/xds/v3/http_filter_rbac.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/listener.proto src/proto/grpc/testing/xds/v3/listener.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/load_report.proto src/proto/grpc/testing/xds/v3/load_report.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/lrs.proto src/proto/grpc/testing/xds/v3/lrs.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/metadata.proto src/proto/grpc/testing/xds/v3/metadata.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/orca_load_report.proto src/proto/grpc/testing/xds/v3/orca_load_report.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/orca_service.proto src/proto/grpc/testing/xds/v3/orca_service.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/outlier_detection.proto src/proto/grpc/testing/xds/v3/outlier_detection.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/path.proto src/proto/grpc/testing/xds/v3/path.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/percent.proto src/proto/grpc/testing/xds/v3/percent.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/protocol.proto src/proto/grpc/testing/xds/v3/protocol.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/range.proto src/proto/grpc/testing/xds/v3/range.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/rbac.proto src/proto/grpc/testing/xds/v3/rbac.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/regex.proto src/proto/grpc/testing/xds/v3/regex.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/ring_hash.proto src/proto/grpc/testing/xds/v3/ring_hash.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/round_robin.proto src/proto/grpc/testing/xds/v3/round_robin.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/route.proto src/proto/grpc/testing/xds/v3/route.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/router.proto src/proto/grpc/testing/xds/v3/router.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/string.proto src/proto/grpc/testing/xds/v3/string.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/tls.proto src/proto/grpc/testing/xds/v3/tls.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/typed_struct.proto src/proto/grpc/testing/xds/v3/typed_struct.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/udpa_typed_struct.proto src/proto/grpc/testing/xds/v3/udpa_typed_struct.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/wrr_locality.proto src/proto/grpc/testing/xds/v3/wrr_locality.proto -+ src/proto/grpc/status/status.proto grpc/status/status.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto -@@ -3497,10 +3323,8 @@ endif() - - if(gRPC_BUILD_CODEGEN) - add_library(grpc++_reflection -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.h -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h -+ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.cc -+ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.h - src/cpp/ext/proto_server_reflection.cc - src/cpp/ext/proto_server_reflection_plugin.cc - ) -@@ -3539,6 +3363,7 @@ target_link_libraries(grpc++_reflection - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ -+ grpc-proto::grpc-proto - ) - - foreach(_hdr -@@ -4096,10 +3921,8 @@ endif() - # See https://github.com/grpc/grpc/issues/19473 - if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) - add_library(grpcpp_channelz -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h -+ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.cc -+ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.h - src/cpp/server/channelz/channelz_service.cc - src/cpp/server/channelz/channelz_service_plugin.cc - ) -@@ -4138,6 +3961,7 @@ target_link_libraries(grpcpp_channelz - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ -+ grpc-proto::grpc-proto - ) - - foreach(_hdr -diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h -index a9b5db0..528e75b 100644 ---- a/src/cpp/ext/proto_server_reflection.h -+++ b/src/cpp/ext/proto_server_reflection.h -@@ -29,8 +29,8 @@ - #include - #include - --#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h" --#include "src/proto/grpc/reflection/v1alpha/reflection.pb.h" -+#include "grpc/reflection/v1alpha/reflection.grpc.pb.h" -+#include "grpc/reflection/v1alpha/reflection.pb.h" - - namespace grpc { - -diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h -index 91936da..a84c57a 100644 ---- a/src/cpp/server/channelz/channelz_service.h -+++ b/src/cpp/server/channelz/channelz_service.h -@@ -24,8 +24,8 @@ - #include - #include - --#include "src/proto/grpc/channelz/channelz.grpc.pb.h" --#include "src/proto/grpc/channelz/channelz.pb.h" -+#include "grpc/channelz/v1/channelz.grpc.pb.h" -+#include "grpc/channelz/v1/channelz.pb.h" - - namespace grpc { - 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 a9339dbcc896b..fb952330fde1c 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/all/patches/v1.50.x/002-consume-protos-from-requirements.patch b/recipes/grpc/all/patches/v1.50.x/002-consume-protos-from-requirements.patch deleted file mode 100644 index 515291213b267..0000000000000 --- a/recipes/grpc/all/patches/v1.50.x/002-consume-protos-from-requirements.patch +++ /dev/null @@ -1,326 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 259fa93..fb05774 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -452,7 +452,7 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM - endif() - - # Sets the include path for ProtoBuf files -- set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) -+ set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR} -I ${googleapis_RES_DIRS} -I ${grpc-proto_RES_DIRS}) - # The absolute path of the expected place for the input proto file - # For example, health proto has package name grpc.health.v1, it's expected to be: - # ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1/health.proto -@@ -477,8 +477,6 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM - # path. For example, health proto has package name grpc.health.v1, the bash - # equivalent would be: - # cp src/proto/grpc/health/v1/health.proto ${_gRPC_PROTO_SRCS_DIR}/grpc/health/v1 -- file(MAKE_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) -- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} DESTINATION ${_gRPC_PROTO_SRCS_DIR}/${REL_DIR}) - - #if cross-compiling, find host plugin - if(CMAKE_CROSSCOMPILING) -@@ -491,18 +489,15 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM - OUTPUT "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc" - "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h" - "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h" -- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" -- "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" - COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} - ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} -- --cpp_out=${_gRPC_PROTO_GENS_DIR} - --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN} - ${_protobuf_include_path} -- ${REL_FIL} -- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} ${_gRPC_CPP_PLUGIN} -+ ${FILE_LOCATION} -+ DEPENDS ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin - WORKING_DIRECTORY ${_gRPC_PROTO_SRCS_DIR} -- COMMENT "Running gRPC C++ protocol buffer compiler for ${IMPORT_PATH}" -- VERBATIM) -+ COMMENT "Running gRPC C++ protocol buffer compiler for ${FILE_LOCATION}" -+ ) - endfunction() - - # These options allow users to enable or disable the building of the various -@@ -554,199 +549,28 @@ add_custom_target(tools - DEPENDS tools_c tools_cxx) - - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/channelz/channelz.proto src/proto/grpc/channelz/channelz.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/core/stats.proto src/proto/grpc/core/stats.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/health/v1/health.proto src/proto/grpc/health/v1/health.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/lb/v1/load_balancer.proto src/proto/grpc/lb/v1/load_balancer.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/lookup/v1/rls.proto src/proto/grpc/lookup/v1/rls.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/lookup/v1/rls_config.proto src/proto/grpc/lookup/v1/rls_config.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/reflection/v1alpha/reflection.proto src/proto/grpc/reflection/v1alpha/reflection.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/status/status.proto src/proto/grpc/status/status.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/benchmark_service.proto src/proto/grpc/testing/benchmark_service.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/control.proto src/proto/grpc/testing/control.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/duplicate/echo_duplicate.proto src/proto/grpc/testing/duplicate/echo_duplicate.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/echo.proto src/proto/grpc/testing/echo.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/echo_messages.proto src/proto/grpc/testing/echo_messages.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/empty.proto src/proto/grpc/testing/empty.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/istio_echo.proto src/proto/grpc/testing/istio_echo.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/messages.proto src/proto/grpc/testing/messages.proto -+ grpc/channelz/v1/channelz.proto grpc/channelz/v1/channelz.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/payloads.proto src/proto/grpc/testing/payloads.proto -+ grpc/core/stats.proto grpc/core/stats.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/report_qps_scenario_service.proto src/proto/grpc/testing/report_qps_scenario_service.proto -+ grpc/health/v1/health.proto grpc/health/v1/health.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/simple_messages.proto src/proto/grpc/testing/simple_messages.proto -+ grpc/lb/v1/load_balancer.proto grpc/lb/v1/load_balancer.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/stats.proto src/proto/grpc/testing/stats.proto -+ grpc/lookup/v1/rls.proto grpc/lookup/v1/rls.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/test.proto src/proto/grpc/testing/test.proto -+ grpc/lookup/v1/rls_config.proto grpc/lookup/v1/rls_config.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/worker_service.proto src/proto/grpc/testing/worker_service.proto -+ grpc/reflection/v1alpha/reflection.proto grpc/reflection/v1alpha/reflection.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/ads_for_test.proto src/proto/grpc/testing/xds/ads_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/cds_for_test.proto src/proto/grpc/testing/xds/cds_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/eds_for_test.proto src/proto/grpc/testing/xds/eds_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/lds_rds_for_test.proto src/proto/grpc/testing/xds/lds_rds_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/lrs_for_test.proto src/proto/grpc/testing/xds/lrs_for_test.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/address.proto src/proto/grpc/testing/xds/v3/address.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/ads.proto src/proto/grpc/testing/xds/v3/ads.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/aggregate_cluster.proto src/proto/grpc/testing/xds/v3/aggregate_cluster.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/base.proto src/proto/grpc/testing/xds/v3/base.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/cluster.proto src/proto/grpc/testing/xds/v3/cluster.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/config_dump.proto src/proto/grpc/testing/xds/v3/config_dump.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/config_source.proto src/proto/grpc/testing/xds/v3/config_source.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/csds.proto src/proto/grpc/testing/xds/v3/csds.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/discovery.proto src/proto/grpc/testing/xds/v3/discovery.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/endpoint.proto src/proto/grpc/testing/xds/v3/endpoint.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/expr.proto src/proto/grpc/testing/xds/v3/expr.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/extension.proto src/proto/grpc/testing/xds/v3/extension.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/fault.proto src/proto/grpc/testing/xds/v3/fault.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/fault_common.proto src/proto/grpc/testing/xds/v3/fault_common.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/http_connection_manager.proto src/proto/grpc/testing/xds/v3/http_connection_manager.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/http_filter_rbac.proto src/proto/grpc/testing/xds/v3/http_filter_rbac.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/listener.proto src/proto/grpc/testing/xds/v3/listener.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/load_report.proto src/proto/grpc/testing/xds/v3/load_report.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/lrs.proto src/proto/grpc/testing/xds/v3/lrs.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/metadata.proto src/proto/grpc/testing/xds/v3/metadata.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/orca_load_report.proto src/proto/grpc/testing/xds/v3/orca_load_report.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/orca_service.proto src/proto/grpc/testing/xds/v3/orca_service.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/outlier_detection.proto src/proto/grpc/testing/xds/v3/outlier_detection.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/path.proto src/proto/grpc/testing/xds/v3/path.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/percent.proto src/proto/grpc/testing/xds/v3/percent.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/protocol.proto src/proto/grpc/testing/xds/v3/protocol.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/range.proto src/proto/grpc/testing/xds/v3/range.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/rbac.proto src/proto/grpc/testing/xds/v3/rbac.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/regex.proto src/proto/grpc/testing/xds/v3/regex.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/ring_hash.proto src/proto/grpc/testing/xds/v3/ring_hash.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/round_robin.proto src/proto/grpc/testing/xds/v3/round_robin.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/route.proto src/proto/grpc/testing/xds/v3/route.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/router.proto src/proto/grpc/testing/xds/v3/router.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/string.proto src/proto/grpc/testing/xds/v3/string.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/tls.proto src/proto/grpc/testing/xds/v3/tls.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/typed_struct.proto src/proto/grpc/testing/xds/v3/typed_struct.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/udpa_typed_struct.proto src/proto/grpc/testing/xds/v3/udpa_typed_struct.proto --) --protobuf_generate_grpc_cpp_with_import_path_correction( -- src/proto/grpc/testing/xds/v3/wrr_locality.proto src/proto/grpc/testing/xds/v3/wrr_locality.proto -+ src/proto/grpc/status/status.proto grpc/status/status.proto - ) - protobuf_generate_grpc_cpp_with_import_path_correction( - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto -@@ -3536,10 +3360,8 @@ endif() - - if(gRPC_BUILD_CODEGEN) - add_library(grpc++_reflection -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.h -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h -+ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.cc -+ ${_gRPC_PROTO_GENS_DIR}/grpc/reflection/v1alpha/reflection.grpc.pb.h - src/cpp/ext/proto_server_reflection.cc - src/cpp/ext/proto_server_reflection_plugin.cc - ) -@@ -3578,6 +3400,7 @@ target_link_libraries(grpc++_reflection - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ -+ grpc-proto::grpc-proto - ) - - foreach(_hdr -@@ -4149,10 +3972,8 @@ endif() - # See https://github.com/grpc/grpc/issues/19473 - if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) - add_library(grpcpp_channelz -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h -- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h -+ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.cc -+ ${_gRPC_PROTO_GENS_DIR}/grpc/channelz/v1/channelz.grpc.pb.h - src/cpp/server/channelz/channelz_service.cc - src/cpp/server/channelz/channelz_service_plugin.cc - ) -@@ -4191,6 +4012,7 @@ target_link_libraries(grpcpp_channelz - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ -+ grpc-proto::grpc-proto - ) - - foreach(_hdr -diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h -index a9b5db0..528e75b 100644 ---- a/src/cpp/ext/proto_server_reflection.h -+++ b/src/cpp/ext/proto_server_reflection.h -@@ -29,8 +29,8 @@ - #include - #include - --#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h" --#include "src/proto/grpc/reflection/v1alpha/reflection.pb.h" -+#include "grpc/reflection/v1alpha/reflection.grpc.pb.h" -+#include "grpc/reflection/v1alpha/reflection.pb.h" - - namespace grpc { - -diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h -index 91936da..0172493 100644 ---- a/src/cpp/server/channelz/channelz_service.h -+++ b/src/cpp/server/channelz/channelz_service.h -@@ -24,8 +24,9 @@ - #include - #include - --#include "src/proto/grpc/channelz/channelz.grpc.pb.h" --#include "src/proto/grpc/channelz/channelz.pb.h" -+#include "grpc/channelz/v1/channelz.grpc.pb.h" -+#include "grpc/channelz/v1/channelz.pb.h" -+ - - namespace grpc { - diff --git a/recipes/grpc/config.yml b/recipes/grpc/config.yml index d36f53e1f178c..0e75e172635d2 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 010ad6b469c3c..48441a1526519 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 d59ea8610e6a3..498e3972927b9 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 0063a1958556f..b4d8ae0dd1ce8 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 6042a2363b626..b21cc49efde95 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 db36d97f3c465..7895db93c24a6 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 d21a23d317e33..587567b5e7b67 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/gsl/all/conandata.yml b/recipes/gsl/all/conandata.yml index ae4c67c1283a1..d61a5f24f34f4 100644 --- a/recipes/gsl/all/conandata.yml +++ b/recipes/gsl/all/conandata.yml @@ -1,11 +1,17 @@ sources: + "2.7.1": + url: "https://ftpmirror.gnu.org/gsl/gsl-2.7.1.tar.gz" + sha256: "dcb0fbd43048832b757ff9942691a8dd70026d5da0ff85601e52687f6deeb34b" "2.7": - url: "https://ftp.gnu.org/gnu/gsl/gsl-2.7.tar.gz" + url: "https://ftpmirror.gnu.org/gsl/gsl-2.7.tar.gz" sha256: "efbbf3785da0e53038be7907500628b466152dbc3c173a87de1b5eba2e23602b" "2.6": - url: "https://ftp.gnu.org/gnu/gsl/gsl-2.6.tar.gz" + url: "https://ftpmirror.gnu.org/gsl/gsl-2.6.tar.gz" sha256: "b782339fc7a38fe17689cb39966c4d821236c28018b6593ddb6fd59ee40786a8" patches: + "2.7.1": + - patch_file: "patches/0001-windows-support.patch" + - patch_file: "patches/0002-export-all-gsl_-symbols.patch" "2.7": - patch_file: "patches/0001-windows-support.patch" - patch_file: "patches/0002-export-all-gsl_-symbols.patch" diff --git a/recipes/gsl/config.yml b/recipes/gsl/config.yml index 15814520e1bfd..6bdfd995018bc 100644 --- a/recipes/gsl/config.yml +++ b/recipes/gsl/config.yml @@ -1,4 +1,6 @@ versions: + "2.7.1": + folder: all "2.7": folder: all "2.6": diff --git a/recipes/gsoap/all/conandata.yml b/recipes/gsoap/all/conandata.yml index 4a616af7b7a29..cc91f201aaee4 100644 --- a/recipes/gsoap/all/conandata.yml +++ b/recipes/gsoap/all/conandata.yml @@ -1,21 +1,11 @@ sources: - "2.8.117": + "2.8.132": 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" - sha256: "7cadf8808cfd982629948fe09e4fa6cd18e23cafd40df0aaaff1b1f5b695c442" - "2.8.116": + - "https://downloads.sourceforge.net/project/gsoap2/gsoap_2.8.132.zip" + - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.132.zip" + sha256: "d6eb5d0d2c31532746f4dc9fa1ce95d4553414e918059eac23cf081d88c2aeee" + "2.8.129": 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" - 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" - 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" - sha256: "aa70a999258100c170a3f8750c1f91318a477d440f6a28117f68bc1ded32327f" + - "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" diff --git a/recipes/gsoap/all/conanfile.py b/recipes/gsoap/all/conanfile.py index 38b4629ae4211..6f49eae5e182d 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 1464ab750d83b..9d9cb52d4bac7 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 1ea623e022729..60209e04ba8a6 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 0d20897301b68..b21cc49efde95 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 01534d05392ba..9a5640854a072 100644 --- a/recipes/gsoap/config.yml +++ b/recipes/gsoap/config.yml @@ -1,9 +1,5 @@ versions: - "2.8.117": + "2.8.132": folder: all - "2.8.116": - folder: all - "2.8.115": - folder: all - "2.8.114": + "2.8.129": folder: all diff --git a/recipes/gstreamer/all/conandata.yml b/recipes/gstreamer/all/conandata.yml index 39e4939669206..c81d17d89f92b 100644 --- a/recipes/gstreamer/all/conandata.yml +++ b/recipes/gstreamer/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.22.3": + url: "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.22.3.tar.xz" + sha256: "9ffeab95053f9f6995eb3b3da225e88f21c129cd60da002d3f795db70d6d5974" + "1.20.6": + url: "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.20.6.tar.xz" + sha256: "0545b030960680f71a95f9d39c95daae54b4d317d335e8f239d81138773c9b90" "1.19.2": url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.19.2/gstreamer-1.19.2.tar.gz" sha256: "6ec8494867d9b58f145c0c357da631faf21c2c72c7cd8b637b440188fe904ab8" diff --git a/recipes/gstreamer/all/conanfile.py b/recipes/gstreamer/all/conanfile.py index 2c45e3ce6053d..7bd590a8dadbf 100644 --- a/recipes/gstreamer/all/conanfile.py +++ b/recipes/gstreamer/all/conanfile.py @@ -47,7 +47,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.76.2", transitive_headers=True, transitive_libs=True) + self.requires("glib/2.76.3", transitive_headers=True, transitive_libs=True) def validate(self): if not self.dependencies.direct_host["glib"].options.shared and self.info.options.shared: @@ -55,10 +55,10 @@ def validate(self): raise ConanInvalidConfiguration("shared GStreamer cannot link to static GLib") def build_requirements(self): - self.tool_requires("meson/1.1.0") + self.tool_requires("meson/1.1.1") # There used to be an issue with glib being shared by default but its dependencies being static # No longer the case, but see: https://github.com/conan-io/conan-center-index/pull/13400#issuecomment-1551565573 for context - self.tool_requires("glib/2.76.2") + self.tool_requires("glib/2.76.3") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/1.9.3") if self.options.with_introspection: diff --git a/recipes/gstreamer/config.yml b/recipes/gstreamer/config.yml index ced567b81f5cb..e4692dfb998b7 100644 --- a/recipes/gstreamer/config.yml +++ b/recipes/gstreamer/config.yml @@ -1,4 +1,8 @@ versions: + "1.22.3": + folder: all + "1.20.6": + folder: all "1.19.2": folder: all "1.19.1": diff --git a/recipes/gtest/all/conandata.yml b/recipes/gtest/all/conandata.yml index 70ff2819b4d9f..b22247dc8573d 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" @@ -8,6 +11,9 @@ sources: "1.10.0": url: "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" sha256: "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb" + "1.8.1": + url: "https://github.com/google/googletest/archive/release-1.8.1.tar.gz" + sha256: "9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c" patches: "1.10.0": - patch_file: "patches/gtest-1.10.0.patch" @@ -17,3 +23,7 @@ patches: patch_description: "prevent compiler from complaining while compiling" patch_type: "bugfix" patch_source: "https://github.com/google/googletest/pull/2507" + "1.8.1": + - patch_file: "patches/gtest-1.8.1.patch" + patch_description: "add CUSTOM_DEBUG_POSTFIX option" + patch_type: "conan" diff --git a/recipes/gtest/all/patches/gtest-1.8.1.patch b/recipes/gtest/all/patches/gtest-1.8.1.patch new file mode 100755 index 0000000000000..838ab42c89f02 --- /dev/null +++ b/recipes/gtest/all/patches/gtest-1.8.1.patch @@ -0,0 +1,13 @@ +diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake +index 8c1f9ba..2203d3c 100644 +--- a/googletest/cmake/internal_utils.cmake ++++ b/googletest/cmake/internal_utils.cmake +@@ -166,7 +166,7 @@ function(cxx_library_with_type name type cxx_flags) + # Generate debug library name with a postfix. + set_target_properties(${name} + PROPERTIES +- DEBUG_POSTFIX "d") ++ DEBUG_POSTFIX "${CUSTOM_DEBUG_POSTFIX}") + if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED") + set_target_properties(${name} + PROPERTIES diff --git a/recipes/gtest/config.yml b/recipes/gtest/config.yml index 6df56e900d95a..fa66f2eb7d4d7 100644 --- a/recipes/gtest/config.yml +++ b/recipes/gtest/config.yml @@ -1,7 +1,11 @@ versions: + "1.14.0": + folder: all "1.13.0": folder: all "1.12.1": folder: all "1.10.0": folder: all + "1.8.1": + folder: all diff --git a/recipes/gtk-doc-stub/all/conandata.yml b/recipes/gtk-doc-stub/all/conandata.yml index f0e15055fe310..c03929cb0c469 100644 --- a/recipes/gtk-doc-stub/all/conandata.yml +++ b/recipes/gtk-doc-stub/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "cci.20181216": - patch_file: "patches/0001-relocatable-gtkdocize.patch" - base_path: "source_subfolder" diff --git a/recipes/gtk-doc-stub/all/conanfile.py b/recipes/gtk-doc-stub/all/conanfile.py index dc86c338bb133..e2a8032aad958 100644 --- a/recipes/gtk-doc-stub/all/conanfile.py +++ b/recipes/gtk-doc-stub/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import functools +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path_package_info_legacy + import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class GtkDocStubConan(ConanFile): @@ -12,54 +17,59 @@ class GtkDocStubConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "GPL-2.0-or-later" topics = ("gtk", "documentation", "gtkdocize") + package_type = "application" settings = "os" - exports_sources = "patches/*" - - @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 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_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 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) - - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - args = [ - "--datadir={}".format(tools.unix_path(os.path.join(self.package_folder, "res"))), - "--datarootdir={}".format(tools.unix_path(os.path.join(self.package_folder, "res"))), - ] - autotools.configure(args=args, configure_dir=self._source_subfolder) - return autotools + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--datarootdir=${prefix}/res") + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - autotools = self._configure_autotools() + apply_conandata_patches(self) + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() def package_info(self): + self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] self.cpp_info.resdirs = ["res"] - automake_dir = tools.unix_path(os.path.join(self.package_folder, "res", "aclocal")) - self.output.info("Appending AUTOMAKE_CONAN_INCLUDES environment variable: {}".format(automake_dir)) + self.buildenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) + + automake_dir = unix_path_package_info_legacy(self, os.path.join(self.package_folder, "res", "aclocal")) + self.buildenv_info.append_path("AUTOMAKE_CONAN_INCLUDES", automake_dir) + + # TODO: remove the following when only Conan 2.0 is supported + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) self.env_info.AUTOMAKE_CONAN_INCLUDES.append(automake_dir) diff --git a/recipes/gtk-doc-stub/all/test_package/conanfile.py b/recipes/gtk-doc-stub/all/test_package/conanfile.py index 9346d5cf9cd7a..f3486b7aa5a22 100644 --- a/recipes/gtk-doc-stub/all/test_package/conanfile.py +++ b/recipes/gtk-doc-stub/all/test_package/conanfile.py @@ -1,37 +1,45 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import os -import shutil +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.files import copy +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - exports_sources = "configure.ac", + exports_sources = "configure.ac" test_type = "explicit" + win_bash = True # This assignment must be *here* to avoid "Cannot wrap command with different envs." in Conan 1.x @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - def requirements(self): - self.requires(self.tested_reference_str) + def layout(self): + basic_layout(self) def build_requirements(self): - self.build_requires(self.tested_reference_str) - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - self.build_requires("automake/1.16.4") + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + self.tool_requires("automake/1.16.5") + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-option-checking=fatal") + tc.configure_args.append("--enable-gtk-doc=no") + tc.generate() def build(self): - for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), - os.path.join(self.build_folder, src)) - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True, win_bash=tools.os_info.is_windows) - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - args = [ - "--enable-option-checking=fatal", - "--enable-gtk-doc=no", - ] - autotools.configure(args=args) + copy(self, "configure.ac", self.export_sources_folder, self.build_folder) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() def test(self): - self.run("gtkdocize --copy", run_environment=True, win_bash=tools.os_info.is_windows) + if can_run(self): + self.run(f"gtkdocize --version", env="conanbuild") diff --git a/recipes/gtsam/all/conandata.yml b/recipes/gtsam/all/conandata.yml index a7ab46e7ea6fb..243d25034c49e 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 6ed583d1786ac..bca7930e912c2 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 d19f34cd53327..0000000000000 --- 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 21c808ace60fd..0000000000000 --- 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 6bc74d30d7ff1..0000000000000 --- 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 0000000000000..8bd45c6d8f747 --- /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 0000000000000..2f60f9adaef8a --- /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 0000000000000..19bc6febd2db0 --- /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 6f380a83ebb14..92f20f30ab347 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 d051b6e10260b..0581848785da0 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 acf147558e0f4..55d0965a2f54b 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 e3d119caf2292..0000000000000 --- 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 49abdec557672..addf429c28646 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 0000000000000..c30ef97cb4cf1 --- /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 312ec85b4db11..67af1aea3aa55 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/conandata.yml b/recipes/gurkenlaeufer/all/conandata.yml index 7f1f9f96ad208..8c528ae68f26c 100644 --- a/recipes/gurkenlaeufer/all/conandata.yml +++ b/recipes/gurkenlaeufer/all/conandata.yml @@ -1,4 +1,8 @@ sources: + "1.1.0": + url: + - "https://github.com/paulelsner/gurkenlaeufer/archive/refs/tags/v1.1.0.zip" + sha256: "afa8ff520354ece11c97537ba61998b04fca02d3eda1909d112f008dd4522ba0" "1.0.1": url: - "https://github.com/paulelsner/gurkenlaeufer/archive/refs/tags/v1.0.1.zip" diff --git a/recipes/gurkenlaeufer/all/conanfile.py b/recipes/gurkenlaeufer/all/conanfile.py index 07fa4de3d08f1..50934895c439f 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/gurkenlaeufer/config.yml b/recipes/gurkenlaeufer/config.yml index 715e55357a17b..20ec1c9e2bdee 100644 --- a/recipes/gurkenlaeufer/config.yml +++ b/recipes/gurkenlaeufer/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.0": + folder: all "1.0.1": folder: all diff --git a/recipes/gzip-hpp/all/conanfile.py b/recipes/gzip-hpp/all/conanfile.py index 9401872c82770..8e576978736f7 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 cd78418f65010..264046f12084e 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 572f56191b252..9c9caa28d810e 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 2a1bf3aae7487..6a5c9d7731601 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 64b104957470d..07e6b8fcf90e0 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 d120a992c06a6..0a6bc68712d90 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 c8aa9412f7287..b21cc49efde95 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/happly/all/conanfile.py b/recipes/happly/all/conanfile.py index 21fdcfcb45fd6..2d6741283955a 100644 --- a/recipes/happly/all/conanfile.py +++ b/recipes/happly/all/conanfile.py @@ -1,30 +1,42 @@ -from conans import ConanFile, tools +import os + +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 HapplyConan(ConanFile): name = "happly" + description = "A C++ header-only parser for the PLY file format. Parse .ply happily!" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nmwsharp/happly" - topics = ("conan", "happly", "ply", "3D") - license = "MIT" - description = "A C++ header-only parser for the PLY file format. Parse .ply happily!" - settings = "compiler" + topics = ("ply", "3D", "mesh", "point cloud", "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 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], 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("happly.h", src=self._source_subfolder, dst="include") + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "happly.h", src=self.source_folder, 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/happly/all/test_package/CMakeLists.txt b/recipes/happly/all/test_package/CMakeLists.txt index 33ae887aa6aea..6b4a4a756dfdf 100644 --- a/recipes/happly/all/test_package/CMakeLists.txt +++ b/recipes/happly/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(happly REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE happly::happly) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/happly/all/test_package/conanfile.py b/recipes/happly/all/test_package/conanfile.py index 5a25a64cfaaa9..93e4ec3d18f37 100644 --- a/recipes/happly/all/test_package/conanfile.py +++ b/recipes/happly/all/test_package/conanfile.py @@ -1,12 +1,21 @@ import glob 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 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,8 +23,9 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "test_package")) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") # Let's check if the *.ply file has been created successfully ply_format_file = glob.glob("*.ply")[0] assert os.path.exists(ply_format_file) diff --git a/recipes/happly/all/test_v1_package/CMakeLists.txt b/recipes/happly/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/happly/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/happly/all/test_v1_package/conanfile.py b/recipes/happly/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4b114846091e7 --- /dev/null +++ b/recipes/happly/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +import glob +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")) + # Let's check if the *.ply file has been created successfully + ply_format_file = glob.glob("*.ply")[0] + assert os.path.exists(ply_format_file) diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml index f28956a8ac497..0621f68bfe102 100644 --- a/recipes/harfbuzz/all/conandata.yml +++ b/recipes/harfbuzz/all/conandata.yml @@ -1,39 +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" "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 c31c4772cdf26..7904abea985f6 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 708b5d9734b00..0000000000000 --- 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 2957fc897516b..d5a1a8bf9dfc4 100644 --- a/recipes/harfbuzz/config.yml +++ b/recipes/harfbuzz/config.yml @@ -1,19 +1,17 @@ versions: - "7.3.0": - folder: all - "7.1.0": + "8.3.0": folder: all - "6.0.0": + "8.2.2": folder: all - "5.3.1": + "8.2.1": folder: all - "5.3.0": + "8.1.1": folder: all - "5.2.0": + "8.0.1": folder: all - "5.1.0": + "7.3.0": folder: all - "4.4.1": + "6.0.0": folder: all - "3.2.0": + "5.1.0": folder: all diff --git a/recipes/hayai/all/conandata.yml b/recipes/hayai/all/conandata.yml new file mode 100644 index 0000000000000..490eb3204ef39 --- /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 0000000000000..f9c7ed8eb904b --- /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 0000000000000..f2e12a251e0b8 --- /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 0000000000000..500852dd444f2 --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..32f9269a28efc --- /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 0000000000000..524a9c8112de1 --- /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 03a7693f717d9..132cdd0f76ad6 100644 --- a/recipes/hazelcast-cpp-client/all/conandata.yml +++ b/recipes/hazelcast-cpp-client/all/conandata.yml @@ -1,31 +1,18 @@ sources: + "5.3.0": + url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v5.3.0.tar.gz" + sha256: "5d38710d027b6311a479c2e4c42f9ac2a04c831a3eb673d4539a2221c8ff8015" "5.2.0": url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v5.2.0.tar.gz" sha256: "49afe765fe4e8ddf134ebf2862a698b8d0dd8dc724d4300e09e5bf7da9e4cbfb" "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 ccfd70e209aa3..b58eed49bb2fa 100644 --- a/recipes/hazelcast-cpp-client/all/conanfile.py +++ b/recipes/hazelcast-cpp-client/all/conanfile.py @@ -2,7 +2,6 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir -from conan.tools.scm import Version import os @@ -44,9 +43,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.79.0", transitive_headers=True, transitive_libs=True) + self.requires("boost/1.83.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"): @@ -58,8 +57,6 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["WITH_OPENSSL"] = self.options.with_openssl - if Version(self.version) <= "4.0.0": - tc.variables["BUILD_STATIC_LIB"] = not self.options.shared tc.generate() deps = CMakeDeps(self) @@ -84,6 +81,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 f5655c00c6f25..0000000000000 --- 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/all/test_package/test_package.cpp b/recipes/hazelcast-cpp-client/all/test_package/test_package.cpp index 485a5dcd244e1..1352f7b0b0a1b 100644 --- a/recipes/hazelcast-cpp-client/all/test_package/test_package.cpp +++ b/recipes/hazelcast-cpp-client/all/test_package/test_package.cpp @@ -1,12 +1,7 @@ #include +#include int main() { - hazelcast::client::client_config config; - config.get_connection_strategy_config().get_retry_config().set_cluster_connect_timeout(std::chrono::seconds(1)); - - try { - auto hz = hazelcast::new_client(std::move(config)).get(); - } catch (std::exception &e) { - } + std::cout << "Hazelcast version: " << hazelcast::client::version(); return EXIT_SUCCESS; } diff --git a/recipes/hazelcast-cpp-client/config.yml b/recipes/hazelcast-cpp-client/config.yml index cc9a79c74eb46..5dd47e8b5a4e0 100644 --- a/recipes/hazelcast-cpp-client/config.yml +++ b/recipes/hazelcast-cpp-client/config.yml @@ -1,15 +1,9 @@ versions: + "5.3.0": + folder: all "5.2.0": 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 217b9530b904d..0000000000000 --- 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 c28edc581baba..b92568111eedd 100644 --- a/recipes/hdf4/all/conandata.yml +++ b/recipes/hdf4/all/conandata.yml @@ -1,10 +1,13 @@ sources: + "4.2.16-2": + url: + - "https://hdf-wordpress-1.s3.amazonaws.com/wp-content/uploads/manual/HDF4/HDF4.2.16-2/src/hdf-4.2.16-2.tar.bz2" + - "https://support.hdfgroup.org/ftp/HDF/releases/HDF4.2.16-2/src/hdf-4.2.16-2.tar.bz2" + sha256: "c5c3234b5012258aef2e4432f649b31c21b26015afba1857ad83640c3f2b692c" "4.2.15": url: "https://support.hdfgroup.org/ftp/HDF/releases/HDF4.2.15/src/hdf-4.2.15.tar.gz" sha256: "dbeeef525af7c2d01539906c28953f0fdab7dba603d1bc1ec4a5af60d002c459" 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 2d8c7ea8622e4..daa7c6c3b6c69 100644 --- a/recipes/hdf4/all/conanfile.py +++ b/recipes/hdf4/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.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, save, move_folder_contents +from conan.tools.scm import Version + +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], @@ -28,17 +34,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": @@ -46,96 +43,131 @@ 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.12") + self.requires("zlib/[>=1.2.11 <2]") if self.options.jpegturbo: - self.requires("libjpeg-turbo/2.1.2") + self.requires("libjpeg-turbo/3.0.0") else: - self.requires("libjpeg/9d") + self.requires("libjpeg/9e") if self.options.szip_support == "with_libaec": self.requires("libaec/1.0.6") elif self.options.szip_support == "with_szip": self.requires("szip/2.1.1") 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) + if Version(self.version) > "4.2.15": + move_folder_contents(self, os.path.join(self.source_folder, f"hdf-{self.version}"), self.source_folder) + + 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 tools.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() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + 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) @@ -146,11 +178,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 a6de4b1271021..546a9e09d090d 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 612db2552bfca..7d51739a368b2 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 4efcf0be4d7a7..2e268465bf9bd 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 0000000000000..91630d79f4abb --- /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 0000000000000..2d700055b1faf --- /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/hdf4/config.yml b/recipes/hdf4/config.yml index 64a8c610990e2..da09b79435da4 100644 --- a/recipes/hdf4/config.yml +++ b/recipes/hdf4/config.yml @@ -1,3 +1,5 @@ versions: + "4.2.16-2": + folder: all "4.2.15": folder: all diff --git a/recipes/hdf5/all/conandata.yml b/recipes/hdf5/all/conandata.yml index dc660f8ec159b..c5d710eb6a95b 100644 --- a/recipes/hdf5/all/conandata.yml +++ b/recipes/hdf5/all/conandata.yml @@ -1,4 +1,13 @@ 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" "1.14.0": url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_14_0.tar.gz" sha256: "0f2ec13c1bf6e9f506fd03681c83a476d722e7479cad9ce6f8585a26c317d0ad" diff --git a/recipes/hdf5/all/conanfile.py b/recipes/hdf5/all/conanfile.py index e4e17863639bf..2f176fad53d61 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 6c8040e06da05..78000beb7c226 100644 --- a/recipes/hdf5/config.yml +++ b/recipes/hdf5/config.yml @@ -1,4 +1,10 @@ versions: + "1.14.3": + folder: all + "1.14.2": + folder: all + "1.14.1": + folder: all "1.14.0": folder: all "1.13.1": diff --git a/recipes/hdrhistogram-c/all/conandata.yml b/recipes/hdrhistogram-c/all/conandata.yml index ed9d533f37715..7332bd3995031 100644 --- a/recipes/hdrhistogram-c/all/conandata.yml +++ b/recipes/hdrhistogram-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.11.8": + url: "https://github.com/HdrHistogram/HdrHistogram_c/archive/0.11.8.tar.gz" + sha256: "bb95351a6a8b242dc9be1f28562761a84d4cf0a874ffc90a9b630770a6468e94" "0.11.6": url: "https://github.com/HdrHistogram/HdrHistogram_c/archive/0.11.6.tar.gz" sha256: "b9bb6425d9b0ac5424f6d2286a1295900edab0170d1f50767decb00196785de3" diff --git a/recipes/hdrhistogram-c/all/conanfile.py b/recipes/hdrhistogram-c/all/conanfile.py index dafe5ff3618bc..f9f345becdeab 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/hdrhistogram-c/config.yml b/recipes/hdrhistogram-c/config.yml index 7e06391938f78..9f7269d8ddea4 100644 --- a/recipes/hdrhistogram-c/config.yml +++ b/recipes/hdrhistogram-c/config.yml @@ -1,4 +1,6 @@ versions: + "0.11.8": + folder: all "0.11.6": folder: all "0.11.1": diff --git a/recipes/hedley/all/conanfile.py b/recipes/hedley/all/conanfile.py index 835a13a80a59b..b59e08a89ffbb 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 8b3b9ef203c08..0000000000000 --- 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 8ed6d6d348eaa..78aeef07d0a65 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 820c3b5030b0a..c5006ac155cfc 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 8aeb45bf1b421..0000000000000 --- 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 cf18c1281c79a..6b4c1055e308d 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 417bb10e807de..8d52b7021efe1 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 0000000000000..91630d79f4abb --- /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 0000000000000..0a70df7062409 --- /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 5c12183246809..e06c947a952fd 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 63e048eedc787..a5fdd1b12f317 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 b8be09b23ee81..daed63ba031a6 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 bea843560a088..c27ed0c7d9302 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 d120a992c06a6..0a6bc68712d90 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 31a17e5e32684..b21cc49efde95 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 60d31991f5141..4d32e3eeef7e4 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 0000000000000..0a77d0b0f3599 --- /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 0000000000000..7e609444e89da --- /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/6.0.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.3", transitive_headers=True) + self.requires("highfive/2.8.0", 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 0000000000000..969fb76fe7be1 --- /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 0000000000000..3bfefffc36b5c --- /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 0000000000000..bbe13ab6a3219 --- /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 0000000000000..ff35624c14df5 --- /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 b9befb53e74d3..edcf1ebb04b99 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 ebce29b0f3b16..0d48c634c34c5 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.3") 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 671f071b8ed9f..b21cc49efde95 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 546cbf2ce6f7b..28a0e4f7fb1d0 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 03938c9f3bdf9..72761292a635a 100644 --- a/recipes/highs/all/conandata.yml +++ b/recipes/highs/all/conandata.yml @@ -1,10 +1,7 @@ sources: - "1.4.2": - url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.4.2.tar.gz" - sha256: "29330e284491143cd53a547c23178221df46423679a98f6684251e65cc384d2b" -patches: - "1.4.2": - - patch_file: "patches/0001-missing-includes-msvc15-1.4.2.patch" - patch_description: "Add missing includes for std::tolower and std::max in MSVC15" - patch_type: portability - patch_source: "https://github.com/ERGO-Code/HiGHS/pull/1152" + "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 0873a3aeb59f0..0094aa110e305 100644 --- a/recipes/highs/all/conanfile.py +++ b/recipes/highs/all/conanfile.py @@ -1,12 +1,10 @@ +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.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 os.path import join +from conan.tools.files import copy, get, rmdir -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class HiGHSConan(ConanFile): @@ -16,6 +14,7 @@ class HiGHSConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.highs.dev/" topics = ("simplex", "interior point", "solver", "linear", "programming") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,16 +25,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) - - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -44,45 +33,46 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - def requirements(self): - self.requires("zlib/1.2.13") - def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): tc = CMakeToolchain(self) - tc.variables["SHARED"] = self.options.shared + tc.variables["FAST_BUILD"] = True tc.variables["BUILD_TESTING"] = False tc.variables["PYTHON"] = False tc.variables["FORTRAN"] = False tc.variables["CSHARP"] = False + tc.variables["EXP"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["JULIA"] = False tc.generate() - tc = CMakeDeps(self) - tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() - cmake.build(target="libhighs") + cmake.build() def package(self): - copy(self, pattern="LICENSE", src=self.source_folder, dst=join(self.package_folder, "licenses")) - copy(self, pattern="*.h", src=join(self.source_folder, "src"), dst=join(self.package_folder, "include")) - copy(self, pattern="HConfig.h", src=self.build_folder, dst=join(self.package_folder, "include")) - 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")) - 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) - fix_apple_shared_install_name(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, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.libs = collect_libs(self) + self.cpp_info.set_property("cmake_file_name", "highs") + self.cpp_info.set_property("cmake_target_name", "highs::highs") + self.cpp_info.set_property("pkg_config_name", "highs") + self.cpp_info.libs = ["highs"] + self.cpp_info.includedirs = [os.path.join("include", "highs")] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("m") - self.cpp_info.system_libs.append("pthread") - if is_msvc(self): - self.cpp_info.defines.append("_ITERATOR_DEBUG_LEVEL=0") + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/highs/all/patches/0001-missing-includes-msvc15-1.4.2.patch b/recipes/highs/all/patches/0001-missing-includes-msvc15-1.4.2.patch deleted file mode 100644 index 83c7f865fb734..0000000000000 --- a/recipes/highs/all/patches/0001-missing-includes-msvc15-1.4.2.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/extern/filereaderlp/reader.cpp b/extern/filereaderlp/reader.cpp -index 86151120..71f6747a 100644 ---- a/extern/filereaderlp/reader.cpp -+++ b/extern/filereaderlp/reader.cpp -@@ -2,6 +2,7 @@ - - #include "builder.hpp" - -+#include - #include - #include - #include -diff --git a/src/lp_data/HighsOptions.cpp b/src/lp_data/HighsOptions.cpp -index 903a7c71..6e66e78e 100644 ---- a/src/lp_data/HighsOptions.cpp -+++ b/src/lp_data/HighsOptions.cpp -@@ -17,6 +17,7 @@ - - #include - #include -+#include - - // void setLogOptions(); - -diff --git a/src/presolve/ICrash.cpp b/src/presolve/ICrash.cpp -index 12a6fc3f..e7bf86a4 100644 ---- a/src/presolve/ICrash.cpp -+++ b/src/presolve/ICrash.cpp -@@ -14,6 +14,7 @@ - #include "presolve/ICrash.h" - - #include -+#include - #include - #include - #include -diff --git a/src/util/HighsTimer.h b/src/util/HighsTimer.h -index 6f1d3047..cabef8c4 100644 ---- a/src/util/HighsTimer.h -+++ b/src/util/HighsTimer.h -@@ -16,6 +16,7 @@ - #ifndef UTIL_HIGHSTIMER_H_ - #define UTIL_HIGHSTIMER_H_ - -+#include - #include - #include - #include 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 36b48f96d1078..0000000000000 --- 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 ba127d382373b..f48a692b61e92 100644 --- a/recipes/highs/config.yml +++ b/recipes/highs/config.yml @@ -1,3 +1,5 @@ versions: - "1.4.2": + "1.6.0": + folder: all + "1.5.3": folder: all diff --git a/recipes/highway/all/conandata.yml b/recipes/highway/all/conandata.yml index ae12819eb44d8..710781f517c65 100644 --- a/recipes/highway/all/conandata.yml +++ b/recipes/highway/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "1.0.4": + url: "https://github.com/google/highway/archive/1.0.4.tar.gz" + sha256: "faccd343935c9e98afd1016e9d20e0b8b89d908508d1af958496f8c2d3004ac2" "1.0.3": url: "https://github.com/google/highway/archive/1.0.3.tar.gz" sha256: "566fc77315878473d9a6bd815f7de78c73734acdcb745c3dde8579560ac5440e" @@ -14,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 47b313cb31ecc..70b41b9d07eb4 100644 --- a/recipes/highway/all/conanfile.py +++ b/recipes/highway/all/conanfile.py @@ -12,18 +12,21 @@ class HighwayConan(ConanFile): name = "highway" description = "Performance-portable, length-agnostic SIMD with runtime dispatch" - topics = ("simd",) license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/highway" + topics = ("simd", "neon", "avx", "sse",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "with_test": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_test": False, } @property @@ -49,8 +52,11 @@ def config_options(self): def configure(self): if Version(self.version) < "0.16.0": del self.options.shared + 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") @@ -71,6 +77,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False tc.variables["HWY_ENABLE_EXAMPLES"] = False + tc.variables["HWY_ENABLE_TESTS"] = self.options.get_safe("with_test", False) tc.generate() def _patch_sources(self): @@ -93,6 +100,7 @@ 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")) def package_info(self): self.cpp_info.components["hwy"].set_property("pkg_config_name", "libhwy") @@ -105,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 e409cd92d3227..0000000000000 --- 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 aee3b37dc1e43..0000000000000 --- 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 08286722329d4..51114d87501db 100644 --- a/recipes/highway/config.yml +++ b/recipes/highway/config.yml @@ -1,4 +1,12 @@ versions: + "1.0.7": + folder: all + "1.0.6": + folder: all + "1.0.5": + folder: all + "1.0.4": + folder: all "1.0.3": folder: all "1.0.2": @@ -9,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/hippomocks/all/conanfile.py b/recipes/hippomocks/all/conanfile.py index 313e2b97cc5a4..8ecc6faeb6ba7 100755 --- a/recipes/hippomocks/all/conanfile.py +++ b/recipes/hippomocks/all/conanfile.py @@ -1,28 +1,54 @@ -from conans import ConanFile, ConanFile, tools -import os, glob +import os + +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 HippomocksConan(ConanFile): - name = 'hippomocks' - _libname = 'HippoMocks' - description = 'Single-header mocking framework.' - topics = ("conan", "hippomocks", "mock", "framework") + name = "hippomocks" + description = "Single-header mocking framework." + license = "LGPL-2.1" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/dascandy/hippomocks" - license = 'LGPL-2.1' + topics = ("mock", "framework", "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("%s-*" % (self.name))[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _libname(self): + return "HippoMocks" def package(self): - self.copy('LICENSE', dst='licenses', src=self._source_subfolder) - self.copy('*.h', dst=os.path.join('include', self._libname), src=os.path.join(self._source_subfolder, self._libname)) + 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._libname), + src=os.path.join(self.source_folder, self._libname)) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/hippomocks/all/test_package/CMakeLists.txt b/recipes/hippomocks/all/test_package/CMakeLists.txt index aff8268476df7..2e78c73ea8082 100755 --- a/recipes/hippomocks/all/test_package/CMakeLists.txt +++ b/recipes/hippomocks/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(hippomocks REQUIRED) +find_package(hippomocks REQUIRED CONFIG) add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE hippomocks::hippomocks) diff --git a/recipes/hippomocks/all/test_package/conanfile.py b/recipes/hippomocks/all/test_package/conanfile.py index e065617c053bc..ef5d7042163ec 100755 --- a/recipes/hippomocks/all/test_package/conanfile.py +++ b/recipes/hippomocks/all/test_package/conanfile.py @@ -1,16 +1,26 @@ -from conans import ConanFile, CMake, tools, RunEnvironment +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) cmake.configure() - cmake.build() + 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/hippomocks/all/test_package/main.cpp b/recipes/hippomocks/all/test_package/main.cpp old mode 100755 new mode 100644 diff --git a/recipes/hippomocks/all/test_v1_package/CMakeLists.txt b/recipes/hippomocks/all/test_v1_package/CMakeLists.txt new file mode 100755 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/hippomocks/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/hippomocks/all/test_v1_package/conanfile.py b/recipes/hippomocks/all/test_v1_package/conanfile.py new file mode 100755 index 0000000000000..121b7b9615044 --- /dev/null +++ b/recipes/hippomocks/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools, RunEnvironment +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/hiredis/all/conandata.yml b/recipes/hiredis/all/conandata.yml index 2063383701218..780975d1b5665 100644 --- a/recipes/hiredis/all/conandata.yml +++ b/recipes/hiredis/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/redis/hiredis/archive/v1.2.0.tar.gz" + sha256: "82ad632d31ee05da13b537c124f819eb88e18851d9cb0c30ae0552084811588c" "1.1.0": url: "https://github.com/redis/hiredis/archive/v1.1.0.tar.gz" sha256: "fe6d21741ec7f3fc9df409d921f47dfc73a4d8ff64f4ac6f1d95f951bf7f53d6" @@ -9,6 +12,10 @@ sources: url: "https://github.com/redis/hiredis/archive/v1.0.0.tar.gz" sha256: "2a0b5fe5119ec973a0c1966bfc4bd7ed39dbce1cb6d749064af9121fe971936f" patches: + "1.2.0": + - patch_file: "patches/0002-fix-aix.patch" + patch_description: "support AIX build" + patch_type: "portability" "1.1.0": - patch_file: "patches/0001-fix-cmake-1.1.0.patch" patch_description: "divide static/shared build, fix openssl link name" diff --git a/recipes/hiredis/all/conanfile.py b/recipes/hiredis/all/conanfile.py index 95c01b327b522..4973e6b1da136 100644 --- a/recipes/hiredis/all/conanfile.py +++ b/recipes/hiredis/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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, rm from conan.tools.scm import Version from conan.tools.microsoft import is_msvc import os @@ -53,6 +53,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + # Since 1.2.0, BUILD_SHARED_LIBS has been defined by option() + if Version(self.version) >= "1.2.0": + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared tc.variables["ENABLE_SSL"] = self.options.with_ssl tc.variables["DISABLE_TESTS"] = True tc.variables["ENABLE_EXAMPLES"] = False @@ -74,13 +77,14 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "build")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "hiredis") suffix = "" if Version(self.version) >= "1.1.0": - if is_msvc(self) and not self.options.shared: + if is_msvc(self) and not self.options.shared and Version(self.version) < "1.2.0": suffix += "_static" if self.settings.build_type == "Debug": suffix += "d" diff --git a/recipes/hiredis/config.yml b/recipes/hiredis/config.yml index b06a4f7517eb0..44921f335f1c8 100644 --- a/recipes/hiredis/config.yml +++ b/recipes/hiredis/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "1.0.2": diff --git a/recipes/hlslpp/all/conandata.yml b/recipes/hlslpp/all/conandata.yml index 41a6668e87c71..213b230fcc1d6 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 d8ccb3fef6db2..89394902b2939 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 199b902f23539..6f4aad719df58 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/conandata.yml b/recipes/homog2d/all/conandata.yml index 376b2a2d1feee..f297bf870a626 100644 --- a/recipes/homog2d/all/conandata.yml +++ b/recipes/homog2d/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.11": + url: "https://github.com/skramm/homog2d/archive/refs/tags/v2.11.tar.gz" + sha256: "469a557b87f3285170d84eb06d9b23c6b422f01b17eb753819bfc488d59bf83a" "2.10": url: "https://github.com/skramm/homog2d/archive/refs/tags/v2.10.tar.gz" sha256: "fb71f709d78c386188894b7f08a2c4690b45a5695b8d988e24efbe1216c53052" diff --git a/recipes/homog2d/all/conanfile.py b/recipes/homog2d/all/conanfile.py index 126a1b155e8d7..ba7c79a56f0f0 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/homog2d/config.yml b/recipes/homog2d/config.yml index 7772686420d4e..37be65648ed14 100644 --- a/recipes/homog2d/config.yml +++ b/recipes/homog2d/config.yml @@ -1,4 +1,6 @@ versions: + "2.11": + folder: all "2.10": folder: all "2.9": diff --git a/recipes/hunspell/all/CMakeLists.txt b/recipes/hunspell/all/CMakeLists.txt index b2bc98f40adab..8fb4e22ab52aa 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 6c8c08bc2e4b0..69ac32949f949 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 6c74ea78eaba7..914e9604ac575 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 0000000000000..71aa1cdafa6c8 --- /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 73177e055de6d..45217182fc8cf 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 a8c92dea63335..0a6bc68712d90 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 0000000000000..5d38c542b67a4 --- /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 0000000000000..a500b98343c74 --- /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 0f57b11de8fb0..cc37272dbe648 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 0000000000000..b5373423e2800 --- /dev/null +++ b/recipes/hwdata/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.378": + url: "https://github.com/vcrhonek/hwdata/archive/v0.378.tar.gz" + sha256: "098ea8db12a50290f4b23f7f521edf9c5bab25935d2740de17e4a487110b40c8" + "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 0000000000000..a8f5e3c5ad118 --- /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 0000000000000..0edcd74c5d4d6 --- /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 0000000000000..edc1993064ac3 --- /dev/null +++ b/recipes/hwdata/config.yml @@ -0,0 +1,7 @@ +versions: + "0.378": + folder: all + "0.376": + folder: all + "0.374": + folder: all diff --git a/recipes/hwloc/all/conandata.yml b/recipes/hwloc/all/conandata.yml new file mode 100644 index 0000000000000..c3a77f045e4ad --- /dev/null +++ b/recipes/hwloc/all/conandata.yml @@ -0,0 +1,19 @@ +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 + "2.9.1": + sha256: "a440e2299f7451dc10a57ddbfa3f116c2a6c4be1bb97c663edd3b9c7b3b3b4cf" + url: https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.1.tar.gz + "2.9.0": + sha256: "9d7d3450e0a5fea4cb80ca07dc8db939abb7ab62e2a7bb27f9376447658738ec" + url: https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.0.tar.gz + "2.8.0": + sha256: "20b2bd4df436827d8e50f7afeafb6f967259f2fb374ce7330244f8d0ed2dde6f" + url: https://download.open-mpi.org/release/hwloc/v2.8/hwloc-2.8.0.tar.gz + "2.7.2": + sha256: "407d2712b1c9026787461ddb62044fa9b5c6007755ca37652b360d837a75344f" + url: https://download.open-mpi.org/release/hwloc/v2.7/hwloc-2.7.2.tar.gz diff --git a/recipes/hwloc/all/conanfile.py b/recipes/hwloc/all/conanfile.py new file mode 100644 index 0000000000000..231701d41f587 --- /dev/null +++ b/recipes/hwloc/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +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 copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +import os + +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" + description = "Portable Hardware Locality (hwloc)" + topics = ("hardware", "topology") + license = "BSD-3-Clause" + homepage = "https://www.open-mpi.org/projects/hwloc/" + url = "https://github.com/conan-io/conan-center-index" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_libxml2": [True, False] + } + default_options = { + "with_libxml2": False + } + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def requirements(self): + if self.options.with_libxml2: + self.requires("libxml2/2.12.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def generate(self): + if self.settings.os == "Windows": + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.cache_variables["HWLOC_ENABLE_TESTING"] = 'OFF' + tc.cache_variables["HWLOC_SKIP_LSTOPO"] = 'ON' + tc.cache_variables["HWLOC_SKIP_TOOLS"] = 'ON' + 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"] = True + tc.cache_variables["HWLOC_WITH_LIBXML2"] = self.options.with_libxml2 + tc.generate() + else: + deps = PkgConfigDeps(self) + deps.generate() + tc = AutotoolsToolchain(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): + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join("contrib", "windows-cmake")) + cmake.build() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + # remove PDB files + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + else: + autotools = Autotools(self) + autotools.install() + fix_apple_shared_install_name(self) + # remove tools + rmdir(self, os.path.join(self.package_folder, "bin")) + + rmdir(self, 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")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "hwloc") + self.cpp_info.libs = ["hwloc"] + if is_apple_os(self): + self.cpp_info.frameworks = ['IOKit', 'Foundation', 'CoreFoundation'] diff --git a/recipes/hwloc/all/test_package/CMakeLists.txt b/recipes/hwloc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ea8c4a4511afc --- /dev/null +++ b/recipes/hwloc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(hwloc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE hwloc::hwloc) diff --git a/recipes/hwloc/all/test_package/conanfile.py b/recipes/hwloc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/hwloc/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/hwloc/all/test_package/test_package.c b/recipes/hwloc/all/test_package/test_package.c new file mode 100644 index 0000000000000..a8a04af2fe797 --- /dev/null +++ b/recipes/hwloc/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +int main(void) { + hwloc_topology_t topology; + + hwloc_topology_init(&topology); + hwloc_topology_destroy(topology); + + return 0; +} diff --git a/recipes/hwloc/config.yml b/recipes/hwloc/config.yml new file mode 100644 index 0000000000000..d1ef77599f89a --- /dev/null +++ b/recipes/hwloc/config.yml @@ -0,0 +1,13 @@ +versions: + "2.9.3": + folder: all + "2.9.2": + folder: all + "2.9.1": + folder: all + "2.9.0": + folder: all + "2.8.0": + folder: all + "2.7.2": + folder: all diff --git a/recipes/hyperscan/all/conandata.yml b/recipes/hyperscan/all/conandata.yml index b46d4ac06c616..e3925c18673ce 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 5e30dac82fb95..8ccc3f01da959 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 872966c197543..0000000000000 --- 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 0000000000000..ab66becd930f5 --- /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 0000000000000..87c26ae4533b6 --- /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 0000000000000..7c24368a9f0e1 --- /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 f5c91753bcba3..5e1749b052fcf 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 d02161efd202b..4915e863cdb5a 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 869b97a3d490e..544ea4beb37db 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 8e909fdb64156..5140938481408 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 2780f5433abb4..e5500f0ff4d7b 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 0000000000000..91630d79f4abb --- /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 0000000000000..2780f5433abb4 --- /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/icecream-cpp/all/conanfile.py b/recipes/icecream-cpp/all/conanfile.py index ad2f369b0f440..472b8f9d1ba62 100644 --- a/recipes/icecream-cpp/all/conanfile.py +++ b/recipes/icecream-cpp/all/conanfile.py @@ -1,42 +1,49 @@ -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 IcecreamcppConan(ConanFile): name = "icecream-cpp" + description = "A little library to help with the print debugging on C++11 and forward." license = "MIT" - homepage = "https://github.com/renatoGarcia/icecream-cpp" url = "https://github.com/conan-io/conan-center-index" - description = "A little library to help with the print debugging on C++11 and forward." - topics = ("debug", "single-header-lib", "print") - settings = "compiler" + homepage = "https://github.com/renatoGarcia/icecream-cpp" + topics = ("debug", "single-header-lib", "print", "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 validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration( - "icecream-cpp can't be used by {0} {1}".format( - self.settings.compiler, - self.settings.compiler.version - ) + f"icecream-cpp can't be used by {self.settings.compiler} {self.settings.compiler.version}" ) - def package_id(self): - self.info.header_only() - 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.txt", dst="licenses", src=self._source_subfolder) - self.copy("icecream.hpp", dst="include", src=self._source_subfolder) + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "icecream.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/icecream-cpp/all/test_package/CMakeLists.txt b/recipes/icecream-cpp/all/test_package/CMakeLists.txt index 6aab347eddf53..5b9d4de6b2558 100644 --- a/recipes/icecream-cpp/all/test_package/CMakeLists.txt +++ b/recipes/icecream-cpp/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(icecream-cpp REQUIRED CONFIG) add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example PRIVATE icecream-cpp::icecream-cpp) set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/icecream-cpp/all/test_package/conanfile.py b/recipes/icecream-cpp/all/test_package/conanfile.py index 186ee2682166d..e0f447388fa1b 100644 --- a/recipes/icecream-cpp/all/test_package/conanfile.py +++ b/recipes/icecream-cpp/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 IcecreamcppTestConan(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", "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/iceoryx/all/CMakeLists.txt b/recipes/iceoryx/all/CMakeLists.txt index ae4d7a261b19e..eb44e488fa5bd 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 638b5224b83e0..478d85f83e606 100644 --- a/recipes/iceoryx/all/conandata.yml +++ b/recipes/iceoryx/all/conandata.yml @@ -1,40 +1,15 @@ sources: - "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" + "2.0.5": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.5.tar.gz" + sha256: "bf6de70e3edee71223f993a29bff5e61af95ce4871104929d8bd1729f544bafb" + "2.0.3": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.3.tar.gz" + sha256: "8f391696daf2e63da9437aab8d7154371df630fc93876479f2e84c693fc1ba5a" + "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 c14f7ee13f243..30d23ca370fb4 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,133 @@ 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) + apply_conandata_patches(self) + if Version(self.version) >= "2.0.0": + hoofs_dir = os.path.join(self.source_folder, "iceoryx_hoofs") + else: + hoofs_dir = os.path.join(self.source_folder, "iceoryx_utils") + + # Use acl::acl target, since plain acl fails to link + replace_in_file(self, os.path.join(hoofs_dir, "CMakeLists.txt"), " acl", " acl::acl") + # 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 + if Version(self.version) >= "2.90": + replace_in_file(self, os.path.join(self.source_folder, "iceoryx_hoofs", "cmake", "IceoryxPackageHelper.cmake"), + "set_target_properties( ${IOX_TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON )", "") + else: + cmakelists_list = [ + os.path.join(self.source_folder, "iceoryx_dds", "CMakeLists.txt"), + os.path.join(self.source_folder, "iceoryx_posh", "CMakeLists.txt"), + os.path.join(self.source_folder, "tools", "introspection", "CMakeLists.txt"), + os.path.join(hoofs_dir, "CMakeLists.txt"), + ] + if Version(self.version) >= "2.0.0": + cmakelists_list += [ + os.path.join(self.source_folder, "iceoryx_binding_c", "CMakeLists.txt"), + os.path.join(hoofs_dir, "platform", "CMakeLists.txt"), + ] + for cmakelists in cmakelists_list: + replace_in_file(self, cmakelists, "POSITION_INDEPENDENT_CODE ON", "") 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 +177,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 +194,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 +305,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 062232389f69a..d7d0a656f692e 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 fe7e89524991f..0000000000000 --- 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 4d89e84377074..1ebb72134038c 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 50e21d11f1ebd..49365cc526d27 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 0000000000000..91630d79f4abb --- /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 0000000000000..50e21d11f1ebd --- /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 bb084f4416dd3..8a33c3c252222 100644 --- a/recipes/iceoryx/config.yml +++ b/recipes/iceoryx/config.yml @@ -1,11 +1,7 @@ versions: - "2.0.2": + "2.0.5": folder: all - "2.0.1": + "2.0.3": folder: all - "2.0.0": - folder: all - "1.0.1": - 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 0000000000000..9cba4ae5061fd --- /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 0000000000000..5541ed9fd754d --- /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 0000000000000..edfa602f53039 --- /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 0000000000000..a2ac5bf6805ee --- /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 0000000000000..99ac9eb113bd7 --- /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 0000000000000..4c1b72279193a --- /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 bebf278b61b51..8f6d4963890d2 100644 --- a/recipes/icu/all/conandata.yml +++ b/recipes/icu/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "74.2": + url: "https://github.com/unicode-org/icu/releases/download/release-74-2/icu4c-74_2-src-FIXED.tgz" + sha256: "68db082212a96d6f53e35d60f47d38b962e9f9d207a74cfac78029ae8ff5e08c" + "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" "73.1": url: "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz" sha256: "a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45" @@ -18,6 +27,12 @@ sources: url: "https://github.com/unicode-org/icu/releases/download/release-68-2/icu4c-68_2-src.tgz" sha256: "c79193dee3907a2199b8296a93b52c5cb74332c26f3d167269487680d479d625" patches: + "74.2": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + "74.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + "73.2": + - patch_file: "patches/0001-69.1-fix-mingw.patch" "73.1": - patch_file: "patches/0001-69.1-fix-mingw.patch" "72.1": diff --git a/recipes/icu/all/conanfile.py b/recipes/icu/all/conanfile.py index 26611e98022e6..9e343976b416b 100644 --- a/recipes/icu/all/conanfile.py +++ b/recipes/icu/all/conanfile.py @@ -24,7 +24,7 @@ class ICUConan(ConanFile): description = "ICU is a mature, widely used set of C/C++ and Java libraries " \ "providing Unicode and Globalization support for software applications." url = "https://github.com/conan-io/conan-center-index" - topics = ("icu", "icu4c", "i see you", "unicode") + topics = ("icu4c", "i see you", "unicode") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -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/all/patches/6aba9344a18f4f32e8070ee53b79495630901c26.patch b/recipes/icu/all/patches/6aba9344a18f4f32e8070ee53b79495630901c26.patch deleted file mode 100644 index 05ecec5cd8005..0000000000000 --- a/recipes/icu/all/patches/6aba9344a18f4f32e8070ee53b79495630901c26.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 6aba9344a18f4f32e8070ee53b79495630901c26 Mon Sep 17 00:00:00 2001 -From: "Shane F. Carr" -Date: Fri, 24 Apr 2020 19:23:40 -0500 -Subject: [PATCH] ICU-21081 Make U_ASSERT C++14 compatible - ---- - source/common/uassert.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/source/common/uassert.h b/source/common/uassert.h -index 15cd55c8734..afd31eeffd9 100644 ---- a/source/common/uassert.h -+++ b/source/common/uassert.h -@@ -32,7 +32,7 @@ - # include - # define U_ASSERT(exp) assert(exp) - #elif U_CPLUSPLUS_VERSION --# define U_ASSERT(exp) void() -+# define U_ASSERT(exp) (void)0 - #else - # define U_ASSERT(exp) - #endif diff --git a/recipes/icu/config.yml b/recipes/icu/config.yml index 14241e230efc1..bd6c5fcac524c 100644 --- a/recipes/icu/config.yml +++ b/recipes/icu/config.yml @@ -1,4 +1,10 @@ versions: + "74.2": + folder: all + "74.1": + folder: all + "73.2": + folder: all "73.1": folder: all "72.1": diff --git a/recipes/id3v2lib/all/conandata.yml b/recipes/id3v2lib/all/conandata.yml new file mode 100644 index 0000000000000..c6353a726bee8 --- /dev/null +++ b/recipes/id3v2lib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1": + url: "https://github.com/larsbs/id3v2lib/archive/refs/tags/2.1.tar.gz" + sha256: "c91d185e227254d800617f18bee53181f126cb654bfee6041ed9c04172cea95a" diff --git a/recipes/id3v2lib/all/conanfile.py b/recipes/id3v2lib/all/conanfile.py new file mode 100644 index 0000000000000..d920c95d34bde --- /dev/null +++ b/recipes/id3v2lib/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class Id3v2libConan(ConanFile): + name = "id3v2lib" + description = "id3v2lib is a library written in C to read and edit id3 tags from mp3 files." + topics = ("conan", "id3", "tags", "mp3", "container", "media", "audio") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/larsbs/id3v2lib" + license = "BSD-2-Clause" + package_type = "library" + + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + } + + def validate(self): + # An issue has been opened to discuss supporting MSVC: + # https://github.com/larsbs/id3v2lib/issues/48 + if is_msvc(self): + raise ConanInvalidConfiguration("id3v2lib does not support Visual Studio.") + + 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): + 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 build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + 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", "id3v2lib") + self.cpp_info.set_property("cmake_target_name", "id3v2lib::id3v2lib") + self.cpp_info.set_property("pkg_config_name", "id3v2lib") + self.cpp_info.libs = ["id3v2lib"] diff --git a/recipes/id3v2lib/all/test_package/CMakeLists.txt b/recipes/id3v2lib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4ba735415e377 --- /dev/null +++ b/recipes/id3v2lib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(id3v2lib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE id3v2lib::id3v2lib) diff --git a/recipes/id3v2lib/all/test_package/conanfile.py b/recipes/id3v2lib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/id3v2lib/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/id3v2lib/all/test_package/test_package.c b/recipes/id3v2lib/all/test_package/test_package.c new file mode 100644 index 0000000000000..cc17067652458 --- /dev/null +++ b/recipes/id3v2lib/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +int main(void) { + ID3v2_Tag *tag = ID3v2_Tag_new_empty(); + ID3v2_Tag_set_title(tag, "Amazing Song!"); + + ID3v2_TextFrame *title_frame = ID3v2_Tag_get_title_frame(tag); + printf("Track title: %s\n", title_frame->data->text); + + ID3v2_Tag_free(tag); + return 0; +} diff --git a/recipes/id3v2lib/config.yml b/recipes/id3v2lib/config.yml new file mode 100644 index 0000000000000..adf6918baab9c --- /dev/null +++ b/recipes/id3v2lib/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1": + folder: all diff --git a/recipes/ignition-cmake/all/CMakeLists.txt b/recipes/ignition-cmake/all/CMakeLists.txt deleted file mode 100644 index 8d6da516c42c7..0000000000000 --- 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 91e85702d37b5..ccb98d28636f3 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 f09f2bd8badbc..90598402ac8d1 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 9595663869a7f..de43752ed5575 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 5b49fe0a15144..708eb36d16238 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 e050db890afd7..3934b5db47f4a 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 0000000000000..91630d79f4abb --- /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 0000000000000..8f851887ec419 --- /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 74423119b2602..66b814aa4851f 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 434aea21733de..0000000000000 --- 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 4c28973c33e6b..338c8a935d27e 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 a8994d4c2ba67..e756a56a2d548 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 15d229320021c..ba0d23b2326bb 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 156e2a8976e7c..0d267f1fe3b58 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 0000000000000..91630d79f4abb --- /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 0000000000000..923bd771c14e7 --- /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 e9b2090bb9e33..36a5068b003f9 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 5e4171b55257f..490f157a75b1f 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 4251d2cffa421..9f73275ca1219 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 28e3ee22ca8ac..1c656ce0b375f 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/imath/all/conandata.yml b/recipes/imath/all/conandata.yml index bebaaa4063645..184bb3afe6a05 100644 --- a/recipes/imath/all/conandata.yml +++ b/recipes/imath/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.1.9": + url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.9.tar.gz" + sha256: "f1d8aacd46afed958babfced3190d2d3c8209b66da451f556abd6da94c165cf3" + "3.1.8": + url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.8.tar.gz" + sha256: "a23a4e2160ca8ff68607a4e129e484edd1d0d13f707394d32af7aed659020803" "3.1.7": url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.7.tar.gz" sha256: "bff1fa140f4af0e7f02c6cb78d41b9a7d5508e6bcdfda3a583e35460eb6d4b47" diff --git a/recipes/imath/config.yml b/recipes/imath/config.yml index a8c8ad2b073d1..e9bdf1c39b31e 100644 --- a/recipes/imath/config.yml +++ b/recipes/imath/config.yml @@ -1,4 +1,8 @@ versions: + "3.1.9": + folder: all + "3.1.8": + folder: all "3.1.7": folder: all "3.1.6": diff --git a/recipes/imgui/all/CMakeLists.txt b/recipes/imgui/all/CMakeLists.txt index 8c9bf128442ff..0626bf7008e52 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) @@ -15,6 +16,7 @@ endif() set(BINARY_TO_COMPRESSED_BIN binary_to_compressed_c) add_executable(${BINARY_TO_COMPRESSED_BIN} ${EXTRA_FONTS_DIR}/binary_to_compressed_c.cpp) +target_compile_features(${BINARY_TO_COMPRESSED_BIN} PRIVATE cxx_std_11) add_library(${PROJECT_NAME} ${SOURCE_FILES}) set_target_properties(${PROJECT_NAME} PROPERTIES diff --git a/recipes/imgui/all/conandata.yml b/recipes/imgui/all/conandata.yml index 1eb68f99063db..5a380f8aab078 100644 --- a/recipes/imgui/all/conandata.yml +++ b/recipes/imgui/all/conandata.yml @@ -1,4 +1,31 @@ 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" + "1.89.7-docking": + url: "https://github.com/ocornut/imgui/archive/v1.89.7-docking.tar.gz" + sha256: "28216ec07e87f075b63486d8d5212e4d89542b69bd10a482f1b4b7dc6f1613a0" + "1.89.5": + url: "https://github.com/ocornut/imgui/archive/v1.89.5.tar.gz" + sha256: "eab371005c86dd029523a0c4ba757840787163740d45c1f4e5a110eb21820546" "1.89.4": url: "https://github.com/ocornut/imgui/archive/v1.89.4.tar.gz" sha256: "69f1e83adcab3fdd27b522f5075f407361b0d3875e3522b13d33bc2ae2c7d48c" diff --git a/recipes/imgui/all/conanfile.py b/recipes/imgui/all/conanfile.py index c2583929a0dfa..ffe8b2248047c 100644 --- a/recipes/imgui/all/conanfile.py +++ b/recipes/imgui/all/conanfile.py @@ -1,12 +1,13 @@ from conan import ConanFile from conan.tools.files import get, copy, replace_in_file from conan.tools.scm import Version -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os import re required_conan_version = ">=1.53.0" + class IMGUIConan(ConanFile): name = "imgui" description = "Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies" @@ -14,6 +15,7 @@ class IMGUIConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ocornut/imgui" topics = ("gui", "graphical", "bloat-free") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -61,9 +63,12 @@ def build(self): cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() + def _match_docking_branch(self): + return re.match(r'cci\.\d{8}\+(?P\d+\.\d+(?:\.\d+))\.docking', str(self.version)) + def package(self): copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - m = re.match(r'cci\.\d{8}\+(?P\d+\.\d+)\.docking', str(self.version)) + m = self._match_docking_branch() version = Version(m.group('version')) if m else Version(self.version) backends_folder = os.path.join( self.source_folder, @@ -72,10 +77,21 @@ 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() def package_info(self): + self.conf_info.define("user.imgui:with_docking", bool(self._match_docking_branch())) + self.cpp_info.libs = ["imgui"] if self.settings.os == "Linux": self.cpp_info.system_libs.append("m") diff --git a/recipes/imgui/all/test_package/CMakeLists.txt b/recipes/imgui/all/test_package/CMakeLists.txt index 3e9ea943d420e..e5abc72962c86 100644 --- a/recipes/imgui/all/test_package/CMakeLists.txt +++ b/recipes/imgui/all/test_package/CMakeLists.txt @@ -5,8 +5,12 @@ find_package(imgui REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE imgui::imgui) + +option(DOCKING "Test docking" OFF) + if (DOCKING) target_compile_definitions(${PROJECT_NAME} PRIVATE -DDOCKING) endif() + target_compile_definitions(${PROJECT_NAME} PUBLIC "IMGUI_USER_CONFIG=\"${CMAKE_CURRENT_SOURCE_DIR}/my_imgui_config.h\"") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/imgui/all/test_package/conanfile.py b/recipes/imgui/all/test_package/conanfile.py index a9fb96656f203..b97c0a2e4d75c 100644 --- a/recipes/imgui/all/test_package/conanfile.py +++ b/recipes/imgui/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_layout, CMake +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain import os +import re class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def requirements(self): @@ -15,6 +16,12 @@ def requirements(self): def layout(self): cmake_layout(self) + def generate(self): + with_docking = self.dependencies[self.tested_reference_str].conf_info.get("user.imgui:with_docking", False) + tc = CMakeToolchain(self) + tc.variables["DOCKING"] = with_docking + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/imgui/all/test_package/test_package.cpp b/recipes/imgui/all/test_package/test_package.cpp index 6a0a221db872e..37c38430fa7a8 100644 --- a/recipes/imgui/all/test_package/test_package.cpp +++ b/recipes/imgui/all/test_package/test_package.cpp @@ -7,43 +7,11 @@ int main(int, char**) { - ImGuiContext* context =ImGui::CreateContext(); - ImGuiIO& io = ImGui::GetIO(); - - ImGuiTextBuffer textBuffer; - textBuffer.append("Hello, ImGui"); - - // Build atlas - unsigned char* tex_pixels = NULL; - int tex_w, tex_h; - io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h); - - for (int n = 0; n < 50; n++) - { - printf("NewFrame() %d\n", n); - io.DisplaySize = ImVec2(1920, 1080); - io.DeltaTime = 1.0f / 60.0f; - ImGui::NewFrame(); - + printf("IMGUI VERSION: %s\n", IMGUI_VERSION); + ImGui::CreateContext(); #ifdef DOCKING - auto dockspaceID = ImGui::GetID("MyDockSpace"); - static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_None; - ImGui::DockSpace(dockspaceID, ImVec2(0.0f, 0.0f), dockspace_flags); - printf(" with docking\n"); + printf(" with docking\n"); #endif - - static float f = 0.0f; - ImGui::Text("Hello, world!"); - ImGui::Text("%s", textBuffer.begin()); - ImGui::SliderFloat("float", &f, 0.0f, 1.0f); - ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); - ImGui::MyFunction("test_package"); // ensure we are using our provided IMGUI_USER_CONFIG - ImGui::ShowDemoWindow(NULL); - - ImGui::Render(); - } - - printf("DestroyContext()\n"); - ImGui::DestroyContext(context); + ImGui::DestroyContext(); return 0; } diff --git a/recipes/imgui/all/test_v1_package/conanfile.py b/recipes/imgui/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/imgui/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/imgui/config.yml b/recipes/imgui/config.yml index ce92302f4a251..8714c2dcec41f 100644 --- a/recipes/imgui/config.yml +++ b/recipes/imgui/config.yml @@ -1,4 +1,22 @@ 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": + folder: all + "1.89.5": + folder: all "1.89.4": folder: all "1.89.3": diff --git a/recipes/imguizmo/all/CMakeLists.txt b/recipes/imguizmo/all/CMakeLists.txt index 73784d828761a..00a03f5032972 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 62c65e6489c8b..57281934555cf 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 4db4d9b97252b..bca22087e3920 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 23ba95e79f465..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..6c9d5dba712c7 --- /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 811b858690dba..dcc9095290082 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 952501519b554..dadfcc5005ec6 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 870b269d2d660..3e9a18f3dcd2f 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 0242d96a644ca..ef5d7042163ec 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 3778564a31082..0000000000000 --- 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 0000000000000..78e26ad5b37e6 --- /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 0000000000000..91630d79f4abb --- /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 0000000000000..90eb89e3f2f46 --- /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 9e53a8732b403..249b90e4014ba 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 ec869caed9029..8f2c9651b41e6 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 21af4dfe87312..5aa143a53a498 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 ce2e069d3196d..0f83131c24116 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 945aea8b2724f..e39ff9333e1cc 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 925ecbe19e448..8d8cf1572027f 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 d62abd0d999a8..60016fd219bda 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 f6e8787dbdea2..d9f313c9e9b84 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 2e27608fee20f..446fadbc04892 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 e0917bf5ba07b..fa47f76cede99 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/indirect_value/all/conanfile.py b/recipes/indirect_value/all/conanfile.py index ce84972958e04..7ef5edf99c73d 100644 --- a/recipes/indirect_value/all/conanfile.py +++ b/recipes/indirect_value/all/conanfile.py @@ -1,24 +1,27 @@ -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 IndirectValueConan(ConanFile): name = "indirect_value" - homepage = "https://github.com/jbcoe/indirect_value" description = "Production-quality reference implementation of P1950: A Free-Store-Allocated Value Type For C++" - topics = ("std", "vocabulary-type", "value-semantics") license = "MIT" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jbcoe/indirect_value" + topics = ("std", "vocabulary-type", "value-semantics", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _minimum_cpp_standard(self): return 17 @@ -29,40 +32,45 @@ def _minimum_compilers_version(self): "Visual Studio": "16", "gcc": "8", "clang": "8", - "apple-clang": "11" + "apple-clang": "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"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get( - str(self.settings.compiler)) + 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 " + f"{self.settings.compiler} compiler support.") else: - if tools.Version(self.settings.compiler.version) < min_version: + if 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)) - - def package_id(self): - self.info.header_only() + 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], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="indirect_value.*", dst="include", - src=self._source_subfolder) - self.copy("*LICENSE*", dst="licenses", keep_path=False) + copy(self, "indirect_value.*", + 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, + keep_path=False) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "indirect_value") self.cpp_info.set_property("cmake_target_name", "indirect_value::indirect_value") diff --git a/recipes/indirect_value/all/test_package/CMakeLists.txt b/recipes/indirect_value/all/test_package/CMakeLists.txt index fd68256049f87..e44109c29e389 100644 --- a/recipes/indirect_value/all/test_package/CMakeLists.txt +++ b/recipes/indirect_value/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(indirect_value REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/indirect_value/all/test_package/conanfile.py b/recipes/indirect_value/all/test_package/conanfile.py index 9b63bd176646b..fae501d0afb9e 100644 --- a/recipes/indirect_value/all/test_package/conanfile.py +++ b/recipes/indirect_value/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,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/indirect_value/all/test_v1_package/CMakeLists.txt b/recipes/indirect_value/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/indirect_value/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/indirect_value/all/test_v1_package/conanfile.py b/recipes/indirect_value/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9b63bd176646b --- /dev/null +++ b/recipes/indirect_value/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/influxdb-cpp/all/conanfile.py b/recipes/influxdb-cpp/all/conanfile.py index fa5b1610b16b3..c4120819ef945 100644 --- a/recipes/influxdb-cpp/all/conanfile.py +++ b/recipes/influxdb-cpp/all/conanfile.py @@ -1,33 +1,48 @@ import os -from conans import ConanFile, tools -import glob +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 InfluxDBCppConan(ConanFile): name = "influxdb-cpp" + description = "C++ client for InfluxDB." license = "MIT" - homepage = "https://github.com/orca-zhang/influxdb-cpp" url = "https://github.com/conan-io/conan-center-index" - description = "C++ client for InfluxDB." - topics = ("single-header-lib", "influxdb") - settings = "os" + homepage = "https://github.com/orca-zhang/influxdb-cpp" + topics = ("single-header-lib", "influxdb", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _source_subfolder = "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + @property + def _min_cppstd(self): + return 11 + + 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("influxdb-cpp-*")[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('influxdb.hpp', dst='include', src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "influxdb.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 = [] if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] - - def package_id(self): - self.info.header_only() diff --git a/recipes/influxdb-cpp/all/test_package/CMakeLists.txt b/recipes/influxdb-cpp/all/test_package/CMakeLists.txt index 6aab347eddf53..8aaa0b611508b 100644 --- a/recipes/influxdb-cpp/all/test_package/CMakeLists.txt +++ b/recipes/influxdb-cpp/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(influxdb-cpp REQUIRED CONFIG) -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) -set_property(TARGET example PROPERTY CXX_STANDARD 11) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE influxdb-cpp::influxdb-cpp) +set_property(TARGET test_package PROPERTY CXX_STANDARD 11) diff --git a/recipes/influxdb-cpp/all/test_package/conanfile.py b/recipes/influxdb-cpp/all/test_package/conanfile.py index 17295afcb8561..fae501d0afb9e 100644 --- a/recipes/influxdb-cpp/all/test_package/conanfile.py +++ b/recipes/influxdb-cpp/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 InfluxDBCppTestConan(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", "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/influxdb-cpp/all/test_package/example.cpp b/recipes/influxdb-cpp/all/test_package/test_package.cpp similarity index 100% rename from recipes/influxdb-cpp/all/test_package/example.cpp rename to recipes/influxdb-cpp/all/test_package/test_package.cpp diff --git a/recipes/influxdb-cpp/all/test_v1_package/CMakeLists.txt b/recipes/influxdb-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/influxdb-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/influxdb-cpp/all/test_v1_package/conanfile.py b/recipes/influxdb-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49bc2bd787325 --- /dev/null +++ b/recipes/influxdb-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class InfluxDBCppTestConan(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/inih/all/conandata.yml b/recipes/inih/all/conandata.yml index f45a313d7e7e2..d0684466616d8 100644 --- a/recipes/inih/all/conandata.yml +++ b/recipes/inih/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "57": + url: "https://github.com/benhoyt/inih/archive/r57.tar.gz" + sha256: "f03f98ca35c3adb56b2358573c8d3eda319ccd5287243d691e724b7eafa970b3" "56": url: "https://github.com/benhoyt/inih/archive/r56.tar.gz" sha256: "4f2ba6bd122d30281a8c7a4d5723b7af90b56aa828c0e88256d7fceda03a491a" diff --git a/recipes/inih/all/conanfile.py b/recipes/inih/all/conanfile.py index d2890dd500498..559726ced856f 100644 --- a/recipes/inih/all/conanfile.py +++ b/recipes/inih/all/conanfile.py @@ -3,9 +3,11 @@ 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.build import check_min_cppstd 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 required_conan_version = ">=1.53.0" @@ -24,12 +26,18 @@ class InihConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_inireader": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_inireader": True, } + @property + def _min_cppstd(self): + return 11 + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -37,18 +45,24 @@ def config_options(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") + # INIReader is written in C++ + if not self.options.with_inireader: + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def layout(self): basic_layout(self, src_folder="src") def validate(self): + # since 57, INIReader requires C++11 + if Version(self.version) >= "57" and self.options.with_inireader and \ + self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) if self.options.shared and is_msvc(self): raise ConanInvalidConfiguration("Shared inih is not supported with msvc") 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) @@ -58,7 +72,10 @@ def generate(self): env.generate() tc = MesonToolchain(self) tc.project_options["distro_install"] = True - tc.project_options["with_INIReader"] = True + tc.project_options["with_INIReader"] = self.options.with_inireader + # since 57, INIReader requires C++11 + if Version(self.version) >= "57" and not is_msvc(self): + tc.cpp_args.append("-std=c++11") tc.generate() def build(self): @@ -80,9 +97,10 @@ def package_info(self): self.cpp_info.components["libinih"].set_property("pkg_config_name", "inih") self.cpp_info.components["libinih"].libs = ["inih"] - self.cpp_info.components["inireader"].set_property("pkg_config_name", "INIReader") - self.cpp_info.components["inireader"].libs = ["INIReader"] - self.cpp_info.components["inireader"].requires = ["libinih"] + if self.options.with_inireader: + self.cpp_info.components["inireader"].set_property("pkg_config_name", "INIReader") + self.cpp_info.components["inireader"].libs = ["INIReader"] + self.cpp_info.components["inireader"].requires = ["libinih"] def fix_msvc_libname(conanfile, remove_lib_prefix=True): """remove lib prefix & change extension to .lib in case of cl like compiler""" diff --git a/recipes/inih/config.yml b/recipes/inih/config.yml index 3746836949531..c64487db679f8 100644 --- a/recipes/inih/config.yml +++ b/recipes/inih/config.yml @@ -1,4 +1,6 @@ versions: + "57": + folder: "all" "56": folder: "all" "55": diff --git a/recipes/inja/all/conanfile.py b/recipes/inja/all/conanfile.py index e211c74ba199b..e6c08750f5681 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 d120a992c06a6..0a6bc68712d90 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 a50107175e466..9d152bb546968 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 0f78273600853..b21cc49efde95 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 5493d58611803..1bf1c7e26255d 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 0000000000000..82ca4023ed3e5 --- /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 0000000000000..fcbc0174dcfbb --- /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 0000000000000..460d6198ba06f --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..e9521bde28299 --- /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 0000000000000..9652e22fc19d5 --- /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/intx/all/test_v1_package/conanfile.py b/recipes/intx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/intx/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/intx/config.yml b/recipes/intx/config.yml new file mode 100644 index 0000000000000..36cf695df0df6 --- /dev/null +++ b/recipes/intx/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.1": + folder: all diff --git a/recipes/inversify-cpp/all/conanfile.py b/recipes/inversify-cpp/all/conanfile.py index 3d897954ee020..cbe49e9425718 100644 --- a/recipes/inversify-cpp/all/conanfile.py +++ b/recipes/inversify-cpp/all/conanfile.py @@ -1,20 +1,31 @@ -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 InversifyCppConan(ConanFile): name = "inversify-cpp" description = "C++17 inversion of control and dependency injection container library" - topics = ("ioc", "container", "dependency", "injection") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mosure/inversify-cpp" - license = "MIT" - settings = "compiler" + topics = ("ioc", "container", "dependency", "injection", "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 { @@ -24,27 +35,36 @@ def _compilers_minimum_version(self): "apple-clang": "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"): - 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 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("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) - - @property - def _source_subfolder(self): - return "source_subfolder" + self.output.warning(f"{self.name} requires C++{self._min_cppstd}. " + f"Your compiler is unknown. Assuming it supports C++{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 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", + 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/inversify-cpp/all/test_package/CMakeLists.txt b/recipes/inversify-cpp/all/test_package/CMakeLists.txt index fc7a3028bf1a1..98d70570dc70a 100644 --- a/recipes/inversify-cpp/all/test_package/CMakeLists.txt +++ b/recipes/inversify-cpp/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(inversify-cpp CONFIG REQUIRED) +find_package(inversify-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} inversify-cpp::inversify-cpp) diff --git a/recipes/inversify-cpp/all/test_package/conanfile.py b/recipes/inversify-cpp/all/test_package/conanfile.py index 49a3a66ea5bad..fae501d0afb9e 100644 --- a/recipes/inversify-cpp/all/test_package/conanfile.py +++ b/recipes/inversify-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", "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/inversify-cpp/all/test_package/test_package.cpp b/recipes/inversify-cpp/all/test_package/test_package.cpp index 3bf0d0cfb88a1..4f9ae5cdc6296 100644 --- a/recipes/inversify-cpp/all/test_package/test_package.cpp +++ b/recipes/inversify-cpp/all/test_package/test_package.cpp @@ -2,21 +2,17 @@ #include "mosure/inversify.hpp" - namespace inversify = mosure::inversify; namespace symbols { - using foo = inversify::Symbol; +using foo = inversify::Symbol; } - int main() { - inversify::Container< - symbols::foo - > container; + inversify::Container container; container.bind().toConstantValue(true); - std::cout <<"working: " << container.get() << std::endl; + std::cout << "working: " << container.get() << std::endl; return 0; } diff --git a/recipes/inversify-cpp/all/test_v1_package/CMakeLists.txt b/recipes/inversify-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/inversify-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/inversify-cpp/all/test_v1_package/conanfile.py b/recipes/inversify-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/inversify-cpp/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/iowow/all/conandata.yml b/recipes/iowow/all/conandata.yml new file mode 100644 index 0000000000000..3dc81fcb10588 --- /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 0000000000000..5a4fade27f4f6 --- /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 0000000000000..0a42af275a2ee --- /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 0000000000000..82d76f00b56a7 --- /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 0000000000000..9e0ebfd3d59d1 --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..2ee836be4e2af --- /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 0000000000000..764e66b7855a6 --- /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 04c167a387fc1..6b7355d415953 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 1f64617c87676..5fed7c16effcf 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 094a38e418f47..5401493431040 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 02bdaace3b783..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..54e4743603cf3 --- /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 56f45edf048a4..09af37c4cc900 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 196188113685c..9e88b9de0b709 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 e1f2192537436..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..9d2678d8486a0 --- /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 7ae2d73951a0d..0000000000000 --- 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 0000000000000..1583596ab7878 --- /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 3cb9b81826a59..9e7f86e6f5246 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 3c833fb68b446..c9a9ded1e49f4 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 f9c2acebbb0bb..ad9e58069124d 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 38f4483872d47..ef5d7042163ec 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 ef775457ccc9c..56077cb584102 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 0000000000000..91630d79f4abb --- /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 0000000000000..5a05af3c2dfd2 --- /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 961e113df7bb6..4f1d604b9b789 100644 --- a/recipes/itlib/all/conandata.yml +++ b/recipes/itlib/all/conandata.yml @@ -1,4 +1,13 @@ 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" "1.9.1": url: "https://github.com/iboB/itlib/archive/v1.9.1.tar.gz" sha256: "3d87b841d85dc30fac2a5157955d685c37fd32a5ecff2e9df330b147fdc3da39" @@ -17,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 b00faa3f0c243..09616d2e081cf 100644 --- a/recipes/itlib/config.yml +++ b/recipes/itlib/config.yml @@ -1,4 +1,10 @@ versions: + "1.10.3": + folder: all + "1.10.0": + folder: all + "1.9.2": + folder: all "1.9.1": folder: all "1.9.0": @@ -11,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/ittapi/all/conandata.yml b/recipes/ittapi/all/conandata.yml index 425388a0a3b63..a637e62d86570 100644 --- a/recipes/ittapi/all/conandata.yml +++ b/recipes/ittapi/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.24.4": + url: "https://github.com/intel/ittapi/archive/v3.24.4.tar.gz" + sha256: "f7341c563f228f4358b645fce526208c742fe13e61fc3ba2c777ba94d36e98f5" "3.24.0": url: "https://github.com/intel/ittapi/archive/v3.24.0.tar.gz" sha256: "36c42d3f2446ddfaa2d7dfa02dfaa79615933f1a68a72d7e4f1d70de7b56e2c9" diff --git a/recipes/ittapi/all/conanfile.py b/recipes/ittapi/all/conanfile.py index dc49d467bcae0..0e0597fe61fbb 100644 --- a/recipes/ittapi/all/conanfile.py +++ b/recipes/ittapi/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, replace_in_file +from conan.tools.scm import Version import os required_conan_version = ">=1.47.0" @@ -52,10 +53,9 @@ def source(self): def _patch_sources(self): # Don't force PIC - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} -fPIC\")", - "" - ) + if Version(self.version) < "3.24.1": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + 'set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")', "") def generate(self): self._patch_sources() diff --git a/recipes/ittapi/config.yml b/recipes/ittapi/config.yml index e8e090e18ce3e..68b246e705157 100644 --- a/recipes/ittapi/config.yml +++ b/recipes/ittapi/config.yml @@ -1,4 +1,6 @@ versions: + "3.24.4": + folder: all "3.24.0": folder: all "3.23.0": diff --git a/recipes/ixwebsocket/all/conanfile.py b/recipes/ixwebsocket/all/conanfile.py index c627577a9f00e..839ba03a95e16 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 249c9d8054efc..e552f7fe9fae8 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.1.1": + url: "https://github.com/jasper-software/jasper/releases/download/version-4.1.1/jasper-4.1.1.tar.gz" + sha256: "03ba86823f8798f3f60a5a34e36f3eff9e9cbd76175643a33d4aac7c0390240a" + "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,14 +15,27 @@ 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.1": + - patch_file: "patches/4.1.1-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.1-0003-deterministic-libname.patch" + patch_description: "No generator dependent libname" + patch_type: "conan" + "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-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" patch_source: "https://github.com/jasper-software/jasper/pull/347" patch_type: "conan" - - patch_file: "patches/4.0.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.0.0-0003-deterministic-libname.patch" patch_description: "No generator dependent libname" patch_type: "conan" @@ -25,9 +44,6 @@ patches: patch_description: "Do not enforce rpath configuration" patch_source: "https://github.com/jasper-software/jasper/pull/347" patch_type: "conan" - - patch_file: "patches/3.0.6-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/3.0.6-0003-deterministic-libname.patch" patch_description: "No generator dependent libname" patch_type: "conan" @@ -36,6 +52,3 @@ patches: patch_description: "Do not enforce rpath configuration" patch_source: "https://github.com/jasper-software/jasper/pull/347" patch_type: "conan" - - patch_file: "patches/2.0.33-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" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 86a1c7f3eefd5..758b12ef086f4 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -1,8 +1,8 @@ from conan import ConanFile from conan.tools.build import cross_building 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, rm, rmdir, save -from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os import textwrap @@ -50,14 +50,20 @@ 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") + def build_requirements(self): + if Version(self.version) >= "4.1.1": + self.tool_requires("cmake/[>=3.20 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + VirtualBuildEnv(self).generate() + tc = CMakeToolchain(self) if Version(self.version) >= "4.0.0": tc.variables["JAS_ENABLE_PIC"] = self.options.get_safe("fPIC", True) @@ -67,6 +73,7 @@ def generate(self): tc.variables["JAS_ENABLE_SHARED"] = self.options.shared tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" tc.variables["JAS_ENABLE_LIBJPEG"] = bool(self.options.with_libjpeg) + tc.variables["JAS_HAVE_JPEGLIB_H"] = True if Version(self.version) >= "3.0.0": tc.variables["JAS_ENABLE_LIBHEIF"] = False tc.variables["JAS_ENABLE_OPENGL"] = False @@ -75,12 +82,6 @@ def generate(self): tc.cache_variables["JAS_CROSSCOMPILING"] = True tc.cache_variables["JAS_STDC_VERSION"] = "199901L" - # 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() cmakedeps = CMakeDeps(self) diff --git a/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch b/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch deleted file mode 100644 index e95e029549359..0000000000000 --- a/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 79081c2..38b6238 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -244,12 +244,7 @@ if (JAS_ENABLE_LIBJPEG AND JPEG_FOUND) - # (e.g., stdio.h and stdint.h). So, we cannot reliably use - # check_include_file here. - set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIR}) -- check_c_source_compiles(" -- #include -- #include -- #include -- int main() {} -- " JAS_HAVE_JPEGLIB_H) -+ set(JAS_HAVE_JPEGLIB_H 1) - if(JAS_HAVE_JPEGLIB_H) - set(JAS_HAVE_LIBJPEG 1) - include_directories(${JPEG_INCLUDE_DIR}) diff --git a/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch b/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch deleted file mode 100644 index 47a8350d738d4..0000000000000 --- a/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a0d253d..19518af 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -680,12 +680,7 @@ 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) -+ set(JAS_HAVE_JPEGLIB_H 1) - if(JAS_HAVE_JPEGLIB_H) - set(JAS_HAVE_LIBJPEG 1) - set(JAS_LIBJPEG_TARGET JPEG::JPEG) diff --git a/recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch b/recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch deleted file mode 100644 index b98de65fb7adf..0000000000000 --- a/recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -731,12 +731,7 @@ 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) -+ set(JAS_HAVE_JPEGLIB_H 1) - if(JAS_HAVE_JPEGLIB_H) - set(JAS_HAVE_LIBJPEG 1) - set(JAS_LIBJPEG_TARGET JPEG::JPEG) 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 0000000000000..9ebb0ac66b98c --- /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-0003-deterministic-libname.patch b/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch new file mode 100644 index 0000000000000..0603e4f665033 --- /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/all/patches/4.1.1-0001-skip-rpath.patch b/recipes/jasper/all/patches/4.1.1-0001-skip-rpath.patch new file mode 100644 index 0000000000000..69c4f82817230 --- /dev/null +++ b/recipes/jasper/all/patches/4.1.1-0001-skip-rpath.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ba6f117..6b79a94 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -800,13 +800,13 @@ + + if(JAS_ENABLE_SHARED) + # use, i.e. don't skip the full RPATH for the build tree +- set(CMAKE_SKIP_BUILD_RPATH FALSE) ++# set(CMAKE_SKIP_BUILD_RPATH FALSE) + + # when building, don't use the install RPATH already + # (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 +@@ -817,8 +817,8 @@ + 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.1-0003-deterministic-libname.patch b/recipes/jasper/all/patches/4.1.1-0003-deterministic-libname.patch new file mode 100644 index 0000000000000..88f2faa6388a7 --- /dev/null +++ b/recipes/jasper/all/patches/4.1.1-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 +@@ -276,7 +276,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 4a60a36eef3ae..a8896535acc48 100644 --- a/recipes/jasper/config.yml +++ b/recipes/jasper/config.yml @@ -1,4 +1,8 @@ versions: + "4.1.1": + folder: all + "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 e7cabf3b1a327..43dfc55725a27 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 d27bc00b65615..09813e133a472 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 f35b931b51133..b21cc49efde95 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 361b35d4c17d9..0000000000000 --- 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 f587b0a08830d..466f9de6c36b3 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 d7fc6037445eb..b262445d3a489 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 7b9b613cbb24a..d0cab5c74bc2f 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 bbf2351737349..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..f575dfc3e9c8a --- /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 dbd0bf0ff0d12..51aa78ce2dd31 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/CMakeLists.txt b/recipes/jinja2cpp/all/CMakeLists.txt deleted file mode 100644 index 4b0bc06c8282d..0000000000000 --- a/recipes/jinja2cpp/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(TARGETS) - -add_subdirectory(source_subfolder) diff --git a/recipes/jinja2cpp/all/conandata.yml b/recipes/jinja2cpp/all/conandata.yml index ba871764ca5c4..01898ea7a626a 100644 --- a/recipes/jinja2cpp/all/conandata.yml +++ b/recipes/jinja2cpp/all/conandata.yml @@ -1,6 +1,6 @@ sources: "1.2.1": - url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/refs/tags/1.2.1.tar.gz" + url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/1.2.1.tar.gz" sha256: "2e61516fd4fd77452c8dd7a6f958ad47c42990df9b7bdc62cf2deb8aa7819b6c" "1.1.0": url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/1.1.0.tar.gz" @@ -8,7 +8,9 @@ sources: patches: "1.2.1": - patch_file: "patches/fix-cmake-1.2.1.patch" - base_path: "source_subfolder" + patch_description: "use cci package, fix compilation error on MSVC" + patch_type: "conan" "1.1.0": - patch_file: "patches/fix-cmake-1.1.0.patch" - base_path: "source_subfolder" + patch_description: "use cci package, include mutex for std::unique_lock" + patch_type: "conan" diff --git a/recipes/jinja2cpp/all/conanfile.py b/recipes/jinja2cpp/all/conanfile.py index 5ccade1cbf22f..c95085d906413 100644 --- a/recipes/jinja2cpp/all/conanfile.py +++ b/recipes/jinja2cpp/all/conanfile.py @@ -1,20 +1,22 @@ -from conan.tools.microsoft import msvc_runtime_flag -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 msvc_runtime_flag, is_msvc +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 import os -import textwrap - -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class Jinja2cppConan(ConanFile): name = "jinja2cpp" + description = "Jinja2 C++ (and for C++) almost full-conformance template engine implementation" license = "MIT" - homepage = "https://jinja2cpp.dev/" url = "https://github.com/conan-io/conan-center-index" - description = "Jinja2 C++ (and for C++) almost full-conformance template engine implementation" + homepage = "https://jinja2cpp.dev/" topics = ("cpp14", "cpp17", "jinja2", "string templates", "templates engine") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,25 +27,22 @@ class Jinja2cppConan(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 _min_cppstd(self): + return 14 @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } 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": @@ -51,98 +50,74 @@ 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.78.0") - self.requires("expected-lite/0.5.0") - self.requires("optional-lite/3.5.0") - self.requires("rapidjson/cci.20211112") - self.requires("string-view-lite/1.6.0") - self.requires("variant-lite/2.0.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") + self.requires("string-view-lite/1.7.0", transitive_headers=True) + self.requires("variant-lite/2.0.0", transitive_headers=True) if self.version == "1.1.0": self.requires("fmt/6.2.1") # not compatible with fmt >= 7.0.0 else: - self.requires("nlohmann_json/3.10.5") - self.requires("fmt/8.1.1") + self.requires("nlohmann_json/3.11.2") + self.requires("fmt/10.2.0") 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["JINJA2CPP_BUILD_TESTS"] = False + tc.variables["JINJA2CPP_STRICT_WARNINGS"] = False + tc.variables["JINJA2CPP_BUILD_SHARED"] = self.options.shared + tc.variables["JINJA2CPP_DEPS_MODE"] = "conan-build" + 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" + tc.variables["JINJA2CPP_MSVC_RUNTIME_TYPE"] = runtime + 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) + apply_conandata_patches(self) # Don't force MD for shared lib, allow to honor runtime from profile - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "set(JINJA2CPP_MSVC_RUNTIME_TYPE \"/MD\")", "") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["JINJA2CPP_BUILD_TESTS"] = False - self._cmake.definitions["JINJA2CPP_STRICT_WARNINGS"] = False - self._cmake.definitions["JINJA2CPP_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["JINJA2CPP_DEPS_MODE"] = "conan-build" - self._cmake.definitions["JINJA2CPP_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", 14) - # Conan cmake generator omits the build_type flag for MSVC multiconfiguration CMake, - # but provide build-type-specific runtime type flag. For now, Jinja2C++ build scripts - # need to know the build type is being built in order to setup internal flags correctly - self._cmake.definitions["CMAKE_BUILD_TYPE"] = self.settings.build_type - if self._is_msvc: - # Runtime type configuration for Jinja2C++ should be strictly '/MT' or '/MD' - runtime = "/MD" if "MD" in msvc_runtime_flag(self) else "/MT" - self._cmake.definitions["JINJA2CPP_MSVC_RUNTIME_TYPE"] = runtime - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(JINJA2CPP_MSVC_RUNTIME_TYPE \"/MD\")", "") def build(self): - if self.version == "1.1.0": - if tools.Version(self.deps_cpp_info["fmt"].version) >= "7.0.0": - raise ConanInvalidConfiguration("jinja2cpp requires fmt < 7.0.0") 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, 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", "jinja2cpp")) - tools.rmdir(os.path.join(self.package_folder, "share")) - - # 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), - {"jinja2cpp": "jinja2cpp::jinja2cpp"} - ) - - @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("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + rmdir(self, os.path.join(self.package_folder, "lib", "jinja2cpp")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "jinja2cpp") self.cpp_info.set_property("cmake_target_name", "jinja2cpp") self.cpp_info.libs = ["jinja2cpp"] - # 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/jinja2cpp/all/patches/fix-cmake-1.1.0.patch b/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch index 2c9056e924d37..e1b4bd4776539 100644 --- a/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch +++ b/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch @@ -1,3 +1,5 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b5c8b3c..c0afc14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,10 +21,6 @@ option(JINJA2CPP_STRICT_WARNINGS "Enable additional warnings and treat them as e @@ -29,20 +31,37 @@ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jinja2cpp ) +diff --git a/include/jinja2cpp/template_env.h b/include/jinja2cpp/template_env.h +index d49859e..0bd456e 100644 +--- a/include/jinja2cpp/template_env.h ++++ b/include/jinja2cpp/template_env.h +@@ -6,6 +6,7 @@ + #include "filesystem_handler.h" + #include "template.h" + ++#include + #include + #include + +diff --git a/thirdparty/thirdparty-conan-build.cmake b/thirdparty/thirdparty-conan-build.cmake +index 5aecfbd..957657f 100644 --- a/thirdparty/thirdparty-conan-build.cmake +++ b/thirdparty/thirdparty-conan-build.cmake -@@ -8,7 +8,11 @@ find_package(string-view-lite) +@@ -6,9 +6,13 @@ find_package(optional-lite) + find_package(string-view-lite) + find_package(Boost) - set(CONAN_BOOST_PACKAGE_NAME Boost::Boost) +-set(CONAN_BOOST_PACKAGE_NAME Boost::Boost) find_package(fmt) -find_package(rapidjson) +find_package(RapidJSON) - --set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt rapidjson::rapidjson) --set(JINJA2_PUBLIC_LIBS_INT expected-lite::expected-lite variant-lite::variant-lite optional-lite::optional-lite string-view-lite::string-view-lite) ++ +# TODO: replace conan targets by official imported targets when fixed in corresponding recipes: +# - CONAN_PKG::rapidjson => rapidjson +# - CONAN_PKG::optional-lite => nonstd::optional-lite +# - CONAN_PKG::variant-lite => nonstd::variant-lite -+set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt CONAN_PKG::rapidjson) -+set(JINJA2_PUBLIC_LIBS_INT nonstd::expected-lite CONAN_PKG::variant-lite CONAN_PKG::optional-lite nonstd::string-view-lite) ++set(JINJA2_PRIVATE_LIBS_INT Boost::headers Boost::filesystem fmt::fmt rapidjson) ++set(JINJA2_PUBLIC_LIBS_INT nonstd::expected-lite nonstd::variant-lite nonstd::optional-lite nonstd::string-view-lite) + +-set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt rapidjson::rapidjson) +-set(JINJA2_PUBLIC_LIBS_INT expected-lite::expected-lite variant-lite::variant-lite optional-lite::optional-lite string-view-lite::string-view-lite) diff --git a/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch b/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch index d355b60a17daa..391fd64166078 100644 --- a/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch +++ b/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch @@ -12,7 +12,7 @@ index bf603b0..6229f02 100644 ) diff --git a/src/helpers.h b/src/helpers.h -index 3af280f..a6a3205 100644 +index 3af280f..b1c31fe 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -32,12 +32,21 @@ struct MultiStringLiteral @@ -37,3 +37,33 @@ index 3af280f..a6a3205 100644 template struct SelectMemberPtr; +diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt +index 77794b9..e31b999 100644 +--- a/thirdparty/CMakeLists.txt ++++ b/thirdparty/CMakeLists.txt +@@ -67,8 +67,8 @@ if(JINJA2CPP_BUILD_TESTS) + endif() + + if (NOT DEFINED JINJA2_PRIVATE_LIBS_INT) +- set(JINJA2CPP_PRIVATE_LIBS ${JINJA2CPP_PRIVATE_LIBS} Boost::variant +- Boost::filesystem Boost::algorithm Boost::lexical_cast fmt RapidJson) ++ set(JINJA2CPP_PRIVATE_LIBS ${JINJA2CPP_PRIVATE_LIBS} Boost::headers ++ Boost::filesystem fmt RapidJson) + else () + set (JINJA2CPP_PRIVATE_LIBS ${JINJA2_PRIVATE_LIBS_INT}) + endif () +diff --git a/thirdparty/thirdparty-conan-build.cmake b/thirdparty/thirdparty-conan-build.cmake +index ec1e2c4..3a70e8a 100644 +--- a/thirdparty/thirdparty-conan-build.cmake ++++ b/thirdparty/thirdparty-conan-build.cmake +@@ -7,9 +7,8 @@ find_package(string-view-lite REQUIRED) + find_package(nlohmann_json REQUIRED) + + find_package(Boost) +-set(CONAN_BOOST_PACKAGE_NAME Boost::Boost) + find_package(fmt) + find_package(RapidJSON) + +-set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt RapidJSON::RapidJSON nlohmann_json::nlohmann_json) ++set(JINJA2_PRIVATE_LIBS_INT Boost::headers Boost::filesystem fmt::fmt rapidjson nlohmann_json::nlohmann_json) + set(JINJA2_PUBLIC_LIBS_INT nonstd::expected-lite nonstd::variant-lite nonstd::optional-lite nonstd::string-view-lite) diff --git a/recipes/jinja2cpp/all/test_package/CMakeLists.txt b/recipes/jinja2cpp/all/test_package/CMakeLists.txt index 5f02285c2de3e..832ed53e2f10d 100644 --- a/recipes/jinja2cpp/all/test_package/CMakeLists.txt +++ b/recipes/jinja2cpp/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.15) +project(test_package LANGUAGES CXX) find_package(jinja2cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} jinja2cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE jinja2cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/jinja2cpp/all/test_package/conanfile.py b/recipes/jinja2cpp/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/jinja2cpp/all/test_package/conanfile.py +++ b/recipes/jinja2cpp/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/joltphysics/all/conandata.yml b/recipes/joltphysics/all/conandata.yml index 7c5580239b9ad..3b85494834125 100644 --- a/recipes/joltphysics/all/conandata.yml +++ b/recipes/joltphysics/all/conandata.yml @@ -1,9 +1,16 @@ sources: + "3.0.1": + url: "https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v3.0.1.tar.gz" + sha256: "7ebb40bf2dddbcf0515984582aaa197ddd06e97581fd55b98cb64f91b243b8a6" "2.0.1": url: "https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v2.0.1.tar.gz" sha256: "96ae2e8691c4802e56bf2587da30f2cc86b8abe82a78bc2398065bd87dd718af" patches: + "3.0.1": + - patch_file: "patches/3.0.1-0001-fix-cmake.patch" + patch_description: "Fix CMakeLists: no warnings as errors, allow shared, add install target, and add profile & debug_renderer options" + patch_type: "conan" "2.0.1": - - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/2.0.1-0001-fix-cmake.patch" patch_description: "Fix CMakeLists: no warnings as errors, allow shared, add install target, and add profile & debug_renderer options" patch_type: "conan" diff --git a/recipes/joltphysics/all/conanfile.py b/recipes/joltphysics/all/conanfile.py index dc05fc97bdff2..ef2cbdfc71184 100644 --- a/recipes/joltphysics/all/conanfile.py +++ b/recipes/joltphysics/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get 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" @@ -87,6 +88,9 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + 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) @@ -127,6 +131,8 @@ def generate(self): tc.variables["USE_STATIC_MSVC_RUNTIME_LIBRARY"] = is_msvc_static_runtime(self) tc.variables["JPH_DEBUG_RENDERER"] = self.options.debug_renderer tc.variables["JPH_PROFILE_ENABLED"] = self.options.profile + if Version(self.version) >= "3.0.0": + tc.variables["ENABLE_ALL_WARNINGS"] = False tc.generate() def build(self): diff --git a/recipes/joltphysics/all/patches/0001-fix-cmake.patch b/recipes/joltphysics/all/patches/2.0.1-0001-fix-cmake.patch similarity index 100% rename from recipes/joltphysics/all/patches/0001-fix-cmake.patch rename to recipes/joltphysics/all/patches/2.0.1-0001-fix-cmake.patch diff --git a/recipes/joltphysics/all/patches/3.0.1-0001-fix-cmake.patch b/recipes/joltphysics/all/patches/3.0.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..b42aafe47bc62 --- /dev/null +++ b/recipes/joltphysics/all/patches/3.0.1-0001-fix-cmake.patch @@ -0,0 +1,125 @@ +diff --git a/Build/CMakeLists.txt b/Build/CMakeLists.txt +index e4fddc5..b106489 100644 +--- a/Build/CMakeLists.txt ++++ b/Build/CMakeLists.txt +@@ -19,8 +19,8 @@ option(CROSS_COMPILE_ARM "Cross compile to aarch64-linux-gnu" OFF) + # If you don't do this you may get an error: /usr/bin/ld: libJolt.a: error adding symbols: file format not recognized + option(INTERPROCEDURAL_OPTIMIZATION "Enable interprocedural optimizations" ON) + +-# When turning this on, in Debug and Release mode, the library will emit extra code to ensure that the 4th component of a 3-vector is kept the same as the 3rd component +-# and will enable floating point exceptions during simulation to detect divisions by zero. ++# When turning this on, in Debug and Release mode, the library will emit extra code to ensure that the 4th component of a 3-vector is kept the same as the 3rd component ++# and will enable floating point exceptions during simulation to detect divisions by zero. + # Note that this currently only works using MSVC. Clang turns Float2 into a SIMD vector sometimes causing floating point exceptions (the option is ignored). + option(FLOATING_POINT_EXCEPTIONS_ENABLED "Enable floating point exceptions" ON) + +@@ -47,17 +47,10 @@ include(CMakeDependentOption) + # Windows Store only supports the DLL version + cmake_dependent_option(USE_STATIC_MSVC_RUNTIME_LIBRARY "Use the static MSVC runtime library" ON "MSVC;NOT WINDOWS_STORE" OFF) + +-# Determine which configurations exist +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Distribution") +-elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +- set(CMAKE_CONFIGURATION_TYPES "Debug;Release;ReleaseASAN;ReleaseUBSAN;ReleaseCoverage;Distribution") +-endif() +- + if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND NOT MINGW) + # Fill in the path to the asan libraries + set(CLANG_LIB_PATH "\"$(VSInstallDir)\\VC\\Tools\\Llvm\\x64\\lib\\clang\\${CMAKE_CXX_COMPILER_VERSION}\\lib\\windows\"") +- ++ + # 64 bit architecture + set(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE "x64") + +@@ -68,7 +61,7 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + + # Set general compiler flags + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /Gm- /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline") +- ++ + # Enable warnings + if (ENABLE_ALL_WARNINGS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /WX") +@@ -189,7 +182,7 @@ set(PHYSICS_REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../) + include(${PHYSICS_REPO_ROOT}/Jolt/Jolt.cmake) + if (IOS) + # Ensure that we enable SSE4.2 for the x86_64 build, CMAKE_SYSTEM_PROCESSOR is not set for iOS +- set_property(TARGET Jolt PROPERTY XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=x86_64] "$(inherited) -msse4.2 -mpopcnt") ++ set_property(TARGET Jolt PROPERTY XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=x86_64] "$(inherited) -msse4.2 -mpopcnt") + endif() + + # Install Jolt library and includes +@@ -202,7 +195,7 @@ foreach(SRC_FILE ${JOLT_PHYSICS_SRC_FILES}) + endif() + endforeach() + +-# Check if we're the root CMakeLists.txt, if not we are included by another CMake file and we should disable everything except for the main library ++# Check if we're the root CMakeLists.txt, if not we are included by another CMake file and we should disable everything except for the main library + if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + # Ability to turn ON/OFF individual applications + option(TARGET_UNIT_TESTS "Build Unit Tests" ON) +@@ -258,7 +251,7 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + target_link_options(PerformanceTest PUBLIC "/SUBSYSTEM:CONSOLE") + endif() + set_property(TARGET PerformanceTest PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${PHYSICS_REPO_ROOT}") +- ++ + # Copy the assets folder + add_custom_command(TARGET PerformanceTest PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${PHYSICS_REPO_ROOT}/Assets/ $/Assets/) + endif() +@@ -276,4 +269,4 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + include(${PHYSICS_REPO_ROOT}/JoltViewer/JoltViewer.cmake) + endif() + endif() +-endif() +\ No newline at end of file ++endif() +diff --git a/Jolt/Jolt.cmake b/Jolt/Jolt.cmake +index 176a757..efed8f0 100644 +--- a/Jolt/Jolt.cmake ++++ b/Jolt/Jolt.cmake +@@ -430,14 +430,28 @@ endif() + source_group(TREE ${JOLT_PHYSICS_ROOT} FILES ${JOLT_PHYSICS_SRC_FILES}) + + # Create Jolt lib +-add_library(Jolt STATIC ${JOLT_PHYSICS_SRC_FILES}) ++add_library(Jolt ${JOLT_PHYSICS_SRC_FILES}) ++target_compile_features(Jolt PUBLIC cxx_std_17) ++include(GNUInstallDirs) ++install( ++ TARGETS Jolt ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) ++install(DIRECTORY ${JOLT_PHYSICS_ROOT} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING REGEX "(.*).(h|inl)$") ++if(JPH_DEBUG_RENDERER) ++ target_compile_definitions(Jolt PUBLIC JPH_DEBUG_RENDERER) ++endif() ++if(JPH_PROFILE_ENABLED) ++ target_compile_definitions(Jolt PUBLIC JPH_PROFILE_ENABLED) ++endif() + target_include_directories(Jolt PUBLIC ${PHYSICS_REPO_ROOT}) +-target_precompile_headers(Jolt PRIVATE ${JOLT_PHYSICS_ROOT}/Jolt.h) +-target_compile_definitions(Jolt PUBLIC "$<$:_DEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") ++target_compile_definitions(Jolt PUBLIC "$<$:_DEBUG>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR;JPH_DEBUG_RENDERER>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + + # Setting floating point exceptions +@@ -471,7 +485,7 @@ function(EMIT_X86_INSTRUCTION_SET_DEFINITIONS) + endif() + if (USE_AVX) + target_compile_definitions(Jolt PUBLIC JPH_USE_AVX) +- endif() ++ endif() + if (USE_SSE4_1) + target_compile_definitions(Jolt PUBLIC JPH_USE_SSE4_1) + endif() diff --git a/recipes/joltphysics/config.yml b/recipes/joltphysics/config.yml index bb7eb85dfac49..41bbdfae2300d 100644 --- a/recipes/joltphysics/config.yml +++ b/recipes/joltphysics/config.yml @@ -1,3 +1,5 @@ versions: + "3.0.1": + folder: all "2.0.1": folder: all diff --git a/recipes/jpcre2/all/conanfile.py b/recipes/jpcre2/all/conanfile.py index f0f2f817d89da..537216e3b272a 100644 --- a/recipes/jpcre2/all/conanfile.py +++ b/recipes/jpcre2/all/conanfile.py @@ -1,33 +1,44 @@ -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 Jpcre2Conan(ConanFile): name = "jpcre2" - homepage = "https://github.com/jpcre2/jpcre2" description = "Header-only C++ wrapper for PCRE2 library." - topics = ("regex", "pcre2", "header-only", "single-header") - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jpcre2/jpcre2" + topics = ("regex", "pcre2", "header-only", "single-header") + 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 requirements(self): - self.requires("pcre2/10.37") + self.requires("pcre2/10.42") + + 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("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("jpcre2.hpp", dst="include", src=os.path.join(self._source_subfolder, "src")) - - def package_id(self): - self.info.header_only() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "jpcre2.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "src")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/jpcre2/all/test_package/CMakeLists.txt b/recipes/jpcre2/all/test_package/CMakeLists.txt index c2f7a55ce01f3..dd0af07a2c068 100644 --- a/recipes/jpcre2/all/test_package/CMakeLists.txt +++ b/recipes/jpcre2/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(jpcre2 REQUIRED) +find_package(jpcre2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE jpcre2::jpcre2) diff --git a/recipes/jpcre2/all/test_package/conanfile.py b/recipes/jpcre2/all/test_package/conanfile.py index 3da371b660e0a..fae501d0afb9e 100644 --- a/recipes/jpcre2/all/test_package/conanfile.py +++ b/recipes/jpcre2/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" + 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/jpcre2/all/test_package/test_package.cpp b/recipes/jpcre2/all/test_package/test_package.cpp index dbaa3accd96c7..a1ec58eee8bf5 100644 --- a/recipes/jpcre2/all/test_package/test_package.cpp +++ b/recipes/jpcre2/all/test_package/test_package.cpp @@ -2,12 +2,10 @@ typedef jpcre2::select jp; -int main(int, char**) -{ +int main(int, char **) { jp::Regex re; re.setPattern("Hello (\\S+?)").compile(); - if (!re.match("Hello conan-center-index")) - { + if (!re.match("Hello conan-center-index")) { return 1; } diff --git a/recipes/jpcre2/all/test_v1_package/CMakeLists.txt b/recipes/jpcre2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/jpcre2/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/jpcre2/all/test_v1_package/conanfile.py b/recipes/jpcre2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/jpcre2/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/jsbsim/all/conandata.yml b/recipes/jsbsim/all/conandata.yml new file mode 100644 index 0000000000000..e42c1af7e0ef0 --- /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 0000000000000..3d180281b5649 --- /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 0000000000000..422dcb5cbf527 --- /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 0000000000000..0f6fb6ace3ef3 --- /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 0000000000000..958e041dc8752 --- /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 0000000000000..5ee8eae7c8e6f --- /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 0000000000000..0a6bc68712d90 --- /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 0000000000000..bd360361a7c3d --- /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/vulkan-loader/all/test_v1_package/CMakeLists.txt b/recipes/jsbsim/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/vulkan-loader/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 0000000000000..38f4483872d47 --- /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 0000000000000..26b3368e2a692 --- /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 80c11f45949cb..eff4b5d9d9571 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 7ed706059e17c..a27364e09b956 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 1e4023fe84046..301a8d09f5b3a 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-schema-validator/all/conandata.yml b/recipes/json-schema-validator/all/conandata.yml index 122476811e03f..3c6f2f96fc4ed 100644 --- a/recipes/json-schema-validator/all/conandata.yml +++ b/recipes/json-schema-validator/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.0": + url: "https://github.com/pboettch/json-schema-validator/archive/refs/tags/2.3.0.tar.gz" + sha256: "2c00b50023c7d557cdaa71c0777f5bcff996c4efd7a539e58beaa4219fa2a5e1" "2.2.0": url: "https://github.com/pboettch/json-schema-validator/archive/refs/tags/2.2.0.tar.gz" sha256: "03897867bd757ecac1db7545babf0c6c128859655b496582a9cea4809c2260aa" diff --git a/recipes/json-schema-validator/all/conanfile.py b/recipes/json-schema-validator/all/conanfile.py index 116cea1b74c21..312888fba61cb 100644 --- a/recipes/json-schema-validator/all/conanfile.py +++ b/recipes/json-schema-validator/all/conanfile.py @@ -13,22 +13,30 @@ class JsonSchemaValidatorConan(ConanFile): name = "json-schema-validator" + description = "JSON schema validator for JSON for Modern C++" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/pboettch/json-schema-validator" - description = "JSON schema validator for JSON for Modern C++ " topics = ("modern-json", "schema-validation", "json") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "json_diagnostics": [True, False], + } + options_description = { + "json_diagnostics": ( + "Defines JSON_DIAGNOSTICS=1 for the nlohmann_json library. " + "Refer https://json.nlohmann.me/api/macros/json_diagnostics/ " + "This macro enables extended diagnostics for exception messages." + ) } default_options = { "shared": False, "fPIC": True, + "json_diagnostics": False, } - short_paths = True @property @@ -60,12 +68,16 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("nlohmann_json/3.11.2", transitive_headers=True) + # to support latest compilers, we have to downgrade nlohmann_json. + # https://github.com/pboettch/json-schema-validator/pull/276 + if Version(self.version) < "2.3.0": + self.requires("nlohmann_json/3.10.5", transitive_headers=True) + else: + self.requires("nlohmann_json/3.11.3", 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( @@ -83,6 +95,11 @@ def generate(self): else: tc.variables["JSON_VALIDATOR_BUILD_TESTS"] = False tc.variables["JSON_VALIDATOR_BUILD_EXAMPLES"] = False + tc.variables["JSON_VALIDATOR_INSTALL"] = True + tc.variables["JSON_VALIDATOR_SHARED_LIBS"] = self.options.shared + tc.variables["CMAKE_INSTALL_RUNTIMEDIR"] = "bin" + if self.options.json_diagnostics: + tc.preprocessor_definitions["JSON_DIAGNOSTICS"] = '1' if Version(self.version) < "2.1.0": nlohmann_json_includedirs = self.dependencies["nlohmann_json"].cpp_info.aggregated_components().includedirs tc.variables["NLOHMANN_JSON_DIR"] = ";".join([p.replace("\\", "/") for p in nlohmann_json_includedirs]) @@ -131,9 +148,13 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "nlohmann_json_schema_validator") self.cpp_info.set_property("cmake_target_name", "nlohmann_json_schema_validator") self.cpp_info.libs = ["json-schema-validator" if Version(self.version) < "2.1.0" else "nlohmann_json_schema_validator"] + if self.options.json_diagnostics: + self.cpp_info.defines = ["JSON_DIAGNOSTICS=1"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") + elif self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("JSON_SCHEMA_VALIDATOR_EXPORTS=1") # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "nlohmann_json_schema_validator" diff --git a/recipes/json-schema-validator/all/test_package/CMakeLists.txt b/recipes/json-schema-validator/all/test_package/CMakeLists.txt index c2d764c121782..193d69ef33260 100644 --- a/recipes/json-schema-validator/all/test_package/CMakeLists.txt +++ b/recipes/json-schema-validator/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package LANGUAGES CXX) find_package(nlohmann_json_schema_validator CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} nlohmann_json_schema_validator) +target_link_libraries(${PROJECT_NAME} PRIVATE nlohmann_json_schema_validator) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/json-schema-validator/config.yml b/recipes/json-schema-validator/config.yml index ddf20dd4ca819..3d204ba702a0b 100644 --- a/recipes/json-schema-validator/config.yml +++ b/recipes/json-schema-validator/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.0": + folder: all "2.2.0": folder: all "2.1.0": diff --git a/recipes/json_dto/all/conandata.yml b/recipes/json_dto/all/conandata.yml index 3d6e5b35876d7..48460b81acb17 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 44aa1adf3256a..59d836f777070 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 45401a5b844ae..b20143685a5e9 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 21d7adcc4bb1c..81d4d29e64c73 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 0000000000000..b21cc49efde95 --- /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 0000000000000..38f4483872d47 --- /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 464caddcd4136..87de86e844c69 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 522f8707b0c51..52e32ee921839 100644 --- a/recipes/jsoncons/all/conandata.yml +++ b/recipes/jsoncons/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "0.173.2": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.173.2.tar.gz" + sha256: "c689e9275fe428abf2914e4588321ed0fa756cce6448af94fbd625eb0a618a57" + "0.173.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.173.0.tar.gz" + sha256: "61abb5e4fbdb3ef7601b4fdc263bc806785609c47b4d7e81f8c3110bd53a9282" + "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" + "0.170.2": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.170.2.tar.gz" + sha256: "0ff0cd407f6b27dea66a3202bc8bc2e043ec1614419e76840eda5b5f8045a43a" "0.169.0": url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.169.0.tar.gz" - sha256: 423dc99d6950056fb55782513daf74adf37501eaf01b977b2415873cd0c44243 + sha256: "423dc99d6950056fb55782513daf74adf37501eaf01b977b2415873cd0c44243" diff --git a/recipes/jsoncons/all/conanfile.py b/recipes/jsoncons/all/conanfile.py index 32d3c9bc0d9c9..54b1abb2a2c3e 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" @@ -12,30 +15,56 @@ class JsonconsConan(ConanFile): license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/danielaparker/jsoncons" - topics = ("json", "csv", "cpp", "json-serialization", "cbor", "json-parser", "messagepack", "json-pointer", "json-patch", "json-diff", "bson", "ubjson", "json-parsing", "jsonpath", "jmespath", "csv-parser", "csv-reader", "jsonschema", "json-construction", "streaming-json-read", "header-only") + topics = ( + "json", "csv", "json-serialization", "cbor", "json-parser", + "messagepack", "json-pointer", "json-patch", "json-diff", "bson", + "ubjson", "json-parsing", "jsonpath", "jmespath", "csv-parser", + "csv-reader", "jsonschema", "json-construction", "streaming-json-read", + "header-only", + ) + pckage_type = "header-library" 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], - 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(self, pattern="*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): - # Folders not used for header-only self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/jsoncons/all/test_package/CMakeLists.txt b/recipes/jsoncons/all/test_package/CMakeLists.txt index a15fe60ff614b..067c8673df55b 100644 --- a/recipes/jsoncons/all/test_package/CMakeLists.txt +++ b/recipes/jsoncons/all/test_package/CMakeLists.txt @@ -1,8 +1,12 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) +project(test_package LANGUAGES CXX) 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 2e4adc0eddf16..a5743e33125cd 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 0354650b51267..4ff39c386d267 100644 --- a/recipes/jsoncons/config.yml +++ b/recipes/jsoncons/config.yml @@ -1,3 +1,17 @@ versions: + "0.173.2": + folder: "all" + "0.173.0": + folder: "all" + "0.172.1": + folder: "all" + "0.172.0": + folder: "all" + "0.171.1": + folder: "all" + "0.171.0": + folder: "all" + "0.170.2": + folder: "all" "0.169.0": folder: "all" diff --git a/recipes/jsonnet/all/CMakeLists.txt b/recipes/jsonnet/all/CMakeLists.txt deleted file mode 100644 index 881b1cb39250b..0000000000000 --- a/recipes/jsonnet/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/jsonnet/all/conandata.yml b/recipes/jsonnet/all/conandata.yml index af6fab5053143..260d7031fb23c 100644 --- a/recipes/jsonnet/all/conandata.yml +++ b/recipes/jsonnet/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.20.0": + url: "https://github.com/google/jsonnet/archive/v0.20.0.tar.gz" + sha256: "77bd269073807731f6b11ff8d7c03e9065aafb8e4d038935deb388325e52511b" "0.19.1": url: "https://github.com/google/jsonnet/archive/v0.19.1.tar.gz" sha256: "f5a20f2dc98fdebd5d42a45365f52fa59a7e6b174e43970fea4f9718a914e887" @@ -9,18 +12,35 @@ sources: url: "https://github.com/google/jsonnet/archive/v0.17.0.tar.gz" sha256: "076b52edf888c01097010ad4299e3b2e7a72b60a41abbc65af364af1ed3c8dbe" patches: + "0.20.0": + - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" + patch_description: "fix include path to use cci package" + patch_type: "conan" + - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" + - patch_file: "patches/0.20.0/0003-use-cpp17.patch" + patch_description: "use C++17" + patch_type: "portability" + patch_source: "https://github.com/google/jsonnet/pull/1076" "0.19.1": - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" - base_path: "source_subfolder" + patch_description: "fix include path to use cci package" + patch_type: "conan" - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" - base_path: "source_subfolder" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" "0.18.0": - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" - base_path: "source_subfolder" + patch_description: "fix include path to use cci package" + patch_type: "conan" - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" - base_path: "source_subfolder" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" "0.17.0": - patch_file: "patches/0.17.0/0001-fix-nlohmann-include.patch" - base_path: "source_subfolder" + patch_description: "fix include path to use cci package" + patch_type: "conan" - patch_file: "patches/0.17.0/0002-cmake-fixes.patch" - base_path: "source_subfolder" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" diff --git a/recipes/jsonnet/all/conanfile.py b/recipes/jsonnet/all/conanfile.py index ff9c2346a3e5f..0581568a5b5ce 100644 --- a/recipes/jsonnet/all/conanfile.py +++ b/recipes/jsonnet/all/conanfile.py @@ -1,19 +1,23 @@ -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.microsoft import is_msvc, msvc_runtime_flag +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.53.0" class JsonnetConan(ConanFile): name = "jsonnet" description = "Jsonnet - The data templating language" - topics = ("config", "json", "functional", "configuration") license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/jsonnet" + topics = ("config", "json", "functional", "configuration") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,15 +26,25 @@ class JsonnetConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake", "cmake_find_package" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "11" if Version(self.version) < "0.20.0" else "17" @property - def _build_subfolder(self): - return "build_subfolder" + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -38,70 +52,78 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - # This is a workround. - # If jsonnet is shared, rapidyaml must be built as shared, - # or the c4core functions that rapidyaml depends on will not be able to be found. - # This seems to be a issue of rapidyaml. - # https://github.com/conan-io/conan-center-index/pull/9786#discussion_r829887879 - if tools.Version(self.version) >= "0.18.0": - self.options["rapidyaml"].shared = True + self.options.rm_safe("fPIC") - def requirements(self): - self.requires("nlohmann_json/3.10.5") - if tools.Version(self.version) >= "0.18.0": - self.requires("rapidyaml/0.4.1") + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration("jsonnet does not support cross building") + 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 Version(self.version) == "0.17.0" and Version(self.settings.compiler.get_safe("cppstd")) > "17": + raise ConanInvalidConfiguration(f"{self.ref} does not support C++{self.settings.compiler.cppstd}") - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration(f"{self.ref} does not support cross building") if self.options.shared and is_msvc(self) and "d" in msvc_runtime_flag(self): - raise ConanInvalidConfiguration("shared {} is not supported with MTd/MDd runtime".format(self.name)) + raise ConanInvalidConfiguration(f"shared {self.ref} is not supported with MTd/MDd runtime") - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + # This is a workround. + # If jsonnet is shared, rapidyaml must be built as shared, + # or the c4core functions that rapidyaml depends on will not be able to be found. + # This seems to be a issue of rapidyaml. + # https://github.com/conan-io/conan-center-index/pull/9786#discussion_r829887879 + if self.options.shared and Version(self.version) >= "0.18.0" and self.dependencies["rapidyaml"].options.shared == False: + raise ConanInvalidConfiguration(f"shared {self.ref} requires rapidyaml to be built as shared") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + def requirements(self): + self.requires("nlohmann_json/3.11.2") + if Version(self.version) >= "0.18.0": + self.requires("rapidyaml/0.5.0") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTS"] = False - cmake.definitions["BUILD_STATIC_LIBS"] = not self.options.shared - cmake.definitions["BUILD_SHARED_BINARIES"] = False - cmake.definitions["BUILD_JSONNET"] = False - cmake.definitions["BUILD_JSONNETFMT"] = False - cmake.definitions["USE_SYSTEM_JSON"] = True - cmake.configure(build_folder=self._build_subfolder) - return cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_SHARED_BINARIES"] = False + tc.variables["BUILD_JSONNET"] = False + tc.variables["BUILD_JSONNETFMT"] = False + tc.variables["USE_SYSTEM_JSON"] = True + 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("LICENSE", src=self._source_subfolder, dst="licenses") - 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): self.cpp_info.components["libjsonnet"].libs = ["jsonnet"] self.cpp_info.components["libjsonnet"].requires = ["nlohmann_json::nlohmann_json"] - if tools.Version(self.version) >= "0.18.0": + if Version(self.version) >= "0.18.0": self.cpp_info.components["libjsonnet"].requires.append("rapidyaml::rapidyaml") - if tools.stdcpp_library(self): - self.cpp_info.components["libjsonnet"].system_libs.append(tools.stdcpp_library(self)) + if stdcpp_library(self): + self.cpp_info.components["libjsonnet"].system_libs.append(stdcpp_library(self)) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libjsonnet"].system_libs.append("m") diff --git a/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch b/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch index 6d8e892eb89a7..887943f82c372 100644 --- a/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch +++ b/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch @@ -1,32 +1,44 @@ -- install headers -- optionally disable shared build -- add md5 objects to c library -- allow MSVC ---- core/CMakeLists.txt -+++ core/CMakeLists.txt -@@ -16,8 +16,8 @@ set(LIBJSONNET_HEADERS - string_utils.h +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 385ea82..34b1c63 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,7 +40,7 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" OR + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++11 -fPIC ${OPT}") + else() + # TODO: Windows support. +- message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") ++ message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") + endif() + + set(CMAKE_CXX_STANDARD 11) +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index e8ad830..7d87527 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -17,7 +17,8 @@ set(LIBJSONNET_HEADERS unicode.h vm.h) -- + -set(LIBJSONNET_SOURCE +install(FILES ../include/libjsonnet.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +set(LIBJSONNET_SOURCE $ desugarer.cpp formatter.cpp lexer.cpp -@@ -27,7 +27,7 @@ set(LIBJSONNET_SOURCE - static_analysis.cpp +@@ -28,6 +29,7 @@ set(LIBJSONNET_SOURCE string_utils.cpp vm.cpp) -- + +if (NOT BUILD_STATIC_LIBS) add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE}) add_dependencies(libjsonnet md5 stdlib) target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json) -@@ -50,7 +50,7 @@ install(TARGETS libjsonnet +@@ -47,10 +49,10 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet + install(TARGETS libjsonnet + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") -+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") target_include_directories(libjsonnet INTERFACE $) - @@ -34,9 +46,11 @@ if (BUILD_STATIC_LIBS) # Static library for jsonnet command-line tool. add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE}) ---- cpp/CMakeLists.txt -+++ cpp/CMakeLists.txt -@@ -3,11 +3,11 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 5549902..3091a9c 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -3,14 +3,14 @@ set(LIBJSONNETPP_HEADERS ../include/libjsonnet++.h ) @@ -51,7 +65,13 @@ add_dependencies(libjsonnet++ jsonnet) -# target_link_libraries(libjsonnet libjsonnet) +target_link_libraries(libjsonnet++ libjsonnet) -@@ -24,7 +24,7 @@ + + # CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without + # this step the output would be |liblibjsonnet|. +@@ -21,10 +21,10 @@ set_target_properties(libjsonnet++ PROPERTIES OUTPUT_NAME jsonnet++ + install(TARGETS libjsonnet++ + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") target_include_directories(libjsonnet++ INTERFACE @@ -61,20 +81,11 @@ if (BUILD_STATIC_LIBS) # Static library for jsonnet command-line tool. add_library(libjsonnet++_static STATIC ${LIBJSONNETPP_SOURCE}) ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -40,7 +40,7 @@ - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++11 -fPIC ${OPT}") - else() - # TODO: Windows support. -- message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") -+ message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") - endif() - - set(CMAKE_CXX_STANDARD 11) ---- stdlib/CMakeLists.txt -+++ stdlib/CMakeLists.txt -@@ -5,7 +5,7 @@ +diff --git a/stdlib/CMakeLists.txt b/stdlib/CMakeLists.txt +index a481d9f..00ff502 100644 +--- a/stdlib/CMakeLists.txt ++++ b/stdlib/CMakeLists.txt +@@ -5,7 +5,7 @@ add_executable(to_c_array to_c_array.cpp) # Custom command that will only build stdlib when it changes. add_custom_command( OUTPUT ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h @@ -83,5 +94,3 @@ ${PROJECT_SOURCE_DIR}/stdlib/std.jsonnet ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h DEPENDS to_c_array std.jsonnet) - - diff --git a/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch b/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch index 505ce96c21e93..58b0135ca2153 100644 --- a/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch +++ b/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch @@ -20,7 +20,7 @@ index 5df20ca..c14c93c 100644 add_subdirectory(cpp) add_subdirectory(cmd) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt -index e62a858..c0389f8 100644 +index e62a858..f0fb69f 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -17,7 +17,8 @@ set(LIBJSONNET_HEADERS @@ -33,15 +33,21 @@ index e62a858..c0389f8 100644 desugarer.cpp formatter.cpp lexer.cpp -@@ -28,6 +29,7 @@ set(LIBJSONNET_SOURCE +@@ -28,9 +29,12 @@ set(LIBJSONNET_SOURCE string_utils.cpp vm.cpp) ++find_package(ryml REQUIRED CONFIG) ++ +if (NOT BUILD_STATIC_LIBS) add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE}) add_dependencies(libjsonnet md5 stdlib) - target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml) -@@ -47,10 +49,10 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet +-target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml) ++target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml::ryml) + + file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/../include/libjsonnet.h JSONNET_VERSION_DEF + REGEX "[#]define[ \t]+LIB_JSONNET_VERSION[ \t]+") +@@ -47,15 +51,15 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet install(TARGETS libjsonnet LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" @@ -54,6 +60,12 @@ index e62a858..c0389f8 100644 if (BUILD_STATIC_LIBS) # Static library for jsonnet command-line tool. add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE}) + add_dependencies(libjsonnet_static md5 stdlib) +- target_link_libraries(libjsonnet_static md5 nlohmann_json::nlohmann_json ryml) ++ target_link_libraries(libjsonnet_static md5 nlohmann_json::nlohmann_json ryml::ryml) + set_target_properties(libjsonnet_static PROPERTIES OUTPUT_NAME jsonnet) + install(TARGETS libjsonnet_static DESTINATION "${CMAKE_INSTALL_LIBDIR}") + target_include_directories(libjsonnet_static INTERFACE diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index eb7686c..cbf21bb 100644 --- a/cpp/CMakeLists.txt diff --git a/recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch b/recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch new file mode 100644 index 0000000000000..6735bb58adc58 --- /dev/null +++ b/recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch @@ -0,0 +1,14 @@ +iff --git a/CMakeLists.txt b/CMakeLists.txt +index c14c93c..b1cb1b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,7 +43,8 @@ else() + message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") + endif() + +-set(CMAKE_CXX_STANDARD 11) ++# FIXME: This is a temporary workaround, necessary in MSVC only for version 0.20 and Conan 1.X ++set(CMAKE_CXX_STANDARD 17) + + + # Include external googletest project. This runs a CMake sub-script diff --git a/recipes/jsonnet/all/test_package/CMakeLists.txt b/recipes/jsonnet/all/test_package/CMakeLists.txt index b1f60f164ad79..ad42d5d0faada 100644 --- a/recipes/jsonnet/all/test_package/CMakeLists.txt +++ b/recipes/jsonnet/all/test_package/CMakeLists.txt @@ -1,14 +1,15 @@ -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 C CXX) find_package(jsonnet CONFIG REQUIRED) add_executable(${PROJECT_NAME}_c test_package.c) -target_link_libraries(${PROJECT_NAME}_c jsonnet::libjsonnet) +target_link_libraries(${PROJECT_NAME}_c PRIVATE jsonnet::libjsonnet) add_executable(${PROJECT_NAME}_cxx test_package.cpp) -target_link_libraries(${PROJECT_NAME}_cxx jsonnet::libjsonnetpp) -set_property(TARGET ${PROJECT_NAME}_cxx PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME}_cxx PRIVATE jsonnet::libjsonnetpp) +if(jsonnet_VERSION VERSION_LESS "0.20.0") + target_compile_features(${PROJECT_NAME}_cxx PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME}_cxx PRIVATE cxx_std_17) +endif() diff --git a/recipes/jsonnet/all/test_package/conanfile.py b/recipes/jsonnet/all/test_package/conanfile.py index 1460ef0546803..7f7fcbab40166 100644 --- a/recipes/jsonnet/all/test_package/conanfile.py +++ b/recipes/jsonnet/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -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 +20,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package_c"), run_environment=True) - self.run(os.path.join("bin", "test_package_cxx"), run_environment=True) + if can_run(self): + self.run(os.path.join(self.cpp.build.bindir, "test_package_c"), env="conanrun") + self.run(os.path.join(self.cpp.build.bindir, "test_package_cxx"), env="conanrun") diff --git a/recipes/jsonnet/all/test_v1_package/CMakeLists.txt b/recipes/jsonnet/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/jsonnet/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/jsonnet/all/test_v1_package/conanfile.py b/recipes/jsonnet/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..25fbcb7a6d066 --- /dev/null +++ b/recipes/jsonnet/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): + self.run(os.path.join("bin", "test_package_c"), run_environment=True) + self.run(os.path.join("bin", "test_package_cxx"), run_environment=True) diff --git a/recipes/jsonnet/config.yml b/recipes/jsonnet/config.yml index d98d76db4349a..be300c9c5c2b0 100644 --- a/recipes/jsonnet/config.yml +++ b/recipes/jsonnet/config.yml @@ -1,4 +1,6 @@ versions: + "0.20.0": + folder: all "0.19.1": folder: all "0.18.0": diff --git a/recipes/jthread-lite/all/conanfile.py b/recipes/jthread-lite/all/conanfile.py index efd2ef2fde6ab..b1f862a6ab31f 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 d2b01e47d9d63..0000000000000 --- 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 bd27aef1a8932..804a4efea38b2 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 5350d8f70668d..dba32eb6f0f01 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 354670d11c755..fdc2bc33ffe24 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 9ebf26743f34b..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..9ebf26743f34b --- /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 682db91532894..fb10aeba03ec3 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/conandata.yml b/recipes/jwt-cpp/all/conandata.yml index bf093248fb260..e8a69c12dceae 100644 --- a/recipes/jwt-cpp/all/conandata.yml +++ b/recipes/jwt-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.0": + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.7.0.tar.gz" + sha256: "b9eb270e3ba8221e4b2bc38723c9a1cb4fa6c241a42908b9a334daff31137406" "0.6.0": url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.6.0.tar.gz" sha256: "0227bd6e0356b211341075c7997c837f0b388c01379bd256aa525566a5553f03" @@ -15,6 +18,10 @@ sources: url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.3.1.tar.gz" sha256: "399345e81883f2959df658cd945de39548ddfefdab2acf7b23ee07b9e9a02938" patches: + "0.7.0": + - patch_file: "patches/0005-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" "0.6.0": - patch_file: "patches/0005-fix-picojson-header-location-for-conan.patch" patch_description: "Remove picojson namespace from its include" diff --git a/recipes/jwt-cpp/all/conanfile.py b/recipes/jwt-cpp/all/conanfile.py index 75e913785ea24..1e09b3d6625c7 100644 --- a/recipes/jwt-cpp/all/conanfile.py +++ b/recipes/jwt-cpp/all/conanfile.py @@ -8,13 +8,13 @@ class JwtCppConan(ConanFile): name = "jwt-cpp" + description = "A C++ JSON Web Token library for encoding/decoding" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Thalhammer/jwt-cpp" - description = "A C++ JSON Web Token library for encoding/decoding" topics = ("json", "jwt", "jws", "jwe", "jwk", "jwks", "jose", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True @property def _supports_generic_json(self): @@ -23,17 +23,19 @@ def _supports_generic_json(self): def export_sources(self): export_conandata_patches(self) + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") if not self._supports_generic_json: self.requires("picojson/1.3.0") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=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], strip_root=True) def build(self): apply_conandata_patches(self) @@ -43,21 +45,12 @@ def package(self): copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include", "jwt-cpp"), src=header_dir, keep_path=True) copy(self, "LICENSE", dst=os.path.join(self.package_folder,"licenses"), src=self.source_folder) - 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", "jwt-cpp") self.cpp_info.set_property("cmake_target_name", "jwt-cpp::jwt-cpp") - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "jwt-cpp" - self.cpp_info.names["cmake_find_package_multi"] = "jwt-cpp" - if self._supports_generic_json: self.cpp_info.defines.append("JWT_DISABLE_PICOJSON") - - self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] - self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/jwt-cpp/all/test_package/CMakeLists.txt b/recipes/jwt-cpp/all/test_package/CMakeLists.txt index 020cb1aab4c7d..123d03753d8a0 100644 --- a/recipes/jwt-cpp/all/test_package/CMakeLists.txt +++ b/recipes/jwt-cpp/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(jwt-cpp REQUIRED CONFIG) find_package(picojson REQUIRED CONFIG) @@ -8,6 +8,10 @@ add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE jwt-cpp::jwt-cpp picojson::picojson) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if (MSVC) + target_compile_definitions(${PROJECT_NAME} PRIVATE NOMINMAX) +endif() + if (jwt-cpp_VERSION VERSION_GREATER 0.4.0) target_compile_definitions(${PROJECT_NAME} PRIVATE JSON_TRAITS_NEEDED) endif() @@ -15,3 +19,7 @@ endif() if (jwt-cpp_VERSION VERSION_GREATER_EQUAL 0.6.0) target_compile_definitions(${PROJECT_NAME} PRIVATE HAS_DEFAULT_TRAITS) endif() + +if (jwt-cpp_VERSION VERSION_GREATER_EQUAL 0.7.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE GET_PAYLOAD_JSON) +endif() diff --git a/recipes/jwt-cpp/all/test_package/test_package.cpp b/recipes/jwt-cpp/all/test_package/test_package.cpp index a7af84c85dc7c..64275af84bffa 100644 --- a/recipes/jwt-cpp/all/test_package/test_package.cpp +++ b/recipes/jwt-cpp/all/test_package/test_package.cpp @@ -18,8 +18,13 @@ int main() { .sign(jwt::algorithm::hs256{"secret"}); auto decoded = jwt::decode(token); - for(auto& e : decoded.get_payload_claims()) +#ifdef GET_PAYLOAD_JSON + for(auto& e : decoded.get_payload_json()) + std::cout << e.first << " = " << e.second << std::endl; +#else + for(auto& e : decoded.get_payload_claims()) std::cout << e.first << " = " << e.second.to_json() << std::endl; +#endif auto verifier = jwt::verify() .allow_algorithm(jwt::algorithm::hs256{"secret"}) diff --git a/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt b/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt index d58f9a64ba28e..84b1906ecf746 100644 --- a/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt +++ b/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt @@ -1,20 +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(jwt-cpp REQUIRED CONFIG) -find_package(picojson REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE jwt-cpp::jwt-cpp picojson::picojson) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) - -if (jwt-cpp_VERSION VERSION_GREATER 0.4.0) - target_compile_definitions(${PROJECT_NAME} PRIVATE JSON_TRAITS_NEEDED) -endif() - -if (jwt-cpp_VERSION VERSION_GREATER_EQUAL 0.6.0) - target_compile_definitions(${PROJECT_NAME} PRIVATE HAS_DEFAULT_TRAITS) -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/jwt-cpp/config.yml b/recipes/jwt-cpp/config.yml index 49536ba2e770d..ebed14e0108cb 100644 --- a/recipes/jwt-cpp/config.yml +++ b/recipes/jwt-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.0": + folder: all "0.6.0": folder: all "0.5.1": diff --git a/recipes/jxrlib/all/conanfile.py b/recipes/jxrlib/all/conanfile.py index d4c71b54de455..14c91a4a33519 100644 --- a/recipes/jxrlib/all/conanfile.py +++ b/recipes/jxrlib/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class JxrlibConan(ConanFile): @@ -15,6 +15,7 @@ class JxrlibConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "BSD-2-Clause" topics = ("jxr", "jpeg", "xr") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -36,18 +37,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") diff --git a/recipes/kainjow-mustache/all/conanfile.py b/recipes/kainjow-mustache/all/conanfile.py index 5a235a430af98..0d2d3ee8e05e2 100644 --- a/recipes/kainjow-mustache/all/conanfile.py +++ b/recipes/kainjow-mustache/all/conanfile.py @@ -1,35 +1,48 @@ -from conans import ConanFile, tools import os -import glob + +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 KainjowMustacheConan(ConanFile): name = "kainjow-mustache" description = "Mustache text templates for modern C++" - topics = ("conan", "mustache", "template") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/kainjow/Mustache" - license = "BSL-1.0" + topics = ("mustache", "template", "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]) - os.rename( - "Mustache-{}".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("mustache.hpp", dst=os.path.join("include", "kainjow"), 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, "mustache.hpp", + dst=os.path.join(self.package_folder, "include", "kainjow"), + src=self.source_folder) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "kainjow_mustache") + self.cpp_info.set_property("cmake_target_name", "kainjow_mustache::kainjow_mustache") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "kainjow_mustache" self.cpp_info.names["cmake_find_package_multi"] = "kainjow_mustache" diff --git a/recipes/kainjow-mustache/all/test_package/CMakeLists.txt b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt index 10c7c5ddbef7f..931342e8916cd 100644 --- a/recipes/kainjow-mustache/all/test_package/CMakeLists.txt +++ b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.9) -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(kainjow_mustache REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE kainjow_mustache::kainjow_mustache) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/kainjow-mustache/all/test_package/conanfile.py b/recipes/kainjow-mustache/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/kainjow-mustache/all/test_package/conanfile.py +++ b/recipes/kainjow-mustache/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/kainjow-mustache/all/test_package/test_package.cpp b/recipes/kainjow-mustache/all/test_package/test_package.cpp index e2d83b0f477ec..d45d847b4bf07 100644 --- a/recipes/kainjow-mustache/all/test_package/test_package.cpp +++ b/recipes/kainjow-mustache/all/test_package/test_package.cpp @@ -1,18 +1,15 @@ -#include #include "kainjow/mustache.hpp" - +#include int main() { - using namespace kainjow::mustache; + using namespace kainjow::mustache; - mustache tmpl{"{{#employees}}{{name}}{{#comma}}, {{/comma}}{{/employees}}"}; - data employees{data::type::list}; - employees - << object{{"name", "Steve"}, {"comma", true}} - << object{{"name", "Bill"}}; + mustache tmpl{"{{#employees}}{{name}}{{#comma}}, {{/comma}}{{/employees}}"}; + data employees{data::type::list}; + employees << object{{"name", "Steve"}, {"comma", true}} << object{{"name", "Bill"}}; - if( tmpl.render({"employees", employees}) == "Steve, Bill" ) { - return 0; - } - return 1; + if (tmpl.render({"employees", employees}) == "Steve, Bill") { + return 0; + } + return 1; } diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml b/recipes/kaitai_struct_cpp_stl_runtime/all/conandata.yml index 1a2d17950129d..86037b3ef63f6 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 4940a6da6e857..ee40515a48071 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 0000000000000..ca0d4c309f4aa --- /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 25aabe969604c..aa873ad2d383c 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 7cacb93f9b616..5c977f020a27d 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 f77751b7637b4..a57d047923a8a 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 0feb437e18418..0000000000000 --- 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 da8ca059669a3..4ecaaa44cfb1c 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 ea23c3a999a55..0146b7ee7c3cc 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 b8c9f32e1e658..0000000000000 --- 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 d5b08913be93b..b15d2eca4c2a3 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 f8eeed898d7bd..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..f8eeed898d7bd --- /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 0000000000000..fa9ce176c1b03 --- /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 0000000000000..9f1cf776a90f2 --- /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 0000000000000..cbd352d1e0df7 --- /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 0000000000000..e845ae751a301 --- /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 0000000000000..82e0dc503f17b --- /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 0000000000000..372dd1cb646bd --- /dev/null +++ b/recipes/kdbindings/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.3": + folder: all diff --git a/recipes/keychain/all/CMakeLists.txt b/recipes/keychain/all/CMakeLists.txt deleted file mode 100644 index 1848ca5a77c35..0000000000000 --- a/recipes/keychain/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/keychain/all/conandata.yml b/recipes/keychain/all/conandata.yml index b28baa662e7b6..af35ed376e432 100644 --- a/recipes/keychain/all/conandata.yml +++ b/recipes/keychain/all/conandata.yml @@ -2,3 +2,6 @@ sources: "1.2.0": url: "https://github.com/hrantzsch/keychain/archive/v1.2.0.tar.gz" sha256: "82cc66a7fa12af43f3e2efeb378bacb0a514056617e369430f252da2392acaae" + "1.2.1": + url: "https://github.com/hrantzsch/keychain/archive/v1.2.1.tar.gz" + sha256: "725cc30da0451403713dee648edd06686fdc31b5041e75e3350e6056c78de076" diff --git a/recipes/keychain/all/conanfile.py b/recipes/keychain/all/conanfile.py index d6ff7829ddf3c..64b3ee8743d71 100644 --- a/recipes/keychain/all/conanfile.py +++ b/recipes/keychain/all/conanfile.py @@ -1,60 +1,75 @@ -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, replace_in_file +from conan.tools.gnu import PkgConfigDeps + import os + class KeychainConan(ConanFile): name = "keychain" homepage = "https://github.com/hrantzsch/keychain" description = "A cross-platform wrapper for the operating system's credential storage" - topics = ("conan", "keychain", "security", "credentials", "password", "cpp11") + topics = ("keychain", "security", "credentials", "password", "cpp11") url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "library" settings = "os", "arch", "compiler", "build_type" - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "pkg_config" - options = {'fPIC': [False, True]} - default_options = {'fPIC': True} - - @property - def _source_subfolder(self): - return "source_subfolder" - - def configure(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + options = {'shared': [False, True], 'fPIC': [False, True]} + 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 validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, 11) + def requirements(self): if self.settings.os == "Linux": - self.requires("libsecret/0.20.4") + self.requires("libsecret/0.20.5") + self.requires("glib/2.78.1") def build_requirements(self): if self.settings.os == "Linux": - self.build_requires("pkgconf/1.7.3") + self.tool_requires("pkgconf/2.0.3") + + 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) + # Ensure .dll is installed on Windows + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "TARGETS ${PROJECT_NAME}", "TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin") - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTS"] = False - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + # Export all symbols by default to allow generating a shared library with msvc + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + pc = PkgConfigDeps(self) + pc.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() def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.settings.os == 'Macos': self.cpp_info.frameworks = ['Security', 'CoreFoundation'] diff --git a/recipes/keychain/all/test_package/CMakeLists.txt b/recipes/keychain/all/test_package/CMakeLists.txt index 8a9dd0b5b3015..84121712cf11b 100644 --- a/recipes/keychain/all/test_package/CMakeLists.txt +++ b/recipes/keychain/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(keychain CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON) +target_link_libraries(${PROJECT_NAME} keychain::keychain) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/keychain/all/test_package/conanfile.py b/recipes/keychain/all/test_package/conanfile.py index bd7165a553cf4..e0f3e3cf43edb 100644 --- a/recipes/keychain/all/test_package/conanfile.py +++ b/recipes/keychain/all/test_package/conanfile.py @@ -1,17 +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, cmake_layout + import os class TestPackageConan(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 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): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/keychain/all/test_package/test_package.cpp b/recipes/keychain/all/test_package/test_package.cpp index b28378d16ed4a..fef9682a48345 100644 --- a/recipes/keychain/all/test_package/test_package.cpp +++ b/recipes/keychain/all/test_package/test_package.cpp @@ -1,4 +1,5 @@ #include +#include using namespace keychain; @@ -13,5 +14,7 @@ void never_called(Error &error) { int main() { Error error; + + std::cout << "Keychain Conan test_package\n"; return error.type == ErrorType::NoError ? 0 : 1; } diff --git a/recipes/keychain/config.yml b/recipes/keychain/config.yml index 7ed1f1b6fc695..307602a029f0f 100644 --- a/recipes/keychain/config.yml +++ b/recipes/keychain/config.yml @@ -1,3 +1,5 @@ versions: "1.2.0": folder: all + "1.2.1": + folder: all diff --git a/recipes/khrplatform/all/conanfile.py b/recipes/khrplatform/all/conanfile.py index 4125f97c39bdb..8a3e15b829a64 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 0000000000000..26db9ceb70f4e --- /dev/null +++ b/recipes/kickcat/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "v2.0-rc1": + url: "https://github.com/leducp/KickCAT/archive/refs/tags/v2.0-rc1.zip" + sha256: "3feec08fd2718d286a041cb83266479840f7739c1203b4450375ea1f59f234c8" + "v2-alpha4": + url: "https://github.com/leducp/KickCAT/archive/refs/tags/v2-alpha4.zip" + sha256: "483a374f77808cb35823652eb37c5ab864a3f12a1c3a957d3315c319ca0ec528" + "v2-alpha3": + url: "https://github.com/leducp/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 0000000000000..abaf5d422d588 --- /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 0000000000000..8b77c31d9ca12 --- /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 0000000000000..e46a141327eed --- /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 0000000000000..a0ac4c8fdf423 --- /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 0000000000000..8eaf698f74187 --- /dev/null +++ b/recipes/kickcat/config.yml @@ -0,0 +1,7 @@ +versions: + "v2.0-rc1": + folder: all + "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 d17aaff199b4a..0000000000000 --- 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 7db05a55fbcac..04b20a94ca5f9 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 60b5b3b426db6..8f30ef6f01138 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 38f4483872d47..ef5d7042163ec 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 8ddfae2423dd7..50559e2a32b1d 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 f60d2ebc28242..9877db42cb118 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 872df15047bc5..5d9cc3ea68050 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/kuba-zip/all/conandata.yml b/recipes/kuba-zip/all/conandata.yml index 687b00ee7e238..707848aa88e1e 100644 --- a/recipes/kuba-zip/all/conandata.yml +++ b/recipes/kuba-zip/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.3.1": + url: "https://github.com/kuba--/zip/archive/v0.3.1.tar.gz" + sha256: "775b8a44b53e72a55c13839bf507219c2cf30b26f62e70f1a20bb727db54438f" + "0.3.0": + url: "https://github.com/kuba--/zip/archive/v0.3.0.tar.gz" + sha256: "feb70ae0fe5948b805635b3cc2f3b7f074662c481981857bc6b5896a4343fe5e" "0.2.6": url: "https://github.com/kuba--/zip/archive/v0.2.6.tar.gz" sha256: "6a00e10dc5242f614f76f1bd1d814726a41ee6e3856ef3caf7c73de0b63acf0b" diff --git a/recipes/kuba-zip/config.yml b/recipes/kuba-zip/config.yml index 7244cf3b53ff7..ab67eaba39ebb 100644 --- a/recipes/kuba-zip/config.yml +++ b/recipes/kuba-zip/config.yml @@ -1,4 +1,8 @@ versions: + "0.3.1": + folder: "all" + "0.3.0": + folder: "all" "0.2.6": folder: "all" "0.2.5": diff --git a/recipes/lager/all/conandata.yml b/recipes/lager/all/conandata.yml new file mode 100644 index 0000000000000..e2389a84794f3 --- /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 0000000000000..296459306e38a --- /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 0000000000000..d147f04fcbbe1 --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..c61d64b17b9ae --- /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 0000000000000..b893ff21f7c23 --- /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 0000000000000..1f9c6533da7ce --- /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 0000000000000..f0f8f490335f9 --- /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 0000000000000..655f63d80bdcf --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..c0e33ee18739a --- /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 0000000000000..4d61dda20e41a --- /dev/null +++ b/recipes/lazycsv/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221117": + folder: all diff --git a/recipes/lcms/all/conandata.yml b/recipes/lcms/all/conandata.yml index 5dfb1d726c592..5887ed1478b6c 100644 --- a/recipes/lcms/all/conandata.yml +++ b/recipes/lcms/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.16": + url: "https://github.com/mm2/Little-CMS/releases/download/lcms2.16/lcms2-2.16.tar.gz" + sha256: "d873d34ad8b9b4cea010631f1a6228d2087475e4dc5e763eb81acc23d9d45a51" "2.14": url: "https://github.com/mm2/Little-CMS/releases/download/lcms2.14/lcms2-2.14.tar.gz" sha256: "28474ea6f6591c4d4cee972123587001a4e6e353412a41b3e9e82219818d5740" diff --git a/recipes/lcms/all/conanfile.py b/recipes/lcms/all/conanfile.py index 6a996a28f1758..42471635a5f47 100644 --- a/recipes/lcms/all/conanfile.py +++ b/recipes/lcms/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.microsoft import check_min_vs +from conan.tools.scm import Version import os required_conan_version = ">=1.57.0" @@ -45,7 +46,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) @@ -70,7 +71,8 @@ def build(self): meson.build() def package(self): - copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + license_file = "LICENSE" if Version(self.version) >= "2.16" else "COPYING" + copy(self, license_file, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) meson = Meson(self) meson.install() rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) diff --git a/recipes/lcms/config.yml b/recipes/lcms/config.yml index 8a6c0dd7e6e99..5bef14d0c33a0 100644 --- a/recipes/lcms/config.yml +++ b/recipes/lcms/config.yml @@ -1,4 +1,6 @@ versions: + "2.16": + folder: all "2.14": folder: all "2.13.1": diff --git a/recipes/ldns/all/conandata.yml b/recipes/ldns/all/conandata.yml index a5e4b6259dffa..44d9095cd63eb 100644 --- a/recipes/ldns/all/conandata.yml +++ b/recipes/ldns/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.2": + url: "https://nlnetlabs.nl/downloads/ldns/ldns-1.8.2.tar.gz" + sha256: "b92b001cdd382de653620a05445e42e17a827eec93d64ee587ad291a533cc1e9" "1.8.1": url: "https://nlnetlabs.nl/downloads/ldns/ldns-1.8.1.tar.gz" sha256: "958229abce4d3aaa19a75c0d127666564b17216902186e952ca4aef47c6d7fa3" diff --git a/recipes/ldns/all/conanfile.py b/recipes/ldns/all/conanfile.py index b6e94e58b15d8..531318c15033c 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/ldns/all/test_package/conanfile.py b/recipes/ldns/all/test_package/conanfile.py index b741b0a2b795c..651afdb268a4f 100644 --- a/recipes/ldns/all/test_package/conanfile.py +++ b/recipes/ldns/all/test_package/conanfile.py @@ -14,6 +14,10 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/ldns/all/test_v1_package/conanfile.py b/recipes/ldns/all/test_v1_package/conanfile.py index 648cf88ac9c76..17fb742bffdde 100644 --- a/recipes/ldns/all/test_v1_package/conanfile.py +++ b/recipes/ldns/all/test_v1_package/conanfile.py @@ -7,6 +7,10 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "pkg_config" + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.build_requires("pkgconf/2.1.0") + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/ldns/config.yml b/recipes/ldns/config.yml index c3578038cb2a3..29db722a9f041 100644 --- a/recipes/ldns/config.yml +++ b/recipes/ldns/config.yml @@ -1,3 +1,5 @@ versions: - "1.8.1": - folder: all + "1.8.2": + folder: all + "1.8.1": + folder: all diff --git a/recipes/lefticus-tools/all/conandata.yml b/recipes/lefticus-tools/all/conandata.yml new file mode 100644 index 0000000000000..5f60c304dca5d --- /dev/null +++ b/recipes/lefticus-tools/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230420": + url: "https://github.com/lefticus/tools/archive/137dd15b8aa9d43cc8633b972eec82c9009b6bbd.tar.gz" + sha256: "f1ef4929ea608fb466e11af635d2537808a7df7b1bc664d9742d147ed08e24c2" diff --git a/recipes/lefticus-tools/all/conanfile.py b/recipes/lefticus-tools/all/conanfile.py new file mode 100644 index 0000000000000..d3dbf33094acc --- /dev/null +++ b/recipes/lefticus-tools/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class LefticusToolsConan(ConanFile): + name = "lefticus-tools" + description = "Some handy C++ tools" + topics = ("tools", "cpp", "cmake") + license = "MIT" + homepage = "https://github.com/lefticus/tools" + 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 "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "13", + "apple-clang": "14", + } + + 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) + 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 build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="ProjectOptions", dst=os.path.join(self.package_folder, "lib", "cmake"), src=self.source_folder) + copy(self, pattern="*.cmake", dst=os.path.join(self.package_folder, "lib", "cmake", "cmake"), src=os.path.join(self.source_folder, "cmake")) + 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.set_property("cmake_target_name", "lefticus::tools") + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] diff --git a/recipes/lefticus-tools/all/test_package/CMakeLists.txt b/recipes/lefticus-tools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d6a06ccd62240 --- /dev/null +++ b/recipes/lefticus-tools/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(lefticus-tools REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE lefticus::tools) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/lefticus-tools/all/test_package/conanfile.py b/recipes/lefticus-tools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..254feca104287 --- /dev/null +++ b/recipes/lefticus-tools/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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/lefticus-tools/all/test_package/test_package.cpp b/recipes/lefticus-tools/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..01077cece833f --- /dev/null +++ b/recipes/lefticus-tools/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +#include "lefticus/tools/consteval_invoke.hpp" + + +constexpr unsigned int Factorial(unsigned int number) { + return number <= 1 ? number : Factorial(number - 1) * number; +} + + +int main() { + std::cout << "Factorial of 3 is: " << lefticus::tools::consteval_invoke(Factorial, 3) << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/lefticus-tools/config.yml b/recipes/lefticus-tools/config.yml new file mode 100644 index 0000000000000..7c6ba2bb8da04 --- /dev/null +++ b/recipes/lefticus-tools/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230420": + folder: all diff --git a/recipes/lely-core/all/conandata.yml b/recipes/lely-core/all/conandata.yml index cc7e4931e5ec2..365fdf916f614 100644 --- a/recipes/lely-core/all/conandata.yml +++ b/recipes/lely-core/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.3": + url: "https://gitlab.com/lely_industries/lely-core/-/archive/v2.3.3/lely-core-v2.3.3.tar.gz" + sha256: "6d0810f9e835543f0aeb5f86dcdc7a24578041f5d0a714bf5a14db2cb24ce373" "2.3.2": url: "https://gitlab.com/lely_industries/lely-core/-/archive/v2.3.2/lely-core-v2.3.2.tar.gz" sha256: "c37eb6f004ad1a1ec1f891e31a09b72f588da361fa92888e8edfcf215a1d707a" diff --git a/recipes/lely-core/all/conanfile.py b/recipes/lely-core/all/conanfile.py index f57056df76197..9ed8f191a0a19 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/lely-core/config.yml b/recipes/lely-core/config.yml index aee8de619ec30..5ca4acfdc4f7b 100644 --- a/recipes/lely-core/config.yml +++ b/recipes/lely-core/config.yml @@ -1,3 +1,5 @@ versions: + "2.3.3": + folder: all "2.3.2": folder: all diff --git a/recipes/leptonica/all/conandata.yml b/recipes/leptonica/all/conandata.yml index 2902df5b0c405..49782e81d8fcd 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 109404f2d8984..6bcb75d8840d6 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.39") + self.requires("libpng/1.6.40") if self.options.with_tiff: - self.requires("libtiff/4.4.0") + 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.0") + 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 36297367918ec..7de53a77a3916 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 f1d58df7a46b7..73b69372cf8f4 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 6bcfdf0332e1f..a09a8d0001ec6 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/lest/all/conanfile.py b/recipes/lest/all/conanfile.py index 64f52a3c5b929..8360bb0147108 100644 --- a/recipes/lest/all/conanfile.py +++ b/recipes/lest/all/conanfile.py @@ -1,27 +1,47 @@ import os -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + class LestConan(ConanFile): name = "lest" - description = "A modern, C++11-native, single-file header-only, tiny framework for unit-tests, TDD and BDD." + description = ( + "A modern, C++11-native, single-file header-only, " + "tiny framework for unit-tests, TDD and BDD." + ) license = "BSL-1.0" - topics = ("conan", "testing", "testing-framework", "unit-testing", "header-only") - homepage = "https://github.com/martinmoene/lest" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/lest" + topics = ("testing", "testing-framework", "unit-testing", "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]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.hpp", 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, + pattern="*.hpp", + 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/lest/all/test_package/CMakeLists.txt b/recipes/lest/all/test_package/CMakeLists.txt index 33ae887aa6aea..5d9ebbc9ca6a1 100644 --- a/recipes/lest/all/test_package/CMakeLists.txt +++ b/recipes/lest/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(lest REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE lest::lest) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/lest/all/test_package/conanfile.py b/recipes/lest/all/test_package/conanfile.py index ea57a464900be..ef5d7042163ec 100644 --- a/recipes/lest/all/test_package/conanfile.py +++ b/recipes/lest/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/lexbor/all/conandata.yml b/recipes/lexbor/all/conandata.yml index ae25e89b70b28..ea023ab0ff4cf 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 ca654973c9512..1da7c205b6ff2 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 0000000000000..423d807676428 --- /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 0000000000000..5a2d1592cd373 --- /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 0000000000000..17f6f991a5f99 --- /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 0000000000000..ed4bf02743021 --- /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 0000000000000..f5cf204295e19 --- /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 0000000000000..af96572482927 --- /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 0000000000000..97cadcf3a3227 --- /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 55a14a6d4051e..c612ddb389783 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 b1fdda2825fa6..ce651c2f0d63a 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 17b677e8b1c9a..bb3a5a205cc9f 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 55199e7891956..2ac5e2242b2d4 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 9a164839a427b..b08c943036aa4 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 7b3f2cc70c9d0..2f2b32fea9625 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -81,19 +81,19 @@ 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.3") 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") + self.requires("nettle/3.9.1") if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_libb2: @@ -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.1") 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 62dd3ef819875..9e88323972df9 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 0000000000000..beb5f743fa31f --- /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 0000000000000..9c5a48b11c9e1 --- /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 7b724f1fba164..7b34085f1a3a2 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 5c46b58290b77..45a9561474f8e 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 0000000000000..181a183093fc3 --- /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 5584b5f1606bc..46955b7f8f7ce 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 436c8194e3e4d..3c89010df2aba 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 80d49396aac87..aca2961950d2d 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 0000000000000..67a75a07b08b2 --- /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 4bca48088c19b..69e42f1f5678b 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 0000000000000..c71291d02944a --- /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 0000000000000..c0903cf80cf94 --- /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 0000000000000..04ec53a2e20ba --- /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 0000000000000..6db790a6cd811 --- /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 2cfb62acf5228..0331875919146 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 ce3617941de3e..1cae5dc94ff57 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 8b59411a354b3..c596be696aeb2 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 0000000000000..feca84df9664e --- /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 0000000000000..27871ced2d3f0 --- /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 32641e4d3c230..f5cf204295e19 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 4bd48fe4effaa..751d401023f78 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 74182229a4469..7e264aad8e8ec 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 b0be8446640a5..8ade508384535 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/libatomic_ops/all/conandata.yml b/recipes/libatomic_ops/all/conandata.yml index 04ee70160921a..ca0f7bac81a72 100644 --- a/recipes/libatomic_ops/all/conandata.yml +++ b/recipes/libatomic_ops/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "7.8.0": - url: "https://github.com/ivmai/libatomic_ops/releases/download/v7.8.0/libatomic_ops-7.8.0.tar.gz" - sha256: "15676e7674e11bda5a7e50a73f4d9e7d60452271b8acf6fd39a71fefdf89fa31" + "7.8.2": + url: "https://github.com/ivmai/libatomic_ops/releases/download/v7.8.2/libatomic_ops-7.8.2.tar.gz" + sha256: "d305207fe207f2b3fb5cb4c019da12b44ce3fcbc593dfd5080d867b1a2419b51" diff --git a/recipes/libatomic_ops/config.yml b/recipes/libatomic_ops/config.yml index 95536563a1815..03c7395ab6c04 100644 --- a/recipes/libatomic_ops/config.yml +++ b/recipes/libatomic_ops/config.yml @@ -1,3 +1,3 @@ versions: - "7.8.0": + "7.8.2": folder: all diff --git a/recipes/libavif/all/conandata.yml b/recipes/libavif/all/conandata.yml index 1889bd2ede18f..cf855ce45dc5b 100644 --- a/recipes/libavif/all/conandata.yml +++ b/recipes/libavif/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.0.3": + url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v1.0.3.tar.gz" + sha256: "35e3cb3cd7158209dcc31d3bf222036de5b9597e368a90e18449ecc89bb86a19" + "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 +15,18 @@ sources: url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.9.3.tar.gz" sha256: "bcd9a1f57f982a9615eb7e2faf87236dc88eb1d0c886f3471c7440ead605060d" patches: + "1.0.3": + - patch_file: patches/1.0.1-0001-disable-developer-only-codepaths.patch + patch_description: "disable compiler options for develop" + patch_type: "portability" + "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 dc46d0267dd99..49fe058e91455 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 0000000000000..9bedacfdc3b86 --- /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 f3e6d6038f1fa..74dbb33aa4932 100644 --- a/recipes/libavif/config.yml +++ b/recipes/libavif/config.yml @@ -1,4 +1,10 @@ versions: + "1.0.3": + folder: all + "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 ba9b7e9e27948..9834b369a4d4b 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 88ad67891d73b..ffc67ff6345fe 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 6aab347eddf53..a422f3ac0c116 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 0383b1729b064..8d52b7021efe1 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 0000000000000..91630d79f4abb --- /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 0000000000000..24ecc57793dc6 --- /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 bd4164cb5c1c7..0000000000000 --- 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 7cca98d66479b..7f4a8cfdd695f 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 6dfaf4ee7f3de..2c8606aca448a 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 043a9778c605d..69bef6820b138 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 2adca01f3e68a..e4b4ddeb886b6 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 12dd810a6ab3b..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..abcaeed3f89b6 --- /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 0f28a5364da62..2795e50cf9841 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.0.1", transitive_headers=True) + self.requires("libcurl/[>=7.78.0 <9]", transitive_headers=True) if self.options.with_zlibng: - self.requires("zlib-ng/2.0.7") + self.requires("zlib-ng/2.1.6") 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 dced81ebf510c..2d16ec7238800 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 fcb6be22798a8..b154fd66ef174 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 4383f9baf5229..6fd5fe398b43d 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 5d119b718f418..16d2439fd2b12 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 000b95ab28ae5..6412745da8b97 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 f480305272e38..a24aa126c9102 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 24a13cbb3bd22..9ca623681ce66 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 bd3083b512cb9..0000000000000 --- 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 767df99b3d51a..fbaed8dabebec 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 5113b075852b0..4837f11de4b81 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 320eb687dab0f..55bb33e3fe378 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 d0ea6b764c70f..c0946969bf599 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 38f4483872d47..ef5d7042163ec 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 bd3083b512cb9..0000000000000 --- 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 933f8a2810d53..0cce54484d005 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 016cb1a3f6f02..eebfa5aaa0ba0 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 b81eef988f5b5..999bf7cd574a5 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 8bd5d5d915f3d..e1b4c4f5f3efb 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 0000000000000..91630d79f4abb --- /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 0000000000000..0e1f34afd83e4 --- /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 2b90fe3a049b9..4bddf9ef347cf 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 b59d551a8df2f..08d79c6bc3667 100644 --- a/recipes/libcoro/all/conandata.yml +++ b/recipes/libcoro/all/conandata.yml @@ -1,15 +1,39 @@ 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" "0.7": 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" + patch_description: "Allow to build the library as a shared library" + - patch_file: "patches/0.8-0002-disable-git-config.patch" + patch_type: "conan" + patch_description: "Comment out invocation of git config command" "0.7": - - patch_file: "patches/allow-shared-lib.patch" + - patch_file: "patches/0.7-0001-allow-shared-lib.patch" patch_type: "conan" patch_description: "Allow to build the library as a shared library" - - patch_file: "patches/disable-git-config.patch" + - patch_file: "patches/0.7-0002-disable-git-config.patch" patch_type: "conan" patch_description: "Comment out invocation of git config command" - - patch_file: "patches/fix-dependencies.patch" + - patch_file: "patches/0.7-0003-fix-dependencies.patch" patch_type: "conan" patch_description: "Replace add_subdirectory dependencies with find_package" diff --git a/recipes/libcoro/all/conanfile.py b/recipes/libcoro/all/conanfile.py index 2d097def986f0..1117b3d012d2a 100644 --- a/recipes/libcoro/all/conanfile.py +++ b/recipes/libcoro/all/conanfile.py @@ -12,19 +12,25 @@ class LibcoroConan(ConanFile): name = "libcoro" description = "C++20 coroutine library" - homepage = "https://github.com/jbaldwin/libcoro" topics = ("coroutines", "concurrency", "tasks", "executors", "networking") license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jbaldwin/libcoro" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "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 @@ -43,6 +49,11 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": 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: @@ -52,8 +63,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("openssl/3.1.0", transitive_headers=True) - self.requires("c-ares/1.19.0", 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) def validate(self): @@ -77,6 +89,12 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["LIBCORO_BUILD_TESTS"] = False tc.variables["LIBCORO_BUILD_EXAMPLES"] = False + 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() @@ -96,6 +114,17 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "libcoro") self.cpp_info.set_property("cmake_target_name", "libcoro::libcoro") - self.cpp_info.libs = ["libcoro"] + if Version(self.version) >= "0.8": + self.cpp_info.libs = ["coro"] + 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/allow-shared-lib.patch b/recipes/libcoro/all/patches/0.7-0001-allow-shared-lib.patch similarity index 100% rename from recipes/libcoro/all/patches/allow-shared-lib.patch rename to recipes/libcoro/all/patches/0.7-0001-allow-shared-lib.patch diff --git a/recipes/libcoro/all/patches/disable-git-config.patch b/recipes/libcoro/all/patches/0.7-0002-disable-git-config.patch similarity index 100% rename from recipes/libcoro/all/patches/disable-git-config.patch rename to recipes/libcoro/all/patches/0.7-0002-disable-git-config.patch diff --git a/recipes/libcoro/all/patches/fix-dependencies.patch b/recipes/libcoro/all/patches/0.7-0003-fix-dependencies.patch similarity index 100% rename from recipes/libcoro/all/patches/fix-dependencies.patch rename to recipes/libcoro/all/patches/0.7-0003-fix-dependencies.patch diff --git a/recipes/libcoro/all/patches/0.8-0001-allow-shared-lib.patch b/recipes/libcoro/all/patches/0.8-0001-allow-shared-lib.patch new file mode 100644 index 0000000000000..0481b258f7f9a --- /dev/null +++ b/recipes/libcoro/all/patches/0.8-0001-allow-shared-lib.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f37206b..8221a5d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -91,7 +91,7 @@ if(LIBCORO_FEATURE_NETWORKING) + ) + 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.8-0002-disable-git-config.patch b/recipes/libcoro/all/patches/0.8-0002-disable-git-config.patch new file mode 100644 index 0000000000000..9996b0fa3402a --- /dev/null +++ b/recipes/libcoro/all/patches/0.8-0002-disable-git-config.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8de8174..4790572 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,13 +11,6 @@ if (NOT "$ENV{version}" STREQUAL "") + set(PROJECT_VERSION "$ENV{version}" CACHE INTERNAL "Copied from environment variable") + 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} +-) +- + 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) + option(LIBCORO_CODE_COVERAGE "Enable code coverage, tests must also be enabled, Default=OFF" OFF) 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 0000000000000..4838c6103aa0f --- /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 0000000000000..b169455e6e1ba --- /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 0000000000000..eac4b8bc794e6 --- /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 0536885a53045..77538762e21e7 100644 --- a/recipes/libcoro/config.yml +++ b/recipes/libcoro/config.yml @@ -1,3 +1,7 @@ versions: + "0.9": + folder: all + "0.8": + folder: all "0.7": folder: all diff --git a/recipes/libcpuid/all/CMakeLists.txt b/recipes/libcpuid/all/CMakeLists.txt deleted file mode 100644 index dcbf69112bb06..0000000000000 --- 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 133cbeb595d14..a10d26bb3cb6c 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 68d83bcf3f7fc..819fb78b61c57 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 bbffbda24bead..a08817e34e922 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 a2a865893b40b..b71178d68741b 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 0000000000000..91630d79f4abb --- /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 0000000000000..a2a865893b40b --- /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 98dd67e54de0e..3a12a85c5d679 100644 --- a/recipes/libcurl/all/conandata.yml +++ b/recipes/libcurl/all/conandata.yml @@ -1,40 +1,86 @@ sources: + "8.5.0": + url: + - "https://curl.se/download/curl-8.5.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_5_0/curl-8.5.0.tar.xz" + sha256: "42ab8db9e20d8290a3b633e7fbb3cec15db34df65fd1015ef8ac1e4723750eeb" + "8.4.0": + url: + - "https://curl.se/download/curl-8.4.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_4_0/curl-8.4.0.tar.xz" + sha256: "16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d" + "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.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.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 d7c8bcbae11b7..d2f7a3c31bd9a 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: @@ -183,19 +174,19 @@ def requirements(self): if self.options.with_ssl == "openssl": self.requires("openssl/[>=1.1 <4]") elif self.options.with_ssl == "wolfssl": - self.requires("wolfssl/5.5.1") + self.requires("wolfssl/5.6.3") if self.options.with_nghttp2: - self.requires("libnghttp2/1.51.0") + self.requires("libnghttp2/1.58.0") if self.options.with_libssh2: - self.requires("libssh2/1.10.0") + 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.0") + 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.1.0") if self.settings.os in [ "tvOS", "watchOS" ]: self.tool_requires("gnu-config/cci.20210814") if self._settings_build.os == "Windows": @@ -226,8 +217,8 @@ def build_requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - cert_url = self.conf.get("user.libcurl.cert:url", check_type=str) or "https://curl.se/ca/cacert-2023-01-10.pem" - cert_sha256 = self.conf.get("user.libcurl.cert:sha256", check_type=str) or "fb1ecd641d0a02c01bc9036d513cb658bbda62a75e246bedbc01764560a639f0" + cert_url = self.conf.get("user.libcurl.cert:url", check_type=str) or "https://curl.se/ca/cacert-2023-08-22.pem" + cert_sha256 = self.conf.get("user.libcurl.cert:sha256", check_type=str) or "23c2469e2a568362a62eecf1b49ed90a15621e6fa30e29947ded3436422de9b9" download(self, cert_url, "cacert.pem", verify=True, sha256=cert_sha256) def generate(self): @@ -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 7a5cb866faa93..0000000000000 --- 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 8e9856b18ba3a..8e607e7cc2a0e 100644 --- a/recipes/libcurl/config.yml +++ b/recipes/libcurl/config.yml @@ -1,4 +1,16 @@ versions: + "8.5.0": + folder: all + "8.4.0": + folder: all + "8.2.1": + folder: all + "8.2.0": + folder: all + "8.1.2": + folder: all + "8.1.1": + folder: all "8.0.1": folder: all "7.88.1": @@ -21,7 +33,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 0707d6df726bf..f522bcff96322 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 2500bfb57361a..7e15eabaa687f 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 742431d50ece2..0000000000000 --- 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 7b9b613cbb24a..ee5ced82bf710 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 d919133e5c230..91a8fc7a09b42 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 0000000000000..a83b3cc09a879 --- /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 d94592e5c75f1..0000000000000 --- 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 0000000000000..b9027a80ab6af --- /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 0000000000000..d919133e5c230 --- /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/conandata.yml b/recipes/libdc1394/all/conandata.yml index f12a9d3794e20..72fa1e3400e1a 100644 --- a/recipes/libdc1394/all/conandata.yml +++ b/recipes/libdc1394/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.7": + url: "https://sourceforge.net/projects/libdc1394/files/libdc1394-2/2.2.7/libdc1394-2.2.7.tar.gz" + sha256: "537ceb78dd3cef271a183f4a176191d1cecf85f025520e6bd3758b0e19e6609f" "2.2.6": url: "https://sourceforge.net/projects/libdc1394/files/libdc1394-2/2.2.6/libdc1394-2.2.6.tar.gz" sha256: "2b905fc9aa4eec6bdcf6a2ae5f5ba021232739f5be047dec8fe8dd6049c10fed" diff --git a/recipes/libdc1394/all/conanfile.py b/recipes/libdc1394/all/conanfile.py index f52cb3b808339..0ac48cba03bef 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/libdc1394/config.yml b/recipes/libdc1394/config.yml index 02d886e69e974..ca2455c42caf9 100644 --- a/recipes/libdc1394/config.yml +++ b/recipes/libdc1394/config.yml @@ -1,3 +1,5 @@ versions: + "2.2.7": + folder: all "2.2.6": folder: all diff --git a/recipes/libde265/all/conandata.yml b/recipes/libde265/all/conandata.yml index 1536fa75197a7..3dd8fd65fd529 100644 --- a/recipes/libde265/all/conandata.yml +++ b/recipes/libde265/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.0.15": + url: "https://github.com/strukturag/libde265/releases/download/v1.0.15/libde265-1.0.15.tar.gz" + sha256: "00251986c29d34d3af7117ed05874950c875dd9292d016be29d3b3762666511d" + "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 286e6952e05dc..6618b97bf0692 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 d32ffee4c65d8..4323cd76505c9 100644 --- a/recipes/libde265/config.yml +++ b/recipes/libde265/config.yml @@ -1,4 +1,8 @@ versions: + "1.0.15": + folder: all + "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 01ec059a63c20..720157d82ac2b 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 2ecdca807a8d6..fe3db2bc74050 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 0000000000000..8eb7bfa03fad7 --- /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 0000000000000..ab459c73d54b3 --- /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 0000000000000..2e3df45816e5a --- /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 0000000000000..706b1702c86ed --- /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 0000000000000..1c30db0e66514 --- /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 0000000000000..84f5016ed4a14 --- /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 217b9530b904d..0000000000000 --- 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 e88fe5b5ab8e0..e5d4766a02600 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 d66f5d5a5a432..3bc47f2c45cd7 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 9294e13566895..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..b6f313836cc05 --- /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 0000000000000..916fa487be227 --- /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 0000000000000..4bb6e6e322b36 --- /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 0000000000000..2e3df45816e5a --- /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 0000000000000..3b75f6e4e942b --- /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 0000000000000..21c1bf8b467cd --- /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 0000000000000..b893ff21f7c23 --- /dev/null +++ b/recipes/libdisplay-info/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.1": + folder: all diff --git a/recipes/libdivide/all/conanfile.py b/recipes/libdivide/all/conanfile.py index 47e6ad87f66f6..2252c68d61a0f 100644 --- a/recipes/libdivide/all/conanfile.py +++ b/recipes/libdivide/all/conanfile.py @@ -1,16 +1,24 @@ -from conans import ConanFile, tools +import os + +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 +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.33.0" class LibdivideConan(ConanFile): name = "libdivide" description = "Header-only C/C++ library for optimizing integer division." - topics = ("libdivide", "division", "integer", ) license = ["Zlib", "BSL-1.0"] - homepage = "http://libdivide.com/" url = "https://github.com/conan-io/conan-center-index" - settings = "arch", "compiler" - no_copy_source = True + homepage = "http://libdivide.com/" + topics = ("libdivide", "division", "integer", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" options = { "simd_intrinsics": [False, "sse2", "avx2", "avx512"], "sse2": [True, False], @@ -25,53 +33,52 @@ class LibdivideConan(ConanFile): "avx512": False, "neon": False, } - - @property - def _source_subfolder(self): - return "source_subfolder" + no_copy_source = True def config_options(self): - if tools.Version(self.version) < "4.0.0": - del self.options.sse2 - del self.options.avx2 - del self.options.avx512 - del self.options.neon + if Version(self.version) < "4.0.0": + self.options.rm_safe("sse2") + self.options.rm_safe("avx2") + self.options.rm_safe("avx512") + self.options.rm_safe("neon") if self.settings.arch not in ["x86", "x86_64"]: - del self.options.simd_intrinsics + self.options.rm_safe("simd_intrinsics") else: - del self.options.simd_intrinsics + self.options.rm_safe("simd_intrinsics") if self.settings.arch not in ["x86", "x86_64"]: - del self.options.sse2 - del self.options.avx2 - del self.options.avx512 + self.options.rm_safe("sse2") + self.options.rm_safe("avx2") + self.options.rm_safe("avx512") if not str(self.settings.arch).startswith("arm"): - del self.options.neon + self.options.rm_safe("neon") - def configure(self): - if tools.Version(self.version) < "4.0.0" and self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 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 Version(self.version) < "4.0.0" and 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy("libdivide.h", dst="include", src=self._source_subfolder) - self.copy("constant_fast_div.h", dst="include", src=self._source_subfolder) - self.copy("s16_ldparams.h", dst="include", src=self._source_subfolder) - self.copy("u16_ldparams.h", dst="include", src=self._source_subfolder) + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "libdivide.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "constant_fast_div.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "s16_ldparams.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "u16_ldparams.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 = [] + simd = self.options.get_safe("simd_intrinsics", False) if bool(simd): - self.cpp_info.defines = [ - {"sse2": "LIBDIVIDE_SSE2", - "avx2": "LIBDIVIDE_AVX2", - "avx512": "LIBDIVIDE_AVX512"}[str(simd)] - ] + self.cpp_info.defines = [{"sse2": "LIBDIVIDE_SSE2", "avx2": "LIBDIVIDE_AVX2", "avx512": "LIBDIVIDE_AVX512"}[str(simd)]] if self.options.get_safe("sse2", False): self.cpp_info.defines.append("LIBDIVIDE_SSE2") if self.options.get_safe("avx2", False): diff --git a/recipes/libdivide/all/test_package/CMakeLists.txt b/recipes/libdivide/all/test_package/CMakeLists.txt index c08b1cebc6009..619dae18c0777 100644 --- a/recipes/libdivide/all/test_package/CMakeLists.txt +++ b/recipes/libdivide/all/test_package/CMakeLists.txt @@ -1,15 +1,18 @@ -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 C) find_package(libdivide REQUIRED CONFIG) add_executable(${PROJECT_NAME}_c test_package.c) target_link_libraries(${PROJECT_NAME}_c libdivide::libdivide) -set_property(TARGET ${PROJECT_NAME}_c PROPERTY C_STANDARD 99) +set_target_properties(${PROJECT_NAME}_c PROPERTIES +C_STANDARD 99 +LINKER_LANGUAGE C +) add_executable(${PROJECT_NAME}_cpp test_package.cpp) target_link_libraries(${PROJECT_NAME}_cpp libdivide::libdivide) -set_property(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) +set_target_properties( ${PROJECT_NAME}_cpp PROPERTIES +CXX_STANDARD 11 +LINKER_LANGUAGE CXX +) diff --git a/recipes/libdivide/all/test_package/conanfile.py b/recipes/libdivide/all/test_package/conanfile.py index 0eee35d285cde..b89281b9f4061 100644 --- a/recipes/libdivide/all/test_package/conanfile.py +++ b/recipes/libdivide/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,8 +21,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_c_path = os.path.join("bin", "test_package_c") - self.run(bin_c_path, run_environment=True) - bin_cpp_path = os.path.join("bin", "test_package_cpp") - self.run(bin_cpp_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package_c") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package_cpp") + self.run(bin_path, env="conanrun") diff --git a/recipes/libdivide/all/test_v1_package/CMakeLists.txt b/recipes/libdivide/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libdivide/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/libdivide/all/test_v1_package/conanfile.py b/recipes/libdivide/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0eee35d285cde --- /dev/null +++ b/recipes/libdivide/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.settings): + bin_c_path = os.path.join("bin", "test_package_c") + self.run(bin_c_path, run_environment=True) + bin_cpp_path = os.path.join("bin", "test_package_cpp") + self.run(bin_cpp_path, run_environment=True) diff --git a/recipes/libdivide/all/test_v1_package/test_package.c b/recipes/libdivide/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..dc8a5151154fd --- /dev/null +++ b/recipes/libdivide/all/test_v1_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include +#include +#include + +int main() { + struct libdivide_s64_t fast_d = libdivide_s64_gen(30); + int64_t a = 60; + printf("%" PRId64 "\n", libdivide_s64_do(a, &fast_d)); + return 0; +} diff --git a/recipes/libdrawille/all/conandata.yml b/recipes/libdrawille/all/conandata.yml new file mode 100644 index 0000000000000..7562384137dba --- /dev/null +++ b/recipes/libdrawille/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "cci.20160428": + url: "https://github.com/Huulivoide/libdrawille/archive/e7e366e739c80120690dd0ee9f41648d2556f800.tar.gz" + sha256: "c4f4e4b74d419bb06e8fdf4886421216d65eb095e69fb8bcdeb33960bbd7ae16" +patches: + "cci.20160428": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "disable test, examples add installer, link mathlib only on Linux" + patch_type: "conan" + - patch_file: "patches/0002-support-msvc.patch" + patch_description: "rename restrict keyword for msvc" + patch_type: "portability" diff --git a/recipes/libdrawille/all/conanfile.py b/recipes/libdrawille/all/conanfile.py new file mode 100644 index 0000000000000..b6f2dc8f8a984 --- /dev/null +++ b/recipes/libdrawille/all/conanfile.py @@ -0,0 +1,74 @@ +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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + +class LibdrawilleConan(ConanFile): + name = "libdrawille" + description = "C implementation of drawille library and extra drawing functionality" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Huulivoide/libdrawille/" + topics = ("drawille") + 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 self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.ref} supports x86 and x86_64 only.") + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC.(yet)") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + 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 = ["drawille"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libdrawille/all/patches/0001-fix-cmake.patch b/recipes/libdrawille/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..e45992f62132f --- /dev/null +++ b/recipes/libdrawille/all/patches/0001-fix-cmake.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d225ed..dc1a1b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + cmake_minimum_required(VERSION 3.4) + project(libdrawille VERSION 0.0.1 LANGUAGES C) + +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -pedantic") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic") + set(CMAKE_C_STANDARD 11) + set(CMAKE_C_STANDARD_REQUIRED ON) + +@@ -12,6 +12,3 @@ elseif(${WIN32}) + endif() + + add_subdirectory(src) +-add_subdirectory(test) +-add_subdirectory(examples) +-add_subdirectory(benchmark) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3c74714..240ca8b 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,9 +1,26 @@ +-find_library(MATH m) +- + set(SOURCE_FILES Canvas.c stamp.c mat3.c polygon.c point.c utils.c x86/sse.c x86/avx2.c) + set_source_files_properties(x86/sse.c PROPERTIES COMPILE_FLAGS "-msse -msse2 -msse4") + set_source_files_properties(x86/avx2.c PROPERTIES COMPILE_FLAGS "-msse -msse2 -msse4 -mavx -mavx2") + +-add_library(libdrawille ${SOURCE_FILES}) +-target_link_libraries(libdrawille ${MATH}) ++add_library(drawille ${SOURCE_FILES}) ++ ++find_library(MATH m) ++if(MATH) ++ target_link_libraries(drawille ${MATH}) ++endif() ++ ++include(GNUInstallDirs) ++ ++install( ++ TARGETS drawille ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) + ++install( ++ FILES ++ Canvas.h ++ mat3.h ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/drawille ++) diff --git a/recipes/libdrawille/all/patches/0002-support-msvc.patch b/recipes/libdrawille/all/patches/0002-support-msvc.patch new file mode 100644 index 0000000000000..24685ef15d80a --- /dev/null +++ b/recipes/libdrawille/all/patches/0002-support-msvc.patch @@ -0,0 +1,95 @@ +diff --git a/src/stamp.c b/src/stamp.c +index 73c78d0..6da8910 100644 +--- a/src/stamp.c ++++ b/src/stamp.c +@@ -138,8 +138,13 @@ int draw_stamp_outline(Canvas* c, Color color, const Stamp* s) { + return 1; + } + ++#ifdef _MSC_VER ++void fill_triangle(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3) { ++#else + void fill_triangle(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3) { ++#endif + // 28.4 fixed-point coordinates + const int Y1 = to_fixed(v1.y); + const int Y2 = to_fixed(v2.y); +diff --git a/src/stamp.h b/src/stamp.h +index 5132bd7..009fea9 100644 +--- a/src/stamp.h ++++ b/src/stamp.h +@@ -35,7 +35,12 @@ void apply_matrix(Stamp* s); + int draw_stamp_outline(Canvas* c, Color color, const Stamp* s); + int fill_shape(Canvas* c, Color color, const Stamp* s); + ++#ifdef _MSC_VER ++void fill_triangle(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3); ++#else + void fill_triangle(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3); ++#endif + + #endif //LIBDRAWILLE_STAMP_H +diff --git a/src/x86/avx2.c b/src/x86/avx2.c +index 100c474..27870a8 100644 +--- a/src/x86/avx2.c ++++ b/src/x86/avx2.c +@@ -17,8 +17,13 @@ static inline __m256i to_fixed_avx2(const float a, const float b, const float c, + return _mm256_cvtps_epi32(m); + } + ++#ifdef _MSC_VER ++void fill_triangle_avx2(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3) { ++#else + void fill_triangle_avx2(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3) { ++#endif + // Block size, standard 8x8 (must be power of two) + const int q = 8; + +diff --git a/src/x86/sse.c b/src/x86/sse.c +index 27a6380..5cf0b48 100644 +--- a/src/x86/sse.c ++++ b/src/x86/sse.c +@@ -10,8 +10,13 @@ static inline __m128i to_fixed_sse(const float a, const float b, const float c) + return _mm_cvtps_epi32(m); + } + ++#ifdef _MSC_VER ++void fill_triangle_sse4(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3) { ++#else + void fill_triangle_sse4(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3) { ++#endif + // Block size, standard 8x8 (must be power of two) + const int q = 8; + +diff --git a/src/x86/x86.h b/src/x86/x86.h +index c31cd03..4d161cb 100644 +--- a/src/x86/x86.h ++++ b/src/x86/x86.h +@@ -36,10 +36,19 @@ static inline void printv8h(const char* prefix, vec8 v) { + } + + ++#ifdef _MSC_VER ++void fill_triangle_sse4(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3); ++ ++void fill_triangle_avx2(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3); ++#else + void fill_triangle_sse4(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3); + + void fill_triangle_avx2(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3); ++#endif ++ + + #endif //LIBDRAWILLE_X86_H diff --git a/recipes/libdrawille/all/test_package/CMakeLists.txt b/recipes/libdrawille/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c756c82332027 --- /dev/null +++ b/recipes/libdrawille/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(libdrawille REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdrawille::libdrawille) diff --git a/recipes/libdrawille/all/test_package/conanfile.py b/recipes/libdrawille/all/test_package/conanfile.py new file mode 100644 index 0000000000000..78a82060a3202 --- /dev/null +++ b/recipes/libdrawille/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, src_folder=".") + + 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/libdrawille/all/test_package/test_package.c b/recipes/libdrawille/all/test_package/test_package.c new file mode 100644 index 0000000000000..e6581befbb41a --- /dev/null +++ b/recipes/libdrawille/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "drawille/Canvas.h" + + +int main() { + Canvas* canvas = new_canvas(100, 100); + + free_canvas(canvas); + + return 0; +} diff --git a/recipes/libdrawille/all/test_v1_package/CMakeLists.txt b/recipes/libdrawille/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libdrawille/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/libdrawille/all/test_v1_package/conanfile.py b/recipes/libdrawille/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libdrawille/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/libdrawille/config.yml b/recipes/libdrawille/config.yml new file mode 100644 index 0000000000000..4478b307ea3a4 --- /dev/null +++ b/recipes/libdrawille/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20160428": + folder: all diff --git a/recipes/libdrm/all/conandata.yml b/recipes/libdrm/all/conandata.yml index c664ae449755d..d027d5e2e31c2 100644 --- a/recipes/libdrm/all/conandata.yml +++ b/recipes/libdrm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.119": + url: "https://dri.freedesktop.org/libdrm/libdrm-2.4.119.tar.xz" + sha256: "0a49f12f09b5b6e68eaaaff3f02ca7cff9aa926939b212d343161d3e8ac56291" "2.4.114": url: "https://dri.freedesktop.org/libdrm/libdrm-2.4.114.tar.xz" sha256: "3049cf843a47d12e5eeefbc3be3496d782fa09f42346bf0b7defe3d1e598d026" diff --git a/recipes/libdrm/all/conanfile.py b/recipes/libdrm/all/conanfile.py index aad89cccd5bf6..af355e6b5b875 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/6.5.9") 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.3.0") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + 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 afa2476357074..0561a690e26c1 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 8e9e5fdc7aa40..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..994065a757445 --- /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/libdrm/config.yml b/recipes/libdrm/config.yml index 90fca8a547e3e..856b2ef77e459 100644 --- a/recipes/libdrm/config.yml +++ b/recipes/libdrm/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.119": + folder: all "2.4.114": folder: all "2.4.109": diff --git a/recipes/libdwarf/all/conandata.yml b/recipes/libdwarf/all/conandata.yml index 75d6fc5547c89..6abc97da6d65a 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 ddc9a73438a95..0149255b7e4f0 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 fce5a0373f748..cd8664d42f3dc 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 0000000000000..bb0a859d8fd82 --- /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 0000000000000..0393ff627c4ca --- /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 33cfec6d8bf91..27d0d196b5a8d 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 aa4d403dacd89..2bad80aa2207b 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/libelfin/all/CMakeLists.txt b/recipes/libelfin/all/CMakeLists.txt index eb2aa34b81ac8..98010e3796993 100644 --- a/recipes/libelfin/all/CMakeLists.txt +++ b/recipes/libelfin/all/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.12) project(libelfin CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 11) endif() @@ -11,19 +8,21 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(PythonInterp 3 REQUIRED) -file(GLOB_RECURSE elf_sources source_subfolder/elf/*.cc) +set(src ${CMAKE_CURRENT_LIST_DIR}) + +file(GLOB_RECURSE elf_sources ${src}/elf/*.cc) set(elf_headers - source_subfolder/elf/common.hh - source_subfolder/elf/data.hh - source_subfolder/elf/elf++.hh) -file(GLOB_RECURSE dwarf_sources source_subfolder/dwarf/*.cc) + ${src}/elf/common.hh + ${src}/elf/data.hh + ${src}/elf/elf++.hh) +file(GLOB_RECURSE dwarf_sources ${src}/dwarf/*.cc) set(dwarf_headers - source_subfolder/dwarf/data.hh - source_subfolder/dwarf/dwarf++.hh - source_subfolder/dwarf/small_vector.hh) + ${src}/dwarf/data.hh + ${src}/dwarf/dwarf++.hh + ${src}/dwarf/small_vector.hh) add_custom_command( - OUTPUT source_subfolder/elf/to_string.cc + OUTPUT ${src}/elf/to_string.cc COMMAND ${CMAKE_COMMAND} -E echo '// Automatically generated' > to_string.cc COMMAND ${CMAKE_COMMAND} -E echo '// DO NOT EDIT' >> to_string.cc COMMAND ${CMAKE_COMMAND} -E echo >> to_string.cc @@ -34,11 +33,11 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E echo >> to_string.cc COMMAND ${PYTHON_EXECUTABLE} enum-print.py -u --hex --no-type --mask shf --mask pf -x loos -x hios -x loproc -x hiproc < data.hh >> to_string.cc COMMAND ${CMAKE_COMMAND} -E echo 'ELFPP_END_NAMESPACE' >> to_string.cc - DEPENDS source_subfolder/elf/enum-print.py source_subfolder/elf/data.hh - WORKING_DIRECTORY source_subfolder/elf) + DEPENDS ${src}/elf/enum-print.py ${src}/elf/data.hh + WORKING_DIRECTORY ${src}/elf) add_custom_command( - OUTPUT source_subfolder/dwarf/to_string.cc + OUTPUT ${src}/dwarf/to_string.cc COMMAND ${CMAKE_COMMAND} -E echo '// Automatically generated' > to_string.cc COMMAND ${CMAKE_COMMAND} -E echo '// DO NOT EDIT' >> to_string.cc COMMAND ${CMAKE_COMMAND} -E echo >> to_string.cc @@ -49,29 +48,23 @@ add_custom_command( COMMAND ${PYTHON_EXECUTABLE} ../elf/enum-print.py < dwarf++.hh >> to_string.cc COMMAND ${PYTHON_EXECUTABLE} ../elf/enum-print.py -s _ -u --hex -x hi_user -x lo_user < data.hh >> to_string.cc COMMAND ${CMAKE_COMMAND} -E echo 'DWARFPP_END_NAMESPACE' >> to_string.cc - DEPENDS source_subfolder/elf/enum-print.py source_subfolder/dwarf/data.hh - WORKING_DIRECTORY source_subfolder/dwarf) + DEPENDS ${src}/elf/enum-print.py ${src}/dwarf/data.hh + WORKING_DIRECTORY ${src}/dwarf) -add_library(elf++ ${elf_sources} source_subfolder/elf/to_string.cc) +add_library(elf++ ${elf_sources} ${src}/elf/to_string.cc) set_target_properties(elf++ PROPERTIES PUBLIC_HEADER "${elf_headers}" - VERSION ${CONAN_PACKAGE_VERSION}) + VERSION ${libelfin_VERSION}) -add_library(dwarf++ ${dwarf_sources} source_subfolder/dwarf/to_string.cc) +add_library(dwarf++ ${dwarf_sources} ${src}/dwarf/to_string.cc) set_target_properties(dwarf++ PROPERTIES PUBLIC_HEADER "${dwarf_headers}" - VERSION ${CONAN_PACKAGE_VERSION}) + VERSION ${libelfin_VERSION}) include(GNUInstallDirs) install(TARGETS elf++ - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libelfin/elf) install(TARGETS dwarf++ - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libelfin/dwarf) -install(FILES source_subfolder/LICENSE DESTINATION licenses) +install(FILES ${src}/LICENSE DESTINATION licenses) diff --git a/recipes/libelfin/all/conandata.yml b/recipes/libelfin/all/conandata.yml index e1b6341e83185..c74c8954691d8 100644 --- a/recipes/libelfin/all/conandata.yml +++ b/recipes/libelfin/all/conandata.yml @@ -5,7 +5,6 @@ sources: patches: "0.3": - patch_file: "patches/commit-9d0db16d0a0b3c4f8aaa60a3e4dab295df34b6b2.patch" - base_path: "source_subfolder" - patch_file: "patches/const-fix.patch" - base_path: "source_subfolder" - # patch_source: https://github.com/aclements/libelfin/pull/54 + patch_source: "https://github.com/aclements/libelfin/pull/54" + patch_type: "bugfix" diff --git a/recipes/libelfin/all/conanfile.py b/recipes/libelfin/all/conanfile.py index d53acbbfd0abe..852c1494c8a65 100644 --- a/recipes/libelfin/all/conanfile.py +++ b/recipes/libelfin/all/conanfile.py @@ -1,64 +1,82 @@ -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.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 +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class LibelfinConan(ConanFile): name = "libelfin" description = "C++11 library for reading ELF binaries and DWARFv4 debug information" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/aclements/libelfin" - license = "MIT" - topics = ("conan", "elf", "dwarf", "libelfin") + topics = ("elf", "dwarf") + 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], + } + default_options = { + "shared": False, + "fPIC": True, + } - _cmake = None - _source_subfolder = "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": del self.options.fPIC def configure(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("libelfin doesn't support compiler: {} on OS: {}.". - format(self.settings.compiler, self.settings.os)) if self.options.shared: - del self.options.fPIC - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + 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, 11) + if is_msvc(self): + raise ConanInvalidConfiguration(f"libelfin doesn't support compiler: {self.settings.compiler}.") 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.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["libelfin_VERSION"] = self.version + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + copy(self, "CMakeLists.txt", src=self.export_sources_folder, dst=self.source_folder) 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() def package_info(self): - self.cpp_info.components["libelf++"].names["pkg_config"] = "libelf++" + self.cpp_info.components["libelf++"].set_property("pkg_config_name", "libelf++") self.cpp_info.components["libelf++"].libs = ["elf++"] - self.cpp_info.components["libdwarf++"].names["pkg_config"] = "libdwarf++" + self.cpp_info.components["libdwarf++"].set_property("pkg_config_name", "libdwarf++") self.cpp_info.components["libdwarf++"].libs = ["dwarf++"] self.cpp_info.components["libdwarf++"].requires = ["libelf++"] + + # TODO: Legacy, to be removed on Conan 2.0 + self.cpp_info.components["libelf++"].names["pkg_config"] = "libelf++" + self.cpp_info.components["libdwarf++"].names["pkg_config"] = "libdwarf++" diff --git a/recipes/libelfin/all/test_package/CMakeLists.txt b/recipes/libelfin/all/test_package/CMakeLists.txt index 36df85d833b7f..3d1d60bfa1834 100644 --- a/recipes/libelfin/all/test_package/CMakeLists.txt +++ b/recipes/libelfin/all/test_package/CMakeLists.txt @@ -1,11 +1,10 @@ -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(libelfin REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libelfin::libelfin) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON) diff --git a/recipes/libelfin/all/test_package/conanfile.py b/recipes/libelfin/all/test_package/conanfile.py index e2a48eb337ec0..c2a19b9121acf 100644 --- a/recipes/libelfin/all/test_package/conanfile.py +++ b/recipes/libelfin/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -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 + 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,8 +22,7 @@ def build(self): cmake.build() def test(self): - if tools.cross_building(self.settings): - return - bin_path = os.path.join("bin", "test_package") - elf_path = os.path.join(self.source_folder, "hello") - self.run("{} {}".format(bin_path, elf_path), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + elf_path = os.path.join(self.source_folder, "hello") + self.run(f"{bin_path} {elf_path}", env="conanrun") diff --git a/recipes/libelfin/all/test_v1_package/CMakeLists.txt b/recipes/libelfin/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libelfin/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/libelfin/all/test_v1_package/conanfile.py b/recipes/libelfin/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fe9ecdf1845cc --- /dev/null +++ b/recipes/libelfin/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 build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if tools.cross_building(self.settings): + return + bin_path = os.path.join("bin", "test_package") + elf_path = os.path.join(self.source_folder, os.pardir, "test_package", "hello") + self.run(f"{bin_path} {elf_path}", run_environment=True) diff --git a/recipes/libenvpp/all/conandata.yml b/recipes/libenvpp/all/conandata.yml new file mode 100644 index 0000000000000..9ad4addaf724a --- /dev/null +++ b/recipes/libenvpp/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.4.0": + url: "https://github.com/ph3at/libenvpp/archive/refs/tags/v1.4.0.tar.gz" + sha256: "3f9a4a4b62abc06522de76e3a999cc3cd6b60299dc26b28ccc2183aa614f10cd" + "1.3.0": + url: "https://github.com/ph3at/libenvpp/archive/refs/tags/v1.3.0.tar.gz" + sha256: "9201ae39dc67118ee46b4e60fe2e5d22b046faceae4a4b4eec6ab62bc48875dd" +patches: + "1.4.0": + - patch_file: "patches/0001-use-cci-fmt.patch" + patch_description: "use cci fmt package, remove static flag from add_library" + patch_type: "conan" + "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 0000000000000..752e254ee325f --- /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.2.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 0000000000000..d89edb409485d --- /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 0000000000000..59cf4056ecd20 --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..9be10c22b43a7 --- /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 0000000000000..25c9b4921636c --- /dev/null +++ b/recipes/libenvpp/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.0": + folder: all + "1.3.0": + folder: all diff --git a/recipes/libepoxy/all/conanfile.py b/recipes/libepoxy/all/conanfile.py index c8c1d778cd360..2f9f112de0a99 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/libest/all/conandata.yml b/recipes/libest/all/conandata.yml index b9d0db8b23c2b..eaebe131cc296 100644 --- a/recipes/libest/all/conandata.yml +++ b/recipes/libest/all/conandata.yml @@ -5,6 +5,4 @@ sources: patches: "3.2.0": - patch_file: "patches/0001-examples-are-broken-don-t-build-them.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-add-extern.patch" - base_path: "source_subfolder" diff --git a/recipes/libest/all/conanfile.py b/recipes/libest/all/conanfile.py index c3b2b423c3d32..ba0d7ffd16a68 100644 --- a/recipes/libest/all/conanfile.py +++ b/recipes/libest/all/conanfile.py @@ -1,80 +1,100 @@ 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.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +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 + +required_conan_version = ">=1.53.0" class LibEstConan(ConanFile): name = "libest" - license = "BSD-3-Clause" description = "EST is used for secure certificate enrollment" - topics = ("conan", "EST", "RFC 7030", "certificate enrollment") - homepage = "https://github.com/cisco/libest" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" - exports_sources = "patches/**" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - - _autotools = None + homepage = "https://github.com/cisco/libest" + topics = ("EST", "RFC 7030", "certificate enrollment") - @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): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.settings.os in ("Windows", "Macos"): - raise ConanInvalidConfiguration( - "Platform is currently not supported by this recipe") + if self.settings.os == "Windows" or is_apple_os(self): + raise ConanInvalidConfiguration("Platform is currently not supported by this recipe") 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("openssl/1.1.1q") + self.requires("openssl/1.1.1w", transitive_headers=True, transitive_libs=True) + + def build_requirements(self): + self.tool_requires("libtool/2.4.7") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-r" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def _configure_autotools(self): - if not self._autotools: - self._autotools = AutoToolsBuildEnvironment(self) - # TODO: - # - Static only build: https://github.com/cisco/libest/blob/70824ddc09bee661329b9416082d88566efefb32/intro.txt#L140 - # - Release build: https://github.com/cisco/libest/blob/70824ddc09bee661329b9416082d88566efefb32/intro.txt#L253 - args = [] - if self.options.shared: - args.extend(["--enable-shared", "--disable-static"]) - else: - args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(args=args) - return self._autotools + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Remove duplicate AM_INIT_AUTOMAKE + replace_in_file(self, os.path.join(self.source_folder, "configure.ac"), + "AM_INIT_AUTOMAKE\n", "") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() autotools.make() def package(self): - self.copy("*LICENSE", src=self._source_subfolder, dst="licenses") - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - autotools.install() + copy(self, "*LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + if self.settings.build_type in ["Release", "MinSizeRel"]: + # https://github.com/cisco/libest/blob/r3.2.0/intro.txt#L244-L254 + autotools.install(target="install-strip") + else: + autotools.install() os.unlink(os.path.join(self.package_folder, "lib", "libest.la")) def package_info(self): self.cpp_info.libs = ["est"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["dl", "pthread"] diff --git a/recipes/libest/all/test_package/CMakeLists.txt b/recipes/libest/all/test_package/CMakeLists.txt index 48b855b8a30aa..38cd9db26265b 100644 --- a/recipes/libest/all/test_package/CMakeLists.txt +++ b/recipes/libest/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(libest REQUIRED CONFIG) add_executable(example example.c) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example PRIVATE libest::libest) diff --git a/recipes/libest/all/test_package/conanfile.py b/recipes/libest/all/test_package/conanfile.py index 9f2b070b59136..8d52b7021efe1 100644 --- a/recipes/libest/all/test_package/conanfile.py +++ b/recipes/libest/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 CAresTestConan(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/libest/all/test_v1_package/CMakeLists.txt b/recipes/libest/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libest/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/libest/all/test_v1_package/conanfile.py b/recipes/libest/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2978938836233 --- /dev/null +++ b/recipes/libest/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class CAresTestConan(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/libevdev/all/conandata.yml b/recipes/libevdev/all/conandata.yml new file mode 100644 index 0000000000000..36ae01fb48f05 --- /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 0000000000000..bd31989739c14 --- /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 0000000000000..5aab0703e7a4e --- /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 0000000000000..16df74e848742 --- /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 0000000000000..c8e6a5edda83f --- /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 0000000000000..aac1819cc10c0 --- /dev/null +++ b/recipes/libevdev/config.yml @@ -0,0 +1,3 @@ +versions: + "1.13.1": + folder: all diff --git a/recipes/libfdk_aac/all/conandata.yml b/recipes/libfdk_aac/all/conandata.yml index 130e5570f8cdf..516a736a8a125 100644 --- a/recipes/libfdk_aac/all/conandata.yml +++ b/recipes/libfdk_aac/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.3": + url: "https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.0.3.tar.gz" + sha256: "829b6b89eef382409cda6857fd82af84fabb63417b08ede9ea7a553f811cb79e" "2.0.2": url: "https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.0.2.tar.gz" sha256: "c9e8630cf9d433f3cead74906a1520d2223f89bcd3fa9254861017440b8eb22f" diff --git a/recipes/libfdk_aac/config.yml b/recipes/libfdk_aac/config.yml index e850754933d82..7529da0511999 100644 --- a/recipes/libfdk_aac/config.yml +++ b/recipes/libfdk_aac/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.3": + folder: all "2.0.2": folder: all "2.0.1": diff --git a/recipes/libfreenect/all/conandata.yml b/recipes/libfreenect/all/conandata.yml index d95c75077fd15..5f576feee3083 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 a09c617182ab2..d4f601d9832b3 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 c986d294c7547..ff20e4a7a17dd 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 7fab4fd83db66..95824e496a47a 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 dbb951cc733d9..b9a827fb5ffdb 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 93324460a3d71..fcc8f8dfa20e8 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 5742a7e29c0d5..9acae9b976620 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 3da371b660e0a..66cde37e06dd2 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 5b33131a68c48..922dfc4a145e3 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 87f1338e3ed67..362a6680a8215 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 bdc298e883977..3ae320b47fbec 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 7b9b613cbb24a..6f4e1992a2351 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 8c64bd2e6fd24..35930df6e35fd 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 0000000000000..91630d79f4abb --- /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 0000000000000..a86b3a5dad12e --- /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 16c0bb3e46d34..93a939465107f 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 efdfd6bd92c12..40064cdad12f4 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 eb26d0c1b0943..65f19e16d7a62 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 4cc77383a646b..d233b32a70631 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 701d331873021..b328202f167f9 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 0d20897301b68..b21cc49efde95 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/conandata.yml b/recipes/libfuse/all/conandata.yml index c5d2a101abf4a..8a9ccf19ae441 100644 --- a/recipes/libfuse/all/conandata.yml +++ b/recipes/libfuse/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.16.2": + url: "https://github.com/libfuse/libfuse/releases/download/fuse-3.16.2/fuse-3.16.2.tar.gz" + sha256: "f797055d9296b275e981f5f62d4e32e089614fc253d1ef2985851025b8a0ce87" "3.10.5": url: "https://github.com/libfuse/libfuse/releases/download/fuse-3.10.5/fuse-3.10.5.tar.xz" sha256: "b2e283485d47404ac896dd0bb7f7ba81e1470838e677e45f659804c3a3b69666" diff --git a/recipes/libfuse/all/conanfile.py b/recipes/libfuse/all/conanfile.py index 0f2c7852403e0..2b5f67a4fee98 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 c8bc174f2164d..2fd81a9f515e7 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 0d20897301b68..b21cc49efde95 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/libfuse/config.yml b/recipes/libfuse/config.yml index 3f5d2920bcb10..44d31f4a5151a 100644 --- a/recipes/libfuse/config.yml +++ b/recipes/libfuse/config.yml @@ -1,4 +1,6 @@ versions: + "3.16.2": + folder: all "3.10.5": folder: all "2.9.9": diff --git a/recipes/libgcrypt/all/conandata.yml b/recipes/libgcrypt/all/conandata.yml index ec37a3b999a57..7c8e4799d8c00 100644 --- a/recipes/libgcrypt/all/conandata.yml +++ b/recipes/libgcrypt/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.10.3": + url: "https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.10.3.tar.gz" + sha256: "946f7e56f795ba2ea88b842a8c6b8f469360cda42c1d3d191f7ac7e9aa8239f8" "1.8.4": url: "https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.4.tar.gz" sha256: "fc3c49cc8611068e6008482c3bbee6c66b9287808bbb4e14a473f4cc347b78ce" diff --git a/recipes/libgcrypt/all/conanfile.py b/recipes/libgcrypt/all/conanfile.py index 5ec59b6726d5f..eb8e63a9f7a93 100644 --- a/recipes/libgcrypt/all/conanfile.py +++ b/recipes/libgcrypt/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building from conan.tools.env import VirtualRunEnv -from conan.tools.files import copy, get, rm, rmdir +from conan.tools.files import copy, get, rm, rmdir, save from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain from conan.tools.layout import basic_layout import os @@ -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): @@ -63,7 +63,12 @@ def generate(self): deps = AutotoolsDeps(self) deps.generate() + def _patch_sources(self): + # Disable the tests subdir + save(self, os.path.join(self.source_folder, "tests", "Makefile.in"), "all:\ninstall:\n") + def build(self): + self._patch_sources() autotools = Autotools(self) autotools.configure() autotools.make() @@ -73,6 +78,7 @@ def package(self): 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")) def package_info(self): diff --git a/recipes/libgcrypt/config.yml b/recipes/libgcrypt/config.yml index f058837ee5cb1..629c9c832f1c5 100644 --- a/recipes/libgcrypt/config.yml +++ b/recipes/libgcrypt/config.yml @@ -1,3 +1,5 @@ versions: + "1.10.3": + folder: all "1.8.4": folder: all diff --git a/recipes/libgd/all/conandata.yml b/recipes/libgd/all/conandata.yml index e4acad43d15b2..f0b126888eb32 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 169f9e3ba1f8c..5de7e7911d0ed 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 0000000000000..7a3609a12620d --- /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 0000000000000..cdb3bfc14381a --- /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 0000000000000..489c66beb6236 --- /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 0000000000000..4a067840ce98f --- /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 dd7258309aa60..557e23e5c4e53 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], @@ -43,8 +43,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libtiff/4.4.0") - self.requires("proj/9.1.1") + # libgeotiff/include/xtiffio.h includes libtiff/include/tiffio.h + self.requires("libtiff/4.6.0", transitive_headers=True, transitive_libs=True) + self.requires("proj/9.3.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libgettext/all/conandata.yml b/recipes/libgettext/all/conandata.yml index 6024e755af9d8..c7f8b2f8602a5 100644 --- a/recipes/libgettext/all/conandata.yml +++ b/recipes/libgettext/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.22": + url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.tar.gz" + sha256: "49f089be11b490170bbf09ed2f51e5f5177f55be4cc66504a5861820e0fb06ab" "0.21": url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz" sha256: "c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12" diff --git a/recipes/libgettext/all/conanfile.py b/recipes/libgettext/all/conanfile.py index e480512d27ccf..a3d65fe027cb3 100644 --- a/recipes/libgettext/all/conanfile.py +++ b/recipes/libgettext/all/conanfile.py @@ -1,3 +1,4 @@ +import glob import os from conan import ConanFile @@ -25,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" @@ -182,7 +187,7 @@ def programs(): def build(self): apply_conandata_patches(self) autotools = Autotools(self) - autotools.configure("gettext-tools") + autotools.configure("gettext-runtime") autotools.make() def package(self): @@ -214,8 +219,6 @@ 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"]: diff --git a/recipes/libgettext/config.yml b/recipes/libgettext/config.yml index dc03f51a1d462..c7ed4b0b0c8c1 100644 --- a/recipes/libgettext/config.yml +++ b/recipes/libgettext/config.yml @@ -1,4 +1,6 @@ versions: + "0.22": + folder: all "0.21": folder: all "0.20.1": diff --git a/recipes/libglvnd/all/conandata.yml b/recipes/libglvnd/all/conandata.yml index 930441157c427..8d9b790ae637c 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 7d1919c184d04..91471af4e7c75 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 34af13462f44f..60cf6714783e8 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 8b7f471a280d5..ef5d7042163ec 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 bd6887e2cfe66..3283e92e6372f 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/libgpg-error/all/conandata.yml b/recipes/libgpg-error/all/conandata.yml index 256bc1f28533a..c6271e8ce4d72 100644 --- a/recipes/libgpg-error/all/conandata.yml +++ b/recipes/libgpg-error/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.47": + url: "https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.47.tar.gz" + sha256: "685d4bd9d05576c4fc7f0870903dfdfbe41f2dd6a12e76fd8bd1717278f6b365" "1.36": url: "https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.36.tar.gz" sha256: "493a3a5e0ac0eb4df8501039f351459d8901d213a834d8c5a453a8ed94858ba5" diff --git a/recipes/libgpg-error/config.yml b/recipes/libgpg-error/config.yml index f10713a7746e2..be46539e39213 100644 --- a/recipes/libgpg-error/config.yml +++ b/recipes/libgpg-error/config.yml @@ -1,3 +1,5 @@ versions: + "1.47": + folder: all "1.36": folder: all diff --git a/recipes/libgphoto2/all/conandata.yml b/recipes/libgphoto2/all/conandata.yml index 1f142a35cee75..8bad48c781d69 100644 --- a/recipes/libgphoto2/all/conandata.yml +++ b/recipes/libgphoto2/all/conandata.yml @@ -1,7 +1,12 @@ sources: + "2.5.31": + url: "https://github.com/gphoto/libgphoto2/releases/download/v2.5.31/libgphoto2-2.5.31.tar.xz" + sha256: "8fc7bf40f979459509b87dd4ff1aae9b6c1c2b4724d37db576081eec15406ace" "2.5.27": url: "https://github.com/gphoto/libgphoto2/releases/download/v2.5.27/libgphoto2-2.5.27.tar.xz" sha256: "a7253bd18c6ef65352150ac36a668f883a5ad2634eb6455b3ca9aa6ac98d0073" patches: + "2.5.31": + - patch_file: "patches/2.5.27-0001-macos_snprintf.patch" "2.5.27": - patch_file: "patches/2.5.27-0001-macos_snprintf.patch" diff --git a/recipes/libgphoto2/all/conanfile.py b/recipes/libgphoto2/all/conanfile.py index e3382ba23526b..42df92be12821 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.12.3") 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.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/libgphoto2/config.yml b/recipes/libgphoto2/config.yml index 5139145403d46..90c8118874b7e 100644 --- a/recipes/libgphoto2/config.yml +++ b/recipes/libgphoto2/config.yml @@ -1,3 +1,5 @@ versions: + "2.5.31": + folder: all "2.5.27": folder: all diff --git a/recipes/libgpiod/all/conandata.yml b/recipes/libgpiod/all/conandata.yml index 851ae98da0f81..e57f9b7713c5f 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 99787ae3af1c0..f35d2c80dd4b3 100644 --- a/recipes/libgpiod/all/conanfile.py +++ b/recipes/libgpiod/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, 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.57.0" + class LibgpiodConan(ConanFile): name = "libgpiod" @@ -10,7 +14,8 @@ class LibgpiodConan(ConanFile): homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/" license = "LGPL-2.1-or-later" description = "C library and tools for interacting with the linux GPIO character device" - topics = ("gpio", "libgpiod", "libgpiodcxx", "linux") + topics = ("gpio", "libgpiodcxx", "linux") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,12 +29,6 @@ class LibgpiodConan(ConanFile): "enable_bindings_cxx": False, "enable_tools": False, } - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" def validate(self): if self.settings.os != "Linux": @@ -37,51 +36,51 @@ def validate(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.enable_bindings_cxx: - 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 requirements(self): + self.requires("linux-headers-generic/6.5.9") def build_requirements(self): - self.build_requires("libtool/2.4.6") - self.build_requires("pkgconf/1.7.4") - self.build_requires("autoconf-archive/2021.02.19") - self.build_requires("linux-headers-generic/5.13.9") + self.build_requires("libtool/2.4.7") + self.build_requires("pkgconf/2.0.3") + self.build_requires("autoconf-archive/2022.09.03") 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_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) + def generate(self): + 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-bindings-cxx={}".format(yes_no(self.options.enable_bindings_cxx)), - "--enable-tools={}".format(yes_no(self.options.enable_tools)), - ] - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools + tc.configure_args.append("--enable-bindings-cxx={}".format(yes_no(self.options.enable_bindings_cxx))) + tc.configure_args.append("--enable-tools={}".format(yes_no(self.options.enable_tools))) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() def build(self): - with tools.chdir(os.path.join(self._source_subfolder)): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True) - 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() - tools.remove_files_by_mask(self.package_folder, "*.la") - 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, "lib", "pkgconfig")) def package_info(self): self.cpp_info.components["gpiod"].libs = ["gpiod"] - self.cpp_info.components["gpiod"].names["pkg_config"] = "gpiod" + self.cpp_info.components["gpiod"].set_property("pkg_config_name", "libgpiod") if self.options.enable_bindings_cxx: self.cpp_info.components["gpiodcxx"].libs = ["gpiodcxx"] - self.cpp_info.components["gpiodcxx"].names["pkg_config"] = "gpiodcxx" + self.cpp_info.components["gpiodcxx"].set_property("pkg_config_name", "libgpiodcxx") self.cpp_info.components["gpiodcxx"].requires = ["gpiod"] diff --git a/recipes/libgpiod/all/test_package/CMakeLists.txt b/recipes/libgpiod/all/test_package/CMakeLists.txt index a5ffd526aaea7..fe28114b7fac7 100644 --- a/recipes/libgpiod/all/test_package/CMakeLists.txt +++ b/recipes/libgpiod/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(libgpiod REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.c) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${CMAKE_PROJECT_NAME} libgpiod::gpiod) diff --git a/recipes/libgpiod/all/test_package/conanfile.py b/recipes/libgpiod/all/test_package/conanfile.py index db57f3bb0d17f..2325fb400694e 100644 --- a/recipes/libgpiod/all/test_package/conanfile.py +++ b/recipes/libgpiod/all/test_package/conanfile.py @@ -1,11 +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 required_conan_version = ">=1.33.0" 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 +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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libgpiod/all/test_package/test_package.c b/recipes/libgpiod/all/test_package/test_package.c index 686dc9682cd7d..624c4536ecb0e 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 bfd56b0a1b59f..032322a67e7ab 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 217b9530b904d..0000000000000 --- 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 a0064e504c27d..a15e741e867e1 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 7b9b613cbb24a..3bb9ae06e8bb8 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 ea57a464900be..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..84ee68733e516 --- /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 0a5fcff604fbd..5f30969947a89 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 c9f4762f7af23..b711596878185 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 e2cd1b5424ba3..1d38a74649aa2 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 3a8c6c5442b33..0ab1977ef0330 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 4fb5e3cdcdfd4..0000000000000 --- 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 0000000000000..f702ac0fa8617 --- /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 0c60d16c7a716..390a1bca7ce2f 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 ecbb76a96ea8d..855e335e2fd53 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 29a286d695d61..0e549c3a82e1f 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 fc6fd0d3335fc..c35f205e346da 100644 --- a/recipes/libharu/all/conanfile.py +++ b/recipes/libharu/all/conanfile.py @@ -47,8 +47,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.13") - self.requires("libpng/1.6.39") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("libpng/1.6.40") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) diff --git a/recipes/libharu/config.yml b/recipes/libharu/config.yml index 39ca57fe00f3b..be72156e0ef73 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 c5668b6d3c93a..e7a2fc9ba8c25 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 55d521d49ca38..912d662dba19e 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 0000000000000..957b6fe2587f2 --- /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 0000000000000..ca167755d4ece --- /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 1b1bac20e2e23..887a8fb56ade3 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/libiconv/all/conanfile.py b/recipes/libiconv/all/conanfile.py index 544fb2b4ab962..2117c9f4edde3 100644 --- a/recipes/libiconv/all/conanfile.py +++ b/recipes/libiconv/all/conanfile.py @@ -9,7 +9,8 @@ get, rename, rm, - rmdir + rmdir, + replace_in_file ) from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout @@ -119,8 +120,15 @@ def generate(self): env.define("win32_target", "_WIN32_WINNT_VISTA") tc.generate(env) - def build(self): + def _apply_resource_patch(self): + if self.settings.arch == "x86": + windres_options_path = os.path.join(self.source_folder, "windows", "windres-options") + self.output.info("Applying {} resource patch: {}".format(self.settings.arch, windres_options_path)) + replace_in_file(self, windres_options_path, '# PACKAGE_VERSION_SUBMINOR', '# PACKAGE_VERSION_SUBMINOR\necho "--target=pe-i386"', strict=True) + + def build(self): apply_conandata_patches(self) + self._apply_resource_patch() autotools = Autotools(self) autotools.configure() autotools.make() diff --git a/recipes/libid3tag/all/CMakeLists.txt b/recipes/libid3tag/all/CMakeLists.txt new file mode 100644 index 0000000000000..cbee8d19a93e7 --- /dev/null +++ b/recipes/libid3tag/all/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.15) +project(libid3tag LANGUAGES C) + +file(GLOB SOURCES "*.c" "*.h") +add_library(libid3tag ${SOURCES} ${HEADERS}) +target_include_directories(libid3tag PRIVATE msvc++) + +# https://github.com/markjeee/libid3tag/blob/master/msvc%2B%2B/libid3tag.dsp#L43-L44 +target_compile_options(libid3tag PRIVATE /W2 "$<$:/Od;/GZ>" "$<$:/O2>") +target_compile_definitions(libid3tag PRIVATE HAVE_CONFIG_H "$<$:DEBUG;>" "$<$:NDEBUG>") +set_property(TARGET libid3tag PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) + +find_package(ZLIB REQUIRED CONFIG) +target_link_libraries(libid3tag PRIVATE ZLIB::ZLIB) + +install(TARGETS libid3tag + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +install(FILES id3tag.h DESTINATION include) diff --git a/recipes/libid3tag/all/conanfile.py b/recipes/libid3tag/all/conanfile.py index ec346961d3ce4..39074d29616bc 100644 --- a/recipes/libid3tag/all/conanfile.py +++ b/recipes/libid3tag/all/conanfile.py @@ -1,28 +1,39 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild -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 cross_building +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, copy, get, rm, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class LibId3TagConan(ConanFile): name = "libid3tag" description = "ID3 tag manipulation library." - topics = ("conan", "mad", "id3", "MPEG", "audio", "decoder") + license = "GPL-2.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.underbit.com/products/mad/" - license = "GPL-2.0-or-later" - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generator = "pkg_config", "visual_studio" + topics = ("mad", "id3", "MPEG", "audio", "decoder") - _autotools = 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, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -30,95 +41,81 @@ 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("zlib/1.2.11") + def layout(self): + if is_msvc(self): + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") - @property - def _is_msvc(self): - return self.settings.compiler == "Visual Studio" or ( - self.settings.compiler == "clang" and self.settings.os == "Windows" - ) + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") def validate(self): - if self._is_msvc and self.options.shared: - raise ConanInvalidConfiguration("libid3tag does not support shared library for MSVC") - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + if cross_building(self) and self.settings.arch == "armv8" and self.options.shared: + # https://github.com/conan-io/conan-center-index/pull/18987#issuecomment-1668243831 + raise ConanInvalidConfiguration("shared library cross-building is not supported for armv8") def build_requirements(self): - 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") + if not is_msvc(self): + self.tool_requires("gnu-config/cci.20210814") 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): + if is_msvc(self): + tc = CMakeToolchain(self) + tc.preprocessor_definitions["ID3TAG_EXPORT"] = "__declspec(dllexport)" if self.options.shared else "" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + else: + venv = VirtualBuildEnv(self) + venv.generate() + tc = AutotoolsToolchain(self) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() def build(self): - if self._is_msvc: - self._build_msvc() + if is_msvc(self): + # https://github.com/markjeee/libid3tag/blob/master/id3tag.h#L355-L358 + replace_in_file(self, os.path.join(self.source_folder, "id3tag.h"), + "extern char", "ID3TAG_EXPORT extern char") + cmake = CMake(self) + cmake.configure() + cmake.build() else: - self._build_autotools() - - def _build_msvc(self): - kwargs = {} - with tools.chdir(os.path.join(self._source_subfolder, "msvc++")): - # cl : Command line error D8016: '/ZI' and '/Gy-' command-line options are incompatible - tools.replace_in_file("libid3tag.dsp", "/ZI ", "") - if self.settings.compiler == "clang": - tools.replace_in_file("libid3tag.dsp", "CPP=cl.exe", "CPP=clang-cl.exe") - tools.replace_in_file("libid3tag.dsp", "RSC=rc.exe", "RSC=llvm-rc.exe") - kwargs["toolset"] = "ClangCl" - if self.settings.arch == "x86_64": - tools.replace_in_file("libid3tag.dsp", "Win32", "x64") - with tools.vcvars(self.settings): - self.run("devenv /Upgrade libid3tag.dsp") - msbuild = MSBuild(self) - msbuild.build(project_file="libid3tag.vcxproj", **kwargs) - - def _configure_autotools(self): - if not self._autotools: - if self.options.shared: - args = ["--disable-static", "--enable-shared"] - else: - args = ["--disable-shared", "--enable-static"] - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools - - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) - - 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")) - autotools = self._configure_autotools() - autotools.make() - - def _install_autotools(self): - autotools = self._configure_autotools() - autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + 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), self.source_folder) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy("COPYRIGHT", dst="licenses", src=self._source_subfolder) - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("CREDITS", dst="licenses", src=self._source_subfolder) - if self._is_msvc: - self.copy(pattern="*.lib", dst="lib", src=self._source_subfolder, keep_path=False) - self.copy(pattern="id3tag.h", dst="include", src=self._source_subfolder) + for license_file in ["COPYRIGHT", "COPYING", "CREDITS"]: + copy(self, license_file, self.source_folder, os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + cmake = CMake(self) + cmake.install() else: - self._install_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", self.package_folder, recursive=True) def package_info(self): - self.cpp_info.libs = ["libid3tag" if self._is_msvc else "id3tag"] + if is_msvc(self): + self.cpp_info.libs = ["libid3tag"] + self.cpp_info.defines.append("ID3TAG_EXPORT=" + ("__declspec(dllimport)" if self.options.shared else "")) + else: + self.cpp_info.libs = ["id3tag"] diff --git a/recipes/libid3tag/all/test_package/CMakeLists.txt b/recipes/libid3tag/all/test_package/CMakeLists.txt index 7b9b613cbb24a..5735549609ad1 100644 --- a/recipes/libid3tag/all/test_package/CMakeLists.txt +++ b/recipes/libid3tag/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(libid3tag REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libid3tag::libid3tag) diff --git a/recipes/libid3tag/all/test_package/conanfile.py b/recipes/libid3tag/all/test_package/conanfile.py index d4128b0450777..ef5d7042163ec 100644 --- a/recipes/libid3tag/all/test_package/conanfile.py +++ b/recipes/libid3tag/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/libid3tag/all/test_v1_package/CMakeLists.txt b/recipes/libid3tag/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libid3tag/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/libid3tag/all/test_v1_package/conanfile.py b/recipes/libid3tag/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/libid3tag/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/libidn/all/conanfile.py b/recipes/libidn/all/conanfile.py index 6305a5795dac0..49221670d5e8e 100644 --- a/recipes/libidn/all/conanfile.py +++ b/recipes/libidn/all/conanfile.py @@ -1,5 +1,8 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, rmdir +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment, tools import contextlib import functools import os @@ -49,7 +52,7 @@ def configure(self): del self.settings.compiler.cppstd def requirements(self): - self.requires("libiconv/1.16") + self.requires("libiconv/1.17") def validate(self): if self.settings.os == "Windows" and self.options.shared: @@ -59,10 +62,10 @@ 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") + self.build_requires("automake/1.16.5") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) @contextlib.contextmanager @@ -87,7 +90,7 @@ def _configure_autotools(self): if not self.options.shared: autotools.defines.append("LIBIDN_STATIC") if self.settings.compiler == "Visual Studio": - if tools.Version(self.settings.compiler.version) >= "12": + if Version(self.settings.compiler.version) >= "12": autotools.flags.append("-FS") autotools.link_flags.extend("-L{}".format(p.replace("\\", "/")) for p in self.deps_cpp_info.lib_paths) yes_no = lambda v: "yes" if v else "no" @@ -122,8 +125,8 @@ def package(self): autotools = self._configure_autotools() autotools.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")) tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") def package_info(self): diff --git a/recipes/libinterpolate/all/conandata.yml b/recipes/libinterpolate/all/conandata.yml index 04998351d32b8..7d38fb0462c3a 100644 --- a/recipes/libinterpolate/all/conandata.yml +++ b/recipes/libinterpolate/all/conandata.yml @@ -3,3 +3,11 @@ sources: url: - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.2.tar.gz" sha256: "42f40c9b77fda6e0c52ed39b522458456e89fb4981d63f812aa158c6f4be8ab0" + "2.6.3": + url: + - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.3.tar.gz" + sha256: "bb2f253c27594b4e56ed9349630086665f529100eac2cd3cba63d198c3a84ff9" + "2.6.4": + url: + - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.4.tar.gz" + sha256: "231a39fcc87ffc3e03936f7a21abc78ef309c2f1de79bd3ae72c24d78352d666" diff --git a/recipes/libinterpolate/all/conanfile.py b/recipes/libinterpolate/all/conanfile.py index 62e7baa6e4ea4..c6aadd8b682fe 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,10 +42,14 @@ def requirements(self): self.requires("boost/1.80.0", transitive_headers=True) self.requires("eigen/3.3.7", transitive_headers=True) - def validate(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration("libInterpolate currently only supports Linux. Upstream PR's are welcome (https://github.com/CD3/libInterpolate/issues/14).") + 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") + if Version(self.version) >= "2.6.4" and self.settings.os not in ["Linux", "Windows"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported by {self.settings.os}.") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get( @@ -79,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/libinterpolate/config.yml b/recipes/libinterpolate/config.yml index 8296a371553be..2f31497672d43 100644 --- a/recipes/libinterpolate/config.yml +++ b/recipes/libinterpolate/config.yml @@ -1,3 +1,7 @@ versions: "2.6.2": folder: all + "2.6.3": + folder: all + "2.6.4": + folder: all diff --git a/recipes/libipt/all/CMakeLists.txt b/recipes/libipt/all/CMakeLists.txt deleted file mode 100644 index f62f6ae283c5f..0000000000000 --- 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 91a36f41590f6..702bec04ce824 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 73c8a14fe3622..e7687b6d7c00d 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 614fc23d88dda..9f56367278f32 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 a8c92dea63335..ef5d7042163ec 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 6b9e18b8eb133..26def6a295d25 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 0000000000000..91630d79f4abb --- /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 0000000000000..a8c92dea63335 --- /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 16ab573dd6bd3..c14d5aed738ae 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 1821235633f65..6b84ea73c442f 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 afc30df36cff2..ebe4c40f12545 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 cdfe1237074c7..382a6fb1070c9 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 1b2a9bb8fba8b..1a9d0a90947d1 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 0000000000000..9cc2caed8889e --- /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 0000000000000..28626c0146534 --- /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 0000000000000..5aab0703e7a4e --- /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 0000000000000..a943f09604a97 --- /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 0000000000000..82017ed512aff --- /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 0000000000000..3a9d5538921fc --- /dev/null +++ b/recipes/libliftoff/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.1": + folder: all diff --git a/recipes/liblsl/all/conandata.yml b/recipes/liblsl/all/conandata.yml index 2cf8655a17765..ee93b75bd818e 100644 --- a/recipes/liblsl/all/conandata.yml +++ b/recipes/liblsl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.16.2": + url: "https://github.com/sccn/liblsl/archive/refs/tags/v1.16.2.tar.gz" + sha256: "923aa4c81c0fef651c325e3c27aa5b96771540ca2a0933d1b327db27c6dac839" "1.16.1": url: "https://github.com/sccn/liblsl/archive/refs/tags/v1.16.1.tar.gz" sha256: "7410620c26f8e86ae431e7476bf685918e180bd676982a7f7a7817299c8707c5" diff --git a/recipes/liblsl/config.yml b/recipes/liblsl/config.yml index eb92f3dd2dc5e..4caf149a06ee6 100644 --- a/recipes/liblsl/config.yml +++ b/recipes/liblsl/config.yml @@ -1,4 +1,6 @@ versions: + "1.16.2": + folder: all "1.16.1": folder: all "1.16.0": diff --git a/recipes/libmagic/all/conandata.yml b/recipes/libmagic/all/conandata.yml new file mode 100644 index 0000000000000..f585a96bf81ba --- /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 0000000000000..6d0843dc3f3f3 --- /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 0000000000000..c8e4d0491b35e --- /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 0000000000000..fafe4ac251f83 --- /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 0000000000000..64afba96e3118 --- /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 0000000000000..6655b3c6cb852 --- /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 83c876364326d..6267e2c13434f 100644 --- a/recipes/libmaxminddb/all/conandata.yml +++ b/recipes/libmaxminddb/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.9.1": + url: "https://github.com/maxmind/libmaxminddb/releases/download/1.9.1/libmaxminddb-1.9.1.tar.gz" + sha256: "a80682a89d915fdf60b35d316232fb04ebf36fff27fda9bd39fe8a38d3cd3f12" + "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 9efd2189b76e9..0a05d03a9c3a0 100644 --- a/recipes/libmaxminddb/config.yml +++ b/recipes/libmaxminddb/config.yml @@ -1,4 +1,8 @@ versions: + "1.9.1": + folder: all + "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 361b35d4c17d9..0000000000000 --- 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 5c3ff6e87aae2..841dbf22c8b0d 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 34af13462f44f..076d1645a34b0 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 933dbf96533ae..fae501d0afb9e 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 0000000000000..91630d79f4abb --- /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 0000000000000..9de3689208f00 --- /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/CMakeLists.txt b/recipes/libmediainfo/all/CMakeLists.txt deleted file mode 100644 index 8f32238b21da5..0000000000000 --- a/recipes/libmediainfo/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_definitions(${CONAN_DEFINES}) -set(ZenLib_LIBRARY ${CONAN_LIBS_LIBZEN}) -set(TinyXML_FOUND ON) - -add_subdirectory(source_subfolder/Project/CMake) diff --git a/recipes/libmediainfo/all/conandata.yml b/recipes/libmediainfo/all/conandata.yml index c54a0606f82a2..5a0b5059c5987 100644 --- a/recipes/libmediainfo/all/conandata.yml +++ b/recipes/libmediainfo/all/conandata.yml @@ -13,8 +13,37 @@ sources: sha256: "6848310eb7050efe7f90f18191dacfcc220c924390b8088fdf0d553274917f72" patches: "22.03": - - patch_file: "patches/0002-cmake-get-property-location.patch" - base_path: "source_subfolder" + - patch_file: "patches/21.09-0001-cmake-get-property-location.patch" + patch_description: "CMake: remove use of LOCATION property" + patch_type: "portability" + patch_source: "https://github.com/MediaArea/MediaInfoLib/pull/1526" + - patch_file: "patches/21.09-0002-cmake-handle-dependencies.patch" + patch_description: "CMake: robust discovery and link of dependencies" + patch_type: "conan" + "21.09": + - patch_file: "patches/21.09-0001-cmake-get-property-location.patch" + patch_description: "CMake: remove use of LOCATION property" + patch_type: "portability" + patch_source: "https://github.com/MediaArea/MediaInfoLib/pull/1526" + - patch_file: "patches/21.09-0002-cmake-handle-dependencies.patch" + patch_description: "CMake: robust discovery and link of dependencies" + patch_type: "conan" + "21.03": + - patch_file: "patches/21.03-0001-cmake-get-property-location.patch" + patch_description: "CMake: remove use of LOCATION property" + patch_type: "portability" + patch_source: "https://github.com/MediaArea/MediaInfoLib/pull/1526" + - patch_file: "patches/21.03-0002-cmake-handle-dependencies.patch" + patch_description: "CMake: robust discovery and link of dependencies" + patch_type: "conan" "20.03": - - patch_file: "patches/0001-cmakelists-CMAKE_MODULE_PATH-find_package.patch" - base_path: "source_subfolder" + - patch_file: "patches/20.03-0001-cmake-get-property-location.patch" + patch_description: "CMake: remove use of LOCATION property" + patch_type: "portability" + patch_source: "https://github.com/MediaArea/MediaInfoLib/pull/1526" + - patch_file: "patches/20.03-0002-cmake-handle-dependencies.patch" + patch_description: "CMake: robust discovery and link of dependencies" + patch_type: "conan" + - patch_file: "patches/20.03-0003-cmake-minimum-required.patch" + patch_description: "CMake: fix cmake_minimum_required()" + patch_type: "conan" diff --git a/recipes/libmediainfo/all/conanfile.py b/recipes/libmediainfo/all/conanfile.py index 37d62638387b4..29fb127a8927a 100644 --- a/recipes/libmediainfo/all/conanfile.py +++ b/recipes/libmediainfo/all/conanfile.py @@ -1,11 +1,16 @@ -from conan.tools.files import rename -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools +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 ( + apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, + rm, rmdir, save +) +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class LibmediainfoConan(ConanFile): @@ -13,9 +18,12 @@ class LibmediainfoConan(ConanFile): license = ("BSD-2-Clause", "Apache-2.0", "GLPL-2.1+", "GPL-2.0-or-later", "MPL-2.0") homepage = "https://mediaarea.net/en/MediaInfo" url = "https://github.com/conan-io/conan-center-index" - description = "MediaInfo is a convenient unified display of the most relevant technical and tag data for video and audio files" - topics = ("libmediainfo", "video", "audio", "metadata", "tag") - + description = ( + "MediaInfo is a convenient unified display of the most relevant " + "technical and tag data for video and audio files" + ) + topics = ("video", "audio", "metadata", "tag") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,16 +34,8 @@ class LibmediainfoConan(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" - - @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": @@ -43,67 +43,64 @@ 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("libcurl/7.82.0") - self.requires("libzen/0.4.38") + 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.12") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): - if not self.options["libzen"].enable_unicode: + if not self.dependencies["libzen"].options.enable_unicode: raise ConanInvalidConfiguration("This package requires libzen with unicode support") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_ZENLIB"] = False - cmake.definitions["BUILD_ZLIB"] = False - # Generate a relocatable shared lib on Macos - cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - cmake.configure() - return cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_ZENLIB"] = False + tc.variables["BUILD_ZLIB"] = False + if Version(self.version) < "22.03": + # Generate a relocatable shared lib 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) - - rename(self, "Findtinyxml2.cmake", "FindTinyXML.cmake") - tools.replace_in_file("FindTinyXML.cmake", "tinyxml2_LIBRARIES", "TinyXML_LIBRARIES") + apply_conandata_patches(self) - # TODO: move this to a patch (see how https://github.com/MediaArea/MediaInfoLib/issues/1408 if addressed by upstream) + # TODO: move this to a patch (see how https://github.com/MediaArea/MediaInfoLib/issues/1408 is addressed by upstream) postfix = "" if self.settings.build_type == "Debug": if self.settings.os == "Windows": postfix += "d" - elif tools.is_apple_os(self.settings.os): + elif is_apple_os(self): postfix += "_debug" - tools.replace_in_file(os.path.join(self._source_subfolder, "Source", "MediaInfoDLL", "MediaInfoDLL.h"), - "MediaInfo.dll", - "MediaInfo{}.dll".format(postfix)) - tools.replace_in_file(os.path.join(self._source_subfolder, "Source", "MediaInfoDLL", "MediaInfoDLL.h"), - "libmediainfo.0.dylib", - "libmediainfo{}.0.dylib".format(postfix)) + mediainfodll_h = os.path.join(self.source_folder, "Source", "MediaInfoDLL", "MediaInfoDLL.h") + replace_in_file(self, mediainfodll_h, "MediaInfo.dll", f"MediaInfo{postfix}.dll") + replace_in_file(self, mediainfodll_h, "libmediainfo.0.dylib", f"libmediainfo{postfix}.0.dylib") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "Project", "CMake")) cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("License.html", 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, "License.html", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") - tools.rmdir(os.path.join(self.package_folder, "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + 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")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -111,21 +108,20 @@ def package(self): {"mediainfo": "MediaInfoLib::MediaInfoLib"} ) - @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", "MediaInfoLib") @@ -135,9 +131,9 @@ def package_info(self): if self.settings.build_type == "Debug": if self.settings.os == "Windows": postfix += "d" - elif tools.is_apple_os(self.settings.os): + elif is_apple_os(self): postfix += "_debug" - self.cpp_info.libs = ["mediainfo" + postfix] + self.cpp_info.libs = [f"mediainfo{postfix}"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) @@ -146,4 +142,3 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "MediaInfoLib" 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"] = "libmediainfo" diff --git a/recipes/libmediainfo/all/patches/0001-cmakelists-CMAKE_MODULE_PATH-find_package.patch b/recipes/libmediainfo/all/patches/0001-cmakelists-CMAKE_MODULE_PATH-find_package.patch deleted file mode 100644 index 0a6c4f7b41354..0000000000000 --- a/recipes/libmediainfo/all/patches/0001-cmakelists-CMAKE_MODULE_PATH-find_package.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- Project/CMake/CMakeLists.txt -+++ Project/CMake/CMakeLists.txt -@@ -2,7 +2,7 @@ - - cmake_minimum_required(VERSION 2.8.11) - --set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") - - set(MediaInfoLib_MAJOR_VERSION 20) - set(MediaInfoLib_MINOR_VERSION 03) -@@ -85,10 +85,10 @@ - endif() - - # use bundled tinyxml only if no system --find_package(TinyXML) -+find_package(TinyXML REQUIRED) - - # use system curl if is present --find_package(CURL) -+find_package(CURL REQUIRED) - - include_directories(${MediaInfoLib_SOURCES_PATH}) - include_directories(${MediaInfoLib_SOURCES_PATH}/ThirdParty/md5/) diff --git a/recipes/libmediainfo/all/patches/20.03-0001-cmake-get-property-location.patch b/recipes/libmediainfo/all/patches/20.03-0001-cmake-get-property-location.patch new file mode 100644 index 0000000000000..d4cf8aa8336f4 --- /dev/null +++ b/recipes/libmediainfo/all/patches/20.03-0001-cmake-get-property-location.patch @@ -0,0 +1,29 @@ +--- a/Project/CMake/CMakeLists.txt ++++ b/Project/CMake/CMakeLists.txt +@@ -56,10 +56,8 @@ if (NOT BUILD_ZLIB) + find_package(ZLIB REQUIRED) + else() + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib) +- get_target_property(ZLIB_LIBRARIES zlibstatic LOCATION) + if(NOT BUILD_SHARED_LIBS) +- get_filename_component(ZLIB_LIBRARIES ${ZLIB_LIBRARIES} NAME) +- set(ZLIB_LIBRARIES "${LIB_INSTALL_DIR}/${ZLIB_LIBRARIES}") ++ set(ZLIB_LIBRARIES "${LIB_INSTALL_DIR}/$") + endif() + if(UNIX AND BUILD_SHARED_LIBS) + target_compile_options(zlibstatic PRIVATE -fPIC) +@@ -398,13 +396,7 @@ endif() + target_link_libraries(mediainfo ${ZenLib_LIBRARY} ${ZLIB_LIBRARIES}) + + if(MSVC AND BUILD_SHARED_LIBS) +- get_target_property(LOCATION mediainfo LOCATION_DEBUG) +- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}") +- install(FILES ${LOCATION} DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) +- +- get_target_property(LOCATION mediainfo LOCATION_RELWITHDEBINFO) +- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}") +- install(FILES ${LOCATION} DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) ++ install(FILES $ DESTINATION ${BIN_INSTALL_DIR} OPTIONAL) + endif() + + if (APPLE) diff --git a/recipes/libmediainfo/all/patches/20.03-0002-cmake-handle-dependencies.patch b/recipes/libmediainfo/all/patches/20.03-0002-cmake-handle-dependencies.patch new file mode 100644 index 0000000000000..0cfa50f5d6096 --- /dev/null +++ b/recipes/libmediainfo/all/patches/20.03-0002-cmake-handle-dependencies.patch @@ -0,0 +1,59 @@ +--- a/Project/CMake/CMakeLists.txt ++++ b/Project/CMake/CMakeLists.txt +@@ -2,7 +2,7 @@ project(MediaInfoLib) + + cmake_minimum_required(VERSION 2.8.11) + +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + + set(MediaInfoLib_MAJOR_VERSION 20) + set(MediaInfoLib_MINOR_VERSION 03) +@@ -83,7 +83,7 @@ elseif(APPLE) + endif() + + # use bundled tinyxml only if no system +-find_package(TinyXML) ++find_package(tinyxml2 REQUIRED CONFIG) + + # use system curl if is present + find_package(CURL) +@@ -350,7 +350,7 @@ if(WIN32) + set(MediaInfoLib_SRCS ${MediaInfoLib_SRCS} ${MediaInfoLib_SOURCES_PATH}/ThirdParty/aes-gladman/aes_ni.c) + endif() + +-if(NOT TinyXML_FOUND) ++if(NOT tinyxml2_FOUND) + include_directories(${MediaInfoLib_SOURCES_PATH}/ThirdParty/tinyxml2/) + list(APPEND MediaInfoLib_SRCS ${MediaInfoLib_SOURCES_PATH}/ThirdParty/tinyxml2/tinyxml2.cpp) + endif() +@@ -368,7 +368,7 @@ if(NOT CURL_FOUND) + target_compile_definitions(mediainfo PRIVATE MEDIAINFO_LIBCURL_NO) + else() + include_directories(${CURL_INCLUDE_DIRS}) +- target_link_libraries(mediainfo ${CURL_LIBRARIES}) ++ target_link_libraries(mediainfo CURL::libcurl) + set(CURL_PC " libcurl") + set(CURL_LIB " -lcurl") + endif() +@@ -383,17 +383,17 @@ target_include_directories(mediainfo PRIVATE + ${MediaInfoLib_SOURCES_PATH}/ThirdParty/sha2-gladman/ + ${MediaInfoLib_SOURCES_PATH}/ThirdParty/hmac-gladman/) + +-if(NOT TinyXML_FOUND) ++if(NOT tinyxml2_FOUND) + target_include_directories(mediainfo PRIVATE ${MediaInfoLib_SOURCES_PATH}/ThirdParty/tinyxml2/) + else() +- target_link_libraries(mediainfo "${TinyXML_LIBRARIES}") ++ target_link_libraries(mediainfo tinyxml2::tinyxml2) + endif() + + if(BUILD_ZENLIB) + target_include_directories(mediainfo PRIVATE ${ZLIB_INCLUDE_DIRS}) + endif() + +-target_link_libraries(mediainfo ${ZenLib_LIBRARY} ${ZLIB_LIBRARIES}) ++target_link_libraries(mediainfo zen ZLIB::ZLIB) + + if(MSVC AND BUILD_SHARED_LIBS) + install(FILES $ DESTINATION ${BIN_INSTALL_DIR} OPTIONAL) diff --git a/recipes/libmediainfo/all/patches/20.03-0003-cmake-minimum-required.patch b/recipes/libmediainfo/all/patches/20.03-0003-cmake-minimum-required.patch new file mode 100644 index 0000000000000..c5d841d99efb7 --- /dev/null +++ b/recipes/libmediainfo/all/patches/20.03-0003-cmake-minimum-required.patch @@ -0,0 +1,10 @@ +--- a/Project/CMake/CMakeLists.txt ++++ b/Project/CMake/CMakeLists.txt +@@ -1,6 +1,6 @@ ++cmake_minimum_required(VERSION 2.8.11) + project(MediaInfoLib) + +-cmake_minimum_required(VERSION 2.8.11) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + diff --git a/recipes/libmediainfo/all/patches/21.03-0001-cmake-get-property-location.patch b/recipes/libmediainfo/all/patches/21.03-0001-cmake-get-property-location.patch new file mode 100644 index 0000000000000..5b2da1594d4ef --- /dev/null +++ b/recipes/libmediainfo/all/patches/21.03-0001-cmake-get-property-location.patch @@ -0,0 +1,29 @@ +--- a/Project/CMake/CMakeLists.txt ++++ b/Project/CMake/CMakeLists.txt +@@ -56,10 +56,8 @@ if (NOT BUILD_ZLIB) + find_package(ZLIB REQUIRED) + else() + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib) +- get_target_property(ZLIB_LIBRARIES zlibstatic LOCATION) + if(NOT BUILD_SHARED_LIBS) +- get_filename_component(ZLIB_LIBRARIES ${ZLIB_LIBRARIES} NAME) +- set(ZLIB_LIBRARIES "${LIB_INSTALL_DIR}/${ZLIB_LIBRARIES}") ++ set(ZLIB_LIBRARIES "${LIB_INSTALL_DIR}/$") + endif() + if(UNIX AND BUILD_SHARED_LIBS) + target_compile_options(zlibstatic PRIVATE -fPIC) +@@ -400,13 +398,7 @@ endif() + target_link_libraries(mediainfo ${ZenLib_LIBRARY} ${ZLIB_LIBRARIES}) + + if(MSVC AND BUILD_SHARED_LIBS) +- get_target_property(LOCATION mediainfo LOCATION_DEBUG) +- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}") +- install(FILES ${LOCATION} DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) +- +- get_target_property(LOCATION mediainfo LOCATION_RELWITHDEBINFO) +- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}") +- install(FILES ${LOCATION} DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) ++ install(FILES $ DESTINATION ${BIN_INSTALL_DIR} OPTIONAL) + endif() + + if (APPLE) diff --git a/recipes/libmediainfo/all/patches/21.03-0002-cmake-handle-dependencies.patch b/recipes/libmediainfo/all/patches/21.03-0002-cmake-handle-dependencies.patch new file mode 100644 index 0000000000000..2c573df236311 --- /dev/null +++ b/recipes/libmediainfo/all/patches/21.03-0002-cmake-handle-dependencies.patch @@ -0,0 +1,50 @@ +--- a/Project/CMake/CMakeLists.txt ++++ b/Project/CMake/CMakeLists.txt +@@ -83,7 +83,7 @@ elseif(APPLE) + endif() + + # use bundled tinyxml only if no system +-find_package(TinyXML) ++find_package(tinyxml2 REQUIRED CONFIG) + + # use system curl if is present + find_package(CURL) +@@ -352,7 +352,7 @@ if(WIN32) + set(MediaInfoLib_SRCS ${MediaInfoLib_SRCS} ${MediaInfoLib_SOURCES_PATH}/ThirdParty/aes-gladman/aes_ni.c) + endif() + +-if(NOT TinyXML_FOUND) ++if(NOT tinyxml2_FOUND) + include_directories(${MediaInfoLib_SOURCES_PATH}/ThirdParty/tinyxml2/) + list(APPEND MediaInfoLib_SRCS ${MediaInfoLib_SOURCES_PATH}/ThirdParty/tinyxml2/tinyxml2.cpp) + endif() +@@ -370,7 +370,7 @@ if(NOT CURL_FOUND) + target_compile_definitions(mediainfo PRIVATE MEDIAINFO_LIBCURL_NO) + else() + include_directories(${CURL_INCLUDE_DIRS}) +- target_link_libraries(mediainfo ${CURL_LIBRARIES}) ++ target_link_libraries(mediainfo CURL::libcurl) + set(CURL_PC " libcurl") + set(CURL_LIB " -lcurl") + endif() +@@ -385,17 +385,17 @@ target_include_directories(mediainfo PRIVATE + ${MediaInfoLib_SOURCES_PATH}/ThirdParty/sha2-gladman/ + ${MediaInfoLib_SOURCES_PATH}/ThirdParty/hmac-gladman/) + +-if(NOT TinyXML_FOUND) ++if(NOT tinyxml2_FOUND) + target_include_directories(mediainfo PRIVATE ${MediaInfoLib_SOURCES_PATH}/ThirdParty/tinyxml2/) + else() +- target_link_libraries(mediainfo "${TinyXML_LIBRARIES}") ++ target_link_libraries(mediainfo tinyxml2::tinyxml2) + endif() + + if(BUILD_ZENLIB) + target_include_directories(mediainfo PRIVATE ${ZLIB_INCLUDE_DIRS}) + endif() + +-target_link_libraries(mediainfo ${ZenLib_LIBRARY} ${ZLIB_LIBRARIES}) ++target_link_libraries(mediainfo zen ZLIB::ZLIB) + + if(MSVC AND BUILD_SHARED_LIBS) + install(FILES $ DESTINATION ${BIN_INSTALL_DIR} OPTIONAL) diff --git a/recipes/libmediainfo/all/patches/0002-cmake-get-property-location.patch b/recipes/libmediainfo/all/patches/21.09-0001-cmake-get-property-location.patch similarity index 100% rename from recipes/libmediainfo/all/patches/0002-cmake-get-property-location.patch rename to recipes/libmediainfo/all/patches/21.09-0001-cmake-get-property-location.patch diff --git a/recipes/libmediainfo/all/patches/21.09-0002-cmake-handle-dependencies.patch b/recipes/libmediainfo/all/patches/21.09-0002-cmake-handle-dependencies.patch new file mode 100644 index 0000000000000..5c11938fdfdda --- /dev/null +++ b/recipes/libmediainfo/all/patches/21.09-0002-cmake-handle-dependencies.patch @@ -0,0 +1,50 @@ +--- a/Project/CMake/CMakeLists.txt ++++ b/Project/CMake/CMakeLists.txt +@@ -83,7 +83,7 @@ elseif(APPLE) + endif() + + # use bundled tinyxml only if no system +-find_package(TinyXML) ++find_package(tinyxml2 REQUIRED CONFIG) + + # use system curl if is present + find_package(CURL) +@@ -357,7 +357,7 @@ if(WIN32) + set(MediaInfoLib_SRCS ${MediaInfoLib_SRCS} ${MediaInfoLib_SOURCES_PATH}/ThirdParty/aes-gladman/aes_ni.c) + endif() + +-if(NOT TinyXML_FOUND) ++if(NOT tinyxml2_FOUND) + include_directories(${MediaInfoLib_SOURCES_PATH}/ThirdParty/tinyxml2/) + list(APPEND MediaInfoLib_SRCS ${MediaInfoLib_SOURCES_PATH}/ThirdParty/tinyxml2/tinyxml2.cpp) + endif() +@@ -375,7 +375,7 @@ if(NOT CURL_FOUND) + target_compile_definitions(mediainfo PRIVATE MEDIAINFO_LIBCURL_NO) + else() + include_directories(${CURL_INCLUDE_DIRS}) +- target_link_libraries(mediainfo ${CURL_LIBRARIES}) ++ target_link_libraries(mediainfo CURL::libcurl) + set(CURL_PC " libcurl") + set(CURL_LIB " -lcurl") + endif() +@@ -390,17 +390,17 @@ target_include_directories(mediainfo PRIVATE + ${MediaInfoLib_SOURCES_PATH}/ThirdParty/sha2-gladman/ + ${MediaInfoLib_SOURCES_PATH}/ThirdParty/hmac-gladman/) + +-if(NOT TinyXML_FOUND) ++if(NOT tinyxml2_FOUND) + target_include_directories(mediainfo PRIVATE ${MediaInfoLib_SOURCES_PATH}/ThirdParty/tinyxml2/) + else() +- target_link_libraries(mediainfo "${TinyXML_LIBRARIES}") ++ target_link_libraries(mediainfo tinyxml2::tinyxml2) + endif() + + if(BUILD_ZENLIB) + target_include_directories(mediainfo PRIVATE ${ZLIB_INCLUDE_DIRS}) + endif() + +-target_link_libraries(mediainfo ${ZenLib_LIBRARY} ${ZLIB_LIBRARIES}) ++target_link_libraries(mediainfo zen ZLIB::ZLIB) + + if(MSVC AND BUILD_SHARED_LIBS) + install(FILES $ DESTINATION ${BIN_INSTALL_DIR} OPTIONAL) diff --git a/recipes/libmediainfo/all/test_package/CMakeLists.txt b/recipes/libmediainfo/all/test_package/CMakeLists.txt index ddd72d9a23de2..c81192f5719cd 100644 --- a/recipes/libmediainfo/all/test_package/CMakeLists.txt +++ b/recipes/libmediainfo/all/test_package/CMakeLists.txt @@ -1,13 +1,10 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(MediaInfoLib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} mediainfo) +target_link_libraries(${PROJECT_NAME} PRIVATE mediainfo) option(LIBMEDIAINFO_SHARED "Is libmediainfo a shared library?") if(LIBMEDIAINFO_SHARED) diff --git a/recipes/libmediainfo/all/test_package/conanfile.py b/recipes/libmediainfo/all/test_package/conanfile.py index f658082513f60..a518ea1284361 100644 --- a/recipes/libmediainfo/all/test_package/conanfile.py +++ b/recipes/libmediainfo/all/test_package/conanfile.py @@ -1,4 +1,6 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os # testsrc.mp4 generated with: @@ -6,17 +8,28 @@ class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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["LIBMEDIAINFO_SHARED"] = self.dependencies["libmediainfo"].options.shared + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["LIBMEDIAINFO_SHARED"] = self.options["libmediainfo"].shared cmake.configure() 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.bindirs[0], "test_package") testsrc = os.path.join(self.source_folder, "testsrc.mp4") - self.run("{} {}".format(bin_path, testsrc), run_environment=True) + self.run(f"{bin_path} {testsrc}", env="conanrun") diff --git a/recipes/libmediainfo/all/test_v1_package/CMakeLists.txt b/recipes/libmediainfo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libmediainfo/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/libmediainfo/all/test_v1_package/conanfile.py b/recipes/libmediainfo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f87f616cc28bd --- /dev/null +++ b/recipes/libmediainfo/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.definitions["LIBMEDIAINFO_SHARED"] = self.options["libmediainfo"].shared + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + testsrc = os.path.join(self.source_folder, os.pardir, "test_package", "testsrc.mp4") + self.run(f"{bin_path} {testsrc}", run_environment=True) diff --git a/recipes/libmemcached/all/conandata.yml b/recipes/libmemcached/all/conandata.yml new file mode 100644 index 0000000000000..10b3ba148bd9a --- /dev/null +++ b/recipes/libmemcached/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.0.18": + url: "https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz" + sha256: "e22c0bb032fde08f53de9ffbc5a128233041d9f33b5de022c0978a2149885f82" + +patches: + "1.0.18": + - patch_file: "patches/01-compile-fix.patch" + patch_description: "fix compilation on MacOS" diff --git a/recipes/libmemcached/all/conanfile.py b/recipes/libmemcached/all/conanfile.py new file mode 100644 index 0000000000000..0288b9bb0fd69 --- /dev/null +++ b/recipes/libmemcached/all/conanfile.py @@ -0,0 +1,99 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.build import cross_building +from conan.tools.files import apply_conandata_patches, get, copy, export_conandata_patches, rm, rmdir +from conan.tools.layout import basic_layout +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os + +import os + +required_conan_version = ">=1.54.0" + +class LibmemcachedConan(ConanFile): + name = "libmemcached" + + # Optional metadata + license = "BSD License" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libmemcached.org/" + description = "libmemcached is a C client library for interfacing to a memcached server" + topics = ("cache", "network", "cloud") + # package_type should usually be "library" (if there is shared option) + package_type = "library" + + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "sasl": [True, False] + } + default_options = {"shared": False, + "fPIC": True, + "sasl": False} + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self.source_folder) + + 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): + # src_folder must use the same source folder name the project + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"] and not is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + + def _patch_source(self): + apply_conandata_patches(self) + + 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('--disable-dependency-tracking') + if not self.options.sasl: + tc.configure_args.append("--disable-sasl") + tc.generate() + + AutotoolsDeps(self).generate() + + def build(self): + self._patch_source() + + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) + autotools.install() + + # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + 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")) + + # In shared lib/executable files, autotools set install_name (macOS) to lib dir absolute path instead of @rpath, it's not relocatable, so fix it + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["memcached"] + self.cpp_info.system_libs = ["m"] + diff --git a/recipes/libmemcached/all/patches/01-compile-fix.patch b/recipes/libmemcached/all/patches/01-compile-fix.patch new file mode 100644 index 0000000000000..368bfda4321ab --- /dev/null +++ b/recipes/libmemcached/all/patches/01-compile-fix.patch @@ -0,0 +1,218 @@ +diff --git a/clients/memflush.cc b/clients/memflush.cc +index 8bd0dbf..cdba743 100644 +--- a/clients/memflush.cc ++++ b/clients/memflush.cc +@@ -39,7 +39,7 @@ int main(int argc, char *argv[]) + { + options_parse(argc, argv); + +- if (opt_servers == false) ++ if (opt_servers == NULL) + { + char *temp; + +@@ -48,7 +48,7 @@ int main(int argc, char *argv[]) + opt_servers= strdup(temp); + } + +- if (opt_servers == false) ++ if (opt_servers == NULL) + { + std::cerr << "No Servers provided" << std::endl; + exit(EXIT_FAILURE); +diff --git a/example/byteorder.cc b/example/byteorder.cc +index fdfa021..8c03d35 100644 +--- a/example/byteorder.cc ++++ b/example/byteorder.cc +@@ -42,27 +42,59 @@ + #include + + /* Byte swap a 64-bit number. */ +-#ifndef swap64 +-static inline uint64_t swap64(uint64_t in) +-{ +-#ifndef WORDS_BIGENDIAN +- /* Little endian, flip the bytes around until someone makes a faster/better ++#if !defined(htonll) && !defined(ntohll) ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++# if defined(__FreeBSD__) ++# include ++# define htonll(x) bswap64(x) ++# define ntohll(x) bswap64(x) ++# elif defined(__APPLE__) ++# include ++# define htonll(x) OSSwapInt64(x) ++# define ntohll(x) OSSwapInt64(x) ++# elif defined(__OpenBSD__) ++# include ++# define htonll(x) swap64(x) ++# define ntohll(x) swap64(x) ++# elif defined(__NetBSD__) ++# include ++# include ++# if defined(__BSWAP_RENAME) && !defined(__bswap_32) ++# define htonll(x) bswap64(x) ++# define ntohll(x) bswap64(x) ++# endif ++# elif defined(__sun) || defined(sun) ++# include ++# define htonll(x) BSWAP_64(x) ++# define ntohll(x) BSWAP_64(x) ++# elif defined(_MSC_VER) ++# include ++# define htonll(x) _byteswap_uint64(x) ++# define ntohll(x) _byteswap_uint64(x) ++# else ++# include ++# ifndef bswap_64 ++ /* Little endian, flip the bytes around until someone makes a faster/better + * way to do this. */ +- uint64_t rv= 0; +- for (uint8_t x= 0; x < 8; x++) +- { +- rv= (rv << 8) | (in & 0xff); +- in >>= 8; +- } +- return rv; ++ static inline uint64_t bswap_64(uint64_t in) ++ { ++ uint64_t rv= 0; ++ for (uint8_t x= 0; x < 8; x++) ++ { ++ rv= (rv << 8) | (in & 0xff); ++ in >>= 8; ++ } ++ return rv; ++ } ++# endif ++# define htonll(x) bswap_64(x) ++# define ntohll(x) bswap_64(x) ++# endif + #else +- /* big-endian machines don't need byte swapping */ +- return in; +-#endif // WORDS_BIGENDIAN +-} ++# define htonll(x) (x) ++# define ntohll(x) (x) ++#endif + #endif +- +-#ifdef HAVE_HTONLL + + uint64_t example_ntohll(uint64_t value) + { +@@ -73,17 +105,3 @@ uint64_t example_htonll(uint64_t value) + { + return htonll(value); + } +- +-#else // HAVE_HTONLL +- +-uint64_t example_ntohll(uint64_t value) +-{ +- return swap64(value); +-} +- +-uint64_t example_htonll(uint64_t value) +-{ +- return swap64(value); +-} +- +-#endif // HAVE_HTONLL +diff --git a/libmemcached/byteorder.cc b/libmemcached/byteorder.cc +index 9f11aa8..f167822 100644 +--- a/libmemcached/byteorder.cc ++++ b/libmemcached/byteorder.cc +@@ -39,41 +39,66 @@ + #include "libmemcached/byteorder.h" + + /* Byte swap a 64-bit number. */ +-#ifndef swap64 +-static inline uint64_t swap64(uint64_t in) +-{ +-#ifndef WORDS_BIGENDIAN +- /* Little endian, flip the bytes around until someone makes a faster/better ++#if !defined(htonll) && !defined(ntohll) ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++# if defined(__FreeBSD__) ++# include ++# define htonll(x) bswap64(x) ++# define ntohll(x) bswap64(x) ++# elif defined(__APPLE__) ++# include ++# define htonll(x) OSSwapInt64(x) ++# define ntohll(x) OSSwapInt64(x) ++# elif defined(__OpenBSD__) ++# include ++# define htonll(x) swap64(x) ++# define ntohll(x) swap64(x) ++# elif defined(__NetBSD__) ++# include ++# include ++# if defined(__BSWAP_RENAME) && !defined(__bswap_32) ++# define htonll(x) bswap64(x) ++# define ntohll(x) bswap64(x) ++# endif ++# elif defined(__sun) || defined(sun) ++# include ++# define htonll(x) BSWAP_64(x) ++# define ntohll(x) BSWAP_64(x) ++# elif defined(_MSC_VER) ++# include ++# define htonll(x) _byteswap_uint64(x) ++# define ntohll(x) _byteswap_uint64(x) ++# else ++# include ++# ifndef bswap_64 ++ /* Little endian, flip the bytes around until someone makes a faster/better + * way to do this. */ +- uint64_t rv= 0; +- for (uint8_t x= 0; x < 8; ++x) +- { +- rv= (rv << 8) | (in & 0xff); +- in >>= 8; +- } +- return rv; ++ static inline uint64_t bswap_64(uint64_t in) ++ { ++ uint64_t rv= 0; ++ for (uint8_t x= 0; x < 8; x++) ++ { ++ rv= (rv << 8) | (in & 0xff); ++ in >>= 8; ++ } ++ return rv; ++ } ++# endif ++# define htonll(x) bswap_64(x) ++# define ntohll(x) bswap_64(x) ++# endif + #else +- /* big-endian machines don't need byte swapping */ +- return in; +-#endif // WORDS_BIGENDIAN +-} ++# define htonll(x) (x) ++# define ntohll(x) (x) ++#endif + #endif +- + + uint64_t memcached_ntohll(uint64_t value) + { +-#ifdef HAVE_HTONLL + return ntohll(value); +-#else +- return swap64(value); +-#endif + } + + uint64_t memcached_htonll(uint64_t value) + { +-#ifdef HAVE_HTONLL + return htonll(value); +-#else +- return swap64(value); +-#endif + } diff --git a/recipes/libmemcached/all/test_package/CMakeLists.txt b/recipes/libmemcached/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..453e1be414e2c --- /dev/null +++ b/recipes/libmemcached/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 11) + +find_package(libmemcached REQUIRED) + +add_executable(${PROJECT_NAME} src/example.cpp) +#target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} libmemcached::libmemcached) diff --git a/recipes/libmemcached/all/test_package/conanfile.py b/recipes/libmemcached/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6bf32dfafa72f --- /dev/null +++ b/recipes/libmemcached/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +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/libmemcached/all/test_package/src/example.cpp b/recipes/libmemcached/all/test_package/src/example.cpp new file mode 100644 index 0000000000000..5f730988f2265 --- /dev/null +++ b/recipes/libmemcached/all/test_package/src/example.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + std::cout << memcached_lib_version() << '\n'; + return 0; +} diff --git a/recipes/libmemcached/all/test_v1_package/CMakeLists.txt b/recipes/libmemcached/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8b0d38c4a2f57 --- /dev/null +++ b/recipes/libmemcached/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +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/libmemcached/all/test_v1_package/conanfile.py b/recipes/libmemcached/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..395686390e2f2 --- /dev/null +++ b/recipes/libmemcached/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +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/libmemcached/config.yml b/recipes/libmemcached/config.yml new file mode 100644 index 0000000000000..701bdddc9bca6 --- /dev/null +++ b/recipes/libmemcached/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.18": + folder: all diff --git a/recipes/libmetalink/all/conanfile.py b/recipes/libmetalink/all/conanfile.py index 26b6f8a3d9655..10c23cc875879 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.12.3") 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.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/libmicrohttpd/all/conandata.yml b/recipes/libmicrohttpd/all/conandata.yml index ead353a01eb87..f20a5496c465e 100644 --- a/recipes/libmicrohttpd/all/conandata.yml +++ b/recipes/libmicrohttpd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.77": + url: "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.77.tar.gz" + sha256: "9e7023a151120060d2806a6ea4c13ca9933ece4eacfc5c9464d20edddb76b0a0" "0.9.75": url: "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.75.tar.gz" sha256: "9278907a6f571b391aab9644fd646a5108ed97311ec66f6359cebbedb0a4e3bb" diff --git a/recipes/libmicrohttpd/all/conanfile.py b/recipes/libmicrohttpd/all/conanfile.py index 82ca43a61b7ad..c81f9e360d523 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/libmicrohttpd/config.yml b/recipes/libmicrohttpd/config.yml index 48e6a23d34df6..a945bee94f12c 100644 --- a/recipes/libmicrohttpd/config.yml +++ b/recipes/libmicrohttpd/config.yml @@ -1,3 +1,5 @@ versions: + "0.9.77": + folder: all "0.9.75": folder: all diff --git a/recipes/libmikmod/all/conanfile.py b/recipes/libmikmod/all/conanfile.py index d4af224f4ca59..b2f6c5dadec51 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/conandata.yml b/recipes/libmnl/all/conandata.yml index bde6a08f3c7d1..11d5c387c466f 100644 --- a/recipes/libmnl/all/conandata.yml +++ b/recipes/libmnl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.5": + url: "https://www.netfilter.org/projects/libmnl/files/libmnl-1.0.5.tar.bz2" + sha256: "274b9b919ef3152bfb3da3a13c950dd60d6e2bcd54230ffeca298d03b40d0525" "1.0.4": - sha256: 171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81 - url: https://www.netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2 + url: "https://www.netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2" + sha256: "171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81" diff --git a/recipes/libmnl/all/conanfile.py b/recipes/libmnl/all/conanfile.py index 14628c1889b0d..4542e12fe1d34 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 d4fdee1a8a79c..941d5b3d99ff8 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 58e0d68615142..39ac1b7b50008 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/libmnl/config.yml b/recipes/libmnl/config.yml index 33bdc0114d503..4e7eb0116387e 100644 --- a/recipes/libmnl/config.yml +++ b/recipes/libmnl/config.yml @@ -1,3 +1,5 @@ versions: + 1.0.5: + folder: all 1.0.4: folder: all diff --git a/recipes/libmodbus/all/conandata.yml b/recipes/libmodbus/all/conandata.yml index 176711066e07f..ed5ad22d14ff2 100644 --- a/recipes/libmodbus/all/conandata.yml +++ b/recipes/libmodbus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.10": + url: "https://github.com/stephane/libmodbus/releases/download/v3.1.10/libmodbus-3.1.10.tar.gz" + sha256: "899be4e25ab7fe5799d43f9567510d6f063d2e8f56136dd726b6fd976f9b2253" "3.1.8": url: "https://github.com/stephane/libmodbus/releases/download/v3.1.8/libmodbus-3.1.8.tar.gz" sha256: "b122f2bc29f749702a22c0a760a7ca2182d541f5fa26bf25e3431f907b606f3c" @@ -6,6 +9,8 @@ sources: url: "https://libmodbus.org/releases/libmodbus-3.1.6.tar.gz" sha256: "d7d9fa94a16edb094e5fdf5d87ae17a0dc3f3e3d687fead81835d9572cf87c16" patches: + "3.1.10": + - patch_file: "patches/3.1.10-0001-msvc-fixes.patch" "3.1.8": - patch_file: "patches/3.1.8-0001-msvc-fixes.patch" "3.1.6": diff --git a/recipes/libmodbus/all/patches/3.1.10-0001-msvc-fixes.patch b/recipes/libmodbus/all/patches/3.1.10-0001-msvc-fixes.patch new file mode 100644 index 0000000000000..876ce8dc08eca --- /dev/null +++ b/recipes/libmodbus/all/patches/3.1.10-0001-msvc-fixes.patch @@ -0,0 +1,20 @@ +--- src/Makefile.in ++++ src/Makefile.in +@@ -326,7 +326,7 @@ + localstatedir = @localstatedir@ + mandir = @mandir@ + mkdir_p = @mkdir_p@ +-my_CFLAGS = @my_CFLAGS@ ++my_CFLAGS = + oldincludedir = @oldincludedir@ + pdfdir = @pdfdir@ + prefix = @prefix@ +--- src/modbus-private.h ++++ src/modbus-private.h +@@ -14,5 +14,5 @@ + #else + # include "stdint.h" + # include +-typedef int ssize_t; ++//typedef int ssize_t; + #endif diff --git a/recipes/libmodbus/config.yml b/recipes/libmodbus/config.yml index 49c098a9b7d41..98dbf2345aa1e 100644 --- a/recipes/libmodbus/config.yml +++ b/recipes/libmodbus/config.yml @@ -1,4 +1,6 @@ versions: + "3.1.10": + folder: all "3.1.8": folder: all "3.1.6": diff --git a/recipes/libmorton/all/conandata.yml b/recipes/libmorton/all/conandata.yml index 388df27940d46..db08154a617a3 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 88387c424a149..056827a88e63b 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 5bf946443eb38..d36ca36c23c13 100644 --- a/recipes/libmount/all/conandata.yml +++ b/recipes/libmount/all/conandata.yml @@ -1,4 +1,10 @@ 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" "2.36.2": url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.2.tar.xz" sha256: "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f" diff --git a/recipes/libmount/all/conanfile.py b/recipes/libmount/all/conanfile.py index 8152bd466af26..b9ec541d71963 100644 --- a/recipes/libmount/all/conanfile.py +++ b/recipes/libmount/all/conanfile.py @@ -17,7 +17,7 @@ class LibmountConan(ConanFile): topics = ("mount", "linux", "util-linux") url = "https://github.com/conan-io/conan-center-index" homepage = "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git" - license = "GPL-2.0-or-later" + license = "LGPL-2.1-or-later" package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -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 c0f9ff233a2c0..867141253ca23 100644 --- a/recipes/libmount/config.yml +++ b/recipes/libmount/config.yml @@ -1,4 +1,8 @@ versions: + "2.39.2": + folder: all + "2.39": + folder: all "2.36.2": folder: all "2.36": diff --git a/recipes/libmpdclient/all/conandata.yml b/recipes/libmpdclient/all/conandata.yml new file mode 100644 index 0000000000000..45f3be3daf711 --- /dev/null +++ b/recipes/libmpdclient/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.22": + url: "https://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.22.tar.xz" + sha256: "eac15b82b5ba5ed0648af580221eb74657394f7fe768e966d9e9ebb27435429f" + "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 0000000000000..7df400a892ea8 --- /dev/null +++ b/recipes/libmpdclient/all/conanfile.py @@ -0,0 +1,115 @@ +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 +from conan.tools.scm import Version +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-2-Clause", "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): + if Version(self.version) >= "2.22": + copy(self, "*", os.path.join(self.source_folder, "LICENSES"), os.path.join(self.package_folder, "licenses")) + else: + 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")) + 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 0000000000000..f00d9cb1c388c --- /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 0000000000000..0a6bc68712d90 --- /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 0000000000000..bb53ebecfee6d --- /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/libmpdclient/all/test_v1_package/CMakeLists.txt b/recipes/libmpdclient/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libmpdclient/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/libmpdclient/all/test_v1_package/conanfile.py b/recipes/libmpdclient/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /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 0000000000000..76913be25172d --- /dev/null +++ b/recipes/libmpdclient/config.yml @@ -0,0 +1,5 @@ +versions: + "2.22": + folder: "all" + "2.20": + folder: "all" diff --git a/recipes/libmysqlclient/all/conandata.yml b/recipes/libmysqlclient/all/conandata.yml index 7533ad1b401d8..78b5ed97e3e15 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 46f8df1537d5e..deb913588e58e 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,20 +250,28 @@ 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") self.cpp_info.libs = ["libmysql" if self.settings.os == "Windows" and self.options.shared else "mysqlclient"] + self.cpp_info.includedirs.append(os.path.join("include", "mysql")) if not self.options.shared: stdcpplib = stdcpp_library(self) if stdcpplib: 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 0000000000000..ebaba58ec7fab --- /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 d2183e51a5f3c..1b617851b7de6 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/libnet/all/conandata.yml b/recipes/libnet/all/conandata.yml index 56c7fdd2f75d8..b6160ca826334 100644 --- a/recipes/libnet/all/conandata.yml +++ b/recipes/libnet/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3": + url: "https://github.com/libnet/libnet/releases/download/v1.3/libnet-1.3.tar.gz" + sha256: "ad1e2dd9b500c58ee462acd839d0a0ea9a2b9248a1287840bc601e774fb6b28f" "1.2": - sha256: caa4868157d9e5f32e9c7eac9461efeff30cb28357f7f6bf07e73933fb4edaa7 - url: https://github.com/libnet/libnet/releases/download/v1.2/libnet-1.2.tar.gz + url: "https://github.com/libnet/libnet/releases/download/v1.2/libnet-1.2.tar.gz" + sha256: "caa4868157d9e5f32e9c7eac9461efeff30cb28357f7f6bf07e73933fb4edaa7" diff --git a/recipes/libnet/config.yml b/recipes/libnet/config.yml index a0777b5aa931c..81d0457bb64a7 100644 --- a/recipes/libnet/config.yml +++ b/recipes/libnet/config.yml @@ -1,3 +1,5 @@ versions: + "1.3": + folder: all "1.2": folder: all diff --git a/recipes/libnetfilter_conntrack/all/conandata.yml b/recipes/libnetfilter_conntrack/all/conandata.yml index 15ebea6f3f76c..dbaef81342d93 100644 --- a/recipes/libnetfilter_conntrack/all/conandata.yml +++ b/recipes/libnetfilter_conntrack/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.9": + url: "https://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-1.0.9.tar.bz2" + sha256: "67bd9df49fe34e8b82144f6dfb93b320f384a8ea59727e92ff8d18b5f4b579a8" "1.0.8": - sha256: 0cd13be008923528687af6c6b860f35392d49251c04ee0648282d36b1faec1cf - url: https://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-1.0.8.tar.bz2 + url: "https://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-1.0.8.tar.bz2" + sha256: "0cd13be008923528687af6c6b860f35392d49251c04ee0648282d36b1faec1cf" diff --git a/recipes/libnetfilter_conntrack/all/conanfile.py b/recipes/libnetfilter_conntrack/all/conanfile.py index b4f68103f83c1..838c21aea601b 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 4dbc40cd2c4d9..133b0de001670 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 4959660649186..cf3b9d75009a7 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 331a7d9d4f854..ccdf8593d195f 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 0000000000000..91630d79f4abb --- /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 0000000000000..ebd551d13e399 --- /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_conntrack/config.yml b/recipes/libnetfilter_conntrack/config.yml index 3d5953260054d..f02198b44e348 100644 --- a/recipes/libnetfilter_conntrack/config.yml +++ b/recipes/libnetfilter_conntrack/config.yml @@ -1,3 +1,5 @@ versions: + 1.0.9: + folder: all 1.0.8: folder: all diff --git a/recipes/libnetfilter_queue/all/conanfile.py b/recipes/libnetfilter_queue/all/conanfile.py index 56576ded262ce..3552a30ecc625 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 4dbc40cd2c4d9..58e2406eaac64 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 1097433829a7c..cf3b9d75009a7 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 f229443f228aa..6260070d87080 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 0000000000000..91630d79f4abb --- /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 0000000000000..528904ad9f959 --- /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 10540d39fbf9c..3797ae3ceea3a 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 d4fdee1a8a79c..7e1aa1808dfd5 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 e4f1965959dec..e0f447388fa1b 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 95153d8532f51..395453bdde08a 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 0000000000000..91630d79f4abb --- /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 0000000000000..c8689f282274d --- /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/libnfs/all/conandata.yml b/recipes/libnfs/all/conandata.yml index 5c9b795165455..b4b4af80e776c 100644 --- a/recipes/libnfs/all/conandata.yml +++ b/recipes/libnfs/all/conandata.yml @@ -1,8 +1,16 @@ sources: + "5.0.2": + url: "https://github.com/sahlberg/libnfs/archive/refs/tags/libnfs-5.0.2.tar.gz" + sha256: "637e56643b19da9fba98f06847788c4dad308b723156a64748041035dcdf9bd3" "5.0.1": url: "https://github.com/sahlberg/libnfs/archive/refs/tags/libnfs-5.0.1.tar.gz" sha256: "7ef445410b42f36b9bad426608b53ccb9ccca4101e545c383f564c11db672ca8" patches: + "5.0.2": + - patch_file: "patches/5.0.1-0001-remove-exports.patch" + patch_description: "Fix installation" + patch_type: "conan" + patch_source: "https://github.com/sahlberg/libnfs/pull/377" "5.0.1": - patch_file: "patches/5.0.1-0001-remove-exports.patch" patch_description: "Fix installation" diff --git a/recipes/libnfs/all/conanfile.py b/recipes/libnfs/all/conanfile.py index 3b943c080be1a..12b83841bd97e 100644 --- a/recipes/libnfs/all/conanfile.py +++ b/recipes/libnfs/all/conanfile.py @@ -13,6 +13,7 @@ class LibnfsConan(ConanFile): license = "LGPL-2.1" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/sahlberg/libnfs" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -40,8 +41,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/libnfs/config.yml b/recipes/libnfs/config.yml index 12fc1d264fabb..7e49cd33d0bdc 100644 --- a/recipes/libnfs/config.yml +++ b/recipes/libnfs/config.yml @@ -1,3 +1,5 @@ versions: + "5.0.2": + folder: "all" "5.0.1": folder: "all" diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index 9078b4202e02b..a883c4b7d535a 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,4 +1,22 @@ 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" + "1.55.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.55.0.tar.gz" + sha256: "6d2a4d246e84cb1e3e581591bd1c50ecc085e50090bc068ed5a67f87c6b4a06e" + "1.54.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.54.0.tar.gz" + sha256: "aae8bda9e06d7c51a12488175086edc44a46c230561dc7c45d779e00e43d4b8e" "1.53.0": url: "https://github.com/nghttp2/nghttp2/releases/download/v1.53.0/nghttp2-1.53.0.tar.xz" sha256: "b867184254e5a29b0ba68413aa14f8b0ce1142a371761374598dec092dabb809" @@ -8,65 +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" - "1.45.1": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.45.1/nghttp2-1.45.1.tar.xz" - sha256: "abdc4addccadbc7d89abe27c4d6427d78e57d139f69c1f45749227393c68bf79" - "1.43.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.43.0/nghttp2-1.43.0.tar.xz" - sha256: "f7d54fa6f8aed29f695ca44612136fa2359013547394d5dffeffca9e01a26b0f" - "1.42.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.42.0/nghttp2-1.42.0.tar.xz" - sha256: "c5a7f09020f31247d0d1609078a75efadeccb7e5b86fc2e4389189b1b431fe63" - "1.40.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.40.0/nghttp2-1.40.0.tar.xz" - sha256: "09fc43d428ff237138733c737b29fb1a7e49d49de06d2edbed3bc4cdcee69073" - "1.39.2": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.39.2/nghttp2-1.39.2.tar.xz" - sha256: "a2d216450abd2beaf4e200c168957968e89d602ca4119338b9d7ab059fd4ce8b" -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" - "1.45.1": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - "1.43.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - "1.42.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - "1.40.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - - patch_file: "patches/1.40.0-remove-static-suffix.patch" - patch_type: "backport" - patch_source: https://github.com/curl/curl/pull/7515#issuecomment-890320856 - patch_description: >- - Fix the breaking change that was introduced in 1.40.0 and made optional - in 1.40.1 - "1.39.2": - - patch_file: "patches/fix-addNghttp2IncludesPathCMake.patch" - - 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 d6777fe1e084b..7a30076b7b190 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.0") + self.requires("c-ares/1.22.0") self.requires("libev/4.33") self.requires("libevent/2.1.12") - self.requires("libxml2/2.10.4") - self.requires("zlib/1.2.13") + self.requires("libxml2/2.12.3") + 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.81.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/1.40.0-remove-static-suffix.patch b/recipes/libnghttp2/all/patches/1.40.0-remove-static-suffix.patch deleted file mode 100644 index b769d5a577c38..0000000000000 --- a/recipes/libnghttp2/all/patches/1.40.0-remove-static-suffix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/CMakeLists.txt.orig 2022-12-23 11:01:09.000000000 +0200 -+++ lib/CMakeLists.txt 2022-12-23 11:01:22.000000000 +0200 -@@ -62,7 +62,7 @@ if(HAVE_CUNIT OR ENABLE_STATIC_LIB) - set_target_properties(nghttp2_static PROPERTIES - COMPILE_FLAGS "${WARNCFLAGS}" - VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} -- ARCHIVE_OUTPUT_NAME nghttp2_static -+ ARCHIVE_OUTPUT_NAME nghttp2 - ) - target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB") - if(ENABLE_STATIC_LIB) diff --git a/recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch b/recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch deleted file mode 100644 index f3458ec8b39b9..0000000000000 --- a/recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt.orig 2019-12-12 20:23:38.855819744 +0100 -+++ CMakeLists.txt 2019-12-12 20:22:54.194563670 +0100 -@@ -449,6 +449,8 @@ - - install(FILES README.rst DESTINATION "${CMAKE_INSTALL_DOCDIR}") - -+include_directories(lib/includes) -+ - add_subdirectory(lib) - #add_subdirectory(lib/includes) - add_subdirectory(third-party) diff --git a/recipes/libnghttp2/all/patches/fix-findJemalloc.cmake b/recipes/libnghttp2/all/patches/fix-findJemalloc.cmake deleted file mode 100644 index f072d3a7f8d5a..0000000000000 --- 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 b58cd730c3bff..0000000000000 --- 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/all/test_package/CMakeLists.txt b/recipes/libnghttp2/all/test_package/CMakeLists.txt index eb7f9cd8b9769..f359e60515137 100644 --- a/recipes/libnghttp2/all/test_package/CMakeLists.txt +++ b/recipes/libnghttp2/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(libnghttp2 REQUIRED CONFIG) diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index 35bd03552b39b..9868faae8fd3c 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,25 +1,19 @@ versions: - "1.53.0": - folder: all - "1.51.0": - folder: all - "1.50.0": + "1.58.0": folder: all - "1.49.0": + "1.57.0": folder: all - "1.48.0": + "1.56.0": folder: all - "1.47.0": + "1.55.1": folder: all - "1.46.0": + "1.55.0": folder: all - "1.45.1": + "1.54.0": folder: all - "1.43.0": - folder: all - "1.42.0": + "1.53.0": folder: all - "1.40.0": + "1.51.0": folder: all - "1.39.2": + "1.50.0": folder: all diff --git a/recipes/libnice/all/conanfile.py b/recipes/libnice/all/conanfile.py index 5fd9fcdbbc036..e35ebe0fd7925 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 22dd4e9d14ebe..a91756abf0bec 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 8c9580d2d52b2..ecf464197e0a5 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 edfebcd8dad20..9db76cae21f37 100644 --- a/recipes/libnl/all/conandata.yml +++ b/recipes/libnl/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "3.9.0": + url: "https://github.com/thom311/libnl/releases/download/libnl3_9_0/libnl-3.9.0.tar.gz" + sha256: "aed507004d728a5cf11eab48ca4bf9e6e1874444e33939b9d3dfed25018ee9bb" + "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": + 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://www.infradead.org/~tgr/libnl/files/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 1bd02b2f42194..a355e8b21201e 100644 --- a/recipes/libnl/all/conanfile.py +++ b/recipes/libnl/all/conanfile.py @@ -1,78 +1,71 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import get, rmdir, copy, rm +from conan.tools.layout import basic_layout +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" - +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} - build_requires = ( "flex/2.6.4", "bison/3.7.6" ) - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } 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 != "Linux": - raise ConanInvalidConfiguration("Libnl is only supported on Linux") + raise ConanInvalidConfiguration(f"{self.ref} is only supported on Linux") - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - config_args = [ - "--prefix={}".format(tools.unix_path(self.package_folder)), - ] - if self.options.shared: - config_args.extend(["--enable-shared=yes", "--enable-static=no"]) - else: - config_args.extend(["--enable-shared=no", "--enable-static=yes"]) + def build_requirements(self): + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") - self._autotools.configure(configure_dir=self._source_subfolder, args=config_args) - return self._autotools + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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): - autotools = self._configure_autotools() + autotools = Autotools(self) autotools.install() - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - 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")) - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), 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.components["nl"].libs = ["nl-3"] self.cpp_info.components["nl"].includedirs = [os.path.join('include', 'libnl3')] - if self._settings_build.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"] @@ -81,5 +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"] + 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/all/test_package/CMakeLists.txt b/recipes/libnl/all/test_package/CMakeLists.txt index df9446e8809cf..c5d1b19c7a8f9 100644 --- a/recipes/libnl/all/test_package/CMakeLists.txt +++ b/recipes/libnl/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.5) -project(netlink_example) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libnl REQUIRED CONFIG) -add_executable(show_links show_links.c) -target_link_libraries(show_links ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} ${PROJECT_NAME}.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libnl::nl libnl::nl-route libnl::nl-genl libnl::nl-nf libnl::nl-cli libnl::nl-idiag) diff --git a/recipes/libnl/all/test_package/conanfile.py b/recipes/libnl/all/test_package/conanfile.py index c130487451ae0..9b544e8a245c0 100644 --- a/recipes/libnl/all/test_package/conanfile.py +++ b/recipes/libnl/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -import os.path - -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, cmake_layout class NetlinkTestConan(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) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join(self.build_folder, "bin", "show_links") - self.run(bin_path, cwd=self.source_folder, 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/libnl/all/test_package/show_links.c b/recipes/libnl/all/test_package/test_package.c similarity index 100% rename from recipes/libnl/all/test_package/show_links.c rename to recipes/libnl/all/test_package/test_package.c diff --git a/recipes/libnl/config.yml b/recipes/libnl/config.yml index 992cfb9a265e6..4e17fb9e83226 100644 --- a/recipes/libnl/config.yml +++ b/recipes/libnl/config.yml @@ -1,3 +1,9 @@ versions: + 3.9.0: + folder: all + 3.8.0: + folder: all + 3.7.0: + folder: all 3.2.25: folder: all diff --git a/recipes/libnpy/all/conandata.yml b/recipes/libnpy/all/conandata.yml new file mode 100644 index 0000000000000..f7c435c55da39 --- /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 0000000000000..1a453076924de --- /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 0000000000000..d8ff7a7d07435 --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..896ab340a0523 --- /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 0000000000000..715e55357a17b --- /dev/null +++ b/recipes/libnpy/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/libnuma/all/conandata.yml b/recipes/libnuma/all/conandata.yml index 0c573279e69f1..34ddb5ae1b18a 100644 --- a/recipes/libnuma/all/conandata.yml +++ b/recipes/libnuma/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.16": + url: "https://github.com/numactl/numactl/releases/download/v2.0.16/numactl-2.0.16.tar.gz" + sha256: "1b242f893af977a1d31af6ce9d6b8dafdd2d8ec3dc9207f7c2dc0d3446e7c7c8" "2.0.14": url: "https://github.com/numactl/numactl/releases/download/v2.0.14/numactl-2.0.14.tar.gz" sha256: "826bd148c1b6231e1284e42a4db510207747484b112aee25ed6b1078756bcff6" diff --git a/recipes/libnuma/config.yml b/recipes/libnuma/config.yml index 819ebd6fb8395..e2f73008d4e9a 100644 --- a/recipes/libnuma/config.yml +++ b/recipes/libnuma/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.16": + folder: all "2.0.14": folder: all diff --git a/recipes/liboping/all/conandata.yml b/recipes/liboping/all/conandata.yml index 383d4f884713f..a9da5ce81e695 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 21125770e672e..811729afcf6e2 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 30961cdb0ded2..76c10855ad585 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 b7bbf79eba926..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..b7bbf79eba926 --- /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/libpcap/all/conandata.yml b/recipes/libpcap/all/conandata.yml index c909e32c74890..776adccb0ef4d 100644 --- a/recipes/libpcap/all/conandata.yml +++ b/recipes/libpcap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.10.4": + url: "https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.10.4.tar.gz" + sha256: "1783ff39f2a6eb99a7625c7ea471782614c94965ea934b6b22ac6eb38db266bc" "1.10.1": url: "https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.10.1.tar.gz" sha256: "7b650c9e0ce246aa41ba5463fe8e903efc444c914a3ccb986547350bed077ed6" diff --git a/recipes/libpcap/config.yml b/recipes/libpcap/config.yml index 102e778434a57..704c5ae57304e 100644 --- a/recipes/libpcap/config.yml +++ b/recipes/libpcap/config.yml @@ -1,4 +1,6 @@ versions: + "1.10.4": + folder: all "1.10.1": folder: all "1.10.0": diff --git a/recipes/libpciaccess/all/conanfile.py b/recipes/libpciaccess/all/conanfile.py index fffe763dbedc4..a97b5318a1c30 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/libpfm4/all/conandata.yml b/recipes/libpfm4/all/conandata.yml index ccfa567e2963b..c6534c2a7319f 100644 --- a/recipes/libpfm4/all/conandata.yml +++ b/recipes/libpfm4/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.13.0": + url: "https://versaweb.dl.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.13.0.tar.gz" + sha256: "d18b97764c755528c1051d376e33545d0eb60c6ebf85680436813fa5b04cc3d1" "4.12.0": url: "https://versaweb.dl.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.12.0.tar.gz" sha256: "4b0c1f53f39a61525b69bebf532c68040c1b984d7544a8ae0844b13cd91e1ee4" diff --git a/recipes/libpfm4/all/conanfile.py b/recipes/libpfm4/all/conanfile.py index 89894d3e1796e..563971fb81a95 100644 --- a/recipes/libpfm4/all/conanfile.py +++ b/recipes/libpfm4/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout -from conan.tools.files import get, rmdir, copy, replace_in_file +from conan.tools.files import get, rmdir, copy, replace_in_file, rm from conan.errors import ConanInvalidConfiguration import os @@ -11,11 +11,12 @@ class Libpfm4Conan(ConanFile): license = "MIT" homepage = "http://perfmon2.sourceforge.net" url = "https://github.com/conan-io/conan-center-index" - description = ("A helper library to program the performance monitoring events") + description = "A helper library to program the performance monitoring events" topics = ("perf", "pmu", "benchmark", "microbenchmark") settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} + package_type = "library" def validate(self): # The library doesn't really make much sense without perf_events API @@ -23,28 +24,14 @@ def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("This library is Linux only") - def config_options(self): - # and currently does not compile on modern Mac OS X && 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.cppstd - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") 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, destination=self.source_folder) @@ -54,16 +41,19 @@ def generate(self): tc.generate() def _patch_sources(self): - if not self.options.shared: + if self.options.get_safe("fPIC"): # honor fPIC option replace_in_file(self, os.path.join(self.source_folder, "rules.mk"), "-fPIC", "") replace_in_file(self, os.path.join(self.source_folder, "rules.mk"), "-DPIC", "") + def _yes_no(self, option): + return "y" if option else "n" + def build(self): self._patch_sources() args = [ 'DBG=', - 'CONFIG_PFMLIB_SHARED={}'.format("y" if self.options.shared else "n"), + f'CONFIG_PFMLIB_SHARED={self._yes_no(self.options.shared)}', f'-C {self.source_folder}' ] autotools = Autotools(self) @@ -71,25 +61,24 @@ def build(self): def package(self): copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - args = [ + copy(self, "err.h", dst=os.path.join(self.package_folder, "include", "perfmon"), src=os.path.join(self.source_folder, "include", "perfmon")) + + autotools = Autotools(self) + autotools.install(args=[ 'DBG=', 'LDCONFIG=true', - 'CONFIG_PFMLIB_SHARED={}'.format("y" if self.options.shared else "n"), + f'CONFIG_PFMLIB_SHARED={self._yes_no(self.options.shared)}', f'DESTDIR={self.package_folder}{os.sep}', f'INCDIR=include{os.sep}', f'LIBDIR=lib{os.sep}', f'-C {self.source_folder}' - ] - # due to bug, Mac install phase fails with config shared - if self.settings.os == 'Macos': - args.append('CONFIG_PFMLIB_SHARED=n') - - copy(self, "err.h", dst=os.path.join(self.package_folder, "include", "perfmon"), src=os.path.join(self.source_folder, "include", "perfmon")) - autotools = Autotools(self) - autotools.install(args=args) + ]) rmdir(self, os.path.join(self.package_folder, "usr")) + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.libs = ["pfm"] - if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.system_libs = ["pthread", "m"] + # This currently only compiles on Linux, so always add the libs + self.cpp_info.system_libs = ["pthread", "m"] + diff --git a/recipes/libpfm4/config.yml b/recipes/libpfm4/config.yml index b06c46e0f08f9..c296be9e946ca 100644 --- a/recipes/libpfm4/config.yml +++ b/recipes/libpfm4/config.yml @@ -1,3 +1,5 @@ versions: + "4.13.0": + folder: all "4.12.0": folder: all diff --git a/recipes/libpng/all/conan_cmake_project_include.cmake b/recipes/libpng/all/conan_cmake_project_include.cmake new file mode 100644 index 0000000000000..e70fb28d5bf7d --- /dev/null +++ b/recipes/libpng/all/conan_cmake_project_include.cmake @@ -0,0 +1,7 @@ +# Older versions of libpng's CMakeLists reference the ZLIB_LIBRARy +# varible which was never officially documented. +# This was fixed in which first went into version 1.6.38. +# This can be deleted once the recipe no longer supports versions older than that. +# https://github.com/glennrp/libpng/commit/9f734b13f4ea062af98652c4c7678f667d2d85c7 +find_package(ZLIB CONFIG REQUIRED) +set(ZLIB_LIBRARY "${ZLIB_LIBRARIES}") diff --git a/recipes/libpng/all/conandata.yml b/recipes/libpng/all/conandata.yml index e10462996e48c..bb5cbe33cccce 100644 --- a/recipes/libpng/all/conandata.yml +++ b/recipes/libpng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.40": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.40/libpng-1.6.40.tar.xz" + sha256: "535b479b2467ff231a3ec6d92a525906fb8ef27978be4f66dbe05d3f3a01b3a1" "1.6.39": url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.39/libpng-1.6.39.tar.xz" sha256: "1f4696ce70b4ee5f85f1e1623dc1229b210029fa4b7aee573df3e2ba7b036937" @@ -8,17 +11,9 @@ sources: "1.6.37": url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.37/libpng-1.6.37.tar.xz" sha256: "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca" + "1.6.32": + url: "https://sourceforge.net/projects/libpng/files/libpng16/older-releases/1.6.32/libpng-1.6.32.tar.xz" + sha256: "c918c3113de74a692f0a1526ce881dc26067763eb3915c57ef3a0f7b6886f59b" "1.5.30": url: "https://sourceforge.net/projects/libpng/files/libpng15/1.5.30/libpng-1.5.30.tar.xz" sha256: "7d76275fad2ede4b7d87c5fd46e6f488d2a16b5a69dc968ffa840ab39ba756ed" -patches: - "1.6.37": - - patch_file: "patches/0001-1.6.37-cmakefile-zlib.patch" - patch_description: "Update ZLib include and library paths for conan to provide\ - \ lib. Remove Zlib dll definition." - patch_type: "conan" - "1.5.30": - - patch_file: "patches/0001-1.5.30-cmakefile-zlib.patch" - patch_description: "Update ZLib include and library paths for conan to provide\ - \ lib. Remove Zlib dll definition." - patch_type: "conan" diff --git a/recipes/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py index 5b838438efa3b..f5410a3afa2d7 100644 --- a/recipes/libpng/all/conanfile.py +++ b/recipes/libpng/all/conanfile.py @@ -68,6 +68,7 @@ def _neon_msa_sse_vsx_mapping(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": @@ -91,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): @@ -102,11 +103,13 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["PNG_TESTS"] = False - tc.variables["PNG_SHARED"] = self.options.shared - tc.variables["PNG_STATIC"] = not self.options.shared - tc.variables["PNG_DEBUG"] = self.settings.build_type == "Debug" - tc.variables["PNG_PREFIX"] = self.options.api_prefix + tc.cache_variables["PNG_TESTS"] = False + tc.cache_variables["PNG_SHARED"] = self.options.shared + tc.cache_variables["PNG_STATIC"] = not self.options.shared + tc.cache_variables["PNG_DEBUG"] = self.settings.build_type == "Debug" + tc.cache_variables["PNG_PREFIX"] = self.options.api_prefix + if Version(self.version) < "1.6.38": + tc.cache_variables["CMAKE_PROJECT_libpng_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") if self._has_neon_support: tc.variables["PNG_ARM_NEON"] = self._neon_msa_sse_vsx_mapping[str(self.options.neon)] if self._has_msa_support: @@ -125,26 +128,6 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - if self.settings.os == "Windows": - if Version(self.version) <= "1.5.2": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)', - 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME})') - else: - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - 'OUTPUT_NAME "${PNG_LIB_NAME}_static', - 'OUTPUT_NAME "${PNG_LIB_NAME}') - if not (is_msvc(self) or self._is_clang_cl): - if Version(self.version) < "1.6.38": - src_text = 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $ $/${DEST_FILE}' - else: - src_text = '''COMMAND "${CMAKE_COMMAND}" - -E copy_if_different - $ - $/${DEST_FILE}''' - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - src_text, - 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $/$ $/${DEST_FILE}') def build(self): self._patch_sources() @@ -175,6 +158,8 @@ def package_info(self): prefix = "lib" if (is_msvc(self) or self._is_clang_cl) else "" suffix = major_min_version if self.settings.os == "Windows" else "" + if is_msvc(self) or self._is_clang_cl: + suffix += "_static" if not self.options.shared else "" suffix += "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" self.cpp_info.libs = [f"{prefix}png{suffix}"] if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: diff --git a/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch b/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch deleted file mode 100644 index d78bd326e5e4c..0000000000000 --- a/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b861195..8e3d2ca 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -41,7 +41,7 @@ set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) - - # needed packages - find_package(ZLIB REQUIRED) --include_directories(${ZLIB_INCLUDE_DIR}) -+include_directories(${ZLIB_INCLUDE_DIRS}) - - if(NOT WIN32) - find_library(M_LIBRARY -@@ -312,7 +312,7 @@ if(PNG_DEBUG) - endif() - - # NOW BUILD OUR TARGET --include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) -+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) - - unset(PNG_LIB_TARGETS) - -@@ -326,7 +326,7 @@ if(PNG_SHARED) - set_target_properties(png PROPERTIES PREFIX "lib") - set_target_properties(png PROPERTIES IMPORT_PREFIX "lib") - endif() -- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY}) - - if(UNIX AND AWK) - if(HAVE_LD_VERSION_SCRIPT) -@@ -361,7 +361,7 @@ if(PNG_STATIC) - # msvc does not append 'lib' - do it here to have consistent name - set_target_properties(png_static PROPERTIES PREFIX "lib") - endif() -- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(PNG_FRAMEWORK) -@@ -378,7 +378,7 @@ if(PNG_FRAMEWORK) - XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" - PUBLIC_HEADER "${libpng_public_hdrs}" - OUTPUT_NAME png) -- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(NOT PNG_LIB_TARGETS) diff --git a/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch b/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch deleted file mode 100644 index aaf8fda5cb495..0000000000000 --- a/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- CMakeLists.txt 2019-04-14 20:10:32.000000000 +0200 -+++ CMakeLists.txt 2019-07-04 11:25:33.862280292 +0200 -@@ -40,7 +40,7 @@ - - if(NOT PNG_BUILD_ZLIB) - find_package(ZLIB REQUIRED) -- include_directories(${ZLIB_INCLUDE_DIR}) -+ include_directories(${ZLIB_INCLUDE_DIRS}) - endif() - - if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU) -@@ -522,7 +522,7 @@ - endif() - - # NOW BUILD OUR TARGET --include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) -+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) - - unset(PNG_LIB_TARGETS) - -@@ -536,7 +536,7 @@ - set_target_properties(png PROPERTIES PREFIX "lib") - set_target_properties(png PROPERTIES IMPORT_PREFIX "lib") - endif() -- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY}) - - if(UNIX AND AWK) - if(HAVE_LD_VERSION_SCRIPT) -@@ -571,7 +571,7 @@ - # msvc does not append 'lib' - do it here to have consistent name - set_target_properties(png_static PROPERTIES PREFIX "lib") - endif() -- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(PNG_FRAMEWORK) -@@ -588,7 +588,7 @@ - XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" - PUBLIC_HEADER "${libpng_public_hdrs}" - OUTPUT_NAME png) -- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(NOT PNG_LIB_TARGETS) -@@ -753,7 +753,7 @@ - set(PNG_BIN_TARGETS pngfix) - - add_executable(png-fix-itxt ${png_fix_itxt_sources}) -- target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png-fix-itxt ${ZLIB_LIBRARIES} ${M_LIBRARY}) - list(APPEND PNG_BIN_TARGETS png-fix-itxt) - endif() - diff --git a/recipes/libpng/config.yml b/recipes/libpng/config.yml index feabbd00c1919..e93a6a24ec85a 100644 --- a/recipes/libpng/config.yml +++ b/recipes/libpng/config.yml @@ -1,9 +1,13 @@ versions: + "1.6.40": + folder: all "1.6.39": folder: all "1.6.38": folder: all "1.6.37": folder: all + "1.6.32": + folder: all "1.5.30": folder: all diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml index 3f978881fafe5..862caa7abf541 100644 --- a/recipes/libpq/all/conandata.yml +++ b/recipes/libpq/all/conandata.yml @@ -1,58 +1,58 @@ sources: - "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" + "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.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 b4e66be74d363..53f51b549f74e 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 bfa322133c73c..0000000000000 --- 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 c650bf767f6d5..0000000000000 --- 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 ce58850706373..0000000000000 --- 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 ce58850706373..0000000000000 --- 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 ce58850706373..0000000000000 --- 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 0000000000000..8bbd59c7ada00 --- /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 db0dafd7c0984..b9f4d7ab61bce 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 de3b75d9538de..2f11d9b196ef7 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 01599254d7d82..e010db029229d 100644 --- a/recipes/libpq/config.yml +++ b/recipes/libpq/config.yml @@ -1,17 +1,17 @@ versions: - "14.7": + "15.4": 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 a8a8be54d6643..dcbdf0b15a551 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 ef9bfe326bc0a..078a64288a676 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 0000000000000..9a792a2cc015e --- /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 f09c9055d160c..0000000000000 --- 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 ad9d3eeea1da7..0000000000000 --- 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 076ad6cc874e3..0000000000000 --- 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 7e3e49e4fe91c..0000000000000 --- 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 c32258155f947..0000000000000 --- 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 e372b90444861..0000000000000 --- 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 acc981628428c..0000000000000 --- 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 0000000000000..5602c77e030c6 --- /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 0000000000000..0c628fb55fdff --- /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 96d5c5cc00956..9d72f7f742ccb 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 8b8af47ecdb56..0000000000000 --- 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 bff2c33335401..19d12f5955d4a 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 5741d7e7fb2c6..a124a4b81218b 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 1db6320d425c2..d44b2bb585185 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 e55cd6197c257..ef5d7042163ec 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 f06e9d786d768..69876248ecfa9 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 0000000000000..91630d79f4abb --- /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 0000000000000..5a71089bfc92a --- /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 ec026aac098e8..0de3f9766ed38 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/librasterlite/all/conandata.yml b/recipes/librasterlite/all/conandata.yml index 8e05bde05f4df..83f1191432129 100644 --- a/recipes/librasterlite/all/conandata.yml +++ b/recipes/librasterlite/all/conandata.yml @@ -5,6 +5,4 @@ sources: patches: "1.1g": - patch_file: "patches/0001-fix-autotools.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-nmake-honor-flags.patch" - base_path: "source_subfolder" diff --git a/recipes/librasterlite/all/conanfile.py b/recipes/librasterlite/all/conanfile.py index 5fbfd045b9808..f454426605362 100644 --- a/recipes/librasterlite/all/conanfile.py +++ b/recipes/librasterlite/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, VisualStudioBuildEnvironment, tools -import functools +from conan import ConanFile +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 apply_conandata_patches, chdir, copy, export_conandata_patches, get, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeDeps, NMakeToolchain import os -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.58.0" class LibrasterliteConan(ConanFile): @@ -15,7 +21,7 @@ class LibrasterliteConan(ConanFile): topics = ("rasterlite", "raster", "spatialite") homepage = "https://www.gaia-gis.it/fossil/librasterlite" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,23 +32,12 @@ class LibrasterliteConan(ConanFile): "fPIC": True, } - generators = "pkg_config" - - @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) 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": @@ -50,98 +45,86 @@ 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.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("libgeotiff/1.7.0") - self.requires("libjpeg/9d") - self.requires("libpng/1.6.37") + self.requires("libgeotiff/1.7.1") + self.requires("libjpeg/9e") + self.requires("libpng/1.6.40") self.requires("libspatialite/5.0.1") - self.requires("libtiff/4.3.0") - self.requires("sqlite3/3.38.1") + self.requires("libtiff/4.5.1") + self.requires("sqlite3/3.42.0") def build_requirements(self): - if not self._is_msvc: - 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") + 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") + 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 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") - def _build_msvc(self): - target = "rasterlite_i.lib" if self.options.shared else "rasterlite.lib" - optflags = ["-D_USE_MATH_DEFINES"] - system_libs = [lib + ".lib" for lib in self.deps_cpp_info.system_libs] - if self.options.shared: - optflags.append("-DDLL_EXPORT") - with tools.chdir(self._source_subfolder): - tools.save(os.path.join("headers", "config.h"), "#define VERSION \"{}\"\n".format(self.version)) - with tools.vcvars(self): - with tools.environment_append(VisualStudioBuildEnvironment(self).vars): - self.run("nmake -f makefile.vc {} OPTFLAGS=\"{}\" SYSTEM_LIBS=\"{}\"".format(target, - " ".join(optflags), - " ".join(system_libs))) - - def _build_autotools(self): - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) - # 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), - ) - with tools.run_environment(self): - 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-static={}".format(yes_no(not self.options.shared)), - "--enable-shared={}".format(yes_no(self.options.shared)), - "--disable-gcov", - ] - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.configure(args=args) - return autotools + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-gcov") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + deps = PkgConfigDeps(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_msvc() + apply_conandata_patches(self) + if is_msvc(self): + target = "rasterlite_i.lib" if self.options.shared else "rasterlite.lib" + optflags = ["-D_USE_MATH_DEFINES"] + if self.options.shared: + optflags.append("-DDLL_EXPORT") + save(self, os.path.join(self.source_folder, "headers", "config.h"), f"#define VERSION \"{self.version}\"\n") + with chdir(self, self.source_folder): + self.run(f"nmake -f makefile.vc {target} OPTFLAGS=\"{' '.join(optflags)}\"") else: - self._build_autotools() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - if self._is_msvc: - self.copy("rasterlite.h", dst="include", src=os.path.join(self._source_subfolder, "headers")) - self.copy("*.lib", dst="lib", src=self._source_subfolder) - self.copy("*.dll", dst="bin", src=self._source_subfolder) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "rasterlite.h", src=os.path.join(self.source_folder, "headers"), dst=os.path.join(self.package_folder, "include")) + 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) else: - with tools.chdir(self._source_subfolder): - with tools.run_environment(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")) + 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")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.set_property("pkg_config_name", "rasterlite") - suffix = "_i" if self._is_msvc and self.options.shared else "" - self.cpp_info.libs = ["rasterlite{}".format(suffix)] - - # TODO: to remove in conan v2 once pkg_config generator removed - self.cpp_info.names["pkg_config"] = "rasterlite" + suffix = "_i" if is_msvc(self) and self.options.shared else "" + self.cpp_info.libs = [f"rasterlite{suffix}"] diff --git a/recipes/librasterlite/all/patches/0002-nmake-honor-flags.patch b/recipes/librasterlite/all/patches/0002-nmake-honor-flags.patch index ff434e3cfd949..b9711900f2f71 100644 --- a/recipes/librasterlite/all/patches/0002-nmake-honor-flags.patch +++ b/recipes/librasterlite/all/patches/0002-nmake-honor-flags.patch @@ -1,6 +1,5 @@ This patch for msvc build allows to: * define OPTFLAG ourself from conanfile (allow to honor profile) -* inject a custom SYSTEM_LIBS variable from conanfile (allow robust shared build) * not hardcode this very specific C:\OSGeo4W environment * define rasterliteGetVersion() to be compliant with autotools build @@ -37,7 +36,7 @@ This patch for msvc build allows to: - C:\OSGeo4W\lib\libpng13.lib C:\OSGeo4W\lib\zlib.lib \ - C:\OSGeo4W\lib\geotiff_i.lib C:\OSGeo4W\lib\spatialite_i.lib + link /dll /out:$(RASTERLITE_DLL) \ -+ /implib:rasterlite_i.lib $(LIBOBJ) $(SYSTEM_LIBS) ++ /implib:rasterlite_i.lib $(LIBOBJ) if exist $(RASTERLITE_DLL).manifest mt -manifest \ $(RASTERLITE_DLL).manifest -outputresource:$(RASTERLITE_DLL);2 diff --git a/recipes/librasterlite/all/test_package/CMakeLists.txt b/recipes/librasterlite/all/test_package/CMakeLists.txt index 66ed4461774cf..5678137a1cf88 100644 --- a/recipes/librasterlite/all/test_package/CMakeLists.txt +++ b/recipes/librasterlite/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(librasterlite REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} librasterlite::librasterlite) +target_link_libraries(${PROJECT_NAME} PRIVATE librasterlite::librasterlite) diff --git a/recipes/librasterlite/all/test_package/conanfile.py b/recipes/librasterlite/all/test_package/conanfile.py index 79178ce11469e..0a6bc68712d90 100644 --- a/recipes/librasterlite/all/test_package/conanfile.py +++ b/recipes/librasterlite/all/test_package/conanfile.py @@ -1,19 +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 build_requirements(self): - if self.settings.os == "Macos" 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.3") + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -21,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/librasterlite/all/test_v1_package/CMakeLists.txt b/recipes/librasterlite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/librasterlite/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/librasterlite/all/test_v1_package/conanfile.py b/recipes/librasterlite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/librasterlite/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/librasterlite2/all/conanfile.py b/recipes/librasterlite2/all/conanfile.py index f7a1b69c371ae..91ae265228d72 100644 --- a/recipes/librasterlite2/all/conanfile.py +++ b/recipes/librasterlite2/all/conanfile.py @@ -1,5 +1,7 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, rmdir +from conans import AutoToolsBuildEnvironment, tools import functools import os @@ -66,41 +68,41 @@ def configure(self): del self.settings.compiler.cppstd def requirements(self): - self.requires("cairo/1.17.4") - self.requires("freetype/2.11.1") + self.requires("cairo/1.17.6") + self.requires("freetype/2.13.0") self.requires("giflib/5.2.1") - self.requires("libcurl/7.80.0") + self.requires("libcurl/8.1.2") self.requires("libgeotiff/1.7.1") - self.requires("libjpeg/9d") - self.requires("libpng/1.6.37") + self.requires("libjpeg/9e") + self.requires("libpng/1.6.40") self.requires("libspatialite/5.0.1") - self.requires("libtiff/4.3.0") - self.requires("libxml2/2.9.13") - self.requires("sqlite3/3.38.1") - self.requires("zlib/1.2.12") + self.requires("libtiff/4.5.1") + self.requires("libxml2/2.11.4") + self.requires("sqlite3/3.42.0") + self.requires("zlib/1.2.13") if self.options.with_openjpeg: - self.requires("openjpeg/2.4.0") + self.requires("openjpeg/2.5.0") if self.options.with_webp: - self.requires("libwebp/1.2.2") + self.requires("libwebp/1.3.1") if self.options.with_lzma: - self.requires("xz_utils/5.2.5") + self.requires("xz_utils/5.4.2") if self.options.with_lz4: - self.requires("lz4/1.9.3") + self.requires("lz4/1.9.4") if self.options.with_zstd: - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.5") def validate(self): if self._is_msvc: raise ConanInvalidConfiguration("Visual Studio not supported yet") def build_requirements(self): - self.build_requires("libtool/2.4.6") - self.build_requires("pkgconf/1.7.4") + self.build_requires("libtool/2.4.7") + self.build_requires("pkgconf/1.9.5") if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): self.build_requires("msys2/cci.latest") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) def _patch_sources(self): @@ -157,7 +159,7 @@ def package(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")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("pkg_config_name", "rasterlite2") diff --git a/recipes/libraw/all/CMakeLists.txt b/recipes/libraw/all/CMakeLists.txt index 1aba64dbf532a..867dedb15eb72 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 2293cc11d33ee..3a0ac9ffca1b4 100644 --- a/recipes/libraw/all/conandata.yml +++ b/recipes/libraw/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.21.2": + url: "https://github.com/LibRaw/LibRaw/archive/0.21.2.tar.gz" + sha256: "7ac056e0d9e814d808f6973a950bbf45e71b53283eed07a7ea87117a6c0ced96" "0.21.1": url: "https://github.com/LibRaw/LibRaw/archive/0.21.1.tar.gz" sha256: "b63d7ffa43463f74afcc02f9083048c231349b41cc9255dec0840cf8a67b52e0" @@ -8,6 +11,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 e68c86171e78e..4fda00c094ccf 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.4") + 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 35c98427b7408..ef61145f2ee72 100644 --- a/recipes/libraw/config.yml +++ b/recipes/libraw/config.yml @@ -1,9 +1,9 @@ versions: + "0.21.2": + folder: all "0.21.1": folder: all "0.20.2": 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 79827450beb2c..bf7c468b0c4c1 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 fbd6361872d87..cca10bb2c76c2 100644 --- a/recipes/librdkafka/all/conanfile.py +++ b/recipes/librdkafka/all/conanfile.py @@ -1,9 +1,9 @@ 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 required_conan_version = ">=1.55.0" @@ -52,8 +52,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 +63,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") + self.requires("cyrus-sasl/2.1.28") + 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.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -100,8 +98,7 @@ def generate(self): tc.variables["WITH_SSL"] = self.options.ssl tc.variables["WITH_SASL"] = self.options.sasl tc.variables["ENABLE_LZ4_EXT"] = True - if Version(self.version) >= "1.9.0": - tc.variables["WITH_CURL"] = self.options.curl + tc.variables["WITH_CURL"] = self.options.curl tc.generate() cd = CMakeDeps(self) @@ -113,6 +110,11 @@ 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 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 63c4787d111f3..0000000000000 --- 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 966ba38247ca4..0000000000000 --- 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 2c6f62c68a478..0000000000000 --- 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 71155e468786f..0000000000000 --- 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 0a478997b2373..0000000000000 --- 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 377bc8af8e437..0000000000000 --- 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 0000000000000..169e5bb94d3b2 --- /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 92b3b67d04bdf..edafdb9b6c2ac 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 881a52d920da1..1f042ec677a64 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 0000000000000..b36abfb210bed --- /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 0000000000000..f572d1d03056b --- /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 0000000000000..5993f3e0d4e20 --- /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 3505cc5770e1a..28458effcc8e9 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 ceb7c7bc70c18..a6752906fedc2 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 6924adfd04703..7086816ccca53 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 31762006efa77..2a28db28a9c5d 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 b7cd0e8fa4f62..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..043b77522562f --- /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/conandata.yml b/recipes/libsass/all/conandata.yml index a3583eec521db..0d7398fa561ea 100644 --- a/recipes/libsass/all/conandata.yml +++ b/recipes/libsass/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.6.6": + url: "https://github.com/sass/libsass/archive/3.6.6.tar.gz" + sha256: "11f0bb3709a4f20285507419d7618f3877a425c0131ea8df40fe6196129df15d" "3.6.5": url: "https://github.com/sass/libsass/archive/3.6.5.tar.gz" sha256: "89d8f2c46ae2b1b826b58ce7dde966a176bac41975b82e84ad46b01a55080582" diff --git a/recipes/libsass/all/conanfile.py b/recipes/libsass/all/conanfile.py index 374c7b2afb2fd..9bc7cc167e99f 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 2c3751c7f5fee..fc8049a7834b9 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 814aa7bbb26c7..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..814aa7bbb26c7 --- /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/libsass/config.yml b/recipes/libsass/config.yml index dad090706c27e..58097450a200c 100644 --- a/recipes/libsass/config.yml +++ b/recipes/libsass/config.yml @@ -1,4 +1,6 @@ versions: + "3.6.6": + folder: all "3.6.5": folder: all "3.6.4": diff --git a/recipes/libseat/all/conandata.yml b/recipes/libseat/all/conandata.yml new file mode 100644 index 0000000000000..119dc8ef93144 --- /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 0000000000000..4131ba65c629a --- /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 0000000000000..8a62a0a48cda0 --- /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 0000000000000..027296c50f1b3 --- /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 0000000000000..433561157a413 --- /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 0000000000000..3f2ecd791512e --- /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 0000000000000..675f954f2770e --- /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 3311696c926bf..db4251a471dac 100644 --- a/recipes/libsecret/all/conanfile.py +++ b/recipes/libsecret/all/conanfile.py @@ -1,15 +1,14 @@ 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, 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" +required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" class LibsecretConan(ConanFile): @@ -54,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, run=can_run(self)) + self.requires("glib/2.78.1", transitive_headers=True, transitive_libs=True) if self._use_gcrypt: self.requires("libgcrypt/1.8.4") @@ -65,11 +64,17 @@ 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") - if not can_run(self): - self.tool_requires("glib/2.76.0") + self.tool_requires("pkgconf/2.0.3") + 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) @@ -77,9 +82,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) tc.project_options["introspection"] = "false" tc.project_options["manpage"] = "false" @@ -104,7 +106,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("pkg_config_name", "libsecret-1") - self.cpp_info.requires = ["glib::glib-2.0", "glib::gobject-2.0"] + self.cpp_info.requires = ["glib::glib-2.0", "glib::gobject-2.0", "glib::gio-2.0"] if self._use_gcrypt: self.cpp_info.requires.append("libgcrypt::libgcrypt") self.cpp_info.includedirs = [os.path.join("include", "libsecret-1")] diff --git a/recipes/libselinux/all/conandata.yml b/recipes/libselinux/all/conandata.yml index bc06101ad2d72..14380382654d7 100644 --- a/recipes/libselinux/all/conandata.yml +++ b/recipes/libselinux/all/conandata.yml @@ -1,4 +1,14 @@ sources: + "3.6": + - url: "https://github.com/SELinuxProject/selinux/releases/download/3.6/libselinux-3.6.tar.gz" + sha256: "ba4e0ef34b270e7672a5e5f1b523fe2beab3a40bb33d9389f4ad3a8728f21b52" + - url: "https://github.com/SELinuxProject/selinux/releases/download/3.6/libsepol-3.6.tar.gz" + sha256: "c9dc585ea94903d784d597c861cd5dce6459168f95e22b31a0eab1cdd800975a" + "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" @@ -25,6 +35,11 @@ sources: - url: "https://github.com/SELinuxProject/selinux/releases/download/20190315/libsepol-2.9.tar.gz" sha256: "a34b12b038d121e3e459b1cbaca3c9202e983137819c16baf63658390e3f1d5d" patches: + "3.6": + - patch_file: patches/0003-fix-missing-include-3.6.patch + base_path: libselinux-3.6 + patch_description: "Fix a missing #include " + patch_type: "portability" "3.0": - patch_file: patches/0001-fix-fno-common-3.0.patch base_path: libsepol-3.0 diff --git a/recipes/libselinux/all/conanfile.py b/recipes/libselinux/all/conanfile.py index b584e1b1696aa..11d688ce34c15 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/patches/0003-fix-missing-include-3.6.patch b/recipes/libselinux/all/patches/0003-fix-missing-include-3.6.patch new file mode 100644 index 0000000000000..8d2025e18034b --- /dev/null +++ b/recipes/libselinux/all/patches/0003-fix-missing-include-3.6.patch @@ -0,0 +1,10 @@ +--- src/selinux_internal.c ++++ src/selinux_internal.c +@@ -1,6 +5,7 @@ + #include "selinux_internal.h" + + #include + #include + #include ++#include + diff --git a/recipes/libselinux/all/test_package/CMakeLists.txt b/recipes/libselinux/all/test_package/CMakeLists.txt index 7a316858398f3..a2c8fc569bb2f 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 925ecbe19e448..91630d79f4abb 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 3fc66eb377b84..901df00682822 100644 --- a/recipes/libselinux/config.yml +++ b/recipes/libselinux/config.yml @@ -1,4 +1,8 @@ versions: + "3.6": + folder: all + "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 f2d6529173319..3c560a2bb697e 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 27812caf46f4d..3318e67617d62 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 acdc9ee85a453..427372b5ece50 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 0000000000000..0b0946d73305a --- /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 0000000000000..7874f13bef92a --- /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 c465c32853439..0000000000000 --- 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 72af20020d59f..323fde5efbec2 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 9cb40725e278e..b771abcbf3d00 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 d5daeb4ad5467..0401e0f4d83ce 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 e6b0fdb8110e8..b3607270e232e 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 8748a8a951d30..941e12b139215 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 199ae95ae65fc..9bb9b6871d67d 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 e556cc050d509..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..e556cc050d509 --- /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 3086b45fa1be2..84ba240aba82b 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 b33407244e1eb..56bb34708956f 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 13e3af8ad2791..14c66f6f3d628 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 19e6a0c06e3d8..fae501d0afb9e 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 77ba2985f3b59..cc9d3fa6bc38c 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 ef6e2406db761..6ce8582b64685 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 2248a847a68f0..47a9d6a6d063e 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 d0974216f8865..c399471111c38 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 819e72ce10826..4dfbbb5c3d410 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 f0faad0897234..4f59b4c769d25 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 ba37d1a345156..e1bc3a637dd18 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 a4b980e0e807c..8301614166c20 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 ce9505669ad4f..8d52b7021efe1 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 0000000000000..91630d79f4abb --- /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 0000000000000..890f8e01b2489 --- /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 e3af7d3426c10..c9e2a428688a9 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/libspatialite/all/conanfile.py b/recipes/libspatialite/all/conanfile.py index e6186b890b333..4260480b1b097 100644 --- a/recipes/libspatialite/all/conanfile.py +++ b/recipes/libspatialite/all/conanfile.py @@ -85,7 +85,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("sqlite3/3.41.1") + self.requires("sqlite3/3.42.0") self.requires("zlib/1.2.13") if self.options.with_proj: self.requires("proj/9.1.1") diff --git a/recipes/libspng/all/conandata.yml b/recipes/libspng/all/conandata.yml index 20e5a777bfee5..39fc43e8152e7 100644 --- a/recipes/libspng/all/conandata.yml +++ b/recipes/libspng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.4": + url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.4.tar.gz" + sha256: "47ec02be6c0a6323044600a9221b049f63e1953faf816903e7383d4dc4234487" "0.7.3": url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.3.tar.gz" sha256: "a50cadbe808ffda1a7fab17d145f52a23b163f34b3eb3696c7ecb5a52340fc1d" @@ -6,6 +9,13 @@ sources: url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.2.tar.gz" sha256: "4acf25571d31f540d0b7ee004f5461d68158e0a13182505376805da99f4ccc4e" patches: + "0.7.4": + - patch_file: "patches/0.7.4-0001-allow-miniz.patch" + # Miniz is supported by the project, but does not currently expose a CMake + # option to toggle it. This can be removed once the project supports it + # or when the recipe moves to use Meson instead + patch_description: "add miniz option which is written in docs/BUILD.md" + patch_type: "portability" "0.7.3": - patch_file: "patches/0.7.3-0001-fix-dll-install.patch" patch_description: "fix install path" diff --git a/recipes/libspng/all/conanfile.py b/recipes/libspng/all/conanfile.py index 47f9d1ea0e572..f151ee813b219 100644 --- a/recipes/libspng/all/conanfile.py +++ b/recipes/libspng/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, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -46,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) @@ -72,6 +73,8 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if Version(self.version) >= "0.7.4": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("pkg_config_name", "libspng") @@ -80,3 +83,7 @@ def package_info(self): self.cpp_info.libs = ["spng"] if self.options.shared else ["spng_static"] if self.settings.os in ["Linux", "Android", "FreeBSD"]: self.cpp_info.system_libs.append("m") + + if Version(self.version) >= "0.7.4": + self.cpp_info.set_property("cmake_file_name", "SPNG") + self.cpp_info.set_property("cmake_target_name", "spng::spng{}".format("" if self.options.shared else "_static")) diff --git a/recipes/libspng/all/patches/0.7.4-0001-allow-miniz.patch b/recipes/libspng/all/patches/0.7.4-0001-allow-miniz.patch new file mode 100644 index 0000000000000..05e6f905e4d1e --- /dev/null +++ b/recipes/libspng/all/patches/0.7.4-0001-allow-miniz.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index da1917e..30c220d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,7 @@ set(SPNG_VERSION ${SPNG_MAJOR}.${SPNG_MINOR}.${SPNG_REVISION}) + option(ENABLE_OPT "Enable architecture-specific optimizations" ON) + option(SPNG_SHARED "Build shared lib" ON) + option(SPNG_STATIC "Build static lib" ON) ++option(SPNG_USE_MINIZ "Use Miniz instead of zlib" OFF) + option(BUILD_EXAMPLES "Build examples" ON) + + include(GNUInstallDirs) +@@ -47,14 +48,24 @@ if(SPNG_STATIC) + list(APPEND spng_TARGETS spng_static) + endif() + +-find_package(ZLIB REQUIRED) ++if(SPNG_USE_MINIZ) ++ find_package(miniz REQUIRED) ++ set(compress_LIBS miniz::miniz) ++else() ++ find_package(ZLIB REQUIRED) ++ set(compress_LIBS ZLIB::ZLIB) ++endif() ++ + foreach(spng_TARGET ${spng_TARGETS}) + target_include_directories(${spng_TARGET} PUBLIC + $ + $ + ) +- target_link_libraries(${spng_TARGET} PRIVATE ZLIB::ZLIB) ++ target_link_libraries(${spng_TARGET} PRIVATE ${compress_LIBS}) + target_link_libraries(${spng_TARGET} PRIVATE ${MATH_LIBRARY}) ++ if (SPNG_USE_MINIZ) ++ target_compile_definitions(${spng_TARGET} PRIVATE SPNG_USE_MINIZ) ++ endif() + endforeach() + + set(project_config "${CMAKE_CURRENT_BINARY_DIR}/SPNGConfig.cmake") diff --git a/recipes/libspng/all/test_package/CMakeLists.txt b/recipes/libspng/all/test_package/CMakeLists.txt index c8aa2ff46daf5..37a57f5a95869 100644 --- a/recipes/libspng/all/test_package/CMakeLists.txt +++ b/recipes/libspng/all/test_package/CMakeLists.txt @@ -1,7 +1,16 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -find_package(libspng REQUIRED CONFIG) +find_package(libspng CONFIG) +if (NOT libspng_FOUND) + find_package(SPNG REQUIRED CONFIG) +endif() add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE libspng::libspng) +if (TARGET libspng::libspng) + target_link_libraries(${PROJECT_NAME} PRIVATE libspng::libspng) +elseif(TARGET spng::spng) + target_link_libraries(${PROJECT_NAME} PRIVATE spng::spng) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE spng::spng_static) +endif() diff --git a/recipes/libspng/config.yml b/recipes/libspng/config.yml index ed848445a96cc..f0510efbdd19d 100644 --- a/recipes/libspng/config.yml +++ b/recipes/libspng/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.4": + folder: all "0.7.3": folder: all "0.7.2": diff --git a/recipes/libsrtp/all/conandata.yml b/recipes/libsrtp/all/conandata.yml index b0630ee5a7c2f..d7ca622cbdb82 100644 --- a/recipes/libsrtp/all/conandata.yml +++ b/recipes/libsrtp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.5.0": + url: "https://github.com/cisco/libsrtp/archive/v2.5.0.tar.gz" + sha256: "8a43ef8e9ae2b665292591af62aa1a4ae41e468b6d98d8258f91478735da4e09" "2.4.2": url: "https://github.com/cisco/libsrtp/archive/v2.4.2.tar.gz" sha256: "3b1bcb14ebda572b04b9bdf07574a449c84cb924905414e4d94e62837d22b628" diff --git a/recipes/libsrtp/all/conanfile.py b/recipes/libsrtp/all/conanfile.py index 3bf9617ba21c6..8a081d12ab6ba 100644 --- a/recipes/libsrtp/all/conanfile.py +++ b/recipes/libsrtp/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 collect_libs, copy, get, replace_in_file +from conan.tools.files import collect_libs, copy, get, save, rmdir from conan.tools.scm import Version import os @@ -58,22 +58,19 @@ def generate(self): if Version(self.version) < "2.4.0": # Relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) >= "2.5.0": + tc.cache_variables["BUILD_WITH_WARNINGS"] = False tc.generate() deps = CMakeDeps(self) deps.generate() + def _patch_sources(self): + save(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "\ninstall(TARGETS srtp2 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)\n", + append=True) + def build(self): - replace_in_file( - self, os.path.join(self.source_folder, "CMakeLists.txt"), - "install(TARGETS srtp2 DESTINATION lib)", - ( - "include(GNUInstallDirs)\n" - "install(TARGETS srtp2\n" - "RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\n" - "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\n" - "ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})" - ), - ) + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -82,6 +79,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")) def package_info(self): self.cpp_info.set_property("pkg_config_name", f"libsrtp{Version(self.version).major}") diff --git a/recipes/libsrtp/config.yml b/recipes/libsrtp/config.yml index d17b791c9f454..0abd910fd2126 100644 --- a/recipes/libsrtp/config.yml +++ b/recipes/libsrtp/config.yml @@ -1,4 +1,6 @@ versions: + "2.5.0": + folder: all "2.4.2": folder: all "2.4.0": diff --git a/recipes/libssh2/all/CMakeLists.txt b/recipes/libssh2/all/CMakeLists.txt deleted file mode 100644 index 8315062fd31ee..0000000000000 --- a/recipes/libssh2/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper C) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libssh2/all/conandata.yml b/recipes/libssh2/all/conandata.yml index 710cae0e7118d..46c0ee9468864 100644 --- a/recipes/libssh2/all/conandata.yml +++ b/recipes/libssh2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.11.0": + 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 @@ -11,16 +14,3 @@ sources: "1.8.0": sha256: 39f34e2f6835f4b992cafe8625073a88e5a28ba78f83e8099610a7b3af4676d4 url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.8.0/libssh2-1.8.0.tar.gz -patches: - "1.10.0": - - patch_file: "patches/0001-threads.patch" - base_path: "source_subfolder" - "1.9.0": - - patch_file: "patches/0001-threads.patch" - base_path: "source_subfolder" - "1.8.2": - - patch_file: "patches/0001-threads.patch" - base_path: "source_subfolder" - "1.8.0": - - patch_file: "patches/0001-threads.patch" - base_path: "source_subfolder" diff --git a/recipes/libssh2/all/conanfile.py b/recipes/libssh2/all/conanfile.py index bb49ef120e615..3ccfe30d867cc 100644 --- a/recipes/libssh2/all/conanfile.py +++ b/recipes/libssh2/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, CMake, tools -import functools +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +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.43.0" +required_conan_version = ">=1.53.0" class Libssh2Conan(ConanFile): @@ -12,7 +16,7 @@ class Libssh2Conan(ConanFile): homepage = "https://libssh2.org" topics = ("libssh", "ssh", "shell", "ssh2", "connection") license = "BSD-3-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -33,16 +37,36 @@ class Libssh2Conan(ConanFile): "enable_debug_logging": False, } - generators = "cmake", "cmake_find_package" + 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 export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["ENABLE_ZLIB_COMPRESSION"] = self.options.with_zlib + tc.cache_variables["ENABLE_CRYPT_NONE"] = self.options.enable_crypt_none + tc.cache_variables["ENABLE_MAC_NONE"] = self.options.enable_mac_none + tc.cache_variables["ENABLE_DEBUG_LOGGING"] = self.options.enable_debug_logging + if self.options.crypto_backend == "openssl": + tc.cache_variables["CRYPTO_BACKEND"] = "OpenSSL" + tc.cache_variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + elif self.options.crypto_backend == "mbedtls": + tc.cache_variables["CRYPTO_BACKEND"] = "mbedTLS" + tc.cache_variables["BUILD_EXAMPLES"] = False + tc.cache_variables['BUILD_TESTING'] = not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + tc.cache_variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + # To install relocatable shared lib on Macos by default + tc.variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Workaround until github.com/conan-io/conan/pull/12600 is merged + if is_msvc(self): + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def config_options(self): if self.settings.os == "Windows": @@ -50,68 +74,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") + # This is a pure C library + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/[>=1.2.11 <2]") if self.options.crypto_backend == "openssl": - self.requires("openssl/1.1.1q") + 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): - 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) + apply_conandata_patches(self) - 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"), - "set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)", - "list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)") - - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): cmake = CMake(self) - cmake.definitions["ENABLE_ZLIB_COMPRESSION"] = self.options.with_zlib - cmake.definitions["ENABLE_CRYPT_NONE"] = self.options.enable_crypt_none - cmake.definitions["ENABLE_MAC_NONE"] = self.options.enable_mac_none - cmake.definitions["ENABLE_DEBUG_LOGGING"] = self.options.enable_debug_logging - if self.options.crypto_backend == "openssl": - cmake.definitions["CRYPTO_BACKEND"] = "OpenSSL" - cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath - elif self.options.crypto_backend == "mbedtls": - cmake.definitions["CRYPTO_BACKEND"] = "mbedTLS" - cmake.definitions["BUILD_EXAMPLES"] = False - cmake.definitions["BUILD_TESTING"] = False - # To install relocatable shared lib on Macos by default - cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" cmake.configure() - return cmake - - def build(self): - self._patch_sources() - cmake = self._configure_cmake() cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - 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", "pkgconfig")) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "share")) # only docs and manpages + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Libssh2") self.cpp_info.set_property("cmake_target_name", "Libssh2::libssh2") self.cpp_info.set_property("pkg_config_name", "libssh2") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["_libssh2"].libs = tools.collect_libs(self) + self.cpp_info.components["_libssh2"].libs = collect_libs(self) if self.settings.os == "Windows": self.cpp_info.components["_libssh2"].system_libs.append("ws2_32") elif self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/libssh2/all/patches/0001-threads.patch b/recipes/libssh2/all/patches/0001-threads.patch deleted file mode 100644 index 05985dac07a46..0000000000000 --- 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/libssh2/all/test_package/CMakeLists.txt b/recipes/libssh2/all/test_package/CMakeLists.txt index dfda6b6e8ad0d..92f94a36409ed 100644 --- a/recipes/libssh2/all/test_package/CMakeLists.txt +++ b/recipes/libssh2/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(Libssh2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} Libssh2::libssh2) +target_link_libraries(${PROJECT_NAME} PRIVATE Libssh2::libssh2) diff --git a/recipes/libssh2/all/test_package/conanfile.py b/recipes/libssh2/all/test_package/conanfile.py index 49a3a66ea5bad..a9bc449b529dc 100644 --- a/recipes/libssh2/all/test_package/conanfile.py +++ b/recipes/libssh2/all/test_package/conanfile.py @@ -1,17 +1,26 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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 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/libssh2/config.yml b/recipes/libssh2/config.yml index 42bce17ced607..3cada2e5e398c 100644 --- a/recipes/libssh2/config.yml +++ b/recipes/libssh2/config.yml @@ -1,4 +1,6 @@ versions: + "1.11.0": + folder: all "1.10.0": folder: all "1.9.0": diff --git a/recipes/libsvm/all/conandata.yml b/recipes/libsvm/all/conandata.yml index 5712311441eb3..4ce3fd15b7dba 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 026fbb9e30356..c1b9e6f304394 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 74d595eb1046f..54555aa218224 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 37cfc8825c04f..c8fea3589a745 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 8c721280d7274..e4def90fd702a 100644 --- a/recipes/libsystemd/all/conandata.yml +++ b/recipes/libsystemd/all/conandata.yml @@ -1,7 +1,16 @@ sources: - "253.3": - url: "https://github.com/systemd/systemd-stable/archive/v253.3.tar.gz" - sha256: "569775d77084e45d15e103004cf4fbc00d7249c33791471b80f0c3296962bbfd" + "255": + url: "https://github.com/systemd/systemd-stable/archive/v255.tar.gz" + sha256: "a3eb766ee96eb9f4cc25c2a6c933f3299e1b7ae22e72507dade0a5c86d92534f" + "253.14": + url: "https://github.com/systemd/systemd-stable/archive/v253.14.tar.gz" + sha256: "9c83ac26f691ff2c482659884f01f1155ef5e1bd202204f9e3076a31e54ab155" + "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" "252.9": url: "https://github.com/systemd/systemd-stable/archive/v252.9.tar.gz" sha256: "c386aac4ba39fa1bca3a3c9ef9df5a737e3184c9c6a04340e34d6d0254007845" @@ -21,13 +30,43 @@ sources: url: "https://github.com/systemd/systemd-stable/archive/v246.16.tar.gz" sha256: "b69f9940d65870f090269a28f1047a633d4b80d0001e091d53a031dd40a822d2" patches: - "253.3": + "255": + - 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" + "253.14": + - 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.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" + 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" "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 17ae41f5c8e6a..0529c3adb62c2 100644 --- a/recipes/libsystemd/all/conanfile.py +++ b/recipes/libsystemd/all/conanfile.py @@ -1,10 +1,11 @@ import os import re +import tarfile 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, replace_in_file +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, replace_in_file, download, move_folder_contents from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain @@ -52,14 +53,16 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libcap/2.68") - self.requires("libmount/2.36.2") + self.requires("libcap/2.69") + self.requires("libmount/2.39.2") + if Version(self.version) >= "253.6": + self.requires("libxcrypt/4.4.36") if self.options.with_selinux: - self.requires("libselinux/3.3") + self.requires("libselinux/3.5") 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.5") if self.options.with_zstd: self.requires("zstd/1.5.5") @@ -68,19 +71,24 @@ def validate(self): raise ConanInvalidConfiguration("Only Linux supported") def build_requirements(self): - self.tool_requires("meson/1.1.0") + self.tool_requires("meson/1.3.0") 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.1.0") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + # Extract using standard Python tools due to Conan's unzip() not handling backslashes in + # 'units/system-systemd\x2dcryptsetup.slice', etc. correctly. + download(self, **self.conan_data["sources"][self.version], filename="sources.tar.gz") + with tarfile.open("sources.tar.gz", "r:gz") as tar: + tar.extractall() + move_folder_contents(self, os.path.join(self.source_folder, f"systemd-stable-{self.version}"), self.source_folder) @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: @@ -124,7 +132,7 @@ def generate(self): "link-udev-shared", "link-systemctl-shared", "analyze", "pam", "link-networkd-shared", "link-timesyncd-shared", "kernel-install", "libiptc", "elfutils", "repart", "homed", "importd", "acl", - "dns-over-tls", "gnu-efi", "valgrind", "log-trace"] + "dns-over-tls", "log-trace"] if Version(self.version) >= "247.1": unrelated.append("oomd") @@ -134,6 +142,10 @@ def generate(self): unrelated.append("link-boot-shared") if Version(self.version) >= "252.1": unrelated.append("link-journalctl-shared") + if Version(self.version) < "254.7": + unrelated.extend(["gnu-efi", "valgrind"]) + else: + unrelated.extend(["passwdqc", "bootloader", "link-portabled-shared"]) for opt in unrelated: tc.project_options[opt] = "false" @@ -158,10 +170,8 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - meson_build = os.path.join(self.source_folder, "meson.build") - replace_in_file(self, meson_build, "@CONAN_SRC_REL_PATH@", - "'../{}'".format(os.path.basename(self.source_folder))) + replace_in_file(self, meson_build, "@CONAN_SRC_REL_PATH@", f"'../{self.source_path.name}'") def build(self): self._patch_sources() 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 0000000000000..478910e9a3aeb --- /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 4fc0d2de603bc..0e275799b53e7 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 e6b0fdb8110e8..b3607270e232e 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 83bb58c5a15a2..53e3ab4f8fc90 100644 --- a/recipes/libsystemd/config.yml +++ b/recipes/libsystemd/config.yml @@ -1,5 +1,11 @@ versions: - "253.3": + "255": + folder: all + "253.14": + folder: all + "253.10": + folder: all + "253.6": folder: all "252.9": folder: all diff --git a/recipes/libtar/all/conanfile.py b/recipes/libtar/all/conanfile.py index ee12aac6802cc..18b7b52de3166 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 069830d3c9f36..d1eea1562324a 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 a3b0e93e72a46..e73e0da6320f6 100644 --- a/recipes/libtiff/all/conandata.yml +++ b/recipes/libtiff/all/conandata.yml @@ -1,26 +1,28 @@ sources: + "4.6.0": + url: "https://download.osgeo.org/libtiff/tiff-4.6.0.tar.gz" + sha256: "88b3979e6d5c7e32b50d7ec72fb15af724f6ab2cbf7e10880c360a77e4b5d99a" + "4.5.1": + url: "https://download.osgeo.org/libtiff/tiff-4.5.1.tar.gz" + sha256: "d7f38b6788e4a8f5da7940c5ac9424f494d8a79eba53d555f4a507167dca5e2b" "4.5.0": - url: "http://download.osgeo.org/libtiff/tiff-4.5.0.tar.gz" + url: "https://download.osgeo.org/libtiff/tiff-4.5.0.tar.gz" sha256: "c7a1d9296649233979fa3eacffef3fa024d73d05d589cb622727b5b08c423464" "4.4.0": - url: "http://download.osgeo.org/libtiff/tiff-4.4.0.tar.gz" + url: "https://download.osgeo.org/libtiff/tiff-4.4.0.tar.gz" sha256: "917223b37538959aca3b790d2d73aa6e626b688e02dcda272aec24c2f498abed" "4.3.0": - url: "http://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz" + url: "https://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz" sha256: "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8" - "4.2.0": - url: "http://download.osgeo.org/libtiff/tiff-4.2.0.tar.gz" - sha256: "eb0484e568ead8fa23b513e9b0041df7e327f4ee2d22db5a533929dfc19633cb" - "4.1.0": - url: "http://download.osgeo.org/libtiff/tiff-4.1.0.tar.gz" - sha256: "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634" - "4.0.9": - url: "http://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz" - sha256: "6e7bdeec2c310734e734d19aae3a71ebe37a4d842e0e23dbb1b8921c0026cfcd" - "4.0.8": - url: "http://download.osgeo.org/libtiff/tiff-4.0.8.tar.gz" - sha256: "59d7a5a8ccd92059913f246877db95a2918e6c04fb9d43fd74e5c3390dac2910" 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" + patch_type: "conan" "4.5.0": - patch_file: "patches/4.5.0-0001-cmake-dependencies.patch" patch_description: "CMake: robust handling of dependencies" @@ -33,35 +35,3 @@ patches: - patch_file: "patches/4.3.0-0001-cmake-dependencies.patch" patch_description: "CMake: robust handling of dependencies" patch_type: "conan" - "4.2.0": - - patch_file: "patches/4.2.0-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - "4.1.0": - - patch_file: "patches/4.1.0-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - - patch_file: "patches/4.1.0-0002-no-libm-mingw.patch" - patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" - "4.0.9": - - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" - patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" - "4.0.8": - - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" - patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" - - patch_file: "patches/4.0.8-0003-file-offsets-bits-mingw.patch" - patch_description: "port to MINGW: enable Large file support by defining _FILE_OFFSET_BITS=64" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/commit/f2a3b020402943f90957552a884788e70ece6cd7" diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index 9d78f893c2d31..6904690444761 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/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, replace_in_file, rm, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -44,30 +44,12 @@ class LibtiffConan(ConanFile): "cxx": True, } - @property - def _has_webp_option(self): - return Version(self.version) >= "4.0.10" - - @property - def _has_zstd_option(self): - return Version(self.version) >= "4.0.10" - - @property - def _has_libdeflate_option(self): - return Version(self.version) >= "4.2.0" - def export_sources(self): export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self._has_webp_option: - del self.options.webp - if not self._has_zstd_option: - del self.options.zstd - if not self._has_libdeflate_option: - del self.options.libdeflate def configure(self): if self.options.shared: @@ -81,28 +63,33 @@ def layout(self): def requirements(self): if self.options.zlib: - self.requires("zlib/1.2.13") - if self.options.get_safe("libdeflate"): - self.requires("libdeflate/1.18") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.libdeflate: + 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.get_safe("zstd"): + if self.options.zstd: self.requires("zstd/1.5.5") - if self.options.get_safe("webp"): - self.requires("libwebp/1.3.0") + if self.options.webp: + self.requires("libwebp/1.3.2") def validate(self): - if self.options.get_safe("libdeflate") and not self.options.zlib: + if self.options.libdeflate and not self.options.zlib: raise ConanInvalidConfiguration("libtiff:libdeflate=True requires libtiff:zlib=True") + def build_requirements(self): + if Version(self.version) >= "4.5.1": + # https://github.com/conan-io/conan/issues/3482#issuecomment-662284561 + self.tool_requires("cmake/[>=3.18 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -113,14 +100,10 @@ def generate(self): tc.variables["jpeg12"] = False tc.variables["jbig"] = self.options.jbig tc.variables["zlib"] = self.options.zlib - if self._has_libdeflate_option: - tc.variables["libdeflate"] = self.options.libdeflate - if self._has_zstd_option: - tc.variables["zstd"] = self.options.zstd - if self._has_webp_option: - tc.variables["webp"] = self.options.webp - if Version(self.version) >= "4.3.0": - tc.variables["lerc"] = False # TODO: add lerc support for libtiff versions >= 4.3.0 + tc.variables["libdeflate"] = self.options.libdeflate + tc.variables["zstd"] = self.options.zstd + tc.variables["webp"] = self.options.webp + tc.variables["lerc"] = False # TODO: add lerc support for libtiff versions >= 4.3.0 if Version(self.version) >= "4.5.0": # Disable tools, test, contrib, man & html generation tc.variables["tiff-tools"] = False @@ -130,13 +113,23 @@ def generate(self): tc.variables["cxx"] = self.options.cxx # BUILD_SHARED_LIBS must be set in command line because defined upstream before project() tc.cache_variables["BUILD_SHARED_LIBS"] = bool(self.options.shared) + tc.cache_variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = True tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "4.5.1": + deps.set_property("jbig", "cmake_target_name", "JBIG::JBIG") + deps.set_property("xz_utils", "cmake_target_name", "liblzma::liblzma") + deps.set_property("libdeflate", "cmake_file_name", "Deflate") + deps.set_property("libdeflate", "cmake_target_name", "Deflate::Deflate") deps.generate() def _patch_sources(self): apply_conandata_patches(self) + # remove FindXXXX for conan dependencies + for module in ["Deflate", "JBIG", "JPEG", "LERC", "WebP", "ZSTD", "liblzma", "LibLZMA"]: + rm(self, f"Find{module}.cmake", os.path.join(self.source_folder, "cmake")) + # Export symbols of tiffxx for msvc shared replace_in_file(self, os.path.join(self.source_folder, "libtiff", "CMakeLists.txt"), "set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})", @@ -177,7 +170,7 @@ def package_info(self): self.cpp_info.requires = [] if self.options.zlib: self.cpp_info.requires.append("zlib::zlib") - if self.options.get_safe("libdeflate"): + if self.options.libdeflate: self.cpp_info.requires.append("libdeflate::libdeflate") if self.options.lzma: self.cpp_info.requires.append("xz_utils::xz_utils") @@ -189,9 +182,9 @@ def package_info(self): self.cpp_info.requires.append("mozjpeg::libjpeg") if self.options.jbig: self.cpp_info.requires.append("jbig::jbig") - if self.options.get_safe("zstd"): + if self.options.zstd: self.cpp_info.requires.append("zstd::zstd") - if self.options.get_safe("webp"): + if self.options.webp: self.cpp_info.requires.append("libwebp::libwebp") # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed diff --git a/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch deleted file mode 100644 index 7b7979045b5a1..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -544,12 +544,10 @@ endif() - option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) - if (jbig) - set(JBIG_FOUND 0) -- find_path(JBIG_INCLUDE_DIR jbig.h) -- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) -- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) -- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) -+ find_package(jbig REQUIRED CONFIG) -+ if (1) - set(JBIG_FOUND 1) -- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) -+ set(JBIG_LIBRARIES jbig::jbig) - endif() - endif() - set(JBIG_SUPPORT 0) -@@ -564,7 +562,7 @@ set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARY}) --check_function_exists(jbg_newlen HAVE_JBG_NEWLEN) -+set(HAVE_JBG_NEWLEN TRUE) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - -@@ -701,8 +699,8 @@ endif() - if(ZLIB_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch deleted file mode 100644 index 216911511380b..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -206,7 +206,9 @@ else() - endif() - - # Find libm, if available --find_library(M_LIBRARY m) -+if (NOT MINGW) -+ find_library(M_LIBRARY m) -+endif() - - check_include_file(assert.h HAVE_ASSERT_H) - check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch deleted file mode 100644 index 44a861121db9c..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -469,7 +469,7 @@ report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER - HOST_BIG_ENDIAN HAVE_IEEEFP) - - # Large file support --if (UNIX) -+if (UNIX OR MINGW) - # This might not catch every possibility catered for by - # AC_SYS_LARGEFILE. - add_definitions(-D_FILE_OFFSET_BITS=64) diff --git a/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch deleted file mode 100644 index b8a3ec4a4b033..0000000000000 --- a/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -489,12 +489,10 @@ endif() - option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) - if (jbig) - set(JBIG_FOUND 0) -- find_path(JBIG_INCLUDE_DIR jbig.h) -- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) -- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) -- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) -+ find_package(jbig REQUIRED CONFIG) -+ if (1) - set(JBIG_FOUND 1) -- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) -+ set(JBIG_LIBRARIES jbig::jbig) - endif() - endif() - set(JBIG_SUPPORT 0) -@@ -507,7 +505,7 @@ endif() - - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) --check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) -+set(HAVE_JBG_NEWLEN TRUE) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - - # liblzma2 -@@ -523,13 +521,11 @@ endif() - # libzstd - option(zstd "use libzstd (required for ZSTD compression)" ON) - if (zstd) -- find_path(ZSTD_INCLUDE_DIR zstd.h) -- find_library(ZSTD_LIBRARY NAMES zstd) -- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) -- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) -+ find_package(zstd REQUIRED CONFIG) -+ if (1) -+ set(ZSTD_RECENT_ENOUGH TRUE) - if (ZSTD_RECENT_ENOUGH) - set(ZSTD_FOUND TRUE) -- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) - message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") - else () - message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") -@@ -544,15 +540,13 @@ endif() - # libwebp - option(webp "use libwebp (required for WEBP compression)" ON) - if (webp) -- find_path(WEBP_INCLUDE_DIR /webp/decode.h) -- find_library(WEBP_LIBRARY NAMES webp) -+ find_package(WebP REQUIRED CONFIG) - endif() - set(WEBP_SUPPORT 0) --set(WEBP_FOUND FALSE) --if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) -+if (WebP_FOUND) - set(WEBP_SUPPORT 1) - set(WEBP_FOUND TRUE) -- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) -+ set(WEBP_LIBRARIES WebP::webp) - message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") - endif() - -@@ -681,8 +675,8 @@ endif() - if(ZLIB_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) -@@ -693,8 +687,8 @@ endif() - if(LIBLZMA_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) - endif() --if(ZSTD_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) -+if(ZSTD_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - if(WEBP_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch deleted file mode 100644 index 0fcf8f5711810..0000000000000 --- a/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -207,7 +207,9 @@ else() - endif() - - # Find libm, if available --find_library(M_LIBRARY m) -+if (NOT MINGW) -+ find_library(M_LIBRARY m) -+endif() - - check_include_file(assert.h HAVE_ASSERT_H) - check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch deleted file mode 100644 index 7b04f533eb0f4..0000000000000 --- a/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -463,12 +463,10 @@ set(ZIP_SUPPORT ${ZLIB_SUPPORT}) - option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ON) - if (libdeflate) - set(DEFLATE_FOUND 0) -- find_path(DEFLATE_INCLUDE_DIR libdeflate.h) -- set(DEFLATE_NAMES ${DEFLATE_NAMES} deflate) -- find_library(DEFLATE_LIBRARY NAMES ${DEFLATE_NAMES}) -- if (DEFLATE_INCLUDE_DIR AND DEFLATE_LIBRARY) -+ find_package(libdeflate REQUIRED CONFIG) -+ if (1) - set(DEFLATE_FOUND 1) -- set(DEFLATE_LIBRARIES ${DEFLATE_LIBRARY}) -+ set(DEFLATE_LIBRARIES $,libdeflate::libdeflate,libdeflate::libdeflate_static>) - endif() - endif() - set(LIBDEFLATE_SUPPORT FALSE) -@@ -517,12 +515,10 @@ endif() - option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) - if (jbig) - set(JBIG_FOUND 0) -- find_path(JBIG_INCLUDE_DIR jbig.h) -- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) -- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) -- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) -+ find_package(jbig REQUIRED CONFIG) -+ if (1) - set(JBIG_FOUND 1) -- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) -+ set(JBIG_LIBRARIES jbig::jbig) - endif() - endif() - set(JBIG_SUPPORT 0) -@@ -535,7 +531,7 @@ endif() - - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) --check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) -+set(HAVE_JBG_NEWLEN TRUE) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - - # liblzma2 -@@ -551,14 +547,11 @@ endif() - # libzstd - option(zstd "use libzstd (required for ZSTD compression)" ON) - if (zstd) -- find_path(ZSTD_INCLUDE_DIR zstd.h) -- find_library(ZSTD_LIBRARY NAMES zstd) -- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) -- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) -+ find_package(zstd REQUIRED CONFIG) -+ if (1) -+ set(ZSTD_RECENT_ENOUGH TRUE) - if (ZSTD_RECENT_ENOUGH) - set(ZSTD_FOUND TRUE) -- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) -- message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") - else () - message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") - endif () -@@ -572,15 +565,13 @@ endif() - # libwebp - option(webp "use libwebp (required for WEBP compression)" ON) - if (webp) -- find_path(WEBP_INCLUDE_DIR /webp/decode.h) -- find_library(WEBP_LIBRARY NAMES webp) -+ find_package(WebP REQUIRED CONFIG) - endif() - set(WEBP_SUPPORT 0) --set(WEBP_FOUND FALSE) --if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) -+if (WebP_FOUND) - set(WEBP_SUPPORT 1) - set(WEBP_FOUND TRUE) -- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) -+ set(WEBP_LIBRARIES WebP::webp) - message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") - endif() - -@@ -715,8 +706,8 @@ endif() - if(DEFLATE_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${DEFLATE_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) -@@ -727,8 +718,8 @@ endif() - if(LIBLZMA_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) - endif() --if(ZSTD_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) -+if(ZSTD_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - if(WEBP_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.5.1-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.5.1-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..761950e496109 --- /dev/null +++ b/recipes/libtiff/all/patches/4.5.1-0001-cmake-dependencies.patch @@ -0,0 +1,31 @@ +diff --git a/cmake/JPEGCodec.cmake b/cmake/JPEGCodec.cmake +index 8455a3ec..09fe975a 100644 +--- a/cmake/JPEGCodec.cmake ++++ b/cmake/JPEGCodec.cmake +@@ -42,25 +42,7 @@ endif() + if (JPEG_SUPPORT) + # Check for jpeg12_read_scanlines() which has been added in libjpeg-turbo 2.2 + # for dual 8/12 bit mode. +- include(CheckCSourceCompiles) +- include(CMakePushCheckState) +- cmake_push_check_state(RESET) +- set(CMAKE_REQUIRED_INCLUDES "${JPEG_INCLUDE_DIRS}") +- set(CMAKE_REQUIRED_LIBRARIES "${JPEG_LIBRARIES}") +- check_c_source_compiles( +- " +- #include +- #include +- #include \"jpeglib.h\" +- int main() +- { +- jpeg_read_scanlines(0,0,0); +- jpeg12_read_scanlines(0,0,0); +- return 0; +- } +- " +- HAVE_JPEGTURBO_DUAL_MODE_8_12) +- cmake_pop_check_state() ++ set(HAVE_JPEGTURBO_DUAL_MODE_8_12 FALSE) + endif() + + if (NOT HAVE_JPEGTURBO_DUAL_MODE_8_12) diff --git a/recipes/libtiff/config.yml b/recipes/libtiff/config.yml index bbe65356cc08b..d9523166c1893 100644 --- a/recipes/libtiff/config.yml +++ b/recipes/libtiff/config.yml @@ -1,15 +1,11 @@ versions: + "4.6.0": + folder: all + "4.5.1": + folder: all "4.5.0": folder: all "4.4.0": folder: all "4.3.0": folder: all - "4.2.0": - folder: all - "4.1.0": - folder: all - "4.0.9": - folder: all - "4.0.8": - folder: all diff --git a/recipes/libtins/all/CMakeLists.txt b/recipes/libtins/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- a/recipes/libtins/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/libtins/all/conandata.yml b/recipes/libtins/all/conandata.yml index d565c818eeabe..ee42178c90b26 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 27984b1647f64..c84ea4afb38c0 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -1,18 +1,29 @@ -from conans import tools, CMake, ConanFile import os -import textwrap -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 copy, get, rm, rmdir + +required_conan_version = ">=1.53.0" class LibTinsConan(ConanFile): name = "libtins" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/mfontanini/libtins" description = "High-level, multiplatform C++ network packet sniffing and crafting library." license = "BSD-2-Clause" - topics = ("pcap", "packets", "network", "packet-analyser", "packet-parsing", "libpcap", "sniffing") - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mfontanini/libtins" + topics = ( + "pcap", + "packets", + "network", + "packet-analyser", + "packet-parsing", + "libpcap", + "sniffing", + ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -20,6 +31,7 @@ class LibTinsConan(ConanFile): "with_ack_tracker": [True, False], "with_wpa2": [True, False], "with_dot11": [True, False], + "with_tcp_stream_custom_data": [True, False], } default_options = { "shared": False, @@ -27,19 +39,12 @@ class LibTinsConan(ConanFile): "with_ack_tracker": True, "with_wpa2": True, "with_dot11": True, + "with_tcp_stream_custom_data": 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" + def _min_cppstd(self): + return 11 def config_options(self): if self.settings.os == "Windows": @@ -47,88 +52,71 @@ 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("libpcap/1.10.1") - if self.options.with_ack_tracker: - self.requires("boost/1.79.0") + 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.83.0", transitive_headers=True) if self.options.with_wpa2: - self.requires("openssl/1.1.1q") + self.requires("openssl/[>=1.1 <4]") + + 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], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - # Use Findlibpcap.cmake from cmake_find_package - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "FIND_PACKAGE(PCAP REQUIRED)", - "find_package(libpcap REQUIRED)") - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "${PCAP_LIBRARY}", - "libpcap::libpcap") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["LIBTINS_BUILD_EXAMPLES"] = False - self._cmake.definitions["LIBTINS_BUILD_TESTS"] = False - - self._cmake.definitions["LIBTINS_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["LIBTINS_ENABLE_CXX11"] = tools.valid_min_cppstd(self, 11) - self._cmake.definitions["LIBTINS_ENABLE_ACK_TRACKER"] = self.options.with_ack_tracker - self._cmake.definitions["LIBTINS_ENABLE_WPA2"] = self.options.with_wpa2 - self._cmake.definitions["LIBTINS_ENABLE_DOT11"] = self.options.with_dot11 - - 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["LIBTINS_BUILD_EXAMPLES"] = False + tc.variables["LIBTINS_BUILD_TESTS"] = False + tc.variables["LIBTINS_BUILD_SHARED"] = self.options.shared + tc.variables["LIBTINS_ENABLE_CXX11"] = True + tc.variables["LIBTINS_ENABLE_ACK_TRACKER"] = self.options.with_ack_tracker + tc.variables["LIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA"] = self.options.with_tcp_stream_custom_data + tc.variables["LIBTINS_ENABLE_WPA2"] = self.options.with_wpa2 + tc.variables["LIBTINS_ENABLE_DOT11"] = self.options.with_dot11 + tc.variables["PCAP_LIBRARY"] = "libpcap::libpcap" + tc.generate() + deps = CMakeDeps(self) + deps.set_property("libpcap", "cmake_file_name", "PCAP") + deps.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(os.path.join(self._source_subfolder, "LICENSE"), dst="licenses") - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "CMake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - - # 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), - {"libtins": "libtins::libtins"} + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, ) + cmake = CMake(self) + cmake.install() - @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("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + 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")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib"), recursive=True) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "libtins") - self.cpp_info.set_property("cmake_target_name", "libtins") - self.cpp_info.set_property("pkg_config_name", "libtins") self.cpp_info.libs = ["tins"] + self.cpp_info.set_property("pkg_config_name", "libtins") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.settings.os == "Windows" and not self.options.shared: self.cpp_info.defines.append("TINS_STATIC") self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi"]) - - # 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/libtins/all/test_package/CMakeLists.txt b/recipes/libtins/all/test_package/CMakeLists.txt index e785b2b7bd437..9df74f0fcf532 100644 --- a/recipes/libtins/all/test_package/CMakeLists.txt +++ b/recipes/libtins/all/test_package/CMakeLists.txt @@ -1,10 +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.15) +project(test_package LANGUAGES CXX) find_package(libtins REQUIRED CONFIG) -add_executable(test_package test_package.cpp) -target_link_libraries(test_package libtins) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libtins::libtins) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libtins/all/test_package/conanfile.py b/recipes/libtins/all/test_package/conanfile.py index a4f1e01b10ec3..ef5d7042163ec 100644 --- a/recipes/libtins/all/test_package/conanfile.py +++ b/recipes/libtins/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import tools, 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", "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/libtins/all/test_package/test_package.cpp b/recipes/libtins/all/test_package/test_package.cpp index 54d999bafa1ac..7f4d391a27813 100644 --- a/recipes/libtins/all/test_package/test_package.cpp +++ b/recipes/libtins/all/test_package/test_package.cpp @@ -6,5 +6,5 @@ int main() { SnifferConfiguration config; config.set_filter("port 80"); config.set_promisc_mode(true); - config.set_snap_len(400); + config.set_snap_len(50); } diff --git a/recipes/libtins/config.yml b/recipes/libtins/config.yml index ce55c187fafe1..a962f30c14fe9 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 6f90b31da6ebc..ff73256ddebc0 100644 --- a/recipes/libtool/all/conanfile.py +++ b/recipes/libtool/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanException from conan.tools.apple import is_apple_os, fix_apple_shared_install_name -from conan.tools.env import Environment +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rename, replace_in_file, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout @@ -11,7 +11,8 @@ import re import shutil -required_conan_version = ">=1.57.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.5" + class LibtoolConan(ConanFile): name = "libtool" @@ -33,6 +34,10 @@ class LibtoolConan(ConanFile): "fPIC": True, } + @property + def _has_dual_profiles(self): + return hasattr(self, "settings_build") + def export_sources(self): export_conandata_patches(self) @@ -54,15 +59,15 @@ 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): return getattr(self, "settings_build", self.settings) def build_requirements(self): - if hasattr(self, "settings_build"): - self.tool_requires("automake/1.16.5") + if self._has_dual_profiles: + self.tool_requires("automake/") self.tool_requires("m4/1.4.19") # Needed by configure self.tool_requires("gnu-config/cci.20210814") @@ -72,14 +77,17 @@ 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): return os.path.join(self.package_folder, "res") def generate(self): + VirtualBuildEnv(self).generate() + if not self._has_dual_profiles: + VirtualRunEnv(self).generate(scope="build") + if is_msvc(self): # __VSCMD_ARG_NO_LOGO: this test_package has too many invocations, # this avoids printing the logo everywhere @@ -230,12 +238,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/libtorrent/all/conandata.yml b/recipes/libtorrent/all/conandata.yml index c0a04e36275d4..c7cf929c7aa2c 100644 --- a/recipes/libtorrent/all/conandata.yml +++ b/recipes/libtorrent/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.9": + url: "https://github.com/arvidn/libtorrent/releases/download/v2.0.9/libtorrent-rasterbar-2.0.9.tar.gz" + sha256: "90cd92b6061c5b664840c3d5e151d43fedb24f5b2b24e14425ffbb884ef1798e" "2.0.8": url: "https://github.com/arvidn/libtorrent/releases/download/v2.0.8/libtorrent-rasterbar-2.0.8.tar.gz" sha256: "09dd399b4477638cf140183f5f85d376abffb9c192bc2910002988e27d69e13e" diff --git a/recipes/libtorrent/config.yml b/recipes/libtorrent/config.yml index aabaf7330b305..dd7ddb590b4ae 100644 --- a/recipes/libtorrent/config.yml +++ b/recipes/libtorrent/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.9": + folder: "all" "2.0.8": folder: "all" "2.0.1": diff --git a/recipes/libucl/all/conanfile.py b/recipes/libucl/all/conanfile.py index 99131d4e95863..f81b0da544841 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/libunistring/all/conandata.yml b/recipes/libunistring/all/conandata.yml index c22acd0ca0e42..60207a8f26db0 100644 --- a/recipes/libunistring/all/conandata.yml +++ b/recipes/libunistring/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1": + url: "https://ftp.gnu.org/gnu/libunistring/libunistring-1.1.tar.xz" + sha256: "827c1eb9cb6e7c738b171745dac0888aa58c5924df2e59239318383de0729b98" "0.9.10": - url: "https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.gz" - sha256: "a82e5b333339a88ea4608e4635479a1cfb2e01aafb925e1290b65710d43f610b" + url: "https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.xz" + sha256: "eb8fb2c3e4b6e2d336608377050892b54c3c983b646c561836550863003c05d7" diff --git a/recipes/libunistring/config.yml b/recipes/libunistring/config.yml index b2646e05f90e5..1418b6cb6cc09 100644 --- a/recipes/libunistring/config.yml +++ b/recipes/libunistring/config.yml @@ -1,3 +1,5 @@ versions: + "1.1": + folder: all "0.9.10": folder: all diff --git a/recipes/libunwind/all/conandata.yml b/recipes/libunwind/all/conandata.yml index 3379c640096e5..baa8d36f9cd17 100644 --- a/recipes/libunwind/all/conandata.yml +++ b/recipes/libunwind/all/conandata.yml @@ -1,4 +1,10 @@ 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" "1.6.2": url: "https://github.com/libunwind/libunwind/releases/download/v1.6.2/libunwind-1.6.2.tar.gz" sha256: "4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976" diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py index dd6ce3246217b..002c9bf613f23 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.0") + 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 26cf6b32aa2bf..ce44762c05da1 100644 --- a/recipes/libunwind/config.yml +++ b/recipes/libunwind/config.yml @@ -1,4 +1,8 @@ versions: + "1.7.2": + folder: all + "1.7.0": + folder: all "1.6.2": folder: all "1.5.0": diff --git a/recipes/liburing/all/conandata.yml b/recipes/liburing/all/conandata.yml index ca85945754398..c886933bedcfe 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 9035e2b799208..b1e4b79034482 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 b8135611cec52..7ccf5415cdb07 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 6fbb963afebbd..ead8e42a0dc6d 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 0000000000000..de3b75d9538de --- /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 0000000000000..49a3a66ea5bad --- /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 7c72c93d4edcd..264b68e5678d7 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 36dea026beea9..f7d86f158ac89 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 8e55c99a4d6e0..3be5eb4b77caf 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 0319dc88794d1..a4a005540368d 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 a5ffd526aaea7..016043e24e629 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 4fdc223664bd8..ef5d7042163ec 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 6cdda7a4a359c..bd44d95c27b01 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 0000000000000..91630d79f4abb --- /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 0000000000000..852f062fd4f80 --- /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 e251d497e772d..de25f5782ee20 100644 --- a/recipes/libuv/all/conandata.yml +++ b/recipes/libuv/all/conandata.yml @@ -1,4 +1,13 @@ 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" + "1.45.0": + url: "https://github.com/libuv/libuv/archive/v1.45.0.tar.gz" + sha256: "458e34d5ef7f3c0394a2bfd8c39d757cb1553baa5959b9b4b45df63aa027a228" "1.44.2": url: "https://github.com/libuv/libuv/archive/v1.44.2.tar.gz" sha256: "e6e2ba8b4c349a4182a33370bb9be5e23c51b32efb9b9e209d0e8556b73a48da" @@ -24,6 +33,18 @@ 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" + patch_type: "conan" + "1.45.0": + - patch_file: "patches/1.45.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" "1.44.2": - patch_file: "patches/1.44.2/fix-cmake.patch" patch_description: "separate shared and static library build" diff --git a/recipes/libuv/all/conanfile.py b/recipes/libuv/all/conanfile.py index a147f0a7124e2..d9bda835cdea0 100644 --- a/recipes/libuv/all/conanfile.py +++ b/recipes/libuv/all/conanfile.py @@ -2,20 +2,21 @@ 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.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibuvConan(ConanFile): name = "libuv" + description = "A multi-platform support library with a focus on asynchronous I/O" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://libuv.org" - description = "A multi-platform support library with a focus on asynchronous I/O" - topics = ("libuv", "asynchronous", "io", "networking", "multi-platform") - + topics = ("asynchronous", "io", "networking", "multi-platform") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,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.cppstd - except Exception: - pass - try: - del self.settings.compiler.libcxx - 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") @@ -56,12 +48,13 @@ def validate(self): check_min_vs(self, "190") 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["LIBUV_BUILD_TESTS"] = False + if Version(self.version) >= "1.45.0": + tc.variables["LIBUV_BUILD_SHARED"] = self.options.shared tc.generate() def build(self): @@ -82,7 +75,7 @@ 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), - {self._target_lib_name: "libuv::libuv"} + {self._target_name: "libuv::libuv"} ) def _create_cmake_module_alias_targets(self, module_file, targets): @@ -101,20 +94,32 @@ def _module_file_rel_path(self): return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @property - def _target_lib_name(self): - return "uv" if self.options.shared else "uv_a" + def _target_name(self): + if Version(self.version) < "1.45.0": + return "uv" if self.options.shared else "uv_a" + return "uv" + + @property + def _lib_name(self): + if Version(self.version) < "1.45.0": + return "uv" if self.options.shared else "uv_a" + if is_msvc(self) and not self.options.shared: + return "libuv" + return "uv" def package_info(self): self.cpp_info.set_property("cmake_file_name", "libuv") - self.cpp_info.set_property("cmake_target_name", self._target_lib_name) + self.cpp_info.set_property("cmake_target_name", self._target_name) self.cpp_info.set_property("pkg_config_name", "libuv" if self.options.shared else "libuv-static") - self.cpp_info.libs = [self._target_lib_name] + self.cpp_info.libs = [self._lib_name] if self.options.shared: self.cpp_info.defines = ["USING_UV_SHARED=1"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["dl", "pthread", "rt"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["iphlpapi", "psapi", "userenv", "ws2_32"] + if Version(self.version) >= "1.45.0": + self.cpp_info.system_libs.append("dbghelp") # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["pkg_config"] = "libuv" if self.options.shared else "libuv-static" diff --git a/recipes/libuv/all/patches/1.45.0/fix-cmake.patch b/recipes/libuv/all/patches/1.45.0/fix-cmake.patch new file mode 100644 index 0000000000000..17b69ef2b4959 --- /dev/null +++ b/recipes/libuv/all/patches/1.45.0/fix-cmake.patch @@ -0,0 +1,58 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 93733dd..d9e7acc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -460,8 +460,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}) + target_compile_options(uv_a PRIVATE ${uv_cflags}) +@@ -480,6 +479,8 @@ set_target_properties(uv_a PROPERTIES OUTPUT_NAME "uv") + if(MSVC) + 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, +@@ -732,18 +733,10 @@ 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) + + 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::) + + if(LIBUV_BUILD_SHARED) + # The version in the filename is mirroring the behaviour of autotools. +@@ -757,6 +750,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/all/patches/1.47.0/fix-cmake.patch b/recipes/libuv/all/patches/1.47.0/fix-cmake.patch new file mode 100644 index 0000000000000..9a4ee2265047a --- /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 cc83d80cfe19b..4c8ae03d813d7 100644 --- a/recipes/libuv/config.yml +++ b/recipes/libuv/config.yml @@ -1,4 +1,10 @@ versions: + "1.47.0": + folder: all + "1.46.0": + folder: all + "1.45.0": + folder: all "1.44.2": folder: all "1.44.1": diff --git a/recipes/libuvc/all/conanfile.py b/recipes/libuvc/all/conanfile.py index c10470d935e60..cb9de052b88cd 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/libva/all/conandata.yml b/recipes/libva/all/conandata.yml new file mode 100644 index 0000000000000..da7a69068bfd9 --- /dev/null +++ b/recipes/libva/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.20.0": + url: "https://github.com/intel/libva/archive/refs/tags/2.20.0.tar.gz" + sha256: "117f8d658a5fc9ea406ca80a3eb4ae1d70b15a54807c9ed77199c812bed73b60" +patches: + "2.20.0": + - patch_file: "patches/0001-fix-win32-debug.patch" + patch_description: "Fix win32 debug build break" + patch_type: "backport" + patch_source: "https://github.com/intel/libva/pull/759" diff --git a/recipes/libva/all/conanfile.py b/recipes/libva/all/conanfile.py new file mode 100644 index 0000000000000..4020db9e7c63e --- /dev/null +++ b/recipes/libva/all/conanfile.py @@ -0,0 +1,144 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get, 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 PackageConan(ConanFile): + name = "libva" + description = "Libva is an implementation for VA-API" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/intel/libva" + topics = ("VA-API", "Video", "Acceleration") + provides = "vaapi" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_drm": [True, False], + "with_x11": [True, False], + "with_glx": [True, False], + "with_wayland": [True, False], + "with_win32": [True, False], + } + default_options = { + "with_drm": True, + "with_x11": True, + "with_glx": True, + "with_wayland": True, + "with_win32": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os != "Windows": + del self.options.with_win32 + + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_x11 + del self.options.with_glx + del self.options.with_drm + + if self.settings.os != "Linux": + del self.options.with_wayland + + def configure(self): + 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.get_safe("with_x11"): + self.requires("xorg/system") + if self.options.get_safe("with_drm"): + self.requires("libdrm/2.4.119") + if self.options.get_safe("with_wayland"): + self.requires("wayland/1.22.0") + if self.options.get_safe("with_glx"): + self.requires("opengl/system") + + def validate(self): + if self.options.get_safe("with_glx") and not self.options.get_safe("with_x11"): + raise ConanInvalidConfiguration(f"{self.ref} requires x11 when glx is enabled") + if not self.options.get_safe("with_drm") and not self.options.get_safe("with_x11") and not self.options.get_safe("with_wayland") and not self.options.get_safe("with_win32"): + raise ConanInvalidConfiguration(f"{self.ref} can not be built without at least one backend dev files.") + + def build_requirements(self): + if self.options.get_safe("with_wayland"): + self.tool_requires("wayland/1.22.0") + self.tool_requires("meson/1.3.1") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["disable_drm"] = not self.options.get_safe("with_drm") + for opt in ['with_x11', 'with_glx', 'with_wayland', 'with_win32']: + tc.project_options[opt] = "yes" if self.options.get_safe(opt) else "no" + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate() + + def build(self): + apply_conandata_patches(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")) + 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.components["libva_"].libs = ["va"] + self.cpp_info.components["libva_"].set_property("pkg_config_name", "libva") + + if self.options.get_safe("with_drm"): + self.cpp_info.components["libva-drm"].libs = ["va-drm"] + self.cpp_info.components["libva-drm"].set_property("pkg_config_name", "libva-drm") + self.cpp_info.components["libva-drm"].requires = ["libva_", "libdrm::libdrm"] + + if self.options.get_safe("with_x11"): + self.cpp_info.components["libva-x11"].libs = ["va-x11"] + self.cpp_info.components["libva-x11"].set_property("pkg_config_name", "libva-x11") + self.cpp_info.components["libva-x11"].requires = ["libva_", "xorg::xorg"] + + if self.options.get_safe("with_glx"): + self.cpp_info.components["libva-glx"].libs = ["va-glx"] + self.cpp_info.components["libva-glx"].set_property("pkg_config_name", "libva-glx") + self.cpp_info.components["libva-glx"].requires = ["libva_", "opengl::opengl"] + + if self.options.get_safe("with_wayland"): + self.cpp_info.components["libva-wayland"].libs = ["va-wayland"] + self.cpp_info.components["libva-wayland"].set_property("pkg_config_name", "libva-wayland") + self.cpp_info.components["libva-wayland"].requires = ["libva_", "wayland::wayland-client"] + + if self.options.get_safe("with_win32"): + self.cpp_info.components["libva-win32"].libs = ["va_win32"] + self.cpp_info.components["libva-win32"].set_property("pkg_config_name", "libva-win32") + self.cpp_info.components["libva-win32"].requires = ["libva_"] diff --git a/recipes/libva/all/patches/0001-fix-win32-debug.patch b/recipes/libva/all/patches/0001-fix-win32-debug.patch new file mode 100644 index 0000000000000..9a323b9c3f71a --- /dev/null +++ b/recipes/libva/all/patches/0001-fix-win32-debug.patch @@ -0,0 +1,27 @@ +From 2a1536a7d87eee3de17c27d07a40d8578cbf7cc0 Mon Sep 17 00:00:00 2001 +From: Sil Vilerino +Date: Wed, 27 Sep 2023 11:50:16 -0400 +Subject: [PATCH] win32: Fix debug build break + +Fixes: 484f128 ("win32: remove duplicate adapter_luid entry") +Signed-off-by: Sil Vilerino +--- + va/win32/va_win32.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/va/win32/va_win32.c b/va/win32/va_win32.c +index 7a6a895d3..350ee3a27 100644 +--- a/va/win32/va_win32.c ++++ b/va/win32/va_win32.c +@@ -183,9 +183,9 @@ VADisplay vaGetDisplayWin32( + LoadDriverNameFromRegistry(adapter_luid, pWin32Ctx); + #ifdef _DEBUG + if (pWin32Ctx->registry_driver_available_flag) { +- fprintf(stderr, "VA_Win32: Found driver %s in the registry for LUID %ld %ld \n", pWin32Ctx->registry_driver_name, adapter_luid.LowPart, adapter_luid.HighPart); ++ fprintf(stderr, "VA_Win32: Found driver %s in the registry for LUID %ld %ld \n", pWin32Ctx->registry_driver_name, adapter_luid->LowPart, adapter_luid->HighPart); + } else { +- fprintf(stderr, "VA_Win32: Couldn't find a driver in the registry for LUID %ld %ld. Using default driver: %s \n", adapter_luid.LowPart, adapter_luid.HighPart, VAAPI_DEFAULT_DRIVER_NAME); ++ fprintf(stderr, "VA_Win32: Couldn't find a driver in the registry for LUID %ld %ld. Using default driver: %s \n", adapter_luid->LowPart, adapter_luid->HighPart, VAAPI_DEFAULT_DRIVER_NAME); + } + #endif // _DEBUG + } diff --git a/recipes/libva/all/test_package/CMakeLists.txt b/recipes/libva/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b1b0ee21235e --- /dev/null +++ b/recipes/libva/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libva REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE libva::libva) diff --git a/recipes/libva/all/test_package/conanfile.py b/recipes/libva/all/test_package/conanfile.py new file mode 100644 index 0000000000000..abc9920da73b3 --- /dev/null +++ b/recipes/libva/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + + 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): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/libva/all/test_package/test_package.c b/recipes/libva/all/test_package/test_package.c new file mode 100644 index 0000000000000..2731d8afc64df --- /dev/null +++ b/recipes/libva/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#include + +int main() +{ + VADisplay va_display; + printf("Display is valid: %d", vaDisplayIsValid(0)); + return 0; +} diff --git a/recipes/libva/config.yml b/recipes/libva/config.yml new file mode 100644 index 0000000000000..bb6ad1a3e3dc2 --- /dev/null +++ b/recipes/libva/config.yml @@ -0,0 +1,3 @@ +versions: + "2.20.0": + folder: all diff --git a/recipes/libvault/all/CMakeLists.txt b/recipes/libvault/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d..0000000000000 --- a/recipes/libvault/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/libvault/all/conandata.yml b/recipes/libvault/all/conandata.yml index c828fc89b0560..fad4071cba2ec 100644 --- a/recipes/libvault/all/conandata.yml +++ b/recipes/libvault/all/conandata.yml @@ -10,14 +10,14 @@ sources: sha256: 0a42be282ff0aff77b68cb7238014aa762df5c6b62e4d3561878874ca3760489 patches: "0.52.0": - - patch_file: "patches/fix-cmake-0.51.0.patch" + - patch_file: "patches/0.52.0-0001-fix-cmake.patch" patch_type: "conan" patch_description: "use libcurl from conan center" "0.51.0": - - patch_file: "patches/fix-cmake-0.51.0.patch" + - patch_file: "patches/0.51.0-0001-fix-cmake.patch" patch_type: "conan" patch_description: "use libcurl from conan center" "0.48.0": - - patch_file: "patches/fix-cmake-0.48.0.patch" + - patch_file: "patches/0.48.0-0001-fix-cmake.patch" patch_type: "conan" patch_description: "use libcurl from conan center" diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 659305c5f732b..408c16f6dbb3b 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -1,15 +1,14 @@ import os -from conan import ConanFile, Version +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 -from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, get, rmdir -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +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 -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class LibvaultConan(ConanFile): @@ -19,15 +18,24 @@ class LibvaultConan(ConanFile): homepage = "https://github.com/abedra/libvault" description = "A C++ library for Hashicorp Vault" topics = ("vault", "libvault", "secrets", "passwords") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - exports_sources = ["CMakeLists.txt", "patches/**"] - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } @property def _mac_os_minimum_required_version(self): return "10.15" + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -36,16 +44,20 @@ 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.86.0") - self.requires("catch2/3.2.0") + # public header VaultClient.h includes curl/curl.h and use several functions + self.requires("libcurl/[>=7.78.0 <9]", transitive_headers=True, transitive_libs=True) def validate(self): - compiler = str(self.info.settings.compiler) + compiler = str(self.settings.compiler) compiler_version = Version(self.settings.compiler.version.value) minimum_compiler_version = { - "Visual Studio": "19", + "Visual Studio": "16", + "msvc": "192", "gcc": "8", "clang": "7.0", "apple-clang": "12", @@ -63,7 +75,7 @@ def validate(self): raise ConanInvalidConfiguration("clang 11 with libstdc++ is not supported due to old libstdc++ missing C++17 support") if is_apple_os(self): - os_version = self.info.settings.get_safe("os.version") + os_version = self.settings.get_safe("os.version") if os_version and Version(os_version) < self._mac_os_minimum_required_version: raise ConanInvalidConfiguration( "Macos Mojave (10.14) and earlier cannot to be built because C++ standard library too old.") @@ -72,28 +84,21 @@ def validate(self): check_min_cppstd(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): tc = CMakeToolchain(self) - tc.variables["ENABLE_TEST"] = "OFF" - tc.variables["ENABLE_INTEGRATION_TEST"] = "OFF" - tc.variables["ENABLE_COVERAGE"] = "OFF" - tc.variables["LINK_CURL"] = "OFF" - tc.variables["CMAKE_OSX_DEPLOYMENT_TARGET"] = self._mac_os_minimum_required_version - 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.variables["ENABLE_TEST"] = False + tc.variables["ENABLE_INTEGRATION_TEST"] = False + tc.variables["ENABLE_COVERAGE"] = False tc.generate() - tc = VirtualBuildEnv(self) - tc.generate(scope="build") + deps = CMakeDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure(build_script_folder=self.build_folder) + cmake.configure() cmake.build() def package(self): @@ -105,12 +110,10 @@ def package(self): def package_info(self): self.cpp_info.libs = ["vault"] - self.cpp_info.system_libs = ["m"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.system_libs.append("stdc++fs") - # TODO: Remove after Conan 2.0 - self.cpp_info.names["cmake_find_package"] = "libvault" - self.cpp_info.names["cmake_find_package_multi"] = "libvault" self.cpp_info.set_property("pkg_config_name", "vault") self.cpp_info.set_property("cmake_file_name", "libvault") diff --git a/recipes/libvault/all/patches/0.48.0-0001-fix-cmake.patch b/recipes/libvault/all/patches/0.48.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..df2816ee6d88d --- /dev/null +++ b/recipes/libvault/all/patches/0.48.0-0001-fix-cmake.patch @@ -0,0 +1,42 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,10 +1,6 @@ + cmake_minimum_required(VERSION 3.12) + project(vault VERSION 0.48.0 DESCRIPTION "Vault library for C++") + +-set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) +-set(CMAKE_CXX_FLAGS_DEBUG --coverage) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + option(ENABLE_TEST "Enable tests?" ON) +@@ -14,12 +10,7 @@ option(LINK_CURL "Link curl library for vault" OFF) + option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) + option(INSTALL "Run install targets" ON) + +-find_package(CURL) +-if (CURL_FOUND) +- include_directories(${CURL_INCLUDE_DIR}) +-else (CURL_FOUND) +- message(FATAL_ERROR "CURL not found") +-endif (CURL_FOUND) ++find_package(CURL REQUIRED) + + include(GNUInstallDirs) + include_directories("${PROJECT_SOURCE_DIR}/lib") +@@ -120,9 +111,11 @@ set_target_properties(vault PROPERTIES + + target_include_directories(vault PRIVATE src) + +-if(LINK_CURL) +- target_link_libraries(vault curl) +-endif(LINK_CURL) ++target_link_libraries(vault PUBLIC CURL::libcurl) ++target_compile_features(vault PUBLIC cxx_std_17) ++if(WIN32) ++ set_target_properties(vault PROPERTIES RUNTIME_OUTPUT_NAME "VaultClient") ++endif() + + if (ENABLE_COVERAGE) + target_link_libraries(vault gcov) diff --git a/recipes/libvault/all/patches/0.51.0-0001-fix-cmake.patch b/recipes/libvault/all/patches/0.51.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..2ff417c356ac8 --- /dev/null +++ b/recipes/libvault/all/patches/0.51.0-0001-fix-cmake.patch @@ -0,0 +1,41 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,9 +1,6 @@ + cmake_minimum_required(VERSION 3.12) + project(vault VERSION 0.51.0 DESCRIPTION "Vault library for C++") + +-set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + option(ENABLE_TEST "Enable tests?" ON) +@@ -13,12 +10,7 @@ option(LINK_CURL "Link curl library for vault" OFF) + option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) + option(INSTALL "Run install targets" ON) + +-find_package(CURL) +-if (CURL_FOUND) +- include_directories(${CURL_INCLUDE_DIR}) +-else (CURL_FOUND) +- message(FATAL_ERROR "CURL not found") +-endif (CURL_FOUND) ++find_package(CURL REQUIRED) + + include(GNUInstallDirs) + include_directories("${PROJECT_SOURCE_DIR}/lib") +@@ -119,9 +111,11 @@ set_target_properties(vault PROPERTIES + + target_include_directories(vault PRIVATE src) + +-if(LINK_CURL) +- target_link_libraries(vault curl) +-endif(LINK_CURL) ++target_link_libraries(vault PUBLIC CURL::libcurl) ++target_compile_features(vault PUBLIC cxx_std_17) ++if(WIN32) ++ set_target_properties(vault PROPERTIES RUNTIME_OUTPUT_NAME "VaultClient") ++endif() + + if (ENABLE_COVERAGE) + target_link_libraries(vault gcov) diff --git a/recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch b/recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..70b3ab582fcdc --- /dev/null +++ b/recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch @@ -0,0 +1,41 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,9 +1,6 @@ + cmake_minimum_required(VERSION 3.12) + project(vault VERSION 0.52.0 DESCRIPTION "Vault library for C++") + +-set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + option(ENABLE_TEST "Enable tests?" ON) +@@ -13,12 +10,7 @@ option(LINK_CURL "Link curl library for vault" OFF) + option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) + option(INSTALL "Run install targets" ON) + +-find_package(CURL) +-if (CURL_FOUND) +- include_directories(${CURL_INCLUDE_DIR}) +-else (CURL_FOUND) +- message(FATAL_ERROR "CURL not found") +-endif (CURL_FOUND) ++find_package(CURL REQUIRED) + + include(GNUInstallDirs) + include_directories("${PROJECT_SOURCE_DIR}/lib") +@@ -119,9 +111,11 @@ set_target_properties(vault PROPERTIES + + target_include_directories(vault PRIVATE src) + +-if(LINK_CURL) +- target_link_libraries(vault curl) +-endif(LINK_CURL) ++target_link_libraries(vault PUBLIC CURL::libcurl) ++target_compile_features(vault PUBLIC cxx_std_17) ++if(WIN32) ++ set_target_properties(vault PROPERTIES RUNTIME_OUTPUT_NAME "VaultClient") ++endif() + + if (ENABLE_COVERAGE) + target_link_libraries(vault gcov) diff --git a/recipes/libvault/all/patches/fix-cmake-0.48.0.patch b/recipes/libvault/all/patches/fix-cmake-0.48.0.patch deleted file mode 100644 index 510090973c349..0000000000000 --- a/recipes/libvault/all/patches/fix-cmake-0.48.0.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -4,7 +4,6 @@ - set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) --set(CMAKE_CXX_FLAGS_DEBUG --coverage) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - - option(ENABLE_TEST "Enable tests?" ON) -@@ -14,13 +13,6 @@ - option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) - option(INSTALL "Run install targets" ON) - --find_package(CURL) --if (CURL_FOUND) -- include_directories(${CURL_INCLUDE_DIR}) --else (CURL_FOUND) -- message(FATAL_ERROR "CURL not found") --endif (CURL_FOUND) -- - include(GNUInstallDirs) - include_directories("${PROJECT_SOURCE_DIR}/lib") - -@@ -120,11 +112,20 @@ - - target_include_directories(vault PRIVATE src) - -+OPTION(UseCurl "UseCurl" ON) -+IF (UseCurl) -+ FIND_PACKAGE(CURL) -+ IF (CURL_FOUND) -+ target_link_libraries(vault CURL::libcurl) -+ ENDIF() -+ENDIF() -+ - if(LINK_CURL) - target_link_libraries(vault curl) - endif(LINK_CURL) - - if (ENABLE_COVERAGE) -+ set(CMAKE_CXX_FLAGS_DEBUG --coverage) - target_link_libraries(vault gcov) - endif () - -@@ -155,7 +156,7 @@ - "${CMAKE_CURRENT_BINARY_DIR}/libvaultConfigVersion.cmake" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libvault") - -- configure_file(vault.pc.in vault.pc @ONLY) -+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/vault.pc.in" "${CMAKE_BINARY_DIR}/vault.pc" @ONLY) - install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - endif (INSTALL) -@@ -176,7 +177,7 @@ - target_include_directories(libvault_test PRIVATE include) - - target_link_libraries(libvault_test vault) -- target_link_libraries(libvault_test curl) -+ target_link_libraries(libvault_test CURL::libcurl) - target_link_libraries(libvault_test Catch2::Catch2) - - include(CTest) diff --git a/recipes/libvault/all/patches/fix-cmake-0.51.0.patch b/recipes/libvault/all/patches/fix-cmake-0.51.0.patch deleted file mode 100644 index 74ce9e72d06db..0000000000000 --- a/recipes/libvault/all/patches/fix-cmake-0.51.0.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -13,13 +13,6 @@ option(LINK_CURL "Link curl library for vault" OFF) - option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) - option(INSTALL "Run install targets" ON) - --find_package(CURL) --if (CURL_FOUND) -- include_directories(${CURL_INCLUDE_DIR}) --else (CURL_FOUND) -- message(FATAL_ERROR "CURL not found") --endif (CURL_FOUND) -- - include(GNUInstallDirs) - include_directories("${PROJECT_SOURCE_DIR}/lib") - -@@ -119,6 +112,14 @@ set_target_properties(vault PROPERTIES - - target_include_directories(vault PRIVATE src) - -+OPTION(UseCurl "UseCurl" ON) -+IF (UseCurl) -+ FIND_PACKAGE(CURL) -+ IF (CURL_FOUND) -+ target_link_libraries(vault CURL::libcurl) -+ ENDIF() -+ENDIF() -+ - if(LINK_CURL) - target_link_libraries(vault curl) - endif(LINK_CURL) -@@ -155,7 +156,7 @@ if (INSTALL) - "${CMAKE_CURRENT_BINARY_DIR}/libvaultConfigVersion.cmake" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libvault") - -- configure_file(vault.pc.in vault.pc @ONLY) -+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/vault.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/vault.pc" @ONLY) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - endif (INSTALL) -@@ -176,7 +177,7 @@ if (ENABLE_TEST) - target_include_directories(libvault_test PRIVATE include) - - target_link_libraries(libvault_test vault) -- target_link_libraries(libvault_test curl) -+ target_link_libraries(libvault_test CURL::libcurl) - target_link_libraries(libvault_test Catch2::Catch2) - target_link_libraries(libvault_test stdc++fs) - diff --git a/recipes/libvdpau/all/conandata.yml b/recipes/libvdpau/all/conandata.yml new file mode 100644 index 0000000000000..8273f43ccd712 --- /dev/null +++ b/recipes/libvdpau/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.5": + url: "https://gitlab.freedesktop.org/vdpau/libvdpau/-/archive/1.5/libvdpau-1.5.tar.bz2" + sha256: "a5d50a42b8c288febc07151ab643ac8de06a18446965c7241f89b4e810821913" diff --git a/recipes/libvdpau/all/conanfile.py b/recipes/libvdpau/all/conanfile.py new file mode 100644 index 0000000000000..0ef3234f8182e --- /dev/null +++ b/recipes/libvdpau/all/conanfile.py @@ -0,0 +1,85 @@ +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, 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 +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class PackageConan(ConanFile): + name = "libvdpau" + description = "Video Decode and Presentation API for UNIX" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freedesktop.org/wiki/Software/VDPAU/" + topics = ("video", "decode", "presentation") + package_type = "shared-library" + provides = "vdpau" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_dri2": [True, False], + } + default_options = { + "with_dri2": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + 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("xorg/system") + + def build_requirements(self): + self.tool_requires("meson/1.3.1") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["dri2"] = "true" if self.options.with_dri2 else "false" + tc.project_options["documentation"] = "false" + tc.project_options["sysconfdir"] = "share" + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(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() + + # 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")) + + def package_info(self): + self.cpp_info.libs = ["vdpau"] + self.cpp_info.set_property("pkg_config_name", "vdpau") + self.cpp_info.system_libs.extend(["pthread", "dl"]) diff --git a/recipes/libvdpau/all/test_package/CMakeLists.txt b/recipes/libvdpau/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d19c6aa2e9305 --- /dev/null +++ b/recipes/libvdpau/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libvdpau REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE libvdpau::libvdpau) diff --git a/recipes/libvdpau/all/test_package/conanfile.py b/recipes/libvdpau/all/test_package/conanfile.py new file mode 100644 index 0000000000000..abc9920da73b3 --- /dev/null +++ b/recipes/libvdpau/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + + 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): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/libvdpau/all/test_package/test_package.c b/recipes/libvdpau/all/test_package/test_package.c new file mode 100644 index 0000000000000..f3468bb4d0800 --- /dev/null +++ b/recipes/libvdpau/all/test_package/test_package.c @@ -0,0 +1,46 @@ +#include +#include + +#include + +#include + +int main() +{ + VdpDevice device; + VdpGetProcAddress * get_proc_address; + VdpGetInformationString * get_information_string; + VdpGetApiVersion * get_api_version; + VdpStatus status; + Display * display = XOpenDisplay(NULL); + if (!display) + { + printf("XOpenDisplay failed!\n"); + return 0; + } + status = vdp_device_create_x11(display, 0, &device, &get_proc_address); + if (status != VDP_STATUS_OK) + { + XCloseDisplay(display); + printf("vdp_device_create_x11 failed\n"); + return 0; + } + status = get_proc_address(device, VDP_FUNC_ID_GET_INFORMATION_STRING, (void**) &get_information_string); + if (status == VDP_STATUS_OK) + { + char const * information_string; + status = get_information_string(&information_string); + if (status == VDP_STATUS_OK) + printf("VDPAU information string: %s\n", information_string); + } + status = get_proc_address(device, VDP_FUNC_ID_GET_API_VERSION, (void**) &get_api_version); + if (status == VDP_STATUS_OK) + { + uint32_t api_version; + status = get_api_version(&api_version); + if (status == VDP_STATUS_OK) + printf("VDPAU API version: %d\n", api_version); + } + XCloseDisplay(display); + return 0; +} diff --git a/recipes/libvdpau/config.yml b/recipes/libvdpau/config.yml new file mode 100644 index 0000000000000..289ff2f2a0c3c --- /dev/null +++ b/recipes/libvdpau/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5": + folder: all diff --git a/recipes/libverto/all/conanfile.py b/recipes/libverto/all/conanfile.py index a35c9bf481ff4..a7c33c03726fe 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 e977e0d7cab2b..4e9baa365d40f 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 a64c42db322ce..6d2cd13499015 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 e431a16c35a92..42873e7560c7d 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 460cf69bd04b2..a39af33955838 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 new file mode 100644 index 0000000000000..18c5b099c2c71 --- /dev/null +++ b/recipes/libwebm/all/conandata.yml @@ -0,0 +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/conanfile.py b/recipes/libwebm/all/conanfile.py new file mode 100644 index 0000000000000..7d2ceec33ba43 --- /dev/null +++ b/recipes/libwebm/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.53.0" + + +class LibwebmConan(ConanFile): + name = "libwebm" + description = "Library for muxing and demuxing WebM media container files" + topics = ("webm", "container", "demuxing", "muxing", "media", "audio", "video") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://chromium.googlesource.com/webm/libwebm/" + license = "BSD-3-Clause" + + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_pes_ts": [True, False], + "with_new_parser_api": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "with_pes_ts": True, + "with_new_parser_api": 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_WEBMTS"] = self.options.with_pes_ts + tc.variables["ENABLE_WEBM_PARSER"] = self.options.with_new_parser_api + tc.variables["ENABLE_WEBMINFO"] = False + tc.variables["ENABLE_SAMPLE_PROGRAMS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE.TXT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "webm") + self.cpp_info.set_property("cmake_target_name", "webm::webm") + self.cpp_info.set_property("pkg_config_name", "webm") + self.cpp_info.libs = ["webm"] + + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libwebm/all/test_package/CMakeLists.txt b/recipes/libwebm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4a896b2300ca0 --- /dev/null +++ b/recipes/libwebm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(webm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE webm::webm) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libwebm/all/test_package/conanfile.py b/recipes/libwebm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b02549cdf82ed --- /dev/null +++ b/recipes/libwebm/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +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) + # 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() + 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/libwebm/all/test_package/test_package.cpp b/recipes/libwebm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..07d201d6d4f51 --- /dev/null +++ b/recipes/libwebm/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include + +#ifdef UNPREFIXED_HEADERS +#include +#include +#else +#include +#include +#endif // UNPREFIXED_HEADERS + +int main(void) { + int32_t major, minor, build, revision; + + mkvparser::GetVersion(major, minor, build, revision); + printf("Mkv Parser version: %d.%d.%d.%d\n", major, minor, build, revision); + + mkvmuxer::GetVersion(&major, &minor, &build, &revision); + printf("Mkv Muxer version: %d.%d.%d.%d\n", major, minor, build, revision); + + return 0; +} diff --git a/recipes/libwebm/config.yml b/recipes/libwebm/config.yml new file mode 100644 index 0000000000000..71746ecdc81bd --- /dev/null +++ b/recipes/libwebm/config.yml @@ -0,0 +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 ac9853ed7cd15..0aaa6446c5482 100644 --- a/recipes/libwebp/all/conandata.yml +++ b/recipes/libwebp/all/conandata.yml @@ -1,58 +1,31 @@ sources: - "1.3.0": - url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.0.tar.gz" - sha256: "64ac4614db292ae8c5aa26de0295bf1623dbb3985054cb656c55e67431def17c" + "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.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.0": - - patch_file: "patches/1.3.0-0001-fix-cmake.patch" + "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.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" @@ -62,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 0044f425b95b1..5e7c1354176a4 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 0892ee3bdacd9..0000000000000 --- 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 5f228670d57c8..0000000000000 --- 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 f9c41d4f6a541..0000000000000 --- 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/all/patches/1.3.1-0001-fix-cmake.patch b/recipes/libwebp/all/patches/1.3.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..72ee3a1218366 --- /dev/null +++ b/recipes/libwebp/all/patches/1.3.1-0001-fix-cmake.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad5e14c3..89c836f3 100644 +--- a/CMakeLists.txt ++++ 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) +@@ -153,7 +152,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 df097a6cc668f..e184761fe568e 100644 --- a/recipes/libwebp/config.yml +++ b/recipes/libwebp/config.yml @@ -1,17 +1,9 @@ versions: - "1.3.0": + "1.3.2": folder: all - "1.2.4": - folder: all - "1.2.3": - folder: all - "1.2.2": + "1.3.1": folder: all - "1.2.1": - folder: all - "1.2.0": + "1.2.4": folder: all "1.1.0": folder: all - "1.0.3": - folder: all diff --git a/recipes/libwebsockets/all/CMakeLists.txt b/recipes/libwebsockets/all/CMakeLists.txt deleted file mode 100644 index f3c9da822bfbd..0000000000000 --- a/recipes/libwebsockets/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/libwebsockets/all/conandata.yml b/recipes/libwebsockets/all/conandata.yml index 119725ef837be..ed95c45ed0deb 100644 --- a/recipes/libwebsockets/all/conandata.yml +++ b/recipes/libwebsockets/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.3.3": + url: "https://github.com/warmcat/libwebsockets/archive/v4.3.3.tar.gz" + sha256: "6fd33527b410a37ebc91bb64ca51bdabab12b076bc99d153d7c5dd405e4bdf90" "4.3.2": url: "https://github.com/warmcat/libwebsockets/archive/v4.3.2.tar.gz" sha256: "6a85a1bccf25acc7e8e5383e4934c9b32a102880d1e4c37c70b27ae2a42406e1" diff --git a/recipes/libwebsockets/all/conanfile.py b/recipes/libwebsockets/all/conanfile.py index c2dfe332c1332..0fd0cf66a67ea 100644 --- a/recipes/libwebsockets/all/conanfile.py +++ b/recipes/libwebsockets/all/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException, ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps +from conan.tools.files import get, replace_in_file, rmdir, copy, save, collect_libs +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.56.0" class LibwebsocketsConan(ConanFile): @@ -12,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], @@ -185,17 +190,8 @@ class LibwebsocketsConan(ConanFile): "enable_spawn": False } - exports_sources = "CMakeLists.txt" - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def layout(self): + cmake_layout(self, src_folder="src") def config_options(self): if self.settings.os == "Windows": @@ -203,13 +199,13 @@ 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): 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") @@ -217,44 +213,46 @@ def requirements(self): self.requires("libev/4.33") if self.options.with_zlib == "zlib": - self.requires("zlib/1.2.12") + 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": - self.requires("openssl/1.1.1o") + # Cannot add the [>=1.1 <4] range, as it seems openssl3 makes it fail + 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 tools.Version(self.settings.compiler.version) < "5": + if self.options.shared and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": # https://github.com/conan-io/conan-center-index/pull/5321#issuecomment-826367276 raise ConanInvalidConfiguration("{}/{} shared=True with gcc<5 does not build. Please submit a PR with a fix.".format(self.name, self.version)) - if tools.Version(self.version) <= "4.0.15" and self.settings.compiler == "apple-clang" and tools.Version(self.settings.compiler.version) >= "12": + if Version(self.version) <= "4.0.15" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) >= "12": raise ConanInvalidConfiguration("{}/{} with apple-clang>=12 does not build. Please submit a PR with a fix.".format(self.name, self.version)) - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) < 16 and tools.Version(self.version) >= "4.3.2": - raise ConanInvalidConfiguration ("{}/{} requires at least Visual Studio 2019".format(self.name, self.version)) + if Version(self.version) >= "4.3.2": + if ("Visual" in str(self.settings.compiler.version) and Version(self.settings.compiler.version) < 16) or \ + ("msvc" == str(self.settings.compiler.version) and Version(self.settings.compiler.version) < 192): + raise ConanInvalidConfiguration ("{}/{} requires at least Visual Studio 2019".format(self.name, self.version)) if self.options.with_hubbub: raise ConanInvalidConfiguration("Library hubbub not implemented (yet) in CCI") # TODO - Add hubbub package when available. 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 _get_library_extension(self, dep): - if self.options[dep].shared: + if self.dependencies[dep].options.shared: if self.settings.os == "Windows" : - if self._is_msvc: + if is_msvc(self): return ".lib" else: return ".dll.a" @@ -263,212 +261,202 @@ def _get_library_extension(self, dep): else: return ".so" else: - if self.settings.os == "Windows" and self._is_msvc: + if self.settings.os == "Windows" and is_msvc(self): return ".lib" else: return ".a" - @property - def _get_library_prefix(self): - if self.settings.os == "Windows" : - return "" - return "lib" - def _cmakify_path_list(self, paths): return ";".join(paths).replace("\\", "/") def _find_library(self, libname, dep): - for path in self.deps_cpp_info[dep].lib_paths: - lib_fullpath = os.path.join(path, self._get_library_prefix + libname + self._get_library_extension(dep)) - - print("Test : " + str(lib_fullpath)) + prefix = "lib" if self.settings.os != "Windows" else "" + 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): return lib_fullpath raise ConanException("Library {} not found".format(lib_fullpath)) def _find_libraries(self, dep): - return [self._find_library(lib, dep) for lib in self.deps_cpp_info[dep].libs] - - def _configure_cmake(self): - if self._cmake is not None: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["LWS_WITHOUT_TESTAPPS"] = True - self._cmake.definitions["LWS_WITHOUT_TEST_SERVER"] = True - self._cmake.definitions["LWS_WITHOUT_TEST_SERVER_EXTPOLL"] = True - self._cmake.definitions["LWS_WITHOUT_TEST_PING"] = True - self._cmake.definitions["LWS_WITHOUT_TEST_CLIENT"] = True - - self._cmake.definitions["LWS_LINK_TESTAPPS_DYNAMIC"] = True - self._cmake.definitions["LWS_WITH_SHARED"] = self.options.shared - self._cmake.definitions["LWS_WITH_STATIC"] = not self.options.shared - self._cmake.definitions["LWS_WITH_SSL"] = bool(self.options.with_ssl) + aggregated = self.dependencies[dep].cpp_info.aggregated_components() + result = [self._find_library(lib, dep) for lib in aggregated.libs] + return result + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LWS_WITHOUT_TESTAPPS"] = True + tc.variables["LWS_WITHOUT_TEST_SERVER"] = True + tc.variables["LWS_WITHOUT_TEST_SERVER_EXTPOLL"] = True + tc.variables["LWS_WITHOUT_TEST_PING"] = True + tc.variables["LWS_WITHOUT_TEST_CLIENT"] = True + + tc.variables["LWS_LINK_TESTAPPS_DYNAMIC"] = True + tc.variables["LWS_WITH_SHARED"] = self.options.shared + tc.variables["LWS_WITH_STATIC"] = not self.options.shared + tc.variables["LWS_WITH_SSL"] = bool(self.options.with_ssl) if self.options.with_ssl == "openssl": - self._cmake.definitions["LWS_OPENSSL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("openssl")) - self._cmake.definitions["LWS_OPENSSL_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["openssl"].include_paths) + tc.variables["LWS_OPENSSL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("openssl")) + tc.variables["LWS_OPENSSL_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["openssl"].cpp_info.includedirs) elif self.options.with_ssl == "mbedtls": - self._cmake.definitions["LWS_WITH_MBEDTLS"] = True - self._cmake.definitions["LWS_MBEDTLS_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("mbedtls")) - self._cmake.definitions["LWS_MBEDTLS_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["mbedtls"].include_paths) + tc.variables["LWS_WITH_MBEDTLS"] = True + tc.variables["LWS_MBEDTLS_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("mbedtls")) + tc.variables["LWS_MBEDTLS_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["mbedtls"].cpp_info.includedirs) elif self.options.with_ssl == "wolfssl": - self._cmake.definitions["LWS_WITH_WOLFSSL"] = True - self._cmake.definitions["LWS_WOLFSSL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("wolfssl")) - self._cmake.definitions["LWS_WOLFSSL_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["wolfssl"].include_paths) + tc.variables["LWS_WITH_WOLFSSL"] = True + tc.variables["LWS_WOLFSSL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("wolfssl")) + tc.variables["LWS_WOLFSSL_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["wolfssl"].cpp_info.includedirs) else: - self._cmake.definitions["LWS_WITH_WOLFSSL"] = False + tc.variables["LWS_WITH_WOLFSSL"] = False - self._cmake.definitions["LWS_WITH_LIBEV"] = self.options.with_libevent == "libev" + tc.variables["LWS_WITH_LIBEV"] = self.options.with_libevent == "libev" if self.options.with_libevent == "libev": - self._cmake.definitions["LWS_LIBEV_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libev")) - self._cmake.definitions["LWS_LIBEV_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["libev"].include_paths).replace("\\", "/") + tc.variables["LWS_LIBEV_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libev")) + tc.variables["LWS_LIBEV_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["libev"].cpp_info.includedirs).replace("\\", "/") - self._cmake.definitions["LWS_WITH_LIBUV"] = self.options.with_libuv + tc.variables["LWS_WITH_LIBUV"] = self.options.with_libuv if self.options.with_libuv: - self._cmake.definitions["LWS_LIBUV_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libuv")) - self._cmake.definitions["LWS_LIBUV_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["libuv"].include_paths) + tc.variables["LWS_LIBUV_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libuv")) + tc.variables["LWS_LIBUV_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["libuv"].cpp_info.includedirs) - self._cmake.definitions["LWS_WITH_LIBEVENT"] = self.options.with_libevent == "libevent" + tc.variables["LWS_WITH_LIBEVENT"] = self.options.with_libevent == "libevent" if self.options.with_libevent == "libevent": - self._cmake.definitions["LWS_LIBEVENT_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libevent")) - self._cmake.definitions["LWS_LIBEVENT_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["libevent"].include_paths) + tc.variables["LWS_LIBEVENT_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libevent")) + tc.variables["LWS_LIBEVENT_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["libevent"].cpp_info.includedirs) - self._cmake.definitions["LWS_WITH_ZLIB"] = self.options.with_zlib != False - self._cmake.definitions["LWS_WITH_MINIZ"] = self.options.with_zlib == "miniz" - self._cmake.definitions["LWS_WITH_BUNDLED_ZLIB"] = self.options.with_zlib == "bundled" + tc.variables["LWS_WITH_ZLIB"] = self.options.with_zlib != False + tc.variables["LWS_WITH_MINIZ"] = self.options.with_zlib == "miniz" + tc.variables["LWS_WITH_BUNDLED_ZLIB"] = self.options.with_zlib == "bundled" if self.options.with_zlib == "zlib": - self._cmake.definitions["LWS_ZLIB_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("zlib")) - self._cmake.definitions["LWS_ZLIB_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["zlib"].include_paths) + tc.variables["LWS_ZLIB_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("zlib")) + tc.variables["LWS_ZLIB_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["zlib"].cpp_info.includedirs) elif self.options.with_zlib == "miniz": - self._cmake.definitions["MINIZ_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("miniz")) - self._cmake.definitions["MINIZ_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["miniz"].include_paths) + tc.variables["MINIZ_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("miniz")) + tc.variables["MINIZ_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["miniz"].cpp_info.includedirs) - self._cmake.definitions["LWS_WITH_SQLITE3"] = self.options.with_sqlite3 + tc.variables["LWS_WITH_SQLITE3"] = self.options.with_sqlite3 if self.options.with_sqlite3: - self._cmake.definitions["LWS_SQLITE3_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("sqlite3")) - self._cmake.definitions["LWS_SQLITE3_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["sqlite3"].include_paths) + tc.variables["LWS_SQLITE3_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("sqlite3")) + tc.variables["LWS_SQLITE3_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["sqlite3"].cpp_info.includedirs) - self._cmake.definitions["LWS_WITH_FSMOUNT"] = self.options.with_libmount + tc.variables["LWS_WITH_FSMOUNT"] = self.options.with_libmount if self.options.with_libmount: - self._cmake.definitions["LWS_LIBMOUNT_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libmount")) - self._cmake.definitions["LWS_LIBMOUNT_INCLUDE_DIRS"] = self._cmakify_path_list(self.deps_cpp_info["libmount"].include_paths) - - self._cmake.definitions["LWS_WITH_HUBBUB"] = self.options.with_hubbub - - self._cmake.definitions["LWS_SSL_CLIENT_USE_OS_CA_CERTS"] = self.options.ssl_client_use_os_ca_certs - self._cmake.definitions["LWS_SSL_SERVER_WITH_ECDH_CERT"] = self.options.ssl_server_with_ecdh_cert - - self._cmake.definitions["LWS_WITH_NETWORK"] = self.options.enable_network - self._cmake.definitions["LWS_ROLE_H1"] = self.options.role_h1 - self._cmake.definitions["LWS_ROLE_WS"] = self.options.role_ws - self._cmake.definitions["LWS_ROLE_MQTT"] = self.options.role_mqtt - self._cmake.definitions["LWS_ROLE_DBUS"] = self.options.role_dbus - self._cmake.definitions["LWS_ROLE_RAW_PROXY"] = self.options.role_raw_proxy - self._cmake.definitions["LWS_ROLE_RAW_FILE"] = self.options.role_raw_file - self._cmake.definitions["LWS_WITH_HTTP2"] = self.options.enable_http2 - self._cmake.definitions["LWS_WITH_LWSWS"] = self.options.enable_lwsws - self._cmake.definitions["LWS_WITH_CGI"] = self.options.enable_cgi - self._cmake.definitions["LWS_IPV6"] = self.options.enable_ipv6 - self._cmake.definitions["LWS_UNIX_SOCK"] = self.options.enable_unix_sock - self._cmake.definitions["LWS_WITH_PLUGINS"] = self.options.enable_plugins - self._cmake.definitions["LWS_WITH_HTTP_PROXY"] = self.options.enable_http_proxy - self._cmake.definitions["LWS_WITH_ZIP_FOPS"] = self.options.enable_zip_fops - self._cmake.definitions["LWS_WITH_SOCKS5"] = self.options.enable_socks5 - self._cmake.definitions["LWS_WITH_GENERIC_SESSIONS"] = self.options.enable_generic_sessions - self._cmake.definitions["LWS_WITH_PEER_LIMITS"] = self.options.enable_peer_limits - self._cmake.definitions["LWS_WITH_ACCESS_LOG"] = self.options.enable_access_log - self._cmake.definitions["LWS_WITH_RANGES"] = self.options.enable_ranges - self._cmake.definitions["LWS_WITH_SERVER_STATUS"] = self.options.enable_server_status - self._cmake.definitions["LWS_WITH_THREADPOOL"] = self.options.enable_threadpool - self._cmake.definitions["LWS_WITH_HTTP_STREAM_COMPRESSION"] = self.options.enable_http_stream_compression - self._cmake.definitions["LWS_WITH_HTTP_BROTLI"] = self.options.enable_http_brotli - self._cmake.definitions["LWS_WITH_ACME"] = self.options.enable_acme - self._cmake.definitions["LWS_WITH_FTS"] = self.options.enable_fts - self._cmake.definitions["LWS_WITH_SYS_ASYNC_DNS"] = self.options.enable_sys_async_dns - self._cmake.definitions["LWS_WITH_SYS_NTPCLIENT"] = self.options.enable_sys_ntpclient - self._cmake.definitions["LWS_WITH_SYS_DHCP_CLIENT"] = self.options.enable_sys_dhcp_client - self._cmake.definitions["LWS_WITH_HTTP_BASIC_AUTH"] = self.options.enable_http_basic_auth - self._cmake.definitions["LWS_WITH_HTTP_UNCOMMON_HEADERS"] = self.options.enable_http_uncommon_headers - - self._cmake.definitions["LWS_WITHOUT_EXTENSIONS"] = not self.options.enable_extensions - self._cmake.definitions["LWS_WITHOUT_BUILTIN_GETIFADDRS"] = not self.options.enable_builtin_getifaddrs - self._cmake.definitions["LWS_FALLBACK_GETHOSTBYNAME"] = self.options.enable_fallback_gethostbyname - self._cmake.definitions["LWS_WITHOUT_BUILTIN_SHA1"] = not self.options.enable_builtin_sha1 - self._cmake.definitions["LWS_WITHOUT_DAEMONIZE"] = not self.options.enable_daemonize - self._cmake.definitions["LWS_WITH_LEJP"] = self.options.enable_lejp - self._cmake.definitions["LWS_WITH_STRUCT_JSON"] = self.options.enable_struct_json - self._cmake.definitions["LWS_WITH_STRUCT_SQLITE3"] = self.options.enable_struct_sqlite3 - - self._cmake.definitions["LWS_WITH_NO_LOGS"] = self.options.disable_logs - self._cmake.definitions["LWS_LOGS_TIMESTAMP"] = self.options.logs_timestamp - self._cmake.definitions["LWS_AVOID_SIGPIPE_IGN"] = self.options.avoid_sigpipe_ign - self._cmake.definitions["LWS_WITH_STATS"] = self.options.enable_stats - self._cmake.definitions["LWS_WITH_JOSE"] = self.options.enable_jose - self._cmake.definitions["LWS_WITH_GENCRYPTO"] = self.options.enable_gencrypto - self._cmake.definitions["LWS_WITH_SELFTESTS"] = self.options.enable_selftests - self._cmake.definitions["LWS_WITH_GCOV"] = self.options.enable_gcov - self._cmake.definitions["LWS_WITH_LWSAC"] = self.options.enable_lwsac - self._cmake.definitions["LWS_WITH_CUSTOM_HEADERS"] = self.options.enable_custom_headers - self._cmake.definitions["LWS_WITH_DISKCACHE"] = self.options.enable_diskcache - self._cmake.definitions["LWS_WITH_DIR"] = self.options.enable_dir - self._cmake.definitions["LWS_WITH_LEJP_CONF"] = self.options.enable_lejp_conf - self._cmake.definitions["LWS_WITH_DEPRECATED_LWS_DLL"] = self.options.enable_deprecated_lws_dll - self._cmake.definitions["LWS_WITH_SEQUENCER"] = self.options.enable_sequencer - self._cmake.definitions["LWS_WITH_EXTERNAL_POLL"] = self.options.enable_external_poll - self._cmake.definitions["LWS_WITH_LWS_DSH"] = self.options.enable_lws_dsh - self._cmake.definitions["LWS_CLIENT_HTTP_PROXYING"] = self.options.enable_external_http_proxying - self._cmake.definitions["LWS_WITH_FILE_OPS"] = self.options.enable_file_ops - self._cmake.definitions["LWS_WITH_DETAILED_LATENCY"] = self.options.enable_detailed_latency - self._cmake.definitions["LWS_WITH_UDP"] = self.options.enable_udp - self._cmake.definitions["LWS_WITH_SPAWN"] = self.options.enable_spawn - - self._cmake.definitions["LWS_WITH_ALSA"] = False - self._cmake.definitions["LWS_WITH_GTK"] = False - - if tools.Version(self.version) >= "4.1.0": - self._cmake.definitions["LWS_WITH_SYS_SMD"] = self.settings.os != "Windows" - self._cmake.definitions["DISABLE_WERROR"] = True - - # Temporary override Windows 10 SDK for Visual Studio 2019, see issue #4450 - # CCI worker has 10.0.17763.0 SDK installed alongside with 10.0.20348 but only 20348 can be used with Visual Studio 2019 - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) == 16: - self._cmake.definitions["CMAKE_SYSTEM_VERSION"] = "10.0.20348" - - self._cmake.configure() - return self._cmake + tc.variables["LWS_LIBMOUNT_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("libmount")) + tc.variables["LWS_LIBMOUNT_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["libmount"].cpp_info.includedirs) + + tc.variables["LWS_WITH_HUBBUB"] = self.options.with_hubbub + + tc.variables["LWS_SSL_CLIENT_USE_OS_CA_CERTS"] = self.options.ssl_client_use_os_ca_certs + tc.variables["LWS_SSL_SERVER_WITH_ECDH_CERT"] = self.options.ssl_server_with_ecdh_cert + + tc.variables["LWS_WITH_NETWORK"] = self.options.enable_network + tc.variables["LWS_ROLE_H1"] = self.options.role_h1 + tc.variables["LWS_ROLE_WS"] = self.options.role_ws + tc.variables["LWS_ROLE_MQTT"] = self.options.role_mqtt + tc.variables["LWS_ROLE_DBUS"] = self.options.role_dbus + tc.variables["LWS_ROLE_RAW_PROXY"] = self.options.role_raw_proxy + tc.variables["LWS_ROLE_RAW_FILE"] = self.options.role_raw_file + tc.variables["LWS_WITH_HTTP2"] = self.options.enable_http2 + tc.variables["LWS_WITH_LWSWS"] = self.options.enable_lwsws + tc.variables["LWS_WITH_CGI"] = self.options.enable_cgi + tc.variables["LWS_IPV6"] = self.options.enable_ipv6 + tc.variables["LWS_UNIX_SOCK"] = self.options.enable_unix_sock + tc.variables["LWS_WITH_PLUGINS"] = self.options.enable_plugins + tc.variables["LWS_WITH_HTTP_PROXY"] = self.options.enable_http_proxy + tc.variables["LWS_WITH_ZIP_FOPS"] = self.options.enable_zip_fops + tc.variables["LWS_WITH_SOCKS5"] = self.options.enable_socks5 + tc.variables["LWS_WITH_GENERIC_SESSIONS"] = self.options.enable_generic_sessions + tc.variables["LWS_WITH_PEER_LIMITS"] = self.options.enable_peer_limits + tc.variables["LWS_WITH_ACCESS_LOG"] = self.options.enable_access_log + tc.variables["LWS_WITH_RANGES"] = self.options.enable_ranges + tc.variables["LWS_WITH_SERVER_STATUS"] = self.options.enable_server_status + tc.variables["LWS_WITH_THREADPOOL"] = self.options.enable_threadpool + tc.variables["LWS_WITH_HTTP_STREAM_COMPRESSION"] = self.options.enable_http_stream_compression + tc.variables["LWS_WITH_HTTP_BROTLI"] = self.options.enable_http_brotli + tc.variables["LWS_WITH_ACME"] = self.options.enable_acme + tc.variables["LWS_WITH_FTS"] = self.options.enable_fts + tc.variables["LWS_WITH_SYS_ASYNC_DNS"] = self.options.enable_sys_async_dns + tc.variables["LWS_WITH_SYS_NTPCLIENT"] = self.options.enable_sys_ntpclient + tc.variables["LWS_WITH_SYS_DHCP_CLIENT"] = self.options.enable_sys_dhcp_client + tc.variables["LWS_WITH_HTTP_BASIC_AUTH"] = self.options.enable_http_basic_auth + tc.variables["LWS_WITH_HTTP_UNCOMMON_HEADERS"] = self.options.enable_http_uncommon_headers + + tc.variables["LWS_WITHOUT_EXTENSIONS"] = not self.options.enable_extensions + tc.variables["LWS_WITHOUT_BUILTIN_GETIFADDRS"] = not self.options.enable_builtin_getifaddrs + tc.variables["LWS_FALLBACK_GETHOSTBYNAME"] = self.options.enable_fallback_gethostbyname + tc.variables["LWS_WITHOUT_BUILTIN_SHA1"] = not self.options.enable_builtin_sha1 + tc.variables["LWS_WITHOUT_DAEMONIZE"] = not self.options.enable_daemonize + tc.variables["LWS_WITH_LEJP"] = self.options.enable_lejp + tc.variables["LWS_WITH_STRUCT_JSON"] = self.options.enable_struct_json + tc.variables["LWS_WITH_STRUCT_SQLITE3"] = self.options.enable_struct_sqlite3 + + tc.variables["LWS_WITH_NO_LOGS"] = self.options.disable_logs + tc.variables["LWS_LOGS_TIMESTAMP"] = self.options.logs_timestamp + tc.variables["LWS_AVOID_SIGPIPE_IGN"] = self.options.avoid_sigpipe_ign + tc.variables["LWS_WITH_STATS"] = self.options.enable_stats + tc.variables["LWS_WITH_JOSE"] = self.options.enable_jose + tc.variables["LWS_WITH_GENCRYPTO"] = self.options.enable_gencrypto + tc.variables["LWS_WITH_SELFTESTS"] = self.options.enable_selftests + tc.variables["LWS_WITH_GCOV"] = self.options.enable_gcov + tc.variables["LWS_WITH_LWSAC"] = self.options.enable_lwsac + tc.variables["LWS_WITH_CUSTOM_HEADERS"] = self.options.enable_custom_headers + tc.variables["LWS_WITH_DISKCACHE"] = self.options.enable_diskcache + tc.variables["LWS_WITH_DIR"] = self.options.enable_dir + tc.variables["LWS_WITH_LEJP_CONF"] = self.options.enable_lejp_conf + tc.variables["LWS_WITH_DEPRECATED_LWS_DLL"] = self.options.enable_deprecated_lws_dll + tc.variables["LWS_WITH_SEQUENCER"] = self.options.enable_sequencer + tc.variables["LWS_WITH_EXTERNAL_POLL"] = self.options.enable_external_poll + tc.variables["LWS_WITH_LWS_DSH"] = self.options.enable_lws_dsh + tc.variables["LWS_CLIENT_HTTP_PROXYING"] = self.options.enable_external_http_proxying + tc.variables["LWS_WITH_FILE_OPS"] = self.options.enable_file_ops + tc.variables["LWS_WITH_DETAILED_LATENCY"] = self.options.enable_detailed_latency + tc.variables["LWS_WITH_UDP"] = self.options.enable_udp + tc.variables["LWS_WITH_SPAWN"] = self.options.enable_spawn + + tc.variables["LWS_WITH_ALSA"] = False + tc.variables["LWS_WITH_GTK"] = False + + if Version(self.version) >= "4.1.0": + tc.variables["LWS_WITH_SYS_SMD"] = self.settings.os != "Windows" + tc.variables["DISABLE_WERROR"] = True + + tc.generate() + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") - tools.replace_in_file( + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "SET(CMAKE_INSTALL_NAME_DIR \"${CMAKE_INSTALL_PREFIX}/${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}\")", "", ) - if tools.Version(self.version) == "4.0.15" and self.options.with_ssl: - tools.replace_in_file( + if Version(self.version) == "4.0.15" and self.options.with_ssl: + 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)" ) - if tools.Version(self.version) < "4.1.0": - tools.replace_in_file(cmakelists, "-Werror", "") - if tools.Version(self.version) >= "4.1.4": - tools.replace_in_file(cmakelists, "add_compile_options(/W3 /WX)", "add_compile_options(/W3)") + if Version(self.version) < "4.1.0": + replace_in_file(self, cmakelists, "-Werror", "") + if Version(self.version) >= "4.1.4": + replace_in_file(self, cmakelists, "add_compile_options(/W3 /WX)", "add_compile_options(/W3)") def build(self): self._patch_sources() - 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, "share")) - tools.rmdir(os.path.join(self.package_folder, "cmake")) - 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, "share")) + 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")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -476,8 +464,7 @@ def package(self): {self._cmake_target: "Libwebsockets::{}".format(self._cmake_target)} ) - @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("""\ @@ -486,7 +473,7 @@ def _create_cmake_module_alias_targets(module_file, targets): 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): @@ -502,7 +489,7 @@ def package_info(self): pkgconfig_name = "libwebsockets" if self.options.shared else "libwebsockets_static" self.cpp_info.set_property("pkg_config_name", pkgconfig_name) # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["_libwebsockets"].libs = tools.collect_libs(self) + self.cpp_info.components["_libwebsockets"].libs = collect_libs(self) if self.settings.os == "Windows": self.cpp_info.components["_libwebsockets"].system_libs.extend(["ws2_32", "crypt32"]) elif self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/libwebsockets/all/test_package/CMakeLists.txt b/recipes/libwebsockets/all/test_package/CMakeLists.txt index 7ca319a6f6da7..6aa87cfd3d013 100644 --- a/recipes/libwebsockets/all/test_package/CMakeLists.txt +++ b/recipes/libwebsockets/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(Libwebsockets REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/libwebsockets/all/test_package/conanfile.py b/recipes/libwebsockets/all/test_package/conanfile.py index 9b63bd176646b..bff3c734cea93 100644 --- a/recipes/libwebsockets/all/test_package/conanfile.py +++ b/recipes/libwebsockets/all/test_package/conanfile.py @@ -1,10 +1,24 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout import os 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.generate() def build(self): cmake = CMake(self) @@ -12,5 +26,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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libwebsockets/config.yml b/recipes/libwebsockets/config.yml index 76fbd6a7ba025..f20bf16edc50b 100644 --- a/recipes/libwebsockets/config.yml +++ b/recipes/libwebsockets/config.yml @@ -1,4 +1,6 @@ versions: + "4.3.3": + folder: all "4.3.2": folder: all "4.3.0": diff --git a/recipes/libx264/all/conanfile.py b/recipes/libx264/all/conanfile.py index d1bf4936ed733..3312e7972a7a4 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 4938bb3011950..677f51dce82b0 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 df7c72ca12c22..fb3a279cbaa17 100644 --- a/recipes/libxcrypt/all/conandata.yml +++ b/recipes/libxcrypt/all/conandata.yml @@ -1,4 +1,13 @@ 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" + "4.4.34": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.34.tar.gz" + sha256: "8888bbe9f8530bbd9f8063d65288018d419f91e9b3e3349abb8cb4d0a0397cc5" "4.4.28": url: "https://github.com/besser82/libxcrypt/archive/v4.4.28.tar.gz" sha256: "db7e37901969cb1d1e8020cb73a991ef81e48e31ea5b76a101862c806426b457" diff --git a/recipes/libxcrypt/all/conanfile.py b/recipes/libxcrypt/all/conanfile.py index 7f1e95bcfd907..9535c01222b44 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 5f226d94e67a1..e6406af656d46 100644 --- a/recipes/libxcrypt/config.yml +++ b/recipes/libxcrypt/config.yml @@ -1,4 +1,10 @@ versions: + "4.4.36": + folder: all + "4.4.35": + folder: all + "4.4.34": + folder: all "4.4.28": folder: all "4.4.27": diff --git a/recipes/libxft/all/conandata.yml b/recipes/libxft/all/conandata.yml index e56e888b5fdb6..83115b8c226aa 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 c237fe2cfea9c..fdb9b1a6c8663 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 e55ad61e844f5..71362aacc231a 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 49a3a66ea5bad..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 6caf25620b5dc..d3f36d4632aef 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 0d8e6136fd0e5..1c65ddbb9e247 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 1056eab90fe20..680c5c30397da 100644 --- a/recipes/libxml2/all/conandata.yml +++ b/recipes/libxml2/all/conandata.yml @@ -1,10 +1,19 @@ sources: + "2.12.3": + url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.3.tar.xz" + sha256: "8c8f1092340a89ff32bc44ad5c9693aff9bc8a7a3e161bb239666e5d15ac9aaa" + "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.6": + url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.6.tar.xz" + sha256: "c90eee7506764abbe07bb616b82da452529609815aefef423d66ef080eb0c300" "2.11.4": url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.4.tar.xz" sha256: "737e1d7f8ab3f139729ca13a2494fd17bf30ddb4b7a427cf336252cab57f57f7" - "2.11.3": - url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.3.tar.xz" - sha256: "f1acae1664bda006cd81bfc238238217043d586d06659d5c0e3d1bcebe040870" "2.10.4": url: "https://download.gnome.org/sources/libxml2/2.10/libxml2-2.10.4.tar.xz" sha256: "ed0c91c5845008f1936739e4eee2035531c1c94742c6541f44ee66d885948d45" @@ -23,6 +32,3 @@ sources: "2.9.10": url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.10.tar.xz" sha256: "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813" - "2.9.9": - url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.9.tar.xz" - sha256: "58a5c05a2951f8b47656b676ce1017921a29f6b1419c45e3baed0d6435ba03f5" diff --git a/recipes/libxml2/all/conanfile.py b/recipes/libxml2/all/conanfile.py index becdc73f93c9c..ec0a90e4ddd03 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.5") 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.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/libxml2/all/test_package/test_package.c b/recipes/libxml2/all/test_package/test_package.c index b4b977f00d342..01dc455ced597 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 a49601ef686b5..fa0445d49d104 100644 --- a/recipes/libxml2/config.yml +++ b/recipes/libxml2/config.yml @@ -1,7 +1,13 @@ versions: - "2.11.4": + "2.12.3": + folder: all + "2.12.2": + folder: all + "2.12.1": folder: all - "2.11.3": + "2.11.6": + folder: all + "2.11.4": folder: all "2.10.4": folder: all @@ -15,5 +21,3 @@ versions: folder: all "2.9.10": folder: all - "2.9.9": - folder: all diff --git a/recipes/libxmlpp/2.x.x/conandata.yml b/recipes/libxmlpp/2.x.x/conandata.yml deleted file mode 100644 index c28f5a99de926..0000000000000 --- 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 1297a686c1b40..0000000000000 --- 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 acd4c1ac2441b..0000000000000 --- 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 8aaecaac427e8..0000000000000 --- 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 0000000000000..70b3ca66d954f --- /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 0000000000000..4a4582e3b0921 --- /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.12.3") + 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.3.1") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") + + 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 0000000000000..1359f7eb0c90c --- /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 0000000000000..082b48301a3b9 --- /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 0000000000000..5110568f15e67 --- /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 4976ee096e564..884c9a00e9000 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 77475adeda3d9..681dd5c613eec 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 63d51162a71f7..0312deadc10a9 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 0ea6d5bc37b28..1f28dfc6ff753 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 a8c92dea63335..ef5d7042163ec 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 ed1efad8c383c..925df166533ce 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 0000000000000..91630d79f4abb --- /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 0000000000000..a8c92dea63335 --- /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 abd496668a102..486b79c2c29b4 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 b08d77d4e4328..c48db83ea9231 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 19e6a0c06e3d8..ef5d7042163ec 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 2dc0779250663..6b5dd2b42332c 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 8795d460be899..c4c2c71816465 100644 --- a/recipes/libxslt/all/conandata.yml +++ b/recipes/libxslt/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.1.39": + sha256: "2a20ad621148339b0759c4d4e96719362dee64c9a096dbba625ba053846349f0" + url: "https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.39.tar.xz" + "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 35861075ebb78..711c11f5938b0 100644 --- a/recipes/libxslt/all/conanfile.py +++ b/recipes/libxslt/all/conanfile.py @@ -7,6 +7,7 @@ from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, NMakeDeps, NMakeToolchain +from conan.tools.scm import Version import os required_conan_version = ">=1.55.0" @@ -59,8 +60,11 @@ def layout(self): basic_layout(self, src_folder="src") 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) + if Version(self.version) >= "1.1.39": + # see https://github.com/conan-io/conan-center-index/pull/16205#discussion_r1149570846 + self.requires("libxml2/2.12.3", transitive_headers=True, transitive_libs=True) + else: + self.requires("libxml2/2.11.6", transitive_headers=True, transitive_libs=True) def validate(self): if self.options.plugins and not self.options.shared: @@ -190,6 +194,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 9aafb604e965b..d65db35f37aec 100644 --- a/recipes/libxslt/config.yml +++ b/recipes/libxslt/config.yml @@ -1,3 +1,7 @@ versions: + "1.1.39": + folder: all + "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 e839599c0c5fc..3b9b5764537d0 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 5e5b8c258b2f3..4d851737efc1b 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 0000000000000..b44803ec7ecf3 --- /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 c1f0cfd37130f..fe46d8f150b2c 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/libzen/all/conandata.yml b/recipes/libzen/all/conandata.yml index c0b761db1ccf7..13b7a5a289581 100644 --- a/recipes/libzen/all/conandata.yml +++ b/recipes/libzen/all/conandata.yml @@ -1,8 +1,12 @@ sources: + "0.4.41": + url: "https://mediaarea.net/download/source/libzen/0.4.41/libzen_0.4.41.tar.bz2" + sha256: "eb237d7d3dca6dc6ba068719420a27de0934a783ccaeb2867562b35af3901e2d" "0.4.38": url: "https://mediaarea.net/download/source/libzen/0.4.38/libzen_0.4.38.tar.bz2" sha256: "594e07bb4a0472cd9da258b3c4e050e9a37a39cccd85e3d8b5bf597d027b7eda" patches: + "0.4.41": + - patch_file: "patches/0002-export-data-in-windows-dlls.patch" "0.4.38": - - patch_file: "patches/0001-enable-WIN32-shared-libraries.patch" - patch_file: "patches/0002-export-data-in-windows-dlls.patch" diff --git a/recipes/libzen/all/conanfile.py b/recipes/libzen/all/conanfile.py index c2222bfee137d..76f22e86e9164 100644 --- a/recipes/libzen/all/conanfile.py +++ b/recipes/libzen/all/conanfile.py @@ -1,7 +1,7 @@ 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 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 import os import textwrap @@ -57,8 +57,14 @@ def generate(self): tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + # Enable WIN32 shared libraries + replace_in_file(self, os.path.join(self.source_folder, "Project", "CMake", "CMakeLists.txt"), + "set(BUILD_SHARED_LIBS OFF)", "") + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, "Project", "CMake")) cmake.build() diff --git a/recipes/libzen/all/patches/0001-enable-WIN32-shared-libraries.patch b/recipes/libzen/all/patches/0001-enable-WIN32-shared-libraries.patch deleted file mode 100644 index f40a66c0fca2f..0000000000000 --- a/recipes/libzen/all/patches/0001-enable-WIN32-shared-libraries.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Project/CMake/CMakeLists.txt -+++ Project/CMake/CMakeLists.txt -@@ -7,7 +7,7 @@ - set(ZenLib_PATCH_VERSION 38) - set(ZenLib_VERSION ${ZenLib_MAJOR_VERSION}.${ZenLib_MINOR_VERSION}.${ZenLib_PATCH_VERSION}) - --if(WIN32) -+if(0) - set(BUILD_SHARED_LIBS OFF) - else() - option(BUILD_SHARED_LIBS "Build shared libs" ON) diff --git a/recipes/libzen/all/patches/0002-export-data-in-windows-dlls.patch b/recipes/libzen/all/patches/0002-export-data-in-windows-dlls.patch index 17b22fd745f02..75e09bd7ab6b7 100644 --- a/recipes/libzen/all/patches/0002-export-data-in-windows-dlls.patch +++ b/recipes/libzen/all/patches/0002-export-data-in-windows-dlls.patch @@ -1,18 +1,3 @@ ---- Source/ZenLib/Conf.cpp -+++ Source/ZenLib/Conf.cpp -@@ -24,8 +24,8 @@ - - //End of line - #ifdef WINDOWS -- const Char* EOL=__T("\r\n"); -- const Char PathSeparator=__T('\\'); -+ ZEN_IMPEXP const Char* EOL=__T("\r\n"); -+ ZEN_IMPEXP const Char PathSeparator=__T('\\'); - #endif - #ifdef UNIX - const Char* EOL=__T("\n"); -diff --git a/source_subfolder/Source/ZenLib/Conf.h b/source_subfolder/Source/ZenLib/Conf.h -index 18264cf..d989fdb 100644 --- Source/ZenLib/Conf.h +++ Source/ZenLib/Conf.h @@ -234,9 +234,22 @@ diff --git a/recipes/libzen/config.yml b/recipes/libzen/config.yml index 49eb7f8b8da5a..ced5a558f9a53 100644 --- a/recipes/libzen/config.yml +++ b/recipes/libzen/config.yml @@ -1,3 +1,5 @@ versions: + "0.4.41": + folder: "all" "0.4.38": folder: "all" diff --git a/recipes/libzip/all/conandata.yml b/recipes/libzip/all/conandata.yml index 567f243d79a98..0dcb786c62874 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 466b104bf29b9..ef4f7c2c57579 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 0000000000000..6385883376739 --- /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 0000000000000..2682986aa602f --- /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 0000000000000..511a8497170f9 --- /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 0000000000000..d3a2faebb601a --- /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 0000000000000..24aeef7d82680 --- /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 0000000000000..bbc20c6fe9ebe --- /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 63ddbcf63ff11..614d36cf38cf3 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 f31401deb346d..20f731c93139a 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 e0c0670ea25f1..b6ec87350a23e 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 4ba054a3032a9..ce3931e22d5f5 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/lief/all/conandata.yml b/recipes/lief/all/conandata.yml index 322361c8a5bce..957438b147a11 100644 --- a/recipes/lief/all/conandata.yml +++ b/recipes/lief/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.13.1": + url: "https://github.com/lief-project/LIEF/archive/0.13.1.tar.gz" + sha256: "a3a846e9b6ce2acf89ef4687e870f41ca703f18fee3e7f501ebb05ee1aeb1847" + "0.13.0": + url: "https://github.com/lief-project/LIEF/archive/0.13.0.tar.gz" + sha256: "8834e2ccfeefd1003527887357950173fe55e9a712004aa638af67378e28ef55" "0.12.3": url: "https://github.com/lief-project/LIEF/archive/0.12.3.tar.gz" sha256: "762925ad2eed642a6e7ef2cc899bcd3e93a40a2ce1dd2391d9b9ecadfe6438cf" @@ -9,6 +15,14 @@ sources: url: "https://github.com/lief-project/LIEF/archive/0.10.1.tar.gz" sha256: "6f30c98a559f137e08b25bcbb376c0259914b33c307b8b901e01ca952241d00a" patches: + "0.13.1": + - patch_file: "patches/0.13.0-001_link_to_conan.patch" + patch_description: "find conan package and link these" + patch_type: "conan" + "0.13.0": + - patch_file: "patches/0.13.0-001_link_to_conan.patch" + patch_description: "find conan package and link these" + patch_type: "conan" "0.12.3": - patch_file: "patches/0.12.3-001_link_to_conan.patch" patch_description: "find conan package and link these" diff --git a/recipes/lief/all/conanfile.py b/recipes/lief/all/conanfile.py index 06891925739de..7a69bb5dfa4c4 100644 --- a/recipes/lief/all/conanfile.py +++ b/recipes/lief/all/conanfile.py @@ -50,7 +50,19 @@ class LiefConan(ConanFile): @property def _min_cppstd(self): - return "11" + return "14" if self.options.with_frozen 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, {}) def export_sources(self): export_conandata_patches(self) @@ -84,6 +96,11 @@ def requirements(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." + ) if self.options.shared and is_msvc(self) and not check_min_vs(self, "191", raise_invalid=False): raise ConanInvalidConfiguration(f"{self.ref} does not support Visual Studio < 15 with shared:True") @@ -120,6 +137,10 @@ def generate(self): tc.variables["LIEF_EXTERNAL_SPDLOG"] = True tc.variables["LIEF_OPT_EXTERNAL_LEAF"] = True tc.variables["LIEF_OPT_EXTERNAL_SPAN"] = True + if Version(self.version) >= "0.13.0": + tc.variables["LIEF_INSTALL"] = True + tc.variables["LIEF_EXTERNAL_SPAN_DIR"] = self.dependencies["tcb-span"].cpp_info.includedirs[0].replace("\\", "/") + tc.variables["LIEF_EXTERNAL_LEAF_DIR"] = self.dependencies["boost"].cpp_info.includedirs[0].replace("\\", "/") tc.generate() deps = CMakeDeps(self) diff --git a/recipes/lief/all/patches/0.13.0-001_link_to_conan.patch b/recipes/lief/all/patches/0.13.0-001_link_to_conan.patch new file mode 100644 index 0000000000000..a5a1b2657ba0d --- /dev/null +++ b/recipes/lief/all/patches/0.13.0-001_link_to_conan.patch @@ -0,0 +1,56 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 774c479..5aec5cb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -99,8 +99,12 @@ endif() + + # Dependencies + # ============ +-set(THIRD_PARTY_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/third-party/") + include(LIEFDependencies) ++set(LIEF_FROZEN_ENABLED 0) ++if (LIEF_SUPPORT_CXX14 AND NOT LIEF_DISABLE_FROZEN) ++ message(STATUS "Enable Frozen (C++14 support)") ++ set(LIEF_FROZEN_ENABLED 1) ++endif() + + # iOS specific config + # =================== +@@ -479,8 +483,7 @@ endif() + # cmake-format: off + set_target_properties( + LIB_LIEF +- PROPERTIES POSITION_INDEPENDENT_CODE ON +- CXX_STANDARD 11 ++ PROPERTIES CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + CXX_VISIBILITY_PRESET hidden + C_VISIBILITY_PRESET hidden) +@@ -682,9 +685,9 @@ if (LIEF_INSTALL) + + # Installation + # ====================== +- ++ include(GNUInstallDirs) ++ if(0) + if(UNIX) +- include(GNUInstallDirs) + set(CMAKE_INSTALL_LIBDIR "lib") + else() + if(WIN32) +@@ -698,13 +701,14 @@ if (LIEF_INSTALL) + message(FATAL_ERROR "System not UNIX nor WIN32 - not implemented yet") + endif() + endif() ++ endif() + + install( + TARGETS LIB_LIEF lief_spdlog + EXPORT LIEFExport + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + install( diff --git a/recipes/lief/config.yml b/recipes/lief/config.yml index f24eac175f18c..8c2e3de0a3a96 100644 --- a/recipes/lief/config.yml +++ b/recipes/lief/config.yml @@ -1,4 +1,8 @@ versions: + "0.13.1": + folder: "all" + "0.13.0": + folder: "all" "0.12.3": folder: "all" "0.12.2": diff --git a/recipes/lightgbm/all/CMakeLists.txt b/recipes/lightgbm/all/CMakeLists.txt index 61f3d3b039e2b..d250cd86d5991 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 2fac2e54523aa..53438b1b2b9ba 100644 --- a/recipes/lightgbm/all/conandata.yml +++ b/recipes/lightgbm/all/conandata.yml @@ -1,18 +1,26 @@ sources: - "3.3.2": - url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v3.3.2.tar.gz" - sha256: "d7c0f842e94165578d5a0c046ca942838d1574149f98c84400ce511239d17b9f" + "4.2.0": + url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v4.2.0.tar.gz" + sha256: "4b2df6e3c5fa345a2fac6cefff65dd08cbe2fa4717cd8335c2a58c1a0c7c6b02" + "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 d00e21c352364..cae89a9218102 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 13fa0fe43a998..0000000000000 --- 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 0000000000000..4de5b0a2d1c8e --- /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 12b8a397ff5d3..1fc3dbaef1eaa 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 746d011e4501a..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..746d011e4501a --- /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 185a3ba9f96e0..5160a2bc07bab 100644 --- a/recipes/lightgbm/config.yml +++ b/recipes/lightgbm/config.yml @@ -1,5 +1,9 @@ versions: - "3.3.2": + "4.2.0": + folder: all + "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 5cfb924ad4de7..0000000000000 --- 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 ea6e74e5ca99f..3625228ec2534 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 8927c32d3f4ef..f7eaac4f3f950 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 3da371b660e0a..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 72dbc48e507a8..aeda5df97ec0f 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 ecc5fdb03690f..5ce5b2106b7c8 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 32a14abb318da..5b72ec11402d0 100644 --- a/recipes/linux-headers-generic/all/conanfile.py +++ b/recipes/linux-headers-generic/all/conanfile.py @@ -1,43 +1,62 @@ -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.files import chdir, copy, get +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class LinuxHeadersGenericConan(ConanFile): name = "linux-headers-generic" + description = "Generic Linux kernel headers" + license = "GPL-2.0-only" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.kernel.org/" - license = "GPL-2.0-only" - description = "Generic Linux kernel headers" - topics = ("linux", "headers", "generic") - settings = "os", "arch", "build_type", "compiler" + topics = ("linux", "headers", "generic", "header-only") - @property - def _source_subfolder(self): - return "source_subfolder" + 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): del self.info.settings.os 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 tools.cross_building(self): - raise ConanInvalidConfiguration("linux-headers-generic can not be cross-compiled") 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): - with tools.chdir(os.path.join(self._source_subfolder)): - autotools = AutoToolsBuildEnvironment(self) + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.make(target="headers") def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("include/*.h", src=os.path.join(self._source_subfolder, "usr")) + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "include/*.h", + dst=self.package_folder, + src=os.path.join(self.source_folder, "usr")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/linux-headers-generic/all/test_package/CMakeLists.txt b/recipes/linux-headers-generic/all/test_package/CMakeLists.txt index 34af13462f44f..486ec186a2730 100644 --- a/recipes/linux-headers-generic/all/test_package/CMakeLists.txt +++ b/recipes/linux-headers-generic/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(linux-headers-generic REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE linux-headers-generic::linux-headers-generic) diff --git a/recipes/linux-headers-generic/all/test_package/conanfile.py b/recipes/linux-headers-generic/all/test_package/conanfile.py index 92074169bcc74..fae501d0afb9e 100644 --- a/recipes/linux-headers-generic/all/test_package/conanfile.py +++ b/recipes/linux-headers-generic/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 -required_conan_version = ">=1.33.0" class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + 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 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/linux-headers-generic/config.yml b/recipes/linux-headers-generic/config.yml index a8d9d5e7bbfa8..461cdf02e1d8f 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/linux-syscall-support/all/conandata.yml b/recipes/linux-syscall-support/all/conandata.yml index e2cbe519dc5b7..ca4a399974573 100644 --- a/recipes/linux-syscall-support/all/conandata.yml +++ b/recipes/linux-syscall-support/all/conandata.yml @@ -1,3 +1,5 @@ sources: + "2022.10.12": + url: "https://chromium.googlesource.com/linux-syscall-support/+archive/refs/tags/v2022.10.12.tar.gz" "cci.20200813": url: "https://chromium.googlesource.com/linux-syscall-support/+archive/29f7c7e018f4ce706a709f0b0afbf8bacf869480.tar.gz" diff --git a/recipes/linux-syscall-support/config.yml b/recipes/linux-syscall-support/config.yml index 701f50987ccf0..13c1a01d76262 100644 --- a/recipes/linux-syscall-support/config.yml +++ b/recipes/linux-syscall-support/config.yml @@ -1,3 +1,5 @@ versions: + "2022.10.12": + folder: all "cci.20200813": folder: all diff --git a/recipes/litehtml/all/conandata.yml b/recipes/litehtml/all/conandata.yml index db5e01516c1d0..e50621e5200ff 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 c3158edb62025..e5ccd7b936201 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 cce35fe42eaa9..a9b9bff01672e 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 6a05e08e87321..d45793cdd8277 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/lksctp-tools/all/conandata.yml b/recipes/lksctp-tools/all/conandata.yml new file mode 100644 index 0000000000000..d3fd074d21dd3 --- /dev/null +++ b/recipes/lksctp-tools/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.19": + url: "https://github.com/sctp/lksctp-tools/archive/refs/tags/v1.0.19.tar.gz" + sha256: "9251b1368472fb55aaeafe4787131bdde4e96758f6170620bc75b638449cef01" diff --git a/recipes/lksctp-tools/all/conanfile.py b/recipes/lksctp-tools/all/conanfile.py new file mode 100644 index 0000000000000..c114e01dc9df2 --- /dev/null +++ b/recipes/lksctp-tools/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, chdir, copy, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class LKSCTPToolsConan(ConanFile): + name = "lksctp-tools" + settings = "os", "arch", "compiler", "build_type" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sctp/lksctp-tools" + description = "The Linux Kernel Stream Control Transmission Protocol (lksctp) project" + package_type = "library" + topics = ("sctp") + license = ("GPL-2.0", "LGPL-2.1") + + 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 validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is only available on Linux") + + 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): + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-tests", + ]) + tc.generate() + + def build(self): + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + with chdir(self, self.source_folder): + autools = Autotools(self) + autools.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, "lib", "lksctp-tools")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.libs = ["sctp"] diff --git a/recipes/lksctp-tools/all/test_package/CMakeLists.txt b/recipes/lksctp-tools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..964f83ff15d38 --- /dev/null +++ b/recipes/lksctp-tools/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(lksctp-tools REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} lksctp-tools::lksctp-tools) diff --git a/recipes/lksctp-tools/all/test_package/conanfile.py b/recipes/lksctp-tools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/lksctp-tools/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/lksctp-tools/all/test_package/test_package.c b/recipes/lksctp-tools/all/test_package/test_package.c new file mode 100644 index 0000000000000..3a004853d676d --- /dev/null +++ b/recipes/lksctp-tools/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include +#include + +int main() { + int sockfd; + + sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); + close(sockfd); + + return 0; +} diff --git a/recipes/lksctp-tools/config.yml b/recipes/lksctp-tools/config.yml new file mode 100644 index 0000000000000..682394be2990b --- /dev/null +++ b/recipes/lksctp-tools/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.19": + folder: all diff --git a/recipes/llhttp/all/CMakeLists.txt b/recipes/llhttp/all/CMakeLists.txt deleted file mode 100644 index 881b1cb39250b..0000000000000 --- a/recipes/llhttp/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/llhttp/all/conandata.yml b/recipes/llhttp/all/conandata.yml index c2671d44c5a50..20fe56b5f368c 100644 --- a/recipes/llhttp/all/conandata.yml +++ b/recipes/llhttp/all/conandata.yml @@ -1,8 +1,17 @@ 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.0.6": 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": - patch_file: "patches/cmake_install_dirs.patch" - base_path: "source_subfolder" diff --git a/recipes/llhttp/all/conanfile.py b/recipes/llhttp/all/conanfile.py index df6177221446b..8b1f11d122f18 100644 --- a/recipes/llhttp/all/conanfile.py +++ b/recipes/llhttp/all/conanfile.py @@ -1,19 +1,20 @@ -from conans import ConanFile, tools, CMake -from conan.tools.files import patch +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 import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class LlhttpParserConan(ConanFile): name = "llhttp" - description = "http request/response parser for c " + description = "http request/response parser for c" topics = ("http", "parser") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nodejs/llhttp" - license = ("MIT",) - generators = ("cmake",) - settings = "os", "compiler", "build_type", "arch" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,17 +23,9 @@ class LlhttpParserConan(ConanFile): "shared": False, "fPIC": True, } - exports_sources = "CMakeLists.txt", "patches/*" - _cmake = None - - @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): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -40,48 +33,37 @@ 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 _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + 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) + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if not self.options.shared: + tc.variables["BUILD_STATIC_LIBS"] = True + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy( - "LICENSE-MIT", - src=os.path.join(self.source_folder, self._source_subfolder), - dst="licenses", - ) - cmake = self._configure_cmake() + copy(self, "LICENSE-MIT", 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): self.cpp_info.set_property("cmake_file_name", "llhttp") self.cpp_info.set_property("cmake_target_name", "llhttp::llhttp") self.cpp_info.set_property("pkg_config_name", "libllhttp") self.cpp_info.libs = ["llhttp"] - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "llhttp" - self.cpp_info.names["cmake_find_package_multi"] = "llhttp" - self.cpp_info.names["pkg_config"] = "libllhttp" diff --git a/recipes/llhttp/all/patches/cmake_remove_pcfiles.patch b/recipes/llhttp/all/patches/cmake_remove_pcfiles.patch new file mode 100644 index 0000000000000..f6cab456c7e6f --- /dev/null +++ b/recipes/llhttp/all/patches/cmake_remove_pcfiles.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt.new +@@ -62,14 +62,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/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 0000000000000..7d7c1649ff686 --- /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/all/test_package/CMakeLists.txt b/recipes/llhttp/all/test_package/CMakeLists.txt index e55d928fc7b95..100d91bba1f4c 100644 --- a/recipes/llhttp/all/test_package/CMakeLists.txt +++ b/recipes/llhttp/all/test_package/CMakeLists.txt @@ -1,11 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(llhttp REQUIRED CONFIG) - add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} llhttp::llhttp) +target_link_libraries(${PROJECT_NAME} PRIVATE llhttp::llhttp) diff --git a/recipes/llhttp/all/test_package/conanfile.py b/recipes/llhttp/all/test_package/conanfile.py index 49a3a66ea5bad..0a6bc68712d90 100644 --- a/recipes/llhttp/all/test_package/conanfile.py +++ b/recipes/llhttp/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 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/llhttp/all/test_v1_package/CMakeLists.txt b/recipes/llhttp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/llhttp/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/llhttp/all/test_v1_package/conanfile.py b/recipes/llhttp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/llhttp/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/llhttp/config.yml b/recipes/llhttp/config.yml index 158212133c56d..bd0d914a57968 100644 --- a/recipes/llhttp/config.yml +++ b/recipes/llhttp/config.yml @@ -1,3 +1,7 @@ versions: + "9.1.3": + folder: all + "8.1.0": + folder: all "6.0.6": folder: all diff --git a/recipes/llvm-openmp/all/CMakeLists.txt b/recipes/llvm-openmp/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- 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 499e8f40e5c34..cb5f1104f3fc9 100644 --- a/recipes/llvm-openmp/all/conandata.yml +++ b/recipes/llvm-openmp/all/conandata.yml @@ -1,4 +1,38 @@ sources: + "17.0.6": + openmp: + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/openmp-17.0.6.src.tar.xz" + sha256: "74334cbb4dc8b73a768448a7561d5a3540404940b2267b1fb9813a6464b320de" + cmake: + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/cmake-17.0.6.src.tar.xz" + sha256: "807f069c54dc20cb47b21c1f6acafdd9c649f3ae015609040d6182cab01140f4" + "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 +49,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 4f1ee354a647e..a885645ea3471 100644 --- a/recipes/llvm-openmp/all/conanfile.py +++ b/recipes/llvm-openmp/all/conanfile.py @@ -1,10 +1,17 @@ -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.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class LLVMOpenMpConan(ConanFile): @@ -16,126 +23,177 @@ 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)." + ) + } @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + + @property + def _version_major(self): + return Version(self.version).major def export_sources(self): - 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 is_msvc(self): + raise ConanInvalidConfiguration("llvm-openmp is not compatible with MSVC") + if self.settings.compiler not in ["apple-clang", "clang", "gcc", "intel-cc"]: + raise ConanInvalidConfiguration( + f"{self.settings.compiler} is not supported by this recipe. Contributions are welcome!" + ) + 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 2266bee5e1d73..0000000000000 --- 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 09c16d7b0bef6..0000000000000 --- 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 910ab03dc90e1..0000000000000 --- 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 a1716382cf4d8..0000000000000 --- 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 cd1c4ba9b8096..0000000000000 --- 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 0000000000000..65692e0ed9c15 --- /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 0000000000000..dde4403117078 --- /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 0000000000000..f455aa8e37168 --- /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 0000000000000..d319a4099d212 --- /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 0000000000000..464d6918a7551 --- /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 0000000000000..0a0b868b908cb --- /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 0000000000000..5c9f08ac35cca --- /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 0000000000000..afda1c6a0da19 --- /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 0000000000000..3215d61a23b9f --- /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 2d9a8574cc4d4..491aa7ec1f5d3 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 5ac3af772bdc0..b9c17185d658e 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 0000000000000..103d724f00fcd --- /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 f6316471238aa..b602ec5a096c9 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 0000000000000..91630d79f4abb --- /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 0000000000000..b6e98e149af12 --- /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 5f6a2e2df9402..2f6f02e2e7d3f 100644 --- a/recipes/llvm-openmp/config.yml +++ b/recipes/llvm-openmp/config.yml @@ -1,4 +1,16 @@ versions: + "17.0.6": + folder: all + "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/lmdb/all/conandata.yml b/recipes/lmdb/all/conandata.yml index 924b591216793..34b1aee159c75 100644 --- a/recipes/lmdb/all/conandata.yml +++ b/recipes/lmdb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.31": + url: "https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.31/openldap-LMDB_0.9.31.tar.gz" + sha256: "d35d4f6f46313d62fd342c9dcbf574432919ce5e802d2b6cbe2ebd549821e5c4" "0.9.29": url: "https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.29/openldap-LMDB_0.9.29.tar.gz" sha256: "d4c668167a2d703ef91db733b4069b8b74dbc374405855be6626b45e2a7e2dd3" diff --git a/recipes/lmdb/config.yml b/recipes/lmdb/config.yml index 34b7a75931b22..3c0c6966f556b 100644 --- a/recipes/lmdb/config.yml +++ b/recipes/lmdb/config.yml @@ -1,3 +1,5 @@ "versions": + "0.9.31": + "folder": "all" "0.9.29": "folder": "all" diff --git a/recipes/lodepng/all/conandata.yml b/recipes/lodepng/all/conandata.yml index bc34ea30306f5..c67c30a9939fd 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 4b29d9b93e715..7d5d008d1120b 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 b83949de59dc5..0000000000000 --- 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 4d9c222f7d839..6e4b69d1303a5 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 ac48eb45fc460..f7fedd1522a39 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 0000000000000..9b75430996d18 --- /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 11635d23e734f..0000000000000 --- 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 0000000000000..5b8a283a6e00a --- /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 4b7ef0dd16dbb..a9ec878c74ebe 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 0aa45c8d4db18..382876561a203 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 0000000000000..91630d79f4abb --- /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 0000000000000..0aa45c8d4db18 --- /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 f5578f6ffba14..18729d7b4cdc5 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/logr/0.1.0/CMakeLists.txt b/recipes/logr/0.1.0/CMakeLists.txt deleted file mode 100644 index c21cb501798d1..0000000000000 --- a/recipes/logr/0.1.0/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder/logr) diff --git a/recipes/logr/0.1.0/conandata.yml b/recipes/logr/0.1.0/conandata.yml index 368303bc2a36c..bd261e654fa90 100644 --- a/recipes/logr/0.1.0/conandata.yml +++ b/recipes/logr/0.1.0/conandata.yml @@ -2,3 +2,8 @@ sources: "0.1.0": url: "https://github.com/ngrodzitski/logr/archive/v0.1.0.tar.gz" sha256: "6b2e68b6425362f678b7485cd2c8cef7db377ac8ccd45646c84941b189b0b82d" +patches: + "0.1.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "conan" diff --git a/recipes/logr/0.1.0/conanfile.py b/recipes/logr/0.1.0/conanfile.py index a3500eef56a0a..967c8e88b68f9 100644 --- a/recipes/logr/0.1.0/conanfile.py +++ b/recipes/logr/0.1.0/conanfile.py @@ -1,97 +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.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 +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 LogrConan(ConanFile): name = "logr" - license = "BSD 3-Clause License" - homepage = "https://github.com/ngrodzitski/logr" - url = "https://github.com/conan-io/conan-center-index" description = "Logger frontend substitution for spdlog, glog, etc for server/desktop applications" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ngrodzitski/logr" topics = ("logger", "development", "util", "utils") - generators = "cmake" - settings = "os", "compiler", "build_type", "arch" - exports_sources = ["CMakeLists.txt"] - - options = { "backend": ["spdlog", "glog", "log4cplus", "log4cplus-unicode", None] } - default_options = { "backend": "spdlog"} - - _cmake = None + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "backend": ["spdlog", "glog", "log4cplus", "log4cplus-unicode", None], + } + default_options = { + "backend": "spdlog", + } @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property - def _build_subfolder(self): - return "build_subfolder" - - def requirements(self): - self.requires("fmt/7.1.2") - - if self.options.backend == "spdlog": - self.requires("spdlog/1.8.0") - elif self.options.backend == "glog": - self.requires("glog/0.4.0") - elif self.options.backend == "log4cplus": - self.requires("log4cplus/2.0.5") - elif self.options.backend == "log4cplus-unicode": - self.requires("log4cplus/2.0.5") - - def configure(self): - minimal_cpp_standard = "17" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) - minimal_version = { + def _compilers_minimum_version(self): + return { "gcc": "7", "clang": "7", "apple-clang": "10", - "Visual Studio": "16" + "Visual Studio": "16", + "msvc": "192", } - 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 export_sources(self): + export_conandata_patches(self) - def _configure_cmake(self): - if self._cmake: - return self._cmake + def layout(self): + cmake_layout(self, src_folder="src") - self._cmake = CMake(self) - self._cmake.definitions["LOGR_WITH_SPDLOG_BACKEND"] = self.options.backend == "spdlog" - self._cmake.definitions["LOGR_WITH_GLOG_BACKEND"] = self.options.backend == "glog" - self._cmake.definitions["LOGR_WITH_LOG4CPLUS_BACKEND"] = self.options.backend in ["log4cplus", "log4cplus-unicode"] - - self._cmake.definitions["LOGR_INSTALL"] = True - - self._cmake.configure( build_folder=self._build_subfolder ) - return self._cmake - - 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 requirements(self): + self.requires("fmt/9.1.0") + if self.options.backend == "spdlog": + self.requires("spdlog/1.11.0") + elif self.options.backend == "glog": + self.requires("glog/0.6.0") + elif self.options.backend in ["log4cplus", "log4cplus-unicode"]: + self.requires("log4cplus/2.0.5") - def build(self): + 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 self.options.backend == "log4cplus" and self.options["log4cplus"].unicode: raise ConanInvalidConfiguration("backend='log4cplus' requires log4cplus:unicode=False") elif self.options.backend == "log4cplus-unicode" and not self.options["log4cplus"].unicode: raise ConanInvalidConfiguration("backend='log4cplus-unicode' requires log4cplus:unicode=True") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["LOGR_WITH_SPDLOG_BACKEND"] = self.options.backend == "spdlog" + tc.cache_variables["LOGR_WITH_GLOG_BACKEND"] = self.options.backend == "glog" + tc.cache_variables["LOGR_WITH_LOG4CPLUS_BACKEND"] = self.options.backend in ["log4cplus", "log4cplus-unicode"] + tc.cache_variables["LOGR_INSTALL"] = True + tc.cache_variables["LOGR_BUILD_TESTS"] = False + tc.cache_variables["LOGR_BUILD_EXAMPLES"] = False + tc.cache_variables["LOGR_BUILD_BENCHMARKS"] = 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): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - 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")) + rmdir(self, os.path.join(self.package_folder, "lib")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/logr/0.1.0/patches/0001-fix-cmake.patch b/recipes/logr/0.1.0/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..e806e32f6aa85 --- /dev/null +++ b/recipes/logr/0.1.0/patches/0001-fix-cmake.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e8c2ce1..be74c3d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,13 +4,6 @@ cmake_minimum_required(VERSION 3.14) + + set(logr_root_prj logr_root) + +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/cpp_standard.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/libcxx.cmake") +-include( "${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/static_runtime.cmake" ) +- +-message(STATUS "ENABLE C++17") +-cxx_17() +- + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + + # ------------------------------------------------------------------------------ +@@ -30,8 +23,6 @@ message( STATUS "Use package manager: ${LOGR_PKG_PROVIDER}") + + + if( "${logr_pkg_provider_lowercase}" STREQUAL "conan" ) +- set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH}) +- set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} ${CMAKE_PREFIX_PATH}) + elseif ( "${logr_pkg_provider_lowercase}" STREQUAL "vcpkg" ) + if( NOT CMAKE_TOOLCHAIN_FILE ) + message( FATAL_ERROR "CMAKE_TOOLCHAIN_FILE must be defined when using vcpkg") +@@ -65,18 +56,6 @@ option(LOGR_WITH_LOG4CPLUS_BACKEND "Provide logr with log4cplus backend" ON) + # ------------------------------------------------------------------------------ + + project(${logr_root_prj} CXX) +-handle_explicit_libcxx_if_necessary() +-handle_explicit_static_runtime_if_necessary() +- +-# ------------------------------------------------------------------------------ +-# Various helpers: +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/common_options.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/compiler_flags.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/find_program_required.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/append_src_files.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/link_threads_if_necessary.cmake") +-include( "${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/static_analysis.cmake" ) +-# ------------------------------------------------------------------------------ + + # ------------------------------------------------------------------------------ + # A piece to define hint for pretty source files paths. +@@ -98,6 +77,14 @@ else () + endif () + # ------------------------------------------------------------------------------ + ++ ++message(STATUS "*** dump start cmake variables ***") ++get_cmake_property(_variableNames VARIABLES) ++foreach(_variableName ${_variableNames}) ++ message(STATUS "${_variableName}=${${_variableName}}") ++endforeach() ++message(STATUS "*** dump end ***") ++ + find_package(fmt REQUIRED) + + if (LOGR_WITH_SPDLOG_BACKEND) diff --git a/recipes/logr/0.1.0/test_package/CMakeLists.txt b/recipes/logr/0.1.0/test_package/CMakeLists.txt index cd3eca474d6d3..f0b27f088f57f 100644 --- a/recipes/logr/0.1.0/test_package/CMakeLists.txt +++ b/recipes/logr/0.1.0/test_package/CMakeLists.txt @@ -1,13 +1,8 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) +find_package(logr REQUIRED CONFIG) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE logr::logr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/0.1.0/test_package/conanfile.py b/recipes/logr/0.1.0/test_package/conanfile.py index b862d3bd0137e..ef5d7042163ec 100644 --- a/recipes/logr/0.1.0/test_package/conanfile.py +++ b/recipes/logr/0.1.0/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 LogrTestConan(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, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/logr/0.1.0/test_package/example.cpp b/recipes/logr/0.1.0/test_package/example.cpp deleted file mode 100644 index e80e0e10f0233..0000000000000 --- a/recipes/logr/0.1.0/test_package/example.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include - -#include - -#include -#include - -auto make_logger() -{ - auto sink = std::make_shared< spdlog::sinks::stdout_sink_st >(); - sink->set_pattern("[%Y-%m-%d %T][%n][%l] %v [%g]"); - - return logr::spdlog_logger_t<>{ - "console", - std::move( sink ), - logr::log_message_level::trace - }; -} - -int main() -{ - auto logger = make_logger(); - - logger.info( []( auto & out ){ - fmt::format_to( out, - "Welcome to logr (v{}.{}.{}), package is provided by Conan!", - LOGR_VERSION_MAJOR, - LOGR_VERSION_MINOR, - LOGR_VERSION_PATCH ); - } ); -} diff --git a/recipes/logr/0.1.0/test_package/test_package.cpp b/recipes/logr/0.1.0/test_package/test_package.cpp new file mode 100644 index 0000000000000..de16c1837fbb2 --- /dev/null +++ b/recipes/logr/0.1.0/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include +#include + +#include +#include + +auto make_logger() +{ + auto sink = std::make_shared< spdlog::sinks::stdout_sink_st >(); + sink->set_pattern("[%Y-%m-%d %T][%n][%l] %v [%g]"); + + return logr::spdlog_logger_t<>{ + "console", + std::move( sink ), + logr::log_message_level::trace + }; +} + +int main() +{ + auto logger = make_logger(); + + logger.info( []( auto & out ){ + format_to( std::back_inserter(out), + "Welcome to logr (v{}.{}.{}), package is provided by Conan!", + LOGR_VERSION_MAJOR, + LOGR_VERSION_MINOR, + LOGR_VERSION_PATCH ); + } ); +} diff --git a/recipes/logr/all/conandata.yml b/recipes/logr/all/conandata.yml index 46dc2294ce601..3a291a696ec11 100644 --- a/recipes/logr/all/conandata.yml +++ b/recipes/logr/all/conandata.yml @@ -1,19 +1,19 @@ sources: - "0.2.0": - url: "https://github.com/ngrodzitski/logr/archive/v0.2.0.tar.gz" - sha256: "4e1707f9450f12b0752d8ef4d72a3f38a2e6be0014ca7edde049f22e9b9119a4" - "0.2.1": - url: "https://github.com/ngrodzitski/logr/archive/v0.2.1.tar.gz" - sha256: "411282bb03d678d7266951b979102392dbf7e5e14b629bccfb2c4e74cfa758c6" - "0.3.0": - url: "https://github.com/ngrodzitski/logr/archive/v0.3.0.tar.gz" - sha256: "21eea6cce32e3ccf3769f66211143b17f8b36891e79ec3ef5209f849d9e79ad7" - "0.4.0": - url: "https://github.com/ngrodzitski/logr/archive/v0.4.0.tar.gz" - sha256: "c355aa455d0a9c6d1d3bc168a2db0cd7f3c9706b382088e96948ec3a4cf1286f" - "0.5.1": - url: "https://github.com/ngrodzitski/logr/archive/v0.5.1.tar.gz" - sha256: "674be6a53d5b3f40273b1b5710ac9e32d870827032b5008c41621db47f4b3b0e" "0.6.0": url: "https://github.com/ngrodzitski/logr/archive/v0.6.0.tar.gz" sha256: "2ecb40396add33f2120a79957633533381f3df13cb3b53278eb9dec3a1230eb2" + "0.5.1": + url: "https://github.com/ngrodzitski/logr/archive/v0.5.1.tar.gz" + sha256: "674be6a53d5b3f40273b1b5710ac9e32d870827032b5008c41621db47f4b3b0e" + "0.4.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.4.0.tar.gz" + sha256: "c355aa455d0a9c6d1d3bc168a2db0cd7f3c9706b382088e96948ec3a4cf1286f" + "0.3.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.3.0.tar.gz" + sha256: "21eea6cce32e3ccf3769f66211143b17f8b36891e79ec3ef5209f849d9e79ad7" + "0.2.1": + url: "https://github.com/ngrodzitski/logr/archive/v0.2.1.tar.gz" + sha256: "411282bb03d678d7266951b979102392dbf7e5e14b629bccfb2c4e74cfa758c6" + "0.2.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.2.0.tar.gz" + sha256: "4e1707f9450f12b0752d8ef4d72a3f38a2e6be0014ca7edde049f22e9b9119a4" diff --git a/recipes/logr/all/conanfile.py b/recipes/logr/all/conanfile.py index a5e869c032b2e..7f984ac3075da 100644 --- a/recipes/logr/all/conanfile.py +++ b/recipes/logr/all/conanfile.py @@ -12,30 +12,34 @@ class LogrConan(ConanFile): name = "logr" - license = "BSD-3-Clause" - homepage = "https://github.com/ngrodzitski/logr" - url = "https://github.com/conan-io/conan-center-index" description = ( "Logger frontend substitution for spdlog, glog, etc " "for server/desktop applications" ) + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ngrodzitski/logr" topics = ("logger", "development", "util", "utils") - - settings = "os", "compiler", "build_type", "arch" - - options = {"backend": ["spdlog", "glog", "log4cplus", "boostlog", None]} - default_options = {"backend": "spdlog"} + settings = "os", "arch", "compiler", "build_type" + options = { + "backend": ["spdlog", "glog", "log4cplus", "boostlog", None], + } + default_options = { + "backend": "spdlog", + } def layout(self): basic_layout(self, src_folder="src") def requirements(self): - if Version(self.version) >= "0.6.0": + if self.options.backend != "spdlog": + fmt_ref = "fmt/10.0.0" + elif Version(self.version) >= "0.6.0": fmt_ref = "fmt/9.1.0" spdlog_ref = "spdlog/1.11.0" else: fmt_ref = "fmt/8.1.1" - spdlog_ref = "spdlog/1.9.2" + spdlog_ref = "spdlog/1.10.0" self.requires(fmt_ref) @@ -44,9 +48,9 @@ def requirements(self): elif self.options.backend == "glog": self.requires("glog/0.6.0") elif self.options.backend == "log4cplus": - self.requires("log4cplus/2.0.5") + self.requires("log4cplus/2.1.0") elif self.options.backend == "boostlog": - self.requires("boost/1.77.0") + self.requires("boost/1.82.0") def package_id(self): self.info.settings.clear() diff --git a/recipes/logr/all/test_package/CMakeLists.txt b/recipes/logr/all/test_package/CMakeLists.txt index 866a0cc839d26..5e62d2b8b4d92 100644 --- a/recipes/logr/all/test_package/CMakeLists.txt +++ b/recipes/logr/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(logr REQUIRED) -add_executable(${PROJECT_NAME} example.cpp) -target_link_libraries(${PROJECT_NAME} logr::logr) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE logr::logr) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/all/test_package/conanfile.py b/recipes/logr/all/test_package/conanfile.py index a9fb96656f203..f5cf204295e19 100644 --- a/recipes/logr/all/test_package/conanfile.py +++ b/recipes/logr/all/test_package/conanfile.py @@ -3,7 +3,6 @@ from conan.tools.cmake import cmake_layout, CMake import os - class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" @@ -22,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/logr/all/test_package/example.cpp b/recipes/logr/all/test_package/test_package.cpp similarity index 100% rename from recipes/logr/all/test_package/example.cpp rename to recipes/logr/all/test_package/test_package.cpp diff --git a/recipes/logr/all/test_v1_package/CMakeLists.txt b/recipes/logr/all/test_v1_package/CMakeLists.txt index 7a2102f144a4f..77c0a1e824e62 100644 --- a/recipes/logr/all/test_v1_package/CMakeLists.txt +++ b/recipes/logr/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) find_package(logr REQUIRED CONFIG) -add_executable(${PROJECT_NAME} ../test_package/example.cpp) +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) target_link_libraries(${PROJECT_NAME} logr::logr) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/config.yml b/recipes/logr/config.yml index 2642be9922766..71c5abd93f78c 100644 --- a/recipes/logr/config.yml +++ b/recipes/logr/config.yml @@ -1,15 +1,15 @@ versions: - "0.1.0": - folder: 0.1.0 - "0.2.0": - folder: all - "0.2.1": + "0.6.0": folder: all - "0.3.0": + "0.5.1": folder: all "0.4.0": folder: all - "0.5.1": + "0.3.0": folder: all - "0.6.0": + "0.2.1": folder: all + "0.2.0": + folder: all + "0.1.0": + folder: 0.1.0 diff --git a/recipes/loguru/all/conandata.yml b/recipes/loguru/all/conandata.yml new file mode 100644 index 0000000000000..779d9ad6aa366 --- /dev/null +++ b/recipes/loguru/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230406": + url: "https://github.com/emilk/loguru/archive/4adaa185883e3c04da25913579c451d3c32cfac1.tar.gz" + sha256: "1424f3ce814fa413e5fbdf2949994d455e3914560f958d2931ba869349a686a8" diff --git a/recipes/loguru/all/conanfile.py b/recipes/loguru/all/conanfile.py new file mode 100644 index 0000000000000..8f740c8665ca6 --- /dev/null +++ b/recipes/loguru/all/conanfile.py @@ -0,0 +1,145 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, load, save, rmdir, rm +from conan.tools.build import check_min_cppstd + + +required_conan_version = ">=1.53.0" + + +class LoguruConan(ConanFile): + name = "loguru" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/emilk/loguru" + license = "Unlicense" + topics = ("logging", "log", "fmt") + description = "Loguru is a C++11 logging library." + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_fmt": [True, False], + "verbose_scope_endings": [True, False], + "redefine_assert": [True, False], + "enable_streams": [True, False], + "enable_fileabs": [True, False], + "replace_glog": [True, False], + + "scope_text_size": [None, "ANY"], + "scope_time_precision": [None, "ANY"], + "filename_width": [None, "ANY"], + "threadname_width": [None, "ANY"], + } + + default_options = { + "shared": False, + "fPIC": True, + "with_fmt": False, + "verbose_scope_endings": True, + "redefine_assert": False, + "enable_streams": False, + "enable_fileabs": False, + "replace_glog": False, + "scope_text_size": 196, + "scope_time_precision": 3, + "filename_width": 23, + "threadname_width": 16, + } + + 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_fmt: + self.requires("fmt/9.1.0", transitive_headers=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + if self.options.replace_glog and not self.options.enable_streams: + # https://github.com/emilk/loguru/blob/4adaa185883e3c04da25913579c451d3c32cfac1/docs/index.html#L692 + raise ConanInvalidConfiguration(f"{self.ref}:replace_glog needs {self.ref}:enable_streams=True") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def layout(self): + cmake_layout(self, src_folder='src') + + 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() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _extracted_license(self): + tmp = load(self, os.path.join(self.source_folder, 'loguru.hpp')) + return tmp[2:tmp.find("# Inspiration", 0)].strip() + + 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")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"loguru{suffix}"] + self.cpp_info.includedirs = [os.path.join("include", "loguru")] + # https://github.com/emilk/loguru/blob/4adaa185883e3c04da25913579c451d3c32cfac1/CMakeLists.txt#L301 + self.cpp_info.set_property("cmake_file_name", "loguru") + self.cpp_info.set_property("cmake_target_name", "loguru::loguru") + + # 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}") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "dl", "m"] diff --git a/recipes/loguru/all/test_package/CMakeLists.txt b/recipes/loguru/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..aba0bad284220 --- /dev/null +++ b/recipes/loguru/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(loguru REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PUBLIC loguru::loguru) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/loguru/all/test_package/conanfile.py b/recipes/loguru/all/test_package/conanfile.py new file mode 100644 index 0000000000000..543315cd0fbb8 --- /dev/null +++ b/recipes/loguru/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.build import can_run +from conan.tools.cmake import 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/loguru/all/test_package/test_package.cpp b/recipes/loguru/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..58460d1478be0 --- /dev/null +++ b/recipes/loguru/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +// Partially taken from: https://github.com/emilk/loguru/tree/master/loguru_example + +#include +#include +#include +#include + +inline void sleep_ms(int ms) +{ + VLOG_F(2, "Sleeping for %d ms", ms); + std::this_thread::sleep_for(std::chrono::milliseconds(ms)); +} + +inline void complex_calculation() +{ + LOG_SCOPE_F(INFO, "complex_calculation"); + LOG_F(INFO, "Starting time machine..."); + LOG_F(WARNING, "The flux capacitor is not getting enough power!"); + LOG_F(INFO, "Lighting strike!"); + VLOG_F(1, "Found 1.21 gigawatts..."); +} + +int main(int argc, char *argv[]) +{ + loguru::init(argc, argv); + LOG_F(INFO, "Hello from main.cpp!"); + complex_calculation(); + LOG_F(INFO, "main function about to end!"); +} diff --git a/recipes/loguru/all/test_v1_package/CMakeLists.txt b/recipes/loguru/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/loguru/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/loguru/all/test_v1_package/conanfile.py b/recipes/loguru/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/loguru/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/loguru/config.yml b/recipes/loguru/config.yml new file mode 100644 index 0000000000000..82675897e9768 --- /dev/null +++ b/recipes/loguru/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230406": + folder: all diff --git a/recipes/ls-qpack/all/CMakeLists.txt b/recipes/ls-qpack/all/CMakeLists.txt new file mode 100644 index 0000000000000..6db820d134e2e --- /dev/null +++ b/recipes/ls-qpack/all/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper) + +add_subdirectory(src) + +install( + TARGETS ls-qpack + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +install(FILES src/lsqpack.h DESTINATION include) + +if(WIN32) + install(DIRECTORY src/wincompat DESTINATION include) +endif() diff --git a/recipes/ls-qpack/all/conandata.yml b/recipes/ls-qpack/all/conandata.yml index 2760252082cf6..e0937f2a8bc1f 100644 --- a/recipes/ls-qpack/all/conandata.yml +++ b/recipes/ls-qpack/all/conandata.yml @@ -1,13 +1,23 @@ sources: + "2.5.4": + url: "https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.4.tar.gz" + sha256: "56b96190a1943d75ef8d384b13cd4592a72e3e2d84284f78d7f8adabbc717f3e" + "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.1": - - patch_file: "patches/0001-use-cci-package.patch" + "2.5.4": + - patch_file: "patches/2.5.1-0001-use-cci-package.patch" + patch_description: "use cci packages" + patch_type: "conan" + "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/0002-add-installer.patch" - patch_description: "add installer" + "2.5.1": + - patch_file: "patches/2.5.1-0001-use-cci-package.patch" + patch_description: "use cci packages" patch_type: "conan" diff --git a/recipes/ls-qpack/all/conanfile.py b/recipes/ls-qpack/all/conanfile.py index dd139a2740293..d1d1a2870f42b 100644 --- a/recipes/ls-qpack/all/conanfile.py +++ b/recipes/ls-qpack/all/conanfile.py @@ -26,6 +26,7 @@ class LsQpackConan(ConanFile): def export_sources(self): export_conandata_patches(self) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -42,7 +43,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) @@ -61,7 +62,7 @@ def generate(self): def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure() + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): 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 21e1e856275c9..0000000000000 --- 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/0002-add-installer.patch b/recipes/ls-qpack/all/patches/0002-add-installer.patch deleted file mode 100644 index 1acf784e4597a..0000000000000 --- a/recipes/ls-qpack/all/patches/0002-add-installer.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt -index 670ea97..f2dd257 100644 ---- a/a/CMakeLists.txt -+++ b/b/CMakeLists.txt -@@ -100,3 +100,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/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 0000000000000..4dd248246392c --- /dev/null +++ b/recipes/ls-qpack/all/patches/2.5.1-0001-use-cci-package.patch @@ -0,0 +1,12 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -20,7 +20,7 @@ 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() diff --git a/recipes/ls-qpack/config.yml b/recipes/ls-qpack/config.yml index eab83a303df52..7b62b895ae661 100644 --- a/recipes/ls-qpack/config.yml +++ b/recipes/ls-qpack/config.yml @@ -1,3 +1,7 @@ versions: + "2.5.4": + folder: all + "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 5271897d749e2..47079e98290b1 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 c127812d6a812..6eb7d47405bd9 100644 --- a/recipes/luau/all/conandata.yml +++ b/recipes/luau/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "0.607": + url: "https://github.com/Roblox/luau/archive/0.607.tar.gz" + sha256: "519409d7dbb43da13390131a90c831cb0f2ab9c25e337acf15508313a339bf36" + "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" "0.577": url: "https://github.com/Roblox/luau/archive/0.577.tar.gz" sha256: "4fd3f0d7a3bb6a9f4ed69711d261c4ae6ab6dfe8eb8e444f738c3338c559c7c8" @@ -14,90 +32,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.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 fe153e150679e..643eab7b93170 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 00dcf66617205..0000000000000 --- 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 aaff66adb45b9..0000000000000 --- 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 9901376bd09ea..0000000000000 --- 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 24acb8d334fb9..0000000000000 --- 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 53d1e61ba8c54..7e52185e25e09 100644 --- a/recipes/luau/config.yml +++ b/recipes/luau/config.yml @@ -1,23 +1,23 @@ versions: - "0.577": + "0.607": folder: all - "0.572": + "0.603": folder: all - "0.568": + "0.598": folder: all - "0.563": + "0.593": folder: all - "0.558": + "0.589": folder: all - "0.556": + "0.582": folder: all - "0.552": + "0.577": folder: all - "0.548": + "0.572": folder: all - "0.544": + "0.568": folder: all - "0.541": + "0.563": folder: all - "0.540": + "0.558": folder: all diff --git a/recipes/lunasvg/all/conandata.yml b/recipes/lunasvg/all/conandata.yml index e504366930815..841dc89eb9587 100644 --- a/recipes/lunasvg/all/conandata.yml +++ b/recipes/lunasvg/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.3.9": + url: "https://github.com/sammycage/lunasvg/archive/v2.3.9.tar.gz" + sha256: "088bc9fd1191a004552c65bdcc260989b83da441b0bdaa965e79d984feba88fa" + "2.3.8": + url: "https://github.com/sammycage/lunasvg/archive/v2.3.8.tar.gz" + sha256: "54d697e271a5aca36f9999d546b1b346e98a8183140027330f69a3eb0c184194" "2.3.5": url: "https://github.com/sammycage/lunasvg/archive/v2.3.5.tar.gz" sha256: "350ff56aa1acdedefe2ad8a4241a9fb8f9b232868adc7bd36dfb3dbdd57e2e93" @@ -11,8 +17,19 @@ sources: "2.3.1": url: "https://github.com/sammycage/lunasvg/archive/refs/tags/v2.3.1.tar.gz" sha256: "6492bf0f51982f5382f83f1a42f247bb1bbcbaef4a15963bbd53073cd4944a25" - patches: + "2.3.9": + - patch_file: "patches/2.3.9-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" + - patch_file: "patches/2.3.9-0002-rename-inner-selector.patch" + patch_description: "rename inner selector to subselector" + patch_type: "portability" + patch_source: "https://github.com/sammycage/lunasvg/pull/147" + "2.3.8": + - patch_file: "patches/2.3.5-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" "2.3.5": - patch_file: "patches/2.3.5-0001-fix-cmake.patch" patch_description: "use external plutovg and fix installation path for conan" diff --git a/recipes/lunasvg/all/conanfile.py b/recipes/lunasvg/all/conanfile.py index faebad4a7c975..e2d264c8bbac5 100644 --- a/recipes/lunasvg/all/conanfile.py +++ b/recipes/lunasvg/all/conanfile.py @@ -8,7 +8,7 @@ import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LunaSVGConan(ConanFile): name = "lunasvg" @@ -17,6 +17,7 @@ class LunaSVGConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/sammycage/lunasvg" topics = ("svg", "renderer", ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -28,26 +29,31 @@ class LunaSVGConan(ConanFile): } @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): if Version(self.version) <= "2.3.2": - return 14 - else: - return 17 + return "14" + if Version(self.version) <= "2.3.8": + return "17" + return "11" @property def _compilers_minimum_version(self): - if Version(self.version) <= "2.3.2": - return { + return { + "14": { "gcc": "5", "clang": "3.5", - "apple-clang": "10" - } - else: - return { + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + "17": { "gcc": "7.1", "clang": "7", - "apple-clang": "12.0" - } + "apple-clang": "12.0", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) def export_sources(self): export_conandata_patches(self) @@ -58,10 +64,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") def layout(self): cmake_layout(self, src_folder="src") @@ -74,20 +77,15 @@ def requirements(self): def validate(self): if self.info.settings.compiler.cppstd: - check_min_cppstd(self, self._minimum_cpp_standard) - if Version(self.version) <= "2.3.2": - check_min_vs(self, 191) - else: - check_min_vs(self, 192) - if not is_msvc(self): - 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.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." - ) + 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.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/lunasvg/all/patches/2.3.9-0001-fix-cmake.patch b/recipes/lunasvg/all/patches/2.3.9-0001-fix-cmake.patch new file mode 100644 index 0000000000000..63725e4f5ca8c --- /dev/null +++ b/recipes/lunasvg/all/patches/2.3.9-0001-fix-cmake.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bed8895..4698501 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,8 +12,8 @@ add_library(lunasvg) + + add_subdirectory(include) + add_subdirectory(source) +-add_subdirectory(3rdparty/plutovg) +- ++find_package(plutovg CONFIG REQUIRED) ++target_link_libraries(lunasvg plutovg::plutovg) + if(BUILD_SHARED_LIBS) + target_compile_definitions(lunasvg PUBLIC LUNASVG_SHARED) + target_compile_definitions(lunasvg PRIVATE LUNASVG_EXPORT) +@@ -25,16 +25,16 @@ if(LUNASVG_BUILD_EXAMPLES) + target_include_directories(svg2png PRIVATE 3rdparty/stb) + endif() + +-set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) +-set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include) ++#set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) ++#set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include) + + install(FILES + include/lunasvg.h +- DESTINATION ${LUNASVG_INCDIR} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + + install(TARGETS lunasvg +- LIBRARY DESTINATION ${LUNASVG_LIBDIR} +- ARCHIVE DESTINATION ${LUNASVG_LIBDIR} +- INCLUDES DESTINATION ${LUNASVG_INCDIR} ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ) diff --git a/recipes/lunasvg/all/patches/2.3.9-0002-rename-inner-selector.patch b/recipes/lunasvg/all/patches/2.3.9-0002-rename-inner-selector.patch new file mode 100644 index 0000000000000..bb8abc7dace76 --- /dev/null +++ b/recipes/lunasvg/all/patches/2.3.9-0002-rename-inner-selector.patch @@ -0,0 +1,26 @@ +diff --git a/source/parser.cpp b/source/parser.cpp +index 714228b..3ade738 100644 +--- a/source/parser.cpp ++++ b/source/parser.cpp +@@ -1226,8 +1226,8 @@ bool RuleData::matchPseudoClassSelector(const PseudoClassSelector& selector, con + return element->parent == nullptr; + + if(selector.type == PseudoClassSelector::Type::Is) { +- for(auto& selector : selector.subSelectors) { +- for(auto& sel : selector) { ++ for(auto& subselector : selector.subSelectors) { ++ for(auto& sel : subselector) { + if(!matchSimpleSelector(sel, element)) { + return false; + } +@@ -1238,8 +1238,8 @@ bool RuleData::matchPseudoClassSelector(const PseudoClassSelector& selector, con + } + + if(selector.type == PseudoClassSelector::Type::Not) { +- for(auto& selector : selector.subSelectors) { +- for(auto& sel : selector) { ++ for(auto& subselector : selector.subSelectors) { ++ for(auto& sel : subselector) { + if(matchSimpleSelector(sel, element)) { + return false; + } diff --git a/recipes/lunasvg/all/test_package/CMakeLists.txt b/recipes/lunasvg/all/test_package/CMakeLists.txt index 1c8a5ea6697c7..29d0fd86a92ba 100644 --- a/recipes/lunasvg/all/test_package/CMakeLists.txt +++ b/recipes/lunasvg/all/test_package/CMakeLists.txt @@ -1,8 +1,14 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(lunasvg REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE lunasvg::lunasvg) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +if (lunasvg_VERSION VERSION_LESS_EQUAL "2.3.2") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +elseif (lunasvg_VERSION VERSION_LESS_EQUAL "2.3.8") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/lunasvg/config.yml b/recipes/lunasvg/config.yml index d8c968c29bee6..670758a7b8c7f 100644 --- a/recipes/lunasvg/config.yml +++ b/recipes/lunasvg/config.yml @@ -1,4 +1,8 @@ versions: + "2.3.9": + folder: all + "2.3.8": + folder: all "2.3.5": folder: all "2.3.4": diff --git a/recipes/luple/all/conandata.yml b/recipes/luple/all/conandata.yml index c2dbecf43978d..37619e3ffc243 100644 --- a/recipes/luple/all/conandata.yml +++ b/recipes/luple/all/conandata.yml @@ -2,5 +2,3 @@ sources: "1.2": - url: "https://github.com/alexpolt/luple/archive/1.2.tar.gz" sha256: "810e622b656fa4f1cae5b299db94f550262eb49c81d373cfe770edcea3e8a68b" - - url: "https://unlicense.org/UNLICENSE" - sha256: "7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c" diff --git a/recipes/luple/all/conanfile.py b/recipes/luple/all/conanfile.py index 9334773f3ff8a..2170039c6be4b 100644 --- a/recipes/luple/all/conanfile.py +++ b/recipes/luple/all/conanfile.py @@ -10,13 +10,14 @@ class LupleConan(ConanFile): name = "luple" - license = "Unlicense" + license = "Public-domain" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/alexpolt/luple" description = "Home to luple, nuple, C++ String Interning, Struct Reader and C++ Type Loophole" topics = ("loophole", "luple", "nuple", "struct", "intern") settings = "os", "arch", "compiler", "build_type" no_copy_source = True + package_type = "header-library" @property def _min_cppstd(self): @@ -57,13 +58,13 @@ def loose_lt_semver(v1, v2): def source(self): get(self, **self.conan_data["sources"][self.version][0], destination=self.source_folder, strip_root=True) - download(self, filename="LICENSE", **self.conan_data["sources"][self.version][1]) def build(self): pass def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + # This package doesn't have a license file, it is public domain declared in the Readme + copy(self, "README.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(self, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) def package_info(self): diff --git a/recipes/lyra/all/conandata.yml b/recipes/lyra/all/conandata.yml index f6627e78699fe..8d693ef2d527d 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 184573a6e3fe9..c094e45b8f49c 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 294a9afb37677..8b31e74af3444 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 0b275b10a2f3c..98ab55852ad56 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 b200e21129c40..0000000000000 --- 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 5298875e31c6a..0000000000000 --- 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 425271e9a388e..839c2a460a6e7 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 577763acfe7a6..fc3f8472653fd 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 0000000000000..04a888ec1c444 --- /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 2b81d53f9b8e1..f3b143bd6541b 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 96c8fbac3cb58..3a29086521b1e 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 68dcb6f524644..594395a65c8c3 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 50311f5627b8c..9388ec1d5dc3d 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 0000000000000..ad4c3f5cc843d --- /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 84ae9d8826de5..16e19ad7002bc 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 e027a6bc18156..fe52638d1ec86 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/lzo/all/conanfile.py b/recipes/lzo/all/conanfile.py index d5a4ce4f0d916..2daa81c92934c 100644 --- a/recipes/lzo/all/conanfile.py +++ b/recipes/lzo/all/conanfile.py @@ -12,7 +12,7 @@ class LZOConan(ConanFile): license = "GPL-v2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.oberhumer.com/opensource/lzo/" - topics = ("lzo", "compression") + topics = ("compression") package_type = "library" settings = "os", "arch", "compiler", "build_type" diff --git a/recipes/m4/all/conandata.yml b/recipes/m4/all/conandata.yml index 3b25f4d23294d..6dc3bb1b5c347 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 881f4c539d77d..dadcf2b1794c2 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 0afa4da0a47d0..0000000000000 --- 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 b665b86aad8f3..4a294edf870e7 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 23409570c2d3d..fdefc9766275f 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 91359378f2072..b4bf9474c36c1 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 7bcdd1cec24d5..b023f2456bef0 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 b85bbd5581573..9b4b9a74cb47a 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 38f4483872d47..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 8d13aefb6b4fb..90c91d00495eb 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 759878c043f07..dd9aed1156ca9 100644 --- a/recipes/magic_enum/all/conandata.yml +++ b/recipes/magic_enum/all/conandata.yml @@ -1,4 +1,19 @@ 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" + "0.9.2": + url: "https://github.com/Neargye/magic_enum/archive/v0.9.2.tar.gz" + sha256: "7887d6a2dfdec65acb7a529a620b3c6f53f30cca55b419ac8ca688a089149e1a" + "0.9.1": + url: "https://github.com/Neargye/magic_enum/archive/v0.9.1.tar.gz" + sha256: "864798f3146de2bb0da766f87d9a64b1742a5d109661b5bf4fdf839040b854d7" "0.9.0": url: "https://github.com/Neargye/magic_enum/archive/v0.9.0.tar.gz" sha256: "2fb2f602b4660f8af539ee00958132a397e138bda19aa1ceae546de3a143386b" @@ -11,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 c185d76435a4f..f5917740f5800 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 fcb911e1f966e..208a3dd5fc806 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 e1638e15ae6fe..45e3b1189db90 100644 --- a/recipes/magic_enum/config.yml +++ b/recipes/magic_enum/config.yml @@ -1,21 +1,19 @@ versions: - "0.9.0": + "0.9.5": folder: all - "0.8.2": + "0.9.4": folder: all - "0.8.1": - folder: all - "0.8.0": + "0.9.3": folder: all - "0.7.3": + "0.9.2": folder: all - "0.7.2": + "0.9.1": folder: all - "0.7.1": + "0.9.0": folder: all - "0.7.0": + "0.8.2": folder: all - "0.6.6": + "0.8.1": folder: all - "0.6.5": + "0.8.0": folder: all diff --git a/recipes/mailio/all/conandata.yml b/recipes/mailio/all/conandata.yml index 068f2f54981f1..38e35d02a9f6f 100644 --- a/recipes/mailio/all/conandata.yml +++ b/recipes/mailio/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.23.0": + url: "https://github.com/karastojko/mailio/archive/refs/tags/0.23.0.tar.gz" + sha256: "9fc3f1f803a85170c2081cbbef2e301473a400683fc1dffefa2d6707598206a5" + "0.22.0": + url: "https://github.com/karastojko/mailio/archive/refs/tags/0.22.0.tar.gz" + sha256: "e177522f0479f33b6cbc7085268ca385140457eb752b45f07e5d6b41e314ece9" "0.21.0": url: "https://github.com/karastojko/mailio/archive/refs/tags/0.21.0.tar.gz" sha256: "8f58dfc8bcbe01224c788f22c544c27611e3c411ed5a2097488fbb32a3c0fb3d" @@ -6,6 +12,14 @@ sources: url: "https://github.com/karastojko/mailio/archive/refs/tags/0.20.0.tar.gz" sha256: "073d6b1ff891444b54a01c2a3f17074fd612f9e2e14d9ebd61863c70737b1882" patches: + "0.23.0": + - patch_file: "patches/0.23.0-adapt-cmakelists.patch" + patch_description: "fix install path" + patch_type: "conan" + "0.22.0": + - patch_file: "patches/0.22.0-adapt-cmakelists.patch" + patch_description: "fix install path" + patch_type: "conan" "0.21.0": - patch_file: "patches/0.21.0-adapt-cmakelists.patch" patch_description: "fix install path" diff --git a/recipes/mailio/all/conanfile.py b/recipes/mailio/all/conanfile.py index 67ea0faeba25f..28d892d6df1a4 100644 --- a/recipes/mailio/all/conanfile.py +++ b/recipes/mailio/all/conanfile.py @@ -57,8 +57,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0", transitive_headers=True) - self.requires("openssl/[>=1.1 <4]") + self.requires("boost/1.82.0", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.get_safe("compiler.cppstd"): @@ -84,6 +84,8 @@ def generate(self): tc.variables["MAILIO_BUILD_SHARED_LIBRARY"] = self.options.shared tc.variables["MAILIO_BUILD_DOCUMENTATION"] = False tc.variables["MAILIO_BUILD_EXAMPLES"] = False + if Version(self.version) >= "0.22.0": + tc.variables["MAILIO_BUILD_TESTS"] = False tc.generate() deps = CMakeDeps(self) @@ -100,10 +102,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.libs = ["mailio"] - self.cpp_info.requires = ["boost::system", "boost::date_time", "boost::regex", "openssl::openssl"] + self.cpp_info.requires = [ + "boost::system", + "boost::date_time", + "boost::regex", + "openssl::openssl", + ] + if self.dependencies["boost"].options.get_safe("with_stacktrace_backtrace"): + self.cpp_info.requires.append("boost::stacktrace_backtrace") + + self.cpp_info.set_property("pkg_config_name", "mailio") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/mailio/all/patches/0.22.0-adapt-cmakelists.patch b/recipes/mailio/all/patches/0.22.0-adapt-cmakelists.patch new file mode 100644 index 0000000000000..417d346368830 --- /dev/null +++ b/recipes/mailio/all/patches/0.22.0-adapt-cmakelists.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a79e042..9306cba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -145,7 +145,7 @@ configure_file(mailio.pc.in ${CMAKE_BINARY_DIR}/mailio.pc IMMEDIATE @ONLY) + install(FILES ${CMAKE_BINARY_DIR}/mailio.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) + + configure_file(${PROJECT_SOURCE_DIR}/include/version.hpp.in version.hpp) +-install(FILES ${CMAKE_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) ++install(FILES ${PROJECT_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) + + # generate the export header for exporting symbols + # this is needed to generate a shared library. +@@ -181,16 +181,11 @@ endif() + install(DIRECTORY include/mailio DESTINATION ${INCLUDE_INSTALL_DIR}) + + install(TARGETS ${PROJECT_NAME} +- EXPORT ${PROJECT_NAME}Config + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + ) + +-export(TARGETS ${PROJECT_NAME} FILE ${PROJECT_NAME}Config.cmake) +- +-install(EXPORT ${PROJECT_NAME}Config DESTINATION share/${PROJECT_NAME}/cmake) +- + # optionally build examples + if(${MAILIO_BUILD_EXAMPLES}) + add_subdirectory(examples) diff --git a/recipes/mailio/all/patches/0.23.0-adapt-cmakelists.patch b/recipes/mailio/all/patches/0.23.0-adapt-cmakelists.patch new file mode 100644 index 0000000000000..a29154c581b87 --- /dev/null +++ b/recipes/mailio/all/patches/0.23.0-adapt-cmakelists.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e3b30fd..d1adcab 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -146,7 +146,7 @@ configure_file(mailio.pc.in ${CMAKE_BINARY_DIR}/mailio.pc IMMEDIATE @ONLY) + install(FILES ${CMAKE_BINARY_DIR}/mailio.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) + + configure_file(${PROJECT_SOURCE_DIR}/include/version.hpp.in version.hpp) +-install(FILES ${CMAKE_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) ++install(FILES ${PROJECT_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) + + # generate the export header for exporting symbols + # this is needed to generate a shared library. diff --git a/recipes/mailio/all/test_package/test_package.cpp b/recipes/mailio/all/test_package/test_package.cpp index ffc54c18c0369..43678d207e054 100644 --- a/recipes/mailio/all/test_package/test_package.cpp +++ b/recipes/mailio/all/test_package/test_package.cpp @@ -8,7 +8,4 @@ int main() { msg.add_recipient(mailio::mail_address("mailio library", "mailio@gmail.com")); msg.subject("smtps simple message"); msg.content("Hello, World!"); - - mailio::smtps conn("smtp.gmail.com", 587); - std::cout << msg.content() << "\n";; } diff --git a/recipes/mailio/config.yml b/recipes/mailio/config.yml index ad2748292fb8c..01caa19ce9c40 100644 --- a/recipes/mailio/config.yml +++ b/recipes/mailio/config.yml @@ -1,4 +1,8 @@ versions: + "0.23.0": + folder: all + "0.22.0": + folder: all "0.21.0": folder: all "0.20.0": diff --git a/recipes/make/all/conandata.yml b/recipes/make/all/conandata.yml index fb6e6264363e7..e1b821e38a6db 100644 --- a/recipes/make/all/conandata.yml +++ b/recipes/make/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.4.1": + url: "http://ftpmirror.gnu.org/gnu/make/make-4.4.1.tar.gz" + sha256: "dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3" + "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 +12,10 @@ sources: url: "http://ftpmirror.gnu.org/gnu/make/make-4.2.1.tar.bz2" sha256: "d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589" patches: + "4.4.1": + - patch_file: "patches/4.4.1-0001-clang.patch" + "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/all/patches/4.4.1-0001-clang.patch b/recipes/make/all/patches/4.4.1-0001-clang.patch new file mode 100644 index 0000000000000..3e884bebdc9ef --- /dev/null +++ b/recipes/make/all/patches/4.4.1-0001-clang.patch @@ -0,0 +1,5 @@ +--- lib/glob.c ++++ lib/glob.c +@@ -139,1 +139,1 @@ +-#if !defined __alloca && !defined __GNU_LIBRARY__ ++#if (!defined __alloca && defined __GNU_LIBRARY__ && __linux__) || (!defined __alloca && !defined __GNU_LIBRARY__) diff --git a/recipes/make/config.yml b/recipes/make/config.yml index 0260fd9e5313f..6c7e54ea2509c 100644 --- a/recipes/make/config.yml +++ b/recipes/make/config.yml @@ -1,4 +1,8 @@ versions: + "4.4.1": + folder: all + "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 9edf42d2b8db1..38350b712a514 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 e4046b86f9232..b21cc49efde95 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 dd51a969a8f23..e84afc0329042 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 d120a992c06a6..0a6bc68712d90 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 5f12dfeb0954a..b21cc49efde95 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 74a7f76fab54c..df3894df1372a 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 13b1525cfce34..576fa5d4f935e 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 0000000000000..19168ffa68018 --- /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 84887fbda2ddf..0000000000000 --- 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 087e45138b499..6f5b0ae3b7c45 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 13b534d613bd9..05b8f1775310a 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 9bae1c0958b76..8f42c91d450ee 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 251bf8ae3e3dd..fae501d0afb9e 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 ba90951dd5e1b..5180045c1a180 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 0000000000000..91630d79f4abb --- /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 0000000000000..251bf8ae3e3dd --- /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 1b35d3c154c77..ec12916dc298b 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/mathter/all/conanfile.py b/recipes/mathter/all/conanfile.py index be28b561bbcae..3c07c54ec5fb2 100644 --- a/recipes/mathter/all/conanfile.py +++ b/recipes/mathter/all/conanfile.py @@ -1,20 +1,30 @@ -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 MathterConan(ConanFile): name = "mathter" + description = "Powerful 3D math and small-matrix linear algebra library for games and science." license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/petiaccja/Mathter" - url = "https://github.com/conan-io/conan-center-index/" - description = "Powerful 3D math and small-matrix linear algebra library for games and science." - topics = ("game-dev", "linear-algebra", "vector-math", "matrix-library") + topics = ("game-dev", "linear-algebra", "vector-math", "matrix-library", "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 17 @property def _compilers_minimum_version(self): @@ -25,25 +35,39 @@ def _compilers_minimum_version(self): "Visual Studio": 16, } - def configure(self): + 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, "17") + 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("mathter requires C++17, which your compiler does not support.") + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++{self._min_cppstd}, " + f"which your compiler does not support.") else: - self.output.warn("mathter requires C++17. Your compiler is unknown. Assuming it supports C++17.") + self.output.warning(f"{self.name} requires C++{self._min_cppstd}. " + f"Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("Mathter-" + self.version, self._source_subfolder) - + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def package(self): - self.copy("*.hpp", dst=os.path.join("include", "Mathter"), src=os.path.join(self._source_subfolder, "Mathter")) - self.copy("*.natvis", dst=os.path.join("include", "Mathter"), src=os.path.join(self._source_subfolder, "Mathter")) - self.copy("LICENCE", dst="licenses", src=self._source_subfolder) + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include", "Mathter"), + src=os.path.join(self.source_folder, "Mathter")) + copy(self, "*.natvis", + dst=os.path.join(self.package_folder, "include", "Mathter"), + src=os.path.join(self.source_folder, "Mathter")) + copy(self, "LICENCE", + 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/mathter/all/test_package/CMakeLists.txt b/recipes/mathter/all/test_package/CMakeLists.txt index 27af59f1d203b..e6eb2612386c1 100644 --- a/recipes/mathter/all/test_package/CMakeLists.txt +++ b/recipes/mathter/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(TestPackage CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(mathter REQUIRED CONFIG) add_executable(test_package test_package.cpp) -target_link_libraries(test_package ${CONAN_LIBS}) -target_compile_features(test_package PUBLIC cxx_std_17) +target_link_libraries(test_package PRIVATE mathter::mathter) +target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/mathter/all/test_package/conanfile.py b/recipes/mathter/all/test_package/conanfile.py index 30d42d996e79e..fae501d0afb9e 100644 --- a/recipes/mathter/all/test_package/conanfile.py +++ b/recipes/mathter/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 MathterTestConan(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) @@ -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/mathter/all/test_package/test_package.cpp b/recipes/mathter/all/test_package/test_package.cpp index 9452f0f208fc1..f9de551629038 100644 --- a/recipes/mathter/all/test_package/test_package.cpp +++ b/recipes/mathter/all/test_package/test_package.cpp @@ -3,9 +3,9 @@ int main() { using Vec3 = mathter::Vector; - Vec3 v1 = {1, 0, 3}; - Vec3 v2 = {2, 5, 3}; - auto r = v1 + v2; - std::cout << "Mathter installation works." << std::endl; - return 0; + Vec3 v1 = {1, 0, 3}; + Vec3 v2 = {2, 5, 3}; + auto r = v1 + v2; + std::cout << "Mathter installation works." << std::endl; + return 0; } diff --git a/recipes/mathter/all/test_v1_package/CMakeLists.txt b/recipes/mathter/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/mathter/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/mathter/all/test_v1_package/conanfile.py b/recipes/mathter/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7177bb22dc3a9 --- /dev/null +++ b/recipes/mathter/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class MathterTestConan(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/matio/all/CMakeLists.txt b/recipes/matio/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb9..0000000000000 --- 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 8a659653f91f9..0850bf3d72ee4 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 213dcdf0eba5b..199bb98823415 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 f8b971e2db377..e5b668ec22178 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 f96969845ae24..fae501d0afb9e 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 0000000000000..91630d79f4abb --- /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 0000000000000..3053c8502b32d --- /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 5ec8ba010e8ec..32213bb4d952d 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/mattiasgustavsson-libs/all/conanfile.py b/recipes/mattiasgustavsson-libs/all/conanfile.py index bfba3abb27bab..064ab9c964c61 100644 --- a/recipes/mattiasgustavsson-libs/all/conanfile.py +++ b/recipes/mattiasgustavsson-libs/all/conanfile.py @@ -1,37 +1,53 @@ -from conans import ConanFile, tools -import os.path -import glob +import os + +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 MattiasgustavssonLibsConan(ConanFile): name = "mattiasgustavsson-libs" description = "Single-file public domain libraries for C/C++" - homepage = "https://github.com/mattiasgustavsson/libs" - url = "https://github.com/conan-io/conan-center-index" license = ("Unlicense", "MIT") - topics = ("utilities", "mattiasgustavsson", "libs") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mattiasgustavsson/libs" + topics = ("utilities", "mattiasgustavsson", "libs", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return os.path.join(self.source_folder, "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('libs-*/')[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _extract_licenses(self): - header = tools.load(os.path.join(self._source_subfolder, "thread.h")) - mit_content = header[header.find("ALTERNATIVE A - "):header.find("ALTERNATIVE B -")] - tools.save("LICENSE_MIT", mit_content) - unlicense_content = header[header.find("ALTERNATIVE B - "):header.rfind("*/", 1)] - tools.save("LICENSE_UNLICENSE", unlicense_content) + header = load(self, os.path.join(self.source_folder, "thread.h")) + mit_content = header[header.find("ALTERNATIVE A - ") : header.find("ALTERNATIVE B -")] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE_MIT"), mit_content) + unlicense_content = header[header.find("ALTERNATIVE B - ") : header.rfind("*/", 1)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE_UNLICENSE"), unlicense_content) def package(self): - self.copy(pattern="*.h", dst="include", src=self._source_subfolder) self._extract_licenses() - self.copy("LICENSE_MIT", dst="licenses") - self.copy("LICENSE_UNLICENSE", dst="licenses") + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), 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/mattiasgustavsson-libs/all/test_package/CMakeLists.txt b/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt index 7557711b6dc83..fe3e7c23a7d9b 100644 --- a/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt +++ b/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt @@ -1,8 +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() +find_package(mattiasgustavsson-libs REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE mattiasgustavsson-libs::mattiasgustavsson-libs) diff --git a/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py b/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py +++ b/recipes/mattiasgustavsson-libs/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" + 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/maven/all/conandata.yml b/recipes/maven/all/conandata.yml new file mode 100644 index 0000000000000..f03488696f01d --- /dev/null +++ b/recipes/maven/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "3.9.6": + url: + - "https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz" + - "https://archive.apache.org/dist/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz" + sha256: "6eedd2cae3626d6ad3a5c9ee324bd265853d64297f07f033430755bd0e0c3a4b" + "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://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 new file mode 100644 index 0000000000000..4a59f21e6ca9c --- /dev/null +++ b/recipes/maven/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.47.0" + +class MavenConan(ConanFile): + name = "maven" + description = "Apache Maven is a software project management and comprehension tool." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://maven.apache.org/" + topics = ("build", "project management") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def requirements(self): + self.requires("zulu-openjdk/21.0.1") + + def package_id(self): + del self.info.settings.arch + del self.info.settings.compiler + del self.info.settings.build_type + + 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) + for target in ("bin", "boot", "conf", "lib"): + copy(self, pattern="*", dst=os.path.join(self.package_folder, target), src=os.path.join(self.source_folder, target)) + + def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] diff --git a/recipes/maven/all/test_package/conanfile.py b/recipes/maven/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a44299cfabc6 --- /dev/null +++ b/recipes/maven/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +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 can_run(self): + self.run("mvn --version") diff --git a/recipes/maven/config.yml b/recipes/maven/config.yml new file mode 100644 index 0000000000000..8e2950a3cb156 --- /dev/null +++ b/recipes/maven/config.yml @@ -0,0 +1,7 @@ +versions: + "3.9.6": + folder: all + "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 3d32ee21cb1d7..0000000000000 --- 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 2e2a89aefe311..6768571f77c35 100644 --- a/recipes/mbedtls/all/conandata.yml +++ b/recipes/mbedtls/all/conandata.yml @@ -1,19 +1,34 @@ sources: + "3.5.1": + url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.5.1.tar.gz" + sha256: "0da345cda55ec6f6d71afa84cfae55632a16ba0b8b4644f4d0e8a32c9d1117b0" + "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 84a6a1f32ace2..b5af5483b03f4 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 708448e53f170..5fa9b94ca1217 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 0d20897301b68..b21cc49efde95 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 114a3e62d619d..292e2461de0ef 100644 --- a/recipes/mbedtls/config.yml +++ b/recipes/mbedtls/config.yml @@ -1,13 +1,23 @@ versions: + "3.5.1": + folder: all + "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/conandata.yml b/recipes/mbits-diags/all/conandata.yml index 39c27e3a72100..3bca84056e5f0 100644 --- a/recipes/mbits-diags/all/conandata.yml +++ b/recipes/mbits-diags/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.9.6": + url: "https://github.com/mbits-libs/diags/archive/v0.9.6.tar.gz" + sha256: "db86aa0c4ce1bbfa548a39e046b7872e6f369d668ee433dc5a57cf2a026deb4c" + "0.9.5": + url: "https://github.com/mbits-libs/diags/archive/v0.9.5.tar.gz" + sha256: "5594ad477a9a23012faf50ce0c007351f5073908cf84a3507fc539b74878dd55" "0.9.4": url: "https://github.com/mbits-libs/diags/archive/v0.9.4.tar.gz" sha256: "4fa47e416fa9521c1d268765faf8b313f8e38de249049bc09950a303e11571bf" diff --git a/recipes/mbits-diags/all/conanfile.py b/recipes/mbits-diags/all/conanfile.py index f6c4c3381f0e0..c23670e616dd0 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.2.1") self.requires("mbits-semver/0.1.1") def validate(self): diff --git a/recipes/mbits-diags/config.yml b/recipes/mbits-diags/config.yml index b894994ccfb77..9ac73bad7edeb 100644 --- a/recipes/mbits-diags/config.yml +++ b/recipes/mbits-diags/config.yml @@ -1,3 +1,7 @@ versions: + "0.9.6": + folder: all + "0.9.5": + folder: all "0.9.4": folder: all diff --git a/recipes/mbits-lngs/all/conandata.yml b/recipes/mbits-lngs/all/conandata.yml new file mode 100644 index 0000000000000..a85ddd2561b52 --- /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 0000000000000..49f97626d1e47 --- /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 0000000000000..de4330a77c2a6 --- /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 0000000000000..e3b64136d43e7 --- /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 0000000000000..54cfa70731d8d --- /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 0000000000000..52b142116a700 --- /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 0000000000000..1d3599e3efc2e --- /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 a06f83e964b39..a8cfe1d7dd5a7 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 4d475c04d971c..4ede1237bc36c 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 0ea0db2622ab8..1089c7a6c48f9 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 14c16cdc02a92..8749556609d86 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 8d906d6516e97..fb6aa455469ea 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 876c188b63e35..eff17ed6266f4 100644 --- a/recipes/md4qt/all/conandata.yml +++ b/recipes/md4qt/all/conandata.yml @@ -1,4 +1,85 @@ sources: + "2.5.0": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.5.0.tar.gz" + sha256: "5965552f15d37475f37f644feaee62a89225312e1c82e813b7a119943d82c808" + "2.4.4": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.4.4.tar.gz" + sha256: "03995edbfe6047d047bcd3c5bb4824c3644927437bb60a95f8a3a9c7096ae981" + "2.4.3": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.4.3.tar.gz" + sha256: "b899a290c09ab073341d8924ebbd43694226d9122e0e174264d3a3770814bb15" + "2.4.2": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.4.2.tar.gz" + sha256: "76f3228dd9afa2661fe9326b51e5ec8dc29e364f99fb0f94704792610d543fa2" + "2.4.1": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.4.1.tar.gz" + sha256: "61a439206e1ed2e68702c9811e3055d0adfda5945fb098ea7bfe8906c33d7b49" + "2.4.0": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.4.0.tar.gz" + sha256: "a53c6fb33cfef23f91cc6e967b538cd1940bb765041a0c1c4ac3aa20bf0b5c7c" + "2.3.9": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.9.tar.gz" + sha256: "0ff833b179e01866296a8b2e36b09c19936c2e4434d9e542be389d8104809523" + "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 ce75e30212e5e..90fcedd907a99 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 c78095722f7aa..b5553413c7eed 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 b24e1b03fbf83..b21cc49efde95 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 df702b6f48d7c..e62a3cb2d7440 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 9e06767160daf..b315c5ff7a964 100644 --- a/recipes/md4qt/config.yml +++ b/recipes/md4qt/config.yml @@ -1,4 +1,58 @@ versions: + "2.5.0": + folder: all + "2.4.4": + folder: all + "2.4.3": + folder: all + "2.4.2": + folder: all + "2.4.1": + folder: all + "2.4.0": + folder: all + "2.3.9": + folder: all + "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 ef0896308dfb2..67326bafe7dd9 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 aa012f43092fc..6842da5a57847 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 c7366be61abf1..351413082436f 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 6c0a50e0f7678..ef5d7042163ec 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 b27d9acd4f04b..57ae843c7e0c0 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 0000000000000..91630d79f4abb --- /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 0000000000000..6dffe66394a26 --- /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 cdb4b7bded43e..59538424539ea 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/mdnsresponder/all/conandata.yml b/recipes/mdnsresponder/all/conandata.yml index cadda75d51e61..c11cf45776081 100644 --- a/recipes/mdnsresponder/all/conandata.yml +++ b/recipes/mdnsresponder/all/conandata.yml @@ -5,23 +5,29 @@ sources: "1310.140.1": url: "https://github.com/apple-oss-distributions/mDNSResponder/archive/mDNSResponder-1310.140.1.tar.gz" sha256: "ecb0043ffc5a3cbf4f43da0298e351d787654d980b291d1cb567c6ddee9dc983" + "1790.80.10": + url: "https://github.com/apple-oss-distributions/mDNSResponder/archive/mDNSResponder-1790.80.10.tar.gz" + sha256: "ffb990231639dfe8c7f0b15d0665206a9013f1aacfb2cbb934eb87f6a57f38b7" patches: "878.200.35": - - base_path: "source_subfolder" - patch_file: "patches/878.200.35/DLLStub.c.patch" - - base_path: "source_subfolder" - patch_file: "patches/878.200.35/mDNSResponder.sln.patch" - - base_path: "source_subfolder" - patch_file: "patches/878.200.35/mDNSWin32.c.patch" - - base_path: "source_subfolder" - patch_file: "patches/878.200.35/Service.c.patch" + - patch_file: "patches/878.200.35/DLLStub.c.patch" + - patch_file: "patches/878.200.35/mDNSResponder.sln.patch" + - patch_file: "patches/878.200.35/mDNSWin32.c.patch" + - patch_file: "patches/878.200.35/Service.c.patch" + - patch_file: "patches/878.200.35/upgrade-windows-toolset.patch" "878.200.35-opt": - - base_path: "source_subfolder" - patch_file: "patches/878.200.35/opt/permit-over-long-service-types.patch" - - base_path: "source_subfolder" - patch_file: "patches/878.200.35/opt/poll-rather-than-select.patch" - - base_path: "source_subfolder" - patch_file: "patches/878.200.35/opt/unicast.patch" + - patch_file: "patches/878.200.35/opt/permit-over-long-service-types.patch" + - patch_file: "patches/878.200.35/opt/poll-rather-than-select.patch" + - patch_file: "patches/878.200.35/opt/unicast.patch" "1310.140.1": - - base_path: "source_subfolder" - patch_file: "patches/1310.140.1/dns_sd.c.patch" + - patch_file: "patches/1310.140.1/dns_sd.c.patch" + "1790.80.10": + - patch_file: "patches/1790.80.10/Resolve-compile-problem-on-linux-platform.patch" + patch_description: "ensure the compilation passes on Linux: update mDNS.c, mbedtls.c and uds_daemon.c to resolve compilation errors." + patch_type: "bugfix" + - patch_file: "patches/1790.80.10/Support-cross-building.patch" + patch_description: "allow dependencies provided by conan and support cross-building for linux:update Makefile to use dependencies provided by conan and support cross-building." + patch_type: "conan" + - patch_file: "patches/1790.80.10/Add-unicast-disabled-flag.patch" + patch_description: "add missing unicast cropping option: update Makefile to add missing cropping option, and update uDNS.c to resolve related compilation errors." + patch_type: "bugfix" diff --git a/recipes/mdnsresponder/all/conanfile.py b/recipes/mdnsresponder/all/conanfile.py index 5e0b8a3e6f765..9200f80247bf5 100644 --- a/recipes/mdnsresponder/all/conanfile.py +++ b/recipes/mdnsresponder/all/conanfile.py @@ -1,14 +1,19 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild -from conans.errors import ConanInvalidConfiguration -from conan.tools.files.symlinks import absolute_to_relative_symlinks +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import symlinks, rmdir, get, replace_in_file, rename, chdir, patch, mkdir, copy, apply_conandata_patches +from conan.tools.scm import Version +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuild, is_msvc, MSBuildToolchain, VCVars import os -required_conan_version = ">=1.33.0" + +required_conan_version = ">=1.53.0" class MdnsResponderConan(ConanFile): name = "mdnsresponder" - description = "Conan package for Apple's mDNSResponder" + description = "Apple Open Source DNS Service Discovery Collection" topics = ("Bonjour", "DNS-SD", "mDNS") url = "https://github.com/conan-io/conan-center-index" homepage = "https://opensource.apple.com/tarballs/mDNSResponder/" @@ -16,52 +21,75 @@ class MdnsResponderConan(ConanFile): settings = "os", "arch", "compiler", "build_type" options = { "with_opt_patches": [True, False], + "use_tls": [True, False], + "unicast_disabled": [True, False], } default_options = { "with_opt_patches": False, + "use_tls": False, + "unicast_disabled": False, } - exports_sources = ["patches/**"] - _autotools = None + def export_sources(self): + # INFO: export_conandata_patches will not export optional patches + copy(self, "*.patch", dst=os.path.join(self.export_sources_folder, "patches"), src=os.path.join(self.recipe_folder, "patches")) - @property - def _source_subfolder(self): - return "source_subfolder" + def configure(self): + if self.options.use_tls: + #The target(libdns_sd) is a shared lib, so mbedtls enable 'shared' option + self.options['mbedtls'].shared = True + + def requirements(self): + if self.options.use_tls: + self.requires("mbedtls/2.25.0") + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): if self.settings.os not in ["Linux", "Windows"]: raise ConanInvalidConfiguration("Only Linux and Windows are supported for this package.") - if tools.Version(self.version) >= "1096.0.2": + if Version(self.version) >= "1096.0.2": # recent tarballs (since 1096.0.2) are missing mDNSWindows, so for now, Linux only if self.settings.os == "Windows": raise ConanInvalidConfiguration("Windows is not supported for version {}.".format(self.version)) # TCP_NOTSENT_LOWAT is causing build failures for packages built with gcc 4.9 # the best check would probably be for Linux kernel v3.12, but for now... - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration("Only gcc 5 or higher is supported for this package.") # __has_c_attribute is not available in Clang 5 - if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) < "6": + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "6": raise ConanInvalidConfiguration("Only Clang 6 or higher is supported for this package.") # FIXME: Migration of the project files fails with VS 2017 on c3i (conan-center-index's infrastructure) # though works OK with VS 2015 and VS 2019, and works with VS 2017 in my local environment - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) == "15": + if is_msvc(self) and (Version(self.settings.compiler.version) == "15" or "1910" <= Version(self.settings.compiler.version) <= "1916"): raise ConanInvalidConfiguration("Visual Studio 2017 is not supported in CCI (yet).") + if self.options.use_tls and (not self.dependencies["mbedtls"].options.shared): + raise ConanInvalidConfiguration("The dependency 'mbedtls' must be built as a shared library.") 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 _posix_folder(self): - return os.path.join(self._source_subfolder, "mDNSPosix") + return os.path.join(self.source_folder, "mDNSPosix") @property def _make_build_args(self): # the Makefile does not support parallel builds - return [ + build_args = [ "os=linux", "-j1", ] + if not self.options.use_tls: + build_args.append("tls=no") + #FIXME: 878.200.35 and 1310.140.1 will fail to compile when DEBUG=1 + if self.settings.build_type == "Debug" and Version(self.version) != "878.200.35" and Version(self.version) != "1310.140.1": + build_args.append("DEBUG=1") + if self.options.unicast_disabled: + build_args.append("unicast_disabled=y") + + return build_args @property def _make_build_targets(self): @@ -80,17 +108,9 @@ def _make_install_targets(self): # not installing man pages, NSS plugin return " ".join(["setup", "InstalledDaemon", "InstalledLib", "InstalledClients"]) - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - # fix for error: 'for' loop initial declarations are only allowed in C99 or C11 mode - self._autotools.flags.append("-std=gnu99") - return self._autotools - def _build_make(self): - with tools.chdir(self._posix_folder): - autotools = self._configure_autotools() + with chdir(self, self._posix_folder): + autotools = Autotools(self) autotools.make(args=self._make_build_args, target=self._make_build_targets) @property @@ -110,31 +130,48 @@ def _msvc_platform(self): return self._msvc_platforms[str(self.settings.arch)] def _build_msvc(self): - sln = os.path.join(self._source_subfolder, "mDNSResponder.sln") + sln = os.path.join(self.source_folder, "mDNSResponder.sln") if "MD" in self.settings.compiler.runtime: # could use glob and replace_in_file(strict=False, ...) - dll_vcxproj = os.path.join(self._source_subfolder, "mDNSWindows", "DLL", "dnssd.vcxproj") - dllstub_vcxproj = os.path.join(self._source_subfolder, "mDNSWindows", "DLLStub", "DLLStub.vcxproj") - dns_sd_vcxproj = os.path.join(self._source_subfolder, "Clients", "DNS-SD.VisualStudio", "dns-sd.vcxproj") + dll_vcxproj = os.path.join(self.source_folder, "mDNSWindows", "DLL", "dnssd.vcxproj") + dllstub_vcxproj = os.path.join(self.source_folder, "mDNSWindows", "DLLStub", "DLLStub.vcxproj") + dns_sd_vcxproj = os.path.join(self.source_folder, "Clients", "DNS-SD.VisualStudio", "dns-sd.vcxproj") for vcxproj in [dll_vcxproj, dllstub_vcxproj, dns_sd_vcxproj]: - tools.replace_in_file(vcxproj, "MultiThreaded", "MultiThreadedDLL") - tools.replace_in_file(vcxproj, "MultiThreadedDebug", "MultiThreadedDebugDLL") + replace_in_file(self, vcxproj, "MultiThreaded", "MultiThreadedDLL") + replace_in_file(self, vcxproj, "MultiThreadedDebug", "MultiThreadedDebugDLL") # could use glob and replace_in_file(strict=False, ...) - dll_rc = os.path.join(self._source_subfolder, "mDNSWindows", "DLL", "dll.rc") - dns_sd_rc = os.path.join(self._source_subfolder, "Clients", "DNS-SD.VisualStudio", "dns-sd.rc") + dll_rc = os.path.join(self.source_folder, "mDNSWindows", "DLL", "dll.rc") + dns_sd_rc = os.path.join(self.source_folder, "Clients", "DNS-SD.VisualStudio", "dns-sd.rc") for rc in [dll_rc, dns_sd_rc]: - tools.replace_in_file(rc, "afxres.h", "winres.h") + replace_in_file(self, rc, "afxres.h", "winres.h") msbuild = MSBuild(self) - msbuild.build(sln, targets=self._msvc_targets, platforms=self._msvc_platforms, definitions=self._msvc_definitions) + # use Win32 instead of the default value when building x86 + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + #TODO: How to add _msvc_definitions to msbuild.build + msbuild.build(sln, targets=self._msvc_targets) + + def generate(self): + if self.settings.os == "Linux": + tc = AutotoolsToolchain(self) + # fix for error: 'for' loop initial declarations are only allowed in C99 or C11 mode + tc.extra_cflags.append("-std=gnu99") + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + elif is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = "Debug" if self.settings.build_type == "Debug" else "Release" + tc.generate() + tc = VCVars(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) if self.options.with_opt_patches: - for patch in self.conan_data.get("patches", {}).get("{}-opt".format(self.version), []): - tools.patch(**patch) + for patchfile in self.conan_data.get("patches", {}).get("{}-opt".format(self.version), []): + patch(self, **patchfile) if self.settings.os == "Linux": self._build_make() elif self.settings.os == "Windows": @@ -142,31 +179,31 @@ def build(self): def _install_make(self): for dir in ["bin", "include", "lib", "sbin"]: - tools.mkdir(os.path.join(self.package_folder, dir)) - with tools.chdir(self._posix_folder): - autotools = self._configure_autotools() + mkdir(self, os.path.join(self.package_folder, dir)) + with chdir(self, self._posix_folder): + autotools = Autotools(self) autotools.make(args=self._make_install_args, target=self._make_install_targets) # package the daemon in bin too - tools.rename(os.path.join(self.package_folder, "sbin", "mdnsd"), + rename(self, os.path.join(self.package_folder, "sbin", "mdnsd"), os.path.join(self.package_folder, "bin", "mdnsd")) - tools.rmdir(os.path.join(self.package_folder, "sbin")) - absolute_to_relative_symlinks(self, self.package_folder) + rmdir(self, os.path.join(self.package_folder, "sbin")) + symlinks.absolute_to_relative_symlinks(self, self.package_folder) def _msvc_build_folder(self, *argv): - return os.path.join(self._source_subfolder, *argv, self._msvc_platform, str(self.settings.build_type)) + return os.path.join(self.source_folder, *argv, self._msvc_platform, str(self.settings.build_type)) def _install_msvc(self): - self.copy("mDNSResponder.exe", dst="bin", src=self._msvc_build_folder("mDNSWindows", "SystemService")) - self.copy("dns_sd.h", dst="include", src=os.path.join(self._source_subfolder, "mDNSShared")) - self.copy("dnssd.dll", dst="bin", src=self._msvc_build_folder("mDNSWindows", "DLL")) - self.copy("dnssdStatic.lib", dst="lib", src=self._msvc_build_folder("mDNSWindows", "DLLStub")) + copy(self, "mDNSResponder.exe", dst=os.path.join(self.package_folder, "bin"), src=self._msvc_build_folder("mDNSWindows", "SystemService")) + copy(self, "dns_sd.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "mDNSShared")) + copy(self, "dnssd.dll", dst=os.path.join(self.package_folder, "bin"), src=self._msvc_build_folder("mDNSWindows", "DLL")) + copy(self, "dnssdStatic.lib", dst=os.path.join(self.package_folder, "lib"), src=self._msvc_build_folder("mDNSWindows", "DLLStub")) # rename consistently with Bonjour SDK - tools.rename(src=os.path.join(self.package_folder, "lib", "dnssdStatic.lib"), + rename(self, src=os.path.join(self.package_folder, "lib", "dnssdStatic.lib"), dst=os.path.join(self.package_folder, "lib", "dnssd.lib")) - self.copy("dns-sd.exe", dst="bin", src=self._msvc_build_folder("Clients", "DNS-SD.VisualStudio")) + copy(self, "dns-sd.exe", dst=os.path.join(self.package_folder, "bin"), src=self._msvc_build_folder("Clients", "DNS-SD.VisualStudio")) 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) if self.settings.os == "Linux": self._install_make() elif self.settings.os == "Windows": @@ -176,6 +213,9 @@ def package_info(self): # although not one of the find-modules in the CMake distribution, FindDNSSD.cmake is commonly used for this package self.cpp_info.names["cmake_find_package"] = "DNSSD" self.cpp_info.names["cmake_find_package_multi"] = "DNSSD" + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "DNSSD") + self.cpp_info.set_property("cmake_target_name", "DNSSD::DNSSD") if self.settings.os == "Linux": self.cpp_info.libs = ["dns_sd"] diff --git a/recipes/mdnsresponder/all/patches/1790.80.10/Add-unicast-disabled-flag.patch b/recipes/mdnsresponder/all/patches/1790.80.10/Add-unicast-disabled-flag.patch new file mode 100644 index 0000000000000..a0817cef24722 --- /dev/null +++ b/recipes/mdnsresponder/all/patches/1790.80.10/Add-unicast-disabled-flag.patch @@ -0,0 +1,28 @@ +diff --git a/mDNSCore/uDNS.c b/mDNSCore/uDNS.c +index 5611517..cfbc7b4 100644 +--- a/mDNSCore/uDNS.c ++++ b/mDNSCore/uDNS.c +@@ -7243,7 +7243,7 @@ mDNSexport mStatus mDNS_SetSecretForDomain(mDNS *m, DomainAuthInfo *info, const + return mStatus_UnsupportedErr; + } + +-mDNSexport domainname *uDNS_GetNextSearchDomain(mDNSInterfaceID InterfaceID, mDNSs8 *searchIndex, mDNSBool ignoreDotLocal) ++mDNSexport domainname *uDNS_GetNextSearchDomain(mDNSInterfaceID InterfaceID, int *searchIndex, mDNSBool ignoreDotLocal) + { + (void) InterfaceID; + (void) searchIndex; +diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile +index f695228..179ab8d 100755 +--- a/mDNSPosix/Makefile ++++ b/mDNSPosix/Makefile +@@ -81,6 +81,10 @@ LINKOPTS_PTHREAD = -lpthread + LDSUFFIX = so + JAVACFLAGS_OS = -fPIC -shared -ldns_sd + ++ifeq ($(unicast_disabled), y) ++CFLAGS_COMMON += -DUNICAST_DISABLED ++endif ++ + # Set up diverging paths for debug vs. prod builds + ifeq "$(DEBUG)" "1" + CFLAGS_DEBUGGING = -g -DMDNS_DEBUGMSGS=2 diff --git a/recipes/mdnsresponder/all/patches/1790.80.10/Resolve-compile-problem-on-linux-platform.patch b/recipes/mdnsresponder/all/patches/1790.80.10/Resolve-compile-problem-on-linux-platform.patch new file mode 100644 index 0000000000000..11a00e0f60c5f --- /dev/null +++ b/recipes/mdnsresponder/all/patches/1790.80.10/Resolve-compile-problem-on-linux-platform.patch @@ -0,0 +1,58 @@ +diff --git a/mDNSCore/mDNS.c b/mDNSCore/mDNS.c +index 9466634..d60c6f2 100644 +--- a/mDNSCore/mDNS.c ++++ b/mDNSCore/mDNS.c +@@ -9849,7 +9849,7 @@ mDNSlocal void mDNSCoreReceiveNoUnicastAnswers(mDNS *const m, const DNSMessage * + #else + const DNSServRef dnsserv = qptr->qDNSServer; + #endif +- debugf("mDNSCoreReceiveNoUnicastAnswers making negative cache entry TTL %d for %##s (%s)", negttl, name->c, DNSTypeName(q.qtype)); ++ debugf("mDNSCoreReceiveNoUnicastAnswers making negative cache entry TTL %d for %##s (%s)", negttl, currentQName->c, DNSTypeName(q.qtype)); + // Create a negative record for the current name in the CNAME chain. + MakeNegativeCacheRecord(m, &m->rec.r, currentQName, currentQNameHash, q.qtype, q.qclass, negttl, mDNSInterface_Any, + dnsserv, response->h.flags); +diff --git a/mDNSPosix/mbedtls.c b/mDNSPosix/mbedtls.c +index a73681b..dba44b9 100644 +--- a/mDNSPosix/mbedtls.c ++++ b/mDNSPosix/mbedtls.c +@@ -218,10 +218,12 @@ mDNSPosixTLSRead(TCPSocket *sock, void *buf, unsigned long buflen, mDNSBool *clo + // and then re-enable read events. What we don't want is to keep calling + // read, because that will spin. + return 0; ++#ifdef MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS + case MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS: + LogRedact(MDNS_LOG_CATEGORY_DEFAULT, MDNS_LOG_ERROR, "Got async in progress in TLS read!"); + // No idea how to handle this yet. + return 0; ++#endif + #ifdef MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS + case MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS: + LogRedact(MDNS_LOG_CATEGORY_DEFAULT, MDNS_LOG_ERROR, "Got crypto in progress in TLS read!"); +@@ -259,9 +261,11 @@ mDNSPosixTLSWrite(TCPSocket *sock, const void *buf, unsigned long buflen) + case MBEDTLS_ERR_SSL_WANT_WRITE: + LogRedact(MDNS_LOG_CATEGORY_DEFAULT, MDNS_LOG_ERROR, "Got SSL want write in TLS read!"); + return 0; ++#ifdef MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS + case MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS: + LogRedact(MDNS_LOG_CATEGORY_DEFAULT, MDNS_LOG_ERROR, "Got async in progress in TLS read!"); + return 0; ++#endif + #ifdef MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS + case MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS: + LogRedact(MDNS_LOG_CATEGORY_DEFAULT, MDNS_LOG_ERROR, "Got crypto in progress in TLS read!"); +diff --git a/mDNSShared/uds_daemon.c b/mDNSShared/uds_daemon.c +index bfcb5d8..7475784 100644 +--- a/mDNSShared/uds_daemon.c ++++ b/mDNSShared/uds_daemon.c +@@ -2913,7 +2913,11 @@ exit: + mDNSlocal mStatus add_domain_to_browser(request_state *info, const domainname *d) + { + browser_t *b, *p; ++#if MDNSRESPONDER_PLATFORM_APPLE + __block mStatus err; ++#else ++ mStatus err; ++#endif + + for (p = info->u.browser.browsers; p; p = p->next) + { diff --git a/recipes/mdnsresponder/all/patches/1790.80.10/Support-cross-building.patch b/recipes/mdnsresponder/all/patches/1790.80.10/Support-cross-building.patch new file mode 100644 index 0000000000000..e74fc81741998 --- /dev/null +++ b/recipes/mdnsresponder/all/patches/1790.80.10/Support-cross-building.patch @@ -0,0 +1,158 @@ +diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile +index 802a13d..440b4b2 100755 +--- a/mDNSPosix/Makefile ++++ b/mDNSPosix/Makefile +@@ -37,7 +37,13 @@ + + ############################################################################# + +-LIBVERS = 1 ++ ++ ++LIB_MAJOR_VER = 1 ++LIB_MINOR_VER = 0 ++LIB_PATCH_VER = 0 ++LIBVERS = $(LIB_MAJOR_VER).$(LIB_MINOR_VER).$(LIB_PATCH_VER) ++ + + COREDIR = ../mDNSCore + SHAREDDIR ?= ../mDNSShared +@@ -53,18 +59,24 @@ else ifeq ($(SYSTEM), Linux) + os=linux + endif + +-CC = cc ++ifneq ($(findstring $(os),solaris x),) ++CC ?= gcc ++LD ?= gcc ++else ++CC ?= cc ++LD ?= ld ++endif ++ + BISON = bison + FLEX = flex +-ST = strip +-LD = ld ++STRIP ?= strip + SOOPTS = -shared + CP = cp + RM = rm + LN = ln -s -f + CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(UTILDIR) -I$(DSODIR) -I$(SERVICEREGISTRATIONDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPOSIX_BUILD -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" + CFLAGS_PTHREAD = +-LINKOPTS = ++LINKOPTS += ${LDFLAGS} -Wl,--as-needed $(LIBS) + LINKOPTS_PTHREAD = -lpthread + LDSUFFIX = so + JAVACFLAGS_OS = -fPIC -shared -ldns_sd +@@ -74,13 +86,13 @@ ifeq "$(DEBUG)" "1" + CFLAGS_DEBUGGING = -g -DMDNS_DEBUGMSGS=2 + OBJDIR = objects/debug + BUILDDIR = build/debug +-STRIP = echo ++MDNS_STRIP = echo + else + ifeq "$(DEBUGSYMS)" "1" + CFLAGS_DEBUGGING = -g -DMDNS_DEBUGMSGS=0 + OBJDIR = objects/prod + BUILDDIR = build/prod +-STRIP = echo ++MDNS_STRIP = echo + else + # We use -Os for two reasons: + # 1. We want to make small binaries, suitable for putting into hardware devices +@@ -88,7 +100,7 @@ else + CFLAGS_DEBUGGING = -g -DMDNS_DEBUGMSGS=0 + OBJDIR ?= objects/prod + BUILDDIR ?= build/prod +-STRIP = $(ST) -S ++MDNS_STRIP = $(STRIP) -S + endif + endif + +@@ -97,13 +109,11 @@ ifeq ($(os),solaris) + CFLAGS_DEBUGGING = -O0 -DMDNS_DEBUGMSGS=0 + CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \ + -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -DTARGET_OS_SOLARIS +-CC = gcc +-LD = gcc + SOOPTS = -shared +-LINKOPTS = -lsocket -lnsl -lresolv ++LINKOPTS += -lsocket -lnsl -lresolv + JAVACFLAGS_OS += -I$(JDK)/include/solaris + ifneq ($(DEBUG),1) +-STRIP = $(ST) ++MDNS_STRIP = $(STRIP) + endif + else + +@@ -114,7 +124,7 @@ CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LI + TLSOBJS = + else + CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -DPOSIX_HAS_TLS -ftabstop=4 -Wno-expansion-to-defined +-TLSOBJS = $(OBJDIR)/mbedtls.c.o -lmbedtls -lmbedcrypto ++TLSOBJS = $(OBJDIR)/mbedtls.c.o + endif + LD = $(CC) + SOOPTS = -shared +@@ -162,10 +172,9 @@ CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror -Wdeclaration-after-statement \ + -D__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 \ + -DHAVE_STRLCPY=1 -DTARGET_OS_MAC \ + -D__APPLE_USE_RFC_2292 #-Wunreachable-code +-CC = gcc + LD = $(CC) + SOOPTS = -dynamiclib +-LINKOPTS = -lSystem ++LINKOPTS += -lSystem + LDSUFFIX = dylib + JDK = /System/Library/Frameworks/JavaVM.framework/Home + JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM +@@ -229,7 +238,7 @@ endif + endif + endif + +-MDNSCFLAGS = $(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUGGING) ++MDNSCFLAGS = $(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUGGING) $(CPPFLAGS) $(CXXFLAGS) + + ############################################################################# + +@@ -267,7 +276,7 @@ Daemon: setup $(BUILDDIR)/mdnsd + + $(BUILDDIR)/mdnsd: $(DAEMONOBJS) + $(CC) -o $@ $+ $(LINKOPTS) +- $(STRIP) $@ ++ $(MDNS_STRIP) $@ + + # libdns_sd target builds the client library + libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) +@@ -276,8 +285,8 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) + CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o $(OBJDIR)/dnssd_errstring.c.so.o + + $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) +- $(LD) $(SOOPTS) $(LINKOPTS) -o $@ $+ +- $(STRIP) $@ ++ $(LD) $(SOOPTS) $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).$(LIB_MAJOR_VER) -o $@ $+ ++ $(MDNS_STRIP) $@ + + Clients: setup libdns_sd ../Clients/build/dns-sd + @echo "Clients done" +@@ -291,7 +300,7 @@ nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE) + + $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o + $(LD) $(SOOPTS) $(LINKOPTS) -o $@ $+ +- $(STRIP) $@ ++ $(MDNS_STRIP) $@ + + ############################################################################# + +@@ -322,7 +331,8 @@ $(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAM + + $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX) + $(CP) $< $@ +- $(LN) $@ $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX) ++ $(LN) libdns_sd.$(LDSUFFIX).$(LIBVERS) $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIB_MAJOR_VER) ++ $(LN) libdns_sd.$(LDSUFFIX).$(LIB_MAJOR_VER) $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX) + ifdef LDCONFIG + # -m means 'merge into existing database', -R means 'rescan directories' + $(LDCONFIG) -mR diff --git a/recipes/mdnsresponder/all/patches/878.200.35/upgrade-windows-toolset.patch b/recipes/mdnsresponder/all/patches/878.200.35/upgrade-windows-toolset.patch new file mode 100644 index 0000000000000..082e2a6d8b4d6 --- /dev/null +++ b/recipes/mdnsresponder/all/patches/878.200.35/upgrade-windows-toolset.patch @@ -0,0 +1,570 @@ +diff --git a/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj b/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj +index 8ed154a..e21d9de 100755 +--- a/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj ++++ b/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj +@@ -26,18 +26,22 @@ + + Application + MultiByte ++ v142 + + + Application + MultiByte ++ v142 + + + Application + MultiByte ++ v142 + + + Application + MultiByte ++ v142 + + + +diff --git a/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj b/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj +index 810c90e..87fe301 100755 +--- a/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj ++++ b/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj +@@ -34,24 +34,32 @@ + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + Application ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 ++ ++ ++ v142 + + + +diff --git a/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj b/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj +index fb96fd3..faef74e 100755 +--- a/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj ++++ b/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj +@@ -35,24 +35,32 @@ + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + Application ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 ++ ++ ++ v142 + + + +diff --git a/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj b/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj +index 4fb6490..9471cec 100755 +--- a/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj ++++ b/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj +@@ -34,24 +34,32 @@ + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + Application ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 ++ ++ ++ v142 + + + +diff --git a/Clients/FirefoxExtension/FirefoxExtension.vcxproj b/Clients/FirefoxExtension/FirefoxExtension.vcxproj +index 1d02a4e..3999920 100755 +--- a/Clients/FirefoxExtension/FirefoxExtension.vcxproj ++++ b/Clients/FirefoxExtension/FirefoxExtension.vcxproj +@@ -18,11 +18,13 @@ + DynamicLibrary + false + MultiByte ++ v142 + + + DynamicLibrary + false + MultiByte ++ v142 + + + +diff --git a/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj b/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj +index 563597e..558320e 100755 +--- a/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj ++++ b/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj +@@ -35,24 +35,32 @@ + Application + Static + MultiByte ++ v142 + + + Application + Static + MultiByte ++ v142 + + + Application ++ v142 + + + Application + Static + MultiByte ++ v142 + + + Application + Static + MultiByte ++ v142 ++ ++ ++ v142 + + + +diff --git a/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj b/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj +index 86affb8..efbb143 100755 +--- a/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj ++++ b/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj +@@ -35,24 +35,32 @@ + DynamicLibrary + Static + MultiByte ++ v142 + + + DynamicLibrary + Static + MultiByte ++ v142 + + + Application ++ v142 + + + DynamicLibrary + Static + MultiByte ++ v142 + + + DynamicLibrary + Static + MultiByte ++ v142 ++ ++ ++ v142 + + + +diff --git a/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj b/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj +index 16befa7..3cf521c 100755 +--- a/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj ++++ b/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj +@@ -35,24 +35,32 @@ + DynamicLibrary + Static + MultiByte ++ v142 + + + DynamicLibrary + Static + MultiByte ++ v142 + + + Application ++ v142 + + + DynamicLibrary + Static + MultiByte ++ v142 + + + DynamicLibrary + Static + MultiByte ++ v142 ++ ++ ++ v142 + + + +diff --git a/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj b/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj +index 89a27a4..a26a972 100755 +--- a/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj ++++ b/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj +@@ -28,19 +28,23 @@ + Application + Unicode + true ++ v142 + + + Application + Unicode + true ++ v142 + + + Application + Unicode ++ v142 + + + Application + Unicode ++ v142 + + + +diff --git a/mDNSWindows/ControlPanel/ControlPanel.vcxproj b/mDNSWindows/ControlPanel/ControlPanel.vcxproj +index c341d42..0b82bea 100755 +--- a/mDNSWindows/ControlPanel/ControlPanel.vcxproj ++++ b/mDNSWindows/ControlPanel/ControlPanel.vcxproj +@@ -28,19 +28,23 @@ + Application + Static + MultiByte ++ v142 + + + Application + Static ++ v142 + + + Application + Static + MultiByte ++ v142 + + + Application + Static ++ v142 + + + +diff --git a/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj b/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj +index bc51708..4633fe4 100755 +--- a/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj ++++ b/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj +@@ -36,24 +36,32 @@ + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + Application ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 ++ ++ ++ v142 + + + +diff --git a/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj b/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj +index 321e5ee..37fd041 100755 +--- a/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj ++++ b/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj +@@ -34,24 +34,32 @@ + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + Application ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 ++ ++ ++ v142 + + + +diff --git a/mDNSWindows/DLL/dnssd.vcxproj b/mDNSWindows/DLL/dnssd.vcxproj +index 7438a3a..0a6a50e 100755 +--- a/mDNSWindows/DLL/dnssd.vcxproj ++++ b/mDNSWindows/DLL/dnssd.vcxproj +@@ -28,18 +28,22 @@ + + DynamicLibrary + MultiByte ++ v142 + + + DynamicLibrary + MultiByte ++ v142 + + + DynamicLibrary + MultiByte ++ v142 + + + DynamicLibrary + MultiByte ++ v142 + + + +diff --git a/mDNSWindows/DLLStub/DLLStub.vcxproj b/mDNSWindows/DLLStub/DLLStub.vcxproj +index 292d931..0f3fd11 100755 +--- a/mDNSWindows/DLLStub/DLLStub.vcxproj ++++ b/mDNSWindows/DLLStub/DLLStub.vcxproj +@@ -29,24 +29,28 @@ + false + Unicode + false ++ v142 + + + StaticLibrary + false + Unicode + false ++ v142 + + + StaticLibrary + false + Unicode + false ++ v142 + + + StaticLibrary + false + Unicode + false ++ v142 + + + +diff --git a/mDNSWindows/DLLX/DLLX.vcxproj b/mDNSWindows/DLLX/DLLX.vcxproj +index a57e4ed..6c414b7 100755 +--- a/mDNSWindows/DLLX/DLLX.vcxproj ++++ b/mDNSWindows/DLLX/DLLX.vcxproj +@@ -28,23 +28,27 @@ + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + false + Static + Unicode ++ v142 + + + DynamicLibrary + Static + Unicode ++ v142 + + + DynamicLibrary + false + Static + Unicode ++ v142 + + + +diff --git a/mDNSWindows/NSPTool/NSPTool.vcxproj b/mDNSWindows/NSPTool/NSPTool.vcxproj +index 7c86852..f676f42 100755 +--- a/mDNSWindows/NSPTool/NSPTool.vcxproj ++++ b/mDNSWindows/NSPTool/NSPTool.vcxproj +@@ -26,18 +26,22 @@ + + Application + MultiByte ++ v142 + + + Application + MultiByte ++ v142 + + + Application + MultiByte ++ v142 + + + Application + MultiByte ++ v142 + + + +diff --git a/mDNSWindows/SystemService/Service.vcxproj b/mDNSWindows/SystemService/Service.vcxproj +index c0eb7a0..4a9ee1c 100755 +--- a/mDNSWindows/SystemService/Service.vcxproj ++++ b/mDNSWindows/SystemService/Service.vcxproj +@@ -28,18 +28,22 @@ + + Application + MultiByte ++ v142 + + + Application + MultiByte ++ v142 + + + Application + MultiByte ++ v142 + + + Application + MultiByte ++ v142 + + + +diff --git a/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj b/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj +index 71b2b98..e844f9a 100755 +--- a/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj ++++ b/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj +@@ -26,18 +26,22 @@ + + DynamicLibrary + MultiByte ++ v142 + + + DynamicLibrary + MultiByte ++ v142 + + + DynamicLibrary + MultiByte ++ v142 + + + DynamicLibrary + MultiByte ++ v142 + + + diff --git a/recipes/mdnsresponder/all/test_package/CMakeLists.txt b/recipes/mdnsresponder/all/test_package/CMakeLists.txt index 34af13462f44f..5814f8fe93b5d 100644 --- a/recipes/mdnsresponder/all/test_package/CMakeLists.txt +++ b/recipes/mdnsresponder/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES C) + +find_package(DNSSD REQUIRED CONFIG) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE DNSSD::DNSSD) diff --git a/recipes/mdnsresponder/all/test_package/conanfile.py b/recipes/mdnsresponder/all/test_package/conanfile.py index fdb9f346a1da9..e845ae751a301 100644 --- a/recipes/mdnsresponder/all/test_package/conanfile.py +++ b/recipes/mdnsresponder/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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) 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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mdnsresponder/all/test_v1_package/CMakeLists.txt b/recipes/mdnsresponder/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a4d5a242ce134 --- /dev/null +++ b/recipes/mdnsresponder/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/mdnsresponder/all/test_v1_package/conanfile.py b/recipes/mdnsresponder/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/mdnsresponder/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/mdnsresponder/config.yml b/recipes/mdnsresponder/config.yml index a8ca75314b5a1..a7592a4b20916 100644 --- a/recipes/mdnsresponder/config.yml +++ b/recipes/mdnsresponder/config.yml @@ -3,3 +3,5 @@ versions: folder: all "1310.140.1": folder: all + "1790.80.10": + folder: all diff --git a/recipes/mesa-glu/all/conandata.yml b/recipes/mesa-glu/all/conandata.yml new file mode 100644 index 0000000000000..777327d35cae6 --- /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 0000000000000..116b5d7d6af29 --- /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 0000000000000..2e3df45816e5a --- /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 0000000000000..4b86ab32d1e30 --- /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 0000000000000..1edc7d437e36b --- /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 0000000000000..55cef0386047b --- /dev/null +++ b/recipes/mesa-glu/config.yml @@ -0,0 +1,3 @@ +versions: + "9.0.3": + folder: all diff --git a/recipes/meshoptimizer/all/conandata.yml b/recipes/meshoptimizer/all/conandata.yml index 1132907df3841..123647cd81c5f 100644 --- a/recipes/meshoptimizer/all/conandata.yml +++ b/recipes/meshoptimizer/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.20": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.20.tar.gz" + sha256: "CF1077A83958BED3D8DA28A841CA53A6A42D871E49023EDCE64E37002A0F5A48" "0.17": url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.17.tar.gz" sha256: "50f134da6739702d4398f2a3c614acb1d80afb73afed27ac68bc55c9edae64e2" diff --git a/recipes/meshoptimizer/all/conanfile.py b/recipes/meshoptimizer/all/conanfile.py index 38ff3a5d86908..ee4c17ba67a7c 100644 --- a/recipes/meshoptimizer/all/conanfile.py +++ b/recipes/meshoptimizer/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.build import stdcpp_library from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.54.0" @@ -50,10 +51,11 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - # No warnings as errors - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - replace_in_file(self, cmakelists, "add_compile_options(/W4 /WX)", "") - replace_in_file(self, cmakelists, "-Werror", "") + # No warnings as errors - now fine in 0.19 and up + if Version(self.version) < "0.19": + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "add_compile_options(/W4 /WX)", "") + replace_in_file(self, cmakelists, "-Werror", "") def build(self): self._patch_sources() diff --git a/recipes/meshoptimizer/config.yml b/recipes/meshoptimizer/config.yml index 301a8d09f5b3a..31e2badfe4c2f 100644 --- a/recipes/meshoptimizer/config.yml +++ b/recipes/meshoptimizer/config.yml @@ -1,4 +1,6 @@ versions: + "0.20": + folder: all "0.17": folder: all "0.16": diff --git a/recipes/meson/all/conandata.yml b/recipes/meson/all/conandata.yml index 233e51184aef9..28c305f4e6b32 100644 --- a/recipes/meson/all/conandata.yml +++ b/recipes/meson/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "1.3.1": + url: "https://github.com/mesonbuild/meson/archive/1.3.1.tar.gz" + sha256: "274c121edb859602eb4589d31d8791e980748bb19950fc6f611a21d76dc22cc6" + "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" "1.1.1": url: "https://github.com/mesonbuild/meson/releases/download/1.1.1/meson-1.1.1.tar.gz" sha256: "d04b541f97ca439fb82fab7d0d480988be4bd4e62563a5ca35fadb5400727b1c" diff --git a/recipes/meson/config.yml b/recipes/meson/config.yml index eb30cf3e2eaa0..391274cd2a1ed 100644 --- a/recipes/meson/config.yml +++ b/recipes/meson/config.yml @@ -1,4 +1,16 @@ versions: + "1.3.1": + folder: all + "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": folder: all "1.1.0": diff --git a/recipes/metall/all/conandata.yml b/recipes/metall/all/conandata.yml index 788ef5da15507..023411b883cb5 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 957ba5421027f..b13166986c15d 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 3a8c6c5442b33..0a6bc68712d90 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 90ab90a88d549..b21cc49efde95 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 e3fb6e5067c49..1d869b27d6481 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/metis/all/CMakeLists.txt b/recipes/metis/all/CMakeLists.txt index 15cbde395086d..b311c024ef0c5 100644 --- a/recipes/metis/all/CMakeLists.txt +++ b/recipes/metis/all/CMakeLists.txt @@ -1,10 +1,17 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper LANGUAGES C) +cmake_minimum_required(VERSION 3.15) +project(METIS C) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -set(GKLIB_PATH "${CMAKE_CURRENT_LIST_DIR}/source_subfolder/GKlib" CACHE PATH "") +include(gkbuild.cmake) -add_subdirectory(source_subfolder) +find_package(gklib REQUIRED) + +file(GLOB metis_sources libmetis/*.c) +add_library(metis ${metis_sources}) +target_include_directories(metis PRIVATE libmetis include) +target_link_libraries(metis PRIVATE gklib::gklib) + +include(GNUInstallDirs) +install(TARGETS metis) +install(DIRECTORY include/ DESTINATION include) diff --git a/recipes/metis/all/conandata.yml b/recipes/metis/all/conandata.yml index 396a06387b94f..2250bb8608a80 100644 --- a/recipes/metis/all/conandata.yml +++ b/recipes/metis/all/conandata.yml @@ -1,16 +1,21 @@ sources: + "5.2.1": + url: "https://github.com/KarypisLab/METIS/archive/refs/tags/v5.2.1.tar.gz" + sha256: "1a4665b2cd07edc2f734e30d7460afb19c1217c2547c2ac7bf6e1848d50aff7a" "5.1.1": url: "https://github.com/KarypisLab/METIS/archive/refs/tags/v5.1.1-DistDGL-v0.5.tar.gz" sha256: "cedf0b32d32a8496bac7eb078b2b8260fb00ddb8d50c27e4082968a01bc33331" patches: "5.1.1": - - patch_file: "patches/001-add-gklib-system-cmake.patch" - base_path: "source_subfolder" - - patch_file: "patches/002-support-pure-cmake.patch" - base_path: "source_subfolder" - - patch_file: "patches/003-remove-programs.patch" - base_path: "source_subfolder" - - patch_file: "patches/004-use-conan-gklib.patch" - base_path: "source_subfolder" - - patch_file: "patches/005-fix-install.patch" - base_path: "source_subfolder" + - patch_file: "patches/5.1.1-001-fix-coarse-graph-memory-bugs.patch" + patch_type: "bugfix" + patch_source: "https://github.com/KarypisLab/METIS/commit/36262adecaa9720a4417a67124428061c367fd3f" + patch_description: "Fix memory bug when coarser graph stays the same" + - patch_file: "patches/5.1.1-002-fix-out-out-of-bounds-errors.patch" + patch_type: "bugfix" + patch_source: "https://github.com/KarypisLab/METIS/commit/b9e8609ea16d27cf61e1ad8a38af1bfd6185eca5" + patch_description: "Fix out out-of-bounds memory errors" + - patch_file: "patches/5.1.1-003-reduce-maximum-memory-use.patch" + patch_type: "bugfix" + patch_source: "https://github.com/KarypisLab/METIS/commit/aef54c5b2a72f9d0c3c91b008c35271560b79cac" + patch_description: "Small changes to reduce maximum memory use" diff --git a/recipes/metis/all/conanfile.py b/recipes/metis/all/conanfile.py index 7e077e7ea6112..7782c2735e124 100644 --- a/recipes/metis/all/conanfile.py +++ b/recipes/metis/all/conanfile.py @@ -1,101 +1,149 @@ -from conans import ConanFile, CMake, tools -from conan.tools.files import apply_conandata_patches 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 get, copy, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class METISConan(ConanFile): name = "metis" + description = ( + "Set of serial programs for partitioning graphs, " + "partitioning finite element meshes, and producing " + "fill reducing orderings for sparse matrices" + ) license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/KarypisLab/METIS" - description = "set of serial programs for partitioning graphs," \ - " partitioning finite element meshes, and producing" \ - " fill reducing orderings for sparse matrices" topics = ("karypislab", "graph", "partitioning-algorithms") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "with_64bit_types": [True, False], + "enable_gkrand": [True, False], + "enable_gkregex": [True, False], + "with_openmp": [True, False], + "with_pcre": [True, False], + "with_valgrind": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_64bit_types": True, + "enable_gkrand": False, + "enable_gkregex": False, + "with_openmp": False, + "with_pcre": False, + "with_valgrind": 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"] - - @property - def _is_mingw(self): - return self.settings.os == "Windows" and self.settings.compiler == "gcc" 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", self.recipe_folder, self.export_sources_folder) + copy( + self, + "gkbuild.cmake", + self.recipe_folder, + os.path.join(self.export_sources_folder, "src"), + ) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + del self.options.enable_gkregex 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): self.requires("gklib/5.1.1") 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) + rm(self, "*.pdf", self.source_folder, recursive=True) + copy(self, "CMakeLists.txt", self.export_sources_folder, self.source_folder) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["VALGRIND"] = self.options.with_valgrind + tc.cache_variables["OPENMP"] = self.options.with_openmp + tc.cache_variables["PCRE"] = self.options.with_pcre + tc.cache_variables["GKREGEX"] = self.settings.os == "Windows" or self.options.enable_gkregex + tc.cache_variables["GKRAND"] = self.options.enable_gkrand + if self.settings.build_type == "Debug": + tc.preprocessor_definitions["DEBUG"] = "" + else: + # NDEBUG is defined by default by CMake + # tc.preprocessor_definitions["NDEBUG"] = "" + tc.preprocessor_definitions["NDEBUG2"] = "" + bits = 64 if self.options.with_64bit_types else 32 + tc.preprocessor_definitions["IDXTYPEWIDTH"] = str(bits) + tc.preprocessor_definitions["REALTYPEWIDTH"] = str(bits) + tc.generate() + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): apply_conandata_patches(self) - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - self._cmake.definitions["SHARED"] = self.options.shared - self._cmake.definitions["METIS_INSTALL"] = True - self._cmake.definitions["ASSERT"] = self.settings.build_type == "Debug" - self._cmake.definitions["ASSERT2"] = self.settings.build_type == "Debug" - self._cmake.definitions["METIS_IDX64"] = True - self._cmake.definitions["METIS_REAL64"] = True - self._cmake.configure(build_folder=self._build_subfolder) - 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() + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + cmake = CMake(self) cmake.install() - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + rm(self, "*.cmake", self.package_folder, recursive=True) + rm(self, "*.pc", self.package_folder, recursive=True) + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): self.cpp_info.libs = ["metis"] - self.cpp_info.requires.append("gklib::gklib") + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - if self._is_msvc or self._is_mingw: - self.cpp_info.defines.append("USE_GKREGEX") - if self._is_msvc: + self.cpp_info.defines.append("LINUX") + elif self.settings.os == "Windows": + self.cpp_info.defines.append("WIN32") + self.cpp_info.defines.append("MSC") + self.cpp_info.defines.append("_CRT_SECURE_NO_DEPRECATE") + elif self.settings.os == "Macos": + self.cpp_info.defines.append("MACOS") + elif self.settings.os == "SunOS": + self.cpp_info.defines.append("SUNOS") + + if is_msvc(self): self.cpp_info.defines.append("__thread=__declspec(thread)") + + bits = 64 if self.options.with_64bit_types else 32 + self.cpp_info.defines.append(f"IDXTYPEWIDTH={bits}") + self.cpp_info.defines.append(f"REALTYPEWIDTH={bits}") + + # Defines for GKLib headers + if self.settings.os == "Windows" or self.options.enable_gkregex: + self.cpp_info.defines.append("USE_GKREGEX") + if self.options.enable_gkrand: + self.cpp_info.defines.append("USE_GKRAND") + if self.options.with_pcre: + self.cpp_info.defines.append("__WITHPCRE__") + if self.options.with_openmp: + self.cpp_info.defines.append("__OPENMP__") diff --git a/recipes/metis/all/gkbuild.cmake b/recipes/metis/all/gkbuild.cmake new file mode 100644 index 0000000000000..c5f8ebbaa39fe --- /dev/null +++ b/recipes/metis/all/gkbuild.cmake @@ -0,0 +1,121 @@ +# Source:https://github.com/KarypisLab/METIS/blob/e0f1b88/conf/gkbuild.cmake +# With some of the config moved to conanfile.py. + +# Helper modules. +include(CheckFunctionExists) +include(CheckIncludeFile) + +# Setup options. +option(GPROF "add gprof support" OFF) +option(VALGRIND "add valgrind support" OFF) +option(OPENMP "enable OpenMP support" OFF) +option(PCRE "enable PCRE support" OFF) +option(GKREGEX "enable GKREGEX support" OFF) +option(GKRAND "enable GKRAND support" OFF) + +# Add compiler flags. +if(MSVC) + set(GK_COPTS "/Ox") + set(GK_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX") +elseif(MINGW) + set(GK_COPTS "-DUSE_GKREGEX") +else() + set(GK_COPTIONS "-DLINUX -D_FILE_OFFSET_BITS=64") +endif() +if(CYGWIN) + set(GK_COPTIONS "${GK_COPTIONS} -DCYGWIN") +endif() +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + # GCC opts. + set(GK_COPTIONS "${GK_COPTIONS} -std=c99 -fno-strict-aliasing") + if(VALGRIND) + set(GK_COPTIONS "${GK_COPTIONS} -march=x86-64 -mtune=generic") + else() + # -march=native is not a valid flag on PPC: + if(CMAKE_SYSTEM_PROCESSOR MATCHES "power|ppc|powerpc|ppc64|powerpc64" OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64")) + set(GK_COPTIONS "${GK_COPTIONS} -mtune=native") + else() + set(GK_COPTIONS "${GK_COPTIONS} -march=native") + endif() + endif() + # GCC warnings. + set(GK_COPTIONS "${GK_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label") +elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun") + # Sun insists on -xc99. + set(GK_COPTIONS "${GK_COPTIONS} -xc99") +endif() + +if(${CMAKE_C_COMPILER_ID} STREQUAL "Intel") + set(GK_COPTIONS "${GK_COPTIONS} -xHost") + # set(GK_COPTIONS "${GK_COPTIONS} -fast") +endif() + +# Add support for MacOS items +if(APPLE) + set(GK_COPTIONS "${GK_COPTIONS} -DMACOS") +endif() + +# Find OpenMP if it is requested. +if(OPENMP) + include(FindOpenMP) + if(OPENMP_FOUND) + set(GK_COPTIONS "${GK_COPTIONS} -D__OPENMP__ ${OpenMP_C_FLAGS}") + else() + message(WARNING "OpenMP was requested but support was not found") + endif() +endif() + +if(GPROF) + set(GK_COPTS "-pg") +endif() + +# Add various options +if(PCRE) + set(GK_COPTIONS "${GK_COPTIONS} -D__WITHPCRE__") +endif() + +if(GKREGEX) + set(GK_COPTIONS "${GK_COPTIONS} -DUSE_GKREGEX") +endif() + +if(GKRAND) + set(GK_COPTIONS "${GK_COPTIONS} -DUSE_GKRAND") +endif() + + +# Check for features. +check_include_file(execinfo.h HAVE_EXECINFO_H) +if(HAVE_EXECINFO_H) + set(GK_COPTIONS "${GK_COPTIONS} -DHAVE_EXECINFO_H") +endif() + +check_function_exists(getline HAVE_GETLINE) +if(HAVE_GETLINE) + set(GK_COPTIONS "${GK_COPTIONS} -DHAVE_GETLINE") +endif() + + +# Custom check for TLS. +if(MSVC) + set(GK_COPTIONS "${GK_COPTIONS} -D__thread=__declspec(thread)") + + # This if checks if that value is cached or not. + if("${HAVE_THREADLOCALSTORAGE}" MATCHES "^${HAVE_THREADLOCALSTORAGE}$") + file(WRITE ${CMAKE_SOURCE_DIR}/check_thread_storage.c + "extern __thread int x; int main() { return 0; }") + try_compile(HAVE_THREADLOCALSTORAGE + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/check_thread_storage.c) + if(HAVE_THREADLOCALSTORAGE) + message(STATUS "checking for thread-local storage - found") + else() + message(STATUS "checking for thread-local storage - not found") + endif() + endif() + if(NOT HAVE_THREADLOCALSTORAGE) + set(GK_COPTIONS "${GK_COPTIONS} -D__thread=") + endif() +endif() + +# Finally set the official C flags. +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GK_COPTIONS} ${GK_COPTS}") diff --git a/recipes/metis/all/patches/001-add-gklib-system-cmake.patch b/recipes/metis/all/patches/001-add-gklib-system-cmake.patch deleted file mode 100644 index 2c6798304339e..0000000000000 --- a/recipes/metis/all/patches/001-add-gklib-system-cmake.patch +++ /dev/null @@ -1,151 +0,0 @@ -Add gklib system cmake ---- /dev/null -+++ b/GKlib/GKlibSystem.cmake -@@ -0,0 +1,133 @@ -+# Helper modules. -+include(CheckFunctionExists) -+include(CheckIncludeFile) -+ -+# Setup options. -+option(GDB "enable use of GDB" OFF) -+option(ASSERT "turn asserts on" OFF) -+option(ASSERT2 "additional assertions" OFF) -+option(DEBUG "add debugging support" OFF) -+option(GPROF "add gprof support" OFF) -+option(OPENMP "enable OpenMP support" OFF) -+option(PCRE "enable PCRE support" OFF) -+option(GKREGEX "enable GKREGEX support" OFF) -+option(GKRAND "enable GKRAND support" OFF) -+ -+ -+# Add compiler flags. -+if(MSVC) -+ set(GKlib_COPTS "/Ox") -+ set(GKlib_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX") -+elseif(MINGW) -+ set(GKlib_COPTS "-DUSE_GKREGEX") -+else() -+ set(GKlib_COPTIONS "-DLINUX -D_FILE_OFFSET_BITS=64") -+endif(MSVC) -+if(CYGWIN) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DCYGWIN") -+endif(CYGWIN) -+if(CMAKE_COMPILER_IS_GNUCC) -+# GCC opts. -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -std=c99 -fno-strict-aliasing") -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -march=native") -+ if(NOT MINGW) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -fPIC") -+ endif(NOT MINGW) -+# GCC warnings. -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label") -+elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun") -+# Sun insists on -xc99. -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -xc99") -+endif(CMAKE_COMPILER_IS_GNUCC) -+ -+# Intel compiler -+if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -xHost -std=c99") -+endif() -+ -+# Find OpenMP if it is requested. -+if(OPENMP) -+ include(FindOpenMP) -+ if(OPENMP_FOUND) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__OPENMP__ ${OpenMP_C_FLAGS}") -+ else() -+ message(WARNING "OpenMP was requested but support was not found") -+ endif(OPENMP_FOUND) -+endif(OPENMP) -+ -+ -+# Add various definitions. -+if(GDB) -+ set(GKlib_COPTS "${GKlib_COPTS} -g") -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror") -+else() -+ set(GKlib_COPTS "-O3") -+endif(GDB) -+ -+ -+if(DEBUG) -+ set(GKlib_COPTS "-g") -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DDEBUG") -+endif(DEBUG) -+ -+if(GPROF) -+ set(GKlib_COPTS "-pg") -+endif(GPROF) -+ -+if(NOT ASSERT) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG") -+endif(NOT ASSERT) -+ -+if(NOT ASSERT2) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG2") -+endif(NOT ASSERT2) -+ -+ -+# Add various options -+if(PCRE) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__WITHPCRE__") -+endif(PCRE) -+ -+if(GKREGEX) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKREGEX") -+endif(GKREGEX) -+ -+if(GKRAND) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKRAND") -+endif(GKRAND) -+ -+ -+# Check for features. -+check_include_file(execinfo.h HAVE_EXECINFO_H) -+if(HAVE_EXECINFO_H) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DHAVE_EXECINFO_H") -+endif(HAVE_EXECINFO_H) -+ -+check_function_exists(getline HAVE_GETLINE) -+if(HAVE_GETLINE) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DHAVE_GETLINE") -+endif(HAVE_GETLINE) -+ -+ -+# Custom check for TLS. -+if(MSVC) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__thread=__declspec(thread)") -+ -+ # This if checks if that value is cached or not. -+ if("${HAVE_THREADLOCALSTORAGE}" MATCHES "^${HAVE_THREADLOCALSTORAGE}$") -+ try_compile(HAVE_THREADLOCALSTORAGE -+ ${CMAKE_BINARY_DIR} -+ ${GKLIB_PATH}/conf/check_thread_storage.c) -+ if(HAVE_THREADLOCALSTORAGE) -+ message(STATUS "checking for thread-local storage - found") -+ else() -+ message(STATUS "checking for thread-local storage - not found") -+ endif() -+ endif() -+ if(NOT HAVE_THREADLOCALSTORAGE) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__thread=") -+ endif() -+endif() -+ -+# Finally set the official C flags. -+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GKlib_COPTIONS} ${GKlib_COPTS}") -diff --git a/GKlib/conf/check_thread_storage.c b/GKlib/conf/check_thread_storage.c -new file mode 100644 -index 0000000..e6e1e98 ---- /dev/null -+++ b/GKlib/conf/check_thread_storage.c -@@ -0,0 +1,5 @@ -+extern __thread int x; -+ -+int main(int argc, char **argv) { -+ return 0; -+} --- -2.33.1.windows.1 - diff --git a/recipes/metis/all/patches/002-support-pure-cmake.patch b/recipes/metis/all/patches/002-support-pure-cmake.patch deleted file mode 100644 index 7fc0e8b45ccb7..0000000000000 --- a/recipes/metis/all/patches/002-support-pure-cmake.patch +++ /dev/null @@ -1,771 +0,0 @@ -Generate metis.h based on CMake options ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -20,26 +20,28 @@ endif(SHARED) - include(${GKLIB_PATH}/GKlibSystem.cmake) - - # METIS' custom options --#option(IDX64 "enable 64 bit ints" OFF) --#option(REAL64 "enable 64 bit floats (i.e., double)" OFF) --#if(IDX64) --# set(METIS_COPTIONS "${METIS_COPTIONS} -DIDXTYPEWIDTH=64") --#else() --# set(METIS_COPTIONS "${METIS_COPTIONS} -DIDXTYPEWIDTH=32") --#endif(IDX64) --#if(REAL64) --# set(METIS_COPTIONS "${METIS_COPTIONS} -DREALTYPEWIDTH=64") --#else() --# set(METIS_COPTIONS "${METIS_COPTIONS} -DREALTYPEWIDTH=32") --#endif(REAL64) --# --#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${METIS_COPTIONS}") -- -+option(METIS_IDX64 "enable 64 bit ints" OFF) -+option(METIS_REAL64 "enable 64 bit floats (i.e., double)" OFF) -+if (METIS_IDX64) -+ set(METIS_IDXTYPEWIDTH 64) -+else () -+ set(METIS_IDXTYPEWIDTH 32) -+endif () -+if (METIS_REAL64) -+ set(METIS_REALTYPEWIDTH 64) -+else () -+ set(METIS_REALTYPEWIDTH 32) -+endif () - - # Add include directories. - include_directories(${GKLIB_PATH}) --include_directories(build/xinclude) -+configure_file(${PROJECT_SOURCE_DIR}/include/metis.h.in -+ ${PROJECT_BINARY_DIR}/include/metis.h) -+include_directories(${PROJECT_BINARY_DIR}/include) -+if (METIS_INSTALL) -+ install(FILES ${PROJECT_BINARY_DIR}/include/metis.h DESTINATION include) -+endif () -+ - # Recursively look for CMakeLists.txt in subdirs. --add_subdirectory("build/xinclude") - add_subdirectory("libmetis") - add_subdirectory("programs") ---- a/include/metis.h -+++ /dev/null -@@ -1,358 +0,0 @@ --/*! --\file metis.h --\brief This file contains function prototypes and constant definitions for METIS -- * --\author George --\date Started 8/9/02 --\version\verbatim $Id$\endverbatim --*/ -- --#ifndef _METIS_H_ --#define _METIS_H_ -- --/**************************************************************************** --* A set of defines that can be modified by the user --*****************************************************************************/ -- --/*-------------------------------------------------------------------------- -- Specifies the width of the elementary data type that will hold information -- about vertices and their adjacency lists. -- -- Possible values: -- 32 : Use 32 bit signed integers -- 64 : Use 64 bit signed integers -- -- A width of 64 should be specified if the number of vertices or the total -- number of edges in the graph exceed the limits of a 32 bit signed integer -- i.e., 2^31-1. -- Proper use of 64 bit integers requires that the c99 standard datatypes -- int32_t and int64_t are supported by the compiler. -- GCC does provides these definitions in stdint.h, but it may require some -- modifications on other architectures. ----------------------------------------------------------------------------*/ --//#define IDXTYPEWIDTH 32 -- -- --/*-------------------------------------------------------------------------- -- Specifies the data type that will hold floating-point style information. -- -- Possible values: -- 32 : single precission floating point (float) -- 64 : double precission floating point (double) ----------------------------------------------------------------------------*/ --//#define REALTYPEWIDTH 32 -- -- -- --/**************************************************************************** --* In principle, nothing needs to be changed beyond this point, unless the --* int32_t and int64_t cannot be found in the normal places. --*****************************************************************************/ -- --/* Uniform definitions for various compilers */ --#if defined(_MSC_VER) -- #define COMPILER_MSC --#endif --#if defined(__ICC) -- #define COMPILER_ICC --#endif --#if defined(__GNUC__) -- #define COMPILER_GCC --#endif -- --/* Include c99 int definitions and need constants. When building the library, -- * these are already defined by GKlib; hence the test for _GKLIB_H_ */ --#ifndef _GKLIB_H_ --#ifdef COMPILER_MSC --#include -- --typedef __int32 int32_t; --typedef __int64 int64_t; --#define PRId32 "I32d" --#define PRId64 "I64d" --#define SCNd32 "ld" --#define SCNd64 "I64d" --#define INT32_MIN ((int32_t)_I32_MIN) --#define INT32_MAX _I32_MAX --#define INT64_MIN ((int64_t)_I64_MIN) --#define INT64_MAX _I64_MAX --#else --#include --#endif --#endif -- -- --/*------------------------------------------------------------------------ --* Setup the basic datatypes --*-------------------------------------------------------------------------*/ --#if IDXTYPEWIDTH == 32 -- typedef int32_t idx_t; -- -- #define IDX_MAX INT32_MAX -- #define IDX_MIN INT32_MIN -- -- #define SCIDX SCNd32 -- #define PRIDX PRId32 -- -- #define strtoidx strtol -- #define iabs abs --#elif IDXTYPEWIDTH == 64 -- typedef int64_t idx_t; -- -- #define IDX_MAX INT64_MAX -- #define IDX_MIN INT64_MIN -- -- #define SCIDX SCNd64 -- #define PRIDX PRId64 -- --#ifdef COMPILER_MSC -- #define strtoidx _strtoi64 --#else -- #define strtoidx strtoll --#endif -- #define iabs labs --#else -- #error "Incorrect user-supplied value fo IDXTYPEWIDTH" --#endif -- -- --#if REALTYPEWIDTH == 32 -- typedef float real_t; -- -- #define SCREAL "f" -- #define PRREAL "f" -- #define REAL_MAX FLT_MAX -- #define REAL_MIN FLT_MIN -- #define REAL_EPSILON FLT_EPSILON -- -- #define rabs fabsf -- #define REALEQ(x,y) ((rabs((x)-(y)) <= FLT_EPSILON)) -- --#ifdef COMPILER_MSC -- #define strtoreal (float)strtod --#else -- #define strtoreal strtof --#endif --#elif REALTYPEWIDTH == 64 -- typedef double real_t; -- -- #define SCREAL "lf" -- #define PRREAL "lf" -- #define REAL_MAX DBL_MAX -- #define REAL_MIN DBL_MIN -- #define REAL_EPSILON DBL_EPSILON -- -- #define rabs fabs -- #define REALEQ(x,y) ((rabs((x)-(y)) <= DBL_EPSILON)) -- -- #define strtoreal strtod --#else -- #error "Incorrect user-supplied value for REALTYPEWIDTH" --#endif -- -- --/*------------------------------------------------------------------------ --* Constant definitions --*-------------------------------------------------------------------------*/ --/* Metis's version number */ --#define METIS_VER_MAJOR 5 --#define METIS_VER_MINOR 1 --#define METIS_VER_SUBMINOR 0 -- --/* The maximum length of the options[] array */ --#define METIS_NOPTIONS 40 -- -- -- --/*------------------------------------------------------------------------ --* Function prototypes --*-------------------------------------------------------------------------*/ -- --#ifdef _WINDLL --#define METIS_API(type) __declspec(dllexport) type __cdecl --#elif defined(__cdecl) --#define METIS_API(type) type __cdecl --#else --#define METIS_API(type) type --#endif -- -- -- --#ifdef __cplusplus --extern "C" { --#endif -- --METIS_API(int) METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, -- idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, -- idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, -- idx_t *edgecut, idx_t *part); -- --METIS_API(int) METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, -- idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, -- idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, -- idx_t *edgecut, idx_t *part); -- --METIS_API(int) METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -- idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); -- --METIS_API(int) METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -- idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); -- --METIS_API(int) METIS_PartMeshNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -- idx_t *vwgt, idx_t *vsize, idx_t *nparts, real_t *tpwgts, -- idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart); -- --METIS_API(int) METIS_PartMeshDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -- idx_t *vwgt, idx_t *vsize, idx_t *ncommon, idx_t *nparts, -- real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, -- idx_t *npart); -- --METIS_API(int) METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, -- idx_t *options, idx_t *perm, idx_t *iperm); -- --METIS_API(int) METIS_Free(void *ptr); -- --METIS_API(int) METIS_SetDefaultOptions(idx_t *options); -- -- --/* These functions are used by ParMETIS */ -- --METIS_API(int) METIS_NodeNDP(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, -- idx_t npes, idx_t *options, idx_t *perm, idx_t *iperm, -- idx_t *sizes); -- --METIS_API(int) METIS_ComputeVertexSeparator(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, -- idx_t *vwgt, idx_t *options, idx_t *sepsize, idx_t *part); -- --METIS_API(int) METIS_NodeRefine(idx_t nvtxs, idx_t *xadj, idx_t *vwgt, idx_t *adjncy, -- idx_t *where, idx_t *hmarker, real_t ubfactor); -- -- --/* These functions are used by DGL */ -- --METIS_API(int) METIS_CacheFriendlyReordering(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, -- idx_t *part, idx_t *old2new); -- --#ifdef __cplusplus --} --#endif -- -- -- --/*------------------------------------------------------------------------ --* Enum type definitions --*-------------------------------------------------------------------------*/ --/*! Return codes */ --typedef enum { -- METIS_OK = 1, /*!< Returned normally */ -- METIS_ERROR_INPUT = -2, /*!< Returned due to erroneous inputs and/or options */ -- METIS_ERROR_MEMORY = -3, /*!< Returned due to insufficient memory */ -- METIS_ERROR = -4 /*!< Some other errors */ --} rstatus_et; -- -- --/*! Operation type codes */ --typedef enum { -- METIS_OP_PMETIS, -- METIS_OP_KMETIS, -- METIS_OP_OMETIS --} moptype_et; -- -- --/*! Options codes (i.e., options[]) */ --typedef enum { -- METIS_OPTION_PTYPE, -- METIS_OPTION_OBJTYPE, -- METIS_OPTION_CTYPE, -- METIS_OPTION_IPTYPE, -- METIS_OPTION_RTYPE, -- METIS_OPTION_DBGLVL, -- METIS_OPTION_NIPARTS, -- METIS_OPTION_NITER, -- METIS_OPTION_NCUTS, -- METIS_OPTION_SEED, -- METIS_OPTION_NO2HOP, -- METIS_OPTION_ONDISK, -- METIS_OPTION_MINCONN, -- METIS_OPTION_CONTIG, -- METIS_OPTION_COMPRESS, -- METIS_OPTION_CCORDER, -- METIS_OPTION_PFACTOR, -- METIS_OPTION_NSEPS, -- METIS_OPTION_UFACTOR, -- METIS_OPTION_NUMBERING, -- METIS_OPTION_DROPEDGES, -- -- /* Used for command-line parameter purposes */ -- METIS_OPTION_HELP, -- METIS_OPTION_TPWGTS, -- METIS_OPTION_NCOMMON, -- METIS_OPTION_NOOUTPUT, -- METIS_OPTION_BALANCE, -- METIS_OPTION_GTYPE, -- METIS_OPTION_UBVEC --} moptions_et; -- -- --/*! Partitioning Schemes */ --typedef enum { -- METIS_PTYPE_RB, -- METIS_PTYPE_KWAY --} mptype_et; -- --/*! Graph types for meshes */ --typedef enum { -- METIS_GTYPE_DUAL, -- METIS_GTYPE_NODAL --} mgtype_et; -- --/*! Coarsening Schemes */ --typedef enum { -- METIS_CTYPE_RM, -- METIS_CTYPE_SHEM --} mctype_et; -- --/*! Initial partitioning schemes */ --typedef enum { -- METIS_IPTYPE_GROW, -- METIS_IPTYPE_RANDOM, -- METIS_IPTYPE_EDGE, -- METIS_IPTYPE_NODE, -- METIS_IPTYPE_METISRB --} miptype_et; -- -- --/*! Refinement schemes */ --typedef enum { -- METIS_RTYPE_FM, -- METIS_RTYPE_GREEDY, -- METIS_RTYPE_SEP2SIDED, -- METIS_RTYPE_SEP1SIDED --} mrtype_et; -- -- --/*! Debug Levels */ --typedef enum { -- METIS_DBG_INFO = 1, /*!< Shows various diagnostic messages */ -- METIS_DBG_TIME = 2, /*!< Perform timing analysis */ -- METIS_DBG_COARSEN = 4, /*!< Show the coarsening progress */ -- METIS_DBG_REFINE = 8, /*!< Show the refinement progress */ -- METIS_DBG_IPART = 16, /*!< Show info on initial partitioning */ -- METIS_DBG_MOVEINFO = 32, /*!< Show info on vertex moves during refinement */ -- METIS_DBG_SEPINFO = 64, /*!< Show info on vertex moves during sep refinement */ -- METIS_DBG_CONNINFO = 128, /*!< Show info on minimization of subdomain connectivity */ -- METIS_DBG_CONTIGINFO = 256, /*!< Show info on elimination of connected components */ -- METIS_DBG_MEMORY = 2048, /*!< Show info related to wspace allocation */ --} mdbglvl_et; -- -- --/* Types of objectives */ --typedef enum { -- METIS_OBJTYPE_CUT, -- METIS_OBJTYPE_VOL, -- METIS_OBJTYPE_NODE --} mobjtype_et; -- -- -- --#endif /* _METIS_H_ */ ---- /dev/null -+++ b/include/metis.h.in -@@ -0,0 +1,358 @@ -+/*! -+\file metis.h -+\brief This file contains function prototypes and constant definitions for METIS -+ * -+\author George -+\date Started 8/9/02 -+\version\verbatim $Id$\endverbatim -+*/ -+ -+#ifndef _METIS_H_ -+#define _METIS_H_ -+ -+/**************************************************************************** -+* A set of defines that can be modified by the user -+*****************************************************************************/ -+ -+/*-------------------------------------------------------------------------- -+ Specifies the width of the elementary data type that will hold information -+ about vertices and their adjacency lists. -+ -+ Possible values: -+ 32 : Use 32 bit signed integers -+ 64 : Use 64 bit signed integers -+ -+ A width of 64 should be specified if the number of vertices or the total -+ number of edges in the graph exceed the limits of a 32 bit signed integer -+ i.e., 2^31-1. -+ Proper use of 64 bit integers requires that the c99 standard datatypes -+ int32_t and int64_t are supported by the compiler. -+ GCC does provides these definitions in stdint.h, but it may require some -+ modifications on other architectures. -+--------------------------------------------------------------------------*/ -+#define IDXTYPEWIDTH @METIS_IDXTYPEWIDTH@ -+ -+ -+/*-------------------------------------------------------------------------- -+ Specifies the data type that will hold floating-point style information. -+ -+ Possible values: -+ 32 : single precission floating point (float) -+ 64 : double precission floating point (double) -+--------------------------------------------------------------------------*/ -+#define REALTYPEWIDTH @METIS_REALTYPEWIDTH@ -+ -+ -+ -+/**************************************************************************** -+* In principle, nothing needs to be changed beyond this point, unless the -+* int32_t and int64_t cannot be found in the normal places. -+*****************************************************************************/ -+ -+/* Uniform definitions for various compilers */ -+#if defined(_MSC_VER) -+ #define COMPILER_MSC -+#endif -+#if defined(__ICC) -+ #define COMPILER_ICC -+#endif -+#if defined(__GNUC__) -+ #define COMPILER_GCC -+#endif -+ -+/* Include c99 int definitions and need constants. When building the library, -+ * these are already defined by GKlib; hence the test for _GKLIB_H_ */ -+#ifndef _GKLIB_H_ -+#ifdef COMPILER_MSC -+#include -+ -+typedef __int32 int32_t; -+typedef __int64 int64_t; -+#define PRId32 "I32d" -+#define PRId64 "I64d" -+#define SCNd32 "ld" -+#define SCNd64 "I64d" -+#define INT32_MIN ((int32_t)_I32_MIN) -+#define INT32_MAX _I32_MAX -+#define INT64_MIN ((int64_t)_I64_MIN) -+#define INT64_MAX _I64_MAX -+#else -+#include -+#endif -+#endif -+ -+ -+/*------------------------------------------------------------------------ -+* Setup the basic datatypes -+*-------------------------------------------------------------------------*/ -+#if IDXTYPEWIDTH == 32 -+ typedef int32_t idx_t; -+ -+ #define IDX_MAX INT32_MAX -+ #define IDX_MIN INT32_MIN -+ -+ #define SCIDX SCNd32 -+ #define PRIDX PRId32 -+ -+ #define strtoidx strtol -+ #define iabs abs -+#elif IDXTYPEWIDTH == 64 -+ typedef int64_t idx_t; -+ -+ #define IDX_MAX INT64_MAX -+ #define IDX_MIN INT64_MIN -+ -+ #define SCIDX SCNd64 -+ #define PRIDX PRId64 -+ -+#ifdef COMPILER_MSC -+ #define strtoidx _strtoi64 -+#else -+ #define strtoidx strtoll -+#endif -+ #define iabs labs -+#else -+ #error "Incorrect user-supplied value fo IDXTYPEWIDTH" -+#endif -+ -+ -+#if REALTYPEWIDTH == 32 -+ typedef float real_t; -+ -+ #define SCREAL "f" -+ #define PRREAL "f" -+ #define REAL_MAX FLT_MAX -+ #define REAL_MIN FLT_MIN -+ #define REAL_EPSILON FLT_EPSILON -+ -+ #define rabs fabsf -+ #define REALEQ(x,y) ((rabs((x)-(y)) <= FLT_EPSILON)) -+ -+#ifdef COMPILER_MSC -+ #define strtoreal (float)strtod -+#else -+ #define strtoreal strtof -+#endif -+#elif REALTYPEWIDTH == 64 -+ typedef double real_t; -+ -+ #define SCREAL "lf" -+ #define PRREAL "lf" -+ #define REAL_MAX DBL_MAX -+ #define REAL_MIN DBL_MIN -+ #define REAL_EPSILON DBL_EPSILON -+ -+ #define rabs fabs -+ #define REALEQ(x,y) ((rabs((x)-(y)) <= DBL_EPSILON)) -+ -+ #define strtoreal strtod -+#else -+ #error "Incorrect user-supplied value for REALTYPEWIDTH" -+#endif -+ -+ -+/*------------------------------------------------------------------------ -+* Constant definitions -+*-------------------------------------------------------------------------*/ -+/* Metis's version number */ -+#define METIS_VER_MAJOR 5 -+#define METIS_VER_MINOR 1 -+#define METIS_VER_SUBMINOR 0 -+ -+/* The maximum length of the options[] array */ -+#define METIS_NOPTIONS 40 -+ -+ -+ -+/*------------------------------------------------------------------------ -+* Function prototypes -+*-------------------------------------------------------------------------*/ -+ -+#ifdef _WINDLL -+#define METIS_API(type) __declspec(dllexport) type __cdecl -+#elif defined(__cdecl) -+#define METIS_API(type) type __cdecl -+#else -+#define METIS_API(type) type -+#endif -+ -+ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+METIS_API(int) METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, -+ idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, -+ idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, -+ idx_t *edgecut, idx_t *part); -+ -+METIS_API(int) METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, -+ idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, -+ idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, -+ idx_t *edgecut, idx_t *part); -+ -+METIS_API(int) METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -+ idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); -+ -+METIS_API(int) METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -+ idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); -+ -+METIS_API(int) METIS_PartMeshNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -+ idx_t *vwgt, idx_t *vsize, idx_t *nparts, real_t *tpwgts, -+ idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart); -+ -+METIS_API(int) METIS_PartMeshDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -+ idx_t *vwgt, idx_t *vsize, idx_t *ncommon, idx_t *nparts, -+ real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, -+ idx_t *npart); -+ -+METIS_API(int) METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, -+ idx_t *options, idx_t *perm, idx_t *iperm); -+ -+METIS_API(int) METIS_Free(void *ptr); -+ -+METIS_API(int) METIS_SetDefaultOptions(idx_t *options); -+ -+ -+/* These functions are used by ParMETIS */ -+ -+METIS_API(int) METIS_NodeNDP(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, -+ idx_t npes, idx_t *options, idx_t *perm, idx_t *iperm, -+ idx_t *sizes); -+ -+METIS_API(int) METIS_ComputeVertexSeparator(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, -+ idx_t *vwgt, idx_t *options, idx_t *sepsize, idx_t *part); -+ -+METIS_API(int) METIS_NodeRefine(idx_t nvtxs, idx_t *xadj, idx_t *vwgt, idx_t *adjncy, -+ idx_t *where, idx_t *hmarker, real_t ubfactor); -+ -+ -+/* These functions are used by DGL */ -+ -+METIS_API(int) METIS_CacheFriendlyReordering(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, -+ idx_t *part, idx_t *old2new); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+ -+ -+/*------------------------------------------------------------------------ -+* Enum type definitions -+*-------------------------------------------------------------------------*/ -+/*! Return codes */ -+typedef enum { -+ METIS_OK = 1, /*!< Returned normally */ -+ METIS_ERROR_INPUT = -2, /*!< Returned due to erroneous inputs and/or options */ -+ METIS_ERROR_MEMORY = -3, /*!< Returned due to insufficient memory */ -+ METIS_ERROR = -4 /*!< Some other errors */ -+} rstatus_et; -+ -+ -+/*! Operation type codes */ -+typedef enum { -+ METIS_OP_PMETIS, -+ METIS_OP_KMETIS, -+ METIS_OP_OMETIS -+} moptype_et; -+ -+ -+/*! Options codes (i.e., options[]) */ -+typedef enum { -+ METIS_OPTION_PTYPE, -+ METIS_OPTION_OBJTYPE, -+ METIS_OPTION_CTYPE, -+ METIS_OPTION_IPTYPE, -+ METIS_OPTION_RTYPE, -+ METIS_OPTION_DBGLVL, -+ METIS_OPTION_NIPARTS, -+ METIS_OPTION_NITER, -+ METIS_OPTION_NCUTS, -+ METIS_OPTION_SEED, -+ METIS_OPTION_NO2HOP, -+ METIS_OPTION_ONDISK, -+ METIS_OPTION_MINCONN, -+ METIS_OPTION_CONTIG, -+ METIS_OPTION_COMPRESS, -+ METIS_OPTION_CCORDER, -+ METIS_OPTION_PFACTOR, -+ METIS_OPTION_NSEPS, -+ METIS_OPTION_UFACTOR, -+ METIS_OPTION_NUMBERING, -+ METIS_OPTION_DROPEDGES, -+ -+ /* Used for command-line parameter purposes */ -+ METIS_OPTION_HELP, -+ METIS_OPTION_TPWGTS, -+ METIS_OPTION_NCOMMON, -+ METIS_OPTION_NOOUTPUT, -+ METIS_OPTION_BALANCE, -+ METIS_OPTION_GTYPE, -+ METIS_OPTION_UBVEC -+} moptions_et; -+ -+ -+/*! Partitioning Schemes */ -+typedef enum { -+ METIS_PTYPE_RB, -+ METIS_PTYPE_KWAY -+} mptype_et; -+ -+/*! Graph types for meshes */ -+typedef enum { -+ METIS_GTYPE_DUAL, -+ METIS_GTYPE_NODAL -+} mgtype_et; -+ -+/*! Coarsening Schemes */ -+typedef enum { -+ METIS_CTYPE_RM, -+ METIS_CTYPE_SHEM -+} mctype_et; -+ -+/*! Initial partitioning schemes */ -+typedef enum { -+ METIS_IPTYPE_GROW, -+ METIS_IPTYPE_RANDOM, -+ METIS_IPTYPE_EDGE, -+ METIS_IPTYPE_NODE, -+ METIS_IPTYPE_METISRB -+} miptype_et; -+ -+ -+/*! Refinement schemes */ -+typedef enum { -+ METIS_RTYPE_FM, -+ METIS_RTYPE_GREEDY, -+ METIS_RTYPE_SEP2SIDED, -+ METIS_RTYPE_SEP1SIDED -+} mrtype_et; -+ -+ -+/*! Debug Levels */ -+typedef enum { -+ METIS_DBG_INFO = 1, /*!< Shows various diagnostic messages */ -+ METIS_DBG_TIME = 2, /*!< Perform timing analysis */ -+ METIS_DBG_COARSEN = 4, /*!< Show the coarsening progress */ -+ METIS_DBG_REFINE = 8, /*!< Show the refinement progress */ -+ METIS_DBG_IPART = 16, /*!< Show info on initial partitioning */ -+ METIS_DBG_MOVEINFO = 32, /*!< Show info on vertex moves during refinement */ -+ METIS_DBG_SEPINFO = 64, /*!< Show info on vertex moves during sep refinement */ -+ METIS_DBG_CONNINFO = 128, /*!< Show info on minimization of subdomain connectivity */ -+ METIS_DBG_CONTIGINFO = 256, /*!< Show info on elimination of connected components */ -+ METIS_DBG_MEMORY = 2048, /*!< Show info related to wspace allocation */ -+} mdbglvl_et; -+ -+ -+/* Types of objectives */ -+typedef enum { -+ METIS_OBJTYPE_CUT, -+ METIS_OBJTYPE_VOL, -+ METIS_OBJTYPE_NODE -+} mobjtype_et; -+ -+ -+ -+#endif /* _METIS_H_ */ diff --git a/recipes/metis/all/patches/003-remove-programs.patch b/recipes/metis/all/patches/003-remove-programs.patch deleted file mode 100644 index 73a59f03ddbac..0000000000000 --- a/recipes/metis/all/patches/003-remove-programs.patch +++ /dev/null @@ -1,8 +0,0 @@ -Do not build programs ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -44,4 +44,3 @@ endif () - - # Recursively look for CMakeLists.txt in subdirs. - add_subdirectory("libmetis") --add_subdirectory("programs") diff --git a/recipes/metis/all/patches/004-use-conan-gklib.patch b/recipes/metis/all/patches/004-use-conan-gklib.patch deleted file mode 100644 index 60a824f3c58d1..0000000000000 --- a/recipes/metis/all/patches/004-use-conan-gklib.patch +++ /dev/null @@ -1,17 +0,0 @@ -find gklib from conan ---- a/libmetis/CMakeLists.txt -+++ b/libmetis/CMakeLists.txt -@@ -3,9 +3,11 @@ include_directories(.) - # Find sources. - file(GLOB metis_sources *.c) - # Build libmetis. --add_library(metis ${METIS_LIBRARY_TYPE} ${GKlib_sources} ${metis_sources}) -+add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources}) -+find_package(gklib REQUIRED) -+target_link_libraries(metis PRIVATE gklib::gklib) - if(UNIX) -- target_link_libraries(metis m) -+ target_link_libraries(metis PRIVATE m) - endif() - - if(METIS_INSTALL) diff --git a/recipes/metis/all/patches/005-fix-install.patch b/recipes/metis/all/patches/005-fix-install.patch deleted file mode 100644 index 0ddb28f482535..0000000000000 --- a/recipes/metis/all/patches/005-fix-install.patch +++ /dev/null @@ -1,28 +0,0 @@ -Always install and fix runtime destination ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -4,11 +4,7 @@ project(METIS C) - set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib") - set(SHARED FALSE CACHE BOOL "build a shared library") - --if(MSVC) -- set(METIS_INSTALL FALSE) --else() -- set(METIS_INSTALL TRUE) --endif() -+set(METIS_INSTALL TRUE) - - # Configure libmetis library. - if(SHARED) -diff --git a/libmetis/CMakeLists.txt b/libmetis/CMakeLists.txt -index b577360..e9c7825 100644 ---- a/libmetis/CMakeLists.txt -+++ b/libmetis/CMakeLists.txt -@@ -13,6 +13,6 @@ endif() - if(METIS_INSTALL) - install(TARGETS metis - LIBRARY DESTINATION lib -- RUNTIME DESTINATION lib -+ RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib) - endif() diff --git a/recipes/metis/all/patches/5.1.1-001-fix-coarse-graph-memory-bugs.patch b/recipes/metis/all/patches/5.1.1-001-fix-coarse-graph-memory-bugs.patch new file mode 100644 index 0000000000000..d1640f063425d --- /dev/null +++ b/recipes/metis/all/patches/5.1.1-001-fix-coarse-graph-memory-bugs.patch @@ -0,0 +1,246 @@ +From 36262adecaa9720a4417a67124428061c367fd3f Mon Sep 17 00:00:00 2001 +From: George Karypis +Date: Fri, 27 Nov 2020 23:17:52 +0000 +Subject: [PATCH] fixed a memory bug that appears when the coarser graph stayed + the same size as the original graph + +diff --git a/libmetis/coarsen.c b/libmetis/coarsen.c +--- a/libmetis/coarsen.c ++++ b/libmetis/coarsen.c +@@ -629,7 +629,7 @@ + idx_t *xadj, *vwgt, *adjncy, *adjwgt, *maxvwgt; + idx_t *match, *cmap, *degrees, *perm, *tperm, *vec, *marker; + idx_t mytwgt, xtwgt, ctwgt; +- float bscore, score; ++ real_t bscore, score; + + WCOREPUSH; + +@@ -817,6 +817,7 @@ + printf(" ]\n"); + } + ++#if 0 + + /*************************************************************************/ + /*! This function creates the coarser graph. It uses a simple hash-table +@@ -1327,6 +1328,7 @@ + WCOREPOP; + } + ++#endif + + /*************************************************************************/ + /*! This function creates the coarser graph. Depending on the size of the +@@ -1340,11 +1342,11 @@ + idx_t j, jj, k, kk, l, m, istart, iend, nvtxs, nedges, ncon, + cnedges, v, u, mask; + idx_t *xadj, *vwgt, *vsize, *adjncy, *adjwgt; +- idx_t *cmap, *htable, *table; ++ idx_t *cmap, *htable, *dtable; + idx_t *cxadj, *cvwgt, *cvsize, *cadjncy, *cadjwgt; + graph_t *cgraph; + int dovsize, dropedges; +- idx_t cv, nkeep, droppedewgt; ++ idx_t cv, nkeys, droppedewgt; + idx_t *keys=NULL, *medianewgts=NULL, *noise=NULL; + + WCOREPUSH; +@@ -1367,12 +1369,13 @@ + + /* Setup structures for dropedges */ + if (dropedges) { +- for (nkeep=-1, v=0; vadjncy; + cadjwgt = cgraph->adjwgt; + +- htable = iset(gk_min(cnvtxs+1, mask+1), -1, iwspacemalloc(ctrl, mask+1)); +- table = iset(cnvtxs, -1, iwspacemalloc(ctrl, cnvtxs)); ++ htable = iset(mask+1, -1, iwspacemalloc(ctrl, mask+1)); /* hash table */ ++ dtable = iset(cnvtxs, -1, iwspacemalloc(ctrl, cnvtxs)); /* direct table */ + + cxadj[0] = cnvtxs = cnedges = 0; + for (v=0; v=0; j--) { + k = cadjncy[j]; +- for (kk=k&mask; cadjncy[htable[kk]]!=k; kk=((kk+1)%mask)); ++ for (kk=k&mask; cadjncy[htable[kk]]!=k; kk=((kk+1)&mask)); + htable[kk] = -1; + } + +@@ -1474,10 +1478,10 @@ + iend = xadj[v+1]; + for (j=istart; j= min(medianewgts[u], medianewgts[v]) */ + if (dropedges) { +- for (j=0; j>1)]; ++ ASSERTP(nedges < nkeys, ("%"PRIDX", %"PRIDX"\n", nkeys, nedges)); ++ medianewgts[cnvtxs] = 8; /* default for island nodes */ ++ if (nedges > 0) { ++ for (j=0; j>1))]; ++ } + } + + cadjncy += nedges; +@@ -1542,6 +1550,8 @@ + iend = cxadj[u+1]; + for (j=istart; j= 0, ("%"PRIDX" %"PRIDX"\n", u, medianewgts[u])); ++ ASSERTP(medianewgts[v] >= 0, ("%"PRIDX" %"PRIDX" %"PRIDX"\n", v, medianewgts[v], cnvtxs)); + if ((cadjwgt[j]<<8) + noise[u] + noise[v] >= gk_min(medianewgts[u], medianewgts[v])) { + cadjncy[cnedges] = cadjncy[j]; + cadjwgt[cnedges++] = cadjwgt[j]; +@@ -1573,6 +1583,7 @@ + WCOREPOP; + } + ++#if 0 + + /*************************************************************************/ + /*! This function creates the coarser graph. It uses a full-size array +@@ -1925,6 +1936,7 @@ + WCOREPOP; + } + ++#endif + + /*************************************************************************/ + /*! Setup the various arrays for the coarse graph +@@ -1942,10 +1954,14 @@ + cgraph->finer = graph; + graph->coarser = cgraph; + +- /* Allocate memory for the coarser graph */ ++ /* Allocate memory for the coarser graph. ++ NOTE: The +1 in the adjwgt/adjncy is to allow the optimization of self-loop ++ detection by adding ahead of time the self-loop. That optimization ++ requires a +1 adjncy/adjwgt array for the limit case where the ++ coarser graph is of the same size of the previous graph. */ + cgraph->xadj = imalloc(cnvtxs+1, "SetupCoarseGraph: xadj"); +- cgraph->adjncy = imalloc(graph->nedges, "SetupCoarseGraph: adjncy"); +- cgraph->adjwgt = imalloc(graph->nedges, "SetupCoarseGraph: adjwgt"); ++ cgraph->adjncy = imalloc(graph->nedges+1, "SetupCoarseGraph: adjncy"); ++ cgraph->adjwgt = imalloc(graph->nedges+1, "SetupCoarseGraph: adjwgt"); + cgraph->vwgt = imalloc(cgraph->ncon*cnvtxs, "SetupCoarseGraph: vwgt"); + cgraph->tvwgt = imalloc(cgraph->ncon, "SetupCoarseGraph: tvwgt"); + cgraph->invtvwgt = rmalloc(cgraph->ncon, "SetupCoarseGraph: invtvwgt"); +diff --git a/libmetis/proto.h b/libmetis/proto.h +--- a/libmetis/proto.h ++++ b/libmetis/proto.h +@@ -51,10 +51,6 @@ + void PrintCGraphStats(ctrl_t *ctrl, graph_t *graph); + void CreateCoarseGraph(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, + idx_t *match); +-void CreateCoarseGraphNoMask(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match); +-void CreateCoarseGraphPerm(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match, idx_t *perm); + graph_t *SetupCoarseGraph(graph_t *graph, idx_t cnvtxs, int dovsize); + void ReAdjustMemory(ctrl_t *ctrl, graph_t *graph, graph_t *cgraph); + +diff --git a/libmetis/rename.h b/libmetis/rename.h +--- a/libmetis/rename.h ++++ b/libmetis/rename.h +@@ -41,8 +41,6 @@ + #define Match_JC libmetis__Match_JC + #define PrintCGraphStats libmetis__PrintCGraphStats + #define CreateCoarseGraph libmetis__CreateCoarseGraph +-#define CreateCoarseGraphNoMask libmetis__CreateCoarseGraphNoMask +-#define CreateCoarseGraphPerm libmetis__CreateCoarseGraphPerm + #define SetupCoarseGraph libmetis__SetupCoarseGraph + #define ReAdjustMemory libmetis__ReAdjustMemory + diff --git a/recipes/metis/all/patches/5.1.1-002-fix-out-out-of-bounds-errors.patch b/recipes/metis/all/patches/5.1.1-002-fix-out-out-of-bounds-errors.patch new file mode 100644 index 0000000000000..2e67aa23bc3a8 --- /dev/null +++ b/recipes/metis/all/patches/5.1.1-002-fix-out-out-of-bounds-errors.patch @@ -0,0 +1,199 @@ +Fix out out-of-bounds memory errors + +Squashed commits: +- Avoid out-of-bound memory access for empty graphs +- Fixed incorrect part[] vector when nparts == 1 +- issue #46: fixed the out-of-bound with mdeg+delta + +diff --git a/libmetis/checkgraph.c b/libmetis/checkgraph.c +--- a/libmetis/checkgraph.c ++++ b/libmetis/checkgraph.c +@@ -45,9 +45,11 @@ + + htable = ismalloc(nvtxs, 0, "htable"); + +- minedge = maxedge = adjncy[0]; +- if (adjwgt) +- minewgt = maxewgt = adjwgt[0]; ++ if (graph->nedges > 0) { ++ minedge = maxedge = adjncy[0]; ++ if (adjwgt) ++ minewgt = maxewgt = adjwgt[0]; ++ } + + for (i=0; idbglvl, METIS_DBG_TIME, InitTimers(ctrl)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->TotalTmr)); + +- if (ctrl->dbglvl&512) { +- *objval = BlockKWayPartitioning(ctrl, graph, part); +- } +- else { +- *objval = MlevelKWayPartitioning(ctrl, graph, part); +- } ++ iset(*nvtxs, 0, part); ++ if (ctrl->dbglvl&512) ++ *objval = (*nparts == 1 ? 0 : BlockKWayPartitioning(ctrl, graph, part)); ++ else ++ *objval = (*nparts == 1 ? 0 : MlevelKWayPartitioning(ctrl, graph, part)); + + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->TotalTmr)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, PrintTimers(ctrl)); +diff --git a/libmetis/mmd.c b/libmetis/mmd.c +--- a/libmetis/mmd.c ++++ b/libmetis/mmd.c +@@ -59,24 +59,24 @@ + if (neqns <= 0) + return; + +- /* Adjust from C to Fortran */ ++ /* adjust from C to Fortran */ + xadj--; adjncy--; invp--; perm--; head--; qsize--; list--; marker--; + +- /* initialization for the minimum degree algorithm. */ ++ /* initialization for the minimum degree algorithm */ + *ncsub = 0; + mmdint(neqns, xadj, adjncy, head, invp, perm, qsize, list, marker); + +- /* 'num' counts the number of ordered nodes plus 1. */ ++ /* 'num' counts the number of ordered nodes plus 1 */ + num = 1; + +- /* eliminate all isolated nodes. */ ++ /* eliminate all isolated nodes */ + nextmd = head[1]; + while (nextmd > 0) { + mdeg_node = nextmd; + nextmd = invp[mdeg_node]; + marker[mdeg_node] = maxint; + invp[mdeg_node] = -num; +- num = num + 1; ++ num++; + } + + /* search for node of the minimum degree. 'mdeg' is the current */ +@@ -87,14 +87,16 @@ + head[1] = 0; + mdeg = 2; + +- /* infinite loop here ! */ ++ /* infinite loop here */ + while (1) { + while (head[mdeg] <= 0) + mdeg++; + + /* use value of 'delta' to set up 'mdlmt', which governs */ + /* when a degree update is to be performed. */ +- mdlmt = mdeg + delta; ++ //mdlmt = mdeg + delta; ++ // the need for gk_min() was identified by jsf67 ++ mdlmt = gk_min(neqns, mdeg+delta); + ehead = 0; + + n500: +@@ -107,7 +109,7 @@ + mdeg_node = head[mdeg]; + }; + +- /* remove 'mdeg_node' from the degree structure. */ ++ /* remove 'mdeg_node' from the degree structure */ + nextmd = invp[mdeg_node]; + head[mdeg] = nextmd; + if (nextmd > 0) +@@ -140,7 +142,7 @@ + /* minimum degree nodes elimination. */ + if (num > neqns) + goto n1000; +- mmdupd( ehead, neqns, xadj, adjncy, delta, &mdeg, head, invp, perm, qsize, list, marker, maxint, &tag); ++ mmdupd(ehead, neqns, xadj, adjncy, delta, &mdeg, head, invp, perm, qsize, list, marker, maxint, &tag); + }; /* end of -- while ( 1 ) -- */ + + n1000: +@@ -289,6 +291,7 @@ + return; + } + ++ + /*************************************************************************** + * mmdint ---- mult minimum degree initialization + * purpose -- this routine performs initialization for the +@@ -305,33 +308,30 @@ + idx_t mmdint(idx_t neqns, idx_t *xadj, idx_t *adjncy, idx_t *head, idx_t *forward, + idx_t *backward, idx_t *qsize, idx_t *list, idx_t *marker) + { +- idx_t fnode, ndeg, node; ++ idx_t fnode, ndeg, node; + +- for ( node = 1; node <= neqns; node++ ) { +- head[node] = 0; +- qsize[node] = 1; +- marker[node] = 0; +- list[node] = 0; +- }; ++ for (node=1; node<=neqns; node++) { ++ head[node] = 0; ++ qsize[node] = 1; ++ marker[node] = 0; ++ list[node] = 0; ++ }; + +- /* initialize the degree doubly linked lists. */ +- for ( node = 1; node <= neqns; node++ ) { +- // The following is something that Olaf Schenk identified as potentially a +- // bug that I introduced in the original code. For now, I reverted back +- // to the original code until I have some time to check. +- // ndeg = xadj[node+1] - xadj[node]/* + 1*/; /* george */ +- ndeg = xadj[node+1] - xadj[node] + 1; +- if (ndeg == 0) +- ndeg = 1; +- fnode = head[ndeg]; +- forward[node] = fnode; +- head[ndeg] = node; +- if ( fnode > 0 ) backward[fnode] = node; +- backward[node] = -ndeg; +- }; +- return 0; ++ /* initialize the degree doubly linked lists. */ ++ for (node=1; node<=neqns; node++) { ++ ndeg = xadj[node+1]-xadj[node]+1; ++ fnode = head[ndeg]; ++ forward[node] = fnode; ++ head[ndeg] = node; ++ if (fnode > 0) ++ backward[fnode] = node; ++ backward[node] = -ndeg; ++ }; ++ ++ return 0; + } + ++ + /**************************************************************************** + * mmdnum --- multi minimum degree numbering + * purpose -- this routine performs the final step in producing +@@ -395,6 +395,7 @@ + return; + } + ++ + /**************************************************************************** + * mmdupd ---- multiple minimum degree update + * purpose -- this routine updates the degrees of nodes after a +diff --git a/libmetis/pmetis.c b/libmetis/pmetis.c +--- a/libmetis/pmetis.c ++++ b/libmetis/pmetis.c +@@ -130,7 +130,8 @@ + IFSET(ctrl->dbglvl, METIS_DBG_TIME, InitTimers(ctrl)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->TotalTmr)); + +- *objval = MlevelRecursiveBisection(ctrl, graph, *nparts, part, ctrl->tpwgts, 0); ++ iset(*nvtxs, 0, part); ++ *objval = (*nparts == 1 ? 0 : MlevelRecursiveBisection(ctrl, graph, *nparts, part, ctrl->tpwgts, 0)); + + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->TotalTmr)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, PrintTimers(ctrl)); diff --git a/recipes/metis/all/patches/5.1.1-003-reduce-maximum-memory-use.patch b/recipes/metis/all/patches/5.1.1-003-reduce-maximum-memory-use.patch new file mode 100644 index 0000000000000..93745cf28bbb4 --- /dev/null +++ b/recipes/metis/all/patches/5.1.1-003-reduce-maximum-memory-use.patch @@ -0,0 +1,197 @@ +From aef54c5b2a72f9d0c3c91b008c35271560b79cac Mon Sep 17 00:00:00 2001 +From: George Karypis +Date: Fri, 7 Jan 2022 14:01:46 +0000 +Subject: [PATCH] Small changes to reduce maximum memory use + +diff --git a/libmetis/checkgraph.c b/libmetis/checkgraph.c +--- a/libmetis/checkgraph.c ++++ b/libmetis/checkgraph.c +@@ -45,9 +45,11 @@ + + htable = ismalloc(nvtxs, 0, "htable"); + +- minedge = maxedge = adjncy[0]; +- if (adjwgt) +- minewgt = maxewgt = adjwgt[0]; ++ if (graph->nedges > 0) { ++ minedge = maxedge = adjncy[0]; ++ if (adjwgt) ++ minewgt = maxewgt = adjwgt[0]; ++ } + + for (i=0; idbglvl, METIS_DBG_TIME, InitTimers(ctrl)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->TotalTmr)); + +- if (ctrl->dbglvl&512) { +- *objval = BlockKWayPartitioning(ctrl, graph, part); +- } +- else { +- *objval = MlevelKWayPartitioning(ctrl, graph, part); +- } ++ iset(*nvtxs, 0, part); ++ if (ctrl->dbglvl&512) ++ *objval = (*nparts == 1 ? 0 : BlockKWayPartitioning(ctrl, graph, part)); ++ else ++ *objval = (*nparts == 1 ? 0 : MlevelKWayPartitioning(ctrl, graph, part)); + + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->TotalTmr)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, PrintTimers(ctrl)); +diff --git a/libmetis/mmd.c b/libmetis/mmd.c +--- a/libmetis/mmd.c ++++ b/libmetis/mmd.c +@@ -59,24 +59,24 @@ + if (neqns <= 0) + return; + +- /* Adjust from C to Fortran */ ++ /* adjust from C to Fortran */ + xadj--; adjncy--; invp--; perm--; head--; qsize--; list--; marker--; + +- /* initialization for the minimum degree algorithm. */ ++ /* initialization for the minimum degree algorithm */ + *ncsub = 0; + mmdint(neqns, xadj, adjncy, head, invp, perm, qsize, list, marker); + +- /* 'num' counts the number of ordered nodes plus 1. */ ++ /* 'num' counts the number of ordered nodes plus 1 */ + num = 1; + +- /* eliminate all isolated nodes. */ ++ /* eliminate all isolated nodes */ + nextmd = head[1]; + while (nextmd > 0) { + mdeg_node = nextmd; + nextmd = invp[mdeg_node]; + marker[mdeg_node] = maxint; + invp[mdeg_node] = -num; +- num = num + 1; ++ num++; + } + + /* search for node of the minimum degree. 'mdeg' is the current */ +@@ -87,14 +87,16 @@ + head[1] = 0; + mdeg = 2; + +- /* infinite loop here ! */ ++ /* infinite loop here */ + while (1) { + while (head[mdeg] <= 0) + mdeg++; + + /* use value of 'delta' to set up 'mdlmt', which governs */ + /* when a degree update is to be performed. */ +- mdlmt = mdeg + delta; ++ //mdlmt = mdeg + delta; ++ // the need for gk_min() was identified by jsf67 ++ mdlmt = gk_min(neqns, mdeg+delta); + ehead = 0; + + n500: +@@ -107,7 +109,7 @@ + mdeg_node = head[mdeg]; + }; + +- /* remove 'mdeg_node' from the degree structure. */ ++ /* remove 'mdeg_node' from the degree structure */ + nextmd = invp[mdeg_node]; + head[mdeg] = nextmd; + if (nextmd > 0) +@@ -140,7 +142,7 @@ + /* minimum degree nodes elimination. */ + if (num > neqns) + goto n1000; +- mmdupd( ehead, neqns, xadj, adjncy, delta, &mdeg, head, invp, perm, qsize, list, marker, maxint, &tag); ++ mmdupd(ehead, neqns, xadj, adjncy, delta, &mdeg, head, invp, perm, qsize, list, marker, maxint, &tag); + }; /* end of -- while ( 1 ) -- */ + + n1000: +@@ -289,6 +291,7 @@ + return; + } + ++ + /*************************************************************************** + * mmdint ---- mult minimum degree initialization + * purpose -- this routine performs initialization for the +@@ -305,33 +308,30 @@ + idx_t mmdint(idx_t neqns, idx_t *xadj, idx_t *adjncy, idx_t *head, idx_t *forward, + idx_t *backward, idx_t *qsize, idx_t *list, idx_t *marker) + { +- idx_t fnode, ndeg, node; ++ idx_t fnode, ndeg, node; + +- for ( node = 1; node <= neqns; node++ ) { +- head[node] = 0; +- qsize[node] = 1; +- marker[node] = 0; +- list[node] = 0; +- }; ++ for (node=1; node<=neqns; node++) { ++ head[node] = 0; ++ qsize[node] = 1; ++ marker[node] = 0; ++ list[node] = 0; ++ }; + +- /* initialize the degree doubly linked lists. */ +- for ( node = 1; node <= neqns; node++ ) { +- // The following is something that Olaf Schenk identified as potentially a +- // bug that I introduced in the original code. For now, I reverted back +- // to the original code until I have some time to check. +- // ndeg = xadj[node+1] - xadj[node]/* + 1*/; /* george */ +- ndeg = xadj[node+1] - xadj[node] + 1; +- if (ndeg == 0) +- ndeg = 1; +- fnode = head[ndeg]; +- forward[node] = fnode; +- head[ndeg] = node; +- if ( fnode > 0 ) backward[fnode] = node; +- backward[node] = -ndeg; +- }; +- return 0; ++ /* initialize the degree doubly linked lists. */ ++ for (node=1; node<=neqns; node++) { ++ ndeg = xadj[node+1]-xadj[node]+1; ++ fnode = head[ndeg]; ++ forward[node] = fnode; ++ head[ndeg] = node; ++ if (fnode > 0) ++ backward[fnode] = node; ++ backward[node] = -ndeg; ++ }; ++ ++ return 0; + } + ++ + /**************************************************************************** + * mmdnum --- multi minimum degree numbering + * purpose -- this routine performs the final step in producing +@@ -395,6 +395,7 @@ + return; + } + ++ + /**************************************************************************** + * mmdupd ---- multiple minimum degree update + * purpose -- this routine updates the degrees of nodes after a +diff --git a/libmetis/pmetis.c b/libmetis/pmetis.c +--- a/libmetis/pmetis.c ++++ b/libmetis/pmetis.c +@@ -130,7 +130,8 @@ + IFSET(ctrl->dbglvl, METIS_DBG_TIME, InitTimers(ctrl)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->TotalTmr)); + +- *objval = MlevelRecursiveBisection(ctrl, graph, *nparts, part, ctrl->tpwgts, 0); ++ iset(*nvtxs, 0, part); ++ *objval = (*nparts == 1 ? 0 : MlevelRecursiveBisection(ctrl, graph, *nparts, part, ctrl->tpwgts, 0)); + + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->TotalTmr)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, PrintTimers(ctrl)); diff --git a/recipes/metis/all/test_package/CMakeLists.txt b/recipes/metis/all/test_package/CMakeLists.txt index 04b6e4c9401dc..54194f54c0961 100644 --- a/recipes/metis/all/test_package/CMakeLists.txt +++ b/recipes/metis/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(metis REQUIRED CONFIG) add_executable(${PROJECT_NAME} test.cpp) diff --git a/recipes/metis/all/test_package/conanfile.py b/recipes/metis/all/test_package/conanfile.py index 46d71712aba54..02eb5ce439fb4 100644 --- a/recipes/metis/all/test_package/conanfile.py +++ b/recipes/metis/all/test_package/conanfile.py @@ -1,17 +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_layout, CMake import os +# It will become the standard on Conan 2.x 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 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 requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -19,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): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/metis/all/test_package/test.cpp b/recipes/metis/all/test_package/test.cpp index df955f7eb7be3..6a150009d25d4 100644 --- a/recipes/metis/all/test_package/test.cpp +++ b/recipes/metis/all/test_package/test.cpp @@ -1,10 +1,9 @@ #include #include -#include - -int main(){ +#include +int main() { idx_t nVertices = 6; idx_t nEdges = 7; idx_t nWeights = 1; @@ -14,10 +13,10 @@ int main(){ idx_t part[6]; // Indexes of starting points in adjacent array - idx_t xadj[6+1] = {0,2,5,7,9,12,14}; + idx_t xadj[6 + 1] = {0, 2, 5, 7, 9, 12, 14}; // Adjacent vertices in consecutive index order - idx_t adjncy[2 * 7] = {1,3,0,4,2,1,5,0,4,3,1,5,4,2}; + idx_t adjncy[2 * 7] = {1, 3, 0, 4, 2, 1, 5, 0, 4, 3, 1, 5, 4, 2}; // Weights of vertices // if all weights are equal then can be set to NULL @@ -29,7 +28,7 @@ int main(){ std::cout << ret << std::endl; - for(unsigned part_i = 0; part_i < nVertices; part_i++){ + for (unsigned part_i = 0; part_i < nVertices; part_i++) { std::cout << part_i << " " << part[part_i] << std::endl; } diff --git a/recipes/metis/config.yml b/recipes/metis/config.yml index e7148244c2a2f..bf774fe223f43 100644 --- a/recipes/metis/config.yml +++ b/recipes/metis/config.yml @@ -1,3 +1,5 @@ versions: + "5.2.1": + folder: all "5.1.1": folder: all diff --git a/recipes/mfast/all/conanfile.py b/recipes/mfast/all/conanfile.py index 41c45b6db58d8..dbdf62474df2d 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 fecd6e83f0b2f..6f661e72969a0 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 ff45b79a8420c..c54dc9657fda8 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 6715d7fabbe05..8c86f1a660d74 100644 --- a/recipes/microprofile/all/conandata.yml +++ b/recipes/microprofile/all/conandata.yml @@ -1,12 +1,10 @@ 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" + "4.0": + url: "https://github.com/jonasmr/microprofile/archive/refs/tags/v4.0.tar.gz" + sha256: "59cd3ee7afd3ce5cfeb7599db62ccc0611818985a8e649353bec157122902a5c" + "3.1": + url: "https://github.com/jonasmr/microprofile/archive/refs/tags/v3.1.tar.gz" + sha256: "300e1d0d21e4c13ad1de72c5309ba02fbdb3bcbbe26e5ad9ff8b798380781527" patches: - "3.1": - - patch_file: "patches/sources_fix.patch" - base_path: "source_subfolder" - - patch_file: "patches/cmake.patch" - base_path: "source_subfolder" + "3.1": + - patch_file: "patches/sources_fix.patch" diff --git a/recipes/microprofile/all/conanfile.py b/recipes/microprofile/all/conanfile.py index 9f23e3872db58..b3d0644be3113 100644 --- a/recipes/microprofile/all/conanfile.py +++ b/recipes/microprofile/all/conanfile.py @@ -1,54 +1,62 @@ -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.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, save, load +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version + +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 +67,41 @@ 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.268.0") + if Version(self.version) >= "4.0": + self.requires("stb/cci.20230920") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") + def _validate_int_options(self): positive_int_options = [ "thread_buffer_size", @@ -91,19 +117,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 +139,91 @@ 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - 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 generate(self): + VirtualBuildEnv(self).generate() - 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]) + tc = CMakeToolchain(self) + tc.variables["MP_MINIZ"] = self.options.with_miniz + tc.variables["MP_GPU_TIMERS_VULKAN"] = self.options.enable_timer == "vulkan" + tc.variables["MICROPROFILE_USE_CONFIG_FILE"] = True + tc.preprocessor_definitions["STB_SPRINTF_IMPLEMENTATION"] = 1 + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + deps = PkgConfigDeps(self) + deps.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 Version(self.version) < "4.0": + self.cpp_info.includedirs.append(os.path.join("include", "microprofile")) 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 b92ba025b0a43..0000000000000 --- 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 ed091dc6c1aee..34366c2d4346f 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 30f8c8cfb0975..ef5d7042163ec 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_package/test_package.cpp b/recipes/microprofile/all/test_package/test_package.cpp index 2a13e33f9ca1d..ef555a9511bfa 100644 --- a/recipes/microprofile/all/test_package/test_package.cpp +++ b/recipes/microprofile/all/test_package/test_package.cpp @@ -1,6 +1,6 @@ #include -#include +#include int main() { #if MICROPROFILE_ENABLED 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 0000000000000..91630d79f4abb --- /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 0000000000000..30f8c8cfb0975 --- /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/microprofile/config.yml b/recipes/microprofile/config.yml index 992d10eb37c11..d0751e6458e77 100644 --- a/recipes/microprofile/config.yml +++ b/recipes/microprofile/config.yml @@ -1,3 +1,5 @@ versions: + "4.0": + folder: all "3.1": folder: all diff --git a/recipes/microservice-essentials/all/conandata.yml b/recipes/microservice-essentials/all/conandata.yml new file mode 100644 index 0000000000000..79b465764338c --- /dev/null +++ b/recipes/microservice-essentials/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/seboste/microservice-essentials/archive/refs/tags/0.1.0.tar.gz" + sha256: "9739f7052ee9de96c4b206e0d345d6de5594dcf2bd6f8d3364d44788e83fbe58" diff --git a/recipes/microservice-essentials/all/conanfile.py b/recipes/microservice-essentials/all/conanfile.py new file mode 100644 index 0000000000000..86c82be4f2a4f --- /dev/null +++ b/recipes/microservice-essentials/all/conanfile.py @@ -0,0 +1,105 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.53.0" + +class MicroserviceEssentials(ConanFile): + name = "microservice-essentials" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/seboste/microservice-essentials" + license = "MIT" + description = """microservice-essentials is a portable, independent C++ library that takes care of typical recurring concerns that occur in microservice development.""" + topics = ("microservices", "cloud-native", "request-handling") + settings = "os", "compiler", "arch", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tests": [True, False], + "with_examples": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_tests": False, + "with_examples": False + } + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15.7", + "msvc": "191", + } + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16.3 <4]") + + def requirements(self): + if self.options.with_examples: + self.requires("cpp-httplib/0.14.1") + self.requires("nlohmann_json/3.11.2") + self.requires("openssl/[>=3 <4]") + self.requires("grpc/1.54.3") + if self.options.with_tests: + self.requires("catch2/3.4.0") + self.requires("nlohmann_json/3.11.2") + + 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["BUILD_TESTING"] = self.options.with_tests + tc.variables["BUILD_EXAMPLES"] = self.options.with_examples + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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] + + 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) + ) + + 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 package(self): + 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 = ["microservice-essentials"] + self.cpp_info.bindirs.extend(["lib"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/microservice-essentials/all/test_package/CMakeLists.txt b/recipes/microservice-essentials/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f5945294e9935 --- /dev/null +++ b/recipes/microservice-essentials/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +find_package(microservice-essentials REQUIRED) + +add_executable(test_package main.cpp) +target_link_libraries(test_package microservice-essentials::microservice-essentials) diff --git a/recipes/microservice-essentials/all/test_package/conanfile.py b/recipes/microservice-essentials/all/test_package/conanfile.py new file mode 100644 index 0000000000000..27bfec4efb0d4 --- /dev/null +++ b/recipes/microservice-essentials/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan import ConanFile +from conan.tools.build import cross_building +import os + +class TestPckage(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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/microservice-essentials/all/test_package/main.cpp b/recipes/microservice-essentials/all/test_package/main.cpp new file mode 100644 index 0000000000000..bb1a1722bce6b --- /dev/null +++ b/recipes/microservice-essentials/all/test_package/main.cpp @@ -0,0 +1,13 @@ +#include +#include +#include + +int main() +{ + mse::Context ctx; + std::cout << "context created" << std::endl; + // SignalHandler requires pthread. Check if it builds. + mse::SignalHandler signal_handler(mse::Signal::SIG_SHUTDOWN, []() {}); + std::cout << "signal_handler created" << std::endl; + return 0; +} diff --git a/recipes/microservice-essentials/config.yml b/recipes/microservice-essentials/config.yml new file mode 100644 index 0000000000000..5e5e3d8a61814 --- /dev/null +++ b/recipes/microservice-essentials/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: "all" diff --git a/recipes/mikelankamp-fpm/all/conanfile.py b/recipes/mikelankamp-fpm/all/conanfile.py index 4f1037ea6348f..d62613b715193 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 48499fa0989d9..e845ae751a301 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/conandata.yml b/recipes/mimalloc/all/conandata.yml index c25b069c45c60..4c93c0b6b2850 100644 --- a/recipes/mimalloc/all/conandata.yml +++ b/recipes/mimalloc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.2": + url: "https://github.com/microsoft/mimalloc/archive/v2.1.2.tar.gz" + sha256: "2b1bff6f717f9725c70bf8d79e4786da13de8a270059e4ba0bdd262ae7be46eb" "2.0.9": url: "https://github.com/microsoft/mimalloc/archive/v2.0.9.tar.gz" sha256: "4a29edae32a914a706715e2ac8e7e4109e25353212edeed0888f4e3e15db5850" @@ -17,6 +20,9 @@ sources: "2.0.2": url: "https://github.com/microsoft/mimalloc/archive/v2.0.2.tar.gz" sha256: "c81a5f443f72373e3105172d6a935e29b0dabd13ba387c080bc444586cbe3021" + "1.8.2": + url: "https://github.com/microsoft/mimalloc/archive/v1.8.2.tar.gz" + sha256: "4058d53d6ceb75862f32c30a6ee686c3cbb5e965b2c324b828ca454f7fe064f9" "1.7.9": url: "https://github.com/microsoft/mimalloc/archive/v1.7.9.tar.gz" sha256: "45e05be518363d32b2cdcce1a1fac3580895ea2e4524e1a3c7e71145cb58659f" @@ -33,6 +39,13 @@ sources: url: "https://github.com/microsoft/mimalloc/archive/v1.6.7.tar.gz" sha256: "111b718b496f297f128d842880e72e90e33953cf00b45ba0ccd2167e7340ed17" patches: + "2.1.2": + - patch_file: "patches/2.1.2-0001-change-install-paths.patch" + patch_description: "fix install paths" + patch_type: "conan" + - patch_file: "patches/2.1.2-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" "2.0.9": - patch_file: "patches/2.0.9-0001-change-install-paths.patch" patch_description: "fix install paths" @@ -63,6 +76,13 @@ patches: - patch_file: "patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch" patch_description: "include stddef" patch_type: "portability" + "1.8.2": + - patch_file: "patches/1.8.2-0001-change-install-paths.patch" + patch_description: "fix install paths" + patch_type: "conan" + - patch_file: "patches/1.8.2-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" "1.7.9": - patch_file: "patches/1.7.9-0001-change-install-paths.patch" patch_description: "fix install paths" diff --git a/recipes/mimalloc/all/conanfile.py b/recipes/mimalloc/all/conanfile.py index 124cfd39af08c..eaa8e6193ea4e 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 @@ -19,7 +18,7 @@ class MimallocConan(ConanFile): homepage = "https://github.com/microsoft/mimalloc" description = "mimalloc is a compact general purpose allocator with excellent performance." topics = ("mimalloc", "allocator", "performance", "microsoft") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -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/mimalloc/all/patches/1.8.2-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/1.8.2-0001-change-install-paths.patch new file mode 100644 index 0000000000000..fb5aaa8360791 --- /dev/null +++ b/recipes/mimalloc/all/patches/1.8.2-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2bcd1ef..615cec9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -415,7 +415,7 @@ if(MI_BUILD_SHARED) + install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) + endif() + +- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) ++ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + +@@ -439,7 +439,7 @@ if (MI_BUILD_STATIC) + set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) + endif() + +- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY) ++ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + diff --git a/recipes/mimalloc/all/patches/1.8.2-0002-support-older-compiler.patch b/recipes/mimalloc/all/patches/1.8.2-0002-support-older-compiler.patch new file mode 100644 index 0000000000000..139ede7a8c43a --- /dev/null +++ b/recipes/mimalloc/all/patches/1.8.2-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index 368c22c..fb19939 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -505,7 +505,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -516,7 +516,7 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/recipes/mimalloc/all/patches/2.1.2-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/2.1.2-0001-change-install-paths.patch new file mode 100644 index 0000000000000..eb6660f83dccc --- /dev/null +++ b/recipes/mimalloc/all/patches/2.1.2-0001-change-install-paths.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2bcd1ef..37eee49 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -415,7 +415,7 @@ if(MI_BUILD_SHARED) + install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) + endif() + +- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) ++ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + diff --git a/recipes/mimalloc/all/patches/2.1.2-0002-support-older-compiler.patch b/recipes/mimalloc/all/patches/2.1.2-0002-support-older-compiler.patch new file mode 100644 index 0000000000000..58a4298ac30b4 --- /dev/null +++ b/recipes/mimalloc/all/patches/2.1.2-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index f77c2ea..4c9594f 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -508,7 +508,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -519,7 +519,7 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/recipes/mimalloc/config.yml b/recipes/mimalloc/config.yml index cabec88f14c46..2f9902ecefeb6 100644 --- a/recipes/mimalloc/config.yml +++ b/recipes/mimalloc/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.2": + folder: all "2.0.9": folder: all "2.0.7": @@ -11,6 +13,8 @@ versions: folder: all "2.0.2": folder: all + "1.8.2": + folder: all "1.7.9": folder: all "1.7.7": diff --git a/recipes/mingw-builds/all/conanfile.py b/recipes/mingw-builds/all/conanfile.py index f3b3a8f3278f4..8b875ba354b42 100644 --- a/recipes/mingw-builds/all/conanfile.py +++ b/recipes/mingw-builds/all/conanfile.py @@ -1,7 +1,7 @@ import os from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import download, rmdir +from conan.tools.files import copy, download, rmdir required_conan_version = ">=1.47.0" @@ -16,7 +16,6 @@ class MingwConan(ConanFile): settings = "os", "arch" options = {"threads": ["posix", "win32"], "exception": ["seh", "sjlj"]} default_options = {"threads": "posix", "exception": "seh"} - provides = "mingw-w64" @property @@ -38,15 +37,17 @@ def validate(self): if str(self.settings_target.arch) not in valid_arch: raise ConanInvalidConfiguration(f"MinGW {self.version} is only supported for the following architectures on {self.settings.os}: {valid_arch}") if self.settings_target.compiler != "gcc": - raise ConanInvalidConfiguration("Only GCC is allowed as compiler.") - if str(self.settings_target.compiler.threads) != str(self.options.threads): - raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " - f"with threads={self.options.threads}, your profile:host declares " - f"threads={self.settings_target.compiler.threads}, please use the same value for both.") - if str(self.settings_target.compiler.exception) != str(self.options.exception): - raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " - f"with exception={self.options.exception}, your profile:host declares " - f"exception={self.settings_target.compiler.exception}, please use the same value for both.") + self.output.warning("Only GCC is allowed as compiler. Make sure you are using the right compiler with this package!") + threads_value = self.settings_target.compiler.get_safe("threads") + if str(threads_value) != str(self.options.threads): + self.output.warning("Tool require 'mingw-builds' provides binaries for gcc " + f"with options.threads={self.options.threads}, but your profile:host declares " + f"settings.compiler.threads={threads_value}, please use the same value for both.") + exception_value = self.settings_target.compiler.get_safe("exception") + if str(exception_value) != str(self.options.exception): + self.output.warning("Tool require 'mingw-builds' provides binaries for gcc " + f"with options.exception={self.options.exception}, your profile:host declares " + f"settings.compiler.exception={exception_value}, please use the same value for both.") def build_requirements(self): self.build_requires("7zip/19.00") @@ -62,7 +63,7 @@ def build(self): def package(self): target = "mingw64" if self.settings.arch == "x86_64" else "mingw32" - self.copy("*", dst="", src=target) + copy(self, "*", src=target, dst=self.package_folder) rmdir(self, target) rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "opt", "lib", "cmake")) @@ -70,18 +71,34 @@ def package(self): def package_info(self): if getattr(self, "settings_target", None): if self.settings_target.compiler != "gcc": - raise ConanInvalidConfiguration("Only GCC is allowed as compiler.") - if str(self.settings_target.compiler.threads) != str(self.options.threads): - raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " - f"with threads={self.options.threads}, your profile:host declares " - f"threads={self.settings_target.compiler.threads}, please use the same value for both.") - if str(self.settings_target.compiler.exception) != str(self.options.exception): - raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " - f"with exception={self.options.exception}, your profile:host declares " - f"exception={self.settings_target.compiler.exception}, please use the same value for both.") + self.output.warning("Only GCC is allowed as compiler. Make sure you are using the right compiler with this package!") + threads_value = self.settings_target.compiler.get_safe("threads") + if str(threads_value) != str(self.options.threads): + self.output.warning("Tool require 'mingw-builds' provides binaries for gcc " + f"with options.threads={self.options.threads}, but your profile:host declares " + f"settings.compiler.threads={threads_value}, please use the same value for both.") + exception_value = self.settings_target.compiler.get_safe("exception") + if str(exception_value) != str(self.options.exception): + self.output.warning("Tool require 'mingw-builds' provides binaries for gcc " + f"with options.exception={self.options.exception}, your profile:host declares " + f"settings.compiler.exception={exception_value}, please use the same value for both.") + + self.buildenv_info.define("MINGW_HOME", str(self.package_folder)) + self.buildenv_info.define("CONAN_CMAKE_GENERATOR", "MinGW Makefiles") + self.buildenv_info.define("CXX", os.path.join(self.package_folder, "bin", "g++.exe").replace("\\", "/")) + self.buildenv_info.define("CC", os.path.join(self.package_folder, "bin", "gcc.exe").replace("\\", "/")) + self.buildenv_info.define("LD", os.path.join(self.package_folder, "bin", "ld.exe").replace("\\", "/")) + self.buildenv_info.define("NM", os.path.join(self.package_folder, "bin", "nm.exe").replace("\\", "/")) + self.buildenv_info.define("AR", os.path.join(self.package_folder, "bin", "ar.exe").replace("\\", "/")) + self.buildenv_info.define("AS", os.path.join(self.package_folder, "bin", "as.exe").replace("\\", "/")) + self.buildenv_info.define("STRIP", os.path.join(self.package_folder, "bin", "strip.exe").replace("\\", "/")) + self.buildenv_info.define("RANLIB", os.path.join(self.package_folder, "bin", "ranlib.exe").replace("\\", "/")) + self.buildenv_info.define("STRINGS", os.path.join(self.package_folder, "bin", "strings.exe").replace("\\", "/")) + self.buildenv_info.define("OBJDUMP", os.path.join(self.package_folder, "bin", "objdump.exe").replace("\\", "/")) + self.buildenv_info.define("GCOV", os.path.join(self.package_folder, "bin", "gcov.exe").replace("\\", "/")) + # TODO: Remove this after conan v1 support is dropped 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) self.env_info.MINGW_HOME = str(self.package_folder) diff --git a/recipes/mingw-builds/all/test_package/conanfile.py b/recipes/mingw-builds/all/test_package/conanfile.py index fde2fbd35a165..dbf3513dc9ad8 100644 --- a/recipes/mingw-builds/all/test_package/conanfile.py +++ b/recipes/mingw-builds/all/test_package/conanfile.py @@ -1,16 +1,14 @@ import os -from conans import ConanFile, tools +from conan import ConanFile class MinGWTestConan(ConanFile): - generators = "gcc" - settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + settings = "os", "arch" + test_type = "explicit" - def build(self): - source_file = os.path.join(self.source_folder, "main.cpp") - self.run("gcc.exe {} @conanbuildinfo.gcc -lstdc++ -o main".format(source_file), run_environment=True) + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - if not tools.cross_building(self): - self.run("gcc.exe --version", run_environment=True) - self.run("main") + self.run("gcc.exe --version") diff --git a/recipes/mingw-builds/all/test_package/main.cpp b/recipes/mingw-builds/all/test_package/main.cpp deleted file mode 100644 index b5597569f64e0..0000000000000 --- a/recipes/mingw-builds/all/test_package/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include // test if we can include one of MinGW bundled header - -int main(void) { - std::cout << "Hello world!" << std::endl; - return 0; -} diff --git a/recipes/miniaudio/all/conandata.yml b/recipes/miniaudio/all/conandata.yml index 0a8c29a2d9d9f..061502ec47da0 100644 --- a/recipes/miniaudio/all/conandata.yml +++ b/recipes/miniaudio/all/conandata.yml @@ -1,4 +1,13 @@ 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" "0.11.16": url: "https://github.com/mackron/miniaudio/archive/refs/tags/0.11.16.tar.gz" sha256: "13320464820491c61bd178b95818fecb7cd0e68f9677d61e1345df6be8d4d77e" diff --git a/recipes/miniaudio/config.yml b/recipes/miniaudio/config.yml index a7faf6cecc196..4db3fb9d24db2 100644 --- a/recipes/miniaudio/config.yml +++ b/recipes/miniaudio/config.yml @@ -1,4 +1,10 @@ versions: + "0.11.21": + folder: all + "0.11.18": + folder: all + "0.11.17": + folder: all "0.11.16": folder: all "0.11.11": diff --git a/recipes/minimp3/all/conandata.yml b/recipes/minimp3/all/conandata.yml index f86679db763b3..f9521b04b54c6 100644 --- a/recipes/minimp3/all/conandata.yml +++ b/recipes/minimp3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20211201": + url: "https://github.com/lieff/minimp3/archive/afb604c06bc8beb145fecd42c0ceb5bda8795144.zip" + sha256: "94f847efbb83349ed38dd05888e54bdd8dc6d7bbc3616efd4a1ac899a16bb82e" "20200304": url: "https://github.com/lieff/minimp3/archive/55da78cbeea5fb6757f8df672567714e1e8ca3e9.zip" sha256: "108074684c080a34f0d08f23a709128ea518d48651c8381bce91b73b29185479" diff --git a/recipes/minimp3/all/conanfile.py b/recipes/minimp3/all/conanfile.py index 6886956b3c461..b188314ed0522 100644 --- a/recipes/minimp3/all/conanfile.py +++ b/recipes/minimp3/all/conanfile.py @@ -10,21 +10,21 @@ class Minimp3Conan(ConanFile): name = "minimp3" description = "Minimalistic MP3 decoder single header library." license = "CC0-1.0" - topics = ("minimp3", "decoder", "mp3", "header-only") - homepage = "https://github.com/lieff/minimp3" + topics = ("decoder", "mp3", "header-only") url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lieff/minimp3" + 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/minimp3/all/test_package/conanfile.py b/recipes/minimp3/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/minimp3/all/test_package/conanfile.py +++ b/recipes/minimp3/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/minimp3/config.yml b/recipes/minimp3/config.yml index d49b70495df47..242cda7011c1f 100644 --- a/recipes/minimp3/config.yml +++ b/recipes/minimp3/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20211201": + folder: all "20200304": folder: all "20200221": diff --git a/recipes/minisat/all/conanfile.py b/recipes/minisat/all/conanfile.py index 6dccb7f852803..fdfbb6316a963 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 f0c32e1045bb8..04665f845d5e3 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 af8d398e935c1..731c80a714d09 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 384492f581d34..fcb3fb2b98f24 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/miniupnpc/all/conandata.yml b/recipes/miniupnpc/all/conandata.yml index c414f1ae3f3a4..a75cdc40ec5d3 100644 --- a/recipes/miniupnpc/all/conandata.yml +++ b/recipes/miniupnpc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.5": + url: "https://github.com/miniupnp/miniupnp/archive/refs/tags/miniupnpc_2_2_5.tar.gz" + sha256: "feb2ce11c548115f6e7dead7a523790aceeca92b9fca718f26e5b22303af313c" "2.2.2": url: "https://github.com/miniupnp/miniupnp/archive/refs/tags/miniupnpc_2_2_2.tar.gz" sha256: "a598890cad635170dfce6281d71fc3052dee5c8220da0109281542156267c762" diff --git a/recipes/miniupnpc/all/conanfile.py b/recipes/miniupnpc/all/conanfile.py index 23ce55638aada..46bacdb3551ec 100644 --- a/recipes/miniupnpc/all/conanfile.py +++ b/recipes/miniupnpc/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, replace_in_file, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -41,8 +42,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) @@ -67,11 +67,17 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE", src=os.path.join(self.source_folder, "miniupnpc"), - dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) >= "2.2.4": + copy(self, "LICENSE", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, "LICENSE", src=os.path.join(self.source_folder, "miniupnpc"), + 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")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "miniupnpc") diff --git a/recipes/miniupnpc/all/test_package/test_package.c b/recipes/miniupnpc/all/test_package/test_package.c index b7ba38ffbf1f2..43b44d24b83f2 100644 --- a/recipes/miniupnpc/all/test_package/test_package.c +++ b/recipes/miniupnpc/all/test_package/test_package.c @@ -7,6 +7,8 @@ int main(void) { int ipv6 = 0; unsigned char ttl = 2; int error = 0; - struct UPNPDev *devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, ttl, &error); + if (0) { + struct UPNPDev *devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, ttl, &error); + } return 0; } diff --git a/recipes/miniupnpc/config.yml b/recipes/miniupnpc/config.yml index 6d6cfc66eae07..e89bcaea7727b 100644 --- a/recipes/miniupnpc/config.yml +++ b/recipes/miniupnpc/config.yml @@ -1,3 +1,5 @@ versions: + "2.2.5": + folder: all "2.2.2": folder: all diff --git a/recipes/minizip-ng/all/conandata.yml b/recipes/minizip-ng/all/conandata.yml index cb0fe2c9abad5..59d6ffad1b8f1 100644 --- a/recipes/minizip-ng/all/conandata.yml +++ b/recipes/minizip-ng/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "4.0.4": + url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.4.tar.gz" + sha256: "955800fe39f9d830fcb84e60746952f6a48e41093ec7a233c63ad611b5fcfe9f" + "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" + "3.0.10": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.10.tar.gz" + sha256: "d4a549731d8c7074e421dbab6d8b8ad0a93067752fe767c464f0f40fa5f0a80d" "3.0.9": url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.9.tar.gz" sha256: "992693a532eb15b20d306e6aeea1a1a6501bd19dca993ebe9a95fd22d6b7fd74" @@ -8,25 +26,11 @@ sources: "3.0.7": url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.7.tar.gz" sha256: "39981a0db1bb6da504909bce63d7493286c5e50825c056564544c990d15c55cf" - "3.0.6": - url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.6.tar.gz" - sha256: "383fa1bdc28c482828a8a8db53f758dbd44291b641182724fda5df5b59cce543" - "3.0.5": - url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.5.tar.gz" - sha256: "1a248c378fdf4ef6c517024bb65577603d5146cffaebe81900bec9c0a5035d4d" - "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.10": + - patch_file: "patches/3.0.10-0001-fix-cmake-project.patch" + patch_description: "CMake: declare project() sooner" + patch_type: "conan" "3.0.9": - patch_file: "patches/3.0.9-0001-fix-cmake-project.patch" patch_description: "CMake: declare project() sooner" @@ -43,51 +47,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.6": - - patch_file: "patches/3.0.6-0001-fix-cmake-project.patch" - patch_description: "CMake: declare project() sooner" - patch_type: "conan" - - patch_file: "patches/3.0.6-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.5": - - patch_file: "patches/3.0.5-0001-fix-cmake-project.patch" - patch_description: "CMake: declare project() sooner" - patch_type: "conan" - - patch_file: "patches/3.0.5-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.4": - - patch_file: "patches/3.0.4-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.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 a4e9fe7489e1e..01cfddc75128c 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 = { @@ -73,8 +71,6 @@ def configure(self): self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") - if self.options.mz_compatibility: - self.provides = "minizip" if self.options.get_safe("with_libcomp"): del self.options.with_zlib @@ -83,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: @@ -98,7 +94,9 @@ def requirements(self): def build_requirements(self): if self._needs_pkg_config: - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") + if Version(self.version) >= "4.0.0": + self.tool_requires("cmake/[>=3.19 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -136,9 +134,14 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE 1)", - "") + if Version(self.version) < "4.0.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE 1)", + "") + 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)", + "") def build(self): self._patch_sources() @@ -169,6 +172,10 @@ def package_info(self): if self.options.with_bzip2: self.cpp_info.components["minizip"].defines.append("HAVE_BZIP2") + if Version(self.version) >= "4.0.0": + minizip_dir = "minizip" if self.options.mz_compatibility else "minizip-ng" + self.cpp_info.components["minizip"].includedirs.append(os.path.join(self.package_folder, "include", minizip_dir)) + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "minizip" self.cpp_info.filenames["cmake_find_package_multi"] = "minizip" @@ -192,3 +199,4 @@ def package_info(self): self.cpp_info.components["minizip"].frameworks.extend(["CoreFoundation", "Security"]) if self.settings.os != "Windows" and self.options.with_iconv: self.cpp_info.components["minizip"].requires.append("libiconv::libiconv") + 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 c44b1784ce620..0000000000000 --- 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.1-0002-fix-lzma-libdir.patch b/recipes/minizip-ng/all/patches/3.0.1-0002-fix-lzma-libdir.patch deleted file mode 100644 index cb1ecba6e8149..0000000000000 --- a/recipes/minizip-ng/all/patches/3.0.1-0002-fix-lzma-libdir.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -312,6 +312,7 @@ if(MZ_LZMA) - - list(APPEND MINIZIP_INC ${LIBLZMA_INCLUDE_DIRS}) - list(APPEND MINIZIP_LIB ${LIBLZMA_LIBRARIES}) -+ list(APPEND MINIZIP_LBD ${LIBLZMA_LIBRARY_DIRS}) - - set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lliblzma") - elseif(MZ_FETCH_LIBS) diff --git a/recipes/minizip-ng/all/patches/3.0.10-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.10-0001-fix-cmake-project.patch new file mode 100644 index 0000000000000..59a38a7b64d6f --- /dev/null +++ b/recipes/minizip-ng/all/patches/3.0.10-0001-fix-cmake-project.patch @@ -0,0 +1,18 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -80,6 +80,7 @@ + + # Library version + set(VERSION "3.0.10") ++project(minizip${MZ_PROJECT_SUFFIX} LANGUAGES C VERSION ${VERSION}) + + # API version + set(SOVERSION "3") +@@ -662,7 +663,6 @@ + list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) + + # Create minizip library +-project(minizip${MZ_PROJECT_SUFFIX} LANGUAGES C 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 8cfa267f8cff7..0000000000000 --- 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 484eb23a91671..0000000000000 --- 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/all/patches/3.0.4-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.4-0001-fix-cmake-project.patch deleted file mode 100644 index 5ae134194c263..0000000000000 --- a/recipes/minizip-ng/all/patches/3.0.4-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.4") -+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/all/patches/3.0.5-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.5-0001-fix-cmake-project.patch deleted file mode 100644 index bc28f8055105e..0000000000000 --- a/recipes/minizip-ng/all/patches/3.0.5-0001-fix-cmake-project.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -66,10 +66,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.5") -+project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) - - # API version - set(SOVERSION "3") -@@ -661,7 +661,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.5-0002-fix-lzma-libdir.patch b/recipes/minizip-ng/all/patches/3.0.5-0002-fix-lzma-libdir.patch deleted file mode 100644 index 0e4b01050297b..0000000000000 --- a/recipes/minizip-ng/all/patches/3.0.5-0002-fix-lzma-libdir.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -303,6 +303,7 @@ if(MZ_LZMA) - - list(APPEND MINIZIP_INC ${LIBLZMA_INCLUDE_DIRS}) - list(APPEND MINIZIP_LIB ${LIBLZMA_LIBRARIES}) -+ list(APPEND MINIZIP_LBD ${LIBLZMA_LIBRARY_DIRS}) - - set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lliblzma") - elseif(MZ_FETCH_LIBS) diff --git a/recipes/minizip-ng/all/patches/3.0.6-0001-fix-cmake-project.patch b/recipes/minizip-ng/all/patches/3.0.6-0001-fix-cmake-project.patch deleted file mode 100644 index e08990e93540e..0000000000000 --- a/recipes/minizip-ng/all/patches/3.0.6-0001-fix-cmake-project.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -70,6 +70,7 @@ enable_language(C) - - # Library version - set(VERSION "3.0.6") -+project(minizip${MZ_PROJECT_SUFFIX} VERSION ${VERSION} LANGUAGES C) - - # API version - set(SOVERSION "3") -@@ -663,7 +664,6 @@ endif() - list(APPEND MINIZIP_INC ${CMAKE_CURRENT_SOURCE_DIR}) - - # Create minizip library --project(minizip${MZ_PROJECT_SUFFIX} LANGUAGES C 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 d293a6987b124..8a16d3eeb883f 100644 --- a/recipes/minizip-ng/config.yml +++ b/recipes/minizip-ng/config.yml @@ -1,19 +1,19 @@ versions: - "3.0.9": + "4.0.4": folder: all - "3.0.8": + "4.0.3": folder: all - "3.0.7": + "4.0.2": folder: all - "3.0.6": + "4.0.1": folder: all - "3.0.5": + "4.0.0": folder: all - "3.0.4": + "3.0.10": folder: all - "3.0.3": + "3.0.9": folder: all - "3.0.2": + "3.0.8": folder: all - "3.0.1": + "3.0.7": folder: all diff --git a/recipes/minizip/all/conanfile.py b/recipes/minizip/all/conanfile.py index e4316426a6e9c..cec7c823f0429 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 fdad8f55da413..6e7bb1d711691 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 469a34156ae79..a91c01d248f09 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 d120a992c06a6..0a6bc68712d90 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 84deeaa812c31..b21cc49efde95 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 ce9e92b9275c8..023d02b706f66 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 0000000000000..2e4260fa45c64 --- /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 0000000000000..781246e7dfea4 --- /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 0000000000000..5c2d17e17789e --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..708d34f560ee3 --- /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 0000000000000..40341aa3db6cd --- /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 a89b6dfd7b4a5..404038dfda2d5 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 e00b58eaa4743..2b86f2fbd7132 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 925ecbe19e448..91630d79f4abb 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 5d89f31c243f2..0000000000000 --- 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 132186858b019..0000000000000 --- 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 f4c00d1c189e7..0000000000000 --- 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 22885d71a0ad6..27fad647a9723 100644 --- a/recipes/mold/all/conandata.yml +++ b/recipes/mold/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.4.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.4.0.tar.gz" + sha256: "be65f3d785d32ece7b3204ecaa57810847fdd25c232cf704cbfff2dafb1ac107" + "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 7a48206ed3782..a760cce0d4728 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 60e9ac3ecf6ee..551d50ce9428a 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 b98e60e56dc68..b4070800652f5 100644 --- a/recipes/mold/config.yml +++ b/recipes/mold/config.yml @@ -1,6 +1,8 @@ versions: - "1.3.1": - folder: 1.3.1 + "2.4.0": + folder: all + "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 be9c59fe3dc4d..5e5abc368ffce 100644 --- a/recipes/mongo-c-driver/all/conandata.yml +++ b/recipes/mongo-c-driver/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "1.23.5": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.23.5/mongo-c-driver-1.23.5.tar.gz" + sha256: "260dc2207881ccbe7b79b1fa6b3ba84ab9be94eb93d4beefbbe8a6cb562947ed" + "1.23.4": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.23.4/mongo-c-driver-1.23.4.tar.gz" + sha256: "209406c91fcf7c63aa633179a0a6b1b36ba237fb77e0470fd81f7299a408e334" "1.23.2": url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.23.2/mongo-c-driver-1.23.2.tar.gz" sha256: "123c358827eea07cd76a31c40281bb1c81b6744f6587c96d0cf217be8b1234e3" @@ -11,16 +23,47 @@ sources: "1.17.6": url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.6/mongo-c-driver-1.17.6.tar.gz" sha256: "8644deec7ae585e8d12566978f2017181e883f303a028b5b3ccb83c91248b150" - "1.17.4": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.4/mongo-c-driver-1.17.4.tar.gz" - sha256: "9ec8fe7fb54d636886fa823460658ccf660e3d82520d10810fb7c9d302ac974f" - "1.17.3": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.3/mongo-c-driver-1.17.3.tar.gz" - sha256: "6594cbae17389005bcac5a8d4091af3be4894d5314a519504d4b4509effcc0df" - "1.17.2": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.2/mongo-c-driver-1.17.2.tar.gz" - sha256: "bc53d5f72ab628a1ae549db6888325d6dc34db3ca31c5e16e550c1bb4266d864" 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" + 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.23.5": + - patch_file: "patches/1.23.2-0001-disable-shared-when-static.patch" + patch_description: "separate static and shared builds" + patch_type: "conan" + - patch_file: "patches/1.22.0-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.23.4": + - patch_file: "patches/1.23.2-0001-disable-shared-when-static.patch" + patch_description: "separate static and shared builds" + patch_type: "conan" + - patch_file: "patches/1.22.0-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.23.2": - patch_file: "patches/1.23.2-0001-disable-shared-when-static.patch" patch_description: "separate static and shared builds" @@ -55,15 +98,3 @@ patches: - patch_file: "patches/1.17.6-0001-disable-shared-when-static.patch" patch_description: "separate static and shared builds" patch_type: "conan" - "1.17.4": - - patch_file: "patches/1.17.2-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" - "1.17.3": - - patch_file: "patches/1.17.2-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" - "1.17.2": - - patch_file: "patches/1.17.2-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" diff --git a/recipes/mongo-c-driver/all/conanfile.py b/recipes/mongo-c-driver/all/conanfile.py index 9c272cde63df8..abc21a11a2f2b 100644 --- a/recipes/mongo-c-driver/all/conanfile.py +++ b/recipes/mongo-c-driver/all/conanfile.py @@ -74,11 +74,11 @@ 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: - self.requires("icu/72.1") + self.requires("icu/73.2") def validate(self): if self.options.with_ssl == "darwin" and not is_apple_os(self): @@ -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/all/patches/1.17.2-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.17.2-0001-disable-shared-when-static.patch deleted file mode 100644 index 8767b278cd009..0000000000000 --- a/recipes/mongo-c-driver/all/patches/1.17.2-0001-disable-shared-when-static.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- a/src/libbson/CMakeLists.txt -+++ b/src/libbson/CMakeLists.txt -@@ -230,6 +230,7 @@ set (HEADERS_FORWARDING - ${PROJECT_SOURCE_DIR}/src/bson/forwarding/bson.h - ) - -+if (NOT MONGOC_ENABLE_STATIC_BUILD) - add_library (bson_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) - set (CMAKE_CXX_VISIBILITY_PRESET hidden) - target_compile_definitions (bson_shared PRIVATE BSON_COMPILATION JSONSL_PARSE_NAN) -@@ -272,6 +273,7 @@ if (WIN32) - # must be handled specially since we can't resolve them - set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32) - endif () -+endif() - - if (MONGOC_ENABLE_STATIC_BUILD) - add_library (bson_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) -@@ -330,7 +332,7 @@ set (BSON_HEADER_INSTALL_DIR - ) - - if (MONGOC_ENABLE_STATIC_INSTALL) -- set (TARGETS_TO_INSTALL bson_shared bson_static) -+ set (TARGETS_TO_INSTALL bson_static) - else () - set (TARGETS_TO_INSTALL bson_shared) - endif () ---- a/src/libmongoc/CMakeLists.txt -+++ b/src/libmongoc/CMakeLists.txt -@@ -725,6 +725,7 @@ if (MONGOC_ENABLE_MONGODB_AWS_AUTH) - endif() - endif () - -+if (NOT MONGOC_ENABLE_STATIC_BUILD) - add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) - set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden) - target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIES}) -@@ -744,6 +745,7 @@ target_compile_definitions (mongoc_shared PRIVATE MONGOC_COMPILATION ${KMS_MSG_D - - set_target_properties (mongoc_shared PROPERTIES VERSION 0.0.0 SOVERSION 0) - set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-${MONGOC_API_VERSION}") -+endif() - - if (MONGOC_ENABLE_STATIC_BUILD) - add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) -@@ -766,6 +768,7 @@ if (MONGOC_ENABLE_STATIC_BUILD) - set_target_properties (mongoc_static PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-static-${MONGOC_API_VERSION}") - endif () - -+if (NOT MONGOC_ENABLE_STATIC_BUILD) - if (ENABLE_APPLE_FRAMEWORK) - set_target_properties (mongoc_shared PROPERTIES - FRAMEWORK TRUE -@@ -776,9 +779,14 @@ if (ENABLE_APPLE_FRAMEWORK) - PUBLIC_HEADER "${HEADERS}" - ) - endif () -+endif() - - add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c) -+if (NOT MONGOC_ENABLE_STATIC_BUILD) - target_link_libraries (mongoc-stat mongoc_shared ${LIBRARIES}) -+else () -+target_link_libraries (mongoc-stat mongoc_static ${STATIC_LIBRARIES}) -+endif () - - # mongoc-stat works if shared memory performance counters are enabled. - if (ENABLE_SHM_COUNTERS STREQUAL "ON") -@@ -1040,7 +1048,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR} - file (COPY ${PROJECT_SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests) - - if (MONGOC_ENABLE_STATIC_INSTALL) -- set (TARGETS_TO_INSTALL mongoc_shared mongoc_static) -+ set (TARGETS_TO_INSTALL mongoc_static) - else () - set (TARGETS_TO_INSTALL mongoc_shared) - endif () diff --git a/recipes/mongo-c-driver/all/patches/1.24.1-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.24.1-0001-disable-shared-when-static.patch new file mode 100644 index 0000000000000..2ec7380ba4806 --- /dev/null +++ b/recipes/mongo-c-driver/all/patches/1.24.1-0001-disable-shared-when-static.patch @@ -0,0 +1,82 @@ +diff --git a/src/libbson/CMakeLists.txt b/src/libbson/CMakeLists.txt +index 61e9267..ff26474 100644 +--- a/src/libbson/CMakeLists.txt ++++ b/src/libbson/CMakeLists.txt +@@ -205,6 +205,7 @@ set (HEADERS_FORWARDING + ${PROJECT_SOURCE_DIR}/src/bson/forwarding/bson.h + ) + ++if (NOT MONGOC_ENABLE_STATIC_BUILD) + add_library (bson_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) + if (MSVC AND MSVC_VERSION VERSION_LESS 1900) + message (STATUS "Disabling warning C4756 for VS 2013 and older") +@@ -282,6 +283,7 @@ if (WIN32) + # must be handled specially since we can't resolve them + set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32) + endif () ++endif () + + if (MONGOC_ENABLE_STATIC_BUILD) + add_library (bson_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) +@@ -367,7 +369,7 @@ set (BSON_HEADER_INSTALL_DIR + ) + + if (MONGOC_ENABLE_STATIC_INSTALL) +- set (TARGETS_TO_INSTALL bson_shared bson_static) ++ set (TARGETS_TO_INSTALL bson_static) + else () + set (TARGETS_TO_INSTALL bson_shared) + endif () +diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt +index bf95bd0..03a0f51 100644 +--- a/src/libmongoc/CMakeLists.txt ++++ b/src/libmongoc/CMakeLists.txt +@@ -745,6 +745,7 @@ if (MONGOC_ENABLE_STATIC_BUILD) + set_target_properties (mcd_rpc PROPERTIES OUTPUT_NAME "mcd-rpc") + endif () + ++if (NOT MONGOC_ENABLE_STATIC_BUILD) + add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) + set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden) + target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIES}) +@@ -785,6 +786,7 @@ target_include_directories ( + + set_target_properties (mongoc_shared PROPERTIES VERSION 0.0.0 SOVERSION 0) + set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-${MONGOC_API_VERSION}") ++endif() + + if (MONGOC_ENABLE_STATIC_BUILD) + add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) +@@ -828,6 +830,7 @@ if (MONGOC_ENABLE_STATIC_BUILD) + set_target_properties (mongoc_static PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-static-${MONGOC_API_VERSION}") + endif () + ++if (NOT MONGOC_ENABLE_STATIC_BUILD) + if (ENABLE_APPLE_FRAMEWORK) + set_target_properties (mongoc_shared PROPERTIES + FRAMEWORK TRUE +@@ -838,9 +841,15 @@ if (ENABLE_APPLE_FRAMEWORK) + PUBLIC_HEADER "${HEADERS}" + ) + endif () ++endif () + + add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c) ++if (NOT MONGOC_ENABLE_STATIC_BUILD) + target_link_libraries (mongoc-stat mongoc_shared ${LIBRARIES}) ++else () ++target_link_libraries (mongoc-stat mongoc_static ${STATIC_LIBRARIES}) ++endif () ++ + + # mongoc-stat works if shared memory performance counters are enabled. + if (ENABLE_SHM_COUNTERS) +@@ -1150,7 +1159,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR} + file (COPY ${PROJECT_SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests) + + if (MONGOC_ENABLE_STATIC_INSTALL) +- set (TARGETS_TO_INSTALL mongoc_shared mongoc_static) ++ set (TARGETS_TO_INSTALL mongoc_static) + else () + set (TARGETS_TO_INSTALL mongoc_shared) + endif () diff --git a/recipes/mongo-c-driver/all/patches/1.24.1-0002-fix-uninitialized-warning.patch b/recipes/mongo-c-driver/all/patches/1.24.1-0002-fix-uninitialized-warning.patch new file mode 100644 index 0000000000000..7f59dea94d008 --- /dev/null +++ b/recipes/mongo-c-driver/all/patches/1.24.1-0002-fix-uninitialized-warning.patch @@ -0,0 +1,13 @@ +diff --git a/src/libbson/src/bson/bson-iter.c b/src/libbson/src/bson/bson-iter.c +index 00aa5c5..38e9c2b 100644 +--- a/src/libbson/src/bson/bson-iter.c ++++ b/src/libbson/src/bson/bson-iter.c +@@ -2146,7 +2146,7 @@ bson_iter_visit_all (bson_iter_t *iter, /* INOUT */ + + if (iter->err_off) { + if (unsupported && visitor->visit_unsupported_type && +- bson_utf8_validate (key, strlen (key), false)) { ++ key != NULL && bson_utf8_validate (key, strlen (key), false)) { + visitor->visit_unsupported_type (iter, key, bson_type, data); + return false; + } diff --git a/recipes/mongo-c-driver/config.yml b/recipes/mongo-c-driver/config.yml index 1b2d5cda4e394..c20e8c0d07847 100644 --- a/recipes/mongo-c-driver/config.yml +++ b/recipes/mongo-c-driver/config.yml @@ -1,4 +1,12 @@ versions: + "1.24.3": + folder: all + "1.24.1": + folder: all + "1.23.5": + folder: all + "1.23.4": + folder: all "1.23.2": folder: all "1.22.2": @@ -7,9 +15,3 @@ versions: folder: all "1.17.6": folder: all - "1.17.4": - folder: all - "1.17.3": - folder: all - "1.17.2": - folder: all diff --git a/recipes/mongo-cxx-driver/all/conandata.yml b/recipes/mongo-cxx-driver/all/conandata.yml index 63919e45005aa..58272018f4021 100644 --- a/recipes/mongo-cxx-driver/all/conandata.yml +++ b/recipes/mongo-cxx-driver/all/conandata.yml @@ -1,4 +1,13 @@ 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" "3.7.0": url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.0/mongo-cxx-driver-r3.7.0.tar.gz" sha256: "fb2da11178db728f63147fe4b0c7509eb49b1b02c5cb55f9bee5f927e451a0c7" @@ -15,6 +24,27 @@ 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" + 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.0": - patch_file: "patches/3.7.0-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 118ad3a647540..26e997f666df1 100644 --- a/recipes/mongo-cxx-driver/all/conanfile.py +++ b/recipes/mongo-cxx-driver/all/conanfile.py @@ -17,7 +17,7 @@ class MongoCxxConan(ConanFile): homepage = "http://mongocxx.org" description = "C++ Driver for MongoDB" topics = ("libbsoncxx", "libmongocxx", "mongo", "mongodb", "database", "db") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -47,9 +47,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("mongo-c-driver/1.23.2") + self.requires("mongo-c-driver/1.24.3") if self.options.polyfill == "boost": - self.requires("boost/1.81.0") + self.requires("boost/1.82.0", transitive_headers=True) @property def _minimal_std_version(self): diff --git a/recipes/mongo-cxx-driver/all/patches/3.7.2-0001-dirs.patch b/recipes/mongo-cxx-driver/all/patches/3.7.2-0001-dirs.patch new file mode 100644 index 0000000000000..f1c52fb2f96e1 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.7.2-0001-dirs.patch @@ -0,0 +1,80 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 20254fa..d7dc7c4 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 d87d588..1aefd91 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.13.0) + set(LIBBSON_REQUIRED_ABI_VERSION 1.0) +@@ -94,7 +94,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 a7e6ded..4fb9027 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.22.1) + set(LIBMONGOC_REQUIRED_ABI_VERSION 1.0) diff --git a/recipes/mongo-cxx-driver/all/patches/3.7.2-0002-poly_use_std_define.patch b/recipes/mongo-cxx-driver/all/patches/3.7.2-0002-poly_use_std_define.patch new file mode 100644 index 0000000000000..1105c439eae72 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.7.2-0002-poly_use_std_define.patch @@ -0,0 +1,13 @@ +diff --git a/src/bsoncxx/stdx/make_unique.hpp b/src/bsoncxx/stdx/make_unique.hpp +index fe8bb2d..737e76b 100644 +--- a/src/bsoncxx/stdx/make_unique.hpp ++++ b/src/bsoncxx/stdx/make_unique.hpp +@@ -48,7 +48,7 @@ using ::boost::make_unique; + BSONCXX_INLINE_NAMESPACE_END + } // namespace bsoncxx + +-#elif __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) ++#elif defined(BSONCXX_POLY_USE_STD) + + #include + 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 0000000000000..e057a4548d890 --- /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 0000000000000..d7084612ddc1d --- /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/all/test_package/test_package.cpp b/recipes/mongo-cxx-driver/all/test_package/test_package.cpp index 57282320fb7a6..d44d69617b5ba 100644 --- a/recipes/mongo-cxx-driver/all/test_package/test_package.cpp +++ b/recipes/mongo-cxx-driver/all/test_package/test_package.cpp @@ -6,8 +6,6 @@ #include // Compilation check -#include -#include #include int main() { diff --git a/recipes/mongo-cxx-driver/config.yml b/recipes/mongo-cxx-driver/config.yml index fe3fd8b511744..dfc6d8b54584e 100644 --- a/recipes/mongo-cxx-driver/config.yml +++ b/recipes/mongo-cxx-driver/config.yml @@ -1,4 +1,10 @@ versions: + "3.8.1": + folder: all + "3.8.0": + folder: all + "3.7.2": + folder: all "3.7.0": folder: all "3.6.7": diff --git a/recipes/mosquitto/1.x/conanfile.py b/recipes/mosquitto/1.x/conanfile.py index c9cd7eb5586db..030bc9686278b 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 622f72a77af8b..8200a378ca1b5 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 6af30191cdf13..c221f41ff8ca8 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 7627743e2625f..0e19ca6c8d04b 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/mozilla-build/all/conandata.yml b/recipes/mozilla-build/all/conandata.yml index 5311816d69140..170e338726163 100644 --- a/recipes/mozilla-build/all/conandata.yml +++ b/recipes/mozilla-build/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "4.0.2": + - url: "https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-4.0.2.exe" + sha256: "a7b84c266fc8908a925f6a788f46226aa76507e1b43230f7a63db6e1b1384ed1" + - url: "https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt" + sha256: "fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85" "3.3": - url: "https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-3.3.exe" sha256: "ac86e5794c6a99c25dee0b60720c7cfd9833ec64785c74838723179830749c9c" diff --git a/recipes/mozilla-build/all/conanfile.py b/recipes/mozilla-build/all/conanfile.py index c13282cd3e215..6bed83f899cf8 100644 --- a/recipes/mozilla-build/all/conanfile.py +++ b/recipes/mozilla-build/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import download +from conan.tools.files import download, copy from conan.errors import ConanInvalidConfiguration import os @@ -19,18 +19,18 @@ def validate(self): raise ConanInvalidConfiguration("Only Windows supported") def build_requirements(self): - self.build_requires("7zip/19.00") + self.build_requires("7zip/22.01") def build(self): filename = "mozilla-build.exe" download(self, **self.conan_data["sources"][self.version][0], filename=filename) download(self, **self.conan_data["sources"][self.version][1], filename="LICENSE") - self.run(f"7z x {filename}", run_environment=True) + self.run(f"7z x {filename}") def package(self): - self.copy("LICENSE", dst="licenses") - self.copy("nsinstall.exe", src="bin", dst="bin") + copy(self, "LICENSE", src=self.build_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "nsinstall.exe", src=os.path.join(self.build_folder, "bin"), dst=os.path.join(self.package_folder, "bin")) def package_id(self): del self.info.settings.build_type diff --git a/recipes/mozilla-build/all/test_package/conanfile.py b/recipes/mozilla-build/all/test_package/conanfile.py index 73fd3540bb387..dd7e8af7bf77d 100644 --- a/recipes/mozilla-build/all/test_package/conanfile.py +++ b/recipes/mozilla-build/all/test_package/conanfile.py @@ -1,15 +1,21 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import save import os 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): - tools.save("file.txt", "some text") + save(self, "file.txt", "some text") assert not os.path.isdir("destionation") self.run("nsinstall -D destination") assert os.path.isdir("destination") assert not os.path.isfile(os.path.join("destination", "file.txt")) self.run("nsinstall -t -m 644 file.txt destination") assert os.path.isfile(os.path.join("destination", "file.txt")) - diff --git a/recipes/mozilla-build/config.yml b/recipes/mozilla-build/config.yml index e5e834cfda633..2bc9098fbced7 100644 --- a/recipes/mozilla-build/config.yml +++ b/recipes/mozilla-build/config.yml @@ -1,3 +1,5 @@ versions: + "4.0.2": + folder: all "3.3": folder: all diff --git a/recipes/mozjpeg/all/conandata.yml b/recipes/mozjpeg/all/conandata.yml index b3cb941ad21eb..16c60131167b1 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 3dcf78b0f0e8e..117852b445d53 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 0000000000000..b9d6dd16f33f3 --- /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 0000000000000..d3dd3fde8807b --- /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 c5a4dbb215dd3..ae34a5e9040b3 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.6.0/conandata.yml b/recipes/mp-units/0.6.0/conandata.yml deleted file mode 100644 index b8636a96910a4..0000000000000 --- a/recipes/mp-units/0.6.0/conandata.yml +++ /dev/null @@ -1,4 +0,0 @@ -sources: - "0.6.0": - url: https://github.com/mpusz/units/archive/v0.6.0.tar.gz - sha256: 7102d2c4460c87525d385b5f1488ac0ef9755b7f7984076bcc64d1506e1bdfd8 diff --git a/recipes/mp-units/0.6.0/conanfile.py b/recipes/mp-units/0.6.0/conanfile.py deleted file mode 100644 index d3b064aae5a00..0000000000000 --- a/recipes/mp-units/0.6.0/conanfile.py +++ /dev/null @@ -1,69 +0,0 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from conans.tools import Version, check_min_cppstd -import os - - -class MPUnitsConan(ConanFile): - name = "mp-units" - homepage = "https://github.com/mpusz/units" - description = "Physical Units library for C++" - topics = ("units", "dimensions", "quantities", "dimensional-analysis", "physical-quantities", "physical-units", "system-of-units", "cpp23", "cpp20", "library", "quantity-manipulation") - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - settings = "os", "arch", "compiler", "build_type" - requires = ( - "fmt/7.0.3", - "ms-gsl/3.1.0" - ) - generators = "cmake" - no_copy_source = True - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def _validate_compiler_settings(self): - compiler = self.settings.compiler - version = Version(self.settings.compiler.version) - if compiler == "gcc": - if version < "10.0": - raise ConanInvalidConfiguration("mp-units requires at least g++-10") - elif compiler == "Visual Studio": - if version < "16": - raise ConanInvalidConfiguration("mp-units requires at least MSVC 16.7") - else: - raise ConanInvalidConfiguration("mp-units is supported only by gcc and Visual Studio so far") - if compiler.get_safe("cppstd"): - check_min_cppstd(self, "20") - - def configure(self): - self._validate_compiler_settings() - - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "units-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def package(self): - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "src", "include")) - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) - - def package_id(self): - self.info.header_only() - - def package_info(self): - compiler = self.settings.compiler - version = Version(self.settings.compiler.version) - if compiler == "gcc": - self.cpp_info.cxxflags = [ - "-Wno-non-template-friend" - ] - elif compiler == "Visual Studio": - self.cpp_info.cxxflags = [ - "/utf-8" - ] diff --git a/recipes/mp-units/0.6.0/test_package/CMakeLists.txt b/recipes/mp-units/0.6.0/test_package/CMakeLists.txt deleted file mode 100644 index 9276c30bd7348..0000000000000 --- a/recipes/mp-units/0.6.0/test_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::mp-units) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) diff --git a/recipes/mp-units/0.6.0/test_package/conanfile.py b/recipes/mp-units/0.6.0/test_package/conanfile.py deleted file mode 100644 index 0109b151054b5..0000000000000 --- a/recipes/mp-units/0.6.0/test_package/conanfile.py +++ /dev/null @@ -1,25 +0,0 @@ -from conans import ConanFile, CMake, tools -from conans.tools import Version -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - - # TODO remove when https://github.com/conan-io/conan/issues/7680 is solved (or VS2019 is updated to at least 16.7) - 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(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/mp-units/0.6.0/test_package/test_package.cpp b/recipes/mp-units/0.6.0/test_package/test_package.cpp deleted file mode 100644 index 08d749317da70..0000000000000 --- a/recipes/mp-units/0.6.0/test_package/test_package.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main() -{ - using namespace units::physical::si::literals; - std::cout << "Speed = " << 240._q_km / 2_q_h << '\n'; -} diff --git a/recipes/mp-units/0.7.0/conandata.yml b/recipes/mp-units/0.7.0/conandata.yml deleted file mode 100644 index 9986b435619c5..0000000000000 --- a/recipes/mp-units/0.7.0/conandata.yml +++ /dev/null @@ -1,4 +0,0 @@ -sources: - "0.7.0": - url: https://github.com/mpusz/units/archive/v0.7.0.tar.gz - sha256: 7ff4bc3537e1bd09630fefae513796686a3f97e509283ad658e1ae81fe49de67 diff --git a/recipes/mp-units/0.7.0/conanfile.py b/recipes/mp-units/0.7.0/conanfile.py deleted file mode 100644 index 71d2cc465a52e..0000000000000 --- a/recipes/mp-units/0.7.0/conanfile.py +++ /dev/null @@ -1,84 +0,0 @@ -from conans import ConanFile, CMake, tools -from conans.tools import Version, check_min_cppstd -from conans.errors import ConanInvalidConfiguration -import os - -required_conan_version = ">=1.33.0" - -class MPUnitsConan(ConanFile): - name = "mp-units" - homepage = "https://github.com/mpusz/units" - description = "Physical Units library for C++" - topics = ("units", "dimensions", "quantities", "dimensional-analysis", "physical-quantities", "physical-units", "system-of-units", "cpp23", "cpp20", "library", "quantity-manipulation") - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - settings = "os", "arch", "compiler", "build_type" - generators = "cmake_find_package_multi" - no_copy_source = True - - @property - def _source_subfolder(self): - return "source_subfolder" - - def requirements(self): - compiler = self.settings.compiler - self.requires("fmt/7.1.3") - self.requires("gsl-lite/0.38.0") - if compiler == "clang" and compiler.libcxx == "libc++": - self.requires("range-v3/0.11.0") - - def validate(self): - compiler = self.settings.compiler - version = Version(self.settings.compiler.version) - if compiler == "gcc": - if version < "10.0": - raise ConanInvalidConfiguration("mp-units requires at least g++-10") - elif compiler == "clang": - if version < "12": - raise ConanInvalidConfiguration("mp-units requires at least clang++-12") - elif compiler == "Visual Studio": - if version < "16": - raise ConanInvalidConfiguration("mp-units requires at least Visual Studio 16.9") - else: - raise ConanInvalidConfiguration("Unsupported compiler") - if compiler.get_safe("cppstd"): - check_min_cppstd(self, "20") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def package(self): - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) - cmake = CMake(self) - cmake.configure(source_folder=os.path.join(self._source_subfolder, "src")) - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - - def package_id(self): - self.info.header_only() - - def package_info(self): - compiler = self.settings.compiler - - # core - self.cpp_info.components["core"].requires = ["gsl-lite::gsl-lite"] - if compiler == "Visual Studio": - self.cpp_info.components["core"].cxxflags = ["/utf-8"] - elif compiler == "clang" and compiler.libcxx == "libc++": - 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", "fmt::fmt"] - self.cpp_info.components["isq"].requires = ["core"] - self.cpp_info.components["isq-natural"].requires = ["isq"] - self.cpp_info.components["si"].requires = ["isq"] - self.cpp_info.components["si-cgs"].requires = ["si"] - self.cpp_info.components["si-fps"].requires = ["si"] - self.cpp_info.components["si-iau"].requires = ["si"] - self.cpp_info.components["si-imperial"].requires = ["si"] - self.cpp_info.components["si-international"].requires = ["si"] - self.cpp_info.components["si-typographic"].requires = ["si"] - self.cpp_info.components["si-uscs"].requires = ["si"] - self.cpp_info.components["isq-iec80000"].requires = ["si"] - self.cpp_info.components["systems"].requires = ["isq", "isq-natural", "si", "si-cgs", "si-fps", "si-iau", "si-imperial", "si-international", "si-typographic", "si-uscs", "isq-iec80000"] diff --git a/recipes/mp-units/0.8.0/conandata.yml b/recipes/mp-units/0.8.0/conandata.yml new file mode 100644 index 0000000000000..7b20912030889 --- /dev/null +++ b/recipes/mp-units/0.8.0/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.8.0": + url: https://github.com/mpusz/units/archive/v0.8.0.tar.gz + sha256: 4081c75e5f2763bb95a6514d952f187519591e594b8fb93ddc9943741827e8c9 diff --git a/recipes/mp-units/0.8.0/conanfile.py b/recipes/mp-units/0.8.0/conanfile.py new file mode 100644 index 0000000000000..c44e1496f2a03 --- /dev/null +++ b/recipes/mp-units/0.8.0/conanfile.py @@ -0,0 +1,155 @@ +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.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): + return {"gcc": "10.3", "clang": "12", "apple-clang": "13", "msvc": "192"} + + @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.12.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)" + ) + + 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["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["isq"].requires = ["core"] + self.cpp_info.components["isq-natural"].requires = ["isq"] + self.cpp_info.components["si"].requires = ["isq"] + self.cpp_info.components["si-cgs"].requires = ["si"] + self.cpp_info.components["si-fps"].requires = ["si-international"] + self.cpp_info.components["si-hep"].requires = ["si"] + self.cpp_info.components["si-iau"].requires = ["si"] + self.cpp_info.components["si-imperial"].requires = ["si"] + self.cpp_info.components["si-international"].requires = ["si"] + self.cpp_info.components["si-typographic"].requires = ["si"] + self.cpp_info.components["si-uscs"].requires = ["si"] + self.cpp_info.components["isq-iec80000"].requires = ["si"] + self.cpp_info.components["systems"].requires = [ + "isq", + "isq-natural", + "si", + "si-cgs", + "si-fps", + "si-hep", + "si-iau", + "si-imperial", + "si-international", + "si-typographic", + "si-uscs", + "isq-iec80000", + ] diff --git a/recipes/mp-units/0.7.0/test_package/CMakeLists.txt b/recipes/mp-units/0.8.0/test_package/CMakeLists.txt similarity index 100% rename from recipes/mp-units/0.7.0/test_package/CMakeLists.txt rename to recipes/mp-units/0.8.0/test_package/CMakeLists.txt diff --git a/recipes/mp-units/0.8.0/test_package/conanfile.py b/recipes/mp-units/0.8.0/test_package/conanfile.py new file mode 100644 index 0000000000000..e418ee7701960 --- /dev/null +++ b/recipes/mp-units/0.8.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/0.7.0/test_package/test_package.cpp b/recipes/mp-units/0.8.0/test_package/test_package.cpp similarity index 100% rename from recipes/mp-units/0.7.0/test_package/test_package.cpp rename to recipes/mp-units/0.8.0/test_package/test_package.cpp diff --git a/recipes/mp-units/0.8.0/test_v1_package/CMakeLists.txt b/recipes/mp-units/0.8.0/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..07f3e7cd91e8a --- /dev/null +++ b/recipes/mp-units/0.8.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/0.7.0/test_package/conanfile.py b/recipes/mp-units/0.8.0/test_v1_package/conanfile.py similarity index 100% rename from recipes/mp-units/0.7.0/test_package/conanfile.py rename to recipes/mp-units/0.8.0/test_v1_package/conanfile.py diff --git a/recipes/mp-units/0.8.0/test_v1_package/test_package.cpp b/recipes/mp-units/0.8.0/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..cd9ed5c7a0227 --- /dev/null +++ b/recipes/mp-units/0.8.0/test_v1_package/test_package.cpp @@ -0,0 +1,19 @@ +#include +#include +#include +#include +#include + +using namespace units; + +template +constexpr auto avg_speed(Length d, Time t) +{ + return d / t; +} + +int main() +{ + using namespace units::isq::si::references; + std::cout << "Average speed = " << avg_speed(240 * km, 2 * h) << '\n'; +} 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 0000000000000..6919665f992c1 --- /dev/null +++ b/recipes/mp-units/2.0.0/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.1.0": + url: https://github.com/mpusz/units/archive/v2.1.0.tar.gz + sha256: a42057492f5a8e80442cf13602b97bb48b9c3a408bc91bdb60d86aadc84c95cc + "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 0000000000000..c41e90a14db59 --- /dev/null +++ b/recipes/mp-units/2.0.0/conanfile.py @@ -0,0 +1,156 @@ +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 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 msvc is disabled for now, its C++20 implementation are not up to speed + return {"gcc": "12", "clang": "16", "apple-clang": "15"} + + @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 + + def requirements(self): + self.requires("gsl-lite/0.40.0") + if self._use_libfmt: + self.requires("fmt/10.1.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)" + ) + + # Re-enable once newer versions with better support come out + if is_msvc(self): + 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"] + + # 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 0000000000000..07f3e7cd91e8a --- /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 0000000000000..e418ee7701960 --- /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 0000000000000..f7a82eba1d2de --- /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 0000000000000..07f3e7cd91e8a --- /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 0000000000000..048e0f9557d47 --- /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 0000000000000..f7a82eba1d2de --- /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 7ad903a9673a0..3bf1ad6108b4a 100644 --- a/recipes/mp-units/config.yml +++ b/recipes/mp-units/config.yml @@ -1,5 +1,7 @@ versions: - "0.7.0": - folder: 0.7.0 - "0.6.0": - folder: 0.6.0 + "2.1.0": + folder: 2.0.0 + "2.0.0": + folder: 2.0.0 + "0.8.0": + folder: 0.8.0 diff --git a/recipes/mpark-variant/all/conanfile.py b/recipes/mpark-variant/all/conanfile.py index e015db951bf2d..1796ef9e9cc74 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 cd8f83a739d7d..8f24801eccbac 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 f996155628e5c..820b8fd1588b8 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 5167a095daebe..3a407d4714c49 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 da190011b6b6d..45240bc874229 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 d07c95e596619..ad477c94d0d7a 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/mpdecimal/2.4.2/conandata.yml b/recipes/mpdecimal/2.4.2/conandata.yml index 41a874b9a4e1b..c08ade0abc061 100644 --- a/recipes/mpdecimal/2.4.2/conandata.yml +++ b/recipes/mpdecimal/2.4.2/conandata.yml @@ -4,7 +4,5 @@ sources: url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.4.2.tar.gz" patches: "2.4.2": - - base_path: "source_subfolder" - patch_file: "patches/0001-msvc-fixes.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-disable-vcstdint-h-vs2015.patch" + - patch_file: "patches/0001-msvc-fixes.patch" + - patch_file: "patches/0002-disable-vcstdint-h-vs2015.patch" diff --git a/recipes/mpdecimal/2.4.2/conanfile.py b/recipes/mpdecimal/2.4.2/conanfile.py index e0edbd2d2f318..c1e944ec6366b 100644 --- a/recipes/mpdecimal/2.4.2/conanfile.py +++ b/recipes/mpdecimal/2.4.2/conanfile.py @@ -1,19 +1,30 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration import os -import shutil + +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.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, mkdir, rename +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, VCVars, NMakeDeps, NMakeToolchain + +required_conan_version = ">=1.53.0" class MpdecimalConan(ConanFile): name = "mpdecimal" - version = "2.4.2" - description = "mpdecimal is a package for correctly-rounded arbitrary precision decimal floating point arithmetic." + description = ( + "mpdecimal is a package for correctly-rounded arbitrary precision decimal floating point arithmetic." + ) license = "BSD-2-Clause" - topics = ("mpdecimal", "multiprecision", "library") url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.bytereef.org/mpdecimal" - settings = "os", "compiler", "build_type", "arch" - exports_sources = "patches/**" + topics = ("multiprecision", "library") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -23,42 +34,72 @@ class MpdecimalConan(ConanFile): "fPIC": True, } - _autotools = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "setings_build", self.settings) - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - - def configure(self): - if self._is_msvc and self.settings.arch not in ("x86", "x86_64"): - raise ConanInvalidConfiguration("Arch is unsupported") - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - if self.options.shared: - del self.options.fPIC + 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 validate(self): + if is_msvc(self) and self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration( + f"{self.ref} currently does not supported {self.settings.arch}. Contributions are welcomed") + + def build_requirements(self): + if is_msvc(self): + self.tool_requires("automake/1.16.5") + else: + 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], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - _shared_ext_mapping = { - "Linux": ".so", - "Windows": ".dll", - "Macos": ".dylib", - } + def generate(self): + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + + deps = NMakeDeps(self) + deps.generate() + + tc = NMakeToolchain(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() + + deps = AutotoolsDeps(self) + if is_apple_os(self) and self.settings.arch == "armv8": + deps.environment.append("LDFLAGS", ["-arch arm64"]) + deps.environment.append("LDXXFLAGS", ["-arch arm64"]) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if not self._is_msvc: + apply_conandata_patches(self) + if not is_msvc(self): """ Using autotools: - Build only shared libraries when shared == True @@ -66,142 +107,140 @@ def _patch_sources(self): ! This is more complicated on Windows because when shared=True, an implicit static library has to be built """ - shared_ext = self._shared_ext_mapping[str(self.settings.os)] + shared_ext_mapping = { + "Linux": ".so", + "Windows": ".dll", + "Macos": ".dylib", + } + shared_ext = shared_ext_mapping[str(self.settings.os)] static_ext = ".a" main_version, _ = self.version.split(".", 1) - tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), - "libmpdec.a", - "libmpdec{}".format(static_ext)) - tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), - "libmpdec.so", - "libmpdec{}".format(shared_ext)) - - makefile_in = os.path.join(self._source_subfolder, "Makefile.in") - mpdec_makefile_in = os.path.join(self._source_subfolder, "libmpdec", "Makefile.in") - tools.replace_in_file(makefile_in, - "libdir = @libdir@", - "libdir = @libdir@\n" - "bindir = @bindir@") + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "libmpdec.a", f"libmpdec{static_ext}") + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "libmpdec.so", f"libmpdec{shared_ext}") + + makefile_in = os.path.join(self.source_folder, "Makefile.in") + mpdec_makefile_in = os.path.join(self.source_folder, "libmpdec", "Makefile.in") + replace_in_file(self, makefile_in, "libdir = @libdir@", "libdir = @libdir@\nbindir = @bindir@") if self.options.shared: if self.settings.os == "Windows": - tools.replace_in_file(makefile_in, - "LIBSHARED = @LIBSHARED@", - "LIBSHARED = libmpdec-{}{}".format(main_version, shared_ext)) - tools.replace_in_file(makefile_in, - "install: FORCE", - "install: FORCE\n" - "\t$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)") - tools.replace_in_file(makefile_in, - "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(libdir)\n", - "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(bindir)\n") - tools.replace_in_file(makefile_in, - "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so\n", - "") + replace_in_file(self, makefile_in, + "LIBSHARED = @LIBSHARED@", + f"LIBSHARED = libmpdec-{main_version}{shared_ext}") + replace_in_file(self, makefile_in, + "install: FORCE", + "install: FORCE\n\t$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)") + replace_in_file(self, makefile_in, + "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(libdir)\n", + "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(bindir)\n") + replace_in_file(self, makefile_in, + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so\n", + "") else: - tools.replace_in_file(makefile_in, - "\t$(INSTALL) -m 644 libmpdec/$(LIBSTATIC) $(DESTDIR)$(libdir)\n", - "") - tools.replace_in_file(makefile_in, - "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so", - "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec{}".format(shared_ext)) + replace_in_file(self, makefile_in, + "\t$(INSTALL) -m 644 libmpdec/$(LIBSTATIC) $(DESTDIR)$(libdir)\n", + "") + replace_in_file(self, makefile_in, + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so", + f"\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec{shared_ext}") else: - tools.replace_in_file(makefile_in, - "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(libdir)\n", - "") - tools.replace_in_file(makefile_in, - "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so\n", - "") + replace_in_file(self, makefile_in, + "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(libdir)\n", + "") + replace_in_file(self, makefile_in, + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so\n", + "") - tools.replace_in_file(mpdec_makefile_in, - "default: $(LIBSTATIC) $(LIBSHARED)", - "default: $({})".format("LIBSHARED" if self.options.shared else "LIBSTATIC")) + replace_in_file(self, mpdec_makefile_in, + "default: $(LIBSTATIC) $(LIBSHARED)", + "default: $({})".format("LIBSHARED" if self.options.shared else "LIBSTATIC")) if self.settings.os == "Windows": - tools.replace_in_file(mpdec_makefile_in, - "LIBSHARED = @LIBSHARED@", - "LIBSHARED = libmpdec-{}{}".format(main_version, shared_ext)) - tools.replace_in_file(mpdec_makefile_in, - "\tln -sf $(LIBSHARED) libmpdec.so", - "") - tools.replace_in_file(mpdec_makefile_in, - "\tln -sf $(LIBSHARED) $(LIBSONAME)", - "") - tools.replace_in_file(mpdec_makefile_in, - "CONFIGURE_LDFLAGS =", - "CONFIGURE_LDFLAGS = -Wl,--out-implib,libmpdec{}".format(static_ext)) + replace_in_file(self, mpdec_makefile_in, + "LIBSHARED = @LIBSHARED@", + f"LIBSHARED = libmpdec-{main_version}{shared_ext}") + replace_in_file(self, mpdec_makefile_in, "\tln -sf $(LIBSHARED) libmpdec.so", "") + replace_in_file(self, mpdec_makefile_in, "\tln -sf $(LIBSHARED) $(LIBSONAME)", "") + replace_in_file(self, mpdec_makefile_in, + "CONFIGURE_LDFLAGS =", + f"CONFIGURE_LDFLAGS = -Wl,--out-implib,libmpdec{static_ext}") else: - tools.replace_in_file(mpdec_makefile_in, - "libmpdec.so", - "libmpdec{}".format(shared_ext)) + replace_in_file(self, mpdec_makefile_in, "libmpdec.so", f"libmpdec{shared_ext}") - def _build_msvc(self): - libmpdec_folder = os.path.join(self.build_folder, self._source_subfolder, "libmpdec") - vcbuild_folder = os.path.join(self.build_folder, self._source_subfolder, "vcbuild") - arch_ext = "{}".format(32 if self.settings.arch == "x86" else 64) - dist_folder = os.path.join(vcbuild_folder, "dist{}".format(arch_ext)) - os.mkdir(dist_folder) - - shutil.copy(os.path.join(libmpdec_folder, "Makefile.vc"), os.path.join(libmpdec_folder, "Makefile")) - - autotools = AutoToolsBuildEnvironment(self) - - with tools.chdir(libmpdec_folder): - with tools.vcvars(self.settings): - self.run("""nmake /nologo MACHINE={machine} DLL={dll} CONAN_CFLAGS="{cflags}" CONAN_LDFLAGS="{ldflags}" """.format( - machine="ppro" if self.settings.arch == "x86" else "x64", - dll="1" if self.options.shared else "0", - cflags=" ".join(autotools.flags), - ldflags=" ".join(autotools.link_flags), - )) - - shutil.copy("mpdecimal.h", dist_folder) - if self.options.shared: - shutil.copy("libmpdec-{}.dll".format(self.version), os.path.join(dist_folder, "libmpdec-{}.dll".format(self.version))) - shutil.copy("libmpdec-{}.dll.exp".format(self.version), os.path.join(dist_folder, "libmpdec-{}.exp".format(self.version))) - shutil.copy("libmpdec-{}.dll.lib".format(self.version), os.path.join(dist_folder, "libmpdec-{}.lib".format(self.version))) - else: - shutil.copy("libmpdec-{}.lib".format(self.version), dist_folder) + @property + def _libmpdec_folder(self): + return self.source_path / "libmpdec" + + @property + def _dist_folder(self): + vcbuild_folder = self.build_path / "vcbuild" + arch_ext = "32" if self.settings.arch == "x86" else "64" + return vcbuild_folder / f"dist{arch_ext}" - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - if self.settings.os == "Macos" and self.settings.arch == "armv8": - self._autotools.link_flags.append("-arch arm64") - self._autotools .configure() - return self._autotools + def _build_msvc(self): + libmpdec_folder = self._libmpdec_folder + copy(self, "Makefile.vc", libmpdec_folder, self.build_path) + rename(self, self.build_path / "Makefile.vc", libmpdec_folder / "Makefile") + + ext = "dll" if self.options.shared else "lib" + mpdec_target = f"libmpdec-{self.version}.{ext}" + + with chdir(self, libmpdec_folder): + self.run("nmake -f Makefile.vc {target} MACHINE={machine} DEBUG={debug} DLL={dll}".format( + target=mpdec_target, + machine={"x86": "ppro", "x86_64": "x64"}[str(self.settings.arch)], + # FIXME: else, use ansi32 and ansi64 + debug="1" if self.settings.build_type == "Debug" else "0", + dll="1" if self.options.shared else "0", + )) + + dist_folder = self._dist_folder + mkdir(self, dist_folder) + copy(self, "mpdecimal.h", libmpdec_folder, dist_folder) + if self.options.shared: + copy(self, "*.dll", libmpdec_folder, dist_folder) + copy(self, "*.dll.exp", libmpdec_folder, dist_folder) + copy(self, "*.dll.lib", libmpdec_folder, dist_folder) + else: + copy(self, "*.lib", libmpdec_folder, dist_folder) def build(self): self._patch_sources() - if self._is_msvc: + if is_msvc(self): self._build_msvc() else: - with tools.chdir(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("LICENSE.txt", src=self._source_subfolder, dst="licenses") - if self._is_msvc: - distfolder = os.path.join(self.build_folder, self._source_subfolder, "vcbuild", "dist{}".format(32 if self.settings.arch == "x86" else 64)) - self.copy("vc*.h", src=os.path.join(self.build_folder, self._source_subfolder, "libmpdec"), dst="include") - self.copy("*.h", src=distfolder, dst="include") - self.copy("*.lib", src=distfolder, dst="lib") - self.copy("*.dll", src=distfolder, dst="bin") + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + dist_folder = self._dist_folder + copy(self, "vc*.h", src=self._libmpdec_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "*.h", src=dist_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "*.lib", src=dist_folder, dst=os.path.join(self.package_folder, "lib")) + copy(self, "*.dll", src=dist_folder, dst=os.path.join(self.package_folder, "bin")) else: - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): - autotools = self._configure_autotools() + with chdir(self, os.path.join(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")) + fix_apple_shared_install_name(self) def package_info(self): - if self._is_msvc: - self.cpp_info.libs = ["libmpdec-{}".format(self.version)] + if is_msvc(self): + if self.options.shared: + self.cpp_info.libs = [f"libmpdec-{self.version}.dll"] + else: + self.cpp_info.libs = [f"libmpdec-{self.version}"] else: self.cpp_info.libs = ["mpdec"] if self.options.shared: - if self._is_msvc: + if is_msvc(self): self.cpp_info.defines = ["USE_DLL"] else: if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt b/recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt index 3a403dc404b41..fecc277bff235 100644 --- a/recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt +++ b/recipes/mpdecimal/2.4.2/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(mpdecimal REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE mpdecimal::mpdecimal) diff --git a/recipes/mpdecimal/2.4.2/test_package/conanfile.py b/recipes/mpdecimal/2.4.2/test_package/conanfile.py index 97c415cdb0a2a..694bc86329208 100644 --- a/recipes/mpdecimal/2.4.2/test_package/conanfile.py +++ b/recipes/mpdecimal/2.4.2/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("{} 13 100".format(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(f"{bin_path} 13 100", env="conanrun") diff --git a/recipes/mpdecimal/2.4.2/test_v1_package/CMakeLists.txt b/recipes/mpdecimal/2.4.2/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/mpdecimal/2.4.2/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/mpdecimal/2.4.2/test_v1_package/conanfile.py b/recipes/mpdecimal/2.4.2/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fa100896a6cfb --- /dev/null +++ b/recipes/mpdecimal/2.4.2/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("{} 13 100".format(os.path.join("bin", "test_package")), run_environment=True) diff --git a/recipes/mpdecimal/2.5.x/conanfile.py b/recipes/mpdecimal/2.5.x/conanfile.py index 5d90356bfd228..ce8610550b172 100644 --- a/recipes/mpdecimal/2.5.x/conanfile.py +++ b/recipes/mpdecimal/2.5.x/conanfile.py @@ -8,7 +8,6 @@ from conan.tools.apple import is_apple_os from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -import pathlib required_conan_version = ">=1.55.0" @@ -17,10 +16,11 @@ class MpdecimalConan(ConanFile): name = "mpdecimal" description = "mpdecimal is a package for correctly-rounded arbitrary precision decimal floating point arithmetic." license = "BSD-2-Clause" - topics = ("mpdecimal", "multiprecision", "library") + topics = ("multiprecision", "library") url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.bytereef.org/mpdecimal" - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -64,9 +64,9 @@ def validate(self): def build_requirements(self): if is_msvc(self): - self.tool_requires("automake/1.16.4") + self.tool_requires("automake/1.16.5") else: - # required to suppport windows as a build machine + # required to support windows as a build machine if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): @@ -110,18 +110,18 @@ def generate(self): deps.environment.append("LDXXFLAGS", ["-arch arm64"]) deps.generate() + @property + def _dist_folder(self): + vcbuild_folder = self.build_path / "vcbuild" + arch_ext = "32" if self.settings.arch == "x86" else "64" + return vcbuild_folder / f"dist{arch_ext}" + def _build_msvc(self): - source_dir = pathlib.Path(self.source_folder) - build_dir = pathlib.Path(self.build_folder) - libmpdec_folder = source_dir / "libmpdec" - libmpdecpp_folder = source_dir / "libmpdec++" - vcbuild_folder = build_dir / "vcbuild" - arch_ext = "{}".format(32 if self.settings.arch == "x86" else 64) - dist_folder = vcbuild_folder / "dist{}".format(arch_ext) - mkdir(self, dist_folder) + libmpdec_folder = self.source_path / "libmpdec" + libmpdecpp_folder = self.source_path / "libmpdec++" - copy(self, "Makefile.vc", libmpdec_folder, build_dir) - rename(self, build_dir / "Makefile.vc", libmpdec_folder / "Makefile") + copy(self, "Makefile.vc", libmpdec_folder, self.build_path) + rename(self, self.build_path / "Makefile.vc", libmpdec_folder / "Makefile") mpdec_target = "libmpdec-{}.{}".format(self.version, "dll" if self.options.shared else "lib") mpdecpp_target = "libmpdec++-{}.{}".format(self.version, "dll" if self.options.shared else "lib") @@ -140,16 +140,18 @@ def _build_msvc(self): dll="1" if self.options.shared else "0", )) + dist_folder = self._dist_folder + mkdir(self, dist_folder) copy(self, "mpdecimal.h", libmpdec_folder, dist_folder) if self.options.shared: - copy(self, "libmpdec-{}.dll".format(self.version), libmpdec_folder, dist_folder) - copy(self, "libmpdec-{}.dll.exp".format(self.version), libmpdec_folder, dist_folder) - copy(self, "libmpdec-{}.dll.lib".format(self.version), libmpdec_folder, dist_folder) + copy(self, f"libmpdec-{self.version}.dll", libmpdec_folder, dist_folder) + copy(self, f"libmpdec-{self.version}.dll.exp", libmpdec_folder, dist_folder) + copy(self, f"libmpdec-{self.version}.dll.lib", libmpdec_folder, dist_folder) else: - copy(self, "libmpdec-{}.lib".format(self.version), libmpdec_folder, dist_folder) + copy(self, f"libmpdec-{self.version}.lib", libmpdec_folder, dist_folder) if self.options.cxx: copy(self, "decimal.hh", libmpdecpp_folder, dist_folder) - copy(self, "libmpdec++-{}.lib".format(self.version), libmpdecpp_folder, dist_folder) + copy(self, f"libmpdec++-{self.version}.lib", libmpdecpp_folder, dist_folder) @property def _shared_suffix(self): @@ -162,10 +164,13 @@ def _shared_suffix(self): @property def _target_names(self): libsuffix = self._shared_suffix if self.options.shared else ".a" - versionsuffix = ".{}".format(self.version) if self.options.shared else "" - suffix = "{}{}".format(versionsuffix, libsuffix) if is_apple_os( - self) or self.settings.os == "Windows" else "{}{}".format(libsuffix, versionsuffix) - return "libmpdec{}".format(suffix), "libmpdec++{}".format(suffix) + versionsuffix = f".{self.version}" if self.options.shared else "" + suffix = ( + f"{versionsuffix}{libsuffix}" + if is_apple_os(self) or self.settings.os == "Windows" + else f"{libsuffix}{versionsuffix}" + ) + return f"libmpdec{suffix}", f"libmpdec++{suffix}" def build(self): apply_conandata_patches(self) @@ -176,32 +181,28 @@ def build(self): autotools.configure() # self.output.info(load(self, pathlib.Path("libmpdec", "Makefile"))) libmpdec, libmpdecpp = self._target_names - copy(self, "*", pathlib.Path(self.source_folder, "libmpdec"), pathlib.Path(self.build_folder, "libmpdec")) + copy(self, "*", self.source_path / "libmpdec", self.build_path / "libmpdec") with chdir(self, "libmpdec"): autotools.make(target=libmpdec) if self.options.cxx: - copy(self, "*", pathlib.Path(self.source_folder, "libmpdec++"), - pathlib.Path(self.build_folder, "libmpdec++")) + copy(self, "*", self.source_path / "libmpdec++", self.build_path / "libmpdec++") with chdir(self, "libmpdec++"): autotools.make(target=libmpdecpp) def package(self): - source_dir = pathlib.Path(self.source_folder) - pkg_dir = pathlib.Path(self.package_folder) + pkg_dir = self.package_path copy(self, "LICENSE.txt", src=self.source_folder, dst=pkg_dir / "licenses") if is_msvc(self): - build_dir = pathlib.Path(self.build_folder) - distfolder = build_dir / "vcbuild" / "dist{}".format(32 if self.settings.arch == "x86" else 64) - copy(self, "vc*.h", src=source_dir / "libmpdec", dst=pkg_dir / "include") + distfolder = self._dist_folder + copy(self, "vc*.h", src=self.source_path / "libmpdec", dst=pkg_dir / "include") copy(self, "*.h", src=distfolder, dst=pkg_dir / "include") if self.options.cxx: copy(self, "*.hh", src=distfolder, dst=pkg_dir / "include") copy(self, "*.lib", src=distfolder, dst=pkg_dir / "lib") copy(self, "*.dll", src=distfolder, dst=pkg_dir / "bin") else: - build_dir = pathlib.Path(self.build_folder) - mpdecdir = build_dir / "libmpdec" - mpdecppdir = build_dir / "libmpdec++" + mpdecdir = self.build_path / "libmpdec" + mpdecppdir = self.build_path / "libmpdec++" copy(self, "mpdecimal.h", src=mpdecdir, dst=pkg_dir / "include") if self.options.cxx: copy(self, "decimal.hh", src=mpdecppdir, dst=pkg_dir / "include") @@ -218,7 +219,7 @@ def package(self): def package_info(self): lib_pre_suf = ("", "") if is_msvc(self): - lib_pre_suf = ("lib", "-{}".format(self.version)) + lib_pre_suf = ("lib", f"-{self.version}") elif self.settings.os == "Windows": if self.options.shared: lib_pre_suf = ("", ".dll") diff --git a/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt b/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt index f5aa7762f69b0..fd62443b2dbe5 100644 --- a/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt +++ b/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(test_package) +project(test_package LANGUAGES CXX C) enable_testing() @@ -10,7 +10,7 @@ add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE mpdecimal::libmpdecimal) add_test(NAME test_package COMMAND test_package 10 13) -if(MPDECIMAL_CXX) +if(TARGET mpdecimal::libmpdecimal++) add_executable(${PROJECT_NAME}_cpp test_package.cpp) set_propertY(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) target_link_libraries(${PROJECT_NAME}_cpp PRIVATE mpdecimal::libmpdecimal++) diff --git a/recipes/mpdecimal/2.5.x/test_package/conanfile.py b/recipes/mpdecimal/2.5.x/test_package/conanfile.py index 6ee5b409e31d8..24cabf72b9327 100644 --- a/recipes/mpdecimal/2.5.x/test_package/conanfile.py +++ b/recipes/mpdecimal/2.5.x/test_package/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, cmake_layout from conan.tools.build import can_run, build_jobs class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "VirtualRunEnv", "CMakeDeps" + generators = "VirtualRunEnv", "CMakeToolchain", "CMakeDeps" test_type = "explicit" def layout(self): @@ -14,11 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - def generate(self): - tc = CMakeToolchain(self) - tc.variables["MPDECIMAL_CXX"] = self.dependencies["mpdecimal"].options.cxx - tc.generate() - def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt b/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt index c23ed5cfe6d98..4c6b75fcc1914 100644 --- a/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt +++ b/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_v1_package) enable_testing() diff --git a/recipes/mpdecimal/2.5.x/test_v1_package/conanfile.py b/recipes/mpdecimal/2.5.x/test_v1_package/conanfile.py index 39414f0a3b89d..9f63e99aff76f 100644 --- a/recipes/mpdecimal/2.5.x/test_v1_package/conanfile.py +++ b/recipes/mpdecimal/2.5.x/test_v1_package/conanfile.py @@ -4,7 +4,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/mpfr/all/conandata.yml b/recipes/mpfr/all/conandata.yml index dd4e8f905e5f9..afd84455cac46 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 03acd9af8c081..77727bc0de638 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 c6b67dbae98b2..0000000000000 --- 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 888d7d12deb82..0000000000000 --- 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 0000000000000..8bd309400c5a6 --- /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 f4253e8466cb9..734c455f60d09 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 c56e8a6249e69..862d248f1946f 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 222d09629eb12..0d20897301b68 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 72132855c0cf8..f3d9d2b90378d 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 5ff9754f83253..a4d19cd12463a 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 f31d795bc0cc2..956244df07486 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 d120a992c06a6..0a6bc68712d90 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 e299736630b60..b21cc49efde95 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 60d10df366776..5ecb23c111e1a 100644 --- a/recipes/mppp/all/conandata.yml +++ b/recipes/mppp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.0.2": + url: "https://github.com/bluescarni/mppp/archive/v1.0.2.tar.gz" + sha256: "2a537bc339726388fdda39905692d3df92fceee51d264e720e0e7ab7570bcdaf" + "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,10 +12,30 @@ sources: url: "https://github.com/bluescarni/mppp/archive/v0.26.tar.gz" sha256: "4dbfa68802d9a1365eda884f085418afc147d01b7a928e8333e4dcc1c3b3ce9e" patches: + "1.0.2": + - 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" + "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" patch_type: "portability" + - patch_file: "patches/0.27-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.26": - patch_file: "patches/0.26-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 4677b62f734c2..9510faa71b6c8 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") + 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.81.0") + self.requires("boost/1.83.0") if self.options.get_safe("with_fmt"): - self.requires("fmt/9.1.0") + self.requires("fmt/10.2.1", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch b/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch new file mode 100644 index 0000000000000..28109b89756fd --- /dev/null +++ b/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 22e275f..1a97423 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -414,9 +414,8 @@ endif() + + # NOTE: need at least version 6.2 + # 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/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 0000000000000..20284714ba410 --- /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 0000000000000..b05a5e6c9a442 --- /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 d4d8ae20a50d8..460a704f2241d 100644 --- a/recipes/mppp/config.yml +++ b/recipes/mppp/config.yml @@ -1,4 +1,8 @@ versions: + "1.0.2": + folder: all + "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 1f2447a4480af..22f61968c9ba8 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/msdf-atlas-gen/all/CMakeLists.txt b/recipes/msdf-atlas-gen/all/CMakeLists.txt deleted file mode 100644 index 39b22c5320bd6..0000000000000 --- a/recipes/msdf-atlas-gen/all/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -find_package(msdfgen REQUIRED) - -add_subdirectory(source_subfolder) - diff --git a/recipes/msdf-atlas-gen/all/conandata.yml b/recipes/msdf-atlas-gen/all/conandata.yml index 20e043a17e6cd..1c3664b5df564 100644 --- a/recipes/msdf-atlas-gen/all/conandata.yml +++ b/recipes/msdf-atlas-gen/all/conandata.yml @@ -2,3 +2,8 @@ sources: "1.2.2": url: "https://github.com/Chlumsky/msdf-atlas-gen/archive/refs/tags/v1.2.2.tar.gz" sha256: "7D2EA46F66E21AB9A205BF7703D520F209B9A035EE13CBB266A3B8322F62FA28" +patches: + "1.2.2": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "Fix CMakeLists.txt to get libraries from Conan and install in bin dir" + patch_type: "conan" diff --git a/recipes/msdf-atlas-gen/all/conanfile.py b/recipes/msdf-atlas-gen/all/conanfile.py index a6c7d8b9a0b2a..51daed7b1f501 100644 --- a/recipes/msdf-atlas-gen/all/conanfile.py +++ b/recipes/msdf-atlas-gen/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.33.0" + +required_conan_version = ">=1.53.0" class MsdfAtlasGenConan(ConanFile): @@ -12,60 +16,54 @@ class MsdfAtlasGenConan(ConanFile): description = "MSDF font atlas generator" topics = ("msdf-atlas-gen", "msdf", "font", "atlas") settings = "os", "arch", "compiler", "build_type" - - generators = "cmake", "cmake_find_package_multi" - exports_sources = ["CMakeLists.txt"] - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "application" def requirements(self): self.requires("artery-font-format/1.0") self.requires("msdfgen/1.9.1") + self.requires("lodepng/cci.20200615") + + def layout(self): + cmake_layout(self, src_folder="src") - def validate(self): + def validate_build(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) 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], - strip_root=True, destination=self._source_subfolder) - - def _patch_sources(self): - cmakelists = os.path.join( - self._source_subfolder, "CMakeLists.txt") + def export_sources(self): + export_conandata_patches(self) - tools.replace_in_file(cmakelists, - "add_subdirectory(msdfgen)", "") - tools.save_append(cmakelists, - "install(TARGETS msdf-atlas-gen-standalone DESTINATION bin)") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["MSDF_ATLAS_GEN_BUILD_STANDALONE"] = True - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MSDF_ATLAS_GEN_BUILD_STANDALONE"] = True + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("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.frameworkdirs = [] self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] - 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: 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/msdf-atlas-gen/all/patches/0001-fix-cmake.patch b/recipes/msdf-atlas-gen/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..356c6a09fe8be --- /dev/null +++ b/recipes/msdf-atlas-gen/all/patches/0001-fix-cmake.patch @@ -0,0 +1,42 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,9 +7,11 @@ + set(MSDFGEN_USE_OPENMP OFF CACHE INTERNAL "Build with OpenMP support for multithreaded code (disabled for atlas gen)" FORCE) + set(MSDFGEN_USE_CPP11 ON CACHE INTERNAL "Build with C++11 enabled (always enabled for atlas gen)" FORCE) + set(MSDFGEN_INSTALL OFF CACHE BOOL "Generate installation target for msdfgen") +-add_subdirectory(msdfgen) + ++ + find_package(Threads REQUIRED) ++find_package(msdfgen REQUIRED) ++find_package(artery-font-format REQUIRED) + + file(GLOB_RECURSE msdf-atlas-gen_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + "msdf-atlas-gen/*.h" +@@ -24,19 +26,12 @@ + add_library(msdf-atlas-gen ${msdf-atlas-gen_SOURCES} ${msdf-atlas-gen_HEADERS}) + add_library(msdf-atlas-gen::msdf-atlas-gen ALIAS msdf-atlas-gen) + set_target_properties(msdf-atlas-gen PROPERTIES PUBLIC_HEADER "${msdf-atlas-gen_HEADERS}") +-target_include_directories(msdf-atlas-gen +-INTERFACE +- $ +-PRIVATE +- ${CMAKE_CURRENT_SOURCE_DIR}/msdfgen/include # for lodepng.h +- ${CMAKE_CURRENT_SOURCE_DIR}/artery-font-format +-) + + if (MSVC) + target_compile_definitions(msdf-atlas-gen PUBLIC _CRT_SECURE_NO_WARNINGS) + endif() + target_compile_features(msdf-atlas-gen PUBLIC cxx_std_11) +-target_link_libraries(msdf-atlas-gen PUBLIC Threads::Threads msdfgen::msdfgen msdfgen::msdfgen-ext) ++target_link_libraries(msdf-atlas-gen PUBLIC Threads::Threads msdfgen::msdfgen msdfgen::msdfgen-ext artery-font-format::artery-font-format) + + # TODO make these public in msdfgen so that this doesn't have to be repeated here + if(FREETYPE_WITH_PNG) +@@ -58,3 +53,5 @@ + target_compile_features(msdf-atlas-gen-standalone PUBLIC cxx_std_11) + target_link_libraries(msdf-atlas-gen-standalone PUBLIC msdf-atlas-gen::msdf-atlas-gen) + endif() ++ ++install(TARGETS msdf-atlas-gen-standalone DESTINATION bin) diff --git a/recipes/msdf-atlas-gen/all/test_package/conanfile.py b/recipes/msdf-atlas-gen/all/test_package/conanfile.py index 0e314c3e127bb..f15dfbbe1bd98 100644 --- a/recipes/msdf-atlas-gen/all/test_package/conanfile.py +++ b/recipes/msdf-atlas-gen/all/test_package/conanfile.py @@ -1,9 +1,16 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run + import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) @property def _atlas_texture_file(self): @@ -14,15 +21,14 @@ def _atlas_desc_file(self): return os.path.join(self.build_folder, "atlas_desc.json") def test(self): - if not tools.cross_building(self): - ttf_path = os.path.join( - self.source_folder, "Sacramento-Regular.ttf") - charset_path = os.path.join( - self.source_folder, "uppercase_charset") + if can_run(self): + ttf_path = os.path.join(self.source_folder, "Sacramento-Regular.ttf") + charset_path = os.path.join(self.source_folder, "uppercase_charset") ret_code = self.run( - "msdf-atlas-gen -font {} -charset {} -imageout {} -json {}".format(ttf_path, charset_path, self._atlas_texture_file, self._atlas_desc_file), run_environment=True) + "msdf-atlas-gen -font {} -charset {} -imageout {} -json {}".format(ttf_path, charset_path, self._atlas_texture_file, self._atlas_desc_file), env="conanrun") assert ret_code == 0 assert os.path.isfile(self._atlas_texture_file) assert os.path.isfile(self._atlas_desc_file) + diff --git a/recipes/msgpack-c/all/conandata.yml b/recipes/msgpack-c/all/conandata.yml index dc158b2bf02e6..0062926e73ac9 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 c43afaf0f726a..08e152a5c47d0 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 64a5e6f43e3e6..6af577efebddf 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 2bcaa82b381e6..8d22fa5798373 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 ed380c765040e..d8ac6bce3d809 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 1c632d41b23dd..934a0432a27c7 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 01aa597548f23..1485bf6ada2af 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/all/test_package/conanfile.py b/recipes/msys2/all/test_package/conanfile.py index fa7d81b8ee739..e9550182abfe7 100644 --- a/recipes/msys2/all/test_package/conanfile.py +++ b/recipes/msys2/all/test_package/conanfile.py @@ -31,5 +31,4 @@ def test(self): output = StringIO() self.run('bash.exe -c "echo $PKG_CONFIG_PATH"', output) - print(output.getvalue()) assert self._secret_value in output.getvalue() diff --git a/recipes/msys2/all/test_v1_package/conanfile.py b/recipes/msys2/all/test_v1_package/conanfile.py index 9278b74eeb27b..97f1e665d30ac 100644 --- a/recipes/msys2/all/test_v1_package/conanfile.py +++ b/recipes/msys2/all/test_v1_package/conanfile.py @@ -25,5 +25,4 @@ def test(self): with tools.environment_append({"PKG_CONFIG_PATH": secret_value}): output = StringIO() self.run('bash.exe -c "echo $PKG_CONFIG_PATH"', output=output) - print(output.getvalue()) assert secret_value in output.getvalue() diff --git a/recipes/msys2/config.yml b/recipes/msys2/config.yml index 608a5b0c8a900..807ada4348c72 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 0000000000000..62fe05ee3b518 --- /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 0000000000000..530c1ccfb8d10 --- /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 0000000000000..bfa4f8ba62c05 --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..8cce2788bfac4 --- /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 0000000000000..42b92d9f27e7f --- /dev/null +++ b/recipes/mtdev/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.6": + folder: all diff --git a/recipes/mujs/all/conandata.yml b/recipes/mujs/all/conandata.yml index 8b8c95eb04cf4..3a69126dc4af3 100644 --- a/recipes/mujs/all/conandata.yml +++ b/recipes/mujs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.4": + url: "https://mujs.com/downloads/mujs-1.3.4.tar.gz" + sha256: "c015475880f6a382e706169c94371a7dd6cc22078832f6e0865af8289c2ef42b" "1.1.2": url: "https://mujs.com/downloads/mujs-1.1.2.tar.xz" sha256: "719e882bb7d98640efa163381e9b68ef1ce35c87a422e2aa4190c9e40225875d" diff --git a/recipes/mujs/config.yml b/recipes/mujs/config.yml index 8d13aefb6b4fb..f0766a7d62e0c 100644 --- a/recipes/mujs/config.yml +++ b/recipes/mujs/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.4": + folder: all "1.1.2": folder: all diff --git a/recipes/namedtype/all/conanfile.py b/recipes/namedtype/all/conanfile.py index ff8826be0c227..14c646bee4f47 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 a56821d0dc1a6..c88bbff306fb5 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 67a58bc871cff..7697075d83fd1 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/CMakeLists.txt b/recipes/nanodbc/all/CMakeLists.txt deleted file mode 100644 index 6ba47d078b389..0000000000000 --- a/recipes/nanodbc/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/nanodbc/all/conandata.yml b/recipes/nanodbc/all/conandata.yml index 60ad84e0835de..c6835a8c270b4 100644 --- a/recipes/nanodbc/all/conandata.yml +++ b/recipes/nanodbc/all/conandata.yml @@ -1,26 +1,25 @@ 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" - base_path: "source_subfolder" + patch_description: "Allow compilation on CI with ODBC library" + patch_type: "portability" - patch_file: "patches/0002-allow-windows-shared.patch" - base_path: "source_subfolder" + patch_description: "Allow windows to compile shared libraries" + patch_type: "portability" "2.13.0": - patch_file: "patches/0001-odbc-from-cci.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-allow-windows-shared.patch" - base_path: "source_subfolder" - "2.14.0": - - patch_file: "patches/0001-odbc-from-cci.patch" - base_path: "source_subfolder" + patch_description: "Allow compilation on CI with ODBC library" + patch_type: "portability" - patch_file: "patches/0002-allow-windows-shared.patch" - base_path: "source_subfolder" + 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" + patch_type: "portability" diff --git a/recipes/nanodbc/all/conanfile.py b/recipes/nanodbc/all/conanfile.py index 44cbf934e3a4d..c0ece80748978 100644 --- a/recipes/nanodbc/all/conanfile.py +++ b/recipes/nanodbc/all/conanfile.py @@ -1,18 +1,23 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import glob +from conan import ConanFile +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 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/" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" - exports_sources = "CMakeLists.txt", "patches/**" options = { "shared": [True, False], "fPIC": [True, False], @@ -27,78 +32,99 @@ class NanodbcConan(ConanFile): "unicode": False, "with_boost": False, } - generators = "cmake", "cmake_find_package" - - _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": del self.options.fPIC - _compiler_cxx14 = { - "gcc": 5, - "clang": "3.4", - "Visual Studio": 14, - "apple-clang": "9.1", # FIXME: wild guess - } - def configure(self): if self.options.shared: - del self.options.fPIC - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 14) - _minimum_compiler = self._compiler_cxx14.get(str(self.settings.compiler)) - if _minimum_compiler: - if tools.Version(self.settings.compiler.version) < _minimum_compiler: - raise ConanInvalidConfiguration("nanodbc requires c++14, which your compiler does not support") - else: - self.output.warn("nanodbc requires c++14, but is unknown to this recipe. Assuming your compiler supports c++14.") + 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 { + "gcc": "5", + "clang": "3.4", + "Visual Studio": "14", + "msvc": "190", + "apple-clang": "9.1", # FIXME: this is a guess + } def requirements(self): if self.options.with_boost: - self.requires("boost/1.76.0") + self.requires("boost/1.83.0") if self.settings.os != "Windows": - self.requires("odbc/2.3.9") + self.requires("odbc/2.3.11") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 14) + + 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.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 source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(glob.glob("nanodbc-*")[0], self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["NANODBC_DISABLE_ASYNC"] = not self.options.get_safe("async") - self._cmake.definitions["NANODBC_ENABLE_UNICODE"] = self.options.unicode - self._cmake.definitions["NANODBC_ENABLE_BOOST"] = self.options.with_boost - self._cmake.definitions["NANODBC_DISABLE_LIBCXX"] = self.settings.get_safe("compiler.libcxx") != "libc++" - - self._cmake.definitions["NANODBC_DISABLE_INSTALL"] = False - self._cmake.definitions["NANODBC_DISABLE_EXAMPLES"] = True - self._cmake.definitions["NANODBC_DISABLE_TESTS"] = True - 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["NANODBC_DISABLE_ASYNC"] = not self.options.get_safe("async") + tc.cache_variables["NANODBC_ENABLE_UNICODE"] = self.options.unicode + tc.cache_variables["NANODBC_ENABLE_BOOST"] = self.options.with_boost + tc.cache_variables["NANODBC_DISABLE_LIBCXX"] = self.settings.get_safe("compiler.libcxx") != "libc++" + tc.cache_variables["NANODBC_DISABLE_INSTALL"] = False + tc.cache_variables["NANODBC_DISABLE_EXAMPLES"] = True + tc.cache_variables["NANODBC_DISABLE_TESTS"] = True + tc.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + 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): - 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() + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "cmake")) - 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, "cmake")) + 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: - if self.settings.os == "Windows": - self.cpp_info.system_libs = ["odbc32"] + + if not self.options.shared and self.settings.os == "Windows": + self.cpp_info.system_libs = ["odbc32"] diff --git a/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch b/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch index f5a355e45690b..5ab0d54e37333 100644 --- a/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch +++ b/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch @@ -9,18 +9,19 @@ # Try to find unixODBC first via odbc_config program. find_program(ODBC_CONFIG odbc_config PATHS $ENV{ODBC_PATH}/bin /usr/bin /usr/local/bin) -@@ -171,8 +171,8 @@ +@@ -171,8 +171,9 @@ ## find ODBC libraries to link ######################################## if(UNIX) - set(ODBC_LIBRARIES ${ODBCLIB}) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ODBC_LINK_FLAGS}") -+ set(ODBC_LIBRARIES CONAN_PKG::odbc) ++ find_package(ODBC REQUIRED CONFIG) ++ set(ODBC_LIBRARIES ODBC::ODBC) + #set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ODBC_LINK_FLAGS}") elseif(MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") set(ODBC_LIBRARIES odbc32.lib odbccp32.lib Ws2_32.lib) elseif(MINGW) -@@ -188,7 +188,7 @@ +@@ -188,7 +189,7 @@ find_package(Boost COMPONENTS locale REQUIRED) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) diff --git a/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch b/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch index 5ab2c375b7053..5c996393bca3b 100644 --- a/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch +++ b/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -215,9 +215,9 @@ else() +@@ -216,9 +216,9 @@ else() message(STATUS "nanodbc build: Enable nanodbc target - STATIC") endif() diff --git a/recipes/nanodbc/all/patches/0003-add-missing-include.patch b/recipes/nanodbc/all/patches/0003-add-missing-include.patch new file mode 100644 index 0000000000000..6c70a6f9a9d0b --- /dev/null +++ b/recipes/nanodbc/all/patches/0003-add-missing-include.patch @@ -0,0 +1,10 @@ +--- a/nanodbc/nanodbc.cpp ++++ b/nanodbc/nanodbc.cpp +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/recipes/nanodbc/all/test_package/CMakeLists.txt b/recipes/nanodbc/all/test_package/CMakeLists.txt index f6bbde9919354..0f37b02603638 100644 --- a/recipes/nanodbc/all/test_package/CMakeLists.txt +++ b/recipes/nanodbc/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) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_package(nanodbc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE nanodbc::nanodbc) +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 bd7165a553cf4..9153dc938c484 100644 --- a/recipes/nanodbc/all/test_package/conanfile.py +++ b/recipes/nanodbc/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -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" + 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 +20,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/nanodbc/config.yml b/recipes/nanodbc/config.yml index 35d045402c05f..ccdd596aaff35 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 c3fd08f9f02f0..f8c576a4749fe 100644 --- a/recipes/nanoflann/all/conandata.yml +++ b/recipes/nanoflann/all/conandata.yml @@ -1,4 +1,10 @@ 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" "1.4.3": url: "https://github.com/jlblancoc/nanoflann/archive/v1.4.3.tar.gz" sha256: "cbcecf22bec528a8673a113ee9b0e134f91f1f96be57e913fa1f74e98e4449fa" diff --git a/recipes/nanoflann/all/conanfile.py b/recipes/nanoflann/all/conanfile.py index 5e499d9aae48d..47bfe18256ddd 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 d120a992c06a6..0a6bc68712d90 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 abdc53043545d..42431fc83ed1e 100644 --- a/recipes/nanoflann/config.yml +++ b/recipes/nanoflann/config.yml @@ -1,4 +1,8 @@ versions: + "1.5.2": + folder: "all" + "1.5.0": + folder: "all" "1.4.3": folder: "all" "1.4.2": diff --git a/recipes/nanomsg/all/conandata.yml b/recipes/nanomsg/all/conandata.yml new file mode 100644 index 0000000000000..1d7161c198806 --- /dev/null +++ b/recipes/nanomsg/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2": + url: "https://github.com/nanomsg/nanomsg/archive/refs/tags/1.2.tar.gz" + sha256: "6ef7282e833df6a364f3617692ef21e59d5c4878acea4f2d7d36e21c8858de67" diff --git a/recipes/nanomsg/all/conanfile.py b/recipes/nanomsg/all/conanfile.py new file mode 100644 index 0000000000000..851ab78f2038e --- /dev/null +++ b/recipes/nanomsg/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rm, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +import os + + +required_conan_version = ">=1.53.0" + +class NanomsgConan(ConanFile): + name = "nanomsg" + description = "A socket library that provides several common communication patterns." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nanomsg/nanomsg" + topics = ("socket", "protocols", "communication") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_coverage": [True, False], + "enable_getaddrinfo_a":[True, False], + "enable_tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_coverage": False, + "enable_getaddrinfo_a":True, + "enable_tools": 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.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["NN_STATIC_LIB"] = not self.options.shared + tc.variables["NN_ENABLE_COVERAGE"] = self.options.enable_coverage + tc.variables["NN_ENABLE_GETADDRINFO_A"] = self.options.enable_getaddrinfo_a + tc.variables["NN_ENABLE_DOC"] = False + tc.variables["NN_TESTS"] = False + tc.variables["NN_TOOLS"] = self.options.enable_tools + tc.generate() + tc = CMakeDeps(self) + 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, "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 = ["nanomsg"] + self.cpp_info.set_property("cmake_file_name", "nanomsg") + self.cpp_info.set_property("cmake_target_name", "nanomsg::nanomsg") + self.cpp_info.set_property("pkg_config_name", "nanomsg") + + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.system_libs.extend(["mswsock", "ws2_32", "advapi32"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("anl") + self.cpp_info.system_libs.append("rt") + self.cpp_info.system_libs.append("nsl") + + if not self.options.shared: + self.cpp_info.defines.append("NN_STATIC_LIB") + if self.options.enable_coverage: + self.cpp_info.defines.append("NN_ENABLE_COVERAGE") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "nanomsg" + self.cpp_info.names["cmake_find_package_multi"] = "nanomsg" diff --git a/recipes/nanomsg/all/test_package/CMakeLists.txt b/recipes/nanomsg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5ea217a77048d --- /dev/null +++ b/recipes/nanomsg/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(nanomsg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nanomsg::nanomsg) diff --git a/recipes/nanomsg/all/test_package/conanfile.py b/recipes/nanomsg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f5cf204295e19 --- /dev/null +++ b/recipes/nanomsg/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/nanomsg/all/test_package/test_package.cpp b/recipes/nanomsg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..38d120fc8ced4 --- /dev/null +++ b/recipes/nanomsg/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include +#include "nanomsg/nn.h" + + +int main(void) { + void *msg = nn_allocmsg(32, 0); + nn_freemsg(msg); + + return EXIT_SUCCESS; +} diff --git a/recipes/nanomsg/config.yml b/recipes/nanomsg/config.yml new file mode 100644 index 0000000000000..a0777b5aa931c --- /dev/null +++ b/recipes/nanomsg/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2": + folder: all diff --git a/recipes/nanort/all/conandata.yml b/recipes/nanort/all/conandata.yml new file mode 100644 index 0000000000000..8dcd77657a999 --- /dev/null +++ b/recipes/nanort/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230207": + url: "https://github.com/lighttransport/nanort/archive/0bb8ab5284ee8ab7e75705aaedeaea7d7e63e1fe.zip" + sha256: "08b22d1a8bd3ec2667a71cb71281c08d37d72a81baa0c3272e01db24ef191db5" diff --git a/recipes/nanort/all/conanfile.py b/recipes/nanort/all/conanfile.py new file mode 100644 index 0000000000000..934e494b287de --- /dev/null +++ b/recipes/nanort/all/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd + + +import os + + +class NanoRTConan(ConanFile): + name = "nanort" + description = "Single header only modern ray tracing kernel" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lighttransport/nanort" + topics = ("graphics", "raytracing", "header-only") + license = "MIT" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "nanort.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/nanort/all/test_package/CMakeLists.txt b/recipes/nanort/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..358520baebdbd --- /dev/null +++ b/recipes/nanort/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(nanort REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nanort::nanort) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + diff --git a/recipes/nanort/all/test_package/conanfile.py b/recipes/nanort/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f5cf204295e19 --- /dev/null +++ b/recipes/nanort/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/nanort/all/test_package/test_package.cpp b/recipes/nanort/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..76b9d8b357488 --- /dev/null +++ b/recipes/nanort/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include +#include + +#include "nanort.h" + + +int main(void) { + const std::array vertices = {0.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f}; + const std::array faces = {0, 1, 2}; + + nanort::TriangleMesh triangle_mesh(vertices.data(), faces.data(), sizeof(float) * 3); + nanort::TriangleSAHPred triangle_pred(vertices.data(), faces.data(), sizeof(float) * 3); + + nanort::BVHAccel accel; + const auto ret = accel.Build(1, triangle_mesh, triangle_pred); + + if (!ret) { + std::cerr << "Failed to build BVH" << std::endl; + return EXIT_FAILURE; + } + + std::cout << "Successfully built simple BVH with nanort" << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/nanort/config.yml b/recipes/nanort/config.yml new file mode 100644 index 0000000000000..42394be2d8324 --- /dev/null +++ b/recipes/nanort/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230207": + folder: all diff --git a/recipes/nanosvg/all/conandata.yml b/recipes/nanosvg/all/conandata.yml index 8191482a0d600..2efbe78b92b51 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 907d8771861b8..5e4dbdbbe3aa8 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 621a8ff8e6daf..959fb3ca5317a 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 4cfe8bfdf0bc4..376415f6ab6cf 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 a6ece9857a5b2..5a3dcf12eeb77 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 25d5fec8b82ba..f570e673ace4d 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 0000000000000..c890b5d0ddfab --- /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 3adc44c41e54c..0e692c25e7249 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 6742c96b11c21..98c789fb359ec 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 430a3b6ec8e18..d78cda6c6388d 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 53652835d3593..4c81f48ec928f 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 4b4849803c256..6915cbdbd4166 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 49a3a66ea5bad..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 5e71e1ec032be..44608e3405cb8 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/conandata.yml b/recipes/nettle/all/conandata.yml index 8e0d6c4f8c0c7..8d2046aa39c9c 100644 --- a/recipes/nettle/all/conandata.yml +++ b/recipes/nettle/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.9.1": + url: "https://ftp.gnu.org/gnu/nettle/nettle-3.9.1.tar.gz" + sha256: "ccfeff981b0ca71bbd6fbcb054f407c60ffb644389a5be80d6716d5b550c6ce3" "3.8.1": url: "https://ftp.gnu.org/gnu/nettle/nettle-3.8.1.tar.gz" sha256: "364f3e2b77cd7dcde83fd7c45219c834e54b0c75e428b6f894a23d12dd41cbfe" diff --git a/recipes/nettle/all/conanfile.py b/recipes/nettle/all/conanfile.py index e09965067d8d4..e24910f2f61b5 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/nettle/config.yml b/recipes/nettle/config.yml index e749bd36291ee..f812356867a67 100644 --- a/recipes/nettle/config.yml +++ b/recipes/nettle/config.yml @@ -1,4 +1,6 @@ versions: + "3.9.1": + folder: "all" "3.8.1": folder: "all" "3.6": diff --git a/recipes/newmat/all/CMakeLists.txt b/recipes/newmat/all/CMakeLists.txt new file mode 100644 index 0000000000000..768502b8f6a7f --- /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 0000000000000..e5211d2f68295 --- /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 0000000000000..e73dffca97d70 --- /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 0000000000000..2cbfaaa6c4648 --- /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 0000000000000..b7da1c805dfbd --- /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 0000000000000..0a6bc68712d90 --- /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 0000000000000..bd314f10d88fc --- /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 0000000000000..d7fc56a2cf1b3 --- /dev/null +++ b/recipes/newmat/config.yml @@ -0,0 +1,3 @@ +versions: + "11.0.1": + folder: all diff --git a/recipes/nextsilicon-cpp-subprocess/all/conanfile.py b/recipes/nextsilicon-cpp-subprocess/all/conanfile.py index cc556b383afc6..01f1e1a74c95e 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/conanfile.py +++ b/recipes/nextsilicon-cpp-subprocess/all/conanfile.py @@ -1,27 +1,54 @@ -from conans import ConanFile, tools +import os + +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 CppSubprocess(ConanFile): name = "nextsilicon-cpp-subprocess" + description = ( + "Subprocessing with modern C++. " + "The only goal was to develop something that is as close as possible" + " to the Python subprocess module in dealing with processes." + ) license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nextsilicon/cpp-subprocess" - topics = ("subprocess", "os", "fork") - description = ("Subprocessing with modern C++, " - "The only goal was to develop something that is as close as" - "python subprocess module in dealing with processes.") - no_copy_source = True + topics = ("subprocess", "os", "fork", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True - _source_subfolder = 'cpp-subprocess' + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + @property + def _min_cppstd(self): + return 11 + + 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], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("subprocess.hpp", dst="include/cpp-subprocess", src=self._source_subfolder) - self.copy("LICENSE.MIT", dst="licenses", src=self._source_subfolder) + copy(self, "subprocess.hpp", + dst=os.path.join(self.package_folder, "include/cpp-subprocess"), + src=self.source_folder) + copy(self, "LICENSE.MIT", + 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/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt b/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt index c61a7aada95ff..ccc5e64288292 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt +++ b/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt @@ -1,14 +1,12 @@ -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() - set(CMAKE_CXX_STANDARD 11) -set(CMAKE_BUILD_TYPE Debug) set(THREADS_PREFER_PTHREAD_FLAG ON) + +find_package(nextsilicon-cpp-subprocess REQUIRED CONFIG) find_package(Threads REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} Threads::Threads) +target_link_libraries(${PROJECT_NAME} PRIVATE nextsilicon-cpp-subprocess::nextsilicon-cpp-subprocess Threads::Threads) diff --git a/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py b/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py index fc4fe1905b49a..ef5d7042163ec 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py +++ b/recipes/nextsilicon-cpp-subprocess/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/nfrechette-acl/all/conandata.yml b/recipes/nfrechette-acl/all/conandata.yml index 0c2e8a5978fd0..191bbde1ad6d6 100644 --- a/recipes/nfrechette-acl/all/conandata.yml +++ b/recipes/nfrechette-acl/all/conandata.yml @@ -2,21 +2,12 @@ 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" "2.0.6": url: "https://github.com/nfrechette/acl/archive/v2.0.6.tar.gz" sha256: "595575d3470eb3a4a572f7c5cb986ea2205ea1271ca3b32b864c569659106311" + "2.1.0": + url: "https://github.com/nfrechette/acl/archive/v2.1.0.tar.gz" + sha256: "0ac8473cd30eb768bae1ef58558e3088242d6fef81f727ce7b5ff5af9be74fce" diff --git a/recipes/nfrechette-acl/all/conanfile.py b/recipes/nfrechette-acl/all/conanfile.py index 23d68bbd569f4..9486ab8fa1d5e 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.2.0") + + 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 33ae887aa6aea..da2314ef0ec2b 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 efea435279716..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..49ba777923b40 --- /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 cf68d13e1c698..1a65a1cc6cec7 100644 --- a/recipes/nfrechette-acl/config.yml +++ b/recipes/nfrechette-acl/config.yml @@ -1,15 +1,9 @@ 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": folder: "all" + "2.1.0": + folder: "all" diff --git a/recipes/nghttp3/all/conandata.yml b/recipes/nghttp3/all/conandata.yml new file mode 100644 index 0000000000000..3d19ff221c51b --- /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 0000000000000..618ddcb3adf32 --- /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 0000000000000..c52d61a995b33 --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..f093072babb72 --- /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 0000000000000..f581e0802958e --- /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 6d20bef200f0e..971d0191590f9 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" @@ -38,6 +41,9 @@ sources: "3.7.0": sha256: D51A3A8D3EFBB1139D7608E28782EA9EFEA7E7933157E8FF8184901EFD8EE760 url: https://github.com/nlohmann/json/archive/v3.7.0.tar.gz + "3.5.0": + sha256: E0B1FC6CC6CA05706CCE99118A87ACA5248BD9DB3113E703023D23F044995C1D + url: https://github.com/nlohmann/json/archive/v3.5.0.tar.gz "3.4.0": sha256: C377963A95989270C943D522BFEFE7B889EF5ED0E1E15D535FD6F6F16ED70732 url: https://github.com/nlohmann/json/archive/v3.4.0.tar.gz diff --git a/recipes/nlohmann_json/all/conanfile.py b/recipes/nlohmann_json/all/conanfile.py index 83bc77059e036..98eaf15380fff 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 f26a7154dd392..ad526c439b84b 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": @@ -25,6 +27,8 @@ versions: folder: all "3.7.0": folder: all + "3.5.0": + folder: all "3.4.0": folder: all "3.2.0": diff --git a/recipes/nmea/all/CMakeLists.txt b/recipes/nmea/all/CMakeLists.txt new file mode 100644 index 0000000000000..75b13231e08ae --- /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 0000000000000..11255f314caf5 --- /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 0000000000000..17706f598b456 --- /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 0000000000000..0fc5503253f05 --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..2c83a9e9a35fb --- /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 0000000000000..2a0554e18df80 --- /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 be9549d77d691..67cbae93e0a0b 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 dbb752cd0c9a2..14f7348224835 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 56040987cfeb9..38ff2077350ec 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 bc0089a6ae374..2df20034f628d 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 c8e560d40aa56..0000000000000 --- 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 bc747087c62bd..a76e6327ac2f8 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 637febf0d43bb..339645c679763 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 7b52b10445744..a7336347af2da 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 abcaeed3f89b6..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..abcaeed3f89b6 --- /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 7f6a9a4f236ee..84d072aa8848a 100644 --- a/recipes/nng/all/conandata.yml +++ b/recipes/nng/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.7.1": + url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.7.1.tar.gz" + sha256: "b62b2170d2b4757f9f01fb65e5aa9f078dec726735e9de5ed5d7e332cbbbf2ef" + "1.7.0": + url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.7.0.tar.gz" + sha256: "668325161637a0debcf7fb4340919b81e74b66d38bc7a663e8b55b7e0abd7f57" + "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 +26,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 38c580aa2cc03..418a70d42be1f 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,9 @@ class NngConan(ConanFile): "nngcat": [True, False], "http": [True, False], "tls": [True, False], - "max_taskq_threads": ["ANY"] + "max_taskq_threads": ["ANY"], + "max_expire_threads": ["ANY"], + "max_poller_threads": ["ANY"], } default_options = { "shared": False, @@ -31,7 +33,9 @@ class NngConan(ConanFile): "nngcat": False, "http": True, "tls": False, - "max_taskq_threads": "16" + "max_taskq_threads": "16", + "max_expire_threads": "8", + "max_poller_threads": "8", } def export_sources(self): @@ -40,6 +44,10 @@ 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 + if Version(self.version) < "1.7.0": + del self.options.max_poller_threads def configure(self): if self.options.shared: @@ -55,7 +63,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.1") def validate(self): compiler_minimum_version = { @@ -69,6 +77,10 @@ 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") + if "max_poller_threads" in self.options and not self.options.max_poller_threads.value.isdigit(): + raise ConanInvalidConfiguration("max_poller_threads must be an integral number") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -80,6 +92,10 @@ 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 + if "max_poller_threads" in self.options: + tc.variables["NNG_MAX_POLLER_THREADS"] = self.options.max_poller_threads tc.generate() def build(self): @@ -102,7 +118,7 @@ def package_info(self): if self.settings.os == "Windows" and not self.options.shared: self.cpp_info.system_libs.extend(["mswsock", "ws2_32"]) elif self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.extend(["pthread"]) + self.cpp_info.system_libs.extend(["pthread", "rt", "nsl"]) if self.options.shared: self.cpp_info.defines.append("NNG_SHARED_LIB") diff --git a/recipes/nng/all/test_package/CMakeLists.txt b/recipes/nng/all/test_package/CMakeLists.txt index 6c83380e0106e..7a60c8282db34 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 ba169426f19de..3e8e4d6c71efa 100644 --- a/recipes/nng/config.yml +++ b/recipes/nng/config.yml @@ -1,4 +1,10 @@ versions: + "1.7.1": + folder: all + "1.7.0": + folder: all + "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 0681cc81e538a..56a1be535ef41 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 d08325293889a..c098d4eea4705 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 e973a099243f7..78cc638a90e4d 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 881b1cb39250b..0000000000000 --- 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 bf507c033f50b..633f6755af50c 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 19ef9ea3f1923..86e6f75fa6616 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 027a67d403fb1..881aec891e1d0 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 49a3a66ea5bad..8a5bb47f50c4c 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 0a0ac61c170c3..06df6975769c2 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.12.3") # 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 88fb844b5824b..3f5bd28111ec1 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 c986d294c7547..0000000000000 --- 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 517dd7d55ea04..714275e3c3205 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 aac673c26f6fe..6f3111e50d3ef 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 0937dd58a343b..22e1a75b926d7 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 0000000000000..ed8a6b4ca24f6 --- /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 0000000000000..0937dd58a343b --- /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 b0ce8c9099e1b..fe56b4bbdf4f7 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 e8bb34d55a637..898448a11de58 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 ab912e4e61df1..d6a48b7c16ccf 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 0000000000000..91630d79f4abb --- /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 0000000000000..9f6cd40d88fed --- /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 1d61f4b23cee2..f10905ebbaa04 100644 --- a/recipes/nss/all/conandata.yml +++ b/recipes/nss/all/conandata.yml @@ -1,4 +1,13 @@ 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" "3.89": url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_89_RTM/src/nss-3.89.tar.gz" sha256: "55c37a3f4da010d0574fb8b39264cb1e7b4ce9e6c2954c1c7ecf9f41ee00bed5" diff --git a/recipes/nss/config.yml b/recipes/nss/config.yml index 4e88bb8ad9d3b..82fff1e6a41ec 100644 --- a/recipes/nss/config.yml +++ b/recipes/nss/config.yml @@ -1,4 +1,10 @@ versions: + "3.93": + folder: all + "3.92": + folder: all + "3.91": + folder: all "3.89": folder: all "3.88.1": diff --git a/recipes/nsync/all/conandata.yml b/recipes/nsync/all/conandata.yml index fe01573d5a239..b694103d49b84 100644 --- a/recipes/nsync/all/conandata.yml +++ b/recipes/nsync/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.26.0": + url: "https://github.com/google/nsync/archive/1.26.0.tar.gz" + sha256: "80fc1e605bb3cf5f272811ece39c4fb6761ffcb9b30563301845cc9ff381eb8b" "1.25.0": url: "https://github.com/google/nsync/archive/1.25.0.tar.gz" sha256: "2be9dbfcce417c7abcc2aa6fee351cd4d292518d692577e74a2c6c05b049e442" @@ -9,6 +12,8 @@ sources: sha256: "b7e75b17957c62bd02dd73890bde22da3a564903fcaad651b395453d41d3325b" url: "https://github.com/google/nsync/archive/refs/tags/1.23.0.tar.gz" patches: + "1.26.0": + - patch_file: "patches/0001-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" "1.25.0": - patch_file: "patches/0001-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" "1.24.0": diff --git a/recipes/nsync/config.yml b/recipes/nsync/config.yml index 14ad5b4688ed8..960f98574a708 100644 --- a/recipes/nsync/config.yml +++ b/recipes/nsync/config.yml @@ -1,4 +1,6 @@ versions: + "1.26.0": + folder: "all" "1.25.0": folder: "all" "1.24.0": diff --git a/recipes/nudb/all/conanfile.py b/recipes/nudb/all/conanfile.py index 4613f1e67604a..bd9db41da603f 100644 --- a/recipes/nudb/all/conanfile.py +++ b/recipes/nudb/all/conanfile.py @@ -1,42 +1,66 @@ -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 NudbConan(ConanFile): name = "nudb" - license = "BSL-1.0" description = "A fast key/value insert-only database for SSD drives in C++11" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/CPPAlliance/NuDB" - url = "https://github.com/conan-io/conan-center-index/" topics = ("header-only", "KVS", "insert-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 requirements(self): - self.requires("boost/1.78.0") + self.requires("boost/1.83.0") + + 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], - 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) - self.copy("*.hpp", "include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*.ipp", "include", src=os.path.join(self._source_subfolder, "include")) - - 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"), + src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "NuDB" - self.cpp_info.names["cmake_find_package_multi"] = "NuDB" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_target_name", "NuDB") + self.cpp_info.set_property("cmake_target_aliases", ["NuDB::nudb"]) + self.cpp_info.set_property("cmake_find_module", "both") + + self.cpp_info.components["core"].set_property("cmake_target_name", "nudb") self.cpp_info.components["core"].names["cmake_find_package"] = "nudb" self.cpp_info.components["core"].names["cmake_find_package_multi"] = "nudb" self.cpp_info.components["core"].requires = ["boost::thread", "boost::system"] - self.cpp_info.set_property("cmake_target_name", "NuDB") - self.cpp_info.set_property("cmake_target_module_name", "NuDB::nudb") - self.cpp_info.set_property("cmake_find_module", "both") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "NuDB" + self.cpp_info.names["cmake_find_package_multi"] = "NuDB" diff --git a/recipes/nudb/all/test_package/CMakeLists.txt b/recipes/nudb/all/test_package/CMakeLists.txt index 8aef4010c6c96..ba8bae2a7d0d2 100644 --- a/recipes/nudb/all/test_package/CMakeLists.txt +++ b/recipes/nudb/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(NuDB CONFIG REQUIRED) +find_package(NuDB REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} NuDB::nudb) diff --git a/recipes/nudb/all/test_package/conanfile.py b/recipes/nudb/all/test_package/conanfile.py index 573376a19a476..fae501d0afb9e 100644 --- a/recipes/nudb/all/test_package/conanfile.py +++ b/recipes/nudb/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 NudbTestConan(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" + 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/nudb/all/test_v1_package/CMakeLists.txt b/recipes/nudb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/nudb/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/nudb/all/test_v1_package/conanfile.py b/recipes/nudb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..573376a19a476 --- /dev/null +++ b/recipes/nudb/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class NudbTestConan(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/nuklear/all/conandata.yml b/recipes/nuklear/all/conandata.yml index 2bff2ae899a2a..d11d172a2e7ff 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 6e91081b7e51f..b3be73bced4e2 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 d120a992c06a6..0a6bc68712d90 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 9898e4868ff3c..b21cc49efde95 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 7f21ae0ba7418..96278eaa477be 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 bc5d4611e644e..bc13c5f8f97d8 100644 --- a/recipes/numcpp/all/conandata.yml +++ b/recipes/numcpp/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "2.10.1": + url: "https://github.com/dpilger26/NumCpp/archive/Version_2.10.1.tar.gz" + sha256: "847382a780bea2a9b804c1835dcc5f9addabd0d1e3eb9c8339cde9422a5008d6" "2.9.0": url: "https://github.com/dpilger26/NumCpp/archive/Version_2.9.0.tar.gz" sha256: "1c15e23beb4f3d4933d7a6e8d5eb0259e825685973c8f0219485d3f606e5378a" diff --git a/recipes/numcpp/all/conanfile.py b/recipes/numcpp/all/conanfile.py index 16ba0517e3916..d8dc35d2e0548 100644 --- a/recipes/numcpp/all/conanfile.py +++ b/recipes/numcpp/all/conanfile.py @@ -12,11 +12,11 @@ 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 = { "with_boost" : [True, False], @@ -26,8 +26,8 @@ class NumCppConan(ConanFile): "with_boost" : True, "threads" : False, } - no_copy_source = True + short_paths = True @property def _min_cppstd(self): @@ -61,7 +61,7 @@ def layout(self): def requirements(self): if self.options.get_safe("with_boost", True): - self.requires("boost/1.80.0", transitive_headers=True) + self.requires("boost/1.83.0", transitive_headers=True) def package_id(self): self.info.clear() @@ -75,6 +75,21 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) + # since 2.10.0, numcpp requires filesystem + if Version(self.version) >= "2.10.0" and \ + self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "12" and \ + self.settings.compiler.libcxx == "libstdc++11": + raise ConanInvalidConfiguration( + 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) @@ -101,6 +116,12 @@ def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + if Version(self.version) >= "2.10.0": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": + self.cpp_info.system_libs.append("stdc++fs") + if self.settings.compiler == "clang" and Version(self.settings.compiler.version).major == "7": + self.cpp_info.system_libs.append("c++fs") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "NumCpp" self.cpp_info.names["cmake_find_package_multi"] = "NumCpp" diff --git a/recipes/numcpp/config.yml b/recipes/numcpp/config.yml index 8bc128c7f1485..a222baacafc0a 100644 --- a/recipes/numcpp/config.yml +++ b/recipes/numcpp/config.yml @@ -1,4 +1,12 @@ versions: + "2.12.1": + folder: "all" + "2.12.0": + folder: "all" + "2.11.0": + folder: "all" + "2.10.1": + folder: "all" "2.9.0": folder: "all" "2.8.0": diff --git a/recipes/nv-codec-headers/all/conandata.yml b/recipes/nv-codec-headers/all/conandata.yml index 708ee808ccc1d..482c89e58c766 100644 --- a/recipes/nv-codec-headers/all/conandata.yml +++ b/recipes/nv-codec-headers/all/conandata.yml @@ -1,7 +1,13 @@ sources: + "12.1.14.0": + url: "https://github.com/FFmpeg/nv-codec-headers/archive/n12.1.14.0.tar.gz" + sha256: "2fefaa227d2a3b4170797796425a59d1dd2ed5fd231db9b4244468ba327acd0b" + "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" "9.1.23.2": - url: https://github.com/FFmpeg/nv-codec-headers/releases/download/n9.1.23.2/nv-codec-headers-9.1.23.2.tar.gz - sha256: 34c9d1aedf32dc4b9fb22e94dbb041de666b568ceb4bdb317e414b752a3f9a9a + url: "https://github.com/FFmpeg/nv-codec-headers/releases/download/n9.1.23.2/nv-codec-headers-9.1.23.2.tar.gz" + sha256: "34c9d1aedf32dc4b9fb22e94dbb041de666b568ceb4bdb317e414b752a3f9a9a" diff --git a/recipes/nv-codec-headers/all/conanfile.py b/recipes/nv-codec-headers/all/conanfile.py index b7d41a1b54635..f21dc25aa7ca9 100644 --- a/recipes/nv-codec-headers/all/conanfile.py +++ b/recipes/nv-codec-headers/all/conanfile.py @@ -1,60 +1,67 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools import os -required_conan_version = ">=1.35.0" +from conan import ConanFile +from conan.tools.files import chdir, get, load, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class FFNvEncHeaders(ConanFile): name = "nv-codec-headers" description = "FFmpeg version of headers required to interface with Nvidia's codec APIs" - topics = ("ffmpeg", "video", "nvidia", "headers") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/FFmpeg/nv-codec-headers" - license = "MIT" - settings = "os" + topics = ("ffmpeg", "video", "nvidia", "headers", "header-only") - _autotools = None - _source_subfolder = "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def build_requirements(self): if self._settings_build.os == "Windows": if "CONAN_MAKE_PROGRAM" not in os.environ: - self.build_requires("make/4.2.1") - - def package_id(self): - self.info.header_only() + self.build_requires("make/4.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 _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - return self._autotools + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - autotools = self._configure_autotools() - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.make() def _extract_license(self): # Extract the License/s from the header to a file - tmp = tools.load(os.path.join(self._source_subfolder, "include", "ffnvcodec", "nvEncodeAPI.h")) - license_contents = tmp[2:tmp.find("*/", 1)] # The license begins with a C comment /* and ends with */ - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + tmp = load(self, os.path.join(self.source_folder, "include", "ffnvcodec", "nvEncodeAPI.h")) + license_contents = tmp[2 : tmp.find("*/", 1)] # The license begins with a C comment /* and ends with */ + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package(self): self._extract_license() - - autotools = self._configure_autotools() - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): - autotools.install(args=["PREFIX={}".format(self.package_folder)]) - - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install(args=["PREFIX=/"]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.names["pkg_config"] = "ffnvcodec" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("pkg_config_name", "ffnvcodec") diff --git a/recipes/nv-codec-headers/all/test_package/CMakeLists.txt b/recipes/nv-codec-headers/all/test_package/CMakeLists.txt index 7b9b613cbb24a..a89c9eadf95fc 100644 --- a/recipes/nv-codec-headers/all/test_package/CMakeLists.txt +++ b/recipes/nv-codec-headers/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(nv-codec-headers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE nv-codec-headers::nv-codec-headers) diff --git a/recipes/nv-codec-headers/all/test_package/conanfile.py b/recipes/nv-codec-headers/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/nv-codec-headers/all/test_package/conanfile.py +++ b/recipes/nv-codec-headers/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/nv-codec-headers/all/test_package/test_package.c b/recipes/nv-codec-headers/all/test_package/test_package.c index 6742254a188e9..2cb0fd61df830 100644 --- a/recipes/nv-codec-headers/all/test_package/test_package.c +++ b/recipes/nv-codec-headers/all/test_package/test_package.c @@ -4,7 +4,7 @@ #include #include -int main () { +int main() { printf("hello NVENC API version %u.%u\n", NVENCAPI_MAJOR_VERSION, NVENCAPI_MINOR_VERSION); return EXIT_SUCCESS; } diff --git a/recipes/nv-codec-headers/config.yml b/recipes/nv-codec-headers/config.yml index 993edd5a10422..21a0b445119b1 100644 --- a/recipes/nv-codec-headers/config.yml +++ b/recipes/nv-codec-headers/config.yml @@ -1,4 +1,8 @@ versions: + "12.1.14.0": + folder: all + "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 7d5d894d50353..48340be192d8e 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 fbe722ba0c892..049e362302672 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 f1eca9cdf76de..188be115336dd 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 5aa80c1777d6d..e1a3c065c3b16 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 5493b25252fde..b6b2defa46e0e 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 c605339e388af..42f9cfb1d7ca2 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 0000000000000..c605339e388af --- /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 af3abbeb88948..b4ebf9918d7ba 100644 --- a/recipes/objectbox/all/conandata.yml +++ b/recipes/objectbox/all/conandata.yml @@ -1,4 +1,12 @@ sources: + # The release tarball is invalid, so we need to get the tarball from the v0.20.0 commit. + # https://github.com/objectbox/objectbox-c/issues/38 + "0.20.0": + url: "https://github.com/objectbox/objectbox-c/archive/7e4a5a3ed94aa486acf0737b354726b493fd204c.tar.gz" + sha256: "cb6ec8b7ceaed7963ad582c4519d06ddc887294f0893b3f9bf89e7d0789ce216" + "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 +16,15 @@ sources: "0.17.0": url: "https://github.com/objectbox/objectbox-c/archive/refs/tags/v0.17.0.tar.gz" sha256: "3b936b3352ae0c8ea3706cc0a1790d2714a415cdce16007c2caca367ead5af8d" - patches: + "0.20.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.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 c5710cc60873c..ffcc6e09fb17f 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 8ef573610ef44..daba6910bb48a 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 f2cc4d23dcbd0..2fdec99a504b8 100644 --- a/recipes/objectbox/config.yml +++ b/recipes/objectbox/config.yml @@ -1,4 +1,8 @@ versions: + "0.20.0": + folder: all + "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 a70215ca04760..ee8b970e7d9a3 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 3d66f15a4c9af..6e4898b3c5824 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 d120a992c06a6..0a6bc68712d90 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 20353a906da64..b21cc49efde95 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 1e42247500f04..d2c6c293649c6 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 991faa27ffc84..263f2034b1a24 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 a07fac747020c..bd49d24ed139e 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 62e07ce5add59..ef5d7042163ec 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 1915a524b0e38..2fde3196d3682 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 52e5634af7ecf..b9e37112cb2f5 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 7a68c9f36c4bf..ec355db2143f3 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 6f1d3245dd7e8..bb7197d60a7c5 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 98222f149cce9..418c7b3cdcaa5 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 eecbf7a0bd2d8..92395bec9bd21 100644 --- a/recipes/octo-logger-cpp/all/conandata.yml +++ b/recipes/octo-logger-cpp/all/conandata.yml @@ -1,7 +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.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": - sha256: 54381d6dbc80c6be6d8b9e087a4b55fae6ff5d07c3c2399bc7e1c94252260bf2 - url: https://github.com/ofiriluz/octo-logger-cpp/archive/refs/tags/v1.2.0.tar.gz + 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 cdb8df5c161d2..d8b77698e6f0d 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 4cdb390261544..f7d178a90b8ee 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 696c343fa84f4..ef5d7042163ec 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 ee6c707d3f79c..76947dd2891c2 100644 --- a/recipes/octo-logger-cpp/config.yml +++ b/recipes/octo-logger-cpp/config.yml @@ -1,5 +1,9 @@ versions: - "1.1.0": + "1.5.0": + folder: "all" + "1.4.0": folder: "all" "1.2.0": folder: "all" + "1.1.0": + folder: "all" diff --git a/recipes/octo-wildcardmatching-cpp/all/conanfile.py b/recipes/octo-wildcardmatching-cpp/all/conanfile.py index f22d6f51767b8..c8622ee725469 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 d02959b9b71e5..10219d5afbaa2 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 62e07ce5add59..254feca104287 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 1b73c9b2e5c5d..4699a071746f8 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,11 +15,43 @@ 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/targets-outputname-collision-1.9.5.patch" + - 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.6-0001-cpp17-compat.patch" + patch_description: "Robust C++17 compatibility" + patch_type: "portability" + patch_source: "https://github.com/OctoMap/octomap/pull/394" "1.9.6": - - patch_file: "patches/targets-outputname-collision-1.9.5.patch" + - 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.6-0001-cpp17-compat.patch" + patch_description: "Robust C++17 compatibility" + patch_type: "portability" + patch_source: "https://github.com/OctoMap/octomap/pull/394" "1.9.5": - - patch_file: "patches/targets-outputname-collision-1.9.5.patch" + - 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.3-0002-cpp17-compat.patch" + patch_description: "Robust C++17 compatibility" + patch_type: "portability" + patch_source: "https://github.com/OctoMap/octomap/pull/394" "1.9.3": - - patch_file: "patches/targets-outputname-collision-1.9.3.patch" + - patch_file: "patches/1.9.3-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.3-0002-cpp17-compat.patch" + patch_description: "Robust C++17 compatibility" + patch_type: "portability" + patch_source: "https://github.com/OctoMap/octomap/pull/394" diff --git a/recipes/octomap/all/patches/targets-outputname-collision-1.9.3.patch b/recipes/octomap/all/patches/1.9.3-0001-targets-outputname-collision.patch similarity index 100% rename from recipes/octomap/all/patches/targets-outputname-collision-1.9.3.patch rename to recipes/octomap/all/patches/1.9.3-0001-targets-outputname-collision.patch diff --git a/recipes/octomap/all/patches/1.9.3-0002-cpp17-compat.patch b/recipes/octomap/all/patches/1.9.3-0002-cpp17-compat.patch new file mode 100644 index 0000000000000..f260df02249e4 --- /dev/null +++ b/recipes/octomap/all/patches/1.9.3-0002-cpp17-compat.patch @@ -0,0 +1,247 @@ +--- a/octomap/include/octomap/AbstractOcTree.h ++++ b/octomap/include/octomap/AbstractOcTree.h +@@ -51,7 +51,7 @@ namespace octomap { + 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 @@ namespace octomap { + 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 @@ namespace octomap { + * 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 @@ namespace octomap { + * 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 @@ namespace octomap { + */ + 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 @@ namespace octomap { + * 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 @@ namespace octomap { + 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) +@@ -51,7 +51,7 @@ namespace octomap { + std::string getTreeType() const {return "OcTreeBase";} + }; + +- }; ++} + + + #endif +--- a/octomap/include/octomap/OcTreeBaseImpl.h ++++ b/octomap/include/octomap/OcTreeBaseImpl.h +@@ -244,7 +244,7 @@ namespace octomap { + 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 @@ namespace octomap { + 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 @@ namespace octomap { + 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 tree 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 @@ namespace octomap { + * 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 @@ namespace octomap { + + public: + +- ScanGraph() {}; ++ ScanGraph() {} + ~ScanGraph(); + + /// Clears all nodes and edges, and will delete the corresponding objects +--- a/octomap/src/ColorOcTree.cpp ++++ b/octomap/src/ColorOcTree.cpp +@@ -91,7 +91,7 @@ namespace octomap { + ColorOcTree::ColorOcTree(double in_resolution) + : OccupancyOcTreeBase(in_resolution) { + colorOcTreeMemberInit.ensureLinking(); +- }; ++ } + + ColorOcTreeNode* ColorOcTree::setNodeColor(const OcTreeKey& key, + uint8_t r, +--- a/octomap/src/OcTree.cpp ++++ b/octomap/src/OcTree.cpp +@@ -39,7 +39,7 @@ namespace octomap { + OcTree::OcTree(double in_resolution) + : OccupancyOcTreeBase(in_resolution) { + ocTreeMemberInit.ensureLinking(); +- }; ++ } + + OcTree::OcTree(std::string _filename) + : OccupancyOcTreeBase (0.1) { // resolution will be set according to tree file +--- 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 @@ namespace octomap { + #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 @@ int main(int argc, char** argv) { + 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)){ diff --git a/recipes/octomap/all/patches/targets-outputname-collision-1.9.5.patch b/recipes/octomap/all/patches/1.9.5-0001-targets-outputname-collision.patch similarity index 100% rename from recipes/octomap/all/patches/targets-outputname-collision-1.9.5.patch rename to recipes/octomap/all/patches/1.9.5-0001-targets-outputname-collision.patch diff --git a/recipes/octomap/all/patches/1.9.6-0001-cpp17-compat.patch b/recipes/octomap/all/patches/1.9.6-0001-cpp17-compat.patch new file mode 100644 index 0000000000000..510dd8cad3218 --- /dev/null +++ b/recipes/octomap/all/patches/1.9.6-0001-cpp17-compat.patch @@ -0,0 +1,216 @@ +--- a/octomap/include/octomap/AbstractOcTree.h ++++ b/octomap/include/octomap/AbstractOcTree.h +@@ -51,7 +51,7 @@ namespace octomap { + 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 @@ namespace octomap { + 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 @@ namespace octomap { + * 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 @@ namespace octomap { + * 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 @@ namespace octomap { + */ + 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 @@ namespace octomap { + * 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 @@ namespace octomap { + 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 @@ namespace octomap { + 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 @@ namespace octomap { + 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 @@ namespace octomap { + 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 tree 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 @@ namespace octomap { + * 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 @@ namespace octomap { + + 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 @@ namespace octomap { + #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 @@ int main(int argc, char** argv) { + 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)){ 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 0000000000000..5855cdf69fd95 --- /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 bbf53f61e28d4..7b6ae3353a6fd 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/ode/all/conandata.yml b/recipes/ode/all/conandata.yml index cb490a2db9ad2..59347531ec928 100644 --- a/recipes/ode/all/conandata.yml +++ b/recipes/ode/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "0.16.4": + url: "https://bitbucket.org/odedevs/ode/downloads/ode-0.16.4.tar.gz" + sha256: "71037b8281c6c86b0a55729f90d5db697abe4cbec1d8118157e00d48ec253467" "0.16.2": url: "https://bitbucket.org/odedevs/ode/downloads/ode-0.16.2.tar.gz" sha256: "b26aebdcb015e2d89720ef48e0cb2e8a3ca77915f89d853893e7cc861f810f22" patches: + "0.16.4": + - patch_file: "patches/0002-dont-force-pic.patch" + patch_description: "Allow to build static library without PIC" + patch_type: "conan" "0.16.2": - patch_file: "patches/0001-fix-apple.patch" patch_description: "Fix cross-build to macOS, iOS, watchOS & tvOS" @@ -10,9 +17,6 @@ patches: - patch_file: "patches/0002-dont-force-pic.patch" patch_description: "Allow to build static library without PIC" patch_type: "conan" - - patch_file: "patches/0003-cmake-fix-ccd-target.patch" - patch_description: "Fix link to CMake imported target of libccd" - patch_type: "conan" - patch_file: "patches/0004-fix-include-ode-timer.patch" patch_description: "Fix casing issue in include of ode/timer.h" patch_type: "conan" diff --git a/recipes/ode/all/conanfile.py b/recipes/ode/all/conanfile.py index 380cefe469f49..0ad8a648e1978 100644 --- a/recipes/ode/all/conanfile.py +++ b/recipes/ode/all/conanfile.py @@ -82,6 +82,7 @@ def generate(self): tc.generate() deps = CMakeDeps(self) + deps.set_property("libccd", "cmake_target_name", "ccd::ccd") deps.generate() def build(self): diff --git a/recipes/ode/all/patches/0003-cmake-fix-ccd-target.patch b/recipes/ode/all/patches/0003-cmake-fix-ccd-target.patch deleted file mode 100644 index e9dd8b78218bb..0000000000000 --- a/recipes/ode/all/patches/0003-cmake-fix-ccd-target.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -572,7 +572,7 @@ if(ODE_WITH_LIBCCD) - if(ODE_WITH_LIBCCD_SYSTEM) - find_package(ccd) - target_compile_definitions(ode PRIVATE -DdLIBCCD_ENABLED -DdLIBCCD_SYSTEM) -- target_link_libraries(ODE ccd::ccd) -+ target_link_libraries(ODE PRIVATE ccd) - else() - target_compile_definitions(ODE PRIVATE -DdLIBCCD_ENABLED -DdLIBCCD_INTERNAL) - target_include_directories( diff --git a/recipes/ode/config.yml b/recipes/ode/config.yml index 62178f7b45783..86a42ef0267a1 100644 --- a/recipes/ode/config.yml +++ b/recipes/ode/config.yml @@ -1,3 +1,5 @@ versions: + "0.16.4": + folder: all "0.16.2": folder: all diff --git a/recipes/ogdf/all/conandata.yml b/recipes/ogdf/all/conandata.yml index f4dd3d9efc6c3..c6c2b408e36ee 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 e47d024478deb..cbdc4032988fc 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 6ece5a73dbce4..9860e459d4c28 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 0000000000000..7e45066c8f010 --- /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 0000000000000..ad2031f5acf6b --- /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 0000000000000..487c6aa0a79e2 --- /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 0000000000000..b864873d00282 --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..4d3ae89a2e2e0 --- /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 0000000000000..f52e484dea6d6 --- /dev/null +++ b/recipes/ohnet/config.yml @@ -0,0 +1,3 @@ +versions: + "1.36.5182": + folder: all diff --git a/recipes/ois/all/CMakeLists.txt b/recipes/ois/all/CMakeLists.txt deleted file mode 100644 index cdeeef45d13c1..0000000000000 --- a/recipes/ois/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") - include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -else() - include(conanbuildinfo.cmake) -endif() -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/ois/all/conandata.yml b/recipes/ois/all/conandata.yml index 0c7f109273e17..cad4b4f6daeb0 100644 --- a/recipes/ois/all/conandata.yml +++ b/recipes/ois/all/conandata.yml @@ -1,8 +1,11 @@ sources: + "1.5.1": + url: "https://github.com/wgois/OIS/archive/v1.5.1.tar.gz" + sha256: "614f6ef6d69cf6d84f1b50efff46a6c1acce426933e5f0dcf29862ea8332af73" "1.5": url: "https://github.com/wgois/OIS/archive/v1.5.tar.gz" sha256: "aa3e6b840b1149bb06835e04365957f4659c08b3e3095a48b289050f1637a174" patches: "1.5": - - patch_file: "patches/1.5/001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.5-0001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch" + patch_type: "conan" diff --git a/recipes/ois/all/conanfile.py b/recipes/ois/all/conanfile.py index 53d83bec3c91b..3520d291b333d 100644 --- a/recipes/ois/all/conanfile.py +++ b/recipes/ois/all/conanfile.py @@ -1,17 +1,25 @@ import os import glob -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import ( + apply_conandata_patches, + export_conandata_patches, + get, copy, rmdir, collect_libs + ) +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + +required_conan_version = ">=1.53.0" + class OisConan(ConanFile): name = "ois" description = "Object oriented Input System." - topics = ("conan", "ois", "input" ) + topics = ("input system", "input" ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/wgois/OIS" license = "Zlib" - exports_sources = ["CMakeLists.txt", "patches/*"] - generators = "cmake" + package_type = "library" settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], @@ -22,19 +30,12 @@ class OisConan(ConanFile): "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 requirements(self): - if self.settings.os == "Linux": - self.requires("xorg/system") + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -42,48 +43,59 @@ 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]) - extracted_dir = "OIS-{}".format(self.version) - os.rename(extracted_dir, self._source_subfolder) + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os == "Linux": + self.requires("xorg/system") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["OIS_BUILD_SHARED_LIBS"] = self.options.shared - self._cmake.definitions["OIS_BUILD_DEMOS"] = False - self._cmake.configure(build_folder=self._build_subfolder) + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) - 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["OIS_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["OIS_BUILD_DEMOS"] = 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.md", src=os.path.join(self.source_folder, self._source_subfolder), dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.md", 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")) for pdb_file in glob.glob(os.path.join(self.package_folder, "bin", "*.pdb")): os.unlink(pdb_file) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) - self.cpp_info.names["pkg_config"] = "OIS" - self.cpp_info.names["cmake_find_package"] = "OIS" - self.cpp_info.names["cmake_find_package_multi"] = "OIS" + self.cpp_info.set_property("pkg_config_name", "OIS") if self.settings.os == "Macos": - self.cpp_info.frameworks = ["Foundation", "Cocoa", "IOKit"] + self.cpp_info.frameworks = ["Foundation", "Cocoa", "IOKit", "AppKit", "CoreFoundation", "CoreGraphics"] elif self.settings.os == "Windows": self.cpp_info.defines = ["OIS_WIN32_XINPUT_SUPPORT"] self.cpp_info.system_libs = ["dinput8", "dxguid"] if self.options.shared: self.cpp_info.defines.append("OIS_DYNAMIC_LIB") + elif 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"] = "OIS" + self.cpp_info.names["cmake_find_package_multi"] = "OIS" diff --git a/recipes/ois/all/patches/1.5/001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch b/recipes/ois/all/patches/1.5-0001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch similarity index 100% rename from recipes/ois/all/patches/1.5/001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch rename to recipes/ois/all/patches/1.5-0001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch diff --git a/recipes/ois/all/test_package/CMakeLists.txt b/recipes/ois/all/test_package/CMakeLists.txt index 196188113685c..6704daeed1834 100644 --- a/recipes/ois/all/test_package/CMakeLists.txt +++ b/recipes/ois/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(ois REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ois::ois) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ois/all/test_package/conanfile.py b/recipes/ois/all/test_package/conanfile.py index bd7165a553cf4..3a91c9439218e 100644 --- a/recipes/ois/all/test_package/conanfile.py +++ b/recipes/ois/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 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", "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/ois/config.yml b/recipes/ois/config.yml index 289ff2f2a0c3c..1ce6b25b9dda7 100644 --- a/recipes/ois/config.yml +++ b/recipes/ois/config.yml @@ -1,3 +1,5 @@ versions: + "1.5.1": + folder: all "1.5": folder: all diff --git a/recipes/onetbb/2020.x/conandata.yml b/recipes/onetbb/2020.x/conandata.yml index de98a3aa2d71d..bca751ad9a8a8 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 0fd823e9ffd15..3975cf2c1c8b6 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 d5a40167452f4..2dd759c70dd11 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 38f4483872d47..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 8839ace156f3f..4839476518f75 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" @@ -17,12 +20,12 @@ sources: patches: "2021.8.0": - patch_description: "fix building for android with NDK >= 25" - patch_type: "backport" + patch_type: "portability" patch_source: "https://github.com/oneapi-src/oneTBB/pull/953.patch" patch_file: "patches/android-ndk25.patch" "2021.7.0": - patch_description: "fix building for android with NDK >= 25" - patch_type: "backport" + patch_type: "portability" patch_source: "https://github.com/oneapi-src/oneTBB/pull/953.patch" patch_file: "patches/android-ndk25.patch" "2021.6.0": @@ -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 6cd71594e81e6..771f1bcbec3de 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,74 +22,120 @@ 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": False, - "tbbproxy": False, + "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 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 not (Version(self.version) >= "2021.6.0" and self.options.shared and self.settings.os != "Android"): + 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") + 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.6.0": - del self.info.options.tbbmalloc - del self.info.options.tbbproxy + def requirements(self): + if self._tbbbind_build: + self.requires("hwloc/2.9.3") def validate(self): if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "11.0": raise ConanInvalidConfiguration(f"{self.ref} couldn't be built by apple-clang < 11.0") - if not self.options.get_safe("shared", True): - if Version(self.version) >= "2021.6.0": - raise ConanInvalidConfiguration( - "Building oneTBB as a static library is highly discouraged and not supported " - "to avoid unforeseen issues like https://github.com/oneapi-src/oneTBB/issues/920. " - "Please consider fixing at least the aforementioned issue in upstream." - ) - self.output.warning("oneTBB strongly discourages usage of static linkage") - if self.options.tbbproxy and not (self.options.tbbmalloc and self.options.get_safe("shared", True)): - raise ConanInvalidConfiguration("tbbproxy needs tbbmalloc and shared options") + + # 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.1.0") 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 - if Version(self.version) >= "2021.6.0": + if Version(self.version) >= "2021.5.0": 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("tbbmalloc"): toolchain.variables["TBBMALLOC_PROXY_BUILD"] = self.options.tbbproxy - toolchain.variables["TBB_ENABLE_IPO"] = self.options.get_safe("interprocedural_optimization", False) + 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) @@ -104,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": @@ -131,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") @@ -140,7 +190,7 @@ def lib_name(name): tbbmalloc.system_libs = ["dl", "pthread"] # tbbmalloc_proxy - if self.options.tbbproxy: + 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 0000000000000..e1a3505708cba --- /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 f510136a26a97..fbae62535650c 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 0d20897301b68..b21cc49efde95 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 7995868f434ad..39b3726474302 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 1d4c5ee6c5192..d74493648d9a9 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 271aea5702065..9cf31a690977c 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 7a261fa84daf5..ccb0c203d7239 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 20403cb789ca7..4c5cfb0ecfc0d 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): @@ -26,22 +27,35 @@ class OnnxConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "disable_static_registration": [True, False], } default_options = { "shared": False, "fPIC": True, + "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,24 +65,31 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.shared: + if is_msvc(self): + del self.options.shared + self.package_type = "static-library" + if self.options.get_safe("shared"): self.options.rm_safe("fPIC") def layout(self): 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) @@ -76,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 @@ -87,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 @@ -95,6 +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) + tc.variables["ONNX_DISABLE_STATIC_REGISTRATION"] = self.options.get_safe('disable_static_registration') tc.generate() deps = CMakeDeps(self) deps.generate() @@ -171,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 5ecbd144c4919..0000000000000 --- 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 2d1317c302c93..0000000000000 --- 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 181c708c8d374..0000000000000 --- 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 b701fb66947d1..0000000000000 --- 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 1ff241f73aca7..0000000000000 --- 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 553b17a4b40e9..669807aa7c0eb 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 93052017c9ff5..b051b06768621 100644 --- a/recipes/onnxruntime/all/conandata.yml +++ b/recipes/onnxruntime/all/conandata.yml @@ -1,8 +1,58 @@ 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" "1.14.1": 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" + 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.14.1": - patch_file: "patches/1.14.1-0001-cmake-dependencies.patch" patch_description: "CMake: ensure conan dependencies are used (upstreamed future versions)" @@ -18,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 cd2777075e37e..b91cf5d0a83f9 100644 --- a/recipes/onnxruntime/all/conanfile.py +++ b/recipes/onnxruntime/all/conanfile.py @@ -7,6 +7,7 @@ from conan.tools.scm import Version from conan.tools.env import VirtualBuildEnv import os +import sys required_conan_version = ">=1.53.0" @@ -40,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": "8", + "Visual Studio": "17", + "msvc": "193", + "gcc": "9", "clang": "5", "apple-clang": "10", } @@ -62,23 +71,32 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + @property + def _onnx_version(self): + version = Version(self.version) + return { + "1.14": "1.13.1", + "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("onnx/1.13.1") + 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.231216.1") if self.options.with_xnnpack: self.requires("xnnpack/cci.20220801") @@ -88,7 +106,14 @@ def validate(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." + f"{self.ref} requires minimum compiler version {minimum_version}." + ) + + def validate_build(self): + if self.version >= Version("1.15.0") and self.options.shared and sys.version_info[:2] < (3, 8): + # https://github.com/microsoft/onnxruntime/blob/638146b79ea52598ece514704d3f592c10fab2f1/cmake/CMakeLists.txt#LL500C12-L500C12 + raise ConanInvalidConfiguration( + f"{self.ref} requires python 3.8+ to be built as shared." ) def build_requirements(self): @@ -102,6 +127,9 @@ def generate(self): tc = CMakeToolchain(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: + # 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 @@ -181,6 +209,15 @@ def generate(self): tc.variables["onnxruntime_USE_CANN"] = False tc.generate() deps = CMakeDeps(self) + + if self.dependencies["flatbuffers"].options.shared: + deps.set_property("flatbuffers", "cmake_target_name", "flatbuffers::flatbuffers") + + deps.set_property("boost::headers", "cmake_target_name", "Boost::mp11") + deps.set_property("date", "cmake_target_name", "date_interface") + deps.set_property("safeint", "cmake_target_name", "safeint_interface") + deps.set_property("xnnpack", "cmake_target_name", "XNNPACK") + deps.generate() vbe = VirtualBuildEnv(self) vbe.generate(scope="build") @@ -217,9 +254,14 @@ def package_info(self): "common", "flatbuffers", ] + if self.options.with_xnnpack: + 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") @@ -229,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 33dc41a44c7b2..6dbbfc4af9df4 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 @@ -1,3 +1,5 @@ +diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake +index 54d2f9c5c1..3195ef15a0 100644 --- a/cmake/external/abseil-cpp.cmake +++ b/cmake/external/abseil-cpp.cmake @@ -22,6 +22,7 @@ FetchContent_Declare( @@ -8,6 +10,8 @@ ) onnxruntime_fetchcontent_makeavailable(abseil_cpp) +diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake +index 266dd534af..3c7cb77891 100644 --- a/cmake/external/eigen.cmake +++ b/cmake/external/eigen.cmake @@ -14,8 +14,11 @@ else () @@ -24,6 +28,8 @@ + 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 f85336e8bb..b051ff0be1 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -97,7 +97,7 @@ FetchContent_Declare( @@ -35,18 +41,15 @@ ) #Here we support two build mode: -@@ -136,8 +136,10 @@ FetchContent_Declare( +@@ -136,6 +136,7 @@ FetchContent_Declare( date URL ${DEP_URL_date} URL_HASH SHA1=${DEP_SHA1_date} + FIND_PACKAGE_ARGS NAMES date ) onnxruntime_fetchcontent_makeavailable(date) -+add_library(date_interface ALIAS date::date) - - -@@ -145,6 +147,7 @@ FetchContent_Declare( +@@ -145,6 +146,7 @@ FetchContent_Declare( mp11 URL ${DEP_URL_mp11} URL_HASH SHA1=${DEP_SHA1_mp11} @@ -54,7 +57,7 @@ ) set(JSON_BuildTests OFF CACHE INTERNAL "") -@@ -263,10 +266,12 @@ FetchContent_Declare( +@@ -263,6 +265,7 @@ FetchContent_Declare( safeint URL ${DEP_URL_safeint} URL_HASH SHA1=${DEP_SHA1_safeint} @@ -62,23 +65,7 @@ ) # The next line will generate an error message "fatal: not a git repository", but it is ok. It is from flatbuffers - onnxruntime_fetchcontent_makeavailable(Protobuf nlohmann_json mp11 re2 safeint GSL flatbuffers) -+add_library(Boost::mp11 ALIAS Boost::headers) - if(NOT flatbuffers_FOUND) - if(NOT TARGET flatbuffers::flatbuffers) - add_library(flatbuffers::flatbuffers ALIAS flatbuffers) -@@ -291,6 +296,10 @@ namespace std { using ::getenv; } - target_compile_options(flatc PRIVATE /FI${CMAKE_BINARY_DIR}/gdk_cstdlib_wrapper.h) - endif() - endif() -+else() -+ if(NOT TARGET flatbuffers::flatbuffers) -+ add_library(flatbuffers::flatbuffers ALIAS flatbuffers::flatbuffers_shared) -+ endif() - endif() - - if (onnxruntime_BUILD_UNIT_TESTS) -@@ -359,6 +368,7 @@ FetchContent_Declare( +@@ -359,6 +362,7 @@ FetchContent_Declare( URL ${DEP_URL_onnx} URL_HASH SHA1=${DEP_SHA1_onnx} PATCH_COMMAND ${ONNXRUNTIME_ONNX_PATCH_COMMAND} @@ -86,19 +73,16 @@ ) -@@ -386,8 +396,9 @@ endif() +@@ -386,8 +390,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}) -+add_library(safeint_interface ALIAS safeint::safeint) -+#target_include_directories(safeint_interface INTERFACE ${safeint_SOURCE_DIR}) -+ # XNNPACK EP if (onnxruntime_USE_XNNPACK) -@@ -416,9 +427,9 @@ set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES_XNNPACK} WIL +@@ -416,9 +418,9 @@ set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES_XNNPACK} WIL # 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) @@ -110,6 +94,8 @@ endif() if (onnxruntime_RUN_ONNX_TESTS) +diff --git a/cmake/external/wil.cmake b/cmake/external/wil.cmake +index d38535c4a1..8b181871f9 100644 --- a/cmake/external/wil.cmake +++ b/cmake/external/wil.cmake @@ -11,12 +11,18 @@ FetchContent_Declare( @@ -139,9 +125,11 @@ -endif() \ No newline at end of file +endif() +diff --git a/cmake/external/xnnpack.cmake b/cmake/external/xnnpack.cmake +index 1fc2c6ccdc..a2c28957f9 100644 --- a/cmake/external/xnnpack.cmake +++ b/cmake/external/xnnpack.cmake -@@ -25,12 +25,19 @@ set(FXDIV_SOURCE_DIR ${fxdiv_SOURCE_DIR}) +@@ -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) @@ -158,24 +146,11 @@ onnxruntime_fetchcontent_makeavailable(googlexnnpack) -set(XNNPACK_DIR ${googlexnnpack_SOURCE_DIR}) -set(XNNPACK_INCLUDE_DIR ${XNNPACK_DIR}/include) -+# set(XNNPACK_DIR ${googlexnnpack_SOURCE_DIR}) -+# set(XNNPACK_INCLUDE_DIR ${XNNPACK_DIR}/include) -+ -+add_library(XNNPACK ALIAS xnnpack::xnnpack) set(onnxruntime_EXTERNAL_LIBRARIES_XNNPACK XNNPACK pthreadpool) ---- 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 +++ b/cmake/onnxruntime_providers.cmake @@ -1561,10 +1561,6 @@ if (onnxruntime_USE_XNNPACK) 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 0000000000000..c8e0cc9d9a48e --- /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 new file mode 100644 index 0000000000000..4ebc87b3a4ddc --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch @@ -0,0 +1,150 @@ +diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake +index 54d2f9c5c1..3195ef15a0 100644 +--- a/cmake/external/abseil-cpp.cmake ++++ b/cmake/external/abseil-cpp.cmake +@@ -22,6 +22,7 @@ FetchContent_Declare( + URL ${DEP_URL_abseil_cpp} + URL_HASH SHA1=${DEP_SHA1_abseil_cpp} + PATCH_COMMAND ${ABSL_PATCH_COMMAND} ++ FIND_PACKAGE_ARGS REQUIRED CONFIG NAMES absl + ) + + onnxruntime_fetchcontent_makeavailable(abseil_cpp) +diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake +index 266dd534af..12b1792862 100644 +--- a/cmake/external/eigen.cmake ++++ b/cmake/external/eigen.cmake +@@ -14,8 +14,9 @@ else () + FetchContent_Declare( + eigen + URL https://gitlab.com/libeigen/eigen/-/archive/d10b27fe37736d2944630ecd7557cefa95cf87c9/eigen-d10b27fe37736d2944630ecd7557cefa95cf87c9.zip ++ 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 9effd1a2db..a059c28e36 100644 +--- a/cmake/external/onnxruntime_external_deps.cmake ++++ b/cmake/external/onnxruntime_external_deps.cmake +@@ -173,6 +173,7 @@ FetchContent_Declare( + date + URL ${DEP_URL_date} + URL_HASH SHA1=${DEP_SHA1_date} ++ FIND_PACKAGE_ARGS NAMES date + ) + onnxruntime_fetchcontent_makeavailable(date) + +@@ -182,6 +183,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 "") +@@ -300,6 +302,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 +@@ -396,6 +399,7 @@ FetchContent_Declare( + URL ${DEP_URL_onnx} + URL_HASH SHA1=${DEP_SHA1_onnx} + PATCH_COMMAND ${ONNXRUNTIME_ONNX_PATCH_COMMAND} ++ FIND_PACKAGE_ARGS NAMES onnx ONNX + ) + + +@@ -423,9 +427,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) +@@ -453,9 +454,9 @@ set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES_XNNPACK} WIL + # 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") ++# 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") ++ # target_compile_definitions(onnx PUBLIC "__ONNX_NO_DOC_STRINGS") + endif() + + if (onnxruntime_RUN_ONNX_TESTS) +diff --git a/cmake/external/wil.cmake b/cmake/external/wil.cmake +index d38535c4a1..02d6dbd85d 100644 +--- a/cmake/external/wil.cmake ++++ b/cmake/external/wil.cmake +@@ -9,14 +9,10 @@ FetchContent_Declare( + URL_HASH SHA1=${DEP_SHA1_microsoft_wil} + FIND_PACKAGE_ARGS NAMES wil + ) +-#We can not use FetchContent_MakeAvailable(microsoft_wil) at here, since their cmake file +-#always executes install command without conditions. +-FetchContent_Populate(microsoft_wil) +-if(NOT wil_FOUND) ++ ++if(WIN32) ++ FetchContent_MakeAvailable(microsoft_wil) ++else() + add_library(WIL INTERFACE) + add_library(WIL::WIL ALIAS WIL) +- +- # The interface's include directory. +- target_include_directories(WIL INTERFACE +- $) +-endif() +\ No newline at end of file ++endif() +diff --git a/cmake/external/xnnpack.cmake b/cmake/external/xnnpack.cmake +index 1fc2c6ccdc..a2c28957f9 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_providers.cmake b/cmake/onnxruntime_providers.cmake +index 0daa1b8a3d..1f25467a8c 100644 +--- a/cmake/onnxruntime_providers.cmake ++++ b/cmake/onnxruntime_providers.cmake +@@ -1711,10 +1711,6 @@ if (onnxruntime_USE_XNNPACK) + add_dependencies(onnxruntime_providers_xnnpack onnx ${onnxruntime_EXTERNAL_DEPENDENCIES}) + set_target_properties(onnxruntime_providers_xnnpack PROPERTIES FOLDER "ONNXRuntime") + +- install(DIRECTORY ${ONNXRUNTIME_INCLUDE_DIR}/core/providers/xnnpack +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core/providers +- ) +- + set_target_properties(onnxruntime_providers_xnnpack PROPERTIES LINKER_LANGUAGE CXX) + + if (NOT onnxruntime_BUILD_SHARED_LIB) 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 0000000000000..dacb2b9b27a86 --- /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 0414d9adf6108..7dfea6fd99cd4 100644 --- a/recipes/onnxruntime/config.yml +++ b/recipes/onnxruntime/config.yml @@ -1,3 +1,13 @@ 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": folder: all diff --git a/recipes/open-simulation-interface/all/CMakeLists.txt b/recipes/open-simulation-interface/all/CMakeLists.txt deleted file mode 100644 index 5cfb924ad4de7..0000000000000 --- 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 e0a816774466a..0a86437ce1ae3 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 971823690f5f9..b0e3cac24d6f1 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 34497df14111e..27d995312b038 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 3da371b660e0a..ef5d7042163ec 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 2b6c34045d39d..231a6941a54bb 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 d458e6add2e68..8fd6ed73c8578 100644 --- a/recipes/open62541/all/conandata.yml +++ b/recipes/open62541/all/conandata.yml @@ -1,64 +1,29 @@ 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.9": + url: "https://github.com/open62541/open62541/archive/v1.3.9.tar.gz" + sha256: "71764d4a060cfa07eae7aaabd176da38b155ef01c63103513339699fd8026e2f" + "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" + "1.3.9": + - 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.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 +40,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 25dd98cf850ff..2321b74998973 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 0000000000000..a2c9d60322e4f --- /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 470202a51fce2..0000000000000 --- 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 c1c291956aa8a..0000000000000 --- 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 d8c1db13840da..0000000000000 --- 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 19278804be705..f60651d6c51ea 100644 --- a/recipes/open62541/all/submoduledata.yml +++ b/recipes/open62541/all/submoduledata.yml @@ -1,51 +1,26 @@ 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 + sha256: 032c93e3f7c335bbb2d2d699804a804c9cdce2a2ecc3fe7cde552f2130982c26 + url: https://github.com/OPCFoundation/UA-Nodeset/archive/Glass=1.0.0-2022-01-01.zip archive_pattern: "UA-Nodeset-{version}" - "1.3.4": + "1.3.9": 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 553baebf9bc49..099ba922c1149 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 52782cf8480cf..c1fe645c77cc3 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 bd17b291f8bc6..8113fa1875eb6 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 76c7748700110..02f8b3e330035 100644 --- a/recipes/open62541/config.yml +++ b/recipes/open62541/config.yml @@ -1,21 +1,11 @@ versions: - "1.3.4": + "1.3.9": 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 5401a9836e21a..83f92f752bca9 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 b429533e05e27..f0c50c95fa214 100644 --- a/recipes/openapi-generator/all/conandata.yml +++ b/recipes/openapi-generator/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "7.2.0": + url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar" + sha256: "1cf0c80de12c0fdc8594289c19e414b402108ef10b8dd0bfda1953151341ab5d" + "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 805a487d9c79b..797b4078e69ca 100644 --- a/recipes/openapi-generator/config.yml +++ b/recipes/openapi-generator/config.yml @@ -1,4 +1,8 @@ versions: + "7.2.0": + folder: all + "7.0.0": + folder: all "6.6.0": folder: all "6.5.0": diff --git a/recipes/openblas/all/CMakeLists.txt b/recipes/openblas/all/CMakeLists.txt deleted file mode 100644 index cdeeef45d13c1..0000000000000 --- a/recipes/openblas/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") - include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -else() - include(conanbuildinfo.cmake) -endif() -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/openblas/all/conandata.yml b/recipes/openblas/all/conandata.yml index 33390fd9116e6..d0f076aeb8032 100644 --- a/recipes/openblas/all/conandata.yml +++ b/recipes/openblas/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.3.26": + url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.26.tar.gz" + sha256: "4e6e4f5cb14c209262e33e6816d70221a2fe49eb69eaf0a06f065598ac602c68" + "0.3.25": + url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.25.tar.gz" + sha256: "4c25cb30c4bb23eddca05d7d0a85997b8db6144f5464ba7f8c09ce91e2f35543" + "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 01041ab44fd28..cb78919db63db 100644 --- a/recipes/openblas/all/conanfile.py +++ b/recipes/openblas/all/conanfile.py @@ -1,9 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir, collect_libs +from conan.tools.build import cross_building +from conan.tools.scm import Version +from conan.tools.apple import fix_apple_shared_install_name +from conan.errors import ConanInvalidConfiguration import os import functools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class OpenblasConan(ConanFile): @@ -28,73 +33,104 @@ class OpenblasConan(ConanFile): "use_thread": True, "dynamic_arch": False, } - generators = "cmake" short_paths = True + package_type = "library" @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def export_sources(self): - self.copy("CMakeLists.txt") + 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": del self.options.fPIC + if Version(self.version) >= "0.3.21": + # INFO: When no Fortran compiler is available, OpenBLAS builds LAPACK from an f2c-converted copy of LAPACK unless the NO_LAPACK option is specified + self.options.build_lapack = True def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self, skip_x64_x86=True): + if Version(self.version) < "0.3.24" and self.settings.arch == "armv8": + # OpenBLAS fails to detect the appropriate target architecture for armv8 for versions < 0.3.24, as it matches the 32 bit variant instead of 64. + # This was fixed in https://github.com/OpenMathLib/OpenBLAS/pull/4142, which was introduced in 0.3.24. + # This would be a reasonably trivial hotfix to backport. + raise ConanInvalidConfiguration("armv8 builds are not currently supported for versions lower than 0.3.24. Contributions to support this are welcome.") + + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross-building not implemented") def source(self): - tools.get( + get(self, **self.conan_data["sources"][self.version], strip_root=True, - destination=self._source_subfolder + destination=self.source_folder ) + if Version(self.version) <= "0.3.15": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), + "set(obj_defines ${defines_in})", "set(obj_defines ${defines_in})\r\n\r\n" + + "list(FIND obj_defines \"RC\" def_idx)\r\n" + "if (${def_idx} GREATER -1) \r\n\t" + + "list (REMOVE_ITEM obj_defines \"RC\")\r\n\t" + "list(APPEND obj_defines \"RC=RC\")\r\n" + + "endif ()\r\n" + "list(FIND obj_defines \"CR\" def_idx)\r\n" + + "if (${def_idx} GREATER -1) \r\n\t" + "list (REMOVE_ITEM obj_defines \"CR\")\r\n\t" + + "list(APPEND obj_defines \"CR=CR\")\r\n" + "endif ()") + @functools.lru_cache(1) def _configure_cmake(self): cmake = CMake(self) + cmake.configure() + return cmake + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + + tc.cache_variables["NOFORTRAN"] = not self.options.build_lapack + # This checks explicit user-specified fortran compiler if self.options.build_lapack: - self.output.warn("Building with lapack support requires a Fortran compiler.") - cmake.definitions["NOFORTRAN"] = not self.options.build_lapack - cmake.definitions["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack - cmake.definitions["DYNAMIC_ARCH"] = self.options.dynamic_arch - cmake.definitions["USE_THREAD"] = self.options.use_thread + if not self._fortran_compiler: + if Version(self.version) < "0.3.21": + 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 # Required for safe concurrent calls to OpenBLAS routines - cmake.definitions["USE_LOCKING"] = not self.options.use_thread + tc.cache_variables["USE_LOCKING"] = not self.options.use_thread - cmake.definitions[ - "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. - cmake.definitions["ANDROID"] = self.settings.os in ["Linux", "Android"] + tc.cache_variables["ANDROID"] = self.settings.os in ["Linux", "Android"] - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.generate() def build(self): - if tools.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) @@ -104,20 +140,23 @@ def build(self): set (NO_LAPACK 1) endif()""" - tools.replace_in_file( - os.path.join(self._source_subfolder, "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() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) 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")) + 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) def package_info(self): # CMake config file: @@ -127,17 +166,19 @@ 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") ) - self.cpp_info.components["openblas_component"].libs = tools.collect_libs(self) + self.cpp_info.components["openblas_component"].libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["openblas_component"].system_libs.append("m") if self.options.use_thread: self.cpp_info.components["openblas_component"].system_libs.append("pthread") - if self.options.build_lapack: + if self.options.build_lapack and self._fortran_compiler: self.cpp_info.components["openblas_component"].system_libs.append("gfortran") self.output.info( diff --git a/recipes/openblas/all/test_package/CMakeLists.txt b/recipes/openblas/all/test_package/CMakeLists.txt index 4b2a260fe0ab9..eaf07820c3b1c 100644 --- a/recipes/openblas/all/test_package/CMakeLists.txt +++ b/recipes/openblas/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(OpenBLAS REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/openblas/all/test_package/conanfile.py b/recipes/openblas/all/test_package/conanfile.py index 38f4483872d47..02eb5ce439fb4 100644 --- a/recipes/openblas/all/test_package/conanfile.py +++ b/recipes/openblas/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_layout, CMake import os +# It will become the standard on Conan 2.x 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 +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): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/openblas/config.yml b/recipes/openblas/config.yml index 6d0851b7920c3..e0275b7ea815a 100644 --- a/recipes/openblas/config.yml +++ b/recipes/openblas/config.yml @@ -1,4 +1,10 @@ versions: + "0.3.26": + folder: all + "0.3.25": + folder: all + "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 9973488d4454b..fb18864cacb8a 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 4cf35d30dea34..055db5ab3dbd9 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 ddfa9af0fec0a..0000000000000 --- 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 0000000000000..5084de84816a3 --- /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 0000000000000..ebda62599bb8f --- /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 0000000000000..8c42c0b9ae17f --- /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 21320b4482f5b..3f52809e46906 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 13290d598bb5f..9283a22ebe1e0 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 0000000000000..0d20897301b68 --- /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 0000000000000..13290d598bb5f --- /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 new file mode 100644 index 0000000000000..dccc1bdf6f829 --- /dev/null +++ b/recipes/opencl-clhpp-headers/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "2023.12.14": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2023.12.14.tar.gz" + sha256: "9106700634e79cfa0935ebd67197f64689ced24c42da702acf18fa8435bd8a82" + "2023.04.17": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2023.04.17.tar.gz" + sha256: "179243843c620ef6f78b52937aaaa0a742c6ff415f9aaefe3c20225ee283b357" + "2023.02.06": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2023.02.06.tar.gz" + sha256: "2726106df611fb5cb65503a52df27988d80c0b8844c8f0901c6092ab43701e8c" + "2022.09.30": + url: "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v2022.09.30.tar.gz" + sha256: "999dec3ebf451f0f1087e5e1b9a5af91434b4d0c496d47e912863ac85ad1e6b2" + "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/conanfile.py b/recipes/opencl-clhpp-headers/all/conanfile.py new file mode 100644 index 0000000000000..80288ec7b3f8d --- /dev/null +++ b/recipes/opencl-clhpp-headers/all/conanfile.py @@ -0,0 +1,78 @@ +from conan import ConanFile +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class OpenclClhppHeadersConan(ConanFile): + name = "opencl-clhpp-headers" + description = "C++ language headers for the OpenCL API" + license = "Apache-2.0" + topics = ("opencl", "header-only", "api-headers") + homepage = "https://github.com/KhronosGroup/OpenCL-CLHPP" + 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 _target_name(self): + return "OpenCL::HeadersCpp" + + 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 requirements(self): + self.requires(f"opencl-headers/{self.version}", transitive_headers=True) + + 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) + + def generate(self): + # 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), + {self._target_name: f"{self.name}::{self.name}"} + ) + + 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, "*", src=os.path.join(self.source_folder, "include", "CL"), dst=os.path.join(self.package_folder, "include", "CL")) + + @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", "OpenCLHeadersCpp") + self.cpp_info.set_property("cmake_target_name", self._target_name) + self.cpp_info.set_property("pkg_config_name", "OpenCL-CLHPP") + self.cpp_info.requires = ["opencl-headers::opencl-headers"] + 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"] = "OpenCLHeadersCpp" + self.cpp_info.filenames["cmake_find_package_multi"] = "OpenCLHeadersCpp" + 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/opencl-clhpp-headers/all/test_package/CMakeLists.txt b/recipes/opencl-clhpp-headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..733d421e88716 --- /dev/null +++ b/recipes/opencl-clhpp-headers/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +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/conanfile.py b/recipes/opencl-clhpp-headers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7f3268933acd2 --- /dev/null +++ b/recipes/opencl-clhpp-headers/all/test_package/conanfile.py @@ -0,0 +1,22 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout + + +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): + pass diff --git a/recipes/opencl-clhpp-headers/all/test_package/test_package.cpp b/recipes/opencl-clhpp-headers/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a1e2c103aae1a --- /dev/null +++ b/recipes/opencl-clhpp-headers/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#define CL_HPP_MINIMUM_OPENCL_VERSION 120 +#define CL_HPP_TARGET_OPENCL_VERSION 120 + +#ifdef USE_OPENCL_HPP +#include +#else +#include +#endif + +#include +#include + +int main() { + cl::Context context; + cl::Device device_id; + + (void) context; + (void) device_id; + + if (CL_VERSION_1_2 != 1) { + std::cerr << "Wrong OpenCL header version"; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/opencl-clhpp-headers/all/test_v1_package/CMakeLists.txt b/recipes/opencl-clhpp-headers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/opencl-clhpp-headers/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/opencl-clhpp-headers/all/test_v1_package/conanfile.py b/recipes/opencl-clhpp-headers/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..92704204c75e6 --- /dev/null +++ b/recipes/opencl-clhpp-headers/all/test_v1_package/conanfile.py @@ -0,0 +1,15 @@ +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): + pass diff --git a/recipes/opencl-clhpp-headers/config.yml b/recipes/opencl-clhpp-headers/config.yml new file mode 100644 index 0000000000000..33facd761b66c --- /dev/null +++ b/recipes/opencl-clhpp-headers/config.yml @@ -0,0 +1,23 @@ +versions: + "2023.12.14": + folder: all + "2023.04.17": + folder: all + "2023.02.06": + folder: all + "2022.09.30": + 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-headers/all/conandata.yml b/recipes/opencl-headers/all/conandata.yml index bc33b51742e45..c12029431ef1b 100644 --- a/recipes/opencl-headers/all/conandata.yml +++ b/recipes/opencl-headers/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2023.12.14": + url: "https://github.com/KhronosGroup/OpenCL-Headers/archive/refs/tags/v2023.12.14.tar.gz" + sha256: "407d5e109a70ec1b6cd3380ce357c21e3d3651a91caae6d0d8e1719c69a1791d" + "2023.04.17": + url: "https://github.com/KhronosGroup/OpenCL-Headers/archive/refs/tags/v2023.04.17.tar.gz" + sha256: "0ce992f4167f958f68a37918dec6325be18f848dee29a4521c633aae3304915d" + "2023.02.06": + url: "https://github.com/KhronosGroup/OpenCL-Headers/archive/refs/tags/v2023.02.06.tar.gz" + sha256: "464d1b04a5e185739065b2d86e4cebf02c154c416d63e6067a5060d7c053c79a" "2022.09.30": url: "https://github.com/KhronosGroup/OpenCL-Headers/archive/refs/tags/v2022.09.30.tar.gz" sha256: "0ae857ecb28af95a420c800b21ed2d0f437503e104f841ab8db249df5f4fbe5c" diff --git a/recipes/opencl-headers/all/conanfile.py b/recipes/opencl-headers/all/conanfile.py index dc0b6c90581c5..f2f779e3923da 100644 --- a/recipes/opencl-headers/all/conanfile.py +++ b/recipes/opencl-headers/all/conanfile.py @@ -1,7 +1,8 @@ from conan import ConanFile -from conan.tools.files import copy, get +from conan.tools.files import copy, get, save from conan.tools.layout import basic_layout import os +import textwrap required_conan_version = ">=1.50.0" @@ -17,6 +18,10 @@ class OpenclHeadersConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _target_name(self): + return "OpenCL::Headers" + def layout(self): basic_layout(self, src_folder="src") @@ -33,22 +38,37 @@ 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, "CL"), dst=os.path.join(self.package_folder, "include", "CL")) + 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) + + def generate(self): + # 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), + {self._target_name: f"{self.name}::{self.name}"} + ) + + @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", "OpenCLHeaders") - self.cpp_info.set_property("cmake_target_name", "OpenCL::Headers") - self.cpp_info.set_property("pkg_config_name", "OpenCL") + self.cpp_info.set_property("cmake_target_name", self._target_name) + self.cpp_info.set_property("pkg_config_name", "OpenCL-Headers") 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"] = "OpenCLHeaders" self.cpp_info.filenames["cmake_find_package_multi"] = "OpenCLHeaders" - self.cpp_info.names["cmake_find_package"] = "OpenCL" - self.cpp_info.names["cmake_find_package_multi"] = "OpenCL" - self.cpp_info.names["pkg_config"] = "OpenCL" - self.cpp_info.components["_opencl-headers"].names["cmake_find_package"] = "Headers" - self.cpp_info.components["_opencl-headers"].names["cmake_find_package_multi"] = "Headers" - self.cpp_info.components["_opencl-headers"].set_property("cmake_target_name", "OpenCL::Headers") - self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCL") - self.cpp_info.components["_opencl-headers"].bindirs = [] - self.cpp_info.components["_opencl-headers"].libdirs = [] + 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/opencl-headers/config.yml b/recipes/opencl-headers/config.yml index ce621bb7cdbe5..33facd761b66c 100644 --- a/recipes/opencl-headers/config.yml +++ b/recipes/opencl-headers/config.yml @@ -1,4 +1,10 @@ versions: + "2023.12.14": + folder: all + "2023.04.17": + folder: all + "2023.02.06": + folder: all "2022.09.30": folder: all "2022.05.18": diff --git a/recipes/opencl-icd-loader/all/conandata.yml b/recipes/opencl-icd-loader/all/conandata.yml index 398c17f249549..41da7d924af19 100644 --- a/recipes/opencl-icd-loader/all/conandata.yml +++ b/recipes/opencl-icd-loader/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2023.12.14": + url: "https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/refs/tags/v2023.12.14.tar.gz" + sha256: "af8df96f1e1030329e8d4892ba3aa761b923838d4c689ef52d97822ab0bd8917" + "2023.04.17": + url: "https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/refs/tags/v2023.04.17.tar.gz" + sha256: "173bdc4f321d550b6578ad2aafc2832f25fbb36041f095e6221025f74134b876" + "2023.02.06": + url: "https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/refs/tags/v2023.02.06.tar.gz" + sha256: "f31a932b470c1e115d6a858b25c437172809b939953dc1cf20a3a15e8785d698" "2022.09.30": url: "https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/refs/tags/v2022.09.30.tar.gz" sha256: "e9522fb736627dd4feae2a9c467a864e7d25bb715f808de8a04eea5a7d394b74" diff --git a/recipes/opencl-icd-loader/all/conanfile.py b/recipes/opencl-icd-loader/all/conanfile.py index c056a66cf0845..ae7aae3d17794 100644 --- a/recipes/opencl-icd-loader/all/conanfile.py +++ b/recipes/opencl-icd-loader/all/conanfile.py @@ -1,4 +1,5 @@ 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 apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime @@ -47,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) @@ -75,6 +77,8 @@ def package(self): cmake.install() rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) 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): self.cpp_info.set_property("cmake_find_mode", "both") 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 4c923ce588658..42b334ba331d4 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/opencl-icd-loader/config.yml b/recipes/opencl-icd-loader/config.yml index ee1b6d54f979e..59d020bde1e4e 100644 --- a/recipes/opencl-icd-loader/config.yml +++ b/recipes/opencl-icd-loader/config.yml @@ -1,4 +1,10 @@ versions: + "2023.12.14": + folder: all + "2023.04.17": + folder: all + "2023.02.06": + folder: all "2022.09.30": folder: all "2022.05.18": diff --git a/recipes/opencolorio/all/CMakeLists.txt b/recipes/opencolorio/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- a/recipes/opencolorio/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/opencolorio/all/conandata.yml b/recipes/opencolorio/all/conandata.yml index 23ef77f414ab2..a48a93147f585 100644 --- a/recipes/opencolorio/all/conandata.yml +++ b/recipes/opencolorio/all/conandata.yml @@ -1,4 +1,10 @@ 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" "2.1.0": url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.1.0.tar.gz" sha256: "81fc7853a490031632a69c73716bc6ac271b395e2ba0e2587af9995c2b0efb5f" @@ -6,13 +12,42 @@ 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" + patch_type: "conan" + - patch_file: "patches/2.2.1-0002-fix-pystring.patch" + patch_description: "fix include path for pystring" + patch_type: "conan" + - patch_file: "patches/2.2.1-0003-strlen.patch" + patch_description: "add std namespace for strlen" + patch_type: "portability" "2.1.0": - - patch_file: "patches/fix-cmake-source-dir-and-targets.patch" - base_path: "source_subfolder" - - patch_file: "patches/pstring.patch" - base_path: "source_subfolder" - - patch_file: "patches/strlen.patch" - base_path: "source_subfolder" + - patch_file: "patches/2.1.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.1.0-0002-fix-pystring.patch" + patch_description: "fix include path for pystring" + patch_type: "conan" + - patch_file: "patches/2.1.0-0003-strlen.patch" + patch_description: "include string.h for strlen" + patch_type: "portability" + - patch_file: "patches/2.1.0-0004-fix-cpp-version-check.patch" + patch_description: "fix C++20 compilation error" + patch_type: "portability" + patch_source: "https://github.com/AcademySoftwareFoundation/OpenColorIO/pull/1542" "1.1.1": - - patch_file: "patches/1.1.1.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.1.1-fix-cmake.patch" + patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" + patch_type: "conan" diff --git a/recipes/opencolorio/all/conanfile.py b/recipes/opencolorio/all/conanfile.py index 82c7ed3d43c8c..13719aad33361 100644 --- a/recipes/opencolorio/all/conanfile.py +++ b/recipes/opencolorio/all/conanfile.py @@ -1,10 +1,14 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc -from conans import ConanFile, CMake, tools -import functools +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, 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.45.0" - +required_conan_version = ">=1.53.0" class OpenColorIOConan(ConanFile): name = "opencolorio" @@ -13,7 +17,6 @@ class OpenColorIOConan(ConanFile): homepage = "https://opencolorio.org/" url = "https://github.com/conan-io/conan-center-index" topics = ("colors", "visual", "effects", "animation") - settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,20 +29,8 @@ class OpenColorIOConan(ConanFile): "use_sse": 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") - 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": @@ -49,96 +40,146 @@ 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("expat/2.4.8") - self.requires("openexr/2.5.7") - self.requires("yaml-cpp/0.7.0") - if tools.Version(self.version) < "2.0.0": + self.requires("expat/2.5.0") + if Version(self.version) < "2.2.0": + self.requires("openexr/2.5.7") + else: + self.requires("openexr/3.2.1") + self.requires("imath/3.1.9") + + 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.3") + self.requires("pystring/1.1.4") + self.requires("yaml-cpp/0.8.0") + + 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.13.1") + self.requires("lcms/2.14") # TODO: add GLUT (needed for ociodisplay tool) def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + 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 \ + not self.dependencies["minizip-ng"].options.get_safe("with_zlib", False): + raise ConanInvalidConfiguration(f"{self.ref} requires minizip-ng with with_zlib = True.") + + 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: + raise ConanInvalidConfiguration(f"{self.ref} requires static build minizip-ng") + + def build_requirements(self): + if Version(self.version) >= "2.2.0": + self.tool_requires("cmake/[>=3.16 <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) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - - if tools.Version(self.version) >= "2.1.0": - cmake.definitions["OCIO_BUILD_PYTHON"] = False + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_VERBOSE_MAKEFILE"] = True + if Version(self.version) >= "2.1.0": + tc.variables["OCIO_BUILD_PYTHON"] = False else: - cmake.definitions["OCIO_BUILD_SHARED"] = self.options.shared - cmake.definitions["OCIO_BUILD_STATIC"] = not self.options.shared - cmake.definitions["OCIO_BUILD_PYGLUE"] = False + tc.variables["OCIO_BUILD_SHARED"] = self.options.shared + tc.variables["OCIO_BUILD_STATIC"] = not self.options.shared + tc.variables["OCIO_BUILD_PYGLUE"] = False - cmake.definitions["USE_EXTERNAL_YAML"] = True - cmake.definitions["USE_EXTERNAL_TINYXML"] = True - cmake.definitions["USE_EXTERNAL_LCMS"] = True + tc.variables["USE_EXTERNAL_YAML"] = True + tc.variables["USE_EXTERNAL_TINYXML"] = True + tc.variables["TINYXML_OBJECT_LIB_EMBEDDED"] = False + tc.variables["USE_EXTERNAL_LCMS"] = True - cmake.definitions["OCIO_USE_SSE"] = self.options.get_safe("use_sse", False) + tc.variables["OCIO_USE_SSE"] = self.options.get_safe("use_sse", False) # openexr 2.x provides Half library - cmake.definitions["OCIO_USE_OPENEXR_HALF"] = True + tc.variables["OCIO_USE_OPENEXR_HALF"] = True - cmake.definitions["OCIO_BUILD_APPS"] = True - cmake.definitions["OCIO_BUILD_DOCS"] = False - cmake.definitions["OCIO_BUILD_TESTS"] = False - cmake.definitions["OCIO_BUILD_GPU_TESTS"] = False - cmake.definitions["OCIO_USE_BOOST_PTR"] = False + tc.variables["OCIO_BUILD_APPS"] = True + tc.variables["OCIO_BUILD_DOCS"] = False + tc.variables["OCIO_BUILD_TESTS"] = False + tc.variables["OCIO_BUILD_GPU_TESTS"] = False + tc.variables["OCIO_USE_BOOST_PTR"] = False # avoid downloading dependencies - cmake.definitions["OCIO_INSTALL_EXT_PACKAGE"] = "NONE" + tc.variables["OCIO_INSTALL_EXT_PACKAGE"] = "NONE" if is_msvc(self) and not self.options.shared: # define any value because ifndef is used - cmake.definitions["OpenColorIO_SKIP_IMPORTS"] = True + tc.variables["OpenColorIO_SKIP_IMPORTS"] = True + + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" + tc.generate() - cmake.configure(build_folder=self._build_subfolder) - return cmake + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) - for module in ("expat", "lcms2", "pystring", "yaml-cpp", "Imath"): - tools.remove_files_by_mask(os.path.join(self._source_subfolder, "share", "cmake", "modules"), "Find"+module+".cmake") + for module in ("expat", "lcms2", "pystring", "yaml-cpp", "Imath", "minizip-ng"): + rm(self, "Find"+module+".cmake", os.path.join(self.source_folder, "share", "cmake", "modules")) def build(self): self._patch_sources() - cm = self._configure_cmake() + cm = CMake(self) + cm.configure() cm.build() def package(self): - cm = self._configure_cmake() + cm = CMake(self) cm.install() if not self.options.shared: - self.copy("*", src=os.path.join(self.package_folder, - "lib", "static"), dst="lib") - tools.rmdir(os.path.join(self.package_folder, "lib", "static")) - - tools.rmdir(os.path.join(self.package_folder, "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "*", + src=os.path.join(self.package_folder, "lib", "static"), + dst=os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "static")) + + rmdir(self, 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, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) # nop for 2.x - tools.remove_files_by_mask(self.package_folder, "OpenColorIOConfig*.cmake") + rm(self, "OpenColorIOConfig*.cmake", self.package_folder) + + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + if Version(self.version) == "1.1.1": + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenColorIO") @@ -147,12 +188,14 @@ def package_info(self): self.cpp_info.libs = ["OpenColorIO"] - if tools.Version(self.version) < "2.1.0": + if Version(self.version) < "2.1.0": if not self.options.shared: self.cpp_info.defines.append("OpenColorIO_STATIC") - if self.settings.os == "Macos": + if is_apple_os(self): self.cpp_info.frameworks.extend(["Foundation", "IOKit", "ColorSync", "CoreGraphics"]) + if Version(self.version) == "2.1.0": + self.cpp_info.frameworks.extend(["Carbon", "CoreFoundation"]) if is_msvc(self) and not self.options.shared: self.cpp_info.defines.append("OpenColorIO_SKIP_IMPORTS") diff --git a/recipes/opencolorio/all/patches/1.1.1-fix-cmake.patch b/recipes/opencolorio/all/patches/1.1.1-fix-cmake.patch new file mode 100644 index 0000000000000..39c1981eda4b5 --- /dev/null +++ b/recipes/opencolorio/all/patches/1.1.1-fix-cmake.patch @@ -0,0 +1,287 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4f3119..9eb6d07 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,14 +1,16 @@ ++cmake_minimum_required(VERSION 2.8) + project(OpenColorIO) + set(OCIO_VERSION_MAJOR 1) + set(OCIO_VERSION_MINOR 1) + set(OCIO_VERSION_PATCH 1) + +-cmake_minimum_required(VERSION 2.8) +-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/share/cmake) ++list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/share/cmake) + if(NOT DEFINED CMAKE_FIRST_RUN) + SET(CMAKE_FIRST_RUN 1 CACHE INTERNAL "") + endif() + ++set(CMAKE_CXX_STANDARD 11) ++ + ############################################################################### + ### GLOBAL ### + +@@ -142,11 +144,11 @@ endif(CMAKE_COMPILER_IS_GNUCXX) + ############################################################################### + ### Python ### + +-OCIOFindPython() ++#OCIOFindPython() + + # Find Python, used for (possibly) building pyglue, and now to + # construct the external project path +-set(EXTDIST_ROOT ${CMAKE_BINARY_DIR}/ext/dist) ++set(EXTDIST_ROOT ${PROJECT_BINARY_DIR}/ext/dist) + set(EXTDIST_BINPATH ${EXTDIST_ROOT}/bin) + if(PYTHON_OK) + set(EXTDIST_PYTHONPATH ${EXTDIST_ROOT}/${PYTHON_VARIANT_PATH}) +@@ -170,7 +172,12 @@ messageonce("Setting EXTDIST_PYTHONPATH: ${EXTDIST_PYTHONPATH}") + + if(USE_EXTERNAL_TINYXML) + set(TINYXML_VERSION_MIN "2.6.1") +- find_package(TinyXML) ++ find_package(TinyXML REQUIRED) ++ set(TINYXML_FOUND ${TinyXML_FOUND}) ++ set(TINYXML_LIBRARIES tinyxml::tinyxml) ++ set(TINYXML_VERSION "${TinyXML_VERSION}") ++ list(APPEND EXTERNAL_LIBRARIES ${TINYXML_LIBRARIES}) ++ + if(TINYXML_FOUND) + if(TINYXML_VERSION VERSION_EQUAL ${TINYXML_VERSION_MIN} OR + TINYXML_VERSION VERSION_GREATER ${TINYXML_VERSION_MIN}) +@@ -251,6 +258,13 @@ endif(USE_EXTERNAL_TINYXML) + if(USE_EXTERNAL_YAML) + # Set minimum yaml version for non-patched sources. + set(YAML_VERSION_MIN "0.3.0") ++ find_package(yaml-cpp REQUIRED) ++ set(YAML_CPP_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_YAML-CPP}") ++ set(YAML_CPP_LIBRARIES yaml-cpp) ++ set(YAML_CPP_VERSION "${yaml-cpp_VERSION}") ++ list(APPEND EXTERNAL_LIBRARIES ${YAML_CPP_LIBRARIES}) ++ ++ if(0) + include(FindPkgConfig) + pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp) + find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h +@@ -293,6 +307,7 @@ if(USE_EXTERNAL_YAML) + else(YAML_CPP_FOUND) + message(FATAL_ERROR "ERROR: System yaml-cpp library was not found. Make sure the library is installed and the pkg-config file exists.") + endif(YAML_CPP_FOUND) ++ endif() + else(USE_EXTERNAL_YAML) ## provide 2 ways to build this dependency + set(YAML_CPP_VERSION 0.3.0) + set(YAML_CPP_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/ext/dist -DYAML_CPP_BUILD_TOOLS:BOOL=FALSE -DOCIO_INLINES_HIDDEN:BOOL=${OCIO_INLINES_HIDDEN}) +@@ -384,7 +399,7 @@ else() + set(OCIO_INLINES_HIDDEN OFF) + endif() + +-set(EXTERNAL_COMPILE_FLAGS "-DTIXML_USE_STL ${YAML_CPP_COMPILE_FLAGS} ${GCC_COMPILE_FLAGS}") ++set(EXTERNAL_COMPILE_FLAGS "${YAML_CPP_COMPILE_FLAGS} ${GCC_COMPILE_FLAGS}") + + set(EXTERNAL_LINK_FLAGS "") + set(EXTERNAL_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib) +@@ -460,7 +475,7 @@ endif() + if(OCIO_BUILD_APPS AND (OCIO_BUILD_STATIC OR OCIO_BUILD_SHARED) ) + + # Try to find OpenImageIO (OIIO) and OpenGL stuff +- OCIOFindOpenImageIO() ++ #OCIOFindOpenImageIO() + + if(OIIO_FOUND) + add_subdirectory(src/apps/ocioconvert) +@@ -528,7 +543,7 @@ endif() + + ############################################################################### + ### Configure env script ### +-configure_file(${CMAKE_SOURCE_DIR}/share/ocio/setup_ocio.sh.in ++configure_file(${PROJECT_SOURCE_DIR}/share/ocio/setup_ocio.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh @ONLY) + + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh DESTINATION share/ocio/) +@@ -597,7 +612,7 @@ if(TARGET OpenColorIO_STATIC) + endif() + endif() + install(EXPORT OpenColorIO DESTINATION cmake) +-file(WRITE "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" ++file(WRITE "${PROJECT_BINARY_DIR}/OpenColorIOConfig.cmake" + " + get_filename_component(OpenColorIO_DIR \"\${CMAKE_CURRENT_LIST_FILE}\" PATH) + +@@ -646,4 +661,4 @@ file(WRITE "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" + message(STATUS OPENCOLORIO_FOUND=\${OPENCOLORIO_FOUND}) + " + ) +-install(FILES "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION .) ++install(FILES "${PROJECT_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION .) +diff --git a/share/cmake/OCIOMacros.cmake b/share/cmake/OCIOMacros.cmake +index b9fb239..b1a206e 100644 +--- a/share/cmake/OCIOMacros.cmake ++++ b/share/cmake/OCIOMacros.cmake +@@ -356,9 +356,9 @@ ENDMACRO() + + MACRO(ExtractRstCPP INFILE OUTFILE) + add_custom_command( +- WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + OUTPUT ${OUTFILE} +- COMMAND ${PYTHON} ${CMAKE_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceCPP.py ${INFILE} ${OUTFILE} ++ COMMAND ${PYTHON} ${PROJECT_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceCPP.py ${INFILE} ${OUTFILE} + DEPENDS ${INFILE} + COMMENT "Extracting reStructuredText from ${INFILE} (using old process)" + ) +@@ -366,9 +366,9 @@ ENDMACRO() + + MACRO(ExtractRstSimple INFILE OUTFILE) + add_custom_command( +- WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + OUTPUT ${OUTFILE} +- COMMAND ${PYTHON} ${CMAKE_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceSimple.py ${INFILE} ${OUTFILE} ++ COMMAND ${PYTHON} ${PROJECT_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceSimple.py ${INFILE} ${OUTFILE} + DEPENDS ${INFILE} + COMMENT "Extracting reStructuredText from ${INFILE}" + ) +diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt +index d31b4e3..4aa1efb 100644 +--- a/src/apps/ociobakelut/CMakeLists.txt ++++ b/src/apps/ociobakelut/CMakeLists.txt +@@ -1,6 +1,10 @@ + # LCMS +-include(FindPkgConfig FindPackageMessage) +-pkg_check_modules(LCMS QUIET lcms2) ++find_package(lcms REQUIRED) ++set(LCMS_FOUND ${lcms_FOUND}) ++set(LCMS_VERSION ${lcms_VERSION}) ++set(LCMS_LIBRARIES ${lcms_LIBRARIES}) ++set(LCMS_INCLUDE_DIR ${lcms_INCLUDE_DIR}) ++ + if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATER 2.1)) + FIND_PACKAGE_MESSAGE(LCMS "Found lcms: ${LCMS_LIBRARIES}" + "${LCMS_INCLUDE_DIR}") +@@ -29,12 +33,12 @@ else() + set(LCMS_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lcms2${CMAKE_STATIC_LIBRARY_SUFFIX}) + endif() + +-file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") ++file(GLOB_RECURSE share_src_files "${PROJECT_SOURCE_DIR}/src/apps/share/*.cpp") + + include_directories( +- ${CMAKE_SOURCE_DIR}/export/ +- ${CMAKE_BINARY_DIR}/export/ +- ${CMAKE_SOURCE_DIR}/src/apps/share/ ++ ${PROJECT_SOURCE_DIR}/export/ ++ ${PROJECT_BINARY_DIR}/export/ ++ ${PROJECT_SOURCE_DIR}/src/apps/share/ + ${LCMS_INCLUDE_DIRS} + ${Boost_INCLUDE_DIR} + ) +diff --git a/src/apps/ociocheck/CMakeLists.txt b/src/apps/ociocheck/CMakeLists.txt +index 4955f4d..14b5017 100644 +--- a/src/apps/ociocheck/CMakeLists.txt ++++ b/src/apps/ociocheck/CMakeLists.txt +@@ -1,9 +1,9 @@ +-file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") ++file(GLOB_RECURSE share_src_files "${PROJECT_SOURCE_DIR}/src/apps/share/*.cpp") + + include_directories( +- ${CMAKE_SOURCE_DIR}/export/ +- ${CMAKE_BINARY_DIR}/export/ +- ${CMAKE_SOURCE_DIR}/src/apps/share/ ++ ${PROJECT_SOURCE_DIR}/export/ ++ ${PROJECT_BINARY_DIR}/export/ ++ ${PROJECT_SOURCE_DIR}/src/apps/share/ + ${Boost_INCLUDE_DIR} + ) + +diff --git a/src/core/CDLTransform.cpp b/src/core/CDLTransform.cpp +index 8b05deb..a7d6031 100644 +--- a/src/core/CDLTransform.cpp ++++ b/src/core/CDLTransform.cpp +@@ -126,7 +126,11 @@ OCIO_NAMESPACE_ENTER + TiXmlPrinter printer; + printer.SetStreamPrinting(); + doc.Accept( &printer ); +- return printer.Str(); ++ #ifdef TIXML_USE_STL ++ return printer.Str(); ++ #else ++ return printer.CStr(); ++ #endif + } + } + +diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt +index 1eb691b..a2f099a 100644 +--- a/src/core/CMakeLists.txt ++++ b/src/core/CMakeLists.txt +@@ -2,29 +2,29 @@ + ### OCIO CORE ### + + include_directories( +- ${CMAKE_SOURCE_DIR}/export/ +- ${CMAKE_BINARY_DIR}/export/ +- ${CMAKE_SOURCE_DIR}/ext/oiio/src/include ++ ${PROJECT_SOURCE_DIR}/export/ ++ ${PROJECT_BINARY_DIR}/export/ ++ ${PROJECT_SOURCE_DIR}/ext/oiio/src/include + ${EXTERNAL_INCLUDE_DIRS} + ) + +-file(GLOB_RECURSE core_src_files "${CMAKE_SOURCE_DIR}/src/core/*.cpp") +-file(GLOB_RECURSE core_export_headers "${CMAKE_SOURCE_DIR}/export/OpenColorIO/*.h") ++file(GLOB_RECURSE core_src_files "${PROJECT_SOURCE_DIR}/src/core/*.cpp") ++file(GLOB_RECURSE core_export_headers "${PROJECT_SOURCE_DIR}/export/OpenColorIO/*.h") + + message(STATUS "Create OpenColorABI.h from OpenColorABI.h.in") +-configure_file(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorABI.h.in +- ${CMAKE_BINARY_DIR}/export/OpenColorABI.h @ONLY) +-list(APPEND core_export_headers ${CMAKE_BINARY_DIR}/export/OpenColorABI.h) ++configure_file(${PROJECT_SOURCE_DIR}/export/OpenColorIO/OpenColorABI.h.in ++ ${PROJECT_BINARY_DIR}/export/OpenColorABI.h @ONLY) ++list(APPEND core_export_headers ${PROJECT_BINARY_DIR}/export/OpenColorABI.h) + + # Process all warnings as errors + + if(WIN32) + # On debug mode there are other kinds of warning... + if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") +- set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} /WX") ++ # set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} /WX") + endif() + else() +- set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -Werror") ++ # set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -Werror") + endif() + + # SHARED +@@ -75,7 +75,7 @@ endif() + # STATIC + + if(OCIO_BUILD_STATIC) +- list(REMOVE_ITEM core_src_files ${CMAKE_SOURCE_DIR}/src/core/UnitTest.cpp) ++ list(REMOVE_ITEM core_src_files ${PROJECT_SOURCE_DIR}/src/core/UnitTest.cpp) + add_library(OpenColorIO_STATIC STATIC ${EXTERNAL_OBJECTS} ${core_src_files}) + add_dependencies(OpenColorIO_STATIC TINYXML_LIB YAML_CPP_LIB) + if(EXTERNAL_LIBRARIES) +@@ -113,7 +113,7 @@ install(FILES ${core_export_headers} + + # pkg-config + message(STATUS "Create OpenColorIO.pc from OpenColorIO.pc.in") +-configure_file(${CMAKE_SOURCE_DIR}/export/pkgconfig/OpenColorIO.pc.in ++configure_file(${PROJECT_SOURCE_DIR}/export/pkgconfig/OpenColorIO.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc + DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/lib${LIB_SUFFIX}/pkgconfig/) +diff --git a/src/core/OCIOYaml.cpp b/src/core/OCIOYaml.cpp +index 68fcef6..a1c1c1d 100644 +--- a/src/core/OCIOYaml.cpp ++++ b/src/core/OCIOYaml.cpp +@@ -1442,7 +1442,7 @@ OCIO_NAMESPACE_ENTER + #ifdef OLDYAML + if(node.FindValue("ocio_profile_version") == NULL) + #else +- if(node["ocio_profile_version"] == NULL) ++ if(node["ocio_profile_version"].IsNull()) + #endif + { + std::ostringstream os; diff --git a/recipes/opencolorio/all/patches/2.1.0-0001-fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/2.1.0-0001-fix-cmake-source-dir-and-targets.patch new file mode 100644 index 0000000000000..5de7b145077d6 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.1.0-0001-fix-cmake-source-dir-and-targets.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b0840ac..e4875ab 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,9 +9,9 @@ cmake_minimum_required(VERSION 3.12) + + set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} +- ${CMAKE_SOURCE_DIR}/share/cmake/utils +- ${CMAKE_SOURCE_DIR}/share/cmake/macros +- ${CMAKE_SOURCE_DIR}/share/cmake/modules ++ ${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/utils ++ ${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/macros ++ ${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/modules + ) + + set(CMAKE_WARN_DEPRECATED ON) +@@ -272,7 +272,7 @@ else() + set(OCIO_SETUP_NAME setup_ocio.sh) + endif() + +-configure_file(${CMAKE_SOURCE_DIR}/share/ocio/${OCIO_SETUP_NAME}.in ++configure_file(${PROJECT_SOURCE_DIR}/share/ocio/${OCIO_SETUP_NAME}.in + ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/${OCIO_SETUP_NAME} @ONLY) + + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/${OCIO_SETUP_NAME} DESTINATION share/ocio/) +diff --git a/share/cmake/modules/FindExtPackages.cmake b/share/cmake/modules/FindExtPackages.cmake +index 86a0225..73d8599 100644 +--- a/share/cmake/modules/FindExtPackages.cmake ++++ b/share/cmake/modules/FindExtPackages.cmake +@@ -50,7 +50,7 @@ else() + + # OpenEXR/IlmBase (<=2.5) + # https://github.com/AcademySoftwareFoundation/openexr +- find_package(Half 2.4.0 REQUIRED) ++ find_package(OpenEXR 2.4.0 REQUIRED) + + set(OCIO_HALF_LIB IlmBase::Half CACHE STRING "Half library target" FORCE) + set(OCIO_USE_IMATH_HALF "0" CACHE STRING "Whether 'half' type will be sourced from the Imath library (>=v3.0)" FORCE) +@@ -65,7 +65,7 @@ if(OCIO_BUILD_APPS) + + # lcms2 + # https://github.com/mm2/Little-CMS +- find_package(lcms2 2.2 REQUIRED) ++ find_package(lcms 2.2 REQUIRED) + endif() + + if(OCIO_BUILD_OPENFX) +diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt +index 7eb1cd8..de13607 100755 +--- a/src/apps/ociobakelut/CMakeLists.txt ++++ b/src/apps/ociobakelut/CMakeLists.txt +@@ -35,7 +35,7 @@ set_target_properties(ociobakelut + target_link_libraries(ociobakelut + PRIVATE + apputils +- lcms2::lcms2 ++ lcms::lcms + OpenColorIO + ) + diff --git a/recipes/opencolorio/all/patches/2.1.0-0002-fix-pystring.patch b/recipes/opencolorio/all/patches/2.1.0-0002-fix-pystring.patch new file mode 100644 index 0000000000000..38f15d7e20889 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.1.0-0002-fix-pystring.patch @@ -0,0 +1,117 @@ +diff --git a/src/OpenColorIO/Context.cpp b/src/OpenColorIO/Context.cpp +index 26fdcbee..9ddb4522 100644 +--- a/src/OpenColorIO/Context.cpp ++++ b/src/OpenColorIO/Context.cpp +@@ -14,7 +14,7 @@ + #include "Mutex.h" + #include "PathUtils.h" + #include "PrivateTypes.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + +diff --git a/src/OpenColorIO/OCIOYaml.cpp b/src/OpenColorIO/OCIOYaml.cpp +index 67cafdf1..744fb817 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/Op.cpp b/src/OpenColorIO/Op.cpp +index ebbba040..08db0f68 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 7ed5e9e8..e71d03d9 100644 +--- a/src/OpenColorIO/PathUtils.cpp ++++ b/src/OpenColorIO/PathUtils.cpp +@@ -10,7 +10,7 @@ + + #include "Mutex.h" + #include "PathUtils.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + #if !defined(_WIN32) +diff --git a/src/OpenColorIO/fileformats/FileFormatCTF.cpp b/src/OpenColorIO/fileformats/FileFormatCTF.cpp +index 89c13066..648aabc0 100644 +--- a/src/OpenColorIO/fileformats/FileFormatCTF.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatCTF.cpp +@@ -22,7 +22,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 a52bc728..bd827f06 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 df86206e..b6983cf6 100755 +--- a/src/OpenColorIO/fileformats/FileFormatICC.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatICC.cpp +@@ -12,7 +12,7 @@ + #include "ops/gamma/GammaOp.h" + #include "ops/lut1d/Lut1DOp.h" + #include "ops/matrix/MatrixOp.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 0f83f5b3..d6ee59de 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" + +diff --git a/src/OpenColorIO/transforms/FileTransform.cpp b/src/OpenColorIO/transforms/FileTransform.cpp +index 4f6ea887..97621959 100755 +--- a/src/OpenColorIO/transforms/FileTransform.cpp ++++ b/src/OpenColorIO/transforms/FileTransform.cpp +@@ -17,7 +17,7 @@ + #include "ops/noop/NoOps.h" + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + diff --git a/recipes/opencolorio/all/patches/2.1.0-0003-strlen.patch b/recipes/opencolorio/all/patches/2.1.0-0003-strlen.patch new file mode 100644 index 0000000000000..b90bcdfcf5d57 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.1.0-0003-strlen.patch @@ -0,0 +1,12 @@ +diff --git a/src/OpenColorIO/FileRules.cpp b/src/OpenColorIO/FileRules.cpp +index 794dfdbe..94729459 100644 +--- a/src/OpenColorIO/FileRules.cpp ++++ b/src/OpenColorIO/FileRules.cpp +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/recipes/opencolorio/all/patches/2.1.0-0004-fix-cpp-version-check.patch b/recipes/opencolorio/all/patches/2.1.0-0004-fix-cpp-version-check.patch new file mode 100644 index 0000000000000..50d9ce38deeed --- /dev/null +++ b/recipes/opencolorio/all/patches/2.1.0-0004-fix-cpp-version-check.patch @@ -0,0 +1,18 @@ +diff --git a/share/cmake/utils/CppVersion.cmake b/share/cmake/utils/CppVersion.cmake +index aeca6c0..6b4dc4e 100644 +--- a/share/cmake/utils/CppVersion.cmake ++++ b/share/cmake/utils/CppVersion.cmake +@@ -12,11 +12,11 @@ if(NOT DEFINED CMAKE_CXX_STANDARD) + message(STATUS "Setting C++ version to '11' as none was specified.") + set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to compile against") + elseif(NOT CMAKE_CXX_STANDARD IN_LIST SUPPORTED_CXX_STANDARDS) +- message(FATAL_ERROR ++ message(WARNING + "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}") ++#set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") + + include(CheckCXXCompilerFlag) + 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 new file mode 100644 index 0000000000000..b4e6f3c13f990 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch @@ -0,0 +1,105 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 17e188d..91af0ec 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -332,7 +332,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 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 REQUIRED) + + if(OCIO_BUILD_APPS) + +@@ -149,7 +149,7 @@ if(OCIO_BUILD_APPS) + + # lcms2 + # https://github.com/mm2/Little-CMS +- find_package(lcms2 2.2 REQUIRED) ++ find_package(lcms REQUIRED) + endif() + + if(OCIO_BUILD_OPENFX) +@@ -214,7 +214,7 @@ if(OCIO_BUILD_APPS) + # OpenEXR + # https://github.com/AcademySoftwareFoundation/openexr + set(_OpenEXR_ExternalProject_VERSION "3.1.5") +- find_package(OpenEXR 3.0) ++ find_package(OpenEXR CONFIG) + + if(OpenEXR_FOUND AND TARGET OpenEXR::OpenEXR) + add_library(OpenColorIO::ImageIOBackend ALIAS OpenEXR::OpenEXR) +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 1c4d774..da70227 100755 +--- a/src/OpenColorIO/CMakeLists.txt ++++ b/src/OpenColorIO/CMakeLists.txt +@@ -289,7 +289,7 @@ target_link_libraries(OpenColorIO + "$" + "$" + yaml-cpp +- MINIZIP::minizip-ng ++ MINIZIP::minizip + ) + + if(APPLE) +diff --git a/src/apps/ocioarchive/CMakeLists.txt b/src/apps/ocioarchive/CMakeLists.txt +index 6b868d1..820e36c 100644 +--- a/src/apps/ocioarchive/CMakeLists.txt ++++ b/src/apps/ocioarchive/CMakeLists.txt +@@ -19,7 +19,7 @@ target_link_libraries(ocioarchive + PRIVATE + apputils + OpenColorIO +- MINIZIP::minizip-ng ++ MINIZIP::minizip + ) + + install(TARGETS ocioarchive +diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt +index a50e87e..37174ea 100755 +--- a/src/apps/ociobakelut/CMakeLists.txt ++++ b/src/apps/ociobakelut/CMakeLists.txt +@@ -28,7 +28,7 @@ set_target_properties(ociobakelut + target_link_libraries(ociobakelut + PRIVATE + apputils +- lcms2::lcms2 ++ lcms::lcms + OpenColorIO + ) + diff --git a/recipes/opencolorio/all/patches/2.2.1-0002-fix-pystring.patch b/recipes/opencolorio/all/patches/2.2.1-0002-fix-pystring.patch new file mode 100644 index 0000000000000..fc58ce5a2da84 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.2.1-0002-fix-pystring.patch @@ -0,0 +1,163 @@ +diff --git a/src/OpenColorIO/Config.cpp b/src/OpenColorIO/Config.cpp +index 665d522..6abc149 100644 +--- a/src/OpenColorIO/Config.cpp ++++ b/src/OpenColorIO/Config.cpp +@@ -33,7 +33,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 85fc7bb..4cd1448 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" + +@@ -630,4 +630,4 @@ void CIOPOciozArchive::buildEntries() + getEntriesMappingFromArchiveFile(m_archiveAbsPath, m_entries); + } + +-} // namespace OCIO_NAMESPACE +\ No newline at end of file ++} // namespace OCIO_NAMESPACE +diff --git a/src/OpenColorIO/Op.cpp b/src/OpenColorIO/Op.cpp +index 1ae607a..bb5406f 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 786c8a5..4953103 100755 +--- a/src/OpenColorIO/fileformats/FileFormatICC.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatICC.cpp +@@ -14,7 +14,7 @@ + #include "ops/lut1d/Lut1DOp.h" + #include "ops/matrix/MatrixOp.h" + #include "ops/range/RangeOp.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/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/all/patches/2.2.1-0003-strlen.patch b/recipes/opencolorio/all/patches/2.2.1-0003-strlen.patch new file mode 100644 index 0000000000000..b694178bdf977 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.2.1-0003-strlen.patch @@ -0,0 +1,13 @@ +diff --git a/src/OpenColorIO/FileRules.cpp b/src/OpenColorIO/FileRules.cpp +index 61a5e0f..e0df0d0 100644 +--- a/src/OpenColorIO/FileRules.cpp ++++ b/src/OpenColorIO/FileRules.cpp +@@ -62,7 +62,7 @@ std::string ConvertToRegularExpression(const char * globPattern, bool ignoreCase + + if (ignoreCase) + { +- const size_t length = strlen(globPattern); ++ const size_t length = std::strlen(globPattern); + bool respectCase = false; + for (size_t i = 0; i < length; ++i) + { 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 0000000000000..30c7ddf4a390d --- /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 0000000000000..020aa7dccfebc --- /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/all/test_package/CMakeLists.txt b/recipes/opencolorio/all/test_package/CMakeLists.txt index 074c63fccc550..825fa34216bd6 100644 --- a/recipes/opencolorio/all/test_package/CMakeLists.txt +++ b/recipes/opencolorio/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(OpenColorIO REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} OpenColorIO::OpenColorIO) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenColorIO::OpenColorIO) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/opencolorio/all/test_package/conanfile.py b/recipes/opencolorio/all/test_package/conanfile.py index 38f4483872d47..a9fb96656f203 100644 --- a/recipes/opencolorio/all/test_package/conanfile.py +++ b/recipes/opencolorio/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/opencolorio/all/test_v1_package/CMakeLists.txt b/recipes/opencolorio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/opencolorio/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/opencolorio/all/test_v1_package/conanfile.py b/recipes/opencolorio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/opencolorio/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/opencolorio/config.yml b/recipes/opencolorio/config.yml index 1f2bc2497ef89..89be14d13a1d0 100644 --- a/recipes/opencolorio/config.yml +++ b/recipes/opencolorio/config.yml @@ -1,4 +1,8 @@ versions: + "2.3.0": + folder: "all" + "2.2.1": + folder: "all" "2.1.0": folder: "all" "1.1.1": diff --git a/recipes/opencore-amr/all/conandata.yml b/recipes/opencore-amr/all/conandata.yml index 44a009a38d2e0..8ac0f24717894 100644 --- a/recipes/opencore-amr/all/conandata.yml +++ b/recipes/opencore-amr/all/conandata.yml @@ -5,3 +5,12 @@ sources: "0.1.5": url: "https://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz" sha256: "2c006cb9d5f651bfb5e60156dbff6af3c9d35c7bbcc9015308c0aff1e14cd341" +patches: + "0.1.6": + - patch_file: "patches/0001-remove-deprecated-register-keyword.patch" + patch_description: "remove deprecated register keyword" + patch_type: "portability" + "0.1.5": + - patch_file: "patches/0001-remove-deprecated-register-keyword.patch" + patch_description: "remove deprecated register keyword" + patch_type: "portability" diff --git a/recipes/opencore-amr/all/conanfile.py b/recipes/opencore-amr/all/conanfile.py index 3c1ebbcb2a163..c502c5b4aa5f7 100644 --- a/recipes/opencore-amr/all/conanfile.py +++ b/recipes/opencore-amr/all/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile -from conan.tools import files -from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version -from conans import AutoToolsBuildEnvironment -from conans.tools import environment_append, get_env, os_info, vcvars, unix_path -from contextlib import contextmanager +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import Environment, VirtualBuildEnv +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.microsoft import check_min_vs, is_msvc, unix_path import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.54.0" class OpencoreAmrConan(ConanFile): @@ -17,6 +17,7 @@ class OpencoreAmrConan(ConanFile): topics = ("audio-codec", "amr", "opencore") url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" + package_type = "library" settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], @@ -27,82 +28,83 @@ class OpencoreAmrConan(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 + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): - if self._settings_build.os == "Windows" and not get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_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") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - files.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @contextmanager - def _build_context(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.extend([ + "--disable-compile-c", + "--disable-examples", + ]) if is_msvc(self): - with vcvars(self): - env = { - "CC": "cl -nologo", - "CXX": "cl -nologo", - "LD": "link -nologo", - "AR": "{} lib".format(unix_path(self.deps_user_info["automake"].ar_lib)), - } - with environment_append(env): - yield - else: - yield - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment( - self, win_bash=os_info.is_windows) - - def yes_no(v): return "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] + tc.extra_cxxflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cxxflags.append("-FS") + tc.generate() + if is_msvc(self): - self._autotools.cxx_flags.append("-EHsc") - if Version(self.settings.compiler.version) >= "12": - self._autotools.flags.append("-FS") - self._autotools.configure( - args=args, configure_dir=self._source_subfolder) - return self._autotools + 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 build(self): - with self._build_context(): - self._configure_autotools() - self._autotools.make() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self._autotools.install() - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - files.rm(self, "*.la", os.path.join(self.package_folder, "lib")) - files.rmdir(self, os.path.join( - self.package_folder, "lib", "pkgconfig")) - if self.settings.compiler == "Visual Studio" and self.options.shared: + copy(self, pattern="LICENSE", src=self.source_folder, dst=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")) + + fix_apple_shared_install_name(self) + + if is_msvc(self) and self.options.shared: for lib in ("opencore-amrwb", "opencore-amrnb"): - files.rename(self, os.path.join(self.package_folder, "lib", "{}.dll.lib".format(lib)), + rename(self, os.path.join(self.package_folder, "lib", "{}.dll.lib".format(lib)), os.path.join(self.package_folder, "lib", "{}.lib".format(lib))) def package_info(self): @@ -114,5 +116,8 @@ def package_info(self): "cmake_target_name", f'opencore-amr::{lib}') self.cpp_info.components[lib].set_property("pkg_config_name", lib) self.cpp_info.components[lib].libs = [lib] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components[lib].system_libs.extend(["m"]) + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generator removed self.cpp_info.components[lib].names["pkg_config"] = lib diff --git a/recipes/opencore-amr/all/patches/0001-remove-deprecated-register-keyword.patch b/recipes/opencore-amr/all/patches/0001-remove-deprecated-register-keyword.patch new file mode 100644 index 0000000000000..8604cff0abf61 --- /dev/null +++ b/recipes/opencore-amr/all/patches/0001-remove-deprecated-register-keyword.patch @@ -0,0 +1,1357 @@ +From 8fa46c7a3092186e922ed27e9b38d79caf178f36 Mon Sep 17 00:00:00 2001 +From: Gregor Jasny +Date: Mon, 19 Jun 2023 20:41:15 +0200 +Subject: [PATCH] remove deprecated register keyword + +--- + .../common/include/basic_op_arm_gcc_v5.h | 62 ++++++------ + .../common/include/basic_op_c_equivalent.h | 10 +- + .../gsm_amr/amr_nb/common/include/l_add.h | 8 +- + .../gsm_amr/amr_nb/common/include/l_mac.h | 6 +- + .../gsm_amr/amr_nb/common/include/l_msu.h | 6 +- + .../gsm_amr/amr_nb/common/include/l_mult.h | 6 +- + .../gsm_amr/amr_nb/common/include/l_sub.h | 8 +- + .../gsm_amr/amr_nb/common/include/mpy_32.h | 14 +-- + .../gsm_amr/amr_nb/common/include/mpy_32_16.h | 6 +- + .../gsm_amr/amr_nb/common/include/mult.h | 6 +- + .../gsm_amr/amr_nb/common/include/negate.h | 2 +- + .../gsm_amr/amr_nb/common/include/norm_l.h | 4 +- + .../gsm_amr/amr_nb/common/include/norm_s.h | 4 +- + .../gsm_amr/amr_nb/common/src/az_lsp.cpp | 8 +- + .../audio/gsm_amr/amr_nb/common/src/div_s.cpp | 4 +- + .../gsm_amr/amr_nb/common/src/gc_pred.cpp | 8 +- + .../gsm_amr/amr_nb/common/src/gmed_n.cpp | 6 +- + .../audio/gsm_amr/amr_nb/common/src/l_abs.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/l_shr_r.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/lsp_az.cpp | 8 +- + .../gsm_amr/amr_nb/common/src/mult_r.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/negate.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/norm_l.cpp | 4 +- + .../gsm_amr/amr_nb/common/src/norm_s.cpp | 4 +- + .../gsm_amr/amr_nb/common/src/pred_lt.cpp | 6 +- + .../gsm_amr/amr_nb/common/src/q_plsf_3.cpp | 6 +- + .../gsm_amr/amr_nb/common/src/residu.cpp | 2 +- + .../audio/gsm_amr/amr_nb/common/src/round.cpp | 2 +- + .../audio/gsm_amr/amr_nb/common/src/shr.cpp | 4 +- + .../audio/gsm_amr/amr_nb/common/src/shr_r.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/weight_a.cpp | 2 +- + .../audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp | 2 +- + .../audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp | 2 +- + .../audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp | 6 +- + .../audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp | 8 +- + .../audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp | 4 +- + .../audio/gsm_amr/amr_nb/enc/src/autocorr.cpp | 6 +- + .../audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp | 24 ++--- + .../audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/convolve.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/cor_h.cpp | 4 +- + .../audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp | 6 +- + .../audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp | 6 +- + .../audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp | 6 +- + .../audio/gsm_amr/amr_nb/enc/src/l_negate.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/levinson.cpp | 10 +- + .../audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/set_sign.cpp | 2 +- + .../gsm_amr/amr_wb/dec/src/normalize_amr_wb.h | 4 +- + .../amr_wb/dec/src/pvamrwb_math_op.cpp | 2 +- + .../src/pvamrwbdecoder_basic_op_gcc_armv5.h | 98 +++++++++---------- + 52 files changed, 208 insertions(+), 208 deletions(-) + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h +index 5752171..2c93015 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h +@@ -112,10 +112,10 @@ extern "C" + L_sum = 32-bit sum of L_var1 and L_var2 (Word32) + */ + +- static inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) ++ static inline Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -151,8 +151,8 @@ extern "C" + */ + static inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -190,9 +190,9 @@ extern "C" + */ + static inline Word32 L_mac(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = L_var3; +- register Word32 rb = var1; +- register Word32 rc = var2; ++ Word32 ra = L_var3; ++ Word32 rb = var1; ++ Word32 rc = var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -234,8 +234,8 @@ extern "C" + + static inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = var1; +- register Word32 rb = var2; ++ Word32 ra = var1; ++ Word32 rb = var2; + Word32 result; + Word32 product; + +@@ -279,9 +279,9 @@ extern "C" + */ + static inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = L_var3; +- register Word32 rb = var1; +- register Word32 rc = var2; ++ Word32 ra = L_var3; ++ Word32 rb = var1; ++ Word32 rc = var2; + Word32 product; + Word32 result; + +@@ -326,13 +326,13 @@ extern "C" + Word16 L_var2_lo, + Flag *pOverflow) + { +- register Word32 product32; +- register Word32 L_sum; +- register Word32 L_product, result; +- register Word32 ra = L_var1_hi; +- register Word32 rb = L_var1_lo; +- register Word32 rc = L_var2_hi; +- register Word32 rd = L_var2_lo; ++ Word32 product32; ++ Word32 L_sum; ++ Word32 L_product, result; ++ Word32 ra = L_var1_hi; ++ Word32 rb = L_var1_lo; ++ Word32 rc = L_var2_hi; ++ Word32 rd = L_var2_lo; + + + +@@ -410,9 +410,9 @@ extern "C" + Flag *pOverflow) + { + +- register Word32 ra = L_var1_hi; +- register Word32 rb = L_var1_lo; +- register Word32 rc = var2; ++ Word32 ra = L_var1_hi; ++ Word32 rb = L_var1_lo; ++ Word32 rc = var2; + Word32 result, L_product; + + OSCL_UNUSED_ARG(pOverflow); +@@ -470,8 +470,8 @@ extern "C" + */ + static inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = var1; +- register Word32 rb = var2; ++ Word32 ra = var1; ++ Word32 rb = var2; + Word32 product; + Word32 temp; + +@@ -494,9 +494,9 @@ extern "C" + + static inline Word32 amrnb_fxp_mac_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; +- register Word32 rc = L_var3; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; ++ Word32 rc = L_var3; + Word32 result; + + __asm__ volatile("smlabb %0, %1, %2, %3" +@@ -508,9 +508,9 @@ extern "C" + + static inline Word32 amrnb_fxp_msu_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; +- register Word32 rc = L_var3; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; ++ Word32 rc = L_var3; + Word32 result; + + __asm__ volatile("rsb %0, %1, #0" +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h +index 62072a5..d56ecd0 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h +@@ -109,7 +109,7 @@ extern "C" + Returns: + L_sum = 32-bit sum of L_var1 and L_var2 (Word32) + */ +- static inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) ++ static inline Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { + Word32 L_sum; + +@@ -148,8 +148,8 @@ extern "C" + Returns: + L_diff = 32-bit difference of L_var1 and L_var2 (Word32) + */ +- static inline Word32 L_sub(register Word32 L_var1, register Word32 L_var2, +- register Flag *pOverflow) ++ static inline Word32 L_sub(Word32 L_var1, Word32 L_var2, ++ Flag *pOverflow) + { + Word32 L_diff; + +@@ -240,7 +240,7 @@ extern "C" + */ + static inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 L_product; ++ Word32 L_product; + + L_product = (Word32) var1 * var2; + +@@ -446,7 +446,7 @@ extern "C" + */ + static inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 product; ++ Word32 product; + + product = ((Word32) var1 * var2) >> 15; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h +index ac72c31..fc849a5 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h +@@ -88,10 +88,10 @@ extern "C" + ; Function Prototype declaration + ----------------------------------------------------------------------------*/ + #if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/ +- __inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) ++ __inline Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -107,7 +107,7 @@ extern "C" + #else /* C EQUIVALENT */ + + +- static inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) ++ static inline Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { + Word32 L_sum; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h +index f672428..173e1dd 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h +@@ -90,9 +90,9 @@ extern "C" + + static inline Word32 L_mac(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = L_var3; +- register Word32 rb = var1; +- register Word32 rc = var2; ++ Word32 ra = L_var3; ++ Word32 rb = var1; ++ Word32 rc = var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h +index 86c5735..de07525 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h +@@ -92,9 +92,9 @@ extern "C" + + __inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = L_var3; +- register Word32 rb = var1; +- register Word32 rc = var2; ++ Word32 ra = L_var3; ++ Word32 rb = var1; ++ Word32 rc = var2; + Word32 product; + Word32 result; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h +index 33fedb1..5531509 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h +@@ -91,8 +91,8 @@ extern "C" + + __inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = var1; +- register Word32 rb = var2; ++ Word32 ra = var1; ++ Word32 rb = var2; + Word32 result; + Word32 product; + +@@ -115,7 +115,7 @@ extern "C" + + static inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 L_product; ++ Word32 L_product; + + L_product = (Word32) var1 * var2; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h +index 88d86ca..ef83f1c 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h +@@ -93,8 +93,8 @@ extern "C" + + __inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -109,8 +109,8 @@ extern "C" + + #else /* C EQUIVALENT */ + +- static inline Word32 L_sub(register Word32 L_var1, register Word32 L_var2, +- register Flag *pOverflow) ++ static inline Word32 L_sub(Word32 L_var1, Word32 L_var2, ++ Flag *pOverflow) + { + Word32 L_diff; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h +index 8df43c9..83505f4 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h +@@ -96,13 +96,13 @@ extern "C" + Word16 L_var2_lo, + Flag *pOverflow) + { +- register Word32 product32; +- register Word32 L_sum; +- register Word32 L_product, result; +- register Word32 ra = L_var1_hi; +- register Word32 rb = L_var1_lo; +- register Word32 rc = L_var2_hi; +- register Word32 rd = L_var2_lo; ++ Word32 product32; ++ Word32 L_sum; ++ Word32 L_product, result; ++ Word32 ra = L_var1_hi; ++ Word32 rb = L_var1_lo; ++ Word32 rc = L_var2_hi; ++ Word32 rd = L_var2_lo; + + + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h +index 3a68e69..4eaa732 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h +@@ -96,9 +96,9 @@ extern "C" + Flag *pOverflow) + { + +- register Word32 ra = L_var1_hi; +- register Word32 rb = L_var1_lo; +- register Word32 rc = var2; ++ Word32 ra = L_var1_hi; ++ Word32 rb = L_var1_lo; ++ Word32 rc = var2; + Word32 result, L_product; + + OSCL_UNUSED_ARG(pOverflow); +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h +index c89a94e..c2ebf9a 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h +@@ -89,8 +89,8 @@ extern "C" + + __inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = var1; +- register Word32 rb = var2; ++ Word32 ra = var1; ++ Word32 rb = var2; + Word32 product; + Word32 temp = 0x7FFF; + +@@ -120,7 +120,7 @@ extern "C" + + static inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 product; ++ Word32 product; + + product = ((Word32) var1 * var2) >> 15; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/negate.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/negate.h +index 2b77f77..3ff7347 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/negate.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/negate.h +@@ -86,7 +86,7 @@ extern "C" + ; GLOBAL FUNCTION DEFINITIONS + ; Function Prototype declaration + ----------------------------------------------------------------------------*/ +- Word16 negate(register Word16 var1); ++ Word16 negate(Word16 var1); + + /*---------------------------------------------------------------------------- + ; END +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h +index 288b6c7..d3de69f 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h +@@ -91,8 +91,8 @@ extern "C" + #if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) + static inline Word16 norm_l(Word32 L_var1) + { +- register Word32 var_out = 0; +- register Word32 ra = L_var1; ++ Word32 var_out = 0; ++ Word32 ra = L_var1; + if (L_var1) + { + ra ^= (ra << 1); +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h +index 7847f34..e7865f8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h +@@ -91,8 +91,8 @@ extern "C" + #if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) + static inline Word16 norm_s(Word16 var1) + { +- register Word32 var_out = 0; +- register Word32 ra = var1 << 16; ++ Word32 var_out = 0; ++ Word32 ra = var1 << 16; + if (ra) + { + ra ^= (ra << 1); +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp +index 7711ac9..b3194aa 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp +@@ -489,10 +489,10 @@ void Az_lsp( + Flag *pOverflow /* (i/o): overflow flag */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 nf; +- register Word16 ip; ++ Word16 i; ++ Word16 j; ++ Word16 nf; ++ Word16 ip; + Word16 xlow; + Word16 ylow; + Word16 xhigh; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/div_s.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/div_s.cpp +index f60f18b..40667eb 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/div_s.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/div_s.cpp +@@ -165,13 +165,13 @@ Word16 div_s (Word16 var1, Word16 var2) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word16 div_s(register Word16 var1, register Word16 var2) ++OSCL_EXPORT_REF Word16 div_s(Word16 var1, Word16 var2) + { + /*---------------------------------------------------------------------------- + ; Define all local variables + ----------------------------------------------------------------------------*/ + Word16 var_out = 0; +- register Word16 iteration; ++ Word16 iteration; + Word32 L_num; + Word32 L_denom; + Word32 L_denom_by_2; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp +index 71519e9..198cccc 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp +@@ -445,9 +445,9 @@ OSCL_EXPORT_REF void gc_pred( + Flag *pOverflow + ) + { +- register Word16 i; +- register Word32 L_temp1, L_temp2; +- register Word32 L_tmp; ++ Word16 i; ++ Word32 L_temp1, L_temp2; ++ Word32 L_tmp; + Word32 ener_code; + Word32 ener; + Word16 exp, frac; +@@ -929,7 +929,7 @@ OSCL_EXPORT_REF void gc_pred_average_limited( + ) + { + Word16 av_pred_en; +- register Word16 i; ++ Word16 i; + + /* do average in MR122 mode (log2() domain) */ + av_pred_en = 0; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gmed_n.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gmed_n.cpp +index a723ce4..e15549f 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gmed_n.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gmed_n.cpp +@@ -154,9 +154,9 @@ OSCL_EXPORT_REF Word16 gmed_n( /* o : the median value */ + Word16 n /* i : number of inputs */ + ) + { +- register Word16 i, j, ix = 0; +- register Word16 max; +- register Word16 medianIndex; ++ Word16 i, j, ix = 0; ++ Word16 max; ++ Word16 medianIndex; + Word16 tmp[NMAX]; + Word16 tmp2[NMAX]; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_abs.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_abs.cpp +index e436006..8f167c3 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_abs.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_abs.cpp +@@ -143,7 +143,7 @@ Word32 L_abs (Word32 L_var1) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-Word32 L_abs(register Word32 L_var1) ++Word32 L_abs(Word32 L_var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_shr_r.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_shr_r.cpp +index 0a07135..ec120f0 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_shr_r.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_shr_r.cpp +@@ -159,7 +159,7 @@ Word32 L_shr_r (Word32 L_var1, Word16 var2) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word32 L_shr_r(register Word32 L_var1, register Word16 var2, Flag *pOverflow) ++OSCL_EXPORT_REF Word32 L_shr_r(Word32 L_var1, Word16 var2, Flag *pOverflow) + { + Word32 result; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/lsp_az.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/lsp_az.cpp +index c41f614..af1a716 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/lsp_az.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/lsp_az.cpp +@@ -185,8 +185,8 @@ static void Get_lsp_pol( + Word32 *f, + Flag *pOverflow) + { +- register Word16 i; +- register Word16 j; ++ Word16 i; ++ Word16 j; + + Word16 hi; + Word16 lo; +@@ -332,8 +332,8 @@ OSCL_EXPORT_REF void Lsp_Az( + Flag *pOverflow /* (o) : overflow flag */ + ) + { +- register Word16 i; +- register Word16 j; ++ Word16 i; ++ Word16 j; + + Word32 f1[6]; + Word32 f2[6]; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp +index 003afc7..a6b4a62 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp +@@ -155,7 +155,7 @@ Word16 mult_r (Word16 var1, Word16 var2) + OSCL_EXPORT_REF Word16 mult_r(Word16 var1, Word16 var2, Flag *pOverflow) + { + +- register Word32 L_product_arr; ++ Word32 L_product_arr; + + L_product_arr = ((Word32) var1) * var2; /* product */ + L_product_arr += (Word32) 0x00004000L; /* round */ +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/negate.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/negate.cpp +index 3db2458..e16dca0 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/negate.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/negate.cpp +@@ -128,7 +128,7 @@ Word16 negate (Word16 var1) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-Word16 negate(register Word16 var1) ++Word16 negate(Word16 var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp +index dc4ca72..fabbb44 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp +@@ -153,12 +153,12 @@ Word16 norm_l (Word32 L_var1) + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ + #if !((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_GNUC) || (PV_COMPILER == EPV_ARM_RVCT))) +-OSCL_EXPORT_REF Word16 norm_l(register Word32 L_var1) ++OSCL_EXPORT_REF Word16 norm_l(Word32 L_var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables + ----------------------------------------------------------------------------*/ +- register Word16 var_out = 0; ++ Word16 var_out = 0; + + /*---------------------------------------------------------------------------- + ; Function body here +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp +index 4fdc6d2..66dfb65 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp +@@ -155,13 +155,13 @@ Word16 norm_s (Word16 var1) + ----------------------------------------------------------------------------*/ + #if !((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_GNUC) || (PV_COMPILER == EPV_ARM_RVCT))) + +-OSCL_EXPORT_REF Word16 norm_s(register Word16 var1) ++OSCL_EXPORT_REF Word16 norm_s(Word16 var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables + ----------------------------------------------------------------------------*/ + +- register Word16 var_out = 0; ++ Word16 var_out = 0; + + /*---------------------------------------------------------------------------- + ; Function body here +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/pred_lt.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/pred_lt.cpp +index fd51242..abcfddc 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/pred_lt.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/pred_lt.cpp +@@ -202,9 +202,9 @@ OSCL_EXPORT_REF void Pred_lt_3or6( + Flag *pOverflow /* output: if set, overflow occurred in this function */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 k; ++ Word16 i; ++ Word16 j; ++ Word16 k; + + Word16 *pX0; + Word16 *pX2; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/q_plsf_3.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/q_plsf_3.cpp +index 2c5446b..adb3542 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/q_plsf_3.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/q_plsf_3.cpp +@@ -216,7 +216,7 @@ static Word16 Vq_subvec4( /* o: quantization index, Q0 */ + Flag *pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i; ++ Word16 i; + Word16 temp; + const Word16 *p_dico; + Word16 index = 0; +@@ -510,7 +510,7 @@ static Word16 Vq_subvec3( /* o: quantization index, Q0 */ + Flag use_half, /* i: use every second entry in codebook */ + Flag *pOverflow) /* o : Flag set when overflow occurs */ + { +- register Word16 i; ++ Word16 i; + Word16 temp; + + const Word16 *p_dico; +@@ -884,7 +884,7 @@ OSCL_EXPORT_REF void Q_plsf_3( + Flag *pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i, j; ++ Word16 i, j; + Word16 lsf1[M]; + Word16 wf1[M]; + Word16 lsf_p[M]; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/residu.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/residu.cpp +index 787e043..3e8393e 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/residu.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/residu.cpp +@@ -152,7 +152,7 @@ OSCL_EXPORT_REF void Residu( + { + + +- register Word16 i, j; ++ Word16 i, j; + Word32 s1; + Word32 s2; + Word32 s3; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/round.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/round.cpp +index 9fd4abb..b46a44e 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/round.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/round.cpp +@@ -141,7 +141,7 @@ Word16 pv_round (Word32 L_var1) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word16 pv_round(register Word32 L_var1, Flag *pOverflow) ++OSCL_EXPORT_REF Word16 pv_round(Word32 L_var1, Flag *pOverflow) + { + Word16 result; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr.cpp +index a0fbd35..dabe1a8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr.cpp +@@ -157,9 +157,9 @@ Word16 shr_std (Word16 var1, Word16 var2) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word16 shr(register Word16 var1, register Word16 var2, Flag *pOverflow) ++OSCL_EXPORT_REF Word16 shr(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word16 result; ++ Word16 result; + + if (var2 != 0) + { +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp +index b403885..04ef9e6 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp +@@ -160,7 +160,7 @@ Word16 shr_r (Word16 var1, Word16 var2) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word16 shr_r(register Word16 var1, register Word16 var2, Flag *pOverflow) ++OSCL_EXPORT_REF Word16 shr_r(Word16 var1, Word16 var2, Flag *pOverflow) + { + /*---------------------------------------------------------------------------- + ; Define all local variables +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/weight_a.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/weight_a.cpp +index 98382b8..04160d8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/weight_a.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/weight_a.cpp +@@ -137,7 +137,7 @@ OSCL_EXPORT_REF void Weight_Ai( + Word16 a_exp[] /* (o) : Spectral expanded LPC coefficients */ + ) + { +- register Word16 i; ++ Word16 i; + + *(a_exp) = *(a); + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp +index d56b922..5f147bd 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp +@@ -177,7 +177,7 @@ void dec_10i40_35bits( + const Word16* dgray_ptr /* i : ptr to read-only tbl */ + ) + { +- register Word16 i, j, pos1, pos2; ++ Word16 i, j, pos1, pos2; + Word16 sign, tmp; + + for (i = 0; i < L_CODE; i++) +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp +index 8a4e763..9218c4b 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp +@@ -263,7 +263,7 @@ void D_plsf_5( + Flag *pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i; ++ Word16 i; + Word16 temp; + Word16 sign; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp +index e50eb6c..82844a1 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp +@@ -176,9 +176,9 @@ void Int_lsf( + Flag *pOverflow /* o : flag set if overflow occurs */ + ) + { +- register Word16 i; +- register Word16 temp1; +- register Word16 temp2; ++ Word16 i; ++ Word16 temp1; ++ Word16 temp2; + + if (i_subfr == 0) + { +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp +index 22fe3b5..b2d00ff 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp +@@ -147,7 +147,7 @@ int ph_disp_reset (ph_dispState *state) + + Word16 ph_disp_reset(ph_dispState *state) + { +- register Word16 i; ++ Word16 i; + + if (state == (ph_dispState *) NULL) + { +@@ -560,15 +560,15 @@ void ph_disp( + Flag *pOverflow /* i/o : oveflow indicator */ + ) + { +- register Word16 i, i1; +- register Word16 tmp1; ++ Word16 i, i1; ++ Word16 tmp1; + Word32 L_temp; + Word32 L_temp2; + Word16 impNr; /* indicator for amount of disp./filter used */ + + Word16 inno_sav[L_SUBFR]; + Word16 ps_poss[L_SUBFR]; +- register Word16 nze, nPulse; ++ Word16 nze, nPulse; + Word16 ppos; + const Word16 *ph_imp; /* Pointer to phase dispersion filter */ + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp +index 479ded7..2bbb9e1 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp +@@ -376,10 +376,10 @@ void Post_Filter( + Word16 Ap4[MP1]; /* bandwidth expanded LP parameters */ + Word16 *Az; /* pointer to Az_4: */ + /* LPC parameters in each subframe */ +- register Word16 i_subfr; /* index for beginning of subframe */ ++ Word16 i_subfr; /* index for beginning of subframe */ + Word16 h[L_H]; + +- register Word16 i; ++ Word16 i; + Word16 temp1; + Word16 temp2; + Word32 L_tmp; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/autocorr.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/autocorr.cpp +index 033c93a..014a124 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/autocorr.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/autocorr.cpp +@@ -224,9 +224,9 @@ Word16 Autocorr( + Flag *pOverflow /* (o) : indicates overflow */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 norm; ++ Word16 i; ++ Word16 j; ++ Word16 norm; + + Word16 y[L_WINDOW]; + Word32 sum; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp +index 052a53f..2bcb7b8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp +@@ -267,7 +267,7 @@ extern "C" + Word16 dn_sign[L_CODE]; + Word16 rr[L_CODE][L_CODE]; + +- register Word16 i; ++ Word16 i; + + Word16 index; + Word16 sharp; +@@ -527,10 +527,10 @@ extern "C" + Flag * pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i0; +- register Word16 i1; ++ Word16 i0; ++ Word16 i1; + Word16 ix = 0; /* initialization only needed to keep gcc silent */ +- register Word16 track1; ++ Word16 track1; + Word16 ipos[NB_PULSE]; + Word16 psk; + Word16 ps0; +@@ -543,7 +543,7 @@ extern "C" + Word32 s; + Word32 alp0; + Word32 alp1; +- register Word16 i; ++ Word16 i; + Word32 L_temp; + Word16 *p_codvec = &codvec[0]; + +@@ -898,13 +898,13 @@ extern "C" + Flag *pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 k; +- register Word16 track; +- register Word16 first; +- register Word16 index; +- register Word16 rsign; ++ Word16 i; ++ Word16 j; ++ Word16 k; ++ Word16 track; ++ Word16 first; ++ Word16 index; ++ Word16 rsign; + Word16 indx; + Word16 _sign[NB_PULSE]; + Word16 *p0; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp +index 50eb6b9..2b49af2 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp +@@ -545,7 +545,7 @@ void cl_ltp( + Flag *pOverflow /* o : overflow indicator */ + ) + { +- register Word16 i; ++ Word16 i; + Word16 index; + Word32 L_temp; /* temporarily variable */ + Word16 resu3; /* flag for upsample resolution */ +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/convolve.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/convolve.cpp +index e1471d6..c059532 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/convolve.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/convolve.cpp +@@ -155,7 +155,7 @@ void Convolve( + Word16 L /* (i) : vector size */ + ) + { +- register Word16 i, n; ++ Word16 i, n; + Word32 s1, s2; + + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h.cpp +index 32fbdd1..1b2f3d4 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h.cpp +@@ -193,8 +193,8 @@ void cor_h( + Flag *pOverflow + ) + { +- register Word16 i; +- register Word16 dec; ++ Word16 i; ++ Word16 dec; + + Word16 h2[L_CODE]; + Word32 s; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp +index 7bb54bb..492e4b8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp +@@ -202,9 +202,9 @@ void cor_h_x( + Flag *pOverflow /* (o): pointer to overflow flag */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 k; ++ Word16 i; ++ Word16 j; ++ Word16 k; + + Word32 s; + Word32 y32[L_CODE]; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp +index 9d72ab3..fc126b2 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp +@@ -194,9 +194,9 @@ void cor_h_x2( + Flag *pOverflow + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 k; ++ Word16 i; ++ Word16 j; ++ Word16 k; + Word32 s; + Word32 y32[L_CODE]; + Word32 max; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp +index f4f25f9..202ba2d 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp +@@ -67,7 +67,7 @@ terms listed above has been obtained from the copyright holder. + ; MACROS + ; Define module specific macros here + ----------------------------------------------------------------------------*/ +-extern Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow); ++extern Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow); + + /*---------------------------------------------------------------------------- + ; DEFINES +@@ -544,7 +544,7 @@ void dtx_enc(dtx_encState *st, /* i/o : State struct */ + Flag *pOverflow /* i/o : overflow indicator */ + ) + { +- register Word16 i, j; ++ Word16 i, j; + Word16 temp; + Word16 log_en; + Word16 lsf[M]; +@@ -800,7 +800,7 @@ void dtx_buffer(dtx_encState *st, /* i/o : State struct */ + ) + { + +- register Word16 i; ++ Word16 i; + Word32 L_frame_en; + Word32 L_temp; + Word16 log_en_e; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_negate.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_negate.cpp +index 9699095..01b9dca 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_negate.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_negate.cpp +@@ -125,7 +125,7 @@ Word32 L_negate (Word32 L_var1) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-Word32 L_negate(register Word32 L_var1) ++Word32 L_negate(Word32 L_var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/levinson.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/levinson.cpp +index cbd27d7..c138e5d 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/levinson.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/levinson.cpp +@@ -573,8 +573,8 @@ Word16 Levinson( + Flag *pOverflow + ) + { +- register Word16 i; +- register Word16 j; ++ Word16 i; ++ Word16 j; + Word16 hi; + Word16 lo; + Word16 Kh; /* reflexion coefficient; hi and lo */ +@@ -586,9 +586,9 @@ Word16 Levinson( + Word16 Al[M + 1]; + Word16 Anh[M + 1]; /* LPC coef.for next iteration in */ + Word16 Anl[M + 1]; /* double prec. */ +- register Word32 t0; /* temporary variable */ +- register Word32 t1; /* temporary variable */ +- register Word32 t2; /* temporary variable */ ++ Word32 t0; /* temporary variable */ ++ Word32 t1; /* temporary variable */ ++ Word32 t2; /* temporary variable */ + + Word16 *p_Rh; + Word16 *p_Rl; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp +index d8efa1e..1d0ff1e 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp +@@ -303,7 +303,7 @@ static Word16 Lag_max( /* o : lag found */ + ) + #endif + { +- register Word16 i; ++ Word16 i; + Word16 *p; + Word32 max; + Word32 t0; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp +index 93d23b5..4108f3f 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp +@@ -436,7 +436,7 @@ void Pre_Process( + Word16 signal[], /* input/output signal */ + Word16 lg) /* length of signal */ + { +- register Word16 i; ++ Word16 i; + Word16 x_n_2; + Word16 x_n_1; + Word32 L_tmp; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/set_sign.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/set_sign.cpp +index f759901..f25b062 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/set_sign.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/set_sign.cpp +@@ -194,7 +194,7 @@ void set_sign(Word16 dn[], /* i/o : correlation between target and h[] */ + Word16 n /* i : # of maximum correlations in dn2[] */ + ) + { +- register Word16 i, j, k; ++ Word16 i, j, k; + Word16 val, min; + Word16 pos = 0; /* initialization only needed to keep gcc silent */ + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h +index 73ccb71..5132d7d 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h +@@ -66,8 +66,8 @@ terms listed above has been obtained from the copyright holder. + + __inline int16 normalize_amr_wb(int32 x) + { +- register int32 y; +- register int32 ra = x; ++ int32 y; ++ int32 ra = x; + + + asm volatile( +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwb_math_op.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwb_math_op.cpp +index d1ec790..5872512 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwb_math_op.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwb_math_op.cpp +@@ -205,7 +205,7 @@ int16 div_16by16(int16 var1, int16 var2) + { + + int16 var_out = 0; +- register int16 iteration; ++ int16 iteration; + int32 L_num; + int32 L_denom; + int32 L_denom_by_2; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h +index c2c9f36..e9ddbf1 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h +@@ -51,10 +51,10 @@ extern "C" + + static inline int16 sub_int16(int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 L_var_aux; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; ++ int32 L_var_out; ++ int32 L_var_aux; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; + + asm volatile( + "mov %0, %2, lsl #16\n" +@@ -72,10 +72,10 @@ extern "C" + + static inline int16 add_int16(int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 L_var_aux; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; ++ int32 L_var_out; ++ int32 L_var_aux; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; + + asm volatile( + "mov %0, %2, lsl #16\n" +@@ -93,11 +93,11 @@ extern "C" + + static inline int32 mul_32by16(int16 hi, int16 lo, int16 n) + { +- register int32 H_32; +- register int32 L_32; +- register int32 ra = (int32)hi; +- register int32 rb = (int32)lo; +- register int32 rc = (int32)n; ++ int32 H_32; ++ int32 L_32; ++ int32 ra = (int32)hi; ++ int32 rb = (int32)lo; ++ int32 rc = (int32)n; + + + asm volatile( +@@ -117,9 +117,9 @@ extern "C" + + static inline int32 sub_int32(int32 L_var1, int32 L_var2) + { +- register int32 L_var_out; +- register int32 ra = L_var1; +- register int32 rb = L_var2; ++ int32 L_var_out; ++ int32 ra = L_var1; ++ int32 rb = L_var2; + + asm volatile( + "qsub %0, %1, %2" +@@ -132,9 +132,9 @@ extern "C" + + static inline int32 add_int32(int32 L_var1, int32 L_var2) + { +- register int32 L_var_out; +- register int32 ra = L_var1; +- register int32 rb = L_var2; ++ int32 L_var_out; ++ int32 ra = L_var1; ++ int32 rb = L_var2; + + asm volatile( + "qadd %0, %1, %2" +@@ -147,10 +147,10 @@ extern "C" + + static inline int32 msu_16by16_from_int32(int32 L_var3, int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; +- register int32 rc = L_var3; ++ int32 L_var_out; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; ++ int32 rc = L_var3; + + asm volatile( + "smulbb %0, %1, %2\n" +@@ -166,10 +166,10 @@ extern "C" + + static inline int32 mac_16by16_to_int32(int32 L_var3, int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; +- register int32 rc = L_var3; ++ int32 L_var_out; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; ++ int32 rc = L_var3; + + asm volatile( + "smulbb %0, %1, %2\n" +@@ -185,9 +185,9 @@ extern "C" + + static inline int32 mul_16by16_to_int32(int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; ++ int32 L_var_out; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; + + asm volatile( + "smulbb %0, %1, %2\n" +@@ -202,9 +202,9 @@ extern "C" + + static inline int16 mult_int16(int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; ++ int32 L_var_out; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; + + asm volatile( + "smulbb %0, %1, %2\n" +@@ -218,9 +218,9 @@ extern "C" + + static inline int16 amr_wb_round(int32 L_var1) + { +- register int32 L_var_out; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)0x00008000L; ++ int32 L_var_out; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)0x00008000L; + + asm volatile( + "qadd %0, %1, %2\n" +@@ -233,9 +233,9 @@ extern "C" + + static inline int16 amr_wb_shl1_round(int32 L_var1) + { +- register int32 L_var_out; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)0x00008000L; ++ int32 L_var_out; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)0x00008000L; + + asm volatile( + "qadd %0, %1, %1\n" +@@ -250,10 +250,10 @@ extern "C" + + static inline int32 fxp_mac_16by16(const int16 L_var1, const int16 L_var2, int32 L_add) + { +- register int32 tmp; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)L_var2; +- register int32 rc = (int32)L_add; ++ int32 tmp; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)L_var2; ++ int32 rc = (int32)L_add; + + asm volatile( + "smlabb %0, %1, %2, %3" +@@ -266,9 +266,9 @@ extern "C" + + static inline int32 fxp_mul_16by16bb(int16 L_var1, const int16 L_var2) + { +- register int32 tmp; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)L_var2; ++ int32 tmp; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)L_var2; + + asm volatile( + "smulbb %0, %1, %2" +@@ -284,9 +284,9 @@ extern "C" + + static inline int32 fxp_mul32_by_16(int32 L_var1, const int32 L_var2) + { +- register int32 tmp; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)L_var2; ++ int32 tmp; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)L_var2; + + asm volatile( + "smulwb %0, %1, %2" +-- +2.41.0 + diff --git a/recipes/opencore-amr/all/test_package/CMakeLists.txt b/recipes/opencore-amr/all/test_package/CMakeLists.txt index f8165a7ba4d2f..b4b3b8c570e31 100644 --- a/recipes/opencore-amr/all/test_package/CMakeLists.txt +++ b/recipes/opencore-amr/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(opencore-amr REQUIRED) @@ -10,4 +7,4 @@ add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE opencore-amr::opencore-amrnb opencore-amr::opencore-amrwb - ) +) diff --git a/recipes/opencore-amr/all/test_package/conanfile.py b/recipes/opencore-amr/all/test_package/conanfile.py index e16563695d6b4..e730ad6dc0dfc 100644 --- a/recipes/opencore-amr/all/test_package/conanfile.py +++ b/recipes/opencore-amr/all/test_package/conanfile.py @@ -1,9 +1,18 @@ -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" + 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,6 +20,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/opencore-amr/all/test_v1_package/CMakeLists.txt b/recipes/opencore-amr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/opencore-amr/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/opencore-amr/all/test_v1_package/conanfile.py b/recipes/opencore-amr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e16563695d6b4 --- /dev/null +++ b/recipes/opencore-amr/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "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/opencv/2.x/conanfile.py b/recipes/opencv/2.x/conanfile.py index 33f0ecba72fd2..a256803f12717 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,28 +354,28 @@ 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.4") + 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.39") + self.requires("libpng/1.6.40") if self.options.get_safe("with_jasper"): self.requires("jasper/4.0.0") if self.options.get_safe("with_openexr"): # 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.4.0") + 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 e0e79edab327a..147afc1ea676d 100644 --- a/recipes/opencv/3.x/conandata.yml +++ b/recipes/opencv/3.x/conandata.yml @@ -1,20 +1,20 @@ sources: + "3.4.20": + - url: "https://github.com/opencv/opencv/archive/refs/tags/3.4.20.tar.gz" + sha256: "b9eda448a08ba7b10bfd5bd45697056569ebdf7a02070947e1c1f3e8e69280cd" + - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/3.4.20.tar.gz" + sha256: "b0bb3fa7ae4ac00926b83d4d95c6500c2f7af542f8ec78d0f01b2961a690d5dc" "3.4.17": - url: "https://github.com/opencv/opencv/archive/refs/tags/3.4.17.tar.gz" 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": + "3.4.20": - 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" + "3.4.17": + - patch_file: "patches/3.4.17-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 51dc5157837a5..94f59dc50fb8e 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,32 +76,32 @@ 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.4") + 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.39") + self.requires("libpng/1.6.40") if self.options.with_jasper: self.requires("jasper/4.0.0") if self.options.with_openexr: # opencv 3.x doesn't support openexr >= 3 self.requires("openexr/2.5.7") if self.options.with_tiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.6.0") if self.options.with_eigen: - self.requires("eigen/3.3.9") + 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.2.4") + self.requires("libwebp/1.3.2") if self.options.contrib: - self.requires("freetype/2.12.1") - self.requires("harfbuzz/6.0.0") + self.requires("freetype/2.13.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 757789eca25bb..0000000000000 --- 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 3da12bba6234f..867bde99de61c 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 dc9fe5f7a71d2..31a4382eaa728 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.4") - 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: - self.requires("libpng/1.6.39") - 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.5") + if self.options.get_safe("with_png"): + self.requires("libpng/1.6.40") + if self.options.get_safe("with_openexr"): + self.requires("openexr/3.2.1") if self.options.get_safe("with_tiff"): - self.requires("libtiff/4.4.0") - 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") - if self.options.parallel == "tbb": - self.requires("onetbb/2021.7.0") - if self.options.with_ipp == "intel-ipp": - self.requires("intel-ipp/2020") - if self.options.with_webp: - self.requires("libwebp/1.3.0") - if self.options.get_safe("contrib_freetype"): - self.requires("freetype/2.12.1") - self.requires("harfbuzz/6.0.0") - if self.options.get_safe("contrib_sfm"): + self.requires("ffmpeg/4.4.4") + # freetype module dependencies + if self.options.freetype: + self.requires("freetype/2.13.0") + 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 0000000000000..9113058791110 --- /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 0000000000000..29f4b36e65dc2 --- /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 0000000000000..b32a2916816cb --- /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 0000000000000..c4ff008107555 --- /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 0000000000000..5bd6bfd1b3816 --- /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 0000000000000..3854d36a913a0 --- /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 0000000000000..6e57a96b98355 --- /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 0000000000000..847eeaa9e9869 --- /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 0000000000000..b9b34a95156fe --- /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 0000000000000..5313e7b762001 --- /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 0000000000000..e53df28368b3b --- /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 0000000000000..4c497271a4d6a --- /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 0000000000000..0e70b9535811f --- /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 0000000000000..33c9550f7c325 --- /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 e49280ad955c0..5404f6ff23915 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 5d9136c00ec0e..e5b25fb84dd4b 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 0000000000000..af8ea966d9715 --- /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 0000000000000..bc510aeaf4b18 --- /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 0000000000000..ba01af2fd1861 --- /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 0000000000000..219fc935596f3 --- /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 0000000000000..ce5c7e8b7c821 --- /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 0000000000000..079bcb7ba21ce --- /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 0000000000000..b9635e35d0fc8 --- /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 0000000000000..16c5eca1c9205 --- /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 0000000000000..3d8474fcdd230 --- /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 0000000000000..bbe3442b46dc4 --- /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 0000000000000..9e3953a255cc0 --- /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 0000000000000..2154a2126ebb1 --- /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 0000000000000..0461a2651192b --- /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 0000000000000..49ee14c10ed6a --- /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 0000000000000..ad4485785acc4 --- /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 0000000000000..1894733df9580 --- /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 0000000000000..94d3e97ba46b4 --- /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 0000000000000..8d5391b6b1421 --- /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 0000000000000..69025d66e0e23 --- /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 0000000000000..73ca684981092 --- /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 0000000000000..909d28ae9465d --- /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 0000000000000..23784d8f0a1b6 --- /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 0000000000000..dce55e2e9e3a7 --- /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 0000000000000..a9c8f66bb0d01 --- /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 0000000000000..7b2647b223c4d --- /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 0000000000000..e53dbd4cf97ee --- /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 0000000000000..2533cbb506d59 --- /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 0000000000000..f7ef8c92b736e --- /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 220a68d7c84b1..0000000000000 --- 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 0000000000000..d8863b429ecd4 --- /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 0000000000000..4a94f1b4c0c8f --- /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 0000000000000..40dc21023a5fc --- /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 0000000000000..75faaa7e15666 --- /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 0000000000000..26957e3fa333b --- /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 0000000000000..f4c2a3c31ec3b --- /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 0000000000000..c3938011335b0 --- /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 0000000000000..e4b4bacb2a25a --- /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 0000000000000..ef5e9500abe47 --- /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 0000000000000..8a445823efb35 --- /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 0000000000000..d6f0b0661cdba --- /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 0000000000000..70097500036ec --- /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 0000000000000..3a215084288be --- /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 0000000000000..1c8dbed4b8ea2 --- /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 0000000000000..69efe349df222 --- /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 0000000000000..09a4342add1a1 --- /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 0000000000000..7b0955e888a06 --- /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 0000000000000..6dce15eeb7b40 --- /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 0000000000000..673b9737b4fdd --- /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 0000000000000..b4804362da9b2 --- /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 0000000000000..15cecaff5b8ef --- /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 0000000000000..5c0eb661f221c --- /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 0d20897301b68..c23ed5cfe6d98 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 dc9799aa32b63..9aa234fbd88b8 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 9eaf5dfd20e1b..443d5e91a8125 100644 --- a/recipes/opencv/config.yml +++ b/recipes/opencv/config.yml @@ -1,13 +1,15 @@ versions: + "4.8.1": + folder: "4.x" "4.5.5": folder: "4.x" "4.5.3": folder: "4.x" "4.1.2": folder: "4.x" - "3.4.17": + "3.4.20": folder: "3.x" - "3.4.12": + "3.4.17": 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 aff9aad9e373b..367951b808907 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 c4cc95f34a3b6..c45ff0b2916ff 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 61f3d3b039e2b..0000000000000 --- 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 c12e0f534863e..901bec5f90435 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 de0ae61c3daea..f3bcaea5080c3 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 4371da6fd8c67..47f482568b9fd 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 b295f3f19d774..20c9ce7dbadb1 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 053adab3412f0..fa65c1fd0c5c9 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 0000000000000..91630d79f4abb --- /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 0000000000000..b295f3f19d774 --- /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 ed1dbc177bf25..ad9f3c8967822 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 95068ca05e4d4..6cbbea809703f 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 a68e5d8d7ad88..564b19b00cd64 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 0000000000000..3f4c78fc6bea5 --- /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 0000000000000..a30277a2740a5 --- /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 0000000000000..64f13c78d3ce8 --- /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 a7eeabc240c75..2a41f1e247f6e 100644 --- a/recipes/openexr/3.x/conandata.yml +++ b/recipes/openexr/3.x/conandata.yml @@ -1,17 +1,34 @@ 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" "3.1.7": url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.7.tar.gz" sha256: "78dbca39115a1c526e6728588753955ee75fa7f5bb1a6e238bed5b6d66f91fd7" "3.1.5": url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.5.tar.gz" sha256: "93925805c1fc4f8162b35f0ae109c4a75344e6decae5a240afdfce25f8a433ec" - "3.1.4": - url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.4.tar.gz" - sha256: "cb019c3c69ada47fe340f7fa6c8b863ca0515804dc60bdb25c942c1da886930b" 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/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" - "3.1.4": - - 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 e96841da78ea1..71838c85f0a04 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.6", transitive_headers=True) + 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 0000000000000..fbf062e5d0184 --- /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 e5475f6ba1657..96999743e2fb9 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 839005bf8beb6..c5e2b53e89f02 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" - "3.1.4": - 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 ef54f290e0077..aed678082ff26 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 ef0a6f1a558d2..350f5171a2fd1 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 cdd919fc9ae03..71588be2b8f7e 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 90eb89e3f2f46..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..90eb89e3f2f46 --- /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 5232e354a73ee..1a7641b6f3019 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 6f5bee8600958..935c3113a9393 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 c80f526f36b85..130ac63e132fe 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 884a3017a3bd6..93275299d1c47 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 0000000000000..91630d79f4abb --- /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 0000000000000..884a3017a3bd6 --- /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 46486aec2fc82..5e0a3df392096 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/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index 0d33427fd3228..00cb4e7604b28 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -129,7 +129,7 @@ def _make_args(self): libcxx = str(self.settings.compiler.libcxx) stl_lib = f'$(NDKROOT)/sources/cxx-stl/llvm-libc++/libs/$(APP_ABI)/lib{"c++_static.a" if libcxx == "c++_static" else "c++_shared.so"}' \ + "$(NDKROOT)/sources/cxx-stl/llvm-libc++/libs/$(APP_ABI)/libc++abi.a" - ndk_home = os.environ["ANDROID_NDK_HOME"] + ndk_home = self.conf.get("tools.android:ndk_path") args.extend([ f"NDKLEVEL={self.settings.os.api_level}", f"STL_LIB={stl_lib}", diff --git a/recipes/openimageio/all/conanfile.py b/recipes/openimageio/all/conanfile.py index b8281c87a2d2c..f741a725420ff 100644 --- a/recipes/openimageio/all/conanfile.py +++ b/recipes/openimageio/all/conanfile.py @@ -93,12 +93,12 @@ def requirements(self): # Required libraries self.requires("zlib/1.2.13") self.requires("boost/1.78.0") - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") self.requires("openexr/2.5.7") if self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.2") + self.requires("libjpeg-turbo/2.1.5") self.requires("pugixml/1.12.1") self.requires("libsquish/1.15") self.requires("tsl-robin-map/1.0.1") @@ -106,9 +106,9 @@ def requirements(self): # Optional libraries if self.options.with_libpng: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_freetype: - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.0") if self.options.with_hdf5: self.requires("hdf5/1.12.1") if self.options.with_opencolorio: @@ -138,7 +138,7 @@ def requirements(self): if self.options.with_ptex: self.requires("ptex/2.4.0") if self.options.with_libwebp: - self.requires("libwebp/1.2.4") + self.requires("libwebp/1.3.1") # TODO: R3DSDK dependency # TODO: Nuke dependency diff --git a/recipes/openjdk/all/conandata.yml b/recipes/openjdk/all/conandata.yml index 55fa3138ee966..bb0f8bea50c9b 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 f6296d73d515d..becd2ce7c641c 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 71fa68c00fc9a..1e9a2a92440d2 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 d4b1a9482f6b7..5b1cc6a995945 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 eccda132e4efe..08c910c90a70d 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/openmesh/all/conandata.yml b/recipes/openmesh/all/conandata.yml index da3df78a47023..a2b42f64b8c89 100644 --- a/recipes/openmesh/all/conandata.yml +++ b/recipes/openmesh/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "10.0": + url: "https://www.graphics.rwth-aachen.de/media/openmesh_static/Releases/10.0/OpenMesh-10.0.0.tar.bz2" + sha256: "af22520a474bb6a3b355eb0867449c6b995126f97632d1ee5ff9c7ebd322fedb" "9.0": url: "https://www.graphics.rwth-aachen.de/media/openmesh_static/Releases/9.0/OpenMesh-9.0.tar.gz" sha256: "b9574c921482798ce75a8bf578345a84b928ca26ee759219d21b310e2db9d006" @@ -6,6 +9,11 @@ sources: url: "https://www.graphics.rwth-aachen.de/media/openmesh_static/Releases/8.1/OpenMesh-8.1.tar.gz" sha256: "0953777f483d47ea9fa00c329838443a7a09dde8be77bf7de188001cb9e768a7" patches: + "10.0": + - patch_file: "patches/cmake-install_9.0.patch" + - patch_file: "patches/restore-cxx11-compatibility.patch" + patch_description: "Revert a minor change that broke C++11 compatibility for libc++" + patch_type: "portability" "9.0": - patch_file: "patches/cmake-install_9.0.patch" "8.1": diff --git a/recipes/openmesh/all/conanfile.py b/recipes/openmesh/all/conanfile.py index 36d307d2c5111..0c47f08b1897f 100644 --- a/recipes/openmesh/all/conanfile.py +++ b/recipes/openmesh/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import check_min_cppstd +from conan.tools.build import check_min_cppstd, valid_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save from conan.tools.microsoft import is_msvc @@ -29,6 +29,10 @@ class OpenmeshConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 11 + def export_sources(self): export_conandata_patches(self) @@ -45,7 +49,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) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -56,6 +60,8 @@ def generate(self): tc.variables["OPENMESH_BUILD_SHARED"] = self.options.shared tc.variables["BUILD_APPS"] = False tc.variables["OPENMESH_DOCS"] = False + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd tc.generate() def build(self): diff --git a/recipes/openmesh/all/patches/restore-cxx11-compatibility.patch b/recipes/openmesh/all/patches/restore-cxx11-compatibility.patch new file mode 100644 index 0000000000000..144df56809a27 --- /dev/null +++ b/recipes/openmesh/all/patches/restore-cxx11-compatibility.patch @@ -0,0 +1,17 @@ +Partial revert of https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/commit/998eec1390dcabbb502dc1ac1bc17cd09a16e343 +for compatibility with C++11. + +https://web.archive.org/web/20151001014443/http://en.cppreference.com/w/cpp/container/vector/emplace_back +"The specialization std::vector did not have emplace_back() member until C++14." + +--- src/OpenMesh/Core/Utils/Property.hh ++++ src/OpenMesh/Core/Utils/Property.hh +@@ -250,7 +250,7 @@ + virtual void reserve(size_t _n) override { data_.reserve(_n); } + virtual void resize(size_t _n) override { data_.resize(_n); } + virtual void clear() override { data_.clear(); vector_type().swap(data_); } +- virtual void push_back() override { data_.emplace_back(); } ++ virtual void push_back() override { data_.push_back(bool()); } + virtual void swap(size_t _i0, size_t _i1) override + { bool t(data_[_i0]); data_[_i0]=data_[_i1]; data_[_i1]=t; } + virtual void copy(size_t _i0, size_t _i1) override diff --git a/recipes/openmesh/config.yml b/recipes/openmesh/config.yml index 6b3545daffc92..a5f8255a5ed2a 100644 --- a/recipes/openmesh/config.yml +++ b/recipes/openmesh/config.yml @@ -1,4 +1,6 @@ versions: + "10.0": + folder: all "9.0": folder: all "8.1": diff --git a/recipes/openmvg/all/conanfile.py b/recipes/openmvg/all/conanfile.py index cb31a55747055..6774e8b893191 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,9 +68,14 @@ 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") - self.requires("libpng/1.6.39") - self.requires("libtiff/4.5.0") + 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") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -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 0000000000000..06219b641cc81 --- /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 0000000000000..b8d2328964b48 --- /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 0000000000000..d03b89e820ddd --- /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 0000000000000..0a808db45f245 --- /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 0000000000000..50dff63a6c03a --- /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 0000000000000..1dd1dcdfcdd6f --- /dev/null +++ b/recipes/openpam/config.yml @@ -0,0 +1,3 @@ +versions: + "20190224": + folder: all diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index b22982d840a75..5d6b6d3a14882 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -125,18 +125,18 @@ def requirements(self): self.requires("opengl/system") if self.options.use_fontconfig: - self.requires("fontconfig/2.13.93") + self.requires("fontconfig/2.14.2") if self.options.get_safe("with_asio", False): # Should these be private requires? self.requires("asio/1.22.1") - self.requires("boost/1.79.0") + self.requires("boost/1.81.0") if self.options.with_curl: - self.requires("libcurl/7.83.1") + self.requires("libcurl/8.0.1") if self.options.get_safe("with_dcmtk"): self.requires("dcmtk/3.6.6") if self.options.with_freetype: - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.0") if self.options.with_gdal: self.requires("gdal/3.4.3") if self.options.get_safe("with_gif"): @@ -148,11 +148,11 @@ def requirements(self): if self.options.get_safe("with_jpeg"): self.requires("libjpeg/9e") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.1.5") + self.requires("openexr/3.1.7") if self.options.get_safe("with_png"): - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.40") if self.options.with_tiff: - self.requires("libtiff/4.3.0") + self.requires("libtiff/4.5.1") if self.options.with_zlib: self.requires("zlib/1.2.13") diff --git a/recipes/openssl/1.x.x/conandata.yml b/recipes/openssl/1.x.x/conandata.yml index d35e2ee74b6f2..22aae5e08d56c 100644 --- a/recipes/openssl/1.x.x/conandata.yml +++ b/recipes/openssl/1.x.x/conandata.yml @@ -1,45 +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" + - "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: + 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 d7807c3f39ee0..073a01dcd3cdc 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 f04fd91d793b2..0000000000000 --- 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 460c1e7d062e9..ca3f66a360ac3 100644 --- a/recipes/openssl/3.x.x/conandata.yml +++ b/recipes/openssl/3.x.x/conandata.yml @@ -1,18 +1,42 @@ sources: - 3.1.0: + 3.2.0: url: - - "https://www.openssl.org/source/openssl-3.1.0.tar.gz" - sha256: aaa925ad9828745c4cad9d9efeb273deca820f2cdcf2c3ac7d7c1212b7c497b4 - 3.0.8: + - "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.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: + - "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.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: - url: https://www.openssl.org/source/openssl-3.0.5.tar.gz - sha256: aa7d8d9bef71ad6525c55ba11e5f4397889ce49c2c9349dcea6d3e4f0b024a7a + - "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.0.12: + url: + - "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.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 59da5e3bc2434..0aebce72e25fa 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 0000000000000..6e91678b02dd7 --- /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 f69b3734c7256..816020f3de15e 100644 --- a/recipes/openssl/config.yml +++ b/recipes/openssl/config.yml @@ -1,24 +1,21 @@ versions: - # 3.0.x releases - 3.1.0: + # 3.2.x releases + 3.2.0: + folder: "3.x.x" + # 3.1.x releases + 3.1.4: + folder: "3.x.x" + 3.1.3: folder: "3.x.x" - 3.0.8: + 3.1.2: folder: "3.x.x" - 3.0.7: + 3.1.1: + folder: "3.x.x" + # 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.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 8e41ab1d1bb93..803deaf9df19e 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 1522234dcfaac..6f46f7d0625fe 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 0000000000000..e8cb72fb5398d --- /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 6ef9c2e0ceacc..fde3364b74fa3 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 93dc9e86f93f9..0000000000000 --- 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 0000000000000..795904b844ae4 --- /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 17500dcbe918b..9d4618fc288dc 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 0633733157211..1709d84e6a285 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, 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): @@ -38,86 +41,122 @@ def _minimum_cpp_standard(self): @property 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", + "Visual Studio": "15", + "msvc": "191", + "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.3") + 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.6") 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"] - if Version(self.version) < "1.1.0": - self.cpp_info.components["libopentdf"].requires.append("libarchive::libarchive") + 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.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 0000000000000..9901f248faf03 --- /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 90a74a2912fcb..d73e39aaa8604 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 cffa32351d969..ef5d7042163ec 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 6747766ab2d49..e621751db7c3c 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-cpp/all/conandata.yml b/recipes/opentelemetry-cpp/all/conandata.yml index 88ad3e40bea9c..fb4e67647e394 100644 --- a/recipes/opentelemetry-cpp/all/conandata.yml +++ b/recipes/opentelemetry-cpp/all/conandata.yml @@ -1,59 +1,13 @@ sources: - "1.8.1": - url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.1.tar.gz" - sha256: "3d640201594b07f08dade9cd1017bd0b59674daca26223b560b9bb6bf56264c2" + "1.12.0": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.12.0.tar.gz" + sha256: "09c208a21fb1159d114a3ea15dc1bcc5dee28eb39907ba72a6012d2c7b7564a0" + "1.9.1": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.9.1.tar.gz" + sha256: "668de24f81c8d36d75092ad9dcb02a97cd41473adbe72485ece05e336db48249" + "1.8.3": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.3.tar.gz" + sha256: "b23d3c80d2e0012734ea343d2be69b2a7139ec5545453c503b13e629eb8fbe05" "1.7.0": url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.7.0.tar.gz" sha256: "2ad0911cdc94fe84a93334773bef4789a38bd1f01e39560cabd4a5c267e823c3" - "1.6.1": - url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.6.1.tar.gz" - sha256: "1fc371be049b3220b8b9571c8b713f03e9a84f3c5684363f64ccc814638391a5" - "1.4.1": - url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.4.1.tar.gz" - sha256: "301b1ab74a664723560f46c29f228360aff1e2d63e930b963755ea077ae67524" - "1.4.0": - url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.4.0.tar.gz" - sha256: "110f4fb2e38dcc72a421647631cfbb9429afd3c77c6c98829cc1d11bd0c72563" - "1.3.0": - url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.3.0.tar.gz" - sha256: "6a4c43b9c9f753841ebc0fe2717325271f02e2a1d5ddd0b52735c35243629ab3" - "1.2.0": - url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.2.0.tar.gz" - sha256: "7a6420f9e4fa44b81a5b06e30e5e116da71decc9086e5cc4f126e1efc8a397c2" - "1.0.1": - url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.0.1.tar.gz" - sha256: "32f12ff15ec257e3462883f84bc291c2d5dc30055604c12ec4b46a36dfa3f189" - -patches: - "1.8.1": - - patch_file: "patches/1.8.1-0001-fix-cmake.patch" - patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" - patch_type: "conan" - "1.7.0": - - patch_file: "patches/1.7.0-0001-fix-cmake.patch" - patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" - patch_type: "conan" - "1.6.1": - - patch_file: "patches/1.6.1-0001-fix-cmake.patch" - patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" - patch_type: "conan" - "1.4.1": - - patch_file: "patches/1.4.0-0001-fix-cmake.patch" - patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" - patch_type: "conan" - "1.4.0": - - patch_file: "patches/1.4.0-0001-fix-cmake.patch" - patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" - patch_type: "conan" - "1.3.0": - - patch_file: "patches/1.3.0-0001-fix-cmake.patch" - patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" - patch_type: "conan" - "1.2.0": - - patch_file: "patches/1.2.0-0001-fix-cmake.patch" - patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" - patch_type: "conan" - "1.0.1": - - patch_file: "patches/1.0.1-0001-fix-cmake.patch" - patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" - patch_type: "conan" diff --git a/recipes/opentelemetry-cpp/all/conanfile.py b/recipes/opentelemetry-cpp/all/conanfile.py index 28a5a3dd6a2cd..e13d0077e219b 100644 --- a/recipes/opentelemetry-cpp/all/conanfile.py +++ b/recipes/opentelemetry-cpp/all/conanfile.py @@ -1,15 +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, rmdir, replace_in_file, save +from conan.tools.files import get, copy, rmdir, replace_in_file, 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 -from conan.tools.microsoft import check_min_vs +from conan.tools.env import VirtualRunEnv, VirtualBuildEnv import os import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.56.0 <2 || >=2.0.6" class OpenTelemetryCppConan(ConanFile): name = "opentelemetry-cpp" @@ -18,6 +18,7 @@ class OpenTelemetryCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/open-telemetry/opentelemetry-cpp" topics = ("opentelemetry", "telemetry", "tracing", "metrics", "logs") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -26,7 +27,7 @@ class OpenTelemetryCppConan(ConanFile): "with_stl": [True, False], "with_gsl": [True, False], "with_abseil": [True, False], - "with_otlp": [True, False], + "with_otlp": ["deprecated", True, False], "with_otlp_grpc": [True, False], "with_otlp_http": [True, False], "with_zipkin": [True, False], @@ -48,7 +49,7 @@ class OpenTelemetryCppConan(ConanFile): "with_stl": False, "with_gsl": False, "with_abseil": True, - "with_otlp": True, + "with_otlp": "deprecated", "with_otlp_grpc": True, "with_otlp_http": True, "with_zipkin": True, @@ -65,23 +66,39 @@ class OpenTelemetryCppConan(ConanFile): short_paths = True @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): + if self.options.with_abseil and Version(self.dependencies["abseil"].ref.version) >= "20230125": + return 14 return 11 - def export_sources(self): - export_conandata_patches(self) + @property + def _compilers_minimum_version(self): + if self._min_cppstd == 14: + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "16", + "msvc": "192", + } + else: + return { + "Visual Studio": "16", + "msvc": "192", + } def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") + if Version(self.version) >= "1.10": + del self.options.with_jaeger def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - - if not self.options.with_otlp: - self.options.rm_safe("with_otlp_grpc") - self.options.rm_safe("with_otlp_http") + if self.options.with_otlp != "deprecated": + self.output.warning(f"{self.ref}:with_otlp option is deprecated, do not use anymore. " + "Please, consider with_otlp_grpc or with_otlp_http instead.") def layout(self): cmake_layout(self, src_folder="src") @@ -91,61 +108,52 @@ def requirements(self): self.requires("ms-gsl/4.0.0") if self.options.with_abseil: - self.requires("abseil/20220623.0") - - if self.options.with_otlp: - self.requires("protobuf/3.21.4") - if Version(self.version) <= "1.4.1": - self.requires("opentelemetry-proto/0.11.0") - else: - self.requires("opentelemetry-proto/0.19.0") + self.requires("abseil/20230125.3", transitive_headers=True) - if self.options.get_safe("with_otlp_grpc"): - self.requires("grpc/1.50.1") + if self.options.with_otlp_grpc: + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) + self.requires("grpc/1.54.3", transitive_headers=True, transitive_libs=True) if (self.options.with_zipkin or self.options.with_elasticsearch or - self.options.get_safe("with_otlp_http") or + self.options.with_otlp_http or self.options.with_etw ): self.requires("nlohmann_json/3.11.2") - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") if (self.options.with_zipkin or self.options.with_elasticsearch or - self.options.get_safe("with_otlp_http") + self.options.with_otlp_http ): - self.requires("libcurl/7.87.0") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.with_prometheus: self.requires("prometheus-cpp/1.1.0") - if self.options.with_jaeger: + if self.options.get_safe("with_jaeger"): self.requires("thrift/0.17.0") - - if Version(self.version) >= "1.3.0": - self.requires("boost/1.81.0") + self.requires("boost/1.82.0") @property def _required_boost_components(self): - return ["locale"] if self.options.with_jaeger and Version(self.version) >= "1.3.0" else [] + return ["locale"] if self.options.get_safe("with_jaeger") else [] def validate(self): - if self.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) - check_min_vs(self, "192") + 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.settings.os != "Linux" and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} supports building shared libraries only on Linux") - if self.options.get_safe("with_otlp_grpc") and not self.options.with_otlp: - raise ConanInvalidConfiguration("Option 'with_otlp_grpc' requires 'with_otlp'") - - if self.options.get_safe("with_otlp_http") and not self.options.with_otlp: - raise ConanInvalidConfiguration("Option 'with_otlp_http' requires 'with_otlp'") - - if not self.dependencies["grpc"].options.cpp_plugin: - raise ConanInvalidConfiguration(f"{self.ref} requires grpc with cpp_plugin=True") + if self.options.with_otlp_grpc: + if not self.dependencies["grpc"].options.cpp_plugin: + raise ConanInvalidConfiguration(f"{self.ref} requires grpc with cpp_plugin=True") boost_required_comp = any(self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) for boost_comp in self._required_boost_components) @@ -156,9 +164,16 @@ def validate(self): f"{', '.join(self._required_boost_components)}" ) + if conan_version.major == 1 and self.settings.compiler == "apple-clang" and Version(self.version) >= "1.12.0": + # Only fails on apple-clang in this configuration for some reason: + # https://github.com/conan-io/conan-center-index/pull/21332#issuecomment-1830766894 + raise ConanInvalidConfiguration("opentelemetry-cpp >= 1.12.0 does not support Apple Clang on Conan v1") + def build_requirements(self): - self.tool_requires("protobuf/3.21.4") - self.tool_requires("grpc/1.50.1") + if self.options.with_otlp_grpc: + self.tool_requires("opentelemetry-proto/1.0.0") + self.tool_requires("protobuf/") + self.tool_requires("grpc/") def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ @@ -171,57 +186,67 @@ def _create_cmake_module_variables(self, module_file): """) save(self, module_file, content) + def package_id(self): + # deprecated + del self.info.options.with_otlp + 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_TESTING"] = False - tc.variables["BUILD_BENCHMARK"] = False - - tc.variables["WITH_NO_DEPRECATED_CODE"] = self.options.with_no_deprecated_code - tc.variables["WITH_STL"] = self.options.with_stl - tc.variables["WITH_GSL"] = self.options.with_gsl - tc.variables["WITH_ABSEIL"] = self.options.with_abseil - tc.variables["WITH_OTLP"] = self.options.with_otlp - tc.variables["WITH_OTLP_GRPC"] = self.options.get_safe("with_otlp_grpc") - tc.variables["WITH_OTLP_HTTP"] = self.options.get_safe("with_otlp_http") - tc.variables["WITH_ZIPKIN"] = self.options.with_zipkin - tc.variables["WITH_PROMETHEUS"] = self.options.with_prometheus - tc.variables["WITH_ELASTICSEARCH"] = self.options.with_elasticsearch - tc.variables["WITH_ZPAGES"] = self.options.with_zpages - tc.variables["WITH_JAEGER"] = self.options.with_jaeger - tc.variables["WITH_NO_GETENV"] = self.options.with_no_getenv - tc.variables["WITH_ETW"] = self.options.with_etw - tc.variables["WITH_LOGS_PREVIEW"] = self.options.with_logs_preview - tc.variables["WITH_ASYNC_EXPORT_PREVIEW"] = self.options.with_async_export_preview - tc.variables["WITH_METRICS_EXEMPLAR_PREVIEW"] = self.options.with_metrics_exemplar_preview + VirtualBuildEnv(self).generate(scope="build") + VirtualRunEnv(self).generate(scope="build") + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["BUILD_BENCHMARK"] = False + tc.cache_variables["WITH_EXAMPLES"] = False + tc.cache_variables["WITH_NO_DEPRECATED_CODE"] = self.options.with_no_deprecated_code + tc.cache_variables["WITH_STL"] = self.options.with_stl + tc.cache_variables["WITH_GSL"] = self.options.with_gsl + tc.cache_variables["WITH_ABSEIL"] = self.options.with_abseil + if Version(self.version) < "1.10": + tc.cache_variables["WITH_OTLP"] = self.options.with_otlp_grpc or self.options.with_otlp_http + tc.cache_variables["WITH_OTLP_GRPC"] = self.options.with_otlp_grpc + tc.cache_variables["WITH_OTLP_HTTP"] = self.options.with_otlp_http + tc.cache_variables["WITH_ZIPKIN"] = self.options.with_zipkin + tc.cache_variables["WITH_PROMETHEUS"] = self.options.with_prometheus + tc.cache_variables["WITH_ELASTICSEARCH"] = self.options.with_elasticsearch + tc.cache_variables["WITH_ZPAGES"] = self.options.with_zpages + tc.cache_variables["WITH_JAEGER"] = self.options.get_safe("with_jaeger", False) + tc.cache_variables["WITH_NO_GETENV"] = self.options.with_no_getenv + tc.cache_variables["WITH_ETW"] = self.options.with_etw + tc.cache_variables["WITH_LOGS_PREVIEW"] = self.options.with_logs_preview + tc.cache_variables["WITH_ASYNC_EXPORT_PREVIEW"] = self.options.with_async_export_preview + tc.cache_variables["WITH_METRICS_EXEMPLAR_PREVIEW"] = self.options.with_metrics_exemplar_preview + tc.cache_variables["OPENTELEMETRY_INSTALL"] = True + if not self.settings.compiler.cppstd: + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd tc.generate() - tc = CMakeDeps(self) - tc.generate() + deps = CMakeDeps(self) + + deps.generate() def _patch_sources(self): - protos_path = self.deps_user_info["opentelemetry-proto"].proto_root.replace("\\", "/") - protos_cmake_path = os.path.join( - self.source_folder, - "cmake", - "opentelemetry-proto.cmake") - if Version(self.version) >= "1.1.0": - replace_in_file(self, - protos_cmake_path, - "if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto/.git)", - "if(1)") - replace_in_file(self, - protos_cmake_path, - "set(PROTO_PATH \"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto\")", - f"set(PROTO_PATH \"{protos_path}\")") - rmdir(self, os.path.join(self.source_folder, "api", "include", "opentelemetry", "nostd", "absl")) + if self.options.with_otlp_http or self.options.with_otlp_grpc: + protos_path = self.dependencies.build["opentelemetry-proto"].conf_info.get("user.opentelemetry-proto:proto_root").replace("\\", "/") + protos_cmake_path = os.path.join(self.source_folder, "cmake", "opentelemetry-proto.cmake") + replace_in_file(self, protos_cmake_path, + "if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto/.git)", + "if(1)") + if Version(self.version) < "1.8.3": + replace_in_file(self, protos_cmake_path, + 'set(PROTO_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto")', + f'set(PROTO_PATH "{protos_path}")') + else: + replace_in_file(self, protos_cmake_path, + '"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto")', + f'"{protos_path}")') + if self.options.with_otlp_grpc and Version(self.version) < "1.9.1": + save(self, protos_cmake_path, "\ntarget_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++)", append=True) - apply_conandata_patches(self) + rmdir(self, os.path.join(self.source_folder, "api", "include", "opentelemetry", "nostd", "absl")) def build(self): self._patch_sources() @@ -234,6 +259,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")) self._create_cmake_module_variables( os.path.join(self.package_folder, self._otel_cmake_variables_path) ) @@ -253,7 +279,7 @@ def _otel_build_modules(self): @property def _http_client_name(self): - return "http_client_curl" if Version(self.version) < "1.3.0" else "opentelemetry_http_client_curl" + return "opentelemetry_http_client_curl" @property def _otel_libraries(self): @@ -266,64 +292,41 @@ def _otel_libraries(self): "opentelemetry_trace", "opentelemetry_version", ] - - if self.options.with_otlp: + if self.options.with_otlp_grpc or self.options.with_otlp_http: libraries.extend([ "opentelemetry_proto", "opentelemetry_otlp_recordable", ]) - - if self.options.get_safe("with_otlp_grpc"): + if self.options.with_otlp_grpc: libraries.append("opentelemetry_exporter_otlp_grpc") - - if Version(self.version) >= "1.5.0": - libraries.append("opentelemetry_exporter_otlp_grpc_metrics") - + libraries.append("opentelemetry_exporter_otlp_grpc_metrics") if Version(self.version) >= "1.7.0": libraries.append("opentelemetry_exporter_otlp_grpc_client") - if self.options.with_logs_preview: libraries.append("opentelemetry_exporter_otlp_grpc_log") - - if self.options.get_safe("with_otlp_http"): + if self.options.with_otlp_http: libraries.append("opentelemetry_exporter_otlp_http") - - if Version(self.version) >= "1.1.0": - libraries.append("opentelemetry_exporter_otlp_http_client") - - if Version(self.version) >= "1.5.0": - libraries.append("opentelemetry_exporter_otlp_http_metric") - + libraries.append("opentelemetry_exporter_otlp_http_client") + libraries.append("opentelemetry_exporter_otlp_http_metric") if self.options.with_logs_preview: libraries.append("opentelemetry_exporter_otlp_http_log") - if self.options.with_prometheus: libraries.append("opentelemetry_exporter_prometheus") - if self.options.with_elasticsearch and self.options.with_logs_preview: libraries.append("opentelemetry_exporter_elasticsearch_logs") - if self.options.with_zipkin: libraries.append("opentelemetry_exporter_zipkin_trace") - - if self.options.with_jaeger: + if self.options.get_safe("with_jaeger"): libraries.append("opentelemetry_exporter_jaeger_trace") - - if Version(self.version) >= "1.2.0": - libraries.append("opentelemetry_metrics") - - if Version(self.version) >= "1.4.0": - libraries.append("opentelemetry_exporter_ostream_metrics") - + libraries.append("opentelemetry_metrics") + libraries.append("opentelemetry_exporter_ostream_metrics") if self.options.with_logs_preview: libraries.extend([ "opentelemetry_logs", "opentelemetry_exporter_ostream_logs", ]) - if self.settings.os == "Windows" and self.options.with_etw: libraries.append("opentelemetry_exporter_etw") - return libraries def package_info(self): @@ -372,20 +375,16 @@ def package_info(self): self.cpp_info.components["opentelemetry_common"].defines.append("HAVE_ABSEIL") self.cpp_info.components["opentelemetry_common"].requires.append("abseil::abseil") - if self.options.with_otlp: - self.cpp_info.components["opentelemetry_proto"].requires.extend([ - "opentelemetry-proto::opentelemetry-proto", - "protobuf::protobuf", - ]) - + if self.options.with_otlp_http or self.options.with_otlp_grpc: + self.cpp_info.components["opentelemetry_proto"].requires.append("protobuf::protobuf") self.cpp_info.components["opentelemetry_otlp_recordable"].requires.extend([ "opentelemetry_proto", "opentelemetry_resources", "opentelemetry_trace", ]) - if self.options.get_safe("with_otlp_grpc"): - if Version(self.version) >= "1.5.0" and Version(self.version) < "1.7.0": + if self.options.with_otlp_grpc: + if "1.5.0" <= Version(self.version) < "1.7.0": self.cpp_info.components["opentelemetry_exporter_otlp_grpc_metrics"].requires.extend([ "grpc::grpc++", "opentelemetry_otlp_recordable", @@ -419,13 +418,14 @@ def package_info(self): "opentelemetry_exporter_otlp_grpc_client", ]) - if (self.options.get_safe("with_otlp_http") or + if (self.options.with_otlp_http or self.options.with_zipkin or self.options.with_elasticsearch ): self.cpp_info.components[self._http_client_name].requires.append("libcurl::libcurl") + self.cpp_info.components[self._http_client_name].requires.append("openssl::openssl") - if self.options.get_safe("with_otlp_http"): + if self.options.with_otlp_http: self.cpp_info.components["opentelemetry_exporter_otlp_http_client"].requires.extend([ self._http_client_name, "nlohmann_json::nlohmann_json", @@ -437,11 +437,10 @@ def package_info(self): "opentelemetry_exporter_otlp_http_client", ]) - if Version(self.version) >= "1.5.0": - self.cpp_info.components["opentelemetry_exporter_otlp_http_metric"].requires.extend([ - "opentelemetry_otlp_recordable", - "opentelemetry_exporter_otlp_http_client" - ]) + self.cpp_info.components["opentelemetry_exporter_otlp_http_metric"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_http_client" + ]) if self.options.with_logs_preview: self.cpp_info.components["opentelemetry_exporter_otlp_http_log"].requires.extend([ @@ -456,7 +455,7 @@ def package_info(self): "opentelemetry_trace", ]) - if self.options.with_jaeger: + if self.options.get_safe("with_jaeger"): self.cpp_info.components["opentelemetry_exporter_jaeger_trace"].requires.extend([ self._http_client_name, "openssl::openssl", @@ -464,10 +463,9 @@ def package_info(self): "thrift::thrift", ]) - if Version(self.version) >= "1.3.0": - self.cpp_info.components["opentelemetry_exporter_jaeger_trace"].requires.append( - "boost::locale" - ) + self.cpp_info.components["opentelemetry_exporter_jaeger_trace"].requires.append( + "boost::locale" + ) if self.settings.os == "Windows" and self.options.with_etw: self.cpp_info.components["opentelemetry_exporter_etw"].libs = [] diff --git a/recipes/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch deleted file mode 100644 index ecdbb0cf0f9fc..0000000000000 --- a/recipes/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 9fb6f49..1f1547e 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -162,6 +162,10 @@ else() # cmake 3.8 or lower - target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() -diff --git a/exporters/zipkin/CMakeLists.txt b/exporters/zipkin/CMakeLists.txt -index 2316860..8995b31 100644 ---- a/exporters/zipkin/CMakeLists.txt -+++ b/exporters/zipkin/CMakeLists.txt -@@ -21,7 +21,7 @@ add_library(opentelemetry_exporter_zipkin_trace src/zipkin_exporter.cc - src/recordable.cc) - - target_link_libraries(opentelemetry_exporter_zipkin_trace -- PUBLIC opentelemetry_trace http_client_curl) -+ PUBLIC opentelemetry_trace http_client_curl nlohmann_json::nlohmann_json) - - install( - TARGETS opentelemetry_exporter_zipkin_trace diff --git a/recipes/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch deleted file mode 100644 index 275e2c9b44a66..0000000000000 --- a/recipes/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 8d8f868..2a78f98 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -214,6 +214,10 @@ else() - ${METRICS_SERVICE_PB_CPP_FILE}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(needs_proto_download) - add_dependencies(opentelemetry_proto opentelemetry-proto) - endif() diff --git a/recipes/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch deleted file mode 100644 index ce868fbedca22..0000000000000 --- a/recipes/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 09c21fd..a8d7d16 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -203,7 +203,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 8d8f868..2a78f98 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -214,6 +214,10 @@ else() - ${METRICS_SERVICE_PB_CPP_FILE}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(needs_proto_download) - add_dependencies(opentelemetry_proto opentelemetry-proto) - endif() diff --git a/recipes/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch deleted file mode 100644 index 1fcf5a0427738..0000000000000 --- a/recipes/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6d2b274..4611a6b 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -208,7 +208,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 37d45da..89395c0 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -215,6 +215,10 @@ else() - ${METRICS_SERVICE_PB_CPP_FILE}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(needs_proto_download) - add_dependencies(opentelemetry_proto opentelemetry-proto) - endif() diff --git a/recipes/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch deleted file mode 100644 index b3391855652c4..0000000000000 --- a/recipes/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a1b6934..d4f5251 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -209,7 +209,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 629ea81..3b09b92 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -242,6 +242,10 @@ else() # cmake 3.8 or lower - target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() diff --git a/recipes/opentelemetry-cpp/all/patches/1.7.0-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.7.0-0001-fix-cmake.patch deleted file mode 100644 index e5e3898386303..0000000000000 --- a/recipes/opentelemetry-cpp/all/patches/1.7.0-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e7597fc8..d880a90d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -217,7 +217,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 629ea815..3b09b92e 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -242,6 +242,10 @@ else() # cmake 3.8 or lower - target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() diff --git a/recipes/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch deleted file mode 100644 index 5c4fcae46b11b..0000000000000 --- a/recipes/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9b9710d..6eb42bb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -222,7 +222,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 47f57a6..ebf5869 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -280,6 +280,10 @@ else() # cmake 3.8 or lower - target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() diff --git a/recipes/opentelemetry-cpp/config.yml b/recipes/opentelemetry-cpp/config.yml index 4dd7c49be1a03..ea5fa8db677c4 100644 --- a/recipes/opentelemetry-cpp/config.yml +++ b/recipes/opentelemetry-cpp/config.yml @@ -1,17 +1,9 @@ versions: - "1.8.1": + "1.12.0": folder: all - "1.7.0": - folder: all - "1.6.1": - folder: all - "1.4.1": + "1.9.1": folder: all - "1.4.0": + "1.8.3": folder: all - "1.3.0": - folder: all - "1.2.0": - folder: all - "1.0.1": + "1.7.0": folder: all diff --git a/recipes/opentelemetry-proto/all/conandata.yml b/recipes/opentelemetry-proto/all/conandata.yml index 15e276cc4de55..818f6d6956d04 100644 --- a/recipes/opentelemetry-proto/all/conandata.yml +++ b/recipes/opentelemetry-proto/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.1.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.1.0.tar.gz" + sha256: "df491a05f3fcbf86cc5ba5c9de81f6a624d74d4773d7009d573e37d6e2b6af64" + "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" "0.19.0": url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v0.19.0.tar.gz" sha256: "464bc2b348e674a1a03142e403cbccb01be8655b6de0f8bfe733ea31fcd421be" diff --git a/recipes/opentelemetry-proto/all/conanfile.py b/recipes/opentelemetry-proto/all/conanfile.py index 8b2d929914548..b24f1a700e446 100644 --- a/recipes/opentelemetry-proto/all/conanfile.py +++ b/recipes/opentelemetry-proto/all/conanfile.py @@ -1,9 +1,10 @@ import os -from pathlib import Path -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class OpenTelemetryProtoConan(ConanFile): @@ -12,25 +13,33 @@ class OpenTelemetryProtoConan(ConanFile): 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") - no_copy_source = True + topics = ("opentelemetry", "telemetry", "otlp", "pre-built") - @property - def _source_subfolder(self): - return os.path.join(self.source_folder, "source_subfolder") + package_type = "build-scripts" + settings = "os", "arch", "compiler", "build_type" - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, - strip_root=True) + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def build(self): + 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("*.proto", dst="res", src=self._source_subfolder) - # satisfy KB-H014 (header_only recipes require headers) - tools.save(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.user_info.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 = [] - self.cpp_info.resdirs = [] + + # 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 533d3d56112fa..43eb202cc1d23 100644 --- a/recipes/opentelemetry-proto/all/test_package/conanfile.py +++ b/recipes/opentelemetry-proto/all/test_package/conanfile.py @@ -1,9 +1,24 @@ import os -from conans import ConanFile + +from conan import ConanFile +from conan.tools.files import save, load +from conan.tools.layout import basic_layout class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + 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): - res_folder = self.deps_user_info["opentelemetry-proto"].proto_root - assert os.path.isfile(os.path.join(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/all/test_v1_package/conanfile.py b/recipes/opentelemetry-proto/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c5940f5104d54 --- /dev/null +++ b/recipes/opentelemetry-proto/all/test_v1_package/conanfile.py @@ -0,0 +1,7 @@ +from conans import ConanFile, CMake +import os + +class TestPackageV1Conan(ConanFile): + def test(self): + res_folder = self.deps_user_info["opentelemetry-proto"].proto_root + assert os.path.isfile(os.path.join(res_folder, "opentelemetry", "proto", "common", "v1", "common.proto")) diff --git a/recipes/opentelemetry-proto/config.yml b/recipes/opentelemetry-proto/config.yml index a5c8b6c0c2e34..471fe8eea644f 100644 --- a/recipes/opentelemetry-proto/config.yml +++ b/recipes/opentelemetry-proto/config.yml @@ -1,4 +1,10 @@ versions: + "1.1.0": + folder: all + "1.0.0": + folder: all + "0.20.0": + folder: all "0.19.0": folder: all "0.18.0": diff --git a/recipes/opentracing-cpp/all/CMakeLists.txt b/recipes/opentracing-cpp/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb9..0000000000000 --- 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 97fc5249ab98a..98d819b31175b 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 16f16b80280d2..bd664e1278224 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 124ca7e918838..e9ddbfa9df183 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 abcaeed3f89b6..ef5d7042163ec 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 ca88714cbdbf7..85d2151582572 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 0000000000000..91630d79f4abb --- /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 0000000000000..abcaeed3f89b6 --- /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 f36eb55cee0f2..10e73dc4150e4 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 0000000000000..c1fa2ac395507 --- /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 0000000000000..b1cfc1fd2fe86 --- /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 0000000000000..fd126ded2ddee --- /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 0000000000000..aaa60d5c30197 --- /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 0000000000000..da6548b7c9115 --- /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 0000000000000..2df86d8ed0ec6 --- /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 0000000000000..e5791b37c7a7a --- /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 0000000000000..7659f10e22501 --- /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 0000000000000..50b087b4268b4 --- /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 0000000000000..4184c1832cef3 --- /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 0000000000000..552078a68bae7 --- /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 0000000000000..36844097643e0 --- /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 0000000000000..60799331791bd --- /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 0000000000000..9d90e91b9a9f9 --- /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 0000000000000..1cea5771a2dbf --- /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 0000000000000..baaef66559aa4 --- /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 0000000000000..60f706469b185 --- /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 d7e0ee962c3b2..5ac1b419900e1 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 59334d5077368..3360afdd0ecab 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 ec4750c742092..e9cced5a0a16c 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 5e59c1a6652d9..e916db567410d 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 862ef733ccf23..62d76f92e8327 100644 --- a/recipes/outcome/all/conandata.yml +++ b/recipes/outcome/all/conandata.yml @@ -1,22 +1,13 @@ sources: - "2.2.3": - url: "https://github.com/ned14/outcome/archive/v2.2.3.tar.gz" - sha256: "31cc987d73b2625a70f35083ccff26d1c2634d89304f1ea606a294da36cb2958" - "2.2.2": - url: "https://github.com/ned14/outcome/archive/v2.2.2.tar.gz" - sha256: "fc16bc24f8a7d10dc24b9cc3abd1609f67b29aab2c8da546d123d518e9c29dbb" - "2.2.1": - url: "https://github.com/ned14/outcome/archive/v2.2.1.tar.gz" - sha256: "cf21a9cba8c7d943a6310012626344618923f2ea367ccee6cb499eee8bb97147" - "2.2.0": - url: "https://github.com/ned14/outcome/archive/v2.2.0.tar.gz" - sha256: "eb7a54e74c7ed7e208ab4a610a56e619c82b2797236aee7cff3303a649f24e0e" + "2.2.8": + url: "https://github.com/ned14/outcome/archive/v2.2.8.tar.gz" + sha256: "6ef322867aee454792bd71b61950703dd18608670a69a1780cab81be22f78a1e" + "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" "2.1.5": url: "https://github.com/ned14/outcome/archive/v2.1.5.tar.gz" sha256: "e238e545753e2b00a7eefabeb677c9918c7a5402ad347b67de328089b4e15493" - "2.1.4": - url: "https://github.com/ned14/outcome/archive/v2.1.4.tar.gz" - sha256: "19463d2c9bb0bcdc1c0334b02b344caeb5fc723ab060155c959be8e0b551cf76" - "2.1.3": - url: "https://github.com/ned14/outcome/archive/v2.1.3.tar.gz" - sha256: "45ee2f720bd0965047c35bd0ea719656c9de51c49d13c6a82797fca325b8426a" diff --git a/recipes/outcome/config.yml b/recipes/outcome/config.yml index 5e58124a1d058..783025ec22c41 100644 --- a/recipes/outcome/config.yml +++ b/recipes/outcome/config.yml @@ -1,15 +1,9 @@ versions: - "2.2.3": + "2.2.8": folder: all - "2.2.2": + "2.2.7": folder: all - "2.2.1": - folder: all - "2.2.0": + "2.2.4": folder: all "2.1.5": folder: all - "2.1.4": - folder: all - "2.1.3": - folder: all diff --git a/recipes/ozz-animation/all/CMakeLists.txt b/recipes/ozz-animation/all/CMakeLists.txt deleted file mode 100644 index 73c551783746d..0000000000000 --- 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 548e0d6eb8858..ace2364367ed0 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 7266f8b1ea03c..6a87de84d42e5 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 ef4d8f93d6c96..0c1c8ada3a5be 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 4903f1a7e8fa0..304895d77753a 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 9202b08874e2c..6ed8f2ae5d31c 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 0000000000000..ef4d8f93d6c96 --- /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 0000000000000..4903f1a7e8fa0 --- /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 0000000000000..9202b08874e2c --- /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 a9085cf3fa2b2..8e1c91c8b156c 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/p-ranav-glob/all/conanfile.py b/recipes/p-ranav-glob/all/conanfile.py index 3db82dd1c8225..882ff198b6b6c 100644 --- a/recipes/p-ranav-glob/all/conanfile.py +++ b/recipes/p-ranav-glob/all/conanfile.py @@ -1,23 +1,26 @@ 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 PRanavGlobConan(ConanFile): name = "p-ranav-glob" + description = "Glob for C++17" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/p-ranav/glob" - description = "Glob for C++17" topics = ("c++17", "config", "filesystem", "header-only") - settings = "compiler" - no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _compilers_minimum_version(self): @@ -28,23 +31,33 @@ def _compilers_minimum_version(self): "apple-clang": "11", } - def configure(self): + 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, 17) + check_min_cppstd(self, 17) 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++17, which your compiler does not support.") else: - self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) - - def package_id(self): - self.info.header_only() + self.output.warning(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") 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, "single_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, "single_include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/p-ranav-glob/all/test_package/CMakeLists.txt b/recipes/p-ranav-glob/all/test_package/CMakeLists.txt index 481262167c9f5..5baf64aba53ee 100644 --- a/recipes/p-ranav-glob/all/test_package/CMakeLists.txt +++ b/recipes/p-ranav-glob/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(p-ranav-glob REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE p-ranav-glob::p-ranav-glob) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/p-ranav-glob/all/test_package/conanfile.py b/recipes/p-ranav-glob/all/test_package/conanfile.py index 4903f1a7e8fa0..ef5d7042163ec 100644 --- a/recipes/p-ranav-glob/all/test_package/conanfile.py +++ b/recipes/p-ranav-glob/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/p-ranav-glob/all/test_v1_package/CMakeLists.txt b/recipes/p-ranav-glob/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/p-ranav-glob/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/p-ranav-glob/all/test_v1_package/conanfile.py b/recipes/p-ranav-glob/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6c9d5dba712c7 --- /dev/null +++ b/recipes/p-ranav-glob/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/paho-mqtt-c/all/conandata.yml b/recipes/paho-mqtt-c/all/conandata.yml index 97257e57f3eab..fb14bce735ef1 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 7d5e8aea45866..5fed002dda09d 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 5cba065a6c822..a4dfc7805d29c 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 9c18999c225be..5655ba304a520 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 454c47bb2cbab..272ae426964be 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 a59a26a52c8dc..ef5d7042163ec 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 0000000000000..8a45d0928397d --- /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 d5884326032ea..0000000000000 --- 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 0000000000000..91630d79f4abb --- /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 0000000000000..abcaeed3f89b6 --- /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 5b6ed6e7fb074..dcdd7cd8a501e 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 e810473c6e2e7..3e06bdb26e652 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 d8dcf1537c358..5f3e3f51ac110 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 d120a992c06a6..0a6bc68712d90 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 a8a50d11cadad..a1c1439981d11 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 ea07630def81d..5aea9449b5c81 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 799c3f613ca57..72c50c78f7433 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 0e70a696cc039..ef4d18c549aef 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 187d95623fba1..ee46ccf27506c 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 86f0279553123..5030221edcc76 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 0000000000000..91630d79f4abb --- /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 0000000000000..86f0279553123 --- /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 732f7eb9a62dd..6503626e2502c 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 9385c94daf7b2..0a5b78dee92b9 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 904e2cf4472db..b41b9ff27f477 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 0782807cb46ce..f1bedb2bb26d8 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 432799d5aaab2..0000000000000 --- 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 529d052902f81..236ef4b15fa0a 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 9aee2f753fe6d..8ae53d392140a 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 9f0ff5e7f11af..e01a140f079aa 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 1ed584307b354..bd118a1d0023b 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 0000000000000..91630d79f4abb --- /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 0000000000000..1ed584307b354 --- /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 81c0b9ecee392..06df1f3ce6232 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 0000000000000..26ff7631cb671 --- /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 0000000000000..e1a985494deda --- /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 0000000000000..d30ed5e5eaa78 --- /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 0000000000000..cc326072eb57b --- /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 0000000000000..65ce01f5c61cb --- /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 26e119bb00764..d89c980a8be55 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 0000000000000..6eea92ef4a761 --- /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 0000000000000..3d3a9f2fd7b3e --- /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 0000000000000..5dfeedf59e5f4 --- /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 0000000000000..35fba73e8b067 --- /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 0000000000000..5461a0bfed49e --- /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 0000000000000..34cf4a671e285 --- /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 0000000000000..57794a612df2a --- /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 0000000000000..02eb5ce439fb4 --- /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 0000000000000..cca717d08eb8f --- /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 0000000000000..aac1819cc10c0 --- /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 8d0c74976c81b..ca51bc38829c6 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 5982290e7cdbe..14600c9abe85c 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 217b9530b904d..0000000000000 --- 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 c9fb1fa9f32f7..3a01de34987fe 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 7b9b613cbb24a..06f34416c70f6 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 4aebe114eeb59..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..3f4a9f50f389e --- /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 0000000000000..b1b2eb4b8f3ff --- /dev/null +++ b/recipes/pdf-writer/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "4.6.3": + url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.6.3.tar.gz" + sha256: "3b5d9ba4b49d0380678e8172f27cdb8eda196ea448e7f1cdd79620066d082ab9" + "4.6.2": + url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.6.2.tar.gz" + sha256: "0a36815ccc9d207028567f90039785c824b211169ba5da68de84d0c15455ab62" + "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.3": + - patch_file: "patches/4.6.2-0001-fix-cmake.patch" + patch_description: "disable cpack" + patch_type: "conan" + "4.6.2": + - patch_file: "patches/4.6.2-0001-fix-cmake.patch" + patch_description: "disable cpack" + patch_type: "conan" + "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 0000000000000..976af4f35f825 --- /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 0000000000000..02aec77b37c06 --- /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/patches/4.6.2-0001-fix-cmake.patch b/recipes/pdf-writer/all/patches/4.6.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..ffff2588e7efa --- /dev/null +++ b/recipes/pdf-writer/all/patches/4.6.2-0001-fix-cmake.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e32c883..e9ab456 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -161,13 +161,13 @@ if(PROJECT_IS_TOP_LEVEL AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/PDFWriterTesting) + ADD_SUBDIRECTORY(PDFWriterTesting) + 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 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 0000000000000..079a134d31c95 --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..aa251ff45f385 --- /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 0000000000000..44bc3d66897b6 --- /dev/null +++ b/recipes/pdf-writer/config.yml @@ -0,0 +1,9 @@ +versions: + "4.6.3": + folder: all + "4.6.2": + folder: all + "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 f083cc38ef65c..0000000000000 --- 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 06bb1b45201c1..914f93df79f0d 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 e8af8fb6f31c4..7a5488384bc9e 100644 --- a/recipes/pdfium/all/conanfile.py +++ b/recipes/pdfium/all/conanfile.py @@ -1,17 +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 +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 + +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], @@ -24,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.10.4") - self.requires("icu/69.1") - self.requires("lcms/2.11") - self.requires("openjpeg/2.4.0") + 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/9d") + self.requires("libjpeg/9e") elif self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.0") - - def build_requirements(self): - self.build_requires("pkgconf/1.7.4") + 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 tools.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): - tools.get(**self.conan_data["sources"][self.version]["pdfium-cmake"], - destination="pdfium-cmake", strip_root=True) - tools.get(**self.conan_data["sources"][self.version]["pdfium"], - destination=self._source_subfolder) - tools.get(**self.conan_data["sources"][self.version]["trace_event"], - destination=os.path.join(self._source_subfolder, "base", "trace_event", "common")) - tools.get(**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 + get(self, **self.conan_data["sources"][self.version]["pdfium-cmake"], + destination=os.path.join(self.source_folder, "pdfium-cmake"), strip_root=True) + get(self, **self.conan_data["sources"][self.version]["pdfium"], + destination=self.source_folder) + get(self, **self.conan_data["sources"][self.version]["trace_event"], + 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_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 7b9b613cbb24a..ca11fa5323a30 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 32e61b0a20959..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..4c2f046547705 --- /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 a851713f93a20..6425f0ce6fe06 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 c6b4987b3d5ef..0a1df56b8a3d7 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 d120a992c06a6..0a6bc68712d90 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 400c3982bde1a..b21cc49efde95 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 72be9d8648e78..7cffe456681ae 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 2b1346904f2b5..cfea4cd9b1a61 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 4001f8991b676..451dee24987b0 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 0000000000000..4001f8991b676 --- /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 2fbc0e9ee87b3..7fcc5a39bf3d7 100644 --- a/recipes/perfetto/all/conandata.yml +++ b/recipes/perfetto/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "41.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v41.0.tar.gz" + sha256: "4c8fe8a609fcc77ca653ec85f387ab6c3a048fcd8df9275a1aa8087984b89db8" + "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" "34.0": url: "https://github.com/google/perfetto/archive/refs/tags/v34.0.tar.gz" sha256: "81dbf2fac446a0389c80e309b2060dcccd926012ce2a61621a47e3e432aee8c1" @@ -20,27 +38,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" @@ -48,13 +45,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 44d0edf055cd6..6c9cecd7c62ef 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 27f4b089cd4fd..0000000000000 --- 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 56e86bb66c9e9..0000000000000 --- 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 5e4004e7ada01..0000000000000 --- 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 d109447e2946e..0000000000000 --- 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 0c134a6c0d779..441b287e9826f 100644 --- a/recipes/perfetto/config.yml +++ b/recipes/perfetto/config.yml @@ -1,4 +1,16 @@ versions: + "41.0": + folder: all + "40.0": + folder: all + "39.0": + folder: all + "38.0": + folder: all + "37.0": + folder: all + "35.0": + folder: all "34.0": folder: all "32.1": @@ -13,17 +25,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 5b08eb793f8dc..17b38bf1e163f 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 44edf44c3e48f..88c3b2437f34a 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 7345b4f993eae..c25a9626aeb52 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 cd2e47277e1d7..8919154c6885e 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 0000000000000..91630d79f4abb --- /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 0000000000000..ecb888f16f156 --- /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 a92db9416c3b3..ad60c0a68373e 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 656874f312592..979e702ffcb5f 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 0bbacb7273fdf..f6484b7236c42 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 d9b367577730d..eb0d152fc4aa2 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 70bc84cbc789f..c2e8937d21d4a 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 f24c18a1bb2e1..39ba4f454e712 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 910ae60d10438..ef5d7042163ec 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 5279bc00ec63c..2050756e502b3 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 1f4279689a6c3..64d7ea0c4a642 100644 --- a/recipes/pixman/all/conandata.yml +++ b/recipes/pixman/all/conandata.yml @@ -1,11 +1,30 @@ sources: + "0.43.0": + url: + - "https://www.cairographics.org/releases/pixman-0.43.0.tar.gz" + - "https://www.x.org/releases/individual/lib/pixman-0.43.0.tar.gz" + sha256: "a65c28209858fb16bee50d809c80f90a8e415c0e4fd8321078a1822785a5560a" + "0.42.2": + url: + - "https://www.cairographics.org/releases/pixman-0.42.2.tar.gz" + - "https://www.x.org/releases/individual/lib/pixman-0.42.2.tar.gz" + sha256: "ea1480efada2fd948bc75366f7c349e1c96d3297d09a3fe62626e38e234a625e" "0.40.0": - url: "https://www.cairographics.org/releases/pixman-0.40.0.tar.gz" + url: + - "https://www.cairographics.org/releases/pixman-0.40.0.tar.gz" + - "https://www.x.org/releases/individual/lib/pixman-0.40.0.tar.gz" sha256: "6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc" "0.38.4": - url: "https://www.cairographics.org/releases/pixman-0.38.4.tar.gz" + url: + - "https://www.cairographics.org/releases/pixman-0.38.4.tar.gz" + - "https://www.x.org/releases/individual/lib/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 94146c6c721b7..aca2fe9a7ec26 100644 --- a/recipes/pixman/all/conanfile.py +++ b/recipes/pixman/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.apple import fix_apple_shared_install_name from conan.tools.env import VirtualBuildEnv from conan.tools.files import ( - apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, + apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir ) from conan.tools.layout import basic_layout @@ -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.0.0") + self.tool_requires("meson/1.2.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -93,7 +93,7 @@ def package(self): rename(self, os.path.join(lib_folder, f"{prefix}.a"), os.path.join(lib_folder, f"{prefix}.lib")) def package_info(self): - self.cpp_info.libs = collect_libs(self) + self.cpp_info.libs = ['libpixman-1'] if self.settings.os == "Windows" else ['pixman-1'] self.cpp_info.includedirs.append(os.path.join("include", "pixman-1")) self.cpp_info.set_property("pkg_config_name", "pixman-1") if self.settings.os in ("FreeBSD", "Linux"): 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 0000000000000..4507dc378d06c --- /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 b237af91644c9..1daaad4889538 100644 --- a/recipes/pixman/config.yml +++ b/recipes/pixman/config.yml @@ -1,4 +1,8 @@ versions: + "0.43.0": + folder: "all" + "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 e18df3ec61ad1..413c62bff29ba 100644 --- a/recipes/pkgconf/all/conandata.yml +++ b/recipes/pkgconf/all/conandata.yml @@ -1,14 +1,34 @@ 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" "1.9.3": - url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.9.3.tar.xz" + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.9.3.tar.xz" sha256: "5fb355b487d54fb6d341e4f18d4e2f7e813a6622cf03a9e87affa6a40565699d" "1.7.4": - url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.4.tar.xz" + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.7.4.tar.xz" sha256: "d73f32c248a4591139a6b17777c80d4deab6b414ec2b3d21d0a24be348c476ab" "1.7.3": - url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.3.tar.xz" + 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": - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" "1.7.4": diff --git a/recipes/pkgconf/all/conanfile.py b/recipes/pkgconf/all/conanfile.py index 33928609ef2e5..673b980405e75 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" @@ -48,15 +47,19 @@ def configure(self): self.options.rm_safe("shared") elif self.options.shared: self.options.rm_safe("fPIC") - + 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) @@ -74,7 +77,11 @@ def generate(self): env.generate() tc = MesonToolchain(self) - tc.project_options["tests"] = False + if Version(self.version) >= "1.9.4": + tc.project_options["tests"] = "disabled" + else: + tc.project_options["tests"] = False + if not self.options.enable_lib: tc.project_options["default_library"] = "static" tc.generate() @@ -96,22 +103,18 @@ def package(self): if self.options.enable_lib and not self.options.shared: rename(self, os.path.join(self.package_folder, "lib", "libpkgconf.a"), os.path.join(self.package_folder, "lib", "pkgconf.lib"),) - + if not self.options.enable_lib: 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", "man")) rename(self, os.path.join(self.package_folder, "share", "aclocal"), os.path.join(self.package_folder, "bin", "aclocal")) 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") @@ -125,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") @@ -140,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 0000000000000..ad4d094366b00 --- /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 9816b088e4d7b..f64bc13961492 100644 --- a/recipes/pkgconf/config.yml +++ b/recipes/pkgconf/config.yml @@ -1,4 +1,12 @@ versions: + "2.1.0": + folder: "all" + "2.0.3": + folder: "all" + "2.0.2": + folder: "all" + "1.9.5": + folder: "all" "1.9.3": folder: "all" "1.7.4": diff --git a/recipes/platform.converters/all/conandata.yml b/recipes/platform.converters/all/conandata.yml index dbc2ae3eae699..f7a43902b2ca7 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 4991da89bae2c..898832d2cd9d4 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 80c8108b7c3f7..3372d3e73b186 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 49a3a66ea5bad..ef5d7042163ec 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 283e7f59b558b..47a24cfe4903b 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 9d13e79d6d995..cf054ea78bcab 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 e352e58aa4f01..28942c0367e11 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 dadfcbe5ecf0a..a63090495da9c 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 d4128b0450777..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 0906286bf1225..7914985fc71b1 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 82435a6d7e4a8..f7e585564ab8a 100644 --- a/recipes/platform.hashing/all/conandata.yml +++ b/recipes/platform.hashing/all/conandata.yml @@ -1,10 +1,16 @@ sources: - "0.2.0": - url: https://github.com/linksplatform/Hashing/archive/refs/tags/0.2.0.zip - sha256: 8e34a10d2768d0f2d9ba0cbb88ce193b32245c5a46f14f7ec860c9fddbe8f39f - "0.3.0": - url: https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.3.0.zip - sha256: 8f7d6d401eaec1a78d1f10bfa3783b31ac6189a6ea8edf1ef7f300c47c0e5cb1 + "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" "0.4.0": - url: https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.4.0.zip - sha256: afb8a27a483f636515ca4289f2bfa80fbd37c8416631f0b3ff7001d17a054320 + url: "https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.4.0.zip" + sha256: "afb8a27a483f636515ca4289f2bfa80fbd37c8416631f0b3ff7001d17a054320" + "0.3.0": + url: "https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.3.0.zip" + sha256: "8f7d6d401eaec1a78d1f10bfa3783b31ac6189a6ea8edf1ef7f300c47c0e5cb1" + "0.2.0": + url: "https://github.com/linksplatform/Hashing/archive/refs/tags/0.2.0.zip" + sha256: "8e34a10d2768d0f2d9ba0cbb88ce193b32245c5a46f14f7ec860c9fddbe8f39f" diff --git a/recipes/platform.hashing/all/conanfile.py b/recipes/platform.hashing/all/conanfile.py index 7e465451b8a23..0e0affe79e746 100644 --- a/recipes/platform.hashing/all/conanfile.py +++ b/recipes/platform.hashing/all/conanfile.py @@ -1,91 +1,107 @@ from conan import ConanFile -try: - from conan.tools.build import check_min_cppstd -except ImportError: - from conans.tools import check_min_cppstd # FIXME : not in 1.49 -from conan.tools.files import get -from conan.tools.scm import Version 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.33.0" +required_conan_version = ">=1.52.0" class PlatformInterfacesConan(ConanFile): name = "platform.hashing" - license = "LGPL-3.0-only" - homepage = "https://github.com/linksplatform/Hashing" - url = "https://github.com/conan-io/conan-center-index" description = "platform.hashing is one of the libraries of the LinksPlatform modular framework, " \ "which contains std::hash specializations for:\n" \ " - trivial and standard-layout types\n" \ " - types constrained by std::ranges::range\n" \ " - std::any" - topics = ("linksplatform", "cpp20", "hashing", "any", "ranges", "native") - settings = "compiler", "arch" + license = "LGPL-3.0-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/linksplatform/Hashing" + topics = ("linksplatform", "cpp20", "hashing", "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 _internal_cpp_subfolder(self): + return os.path.join(self.source_folder, "cpp", "Platform.Hashing") @property - def _internal_cpp_subfolder(self): - return os.path.join(self._source_subfolder, "cpp", "Platform.Hashing") + 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" } - @property - def _minimum_cpp_standard(self): - return 20 - - def validate(self): - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + def layout(self): + basic_layout(self, src_folder="src") - if not minimum_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) + def requirements(self): + 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) - elif 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"): - check_min_cppstd(self, self._minimum_cpp_standard) + 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.arch in ("x86", ): - raise ConanInvalidConfiguration("{} does not support arch={}".format(self.name, self.settings.arch)) - - def package_id(self): - self.info.header_only() + raise ConanInvalidConfiguration(f"{self.ref} does not support arch={self.settings.arch}") 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("*.h", dst="include", src=self._internal_cpp_subfolder) - 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 + ) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "cpp", "Platform.Hashing") + ) def package_info(self): self.cpp_info.libdirs = [] - suggested_flags = "" - if self.settings.compiler != "Visual Studio": + self.cpp_info.bindirs = [] + if is_msvc(self): + if Version(self.version) >= "0.5.0": + arch_macros = { + "x86_64": "_X86_64_", + "armv8": "_AARCH_", + }.get(str(self.settings.arch), "") + self.cpp_info.defines.append(arch_macros) + else: suggested_flags = { "x86_64": "-march=haswell", "armv7": "-march=armv7", "armv8": "-march=armv8-a", }.get(str(self.settings.arch), "") - self.user_info.suggested_flags = suggested_flags + self.conf_info.define("user.platform_hashing:suggested_flags", suggested_flags) - if "-march" not in "{} {}".format(os.environ.get("CPPFLAGS", ""), os.environ.get("CXXFLAGS", "")): - self.output.warn("platform.hashing needs to have `-march=ARCH` added to CPPFLAGS/CXXFLAGS. " - "A suggestion is available in deps_user_info[{name}].suggested_flags.".format(name=self.name)) + if "-march" not in "{} {}".format(os.environ.get("CPPFLAGS", ""), os.environ.get("CXXFLAGS", "")): + self.output.warning("platform.hashing needs to have `-march=ARCH` added to CPPFLAGS/CXXFLAGS. " + f"A suggestion is available in dependencies[{self.name}].conf_info.get(\"user.platform_hashing:suggested_flags\")") diff --git a/recipes/platform.hashing/all/test_package/CMakeLists.txt b/recipes/platform.hashing/all/test_package/CMakeLists.txt index f3ca06da8ddf9..bbee5010aae03 100644 --- a/recipes/platform.hashing/all/test_package/CMakeLists.txt +++ b/recipes/platform.hashing/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) set(EXTRA_FLAGS "" CACHE STRING "Extra compiler flags") separate_arguments(EXTRA_FLAGS UNIX_COMMAND ${EXTRA_FLAGS}) @@ -7,9 +7,8 @@ if(EXTRA_FLAGS) add_compile_options(${EXTRA_FLAGS}) endif() -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(platform.hashing REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) +target_link_libraries(${PROJECT_NAME} PRIVATE platform.hashing::platform.hashing) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/platform.hashing/all/test_package/conanfile.py b/recipes/platform.hashing/all/test_package/conanfile.py index ef7d3547638fa..f5e26207308c7 100644 --- a/recipes/platform.hashing/all/test_package/conanfile.py +++ b/recipes/platform.hashing/all/test_package/conanfile.py @@ -1,28 +1,38 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException +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 import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" @property def _extra_flags(self): - return self.deps_user_info["platform.hashing"].suggested_flags + return self.dependencies["platform.hashing"].conf_info.get("user.platform_hashing:suggested_flags", check_type=str) - def build(self): - if self.settings.compiler != "Visual Studio": - if not self._extra_flags: - raise ConanException("Suggested flags are not available for os={}/arch={}".format(self.settings.os, self.settings.arch)) + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + def generate(self): + tc = CMakeToolchain(self) + if not is_msvc(self): + tc.variables["EXTRA_FLAGS"] = self._extra_flags + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): cmake = CMake(self) - if self.settings.compiler != "Visual Studio": - cmake.definitions["EXTRA_FLAGS"] = self._extra_flags 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/platform.hashing/config.yml b/recipes/platform.hashing/config.yml index ee25f0e067a38..4a9a6395456f8 100644 --- a/recipes/platform.hashing/config.yml +++ b/recipes/platform.hashing/config.yml @@ -1,7 +1,11 @@ versions: - "0.2.0": + "0.5.6": folder: all - "0.3.0": + "0.5.5": folder: all "0.4.0": folder: all + "0.3.0": + folder: all + "0.2.0": + folder: all diff --git a/recipes/playrho/all/CMakeLists.txt b/recipes/playrho/all/CMakeLists.txt deleted file mode 100644 index 7d5ba25565b0a..0000000000000 --- 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 03bf919319da8..df36531f2762c 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 9aab4b29f12b3..619e24882a463 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 cf755d3555681..6486eec980147 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 61ac8b9318290..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..61ac8b9318290 --- /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/plf_colony/all/conandata.yml b/recipes/plf_colony/all/conandata.yml index 7d323fe98a8c9..796a27e497755 100644 --- a/recipes/plf_colony/all/conandata.yml +++ b/recipes/plf_colony/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.39": + url: "https://github.com/mattreecebentley/plf_colony/archive/5bb011979a33ee29b4c57ee6a7813a22efc419b7.tar.gz" + sha256: "15812bbd5899d6845d9aeb38ecc6b2884e221326516496a76ebbcc2fb7c3f48b" "7.06": url: "https://github.com/mattreecebentley/plf_colony/archive/348174f0da2ea65b7a561b08412e81ce1f5e6161.tar.gz" sha256: "c6a34d08d4946f0ce54a9836b564b329afffc7ce173720282c7e2b0b57cbc484" diff --git a/recipes/plf_colony/config.yml b/recipes/plf_colony/config.yml index d7dde26d155d4..36d026c86b004 100644 --- a/recipes/plf_colony/config.yml +++ b/recipes/plf_colony/config.yml @@ -1,4 +1,6 @@ versions: + "7.39": + folder: all "7.06": folder: all "7.03": diff --git a/recipes/plf_indiesort/all/conandata.yml b/recipes/plf_indiesort/all/conandata.yml index 8b79bf367fbc1..9638aa153a749 100644 --- a/recipes/plf_indiesort/all/conandata.yml +++ b/recipes/plf_indiesort/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.41": + url: "https://github.com/mattreecebentley/plf_indiesort/archive/fce3d54ed1a43e9e7008703f79c4f4d2e5259176.tar.gz" + sha256: "34cca5e0a20f278dfcd963d18653b9440b1b590f5f193d0e68115f5a1a80bf6f" "1.18": url: "https://github.com/mattreecebentley/plf_indiesort/archive/1999a3017b3a3699f426608841a5a66e0849880d.tar.gz" sha256: "1c035243adbd63d89a61f8a0e8bbea1911ab9421467da9e5d618c30f10f16f91" diff --git a/recipes/plf_indiesort/config.yml b/recipes/plf_indiesort/config.yml index 5b4c7706184cf..473415a4e082f 100644 --- a/recipes/plf_indiesort/config.yml +++ b/recipes/plf_indiesort/config.yml @@ -1,4 +1,6 @@ versions: + "1.41": + folder: all "1.18": folder: all "1.15": diff --git a/recipes/plf_list/all/conandata.yml b/recipes/plf_list/all/conandata.yml index 69ea21b761e16..6f1a0b798e6f8 100644 --- a/recipes/plf_list/all/conandata.yml +++ b/recipes/plf_list/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.70": + url: "https://github.com/mattreecebentley/plf_list/archive/c48d271caad535a783a37e418e1f146040934a30.tar.gz" + sha256: "d6bd1dfb4e7e02804ad91c5a06c9d6f3a3512499ce5c3c0a633eba5e67e90930" "2.57": url: "https://github.com/mattreecebentley/plf_list/archive/d7a06d7497dc01261dd2c2fe675a8b605acb7a56.tar.gz" sha256: "4297c7578fe5ea2c6346541b28a57d87ec311522fa55bc8a5ab069921fc073e9" diff --git a/recipes/plf_list/all/conanfile.py b/recipes/plf_list/all/conanfile.py index 93c3eafa9a2e2..a5286712197f8 100644 --- a/recipes/plf_list/all/conanfile.py +++ b/recipes/plf_list/all/conanfile.py @@ -1,8 +1,12 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd 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 import os + required_conan_version = ">=1.50.0" @@ -15,6 +19,20 @@ class PlflistConan(ConanFile): homepage = "https://github.com/mattreecebentley/plf_list" settings = "os", "arch", "compiler", "build_type" + @property + def _min_cppstd(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "9", + "msvc": "191", + "Visual Studio": "15", + } + def export_sources(self): export_conandata_patches(self) @@ -24,9 +42,18 @@ def package_id(self): def layout(self): basic_layout(self, src_folder="src") + def validate(self): + if Version(self.version) >= "2.70": + 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.", + ) + 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/plf_list/all/test_package/CMakeLists.txt b/recipes/plf_list/all/test_package/CMakeLists.txt index 9871eca4a6f1f..0ca253af213ab 100644 --- a/recipes/plf_list/all/test_package/CMakeLists.txt +++ b/recipes/plf_list/all/test_package/CMakeLists.txt @@ -5,3 +5,6 @@ find_package(plf_list REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE plf_list::plf_list) +if (plf_list_VERSION VERSION_GREATER_EQUAL 2.70) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/plf_list/config.yml b/recipes/plf_list/config.yml index ca1f4fbf159c4..2dc3d36de7cf2 100644 --- a/recipes/plf_list/config.yml +++ b/recipes/plf_list/config.yml @@ -1,4 +1,6 @@ versions: + "2.70": + folder: all "2.57": folder: all "2.52": diff --git a/recipes/plf_queue/all/conandata.yml b/recipes/plf_queue/all/conandata.yml index c563552517b10..70bc260cc9892 100644 --- a/recipes/plf_queue/all/conandata.yml +++ b/recipes/plf_queue/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.2": + url: "https://github.com/mattreecebentley/plf_queue/archive/1fb9d87a210f7813450ee54a469f9f79ea4ec872.tar.gz" + sha256: "812976e4ebc50556891590e1ba066fbe7b73518749e86bbe227428152a3820c8" "1.22": url: "https://github.com/mattreecebentley/plf_queue/archive/bef2bda67cb4cadfd5dceaaf2c8f037c540a12bc.tar.gz" sha256: "96da3d7f27c62b39a147bc38a8d9f3a1a5f1cb0bfcc3b37d5ee2c7c056ad368e" diff --git a/recipes/plf_queue/config.yml b/recipes/plf_queue/config.yml index 60c525e6c3382..35e06c7f4e645 100644 --- a/recipes/plf_queue/config.yml +++ b/recipes/plf_queue/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.2": + folder: all "1.22": folder: all "1.21": diff --git a/recipes/plf_stack/all/conandata.yml b/recipes/plf_stack/all/conandata.yml index cf7e7157c6209..033e21f0986b6 100644 --- a/recipes/plf_stack/all/conandata.yml +++ b/recipes/plf_stack/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.1": + url: "https://github.com/mattreecebentley/plf_stack/archive/9d11bf2c5de5df739c0943af942a544c95b26ffa.tar.gz" + sha256: "2dd0092fbfc1e3d071398c6ef35cede807b4774fddfd892401f432e7d9efcc5b" "1.64": url: "https://github.com/mattreecebentley/plf_stack/archive/c9d8fae0a66d1d0a19c3d0bf690a2776710511fe.tar.gz" sha256: "8dcca43043a3c5e91a642a3ae84f3acca657c3775536569302bbccc6b70d24e6" diff --git a/recipes/plf_stack/config.yml b/recipes/plf_stack/config.yml index 88575a7de5458..d955d60d65ed1 100644 --- a/recipes/plf_stack/config.yml +++ b/recipes/plf_stack/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.1": + folder: all "1.64": folder: all "1.63": diff --git a/recipes/plog/all/conandata.yml b/recipes/plog/all/conandata.yml index a2d1cb2b746a6..d1c46d7ff154b 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 c3432fc6b2f2a..5526e402261bc 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 539b28539b874..595f0e1a79d21 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 5d1248265e161..c073789122310 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 0a4d2fae5c706..8b5b4793ec8d8 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 a500b98343c74..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..a500b98343c74 --- /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 1b582dcf6716b..f5fa9d899d244 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/plutovg/all/conandata.yml b/recipes/plutovg/all/conandata.yml index dbcdf0e92b441..caee6f61d4f89 100644 --- a/recipes/plutovg/all/conandata.yml +++ b/recipes/plutovg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230205": + url: "https://github.com/sammycage/plutovg/archive/ccaa687ac6092ef548b840144820a757c24e718b.tar.gz" + sha256: "e7cb644a76612bcbaeb26f401adf7eff9cc45fbef69aadc7a9d0f84416f0ea98" "cci.20221030": url: "https://github.com/sammycage/plutovg/archive/4d0eee77ce7d1850aac4d90e20ddaaa313d83e6a.tar.gz" sha256: "bb44b1107d1cd41032fecdf3e16cff59a1a06f15a92527029aacb73c5c4d059e" diff --git a/recipes/plutovg/all/conanfile.py b/recipes/plutovg/all/conanfile.py index 13289c4f9dd84..ac581e3e79204 100644 --- a/recipes/plutovg/all/conanfile.py +++ b/recipes/plutovg/all/conanfile.py @@ -4,16 +4,16 @@ import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class PlutoVGConan(ConanFile): name = "plutovg" description = "Tiny 2D vector graphics library in C" + license = "MIT", topics = ("vector", "graphics", ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/sammycage/plutovg" - license = "MIT", - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,24 +30,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.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) diff --git a/recipes/plutovg/config.yml b/recipes/plutovg/config.yml index b7f8945df864d..2d50305e8506d 100644 --- a/recipes/plutovg/config.yml +++ b/recipes/plutovg/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20230205": + folder: all "cci.20221030": folder: all "cci.20220103": diff --git a/recipes/pngpp/all/conanfile.py b/recipes/pngpp/all/conanfile.py index 9693d59416e60..57559867af002 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 c1f5e069c2cc2..c2db4d028c469 100644 --- a/recipes/poco/all/conandata.yml +++ b/recipes/poco/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.13.0": + url: "https://github.com/pocoproject/poco/archive/poco-1.13.0-release.tar.gz" + sha256: "0135160663795901f317215272fadf71f3b526f38daacb2ae8d6b07ad11d319b" + "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 +26,67 @@ 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.13.0": + - patch_file: patches/1.13.0.patch + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: patches/1.13.0-0002-mysql-include.patch + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" + "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 330da5a01ce34..4f4346cde29c2 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 = { @@ -29,12 +29,14 @@ class PocoConan(ConanFile): "fPIC": [True, False], "enable_fork": [True, False], "enable_active_record": [True, False, "deprecated"], + "with_sql_parser": [True, False], } default_options = { "shared": False, "fPIC": True, "enable_fork": True, "enable_active_record": "deprecated", + "with_sql_parser": True, } _PocoComponent = namedtuple("_PocoComponent", ("option", "default_option", "dependencies", "external_dependencies", "is_lib")) @@ -77,6 +79,39 @@ 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 + if Version(self.version) < "1.12.5": + return "11" + # Since 1.13.0, poco requires C++17 + # https://github.com/pocoproject/poco/releases/tag/poco-1.13.0-release + if Version(self.version) < "1.13.0": + return "14" + return "17" + + @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 export_sources(self): export_conandata_patches(self) @@ -88,6 +123,8 @@ def config_options(self): del self.options.enable_netssl_win if Version(self.version) < "1.12.0": del self.options.enable_prometheus + if Version(self.version) < "1.13.0": + del self.options.with_sql_parser def configure(self): if self.options.enable_active_record != "deprecated": @@ -112,13 +149,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 +163,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") @@ -196,6 +241,8 @@ def generate(self): # Disable fork if not self.options.get_safe("enable_fork", True): tc.variables["POCO_NO_FORK_EXEC"] = True + if self.options.get_safe("with_sql_parser", None) is False: + tc.variables["POCO_DATA_NO_SQL_PARSER"] = True # Disable automatic linking on MSVC tc.preprocessor_definitions["POCO_NO_AUTOMATIC_LIBS"] = "1" # Picked up from conan v1 CMake wrapper, don't know the rationale @@ -265,6 +312,14 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "cmake")) rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + # INFO: missing headers https://github.com/pocoproject/poco/issues/4378 + if self.options.get_safe("with_sql_parser", False): + copy( + self, + "*.h", + os.path.join(self.source_folder, "Data", "src"), + os.path.join(self.package_folder, "include"), + ) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Poco") 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 1e07c041d0c68..0000000000000 --- 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 0f5458cd155b5..0000000000000 --- 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 0f5458cd155b5..0000000000000 --- 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 f1fb7b37a7386..0000000000000 --- 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 0000000000000..451cebc08e847 --- /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/patches/1.13.0-0002-mysql-include.patch b/recipes/poco/all/patches/1.13.0-0002-mysql-include.patch new file mode 100644 index 0000000000000..259dda55b0a96 --- /dev/null +++ b/recipes/poco/all/patches/1.13.0-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 ebfb73e..68ed74e 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 3803223..2a6110f 100644 +--- a/Data/MySQL/testsuite/src/SQLExecutor.cpp ++++ b/Data/MySQL/testsuite/src/SQLExecutor.cpp +@@ -31,7 +31,7 @@ + #endif + + +-#include ++#include + #include + #include + diff --git a/recipes/poco/all/patches/1.13.0.patch b/recipes/poco/all/patches/1.13.0.patch new file mode 100644 index 0000000000000..063b45f860b0f --- /dev/null +++ b/recipes/poco/all/patches/1.13.0.patch @@ -0,0 +1,39 @@ +diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index 41ba999..f4a1fe9 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -99,7 +99,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 c0e1768..32a1187 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 2ef58c5..5d7d7fa 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/test_package/CMakeLists.txt b/recipes/poco/all/test_package/CMakeLists.txt index 42eba4251a7ef..99f190c6b84cd 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/all/test_package/conanfile.py b/recipes/poco/all/test_package/conanfile.py index db2773f5ca2c2..155f2e533fc71 100644 --- a/recipes/poco/all/test_package/conanfile.py +++ b/recipes/poco/all/test_package/conanfile.py @@ -20,8 +20,8 @@ def generate(self): poco_options = self.dependencies["poco"].options tc.variables["TEST_CRYPTO"] = poco_options.enable_crypto tc.variables["TEST_UTIL"] = poco_options.enable_util - tc.variables["TEST_NET"] = poco_options.enable_net - tc.variables["TEST_NETSSL"] = poco_options.get_safe("enable_netssl") or poco_options.get_safe("enable_netssl_win") + tc.variables["TEST_NET"] = False + tc.variables["TEST_NETSSL"] = False tc.variables["TEST_SQLITE"] = poco_options.enable_data_sqlite tc.variables["TEST_ENCODINGS"] = poco_options.get_safe("enable_encodings", False) tc.variables["TEST_JWT"] = poco_options.get_safe("enable_jwt", False) diff --git a/recipes/poco/all/test_v1_package/conanfile.py b/recipes/poco/all/test_v1_package/conanfile.py index 3bca6441d5a9a..ef9bd9175eadb 100644 --- a/recipes/poco/all/test_v1_package/conanfile.py +++ b/recipes/poco/all/test_v1_package/conanfile.py @@ -16,8 +16,8 @@ def build(self): cmake = CMake(self) cmake.definitions["TEST_CRYPTO"] = self.options["poco"].enable_crypto cmake.definitions["TEST_UTIL"] = self.options["poco"].enable_util - cmake.definitions["TEST_NET"] = self.options["poco"].enable_net - cmake.definitions["TEST_NETSSL"] = self._poco_option("enable_netssl", False) or self._poco_option("enable_netssl_win", False) + cmake.definitions["TEST_NET"] = False + cmake.definitions["TEST_NETSSL"] = False cmake.definitions["TEST_SQLITE"] = self.options["poco"].enable_data_sqlite cmake.definitions["TEST_ENCODINGS"] = self._poco_option("enable_encodings", False) cmake.definitions["TEST_JWT"] = self._poco_option("enable_jwt", False) diff --git a/recipes/poco/config.yml b/recipes/poco/config.yml index 9843e7f469dce..a59a7f8e7171f 100644 --- a/recipes/poco/config.yml +++ b/recipes/poco/config.yml @@ -1,4 +1,10 @@ versions: + "1.13.0": + folder: all + "1.12.5p2": + folder: all + "1.12.5p1": + folder: all "1.12.4": folder: all "1.12.3": @@ -11,9 +17,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 5046d4d4b8974..87fbb60fe26b7 100644 --- a/recipes/podofo/all/conanfile.py +++ b/recipes/podofo/all/conanfile.py @@ -62,20 +62,20 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.12.1") - self.requires("zlib/1.2.13") + self.requires("freetype/2.13.0") + self.requires("zlib/[>=1.2.11 <2]") if self.settings.os != "Windows": - self.requires("fontconfig/2.13.93") + self.requires("fontconfig/2.14.2") if self.options.with_openssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/1.1.1u") if self.options.with_libidn: self.requires("libidn/1.36") if self.options.with_jpeg: self.requires("libjpeg/9e") if self.options.with_tiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") if self.options.with_png: - self.requires("libpng/1.6.38") + self.requires("libpng/1.6.40") if self.options.with_unistring: self.requires("libunistring/0.9.10") diff --git a/recipes/poly2tri/all/CMakeLists.txt b/recipes/poly2tri/all/CMakeLists.txt index 584d7ebc98cae..f72581637fe53 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 d43ae54e6e9c6..8890a1140dca4 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/portable-file-dialogs/all/conanfile.py b/recipes/portable-file-dialogs/all/conanfile.py index c45d2c0106dee..9ef96147823bf 100644 --- a/recipes/portable-file-dialogs/all/conanfile.py +++ b/recipes/portable-file-dialogs/all/conanfile.py @@ -1,36 +1,42 @@ import os -from conans 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.52.0" class PortableFileDialogsConan(ConanFile): name = "portable-file-dialogs" + description = "Portable GUI dialogs library, C++11, single-header" license = "WTFPL" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/samhocevar/portable-file-dialogs" - description = "Portable GUI dialogs library, C++11, single-header" - topics = ("conan", "gui", "dialogs") - no_copy_source = True - settings = "compiler" + topics = ("gui", "dialogs", "header-only") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True def configure(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + + 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 = self.name + "-" + 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("portable-file-dialogs.h", dst="include", src=self._source_subfolder) - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "portable-file-dialogs.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) def package_info(self): self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] diff --git a/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt b/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt index 33ae887aa6aea..c54c9c2b41cf2 100644 --- a/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt +++ b/recipes/portable-file-dialogs/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(portable-file-dialogs REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE portable-file-dialogs::portable-file-dialogs) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/portable-file-dialogs/all/test_package/conanfile.py b/recipes/portable-file-dialogs/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/portable-file-dialogs/all/test_package/conanfile.py +++ b/recipes/portable-file-dialogs/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" + 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/poshlib/all/CMakeLists.txt b/recipes/poshlib/all/CMakeLists.txt index 7e123f6b4b780..ada768afc9da6 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 8a2c26baad724..7ad4e9bed544b 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 7b9b613cbb24a..06a245507c563 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 16ec9f68ef974..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..90eb89e3f2f46 --- /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/pprint/all/conanfile.py b/recipes/pprint/all/conanfile.py index bff4a1689bd94..364e5bce8ca73 100644 --- a/recipes/pprint/all/conanfile.py +++ b/recipes/pprint/all/conanfile.py @@ -1,48 +1,63 @@ -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 PprintConan(ConanFile): name = "pprint" - homepage = "https://github.com/p-ranav/pprint" - url = "https://github.com/conan-io/conan-center-index" description = "Pretty Printer for Modern C++" license = "MIT" - settings = "os", "compiler" - topics = ("conan", "pprint", "pretty", "printer") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/pprint" + topics = ("pretty", "printer", "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): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 17) + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15", + } - min_compiler_version = { - "gcc": 7, - "clang": 7, - "apple-clang": 10, - "Visual Studio": 15, - }.get(str(self.settings.compiler), None) + def layout(self): + basic_layout(self, src_folder="src") - if min_compiler_version: - if tools.Version(self.settings.compiler.version) < min_compiler_version: - raise ConanInvalidConfiguration("The compiler does not support c++17") - else: - self.output.warn("pprint needs a c++17 capable compiler") + 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): - 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 package(self): - self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") - self.copy(pattern="*.h", src=os.path.join(self._source_subfolder, "include"), dst="include") - self.copy(pattern="*.hpp", 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, "*.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_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/pprint/all/test_package/CMakeLists.txt b/recipes/pprint/all/test_package/CMakeLists.txt index 3572b806e9a79..58ce520a06b4f 100644 --- a/recipes/pprint/all/test_package/CMakeLists.txt +++ b/recipes/pprint/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(pprint REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE pprint::pprint) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/pprint/all/test_package/conanfile.py b/recipes/pprint/all/test_package/conanfile.py index bd7165a553cf4..e0e49c1e8d6b6 100644 --- a/recipes/pprint/all/test_package/conanfile.py +++ b/recipes/pprint/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", + 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/pprint/all/test_v1_package/CMakeLists.txt b/recipes/pprint/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pprint/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/pprint/all/test_v1_package/conanfile.py b/recipes/pprint/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/pprint/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/pranav-csv2/all/conanfile.py b/recipes/pranav-csv2/all/conanfile.py index f73a81dd87306..ce5e7775c6355 100644 --- a/recipes/pranav-csv2/all/conanfile.py +++ b/recipes/pranav-csv2/all/conanfile.py @@ -1,100 +1,116 @@ +# TODO: verify the Conan v2 migration + import os -import functools import textwrap -from conans.errors import ConanInvalidConfiguration -from conans import ConanFile, CMake, tools +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, save +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.33.0" class PranavCSV2Conan(ConanFile): name = "pranav-csv2" - license = "MIT" description = "Various header libraries mostly future std lib, replacements for(e.g. visit), or some misc" - topics = ("csv", "iterator", "header-only", ) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/p-ranav/csv2" - settings = "os", "arch", "compiler", "build_type", - generators = "cmake", + topics = ("csv", "iterator", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _compiler_required_cpp11 = { - "Visual Studio": "16", - "gcc": "8", - "clang": "7", - "apple-clang": "12.0", - } + @property + def _min_cppstd(self): + return 11 @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, self._min_cppstd) - minimum_version = self._compiler_required_cpp11.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++11, which your compiler does not support.".format(self.name)) + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++11, which your compiler does not support.") else: - self.output.warn("{0} requires C++11. Your compiler is unknown. Assuming it supports C++11.".format(self.name)) + self.output.warning(f"{self.name} requires C++11. Your compiler is unknown. Assuming it supports C++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.configure(source_folder=self._source_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() - @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-{}-targets.cmake".format(self.name)) + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() - @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) def package(self): - self.copy("LICENSE*", "licenses", 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", "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")) self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), {"csv2": "csv2::csv2"} ) - def package_id(self): - self.info.header_only() + @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, f"conan-official-{self.name}-targets.cmake") def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "csv2") self.cpp_info.set_property("cmake_target_name", "csv2::csv2") + self.cpp_info.builddirs.append(self._module_subfolder) + self.cpp_info.filenames["cmake_find_package"] = "csv2" self.cpp_info.filenames["cmake_find_package_multi"] = "csv2" self.cpp_info.names["cmake_find_package"] = "csv2" self.cpp_info.names["cmake_find_package_multi"] = "csv2" - - self.cpp_info.builddirs.append(self._module_subfolder) 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/pranav-csv2/all/test_package/CMakeLists.txt b/recipes/pranav-csv2/all/test_package/CMakeLists.txt index f958b282d05ea..b8a570a3eafe7 100644 --- a/recipes/pranav-csv2/all/test_package/CMakeLists.txt +++ b/recipes/pranav-csv2/all/test_package/CMakeLists.txt @@ -1,11 +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(csv2 CONFIG REQUIRED) +find_package(csv2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} csv2) +target_link_libraries(${PROJECT_NAME} csv2::csv2) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/pranav-csv2/all/test_package/conanfile.py b/recipes/pranav-csv2/all/test_package/conanfile.py index 0197f07f63c5d..fae501d0afb9e 100644 --- a/recipes/pranav-csv2/all/test_package/conanfile.py +++ b/recipes/pranav-csv2/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 DawHeaderLibrariesTestConan(ConanFile): + +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) @@ -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/pranav-csv2/all/test_package/test_package.cpp b/recipes/pranav-csv2/all/test_package/test_package.cpp index 6119ae1a3e0f9..d415b3cf575ef 100644 --- a/recipes/pranav-csv2/all/test_package/test_package.cpp +++ b/recipes/pranav-csv2/all/test_package/test_package.cpp @@ -3,7 +3,7 @@ int main() { csv2::Reader< csv2::delimiter<','>, - csv2::quote_character<'"'>, + csv2::quote_character<'"'>, csv2::first_row_is_header, csv2::trim_policy::trim_whitespace> csv; diff --git a/recipes/pranav-csv2/all/test_v1_package/CMakeLists.txt b/recipes/pranav-csv2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pranav-csv2/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/pranav-csv2/all/test_v1_package/conanfile.py b/recipes/pranav-csv2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0197f07f63c5d --- /dev/null +++ b/recipes/pranav-csv2/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class DawHeaderLibrariesTestConan(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/premake/5.x/conandata.yml b/recipes/premake/5.x/conandata.yml index d96239dcf6113..91cb25d43c227 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 f0834e0449cd2..d4fa461153f3c 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 0dd121be8b2ae..0000000000000 --- 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 c300eaeb0abb7..d2d508976967c 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 0000000000000..c300eaeb0abb7 --- /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 e529cc98c1a62..95e71fee0aa88 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/pretty-name/all/conanfile.py b/recipes/pretty-name/all/conanfile.py index 994d455d12104..3cfd0f89c07f3 100644 --- a/recipes/pretty-name/all/conanfile.py +++ b/recipes/pretty-name/all/conanfile.py @@ -1,33 +1,30 @@ 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 PrettyNameConan(ConanFile): name = "pretty-name" + description = "An easy and consistent way how to get type names in C++" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Rechip/pretty-name" - description = "An easy and consistent way how to get type names in C++" - topics = ("cpp", "typename") - settings = ["compiler"] + topics = ("cpp", "typename", "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 source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - 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 14 @property def _minimum_compilers_version(self): @@ -38,21 +35,39 @@ def _minimum_compilers_version(self): "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.cppstd: - tools.check_min_cppstd(self, "14") - minimum_version = self._minimum_compilers_version.get( - str(self.settings.compiler), False) + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn( - "pretty-name requires C++14. Your compiler is unknown. Assuming it supports C++14.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - "pretty-name requires C++14, which your compiler does not support.") + self.output.warning("pretty-name requires C++14. Your compiler is unknown. Assuming it supports C++14.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("pretty-name requires C++14, 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.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "pretty-name") + self.cpp_info.set_property("cmake_target_name", "pretty-name::pretty-name") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "pretty-name" self.cpp_info.names["cmake_find_package_multi"] = "pretty-name" diff --git a/recipes/pretty-name/all/test_package/CMakeLists.txt b/recipes/pretty-name/all/test_package/CMakeLists.txt index 036c165068273..8cdadcdcea642 100644 --- a/recipes/pretty-name/all/test_package/CMakeLists.txt +++ b/recipes/pretty-name/all/test_package/CMakeLists.txt @@ -1,13 +1,10 @@ -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(pretty-name REQUIRED CONFIG) -find_package(pretty-name CONFIG REQUIRED) add_executable(${PROJECT_NAME} src/test.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE pretty-name::pretty-name) - set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 diff --git a/recipes/pretty-name/all/test_package/conanfile.py b/recipes/pretty-name/all/test_package/conanfile.py index cbe0be23191a2..fae501d0afb9e 100644 --- a/recipes/pretty-name/all/test_package/conanfile.py +++ b/recipes/pretty-name/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/pretty-name/all/test_v1_package/CMakeLists.txt b/recipes/pretty-name/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pretty-name/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/pretty-name/all/test_v1_package/conanfile.py b/recipes/pretty-name/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cbe0be23191a2 --- /dev/null +++ b/recipes/pretty-name/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + self.cmake = CMake(self) + self.cmake.configure() + 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) diff --git a/recipes/pretty-name/all/test_v1_package/src/test.cpp b/recipes/pretty-name/all/test_v1_package/src/test.cpp new file mode 100644 index 0000000000000..8c761f54ec31c --- /dev/null +++ b/recipes/pretty-name/all/test_v1_package/src/test.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + +struct Test { + int a; + int b; +}; + +namespace Namespace { +template +struct Test { + A a; + B b; +}; +} // namespace Namespace + +int main() { + std::cout << pretty_name::pretty_name() << std::endl; + std::cout << pretty_name::pretty_name>() << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/procxx-boost-ext-simd/all/conanfile.py b/recipes/procxx-boost-ext-simd/all/conanfile.py index beacde6952502..58d22448c3e7e 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 36ff666d5a74f..f2ca319191721 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 3be12b2d6b0c5..ef5d7042163ec 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 ddf7bb1fb383a..48b397b470c70 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 0000000000000..91630d79f4abb --- /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 0000000000000..70611dabf01ae --- /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 6a5d57f6c5cd3..95a7cf689dd27 100644 --- a/recipes/proj/all/conandata.yml +++ b/recipes/proj/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "9.3.1": + url: "https://github.com/OSGeo/PROJ/releases/download/9.3.1/proj-9.3.1.tar.gz" + sha256: "b0f919cb9e1f42f803a3e616c2b63a78e4d81ecfaed80978d570d3a5e29d10bc" + "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" "9.1.1": url: "https://github.com/OSGeo/PROJ/releases/download/9.1.1/proj-9.1.1.tar.gz" sha256: "003cd4010e52bb5eb8f7de1c143753aa830c8902b6ed01209f294846e40e6d39" @@ -21,6 +30,18 @@ sources: url: "https://github.com/OSGeo/PROJ/releases/download/6.3.1/proj-6.3.1.tar.gz" sha256: "6de0112778438dcae30fcc6942dee472ce31399b9e5a2b67e8642529868c86f8" patches: + "9.3.1": + - patch_file: "patches/0001-use-cmake-targets-9.2.1.patch" + patch_type: "conan" + patch_description: "Use cmake targets" + "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" + patch_description: "Use cmake targets" "9.1.1": - patch_file: "patches/0001-use-cmake-targets-9.1.0.patch" patch_type: "conan" diff --git a/recipes/proj/all/conanfile.py b/recipes/proj/all/conanfile.py index d65efd41b63cf..cc5091962196d 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.41.1", 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.4.0") + self.requires("libtiff/4.6.0") if self.options.get_safe("with_curl"): - self.requires("libcurl/7.88.1") + self.requires("libcurl/[>=7.78.0 <9]") def build_requirements(self): - if not can_run(self): - self.tool_requires("sqlite3/3.41.1") + 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/all/patches/0001-use-cmake-targets-9.2.1.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.2.1.patch new file mode 100644 index 0000000000000..0459aba7efc51 --- /dev/null +++ b/recipes/proj/all/patches/0001-use-cmake-targets-9.2.1.patch @@ -0,0 +1,12 @@ +--- a/src/lib_proj.cmake ++++ b/src/lib_proj.cmake +@@ -438,8 +438,7 @@ + target_link_libraries(proj PRIVATE ${CMAKE_THREAD_LIBS_INIT}) + endif() + +-target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR}) +-target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) ++target_link_libraries(proj PRIVATE SQLite::SQLite3) + + if(NLOHMANN_JSON STREQUAL "external") + target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON) diff --git a/recipes/proj/config.yml b/recipes/proj/config.yml index b8b070a608bed..ab5afce9c830c 100644 --- a/recipes/proj/config.yml +++ b/recipes/proj/config.yml @@ -1,4 +1,10 @@ versions: + "9.3.1": + folder: "all" + "9.3.0": + folder: "all" + "9.2.1": + folder: "all" "9.1.1": folder: "all" "9.1.0": diff --git a/recipes/prometheus-cpp/all/conanfile.py b/recipes/prometheus-cpp/all/conanfile.py index 77a024b271ec1..10a8edf3a1e5e 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/proposal/all/conandata.yml b/recipes/proposal/all/conandata.yml index 0fd8a065192d9..413be0b0859fb 100644 --- a/recipes/proposal/all/conandata.yml +++ b/recipes/proposal/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "7.6.2": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.6.2.tar.gz" + sha256: "52e91807009b8e610deee485ea57523482cf5626a28f3e42b747dc58d9f505d8" + "7.6.1": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.6.1.tar.gz" + sha256: "ed1621e1b859179672468330c1a5ac7d84a4c0a5b80d6bf826b22ed6ef6967ca" + "7.6.0": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.6.0.tar.gz" + sha256: "8c0ddd53ac81c2c4959f2425a9d4bf8e40fba55f03407aefc1d3ac9b3d523a62" "7.5.1": url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.5.1.tar.gz" sha256: "2a283bfc335c4b6b01d2acc1eea1a5e4c456bd3dd11e41ef24ca3d955c9655a3" diff --git a/recipes/proposal/config.yml b/recipes/proposal/config.yml index 279c6cb19e836..52f45a4a6325f 100644 --- a/recipes/proposal/config.yml +++ b/recipes/proposal/config.yml @@ -1,4 +1,10 @@ versions: + "7.6.2": + folder: all + "7.6.1": + folder: all + "7.6.0": + folder: all "7.5.1": folder: all "7.5.0": diff --git a/recipes/protobuf-c/all/conandata.yml b/recipes/protobuf-c/all/conandata.yml new file mode 100644 index 0000000000000..76c13c0bb2057 --- /dev/null +++ b/recipes/protobuf-c/all/conandata.yml @@ -0,0 +1,17 @@ +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" + patch_description: "Fit Protobuf directory variables to official targets" + patch_type: conan diff --git a/recipes/protobuf-c/all/conanfile.py b/recipes/protobuf-c/all/conanfile.py new file mode 100644 index 0000000000000..2111ba51320e0 --- /dev/null +++ b/recipes/protobuf-c/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile, __version__ as conan_version +from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +import os + + +required_conan_version = ">=1.53.0" + + +class ProtobufCConan(ConanFile): + name = "protobuf-c" + description = "Protocol Buffers implementation in C" + license = "LicenseRef-LICENSE" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/protobuf-c/protobuf-c" + topics = ("protocol-buffers", "protocol-compiler", "serialization", "protocol-compiler") + # package_type = "library" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_proto3": [True, False], + "with_protoc": [True, False] + } + default_options = { + "fPIC": True, + "with_proto3": True, + "with_protoc": True + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def export_sources(self): + export_conandata_patches(self) + # 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", src=self.recipe_folder, dst=self.export_sources_folder, keep_path=False) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + # Since the package using protobuf-c will also need to use protoc (part of protobuf), + # we want to make sure the protobuf dep is visible, but the visible param is only available in v2 + # TODO: Remove after dropping Conan 1.x + if conan_version >= Version("2"): + 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") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_PROTO3"] = self.options.with_proto3 + tc.cache_variables["BUILD_PROTOC"] = self.options.with_protoc + # FIXME: Add shared library support. It was just too hairy to figure out initially + # tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.cache_variables["BUILD_TESTS"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "build-cmake")) + cmake.build() + + @property + def _cmake_install_base_path(self): + return os.path.join("lib", "cmake", "protobuf-c") + + 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) + + def package_info(self): + # upstream CMake config file name and target name matches the package name + self.cpp_info.libs = ["protobuf-c"] + self.cpp_info.builddirs.append(self._cmake_install_base_path) + # TODO: This won't be needed once upstream PR (https://github.com/protobuf-c/protobuf-c/pull/555) gets merged + self.cpp_info.set_property("cmake_build_modules", [ + os.path.join(self._cmake_install_base_path, "protobuf-c.cmake") + ]) + self.buildenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) diff --git a/recipes/protobuf-c/all/patches/1.4.1-cmake-protobuf-target.patch b/recipes/protobuf-c/all/patches/1.4.1-cmake-protobuf-target.patch new file mode 100644 index 0000000000000..fb664a553f528 --- /dev/null +++ b/recipes/protobuf-c/all/patches/1.4.1-cmake-protobuf-target.patch @@ -0,0 +1,56 @@ +diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt +--- a/build-cmake/CMakeLists.txt (revision c8f1ff465b55b00114af07d15ceca2aeedee1a4b) ++++ b/build-cmake/CMakeLists.txt (revision cabf46a8ab076fdce0c7bef4e393ac7819bb4b68) +@@ -63,7 +63,6 @@ + endif (MSVC AND NOT BUILD_SHARED_LIBS) + + FIND_PACKAGE(Protobuf REQUIRED) +-INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) + + if (BUILD_PROTO3) + ADD_DEFINITIONS(-DHAVE_PROTO3) +@@ -92,16 +91,16 @@ + SET(CMAKE_CXX_STANDARD_REQUIRED ON) + SET(CMAKE_CXX_EXTENSIONS OFF) + ADD_CUSTOM_COMMAND(OUTPUT protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h +- COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} ++ COMMAND ${Protobuf_PROTOC_EXECUTABLE} + ARGS --cpp_out ${CMAKE_BINARY_DIR} -I${MAIN_DIR} ${MAIN_DIR}/protobuf-c/protobuf-c.proto) + FILE(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.h ${MAIN_DIR}/protoc-c/*.cc ) + ADD_EXECUTABLE(protoc-gen-c ${PROTOC_GEN_C_SRC} protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h) + +-TARGET_LINK_LIBRARIES(protoc-gen-c ${PROTOBUF_PROTOC_LIBRARY} ${PROTOBUF_LIBRARY}) ++TARGET_LINK_LIBRARIES(protoc-gen-c protobuf::libprotoc protobuf::libprotobuf) + + IF (MSVC AND BUILD_SHARED_LIBS) + TARGET_COMPILE_DEFINITIONS(protoc-gen-c PRIVATE -DPROTOBUF_USE_DLLS) +- GET_FILENAME_COMPONENT(PROTOBUF_DLL_DIR ${PROTOBUF_PROTOC_EXECUTABLE} DIRECTORY) ++ GET_FILENAME_COMPONENT(PROTOBUF_DLL_DIR ${Protobuf_PROTOC_EXECUTABLE} DIRECTORY) + FILE(GLOB PROTOBUF_DLLS ${PROTOBUF_DLL_DIR}/*.dll) + FILE(COPY ${PROTOBUF_DLLS} DESTINATION ${CMAKE_BINARY_DIR}) + ENDIF (MSVC AND BUILD_SHARED_LIBS) +@@ -114,7 +113,7 @@ + + FUNCTION(GENERATE_TEST_SOURCES PROTO_FILE SRC HDR) + ADD_CUSTOM_COMMAND(OUTPUT ${SRC} ${HDR} +- COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} ++ COMMAND ${Protobuf_PROTOC_EXECUTABLE} + ARGS --plugin=$ -I${MAIN_DIR} ${PROTO_FILE} --c_out=${CMAKE_BINARY_DIR} + DEPENDS protoc-gen-c) + ENDFUNCTION() +@@ -130,13 +129,13 @@ + + + ADD_CUSTOM_COMMAND(OUTPUT t/test-full.pb.cc t/test-full.pb.h +- COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} ++ COMMAND ${Protobuf_PROTOC_EXECUTABLE} + ARGS --cpp_out ${CMAKE_BINARY_DIR} -I${MAIN_DIR} ${TEST_DIR}/test-full.proto) + + GENERATE_TEST_SOURCES(${TEST_DIR}/test-full.proto t/test-full.pb-c.c t/test-full.pb-c.h) + + ADD_EXECUTABLE(cxx-generate-packed-data ${TEST_DIR}/generated-code2/cxx-generate-packed-data.cc t/test-full.pb.h t/test-full.pb.cc protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h) +-TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${PROTOBUF_LIBRARY}) ++TARGET_LINK_LIBRARIES(cxx-generate-packed-data protobuf::libprotobuf) + IF (MSVC AND BUILD_SHARED_LIBS) + TARGET_COMPILE_DEFINITIONS(cxx-generate-packed-data PRIVATE -DPROTOBUF_USE_DLLS) + ENDIF (MSVC AND BUILD_SHARED_LIBS) 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 0000000000000..babf079071444 --- /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/all/protobuf-c.cmake b/recipes/protobuf-c/all/protobuf-c.cmake new file mode 100644 index 0000000000000..ad1143afc4edc --- /dev/null +++ b/recipes/protobuf-c/all/protobuf-c.cmake @@ -0,0 +1,72 @@ +find_package(Protobuf REQUIRED) +find_program(PROTOC_GEN_C protoc-gen-c REQUIRED) + +function(protobuf_generate_c SRCS HDRS) + cmake_parse_arguments(protobuf_generate_c "" "EXPORT_MACRO;DESCRIPTORS" "" + ${ARGN}) + + set(_proto_files "${protobuf_generate_c_UNPARSED_ARGUMENTS}") + if(NOT _proto_files) + message( + SEND_ERROR "Error: protobuf_generate_c() called without any proto files") + return() + endif() + + if(protobuf_generate_c_APPEND_PATH) + set(_append_arg APPEND_PATH) + endif() + + if(protobuf_generate_c_DESCRIPTORS) + set(_descriptors DESCRIPTORS) + endif() + + if(DEFINED Protobuf_IMPORT_DIRS) + set(_import_arg IMPORT_DIRS ${Protobuf_IMPORT_DIRS}) + endif() + + set(_outvar) + protobuf_generate( + ${_append_arg} + ${_descriptors} + LANGUAGE + c + PLUGIN + ${PROTOC_GEN_C} + GENERATE_EXTENSIONS + .pb-c.h + .pb-c.c + EXPORT_MACRO + ${protobuf_generate_c_EXPORT_MACRO} + OUT_VAR + _outvar + ${_import_arg} + PROTOS + ${_proto_files}) + + set(${SRCS}) + set(${HDRS}) + if(protobuf_generate_c_DESCRIPTORS) + set(${protobuf_generate_c_DESCRIPTORS}) + endif() + + foreach(_file ${_outvar}) + if(_file MATCHES "c$") + list(APPEND ${SRCS} ${_file}) + elseif(_file MATCHES "desc$") + list(APPEND ${protobuf_generate_c_DESCRIPTORS} ${_file}) + else() + list(APPEND ${HDRS} ${_file}) + endif() + endforeach() + set(${SRCS} + ${${SRCS}} + PARENT_SCOPE) + set(${HDRS} + ${${HDRS}} + PARENT_SCOPE) + if(protobuf_generate_c_DESCRIPTORS) + set(${protobuf_generate_c_DESCRIPTORS} + "${${protobuf_generate_c_DESCRIPTORS}}" + PARENT_SCOPE) + endif() +endfunction() diff --git a/recipes/protobuf-c/all/test_package/CMakeLists.txt b/recipes/protobuf-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..99e745b3cbd08 --- /dev/null +++ b/recipes/protobuf-c/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(protobuf-c CONFIG REQUIRED) + +protobuf_generate_c(TEST_PROTO_SRCS TEST_PROTO_HDRS hero.proto) + +add_executable(${PROJECT_NAME} test_package.c hero.proto ${TEST_PROTO_SRCS} ${TEST_PROTO_HDRS}) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries(${PROJECT_NAME} protobuf-c::protobuf-c) diff --git a/recipes/protobuf-c/all/test_package/conanfile.py b/recipes/protobuf-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..979cebae5cc2b --- /dev/null +++ b/recipes/protobuf-c/all/test_package/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +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 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): + VirtualRunEnv(self).generate() + if cross_building(self) and hasattr(self, "settings_build"): + VirtualBuildEnv(self).generate() + else: + VirtualRunEnv(self).generate(scope="build") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + # We need to be able to call protoc (from protobuf) under the hood + self.run("protoc --version", env="conanbuild") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/protobuf-c/all/test_package/hero.proto b/recipes/protobuf-c/all/test_package/hero.proto new file mode 100644 index 0000000000000..5192fe660ef3c --- /dev/null +++ b/recipes/protobuf-c/all/test_package/hero.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package the; + +message Hero { + string name = 1; +} diff --git a/recipes/protobuf-c/all/test_package/test_package.c b/recipes/protobuf-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..7e9da10a4d2c4 --- /dev/null +++ b/recipes/protobuf-c/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +#include "hero.pb-c.h" + +int main() +{ + The__Hero hero; + hero.name = "the_storyteller"; + + printf("The hero's name is %s.\n", hero.name); + + return 0; +} diff --git a/recipes/protobuf-c/config.yml b/recipes/protobuf-c/config.yml new file mode 100644 index 0000000000000..e8bcb86099429 --- /dev/null +++ b/recipes/protobuf-c/config.yml @@ -0,0 +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 502de4a7d6777..0417c4d805f42 100644 --- a/recipes/protobuf/all/conandata.yml +++ b/recipes/protobuf/all/conandata.yml @@ -1,33 +1,38 @@ sources: + "3.21.12": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.12.tar.gz" + sha256: "930c2c3b5ecc6c9c12615cf5ad93f1cd6e12d0aba862b572e076259970ac3a53" "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" patches: + "3.21.12": + - patch_file: "patches/protobuf-3.21.12-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.21.9": - patch_file: "patches/protobuf-3.21.9-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.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" @@ -45,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 d12aca6f2317c..f696a27880684 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 b0f3ddc092047..0000000000000 --- 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.12-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch new file mode 100644 index 0000000000000..3a152f62bca69 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch @@ -0,0 +1,25 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index f00daf7..d956db2 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/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 6cf85b0ac3941..0000000000000 --- 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 e55d642882aa3..0000000000000 --- 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 3823d923c4684..81404c86104a8 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 c22211a7a9d4e..89750d93410cc 100644 --- a/recipes/protobuf/config.yml +++ b/recipes/protobuf/config.yml @@ -1,15 +1,15 @@ versions: + "3.21.12": + 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 138520809226b..977da9b21114c 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/conandata.yml b/recipes/ptex/all/conandata.yml index 7a294e96324ee..6d50d86a6dad6 100644 --- a/recipes/ptex/all/conandata.yml +++ b/recipes/ptex/all/conandata.yml @@ -1,7 +1,12 @@ sources: + "2.4.2": + url: "https://github.com/wdas/ptex/archive/refs/tags/v2.4.2.tar.gz" + sha256: "c8235fb30c921cfb10848f4ea04d5b662ba46886c5e32ad5137c5086f3979ee1" "2.4.0": url: "https://github.com/wdas/ptex/archive/refs/tags/v2.4.0.tar.gz" sha256: "690d66b72f34a92488d63134ad1f5736078677356b0004070b0169b9e3240f8e" patches: + "2.4.2": + - patch_file: "patches/2.4.2-0001-fix-cmake.patch" "2.4.0": - - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/2.4.0-0001-fix-cmake.patch" diff --git a/recipes/ptex/all/conanfile.py b/recipes/ptex/all/conanfile.py index f8059fec65c6b..83f58340ae19c 100644 --- a/recipes/ptex/all/conanfile.py +++ b/recipes/ptex/all/conanfile.py @@ -1,8 +1,11 @@ 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 +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save import os +from conan.tools.gnu import PkgConfigDeps + required_conan_version = ">=1.53.0" @@ -40,7 +43,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], @@ -54,8 +57,15 @@ def generate(self): cd = CMakeDeps(self) cd.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + # disable subdirs + save(self, os.path.join(self.source_folder, "src", "utils", "CMakeLists.txt"), "") + save(self, os.path.join(self.source_folder, "src", "tests", "CMakeLists.txt"), "") + save(self, os.path.join(self.source_folder, "src", "doc", "CMakeLists.txt"), "") + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/ptex/all/patches/0001-fix-cmake.patch b/recipes/ptex/all/patches/0001-fix-cmake.patch deleted file mode 100644 index f6481be77aa84..0000000000000 --- a/recipes/ptex/all/patches/0001-fix-cmake.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -33,6 +33,10 @@ enable_testing() - # Setup platform-specific threading flags. - find_package(Threads REQUIRED) - -+find_package(ZLIB REQUIRED) -+add_library(PkgConfig::Ptex_ZLIB INTERFACE IMPORTED) -+set_property(TARGET PkgConfig::Ptex_ZLIB PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) -+if(0) - # Use pkg-config to create a PkgConfig::Ptex_ZLIB imported target - find_package(PkgConfig REQUIRED) - pkg_checK_modules(Ptex_ZLIB REQUIRED zlib IMPORTED_TARGET) -@@ -59,6 +63,7 @@ if (NOT DEFINED PTEX_VER) - OUTPUT_STRIP_TRAILING_WHITESPACE) - endif () - endif () -+endif() - # Provide a fallback version when the Git repository is unavailable. - if (NOT PTEX_VER) - set(PTEX_VER "v2.3.X") -@@ -76,7 +81,7 @@ endif () - list(GET PTEX_VER_LIST 0 PTEX_MAJOR_VERSION) - list(GET PTEX_VER_LIST 1 PTEX_MINOR_VERSION) - --if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) -+if (0) - # Detect the build type from the $FLAVOR environment variable - # Default to optimized Release builds when unspecified. - if ("$ENV{FLAVOR}" MATCHES "debug") -@@ -116,7 +121,4 @@ endif () - include_directories(src/ptex) - - add_subdirectory(src/ptex) --add_subdirectory(src/utils) --add_subdirectory(src/tests) --add_subdirectory(src/doc) - add_subdirectory(src/build) ---- a/src/ptex/CMakeLists.txt -+++ b/src/ptex/CMakeLists.txt -@@ -21,6 +21,7 @@ if(PTEX_BUILD_STATIC_LIBS) - $ - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}) -+ target_compile_definitions(Ptex_static PUBLIC PTEX_STATIC) - target_link_libraries(Ptex_static - PUBLIC Threads::Threads PkgConfig::Ptex_ZLIB) - install(TARGETS Ptex_static EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) -@@ -39,7 +40,7 @@ if(PTEX_BUILD_SHARED_LIBS) - target_compile_definitions(Ptex_dynamic PRIVATE PTEX_EXPORTS) - target_link_libraries(Ptex_dynamic - PUBLIC Threads::Threads PkgConfig::Ptex_ZLIB) -- install(TARGETS Ptex_dynamic EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(TARGETS Ptex_dynamic EXPORT Ptex RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - - install(FILES diff --git a/recipes/ptex/all/patches/2.4.0-0001-fix-cmake.patch b/recipes/ptex/all/patches/2.4.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..df8361be35c65 --- /dev/null +++ b/recipes/ptex/all/patches/2.4.0-0001-fix-cmake.patch @@ -0,0 +1,49 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,6 +33,10 @@ enable_testing() + # Setup platform-specific threading flags. + find_package(Threads REQUIRED) + ++find_package(ZLIB REQUIRED) ++add_library(PkgConfig::Ptex_ZLIB INTERFACE IMPORTED) ++set_property(TARGET PkgConfig::Ptex_ZLIB PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) ++if(0) + # Use pkg-config to create a PkgConfig::Ptex_ZLIB imported target + find_package(PkgConfig REQUIRED) + pkg_checK_modules(Ptex_ZLIB REQUIRED zlib IMPORTED_TARGET) +@@ -59,6 +63,7 @@ if (NOT DEFINED PTEX_VER) + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif () + endif () ++endif() + # Provide a fallback version when the Git repository is unavailable. + if (NOT PTEX_VER) + set(PTEX_VER "v2.3.X") +@@ -76,7 +81,7 @@ endif () + list(GET PTEX_VER_LIST 0 PTEX_MAJOR_VERSION) + list(GET PTEX_VER_LIST 1 PTEX_MINOR_VERSION) + +-if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) ++if (0) + # Detect the build type from the $FLAVOR environment variable + # Default to optimized Release builds when unspecified. + if ("$ENV{FLAVOR}" MATCHES "debug") +--- a/src/ptex/CMakeLists.txt ++++ b/src/ptex/CMakeLists.txt +@@ -21,6 +21,7 @@ if(PTEX_BUILD_STATIC_LIBS) + $ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}) ++ target_compile_definitions(Ptex_static PUBLIC PTEX_STATIC) + target_link_libraries(Ptex_static + PUBLIC Threads::Threads PkgConfig::Ptex_ZLIB) + install(TARGETS Ptex_static EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) +@@ -39,7 +40,7 @@ if(PTEX_BUILD_SHARED_LIBS) + target_compile_definitions(Ptex_dynamic PRIVATE PTEX_EXPORTS) + target_link_libraries(Ptex_dynamic + PUBLIC Threads::Threads PkgConfig::Ptex_ZLIB) +- install(TARGETS Ptex_dynamic EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(TARGETS Ptex_dynamic EXPORT Ptex RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + install(FILES diff --git a/recipes/ptex/all/patches/2.4.2-0001-fix-cmake.patch b/recipes/ptex/all/patches/2.4.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..cfb56ff285af6 --- /dev/null +++ b/recipes/ptex/all/patches/2.4.2-0001-fix-cmake.patch @@ -0,0 +1,19 @@ +--- a/src/ptex/CMakeLists.txt ++++ b/src/ptex/CMakeLists.txt +@@ -22,6 +22,7 @@ if(PTEX_BUILD_STATIC_LIBS) + $ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}) ++ target_compile_definitions(Ptex_static PUBLIC PTEX_STATIC) + target_link_libraries(Ptex_static + PUBLIC Threads::Threads ZLIB::ZLIB) + install(TARGETS Ptex_static EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) +@@ -40,7 +41,7 @@ if(PTEX_BUILD_SHARED_LIBS) + target_compile_definitions(Ptex_dynamic PRIVATE PTEX_EXPORTS) + target_link_libraries(Ptex_dynamic + PUBLIC Threads::Threads ZLIB::ZLIB) +- install(TARGETS Ptex_dynamic EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(TARGETS Ptex_dynamic EXPORT Ptex RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + install(FILES diff --git a/recipes/ptex/config.yml b/recipes/ptex/config.yml index e1d4aed9fe78f..a61c26db894b1 100644 --- a/recipes/ptex/config.yml +++ b/recipes/ptex/config.yml @@ -1,3 +1,5 @@ versions: + "2.4.2": + folder: all "2.4.0": folder: all diff --git a/recipes/pugixml/all/conandata.yml b/recipes/pugixml/all/conandata.yml index 0e56e7f953dbc..cfdd629e0abb2 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 c5890f6dbab55..7ac623ed2f081 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 191cc957e0c3b..384412d36091f 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 84e7c6bf375e7..1a469fa5694df 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 388307853302a..7964480fefad5 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 be3c8ca6dae34..718caaaae44f4 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 4715fd995b522..d453ce024a968 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 91263ae215697..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..b1255b47b830e --- /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 700325f13fdc8..1338c7bbcf33f 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 d2814f09ff728..62adb5a253c62 100644 --- a/recipes/pybind11/all/conandata.yml +++ b/recipes/pybind11/all/conandata.yml @@ -17,3 +17,9 @@ sources: 2.10.1: url: "https://github.com/pybind/pybind11/archive/v2.10.1.tar.gz" sha256: "111014b516b625083bef701df7880f78c2243835abdb263065b6b59b960b6bad" + 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 4ca688fce0b2b..aa098ee90ec20 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/CMakeLists.txt b/recipes/pybind11/all/test_package/CMakeLists.txt index d142acb135035..e8d17d781285f 100644 --- a/recipes/pybind11/all/test_package/CMakeLists.txt +++ b/recipes/pybind11/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(pybind11 REQUIRED CONFIG) pybind11_add_module(test_package MODULE test_package.cpp) diff --git a/recipes/pybind11/all/test_package/conanfile.py b/recipes/pybind11/all/test_package/conanfile.py index 8c98920d26587..1022e21500a40 100644 --- a/recipes/pybind11/all/test_package/conanfile.py +++ b/recipes/pybind11/all/test_package/conanfile.py @@ -9,7 +9,7 @@ class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" test_type = "explicit" def requirements(self): @@ -20,6 +20,9 @@ def generate(self): deps.generate() toolchain = CMakeToolchain(self) + # Used by FindPython.cmake in CMake + toolchain.variables["Python_EXECUTABLE"] = PurePath(self._python_interpreter).as_posix() + # Used by FindPythonLibsNew.cmake in pybind11 toolchain.variables["PYTHON_EXECUTABLE"] = PurePath(self._python_interpreter).as_posix() toolchain.generate() @@ -47,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/all/test_v1_package/CMakeLists.txt b/recipes/pybind11/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3cee2617c4143..0000000000000 --- a/recipes/pybind11/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(test_package CXX) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_output_dirs_setup() -conan_set_rpath() -conan_set_std() -conan_set_fpic() -conan_check_compiler() -conan_set_libcxx() -conan_set_vs_runtime() - -find_package(Python COMPONENTS Interpreter Development) -find_package(pybind11 REQUIRED CONFIG) - -Python_add_library(test_package ../test_package/test_package.cpp) -target_link_libraries(test_package PRIVATE pybind11::headers) -set_property(TARGET test_package PROPERTY CXX_STANDARD 11) diff --git a/recipes/pybind11/all/test_v1_package/conanfile.py b/recipes/pybind11/all/test_v1_package/conanfile.py deleted file mode 100644 index 922ac10548541..0000000000000 --- a/recipes/pybind11/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +0,0 @@ -from conans import ConanFile, CMake, tools -import os -import sys -from platform import python_version - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.definitions["PYTHON_EXECUTABLE"] = self._python_interpreter - cmake.configure() - cmake.build() - - @property - def _python_interpreter(self): - if getattr(sys, "frozen", False): - return "python" - return sys.executable - - def test(self): - if not tools.cross_building(self): - with tools.environment_append({"PYTHONPATH": "lib"}): - python_module = os.path.join(self.source_folder, "..", "test_package", "test.py") - self.run(f"{self._python_interpreter} {python_module}", run_environment=True) diff --git a/recipes/pybind11/config.yml b/recipes/pybind11/config.yml index d015836d04db4..0637bb6f5067e 100644 --- a/recipes/pybind11/config.yml +++ b/recipes/pybind11/config.yml @@ -11,3 +11,7 @@ versions: folder: all "2.10.1": 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 4c4feedd8416a..829dedced7271 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 d1ca457a18f13..f795a0bec7158 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 7e2dfe859bb27..fae501d0afb9e 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 1e50fae0cd666..2ebca6ab52bbd 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 0000000000000..91630d79f4abb --- /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 0000000000000..7e2dfe859bb27 --- /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/pystring/all/conanfile.py b/recipes/pystring/all/conanfile.py index aae1b97c58843..1f4b786341b1d 100644 --- a/recipes/pystring/all/conanfile.py +++ b/recipes/pystring/all/conanfile.py @@ -11,10 +11,10 @@ class PystringConan(ConanFile): description = "Pystring is a collection of C++ functions which match the " \ "interface and behavior of python's string class methods using std::string." license = "BSD-3-Clause" - topics = ("pystring", "string") - homepage = "https://github.com/imageworks/pystring" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/imageworks/pystring" + topics = ("python", "string") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -39,8 +39,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/qarchive/all/conandata.yml b/recipes/qarchive/all/conandata.yml index da2432b9b6e33..5c350fe46c402 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 b299a0c2ae050..320e0e4349c52 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 3db8c0c3676e9..201ce057fb3e5 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 39427c2f3ccc3..504c6e681a712 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 c04a6ca2954e6..bd41a3e5c73fa 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 476d0ec62783b..7de5afa132670 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 ea1c210104fb1..5c076c42369f7 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 ec80e0c5cc134..ef5d7042163ec 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 68bad9e85cf15..3d79beba62257 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 0000000000000..91630d79f4abb --- /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 0000000000000..ec80e0c5cc134 --- /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 d5b0654a5d179..e97cf90bc30a7 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 353dd22d4b636..bc095a693b2c9 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -1,4 +1,73 @@ sources: + "5.15.12": + url: + - "https://download.qt.io/official_releases/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://download.qt.io/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirror.web4africa.ng/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirrors.sau.edu.cn/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirrors.cloud.tencent.com/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirror.bjtu.edu.cn/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" + sha256: "93f2c0889ee2e9cdf30c170d353c3f829de5f29ba21c119167dee5995e48ccce" + "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" + - "https://download.qt.io/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp1.nluug.nl/languages/qt/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp2.nluug.nl/languages/qt/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://master.qt.io/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirror.web4africa.ng/qt/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + sha256: "b545cb83c60934adc9a6bbd27e2af79e5013de77d46f5b9f5bb2a3c762bf55ca" "5.15.9": url: - "https://download.qt.io/official_releases/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" @@ -32,21 +101,101 @@ sources: - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" sha256: "8a71986676a3f37a198a9113acedbfd5bc5606a459b6b85816d951458adbe9a0" - "5.15.6": - url: - - "https://download.qt.io/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" - sha256: "ebc77d27934b70b25b3dc34fbec7c4471eb451848e891c42b32409ea30fe309f" - "5.15.5": - url: - - "https://download.qt.io/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" - sha256: "5a97827bdf9fd515f43bc7651defaf64fecb7a55e051c79b8f80510d0e990f06" patches: + "5.15.12": + - "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_description": "Fix qmake build with apple-clang>=15" + "patch_file": "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" + "patch_source": "https://codereview.qt-project.org/c/qt/qtbase/+/503916" + "patch_type": "portability" + - "base_path": "qt5/qtbase" + "patch_description": "Fix usage of memory_resource with apple-clang>=15 and deployment\ + \ target of macOS < 14" + "patch_file": "patches/5.15.12-fix-macos-cpp-lib-memory-resource.patch" + "patch_source": "https://codereview.qt-project.org/c/qt/qtbase/+/482392" + "patch_type": "portability" + "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" + - "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/337f28c9ab-5.15.8.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.9": - "base_path": "qt5/qtbase" "patch_file": "patches/aa2a39dea5.diff" @@ -70,6 +219,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" @@ -93,38 +252,17 @@ patches: base_path: "qt5/qtbase" - patch_file: "patches/android-new-ndk.diff" base_path: "qt5/qtbase" - "5.15.7": - - patch_file: "patches/337f28c9ab.patch" - base_path: "qt5/qtbase" - - patch_file: "patches/aa2a39dea5.diff" + - patch_file: "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" base_path: "qt5/qtbase" - - patch_file: "patches/c72097e.diff" - base_path: "qt5/qtwebengine" - - patch_file: "patches/fix-macdeployqt.diff" - base_path: "qt5/qttools" - - patch_file: "patches/dece6f5.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/QTBUG-98813.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/d3396fb6fc.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/107ed30ec5.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/chromium-v8-missing-constexpr.patch" - base_path: "qt5/qtwebengine/src/3rdparty/chromium/v8" - - patch_file: "patches/chromium-skia-missing-iterator-include.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/skia-cd397f3.diff" - base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" - - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/android-backtrace.diff" + 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_file: "patches/android-openssl.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/android-new-ndk.diff" - base_path: "qt5/qtbase" - "5.15.6": + 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" - patch_file: "patches/aa2a39dea5.diff" @@ -155,34 +293,13 @@ patches: base_path: "qt5/qtbase" - patch_file: "patches/android-new-ndk.diff" base_path: "qt5/qtbase" - "5.15.5": - - patch_file: "patches/337f28c9ab-5.15.5.patch" - base_path: "qt5/qtbase" - - patch_file: "patches/aa2a39dea5.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/c72097e.diff" - base_path: "qt5/qtwebengine" - - patch_file: "patches/fix-macdeployqt.diff" - base_path: "qt5/qttools" - - patch_file: "patches/dece6f5.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/QTBUG-98813.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/d3396fb6fc.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/107ed30ec5.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/chromium-v8-missing-constexpr.patch" - base_path: "qt5/qtwebengine/src/3rdparty/chromium/v8" - - patch_file: "patches/chromium-skia-missing-iterator-include.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/skia-cd397f3.diff" - base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" - - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/android-backtrace.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/android-openssl.diff" + - patch_file: "patches/5.15.7-fix-qmake-default-libdirs-apple-clang-15.patch" base_path: "qt5/qtbase" - - patch_file: "patches/android-new-ndk.diff" + 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 145542ecbe345..c3ba904144ea5 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": @@ -338,64 +338,68 @@ 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 Version(self.version) < "5.15.9" and self.settings.os == "Macos" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("qt does not support macOS on ARM before 5.15.9 (QTBUG-85279)") + 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: self.requires("pcre2/10.42") if self.options.get_safe("with_vulkan"): - self.requires("vulkan-loader/1.3.239.0") + self.requires("vulkan-loader/1.3.268.0") if is_apple_os(self): self.requires("moltenvk/1.2.2") if self.options.with_glib: - self.requires("glib/2.76.2") + self.requires("glib/2.78.3") # 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.2.1") + 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.1") + self.requires("icu/74.1") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: - self.requires("harfbuzz/7.1.0") + 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.39") + self.requires("libpng/1.6.40") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.41.2") + 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/14.7") + 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 +407,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.2") + self.requires("dbus/1.15.8") if self.options.qtwayland: - self.requires("wayland/1.21.0") - self.requires("xkbcommon/1.5.0") + self.requires("wayland/1.22.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.48.0") + self.requires("at-spi2-core/2.50.0") if self.options.get_safe("with_md4c", False): self.requires("md4c/0.4.8") @@ -437,12 +440,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.21.0") + self.tool_requires("wayland/") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -475,18 +478,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 +792,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 +845,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)) @@ -954,6 +959,7 @@ def _create_private_module(module, dependencies=[]): def package_info(self): self.cpp_info.set_property("cmake_file_name", "Qt5") + self.cpp_info.set_property("pkg_config_name", "qt5") self.cpp_info.names["cmake_find_package"] = "Qt5" self.cpp_info.names["cmake_find_package_multi"] = "Qt5" @@ -992,6 +998,7 @@ def _create_module(module, requires=[], has_include_dir=True): componentname = f"qt{module}" assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components" self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{module}") + self.cpp_info.components[componentname].set_property("pkg_config_name", f"Qt5{module}") self.cpp_info.components[componentname].names["cmake_find_package"] = module self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module if module.endswith("Private"): @@ -1001,7 +1008,14 @@ def _create_module(module, requires=[], has_include_dir=True): self.cpp_info.components[componentname].libs = [f"Qt5{libname}{libsuffix}"] if has_include_dir: self.cpp_info.components[componentname].includedirs = ["include", os.path.join("include", f"Qt{module}")] - self.cpp_info.components[componentname].defines = [f"QT_{module.upper()}_LIB"] + define = module.upper() + if define == "TEST": + define = "TESTLIB" + elif define == "XCBQPA": + define = "XCB_QPA_LIB" + elif define.endswith("SUPPORT"): + define = define.replace("SUPPORT", "_SUPPORT") + self.cpp_info.components[componentname].defines = [f"QT_{define}_LIB"] if module != "Core" and "Core" not in requires: requires.append("Core") self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) @@ -1033,6 +1047,12 @@ def _create_plugin(pluginname, libname, plugintype, requires): core_reqs.append("glib::glib-2.0") _create_module("Core", core_reqs) + pkg_config_vars = [ + "host_bins=${prefix}/bin", + "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}" @@ -1236,6 +1256,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/337f28c9ab-5.15.5.patch b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch deleted file mode 100644 index a2ea249c1db5f..0000000000000 --- a/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= -Date: Tue, 5 Jul 2022 15:38:33 +0200 -Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with - equivalent - -We can't use the replacement kIOMainPortDefault yet, as it's not -available in operating system versions we still support, but the -kIOMasterPortDefault documentation explicitly says that passing -NULL as a port argument indicates "use the default". - -As the underlying type of a mach_port_t is potentially either -a pointer or an unsigned int, we initialize the default to 0. - -Pick-to: 6.2 6.3 6.4 5.15 -Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0 -Reviewed-by: Alexandru Croitor ---- - src/corelib/global/qglobal.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -(limited to 'src/corelib/global/qglobal.cpp') - -diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp -index 738e39658f..c894471ad6 100644 ---- a/src/corelib/global/qglobal.cpp -+++ b/src/corelib/global/qglobal.cpp -@@ -3059,7 +3059,8 @@ QByteArray QSysInfo::machineUniqueId() - { - #if defined(Q_OS_DARWIN) && __has_include() - char uuid[UuidStringLen + 1]; -- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); -+ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault -+ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice")); - QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); - CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); - return QByteArray(uuid); --- -cgit v1.2.1 - 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 0000000000000..21112d5316d7a --- /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.12-fix-macos-cpp-lib-memory-resource.patch b/recipes/qt/5.x.x/patches/5.15.12-fix-macos-cpp-lib-memory-resource.patch new file mode 100644 index 0000000000000..96fc7fd858e95 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.12-fix-macos-cpp-lib-memory-resource.patch @@ -0,0 +1,43 @@ +--- a/src/corelib/global/qcompilerdetection.h ++++ b/src/corelib/global/qcompilerdetection.h +@@ -1055,16 +1055,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 0000000000000..2eb73ac2b79b5 --- /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 0000000000000..1f9f0f90f6e5b --- /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 0000000000000..a058fb5245ef2 --- /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.5.conf b/recipes/qt/5.x.x/qtmodules5.15.10.conf similarity index 100% rename from recipes/qt/5.x.x/qtmodules5.15.5.conf rename to recipes/qt/5.x.x/qtmodules5.15.10.conf diff --git a/recipes/qt/5.x.x/qtmodules5.15.6.conf b/recipes/qt/5.x.x/qtmodules5.15.11.conf similarity index 100% rename from recipes/qt/5.x.x/qtmodules5.15.6.conf rename to recipes/qt/5.x.x/qtmodules5.15.11.conf diff --git a/recipes/qt/5.x.x/qtmodules5.15.12.conf b/recipes/qt/5.x.x/qtmodules5.15.12.conf new file mode 100644 index 0000000000000..452233655f279 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.12.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/5.x.x/test_v1_package/conanfile.py b/recipes/qt/5.x.x/test_v1_package/conanfile.py index cc3b35ad8bcbd..5cb2041d25d7d 100644 --- a/recipes/qt/5.x.x/test_v1_package/conanfile.py +++ b/recipes/qt/5.x.x/test_v1_package/conanfile.py @@ -21,7 +21,7 @@ def build_requirements(self): if self._settings_build.os == "Windows" and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") if self._meson_supported(): - self.build_requires("meson/1.1.0") + self.build_requires("meson/1.1.1") def generate(self): save(self, "qt.conf", """[Paths] diff --git a/recipes/qt/6.x.x/conandata.yml b/recipes/qt/6.x.x/conandata.yml index b3b89583f4ce5..d81c0510b2a8f 100644 --- a/recipes/qt/6.x.x/conandata.yml +++ b/recipes/qt/6.x.x/conandata.yml @@ -1,22 +1,51 @@ sources: - "6.5.0": + "6.6.1": 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.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.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" @@ -25,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" @@ -41,82 +62,69 @@ sources: - "https://ftp.fau.de/qtproject/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" sha256: "b90524f686224a0e5a945c1d65307e16a375348dbe275c9ac11de171fe31374a" - "6.2.4": - url: - - "https://download.qt.io/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" - - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.2/6.2.4/single/qt-everywhere-src-6.2.4.tar.xz" - sha256: "cfe41905b6bde3712c65b102ea3d46fc80a44c9d1487669f14e4a6ee82ebb8fd" patches: - "6.5.0": - - base_path: "qtwebengine" - patch_description: "Workaround for too long .rps file name" - patch_file: "patches/c72097e.diff" + "6.6.1": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "patch_type": "bugfix" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + - "base_path": "qtbase" + "patch_description": "Fix build error with lambda on GCC 9.2" + "patch_file": "patches/32fa63f.patch" + "patch_type": "bugfix" + "patch_source": "https://bugreports.qt.io/browse/QTBUG-112920" + "6.6.0": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "patch_type": "bugfix" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + - "base_path": "qtbase" + "patch_description": "Fix build error with lambda on GCC 9.2" + "patch_file": "patches/32fa63f.patch" + "patch_type": "bugfix" + "patch_source": "https://bugreports.qt.io/browse/QTBUG-112920" + "6.5.3": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e.diff" + "patch_type": "bugfix" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + - "base_path": "qtbase" + "patch_description": "Fix build error with lambda on GCC 9.2" + "patch_file": "patches/32fa63f_6.5.0.patch" + "patch_type": "bugfix" + "patch_source": "https://bugreports.qt.io/browse/QTBUG-112920" "6.4.2": - 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" - "6.4.1": - - base_path: "qtbase/cmake" - patch_description: "Fix pri helpers" - patch_file: "patches/qt6-pri-helpers-fix.diff" + patch_source: "https://bugreports.qt.io/browse/QTBUG-95569" - patch_file: "patches/c72097e.diff" base_path: "qtwebengine" patch_description: "Workaround for too long .rps file name" + patch_type: "bugfix" + patch_source: "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" - 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" patch_file: "patches/qt6-pri-helpers-fix.diff" + patch_type: "bugfix" + patch_source: "https://bugreports.qt.io/browse/QTBUG-95569" - patch_file: "patches/c72097e.diff" base_path: "qtwebengine" patch_description: "Workaround for too long .rps file name" + patch_type: "bugfix" + patch_source: "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" - patch_file: "patches/d13958d.diff" base_path: "qtbase" patch_description: "Fix PCRE2 detection" patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/445885" patch_type: "bugfix" - "6.2.4": - - base_path: "qtdeclarative" - patch_description: "Directly include Unicode.h in YarrCanonicalize.h" - patch_file: "patches/32451d5.diff" - - 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/138a720.diff" - base_path: "qtwebengine/src/3rdparty" - patch_description: "Fix build with msvc2019 16.8.0" - - patch_file: "patches/CVE-2022-1096-qtwebengine-6.2.diff" - base_path: "qtwebengine" - patch_description: "Fix Chromium callback" - - patch_file: "patches/CVE-2022-25255-qprocess6-2.diff" - base_path: "qtbase" - patch_description: "Fix executable path resolution" - - patch_file: "patches/CVE-2022-25643-6.2.diff" - base_path: "qtbase" - patch_description: "Fix DLL path" - - patch_file: "patches/d13958d_.diff" - base_path: "qtbase" - patch_description: "Fix PCRE2 detection" diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 5511bfa479f30..a0967b918228d 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -1,5 +1,3 @@ -from contextlib import contextmanager - import configparser import glob import os @@ -8,51 +6,17 @@ 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.build import cross_building, check_min_cppstd, build_jobs, default_cppstd -from conan.tools.env import VirtualBuildEnv, Environment +from conan.tools.build import cross_building, check_min_cppstd, default_cppstd +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv, Environment from conan.tools.files import copy, get, replace_in_file, apply_conandata_patches, save, rm, rmdir, export_conandata_patches from conan.tools.gnu import PkgConfigDeps from conan.tools.microsoft import msvc_runtime_flag, is_msvc from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -from conans import RunEnvironment, tools -from conans.model import Generator required_conan_version = ">=1.55.0" -class qt(Generator): - @staticmethod - def content_template(path, folder, os_): - bin_folder = "bin" if os_ == "Windows" else "libexec" - return textwrap.dedent(f"""\ - [Paths] - Prefix = {path} - ArchData = {folder}/archdatadir - HostData = {folder}/archdatadir - Data = {folder}/datadir - Sysconf = {folder}/sysconfdir - LibraryExecutables = {folder}/archdatadir/{bin_folder} - HostLibraryExecutables = bin - Plugins = {folder}/archdatadir/plugins - Imports = {folder}/archdatadir/imports - Qml2Imports = {folder}/archdatadir/qml - Translations = {folder}/datadir/translations - Documentation = {folder}/datadir/doc - Examples = {folder}/datadir/examples""") - - @property - def filename(self): - return "qt.conf" - - @property - def content(self): - return qt.content_template( - self.conanfile.deps_cpp_info["qt"].rootpath.replace("\\", "/"), - "res", - self.conanfile.settings.os) - - class QtConan(ConanFile): _submodules = ["qtsvg", "qtdeclarative", "qttools", "qttranslations", "qtdoc", "qtwayland","qtquickcontrols2", "qtquicktimeline", "qtquick3d", "qtshadertools", "qt5compat", @@ -62,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." @@ -103,11 +68,11 @@ class QtConan(ConanFile): "gui": [True, False], "widgets": [True, False], - "device": "ANY", - "cross_compile": "ANY", - "sysroot": "ANY", + "device": [None, "ANY"], + "cross_compile": [None, "ANY"], + "sysroot": [None, "ANY"], "multiconfiguration": [True, False], - "disabled_features": "ANY", + "disabled_features": [None, "ANY"], } options.update({module: [True, False] for module in _submodules}) @@ -152,12 +117,15 @@ class QtConan(ConanFile): "multiconfiguration": False, "disabled_features": "", } - default_options.update({module: False for module in _submodules}) short_paths = True _submodules_tree = None + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + @property def _get_module_tree(self): if self._submodules_tree: @@ -171,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 @@ -212,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" @@ -222,15 +192,15 @@ def configure(self): del self.options.opengl del self.options.with_vulkan del self.options.with_freetype - del self.options.with_fontconfig + self.options.rm_safe("with_fontconfig") del self.options.with_harfbuzz del self.options.with_libjpeg del self.options.with_libpng del self.options.with_md4c - del self.options.with_x11 + self.options.rm_safe("with_x11") if not self.options.get_safe("qtmultimedia"): - del self.options.with_libalsa + self.options.rm_safe("with_libalsa") del self.options.with_openal del self.options.with_gstreamer del self.options.with_pulseaudio @@ -245,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 \ @@ -264,21 +243,18 @@ def validate(self): check_min_cppstd(self, 17) 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.") + self.output.warning("C++17 support required. Your compiler is unknown. Assuming it supports C++17.") elif Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("C++17 support required, which your compiler does not support.") - if Version(self.version) >= "6.5.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "9": - raise ConanInvalidConfiguration("qt 6.5.0 cannot be built with gcc 9, cf QTBUG-112920") - 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.3.0" and 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 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 Version(self.version) < "6.3.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) >= "11": - raise ConanInvalidConfiguration("Qt lower then 6.3.0 needs to be compiled for gcc with a version lower then 11") + 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: @@ -292,42 +268,6 @@ def validate(self): if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") - if Version(self.version) < "6.3.0": - # Check if a valid python2 is available in PATH or it will failflex - # Start by checking if python2 can be found - python_exe = tools.which("python2") - if not python_exe: - # Fall back on regular python - python_exe = tools.which("python") - - if not python_exe: - msg = ("Python2 must be available in PATH " - "in order to build Qt WebEngine") - raise ConanInvalidConfiguration(msg) - - # In any case, check its actual version for compatibility - from six import StringIO # Python 2 and 3 compatible - mybuf = StringIO() - cmd_v = f"\"{python_exe}\" --version" - self.run(cmd_v, output=mybuf) - verstr = mybuf.getvalue().strip().split("Python ")[1] - if verstr.endswith("+"): - verstr = verstr[:-1] - version = Version(verstr) - # >= 2.7.5 & < 3 - v_min = "2.7.5" - v_max = "3.0.0" - if v_min <= version < v_max: - msg = ("Found valid Python 2 required for QtWebengine:" - f" version={mybuf.getvalue()}, path={python_exe}") - self.output.success(msg) - else: - msg = (f"Found Python 2 in path, but with invalid version {verstr}" - f" (QtWebEngine requires >= {v_min} & < " - f"{v_max})\nIf you have both Python 2 and 3 installed, copy the python 2 executable to" - f"python2(.exe)") - raise ConanInvalidConfiguration(msg) - if self.options.widgets and not self.options.gui: raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " "You can either disable qt:widgets or enable qt:gui") @@ -359,102 +299,107 @@ def validate(self): if cross_building(self): raise ConanInvalidConfiguration("cross compiling qt 6 is not yet supported. Contributions are welcome") + 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.1t") + self.requires("openssl/[>=1.1 <4]") if self.options.with_pcre2: self.requires("pcre2/10.42") if self.options.get_safe("with_vulkan"): - self.requires("vulkan-loader/1.3.239.0") + self.requires("vulkan-loader/1.3.268.0") if is_apple_os(self): self.requires("moltenvk/1.2.2") if self.options.with_glib: - self.requires("glib/2.76.1") + self.requires("glib/2.78.3") if self.options.with_doubleconversion and not self.options.multiconfiguration: - self.requires("double-conversion/3.2.1") + 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.13.93") + self.requires("fontconfig/2.14.2") if self.options.get_safe("with_icu", False): - self.requires("icu/72.1") + self.requires("icu/74.1") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: - self.requires("harfbuzz/6.0.0") + 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.39") + self.requires("libpng/1.6.40") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.41.1") - self.options["sqlite3"].enable_column_metadata = True + 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/14.7") + 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.21.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") if self.options.get_safe("with_pulseaudio", False): self.requires("pulseaudio/14.2") if self.options.with_dbus: - self.requires("dbus/1.15.2") + self.requires("dbus/1.15.8") 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_md4c", False): self.requires("md4c/0.4.8") def build_requirements(self): - self.tool_requires("cmake/3.25.3") + 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.3") + self.tool_requires("pkgconf/2.1.0") if self.settings.os == "Windows": self.tool_requires('strawberryperl/5.32.1.1') if self.options.get_safe("qtwebengine"): - self.tool_requires("nodejs/16.3.0") + 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.21.0") + self.tool_requires("wayland/1.22.0") if cross_building(self): self.tool_requires(f"qt/{self.version}") @@ -480,10 +425,28 @@ def generate(self): pc = PkgConfigDeps(self) pc.generate() + vbe = VirtualBuildEnv(self) + vbe.generate() + if not cross_building(self): + vre = VirtualRunEnv(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": + # 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")) tc = CMakeToolchain(self, generator="Ninja") @@ -505,8 +468,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" @@ -517,7 +481,7 @@ def generate(self): tc.variables["INPUT_openssl"] = "no" else: tc.variables["HAVE_openssl"] = "ON" - if self.options["openssl"].shared: + if self.dependencies["openssl"].options.shared: tc.variables["INPUT_openssl"] = "runtime" tc.variables["QT_FEATURE_openssl_runtime"] = "ON" else: @@ -605,16 +569,18 @@ def generate(self): if xplatform_val: tc.variables["QT_QMAKE_TARGET_MKSPEC"] = xplatform_val else: - self.output.warn(f"host not supported: {self.settings.os} {self.settings.compiler} {self.settings.compiler.version} {self.settings.arch}") + 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: tc.variables["BUILD_WITH_PCH"]= "OFF" # disabling PCH to save disk space if self.settings.os == "Windows": - tc.variables["HOST_PERL"] = getattr(self, "user_info_build", self.deps_user_info)["strawberryperl"].perl + tc.variables["HOST_PERL"] = self.dependencies.build["strawberryperl"].conf_info.get("user.strawberryperl:perl", check_type=str) #"set(QT_EXTRA_INCLUDEPATHS ${CONAN_INCLUDE_DIRS})\n" #"set(QT_EXTRA_DEFINES ${CONAN_DEFINES})\n" #"set(QT_EXTRA_LIBDIRS ${CONAN_LIB_DIRS})\n" @@ -622,32 +588,52 @@ 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() + def package_id(self): + del self.info.options.cross_compile + del self.info.options.sysroot + if self.info.options.multiconfiguration: + if self.info.settings.compiler == "Visual Studio": + if "MD" in self.info.settings.compiler.runtime: + self.info.settings.compiler.runtime = "MD/MDd" + else: + self.info.settings.compiler.runtime = "MT/MTd" + elif self.info.settings.compiler == "msvc": + self.info.settings.compiler.runtime_type = "Release/Debug" + if self.info.settings.os == "Android": + del self.info.options.android_sdk + def source(self): destination = self.source_folder - if self.settings.os == "Windows": + if self.info.settings.os == "Windows": # Don't use os.path.join, or it removes the \\?\ prefix, which enables long paths - destination = f"\\\\?\\{self.source_folder}" + destination = rf"\\?\{self.source_folder}" get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=destination) # patching in source method because of no_copy_source attribute apply_conandata_patches(self) - if Version(self.version) >= "6.2.0": - for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: - replace_in_file(self, os.path.join(self.source_folder, "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), - " if (enable_precompiled_headers) {\n if (is_win) {", - " if (enable_precompiled_headers) {\n if (false) {" - ) + for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: + replace_in_file(self, os.path.join(self.source_folder, "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), + " if (enable_precompiled_headers) {\n if (is_win) {", + " if (enable_precompiled_headers) {\n if (false) {" + ) replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "QtInternalTargets.cmake"), "-Zc:wchar_t", @@ -658,16 +644,16 @@ def source(self): os.remove(file) # workaround QTBUG-94356 - if Version(self.version) >= "6.1.1": - zlib_file_name = "FindWrapSystemZLIB.cmake" if Version(self.version) >= "6.3.1" else "FindWrapZLIB.cmake" - replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", zlib_file_name), '"-lz"', 'ZLIB::ZLIB') - replace_in_file(self, os.path.join(self.source_folder, "qtbase", "configure.cmake"), - "set_property(TARGET ZLIB::ZLIB PROPERTY IMPORTED_GLOBAL TRUE)", - "") + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "FindWrapSystemZLIB.cmake"), '"-lz"', 'ZLIB::ZLIB') + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "configure.cmake"), + "set_property(TARGET ZLIB::ZLIB PROPERTY IMPORTED_GLOBAL TRUE)", + "") if Version(self.version) <= "6.4.0": # 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": @@ -766,41 +752,13 @@ def _xplatform(self): return None - @contextmanager - def _build_context(self): - with tools.vcvars(self) if is_msvc(self) else tools.no_op(): - # next lines force cmake package to be in PATH before the one provided by visual studio (vcvars) - build_env = tools.RunEnvironment(self).vars if is_msvc(self) else {} - build_env["MAKEFLAGS"] = f"j{build_jobs(self)}" - build_env["PKG_CONFIG_PATH"] = [self.build_folder] - if self.settings.os == "Windows": - if "PATH" not in build_env: - build_env["PATH"] = [] - build_env["PATH"].append(os.path.join(self.source_folder, "gnuwin32", "bin")) - if is_msvc(self): - # this avoids cmake using gcc from strawberryperl - build_env["CC"] = "cl" - build_env["CXX"] = "cl" - with tools.environment_append(build_env): - - if self.settings.os == "Macos": - save(self, ".qmake.stash" , "") - save(self, ".qmake.super" , "") - yield - def build(self): - with self._build_context(): - cmake = CMake(self) - cmake.configure() - if self.settings.os == "Macos": - dyld_library_path = ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"]) - save(self, "bash_env", f"export DYLD_LIBRARY_PATH=\"{dyld_library_path}\"") - with tools.environment_append({ - "BASH_ENV": os.path.abspath("bash_env") - }) if self.settings.os == "Macos" else tools.no_op(): - with tools.run_environment(self): - with tools.remove_from_path("perl") if self.settings.os == "Windows" else tools.no_op(): - cmake.build() + if self.settings.os == "Macos": + save(self, ".qmake.stash" , "") + save(self, ".qmake.super" , "") + cmake = CMake(self) + cmake.configure() + cmake.build() @property def _cmake_executables_file(self): @@ -814,13 +772,15 @@ def _cmake_qt6_private_file(self, module): return os.path.join("lib", "cmake", f"Qt6{module}", f"conan_qt_qt6_{module.lower()}private.cmake") def package(self): - with self._build_context(): - cmake = CMake(self) - cmake.install() - save(self, os.path.join(self.package_folder, "bin", "qt.conf"), qt.content_template("..", "res", self.settings.os)) - copy(self, "*LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Macos": + save(self, ".qmake.stash" , "") + save(self, ".qmake.super" , "") + cmake = CMake(self) + cmake.install() + 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"]: @@ -851,10 +811,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") @@ -873,7 +835,7 @@ def package(self): exe_path = path_ break if not exe_path: - self.output.warn(f"Could not find path to {target}{extension}") + self.output.warning(f"Could not find path to {target}{extension}") filecontents += textwrap.dedent(f"""\ if(NOT TARGET ${{QT_CMAKE_EXPORT_NAMESPACE}}::{target}) add_executable(${{QT_CMAKE_EXPORT_NAMESPACE}}::{target} IMPORTED) @@ -919,6 +881,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("""\ @@ -935,25 +900,9 @@ def _create_private_module(module, dependencies): )""") save(self, os.path.join(self.package_folder, self._cmake_entry_point_file), contents) - def package_id(self): - del self.info.options.cross_compile - del self.info.options.sysroot - if self.options.multiconfiguration and is_msvc(self): - if self.settings.compiler == "Visual Studio": - if "MD" in self.settings.compiler.runtime: - self.info.settings.compiler.runtime = "MD/MDd" - else: - self.info.settings.compiler.runtime = "MT/MTd" - else: - self.info.settings.compiler.runtime_type = "Release/Debug" - - @property - def _has_positioning(self): - return (self.options.get_safe("qtlocation") and Version(self.version) < "6.2.2") or \ - (self.options.get_safe("qtpositioning") and Version(self.version) >= "6.2.2") - def package_info(self): self.cpp_info.set_property("cmake_file_name", "Qt6") + self.cpp_info.set_property("pkg_config_name", "qt6") self.cpp_info.names["cmake_find_package"] = "Qt6" self.cpp_info.names["cmake_find_package_multi"] = "Qt6" @@ -994,6 +943,7 @@ def _create_module(module, requires, has_include_dir=True): componentname = f"qt{module}" assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components" self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt6::{module}") + self.cpp_info.components[componentname].set_property("pkg_config_name", f"Qt6{module}") self.cpp_info.components[componentname].names["cmake_find_package"] = module self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module if module.endswith("Private"): @@ -1033,25 +983,28 @@ def _create_plugin(pluginname, libname, plugintype, requires): core_reqs.append("zstd::zstd") if self.options.with_glib: core_reqs.append("glib::glib") + if self.options.openssl: + core_reqs.append("openssl::openssl") # used by QCryptographicHash _create_module("Core", core_reqs) + pkg_config_vars = [ + "bindir=${prefix}/bin", + "libexecdir=${prefix}/bin", + "exec_prefix=${prefix}", + ] + self.cpp_info.components["qtCore"].set_property("pkg_config_custom_content", "\n".join(pkg_config_vars)) + if self.settings.os == "Windows": - if Version(self.version) >= "6.3.0": - self.cpp_info.components["qtCore"].system_libs.append("authz") + self.cpp_info.components["qtCore"].system_libs.append("authz") if is_msvc(self): - if Version(self.version) >= "6.3.0": - self.cpp_info.components["qtCore"].cxxflags.append("-permissive-") - if Version(self.version) >= "6.2.0": - self.cpp_info.components["qtCore"].cxxflags.append("-Zc:__cplusplus") - self.cpp_info.components["qtCore"].system_libs.append("synchronization") - if Version(self.version) >= "6.2.1": - self.cpp_info.components["qtCore"].system_libs.append("runtimeobject") + self.cpp_info.components["qtCore"].cxxflags.append("-permissive-") + self.cpp_info.components["qtCore"].cxxflags.append("-Zc:__cplusplus") + self.cpp_info.components["qtCore"].system_libs.append("synchronization") + self.cpp_info.components["qtCore"].system_libs.append("runtimeobject") self.cpp_info.components["qtPlatform"].set_property("cmake_target_name", "Qt6::Platform") self.cpp_info.components["qtPlatform"].names["cmake_find_package"] = "Platform" self.cpp_info.components["qtPlatform"].names["cmake_find_package_multi"] = "Platform" self.cpp_info.components["qtPlatform"].includedirs = [os.path.join("res", "archdatadir", "mkspecs", self._xplatform())] - if Version(self.version) < "6.1.0": - self.cpp_info.components["qtCore"].libs.append(f"Qt6Core_qobject{libsuffix}") if self.options.with_dbus: _create_module("DBus", ["dbus::dbus"]) if self.options.gui: @@ -1087,7 +1040,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"]) @@ -1156,7 +1109,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_module("Core5Compat", []) # since https://github.com/qt/qtdeclarative/commit/4fb84137f1c0a49d64b8bef66fef8a4384cc2a68 - qt_quick_enabled = self.options.gui and (Version(self.version) < "6.2.0" or self.options.qtshadertools) + qt_quick_enabled = self.options.gui and self.options.qtshadertools if self.options.qtdeclarative: _create_module("Qml", ["Network"]) @@ -1171,6 +1124,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: @@ -1193,13 +1147,14 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_module("Quick3DRuntimeRender", ["Gui", "Quick", "Quick3DAssetImport", "Quick3DUtils", "ShaderTools"]) _create_module("Quick3D", ["Gui", "Qml", "Quick", "Quick3DRuntimeRender"]) - if (self.options.get_safe("qtquickcontrols2") or \ - (self.options.qtdeclarative and Version(self.version) >= "6.2.0")) and qt_quick_enabled: + if (self.options.get_safe("qtquickcontrols2") or self.options.qtdeclarative ) and qt_quick_enabled: _create_module("QuickControls2", ["Gui", "Quick"]) _create_module("QuickTemplates2", ["Gui", "Quick"]) 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"]) @@ -1273,33 +1228,17 @@ 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._has_positioning: + if self.options.get_safe("qtpositioning"): _create_module("Positioning", []) _create_plugin("QGeoPositionInfoSourceFactoryGeoclue2", "qtposition_geoclue2", "position", []) _create_plugin("QGeoPositionInfoSourceFactoryPoll", "qtposition_positionpoll", "position", []) @@ -1336,7 +1275,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.get_safe("qtwebengine") and qt_quick_enabled: webenginereqs = ["Gui", "Quick", "WebChannel"] - if self._has_positioning: + if self.options.get_safe("qtpositioning"): webenginereqs.append("Positioning") if self.settings.os == "Linux": webenginereqs.extend(["expat::expat", "opus::libopus", "xorg-proto::xorg-proto", "libxshmfence::libxshmfence", \ @@ -1351,6 +1290,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") @@ -1397,6 +1349,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") @@ -1410,10 +1363,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) @@ -1436,6 +1394,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/138a720.diff b/recipes/qt/6.x.x/patches/138a720.diff deleted file mode 100644 index 0d48b6636dade..0000000000000 --- a/recipes/qt/6.x.x/patches/138a720.diff +++ /dev/null @@ -1,21 +0,0 @@ -From 138a7203f16cf356e9d4dac697920a22437014b0 Mon Sep 17 00:00:00 2001 -From: Peter Varga -Date: Fri, 13 Nov 2020 11:09:23 +0100 -Subject: [PATCH] Fix build with msvc2019 16.8.0 - -Fixes: QTBUG-88708 -Change-Id: I3554ceec0437801b4861f68edd504d01fc01cf93 -Reviewed-by: Allan Sandfeld Jensen ---- - -diff --git a/chromium/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h b/chromium/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h -index 78c316e..136c796 100644 ---- a/chromium/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h -+++ b/chromium/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h -@@ -145,5 +145,5 @@ - // https://en.wikipedia.org/wiki/CIELAB_color_space#Forward_transformation. - SkV3 ToXYZ(const SkV3& lab) const { - auto invf = [](float x) -> float { -- return x > kSigma ? pow(x, 3) : 3 * kSigma2 * (x - 4.0f / 29.0f); -+ return x > kSigma ? (float)pow(x, 3) : 3 * kSigma2 * (x - 4.0f / 29.0f); - }; diff --git a/recipes/qt/6.x.x/patches/311d29d.patch b/recipes/qt/6.x.x/patches/311d29d.patch deleted file mode 100644 index 600bcca81e265..0000000000000 --- a/recipes/qt/6.x.x/patches/311d29d.patch +++ /dev/null @@ -1,30 +0,0 @@ -From bb01fe6bdf2e52939698de928a1fbeaf3cce4259 Mon Sep 17 00:00:00 2001 -From: Ilya Fedin -Date: Tue, 12 Apr 2022 14:02:36 +0400 -Subject: [PATCH] Fix build on CentOS 7 - -This little change fixes the build on CentOS 7 - -Pick-to: 6.3 -Change-Id: Ic9717147c10ca78e36d6311944de417c6420211d -Reviewed-by: Thiago Macieira ---- - src/corelib/plugin/qelfparser_p.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp -index c6ccda92fb..def1e2494a 100644 ---- a/src/corelib/plugin/qelfparser_p.cpp -+++ b/src/corelib/plugin/qelfparser_p.cpp -@@ -409,7 +409,9 @@ Q_DECL_UNUSED Q_DECL_COLD_FUNCTION static QDebug &operator<<(QDebug &d, ElfHeade - case EM_NONE: d << ", no machine"; break; - case EM_ARM: d << ", ARM"; break; - case EM_AARCH64: d << ", AArch64"; break; -+#ifdef EM_BLACKFIN - case EM_BLACKFIN: d << ", Blackfin"; break; -+#endif - case EM_IA_64: d << ", IA-64"; break; - case EM_MIPS: d << ", MIPS"; break; - case EM_PPC: d << ", PowerPC"; break; --- -2.34.1 diff --git a/recipes/qt/6.x.x/patches/32451d5.diff b/recipes/qt/6.x.x/patches/32451d5.diff deleted file mode 100644 index f9388cbc4f1b8..0000000000000 --- a/recipes/qt/6.x.x/patches/32451d5.diff +++ /dev/null @@ -1,32 +0,0 @@ -From 32451d5c9126921180aad4bf78ec6af5eb27ec2a Mon Sep 17 00:00:00 2001 -From: Ulf Hermann -Date: Tue, 13 Jul 2021 11:05:51 +0200 -Subject: [PATCH] Directly include Unicode.h in YarrCanonicalize.h - -The redirection via utypes.h can be problematic if you have another -utypes.h around in a prominent place. It's easily avoided, though. - -Fixes: QTBUG-77528 -Change-Id: I50368f56b0d7eb957955900a32dbb625a38d02af ---- - -diff --git a/src/3rdparty/masm/stubs/wtf/unicode/utypes.h b/src/3rdparty/masm/stubs/wtf/unicode/utypes.h -deleted file mode 100644 -index e1b4ff9..0000000 ---- a/src/3rdparty/masm/stubs/wtf/unicode/utypes.h -+++ /dev/null -@@ -1 +0,0 @@ --#include -diff --git a/src/3rdparty/masm/yarr/YarrCanonicalize.h b/src/3rdparty/masm/yarr/YarrCanonicalize.h -index cbd279e..17c9831 100644 ---- a/src/3rdparty/masm/yarr/YarrCanonicalize.h -+++ b/src/3rdparty/masm/yarr/YarrCanonicalize.h -@@ -26,7 +26,7 @@ - #pragma once - - #include --#include -+#include - - namespace JSC { namespace Yarr { - diff --git a/recipes/qt/6.x.x/patches/32fa63f.patch b/recipes/qt/6.x.x/patches/32fa63f.patch new file mode 100644 index 0000000000000..733b0c131f1f5 --- /dev/null +++ b/recipes/qt/6.x.x/patches/32fa63f.patch @@ -0,0 +1,28 @@ +From b404930e122013e76ba8fe165f3432288c051438 Mon Sep 17 00:00:00 2001 +From: shjiu +Date: Fri, 17 Nov 2023 09:41:31 +0900 +Subject: [PATCH] Fix build error with lambda on GCC 9.2 + +This patch is specific to the return type of updatePtrSimd function as boolean to avoid the bug of GCC 9.2. + +Fixes: QTBUG-112920 +Pick-to: 6.7 6.6 6.5 +Change-Id: I21cb1f6dda34448b2290ab72ec280b6b2a3732c9 +Reviewed-by: Volker Hilsheimer +--- + src/corelib/text/qstring.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp +index 2dc415584f3..d9e89f8e5bb 100644 +--- a/src/corelib/text/qstring.cpp ++++ b/src/corelib/text/qstring.cpp +@@ -471,7 +471,7 @@ static bool simdTestMask(const char *&ptr, const char *end, quint32 maskval) + if constexpr (UseSse4_1) { + # ifndef Q_OS_QNX // compiler fails in the code below + __m128i mask; +- auto updatePtrSimd = [&](__m128i data) { ++ auto updatePtrSimd = [&](__m128i data) -> bool { + __m128i masked = _mm_and_si128(mask, data); + __m128i comparison = _mm_cmpeq_epi16(masked, _mm_setzero_si128()); + uint result = _mm_movemask_epi8(comparison); diff --git a/recipes/qt/6.x.x/patches/32fa63f_6.5.0.patch b/recipes/qt/6.x.x/patches/32fa63f_6.5.0.patch new file mode 100644 index 0000000000000..3675cf9dd16d7 --- /dev/null +++ b/recipes/qt/6.x.x/patches/32fa63f_6.5.0.patch @@ -0,0 +1,28 @@ +From b404930e122013e76ba8fe165f3432288c051438 Mon Sep 17 00:00:00 2001 +From: shjiu +Date: Fri, 17 Nov 2023 09:41:31 +0900 +Subject: [PATCH] Fix build error with lambda on GCC 9.2 + +This patch is specific to the return type of updatePtrSimd function as boolean to avoid the bug of GCC 9.2. + +Fixes: QTBUG-112920 +Pick-to: 6.7 6.6 6.5 +Change-Id: I21cb1f6dda34448b2290ab72ec280b6b2a3732c9 +Reviewed-by: Volker Hilsheimer +--- + src/corelib/text/qstring.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp +index 2dc415584f3..d9e89f8e5bb 100644 +--- a/src/corelib/text/qstring.cpp ++++ b/src/corelib/text/qstring.cpp +@@ -461,7 +461,7 @@ static bool simdTestMask(const char *&ptr, const char *end, quint32 maskval) + if constexpr (UseSse4_1) { + # ifndef Q_OS_QNX // compiler fails in the code below + __m128i mask; +- auto updatePtrSimd = [&](__m128i data) { ++ auto updatePtrSimd = [&](__m128i data) -> bool { + __m128i masked = _mm_and_si128(mask, data); + __m128i comparison = _mm_cmpeq_epi16(masked, _mm_setzero_si128()); + uint result = _mm_movemask_epi8(comparison); 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 79b347ce90a23..0000000000000 --- 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/5fe0b82.patch b/recipes/qt/6.x.x/patches/5fe0b82.patch deleted file mode 100644 index ae2f8aae34ea9..0000000000000 --- a/recipes/qt/6.x.x/patches/5fe0b82.patch +++ /dev/null @@ -1,23 +0,0 @@ -From bb01af1c36cebd08d407c9a06e5a3c906bd9a660 Mon Sep 17 00:00:00 2001 -From: Mark Jan van Kampen -Date: Wed, 27 Oct 2021 06:49:11 +0200 -Subject: [PATCH] Adds missing includes to utf8_strings.h - ---- - include/litehtml/utf8_strings.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/include/litehtml/utf8_strings.h b/include/litehtml/utf8_strings.h -index c5b2421..35d474f 100644 ---- a/include/litehtml/utf8_strings.h -+++ b/include/litehtml/utf8_strings.h -@@ -1,6 +1,9 @@ - #ifndef LH_UTF8_STRINGS_H - #define LH_UTF8_STRINGS_H - -+#include "os_types.h" -+#include "types.h" -+ - namespace litehtml - { - class utf8_to_wchar diff --git a/recipes/qt/6.x.x/patches/CVE-2022-1096-qtwebengine-6.2.diff b/recipes/qt/6.x.x/patches/CVE-2022-1096-qtwebengine-6.2.diff deleted file mode 100644 index 157d0781d4702..0000000000000 --- a/recipes/qt/6.x.x/patches/CVE-2022-1096-qtwebengine-6.2.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- a/src/3rdparty/chromium/v8/src/objects/objects.cc -+++ b/src/3rdparty/chromium/v8/src/objects/objects.cc -@@ -2513,6 +2513,12 @@ Maybe Object::SetPropertyInternal(LookupIterator* it, - Maybe result = - JSObject::SetPropertyWithInterceptor(it, should_throw, value); - if (result.IsNothing() || result.FromJust()) return result; -+ // Assuming that the callback have side effects, we use -+ // Object::SetSuperProperty() which works properly regardless on -+ // whether the property was present on the receiver or not when -+ // storing to the receiver. -+ // Proceed lookup from the next state. -+ it->Next(); - } else { - Maybe maybe_attributes = - JSObject::GetPropertyAttributesWithInterceptor(it); -@@ -2533,10 +2539,8 @@ Maybe Object::SetPropertyInternal(LookupIterator* it, - // property to the receiver. - it->NotFound(); - } -- return Object::SetSuperProperty(it, value, store_origin, -- should_throw); - } -- break; -+ return Object::SetSuperProperty(it, value, store_origin, should_throw); - } - - case LookupIterator::ACCESSOR: { diff --git a/recipes/qt/6.x.x/patches/CVE-2022-25255-qprocess6-2.diff b/recipes/qt/6.x.x/patches/CVE-2022-25255-qprocess6-2.diff deleted file mode 100644 index 3a566b1b64daa..0000000000000 --- a/recipes/qt/6.x.x/patches/CVE-2022-25255-qprocess6-2.diff +++ /dev/null @@ -1,25 +0,0 @@ ---- a/src/corelib/io/qprocess_unix.cpp -+++ b/src/corelib/io/qprocess_unix.cpp -@@ -1,7 +1,7 @@ - /**************************************************************************** - ** - ** Copyright (C) 2020 The Qt Company Ltd. --** Copyright (C) 2021 Intel Corporation. -+** Copyright (C) 2022 Intel Corporation. - ** Copyright (C) 2021 Alex Trotsenko. - ** Contact: https://www.qt.io/licensing/ - ** -@@ -437,9 +437,10 @@ static QString resolveExecutable(const QString &program) - #endif - - if (!program.contains(QLatin1Char('/'))) { -- QString exeFilePath = QStandardPaths::findExecutable(program); -- if (!exeFilePath.isEmpty()) -- return exeFilePath; -+ // findExecutable() returns its argument if it's an absolute path, -+ // otherwise it searches $PATH; returns empty if not found (we handle -+ // that case much later) -+ return QStandardPaths::findExecutable(program); - } - return program; - } diff --git a/recipes/qt/6.x.x/patches/CVE-2022-25643-6.2.diff b/recipes/qt/6.x.x/patches/CVE-2022-25643-6.2.diff deleted file mode 100644 index c71c32e4002b3..0000000000000 --- a/recipes/qt/6.x.x/patches/CVE-2022-25643-6.2.diff +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp -index 1a7be0d271..9a8506d971 100644 ---- a/src/plugins/platforms/windows/qwindowsglcontext.cpp -+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp -@@ -47,7 +47,7 @@ - #include - #include - #include -- -+#include - #include - - #include -@@ -162,19 +162,25 @@ QFunctionPointer QWindowsOpengl32DLL::resolve(const char *name) - - bool QWindowsOpengl32DLL::init(bool softwareRendering) - { -- const QByteArray opengl32 = QByteArrayLiteral("opengl32.dll"); -- const QByteArray swopengl = QByteArrayLiteral("opengl32sw.dll"); -+ const QByteArray opengl32 = QByteArrayLiteral("opengl32"); -+ const QByteArray swopengl = QByteArrayLiteral("opengl32sw"); -+ bool useSystemLib = false; - - QByteArray openglDll = qgetenv("QT_OPENGL_DLL"); -- if (openglDll.isEmpty()) -+ if (openglDll.isEmpty()) { - openglDll = softwareRendering ? swopengl : opengl32; -+ useSystemLib = !softwareRendering; -+ } - - openglDll = openglDll.toLower(); - m_nonOpengl32 = openglDll != opengl32; - - qCDebug(lcQpaGl) << "Qt: Using WGL and OpenGL from" << openglDll; - -- m_lib = ::LoadLibraryA(openglDll.constData()); -+ if (useSystemLib) -+ m_lib = QSystemLibrary::load((wchar_t*)(QString::fromLatin1(openglDll).utf16())); -+ else -+ m_lib = LoadLibraryA(openglDll.constData()); - if (!m_lib) { - qErrnoWarning(::GetLastError(), "Failed to load %s", openglDll.constData()); - return false; -@@ -184,7 +190,7 @@ bool QWindowsOpengl32DLL::init(bool softwareRendering) - // Load opengl32.dll always. GDI functions like ChoosePixelFormat do - // GetModuleHandle for opengl32.dll and behave differently (and call back into - // opengl32) when the module is present. This is fine for dummy contexts and windows. -- ::LoadLibraryA("opengl32.dll"); -+ QSystemLibrary::load(L"opengl32"); - } - - wglCreateContext = reinterpret_cast(resolve("wglCreateContext")); -diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp -index 0b1af47a65..1757b6a0dc 100644 ---- a/src/plugins/platforms/windows/qwindowsopengltester.cpp -+++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp -@@ -49,6 +49,7 @@ - #include - #include - #include -+#include - - #ifndef QT_NO_OPENGL - #include -@@ -358,7 +359,7 @@ bool QWindowsOpenGLTester::testDesktopGL() - - // Test #1: Load opengl32.dll and try to resolve an OpenGL 2 function. - // This will typically fail on systems that do not have a real OpenGL driver. -- lib = LoadLibraryA("opengl32.dll"); -+ lib = QSystemLibrary::load(L"opengl32"); - if (lib) { - CreateContext = reinterpret_cast( - reinterpret_cast(::GetProcAddress(lib, "wglCreateContext"))); 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 0000000000000..968f4abf220b6 --- /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/c76d2f6.patch b/recipes/qt/6.x.x/patches/c76d2f6.patch deleted file mode 100644 index 8c701061dd5d0..0000000000000 --- a/recipes/qt/6.x.x/patches/c76d2f6.patch +++ /dev/null @@ -1,70 +0,0 @@ -From c76d2f6e997d84d81b0b22e0bd3afdaf7acfe3b3 Mon Sep 17 00:00:00 2001 -From: Allan Sandfeld Jensen -Date: Wed, 13 Oct 2021 12:36:02 +0200 -Subject: [PATCH] Fix build with Win10 21H1 SDK and Win11 SDK - -Different parts are not fully defined - -Task-number: QTBUG-96533 -Change-Id: I4fcb795cea33c519ee082aa69a63660e581a2759 -Reviewed-by: Allan Sandfeld Jensen ---- - chromium/media/gpu/windows/d3d11_av1_accelerator.cc | 2 ++ - chromium/sandbox/win/src/process_mitigations.h | 13 +++++++++---- - 2 files changed, 11 insertions(+), 4 deletions(-) - -diff --git a/chromium/media/gpu/windows/d3d11_av1_accelerator.cc b/chromium/media/gpu/windows/d3d11_av1_accelerator.cc -index 8d2d808ed2a..a4d3a79d7c5 100644 ---- a/chromium/media/gpu/windows/d3d11_av1_accelerator.cc -+++ b/chromium/media/gpu/windows/d3d11_av1_accelerator.cc -@@ -15,6 +15,7 @@ - #include "media/gpu/codec_picture.h" - #include "media/gpu/windows/d3d11_picture_buffer.h" - -+#if !defined(NTDDI_WIN10_FE) // Windows 10.0.20348.0 - // These are from in a newer SDK than the one Chrome ships with. They - // should be deleted once Chrome switches to the updated SDK; they have been - // copied from: https://www.microsoft.com/en-us/download/details.aspx?id=101577 -@@ -279,6 +280,7 @@ typedef struct _DXVA_Tile_AV1 { - UCHAR Reserved8Bits; - } DXVA_Tile_AV1, *LPDXVA_Tile_AV1; - #pragma pack(pop) -+#endif // !defined(NTDDI_WIN10_FE) - - namespace media { - -diff --git a/chromium/sandbox/win/src/process_mitigations.h b/chromium/sandbox/win/src/process_mitigations.h -index 3b511fe2bd9..72b314c335e 100644 ---- a/chromium/sandbox/win/src/process_mitigations.h -+++ b/chromium/sandbox/win/src/process_mitigations.h -@@ -12,21 +12,26 @@ - #include "sandbox/win/src/security_level.h" - - // This will be defined in an upcoming Windows SDK release --#ifndef COMPONENT_KTM -+#ifndef PROC_THREAD_ATTRIBUTE_MACHINE_TYPE - -+#ifndef COMPONENT_KTM - #define COMPONENT_KTM 0x01 - #define COMPONENT_VALID_FLAGS (COMPONENT_KTM) --#define ProcThreadAttributeComponentFilter 26 - - typedef struct _COMPONENT_FILTER { - ULONG ComponentFlags; - } COMPONENT_FILTER, *PCOMPONENT_FILTER; -+#endif // COMPONENT_KTM - -+#define ProcThreadAttributeComponentFilter 26 -+#endif // PROC_THREAD_ATTRIBUTE_MACHINE_TYPE -+ -+// This seems to remain undefined in newer SDKs -+#ifndef PROC_THREAD_ATTRIBUTE_COMPONENT_FILTER - #define PROC_THREAD_ATTRIBUTE_COMPONENT_FILTER \ - ProcThreadAttributeValue(ProcThreadAttributeComponentFilter, FALSE, TRUE, \ - FALSE) -- --#endif // COMPONENT_KTM -+#endif - - namespace sandbox { - diff --git a/recipes/qt/6.x.x/patches/d13958d_.diff b/recipes/qt/6.x.x/patches/d13958d_.diff deleted file mode 100644 index 2e9d40bd0efc0..0000000000000 --- a/recipes/qt/6.x.x/patches/d13958d_.diff +++ /dev/null @@ -1,23 +0,0 @@ -From d13958dabb9f5542d772c6312cd33e4960bf1137 Mon Sep 17 00:00:00 2001 -From: Eric Lemanissier -Date: Tue, 29 Nov 2022 09:15:58 +0000 -Subject: [PATCH] fix pcre2 detection - -Pick-to: 6.3 -Change-Id: I89f167e11bf1c72c9fae474ddd12380636ac5df8 ---- - -diff --git a/cmake/FindWrapSystemPCRE2.cmake b/cmake/FindWrapSystemPCRE2.cmake -index f8516d3..3ac04b8 100644 ---- a/cmake/FindWrapSystemPCRE2.cmake -+++ b/cmake/FindWrapSystemPCRE2.cmake -@@ -6,7 +6,7 @@ - --find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG QUIET) -+find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} COMPONENTS 16BIT QUIET) - --set(__pcre2_target_name "PCRE2::pcre2-16") -+set(__pcre2_target_name "PCRE2::16BIT") - if(PCRE2_FOUND AND TARGET "${__pcre2_target_name}") - # Hunter case. - set(__pcre2_found TRUE) diff --git a/recipes/qt/6.x.x/patches/dece6f5.patch b/recipes/qt/6.x.x/patches/dece6f5.patch deleted file mode 100644 index 16a69952d4016..0000000000000 --- a/recipes/qt/6.x.x/patches/dece6f5.patch +++ /dev/null @@ -1,25 +0,0 @@ -From dece6f5840463ae2ddf927d65eb1b3680e34a547 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=C3=98ystein=20Heskestad?= -Date: Wed, 27 Oct 2021 13:07:46 +0200 -Subject: Add missing macOS header file that was indirectly included before - -Change-Id: I4d4c7d4f957fc36dea5e06eb6d661aeecf6385f1 -Reviewed-by: Timur Pocheptsov ---- - src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h | 1 + - 1 file changed, 1 insertion(+) - -(limited to 'src/plugins/platforms/cocoa') - -diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h -index 5d4b6d6a71..cc7193d8b7 100644 ---- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h -+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h -@@ -43,6 +43,7 @@ - #include - #include - -+#include - #include - - QT_BEGIN_NAMESPACE 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 92bee3c5b0551..0000000000000 --- 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 0ab0c4ef10277..0000000000000 --- 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 809df6bd31582..0000000000000 --- 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.3.conf b/recipes/qt/6.x.x/qtmodules6.5.3.conf new file mode 100644 index 0000000000000..aee8d5684dcec --- /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 0000000000000..e3853727b0712 --- /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 0000000000000..3d1fa112d7390 --- /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/CMakeLists.txt b/recipes/qt/6.x.x/test_package/CMakeLists.txt index 3a020d154ec7c..337604f1af6ee 100644 --- a/recipes/qt/6.x.x/test_package/CMakeLists.txt +++ b/recipes/qt/6.x.x/test_package/CMakeLists.txt @@ -1,25 +1,9 @@ -cmake_minimum_required(VERSION 3.3.0) - -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_set_vs_runtime() -conan_set_libcxx() -conan_output_dirs_setup() +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(Qt6 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) - -add_executable(${PROJECT_NAME} test_package.cpp greeter.h example.qrc) - -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) - -target_link_libraries(${PROJECT_NAME} Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) - -# check if extra qt cmake functions are usable -qt_add_executable(${PROJECT_NAME}2 test_package.cpp greeter.h example.qrc) - -set_property(TARGET ${PROJECT_NAME}2 PROPERTY CXX_STANDARD 17) -target_link_libraries(${PROJECT_NAME}2 PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) +add_executable(${PROJECT_NAME} WIN32 test_package.cpp greeter.h example.qrc) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC ON AUTORCC ON) diff --git a/recipes/qt/6.x.x/test_package/conanfile.py b/recipes/qt/6.x.x/test_package/conanfile.py index 05478516b0d29..1153f37c5a877 100644 --- a/recipes/qt/6.x.x/test_package/conanfile.py +++ b/recipes/qt/6.x.x/test_package/conanfile.py @@ -1,130 +1,57 @@ import os -import shutil from conan import ConanFile -from conan.tools.build import cross_building -from conan.tools.files import mkdir, chdir -from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version - -from conans import tools, Meson, RunEnvironment, CMake -from conan.errors import ConanException +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import VirtualRunEnv +from conan.tools.files import copy, save class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "qt", "cmake", "cmake_find_package_multi", "cmake_find_package", "pkg_config", "qmake" - - def build_requirements(self): - self.tool_requires("cmake/3.25.3") - if self._meson_supported(): - self.tool_requires("meson/1.0.1") - - def _is_mingw(self): - return self.settings.os == "Windows" and self.settings.compiler == "gcc" - - def _meson_supported(self): - return False and self.options["qt"].shared and\ - not cross_building(self) and\ - not self.settings.os == "Macos" and\ - not self._is_mingw() - - def _qmake_supported(self): - return self.options["qt"].shared - - def _build_with_qmake(self): - if not self._qmake_supported(): - return - mkdir(self, "qmake_folder") - with chdir(self, "qmake_folder"): - self.output.info("Building with qmake") - - with tools.vcvars(self.settings) if is_msvc(self) else tools.no_op(): - args = [self.source_folder, "DESTDIR=bin"] - - def _getenvpath(var): - val = os.getenv(var) - if val and tools.os_info.is_windows: - val = val.replace("\\", "/") - os.environ[var] = val - return val + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv" + test_type = "explicit" - value = _getenvpath('CC') - if value: - args.append(f"QMAKE_CC=\"{value}\"") + def layout(self): + cmake_layout(self) - value = _getenvpath('CXX') - if value: - args.append(f"QMAKE_CXX=\"{value}\"") + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(self)) - value = _getenvpath('LD') - if value: - args.append(f"QMAKE_LINK_C=\"{value}\"") - args.append(f"QMAKE_LINK_C_SHLIB=\"{value}\"") - args.append(f"QMAKE_LINK=\"{value}\"") - args.append(f"QMAKE_LINK_SHLIB=\"{value}\"") - - self.run(f"qmake {' '.join(args)}", run_environment=True) - if tools.os_info.is_windows: - if is_msvc(self): - self.run("nmake", run_environment=True) - else: - self.run("mingw32-make", run_environment=True) - else: - self.run("make", run_environment=True) - - def _build_with_meson(self): - if self._meson_supported(): - self.output.info("Building with Meson") - mkdir(self, "meson_folder") - with tools.environment_append(RunEnvironment(self).vars): - meson = Meson(self) - try: - meson.configure(build_folder="meson_folder", defs={"cpp_std": "c++11"}) - except ConanException: - self.output.info(open("meson_folder/meson-logs/meson-log.txt", 'r').read()) - raise - meson.build() - - def _build_with_cmake_find_package_multi(self): - self.output.info("Building with cmake_find_package_multi") - env_build = RunEnvironment(self) - with tools.environment_append(env_build.vars): - cmake = CMake(self, set_cmake_flags=True) - if self.settings.os == "Macos": - cmake.definitions['CMAKE_OSX_DEPLOYMENT_TARGET'] = '10.15' if Version(self.deps_cpp_info["qt"].version) >= "6.5.0" else "10.14" - - cmake.configure() - cmake.build() + def build_requirements(self): + if not can_run(self): + self.tool_requires(self.tested_reference_str) + + def generate(self): + path = self.dependencies["qt"].package_folder.replace("\\", "/") + folder = os.path.join(path, "bin") + bin_folder = "bin" if self.settings.os == "Windows" else "libexec" + save(self, "qt.conf", f"""[Paths] +Prefix = {path} +ArchData = {folder}/archdatadir +HostData = {folder}/archdatadir +Data = {folder}/datadir +Sysconf = {folder}/sysconfdir +LibraryExecutables = {folder}/archdatadir/{bin_folder} +HostLibraryExecutables = bin +Plugins = {folder}/archdatadir/plugins +Imports = {folder}/archdatadir/imports +Qml2Imports = {folder}/archdatadir/qml +Translations = {folder}/datadir/translations +Documentation = {folder}/datadir/doc +Examples = {folder}/datadir/examples""") + + VirtualRunEnv(self).generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") def build(self): - self._build_with_qmake() - self._build_with_meson() - self._build_with_cmake_find_package_multi() - - def _test_with_qmake(self): - if not self._qmake_supported(): - return - self.output.info("Testing qmake") - bin_path = os.path.join("qmake_folder", "bin") - if self.settings.os == "Macos": - bin_path = os.path.join(bin_path, "test_package.app", "Contents", "MacOS") - shutil.copy("qt.conf", bin_path) - self.run(os.path.join(bin_path, "test_package"), run_environment=True) - - def _test_with_meson(self): - if self._meson_supported(): - self.output.info("Testing Meson") - shutil.copy("qt.conf", "meson_folder") - self.run(os.path.join("meson_folder", "test_package"), run_environment=True) - - def _test_with_cmake_find_package_multi(self): - self.output.info("Testing CMake_find_package_multi") - shutil.copy("qt.conf", "bin") - self.run(os.path.join("bin", "test_package"), run_environment=True) + cmake = CMake(self) + cmake.configure() + cmake.build() def test(self): - if not cross_building(self, skip_x64_x86=True): - self._test_with_qmake() - self._test_with_meson() - self._test_with_cmake_find_package_multi() + if can_run(self): + copy(self, "qt.conf", src=self.generators_folder, dst=os.path.join(self.cpp.build.bindirs[0])) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/qt/6.x.x/test_package/test_package.pro b/recipes/qt/6.x.x/test_package/test_package.pro deleted file mode 100644 index 92b10f85fb96e..0000000000000 --- a/recipes/qt/6.x.x/test_package/test_package.pro +++ /dev/null @@ -1,15 +0,0 @@ - include($$OUT_PWD/../conanbuildinfo.pri) - - LIBS += $$CONAN_LIBDIRS - - SOURCES += test_package.cpp - -HEADERS += greeter.h - -RESOURCES = example.qrc - -QT += network sql concurrent xml - -QT -= gui - -CONFIG += console diff --git a/recipes/qt/6.x.x/test_v1_package/CMakeLists.txt b/recipes/qt/6.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..60524d0bb25e1 --- /dev/null +++ b/recipes/qt/6.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.3.0) + +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_set_vs_runtime() +conan_set_libcxx() +conan_output_dirs_setup() + +find_package(Qt6 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp ../test_package/greeter.h ../test_package/example.qrc) + +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) + +target_link_libraries(${PROJECT_NAME} Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) + +# check if extra qt cmake functions are usable +qt_add_executable(${PROJECT_NAME}2 ../test_package/test_package.cpp ../test_package/greeter.h ../test_package/example.qrc) + +set_property(TARGET ${PROJECT_NAME}2 PROPERTY CXX_STANDARD 17) + +target_link_libraries(${PROJECT_NAME}2 PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) diff --git a/recipes/qt/6.x.x/test_v1_package/conanfile.py b/recipes/qt/6.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..85db60ab1408b --- /dev/null +++ b/recipes/qt/6.x.x/test_v1_package/conanfile.py @@ -0,0 +1,145 @@ +import os +import shutil + +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.files import mkdir, chdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +from conans import tools, Meson, RunEnvironment, CMake +from conan.errors import ConanException + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi", "cmake_find_package", "pkg_config", "qmake" + + def build_requirements(self): + self.tool_requires("cmake/3.25.3") + if self._meson_supported(): + self.tool_requires("meson/1.1.0") + + def generate(self): + save(self, "qt.conf", """[Paths] +Prefix = {} +ArchData = bin/archdatadir +HostData = bin/archdatadir +Data = bin/datadir +Sysconf = bin/sysconfdir +LibraryExecutables = bin/archdatadir/bin +Plugins = bin/archdatadir/plugins +Imports = bin/archdatadir/imports +Qml2Imports = bin/archdatadir/qml +Translations = bin/datadir/translations +Documentation = bin/datadir/doc +Examples = bin/datadir/examples""".format(self.dependencies["qt"].package_folder.replace('\\', '/'))) + + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def _meson_supported(self): + return False and self.options["qt"].shared and\ + not cross_building(self) and\ + not self.settings.os == "Macos" and\ + not self._is_mingw() + + def _qmake_supported(self): + return self.options["qt"].shared + + def _build_with_qmake(self): + if not self._qmake_supported(): + return + mkdir(self, "qmake_folder") + with chdir(self, "qmake_folder"): + self.output.info("Building with qmake") + + with tools.vcvars(self.settings) if is_msvc(self) else tools.no_op(): + args = [self.source_folder, "DESTDIR=bin"] + + def _getenvpath(var): + val = os.getenv(var) + if val and tools.os_info.is_windows: + val = val.replace("\\", "/") + os.environ[var] = val + return val + + value = _getenvpath('CC') + if value: + args.append(f"QMAKE_CC=\"{value}\"") + + value = _getenvpath('CXX') + if value: + args.append(f"QMAKE_CXX=\"{value}\"") + + value = _getenvpath('LD') + if value: + args.append(f"QMAKE_LINK_C=\"{value}\"") + args.append(f"QMAKE_LINK_C_SHLIB=\"{value}\"") + args.append(f"QMAKE_LINK=\"{value}\"") + args.append(f"QMAKE_LINK_SHLIB=\"{value}\"") + + self.run(f"qmake {' '.join(args)}", run_environment=True) + if tools.os_info.is_windows: + if is_msvc(self): + self.run("nmake", run_environment=True) + else: + self.run("mingw32-make", run_environment=True) + else: + self.run("make", run_environment=True) + + def _build_with_meson(self): + if self._meson_supported(): + self.output.info("Building with Meson") + mkdir(self, "meson_folder") + with tools.environment_append(RunEnvironment(self).vars): + meson = Meson(self) + try: + meson.configure(build_folder="meson_folder", defs={"cpp_std": "c++11"}) + except ConanException: + self.output.info(open("meson_folder/meson-logs/meson-log.txt", 'r').read()) + raise + meson.build() + + def _build_with_cmake_find_package_multi(self): + self.output.info("Building with cmake_find_package_multi") + env_build = RunEnvironment(self) + with tools.environment_append(env_build.vars): + cmake = CMake(self, set_cmake_flags=True) + if self.settings.os == "Macos": + cmake.definitions['CMAKE_OSX_DEPLOYMENT_TARGET'] = '10.15' if Version(self.deps_cpp_info["qt"].version) >= "6.5.0" else "10.14" + + cmake.configure() + cmake.build() + + def build(self): + self._build_with_qmake() + self._build_with_meson() + self._build_with_cmake_find_package_multi() + + def _test_with_qmake(self): + if not self._qmake_supported(): + return + self.output.info("Testing qmake") + bin_path = os.path.join("qmake_folder", "bin") + if self.settings.os == "Macos": + bin_path = os.path.join(bin_path, "test_package.app", "Contents", "MacOS") + shutil.copy("qt.conf", bin_path) + self.run(os.path.join(bin_path, "test_package"), run_environment=True) + + def _test_with_meson(self): + if self._meson_supported(): + self.output.info("Testing Meson") + shutil.copy("qt.conf", "meson_folder") + self.run(os.path.join("meson_folder", "test_package"), run_environment=True) + + def _test_with_cmake_find_package_multi(self): + self.output.info("Testing CMake_find_package_multi") + shutil.copy("qt.conf", "bin") + self.run(os.path.join("bin", "test_package"), run_environment=True) + + def test(self): + if not cross_building(self, skip_x64_x86=True): + self._test_with_qmake() + self._test_with_meson() + self._test_with_cmake_find_package_multi() diff --git a/recipes/qt/6.x.x/test_package/meson.build b/recipes/qt/6.x.x/test_v1_package/meson.build similarity index 100% rename from recipes/qt/6.x.x/test_package/meson.build rename to recipes/qt/6.x.x/test_v1_package/meson.build diff --git a/recipes/qt/6.x.x/test_v1_package/test_package.pro b/recipes/qt/6.x.x/test_v1_package/test_package.pro new file mode 100644 index 0000000000000..3b3ce9cba0343 --- /dev/null +++ b/recipes/qt/6.x.x/test_v1_package/test_package.pro @@ -0,0 +1,14 @@ +SOURCES += ../test_package/test_package.cpp + +HEADERS += ../test_package/greeter.h + +RESOURCES = ../test_package/example.qrc + +QT -= gui +QT += network sql concurrent xml + +CONFIG += console + +CONFIG += conan_basic_setup +include($$OUT_PWD/../conanbuildinfo.pri) +LIBS -= $$CONAN_LIBS_QT diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml index b1da461ce231b..0a1aaa3dcf0ce 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,21 +1,23 @@ versions: - "6.5.0": + "6.6.1": folder: 6.x.x - "6.4.2": + "6.6.0": folder: 6.x.x - "6.4.1": + "6.5.3": folder: 6.x.x - "6.3.2": + "6.4.2": folder: 6.x.x - "6.2.4": + "6.3.2": folder: 6.x.x + "5.15.12": + folder: 5.x.x + "5.15.11": + folder: 5.x.x + "5.15.10": + folder: 5.x.x "5.15.9": folder: 5.x.x "5.15.8": folder: 5.x.x "5.15.7": folder: 5.x.x - "5.15.6": - folder: 5.x.x - "5.15.5": - folder: 5.x.x diff --git a/recipes/qtawesome/all/conandata.yml b/recipes/qtawesome/all/conandata.yml new file mode 100644 index 0000000000000..f5b2397c54cc5 --- /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 0000000000000..915710817d984 --- /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 0000000000000..b3851eb38d11e --- /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 0000000000000..1dc32834b35c8 --- /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 0000000000000..4a085bcb1915d --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..cca63995ee056 --- /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 0000000000000..773fa8e42ed56 --- /dev/null +++ b/recipes/qtawesome/config.yml @@ -0,0 +1,3 @@ +versions: + "6.4.0": + folder: all diff --git a/recipes/quaternions/all/conanfile.py b/recipes/quaternions/all/conanfile.py index 53d02dd9ca8a2..3270c603bde8d 100644 --- a/recipes/quaternions/all/conanfile.py +++ b/recipes/quaternions/all/conanfile.py @@ -1,36 +1,54 @@ import os -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 QuaternionsConan(ConanFile): name = "quaternions" description = "A blazingly fast C++ library to work with quaternions." - topics = ("conan", "quaternions", "mathematics") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ferd36/quaternions" - license = "MIT" - settings = "compiler" + topics = ("mathematics", "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 configure(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 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.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - url = self.conan_data["sources"][self.version]["url"] - extracted_dir = self.name + "-" + os.path.splitext(os.path.basename(url))[0] - os.rename(extracted_dir, self._source_subfolder) - tools.replace_in_file(os.path.join(self._source_subfolder, "include", "quaternion.h"), - "#include ", "") + get(self, **self.conan_data["sources"][self.version], strip_root=True) + replace_in_file(self, + os.path.join(self.source_folder, "include", "quaternion.h"), + "#include ", + "") def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", 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")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/quaternions/all/test_package/CMakeLists.txt b/recipes/quaternions/all/test_package/CMakeLists.txt index 33ae887aa6aea..a5abaf06c8332 100644 --- a/recipes/quaternions/all/test_package/CMakeLists.txt +++ b/recipes/quaternions/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(quaternions REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE quaternions::quaternions) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/quaternions/all/test_package/conanfile.py b/recipes/quaternions/all/test_package/conanfile.py index ea57a464900be..fae501d0afb9e 100644 --- a/recipes/quaternions/all/test_package/conanfile.py +++ b/recipes/quaternions/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" + 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/quaternions/all/test_v1_package/CMakeLists.txt b/recipes/quaternions/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/quaternions/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/quaternions/all/test_v1_package/conanfile.py b/recipes/quaternions/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..84ee68733e516 --- /dev/null +++ b/recipes/quaternions/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/quazip/all/conanfile.py b/recipes/quazip/all/conanfile.py index 0203b4a63fa9c..6e40033d8025b 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 863c20f1e79d6..bec3ce0e03d95 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 c5c614561ff61..adfbbac153de5 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 3480935d8cd0e..fbea88ec0b6c1 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 57cf0bfd3debb..59fa2d07ab926 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 a68d648c5c5b5..bf3ebab04211e 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 0000000000000..91630d79f4abb --- /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 0000000000000..3148dc9605e6c --- /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/quickjs/all/CMakeLists.txt b/recipes/quickjs/all/CMakeLists.txt index bd4c048f85e13..bcb68cb57eccd 100644 --- a/recipes/quickjs/all/CMakeLists.txt +++ b/recipes/quickjs/all/CMakeLists.txt @@ -42,6 +42,10 @@ set_target_properties(quickjs PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON ) +if(USE_BIGNUM) + target_compile_definitions(quickjs PRIVATE CONFIG_BIGNUM) +endif() + find_library(LIBM m) target_link_libraries(quickjs PRIVATE $<$:${LIBM}>) diff --git a/recipes/quickjs/all/conandata.yml b/recipes/quickjs/all/conandata.yml index b6c326416c7bf..2aeb216a1e5d0 100644 --- a/recipes/quickjs/all/conandata.yml +++ b/recipes/quickjs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2023-12-09": + url: "https://bellard.org/quickjs/quickjs-2023-12-09.tar.xz" + sha256: "e8afe386f875d0e52310ea91aa48e2b0e04182e821f19147794e3e272f4c8d8c" "2021-03-27": url: "https://bellard.org/quickjs/quickjs-2021-03-27.tar.xz" sha256: "a45bface4c3379538dea8533878d694e289330488ea7028b105f72572fe7fe1a" diff --git a/recipes/quickjs/all/conanfile.py b/recipes/quickjs/all/conanfile.py index 8e68a544366f1..6d4979abaf7f7 100644 --- a/recipes/quickjs/all/conanfile.py +++ b/recipes/quickjs/all/conanfile.py @@ -6,7 +6,7 @@ import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class QuickJSConan(ConanFile): name = "quickjs" @@ -35,21 +35,14 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.version >= "2023-12-09": + del self.options.use_bignum 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 validate(self): # TODO: there are forked repository to support MSVC. (https://github.com/c-smile/quickjspp) @@ -60,12 +53,12 @@ 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.variables["QUICKJS_SRC_DIR"] = self.source_folder.replace("\\", "/") - tc.variables["USE_BIGNUM"] = self.options.use_bignum + tc.variables["USE_BIGNUM"] = self.options.get_safe("use_bignum", True) tc.variables["DUMP_LEAKS"] = self.options.dump_leaks tc.generate() @@ -82,7 +75,7 @@ def package(self): def package_info(self): self.cpp_info.libs = ["quickjs"] - if self.options.use_bignum == True: + if self.options.get_safe("use_bignum", True): self.cpp_info.defines.append("CONFIG_BIGNUM") if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/quickjs/all/test_package/CMakeLists.txt b/recipes/quickjs/all/test_package/CMakeLists.txt index e6ebd1f3afdc4..d1a90ff4e16f0 100644 --- a/recipes/quickjs/all/test_package/CMakeLists.txt +++ b/recipes/quickjs/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.0) -project(test_package C) +project(test_package LANGUAGES C) find_package(quickjs REQUIRED CONFIG) diff --git a/recipes/quickjs/all/test_v1_package/CMakeLists.txt b/recipes/quickjs/all/test_v1_package/CMakeLists.txt index 4c0436c623e76..2162b4d53343a 100644 --- a/recipes/quickjs/all/test_v1_package/CMakeLists.txt +++ b/recipes/quickjs/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.0) -project(test_package C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(quickjs REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE quickjs::quickjs) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/quickjs/config.yml b/recipes/quickjs/config.yml index 4110c6ceb7c0f..ee7d61b2fc03e 100644 --- a/recipes/quickjs/config.yml +++ b/recipes/quickjs/config.yml @@ -1,3 +1,5 @@ versions: + "2023-12-09": + folder: "all" "2021-03-27": folder: "all" diff --git a/recipes/quill/all/conandata.yml b/recipes/quill/all/conandata.yml index 6251899f54ebd..b6e754cda2c2e 100644 --- a/recipes/quill/all/conandata.yml +++ b/recipes/quill/all/conandata.yml @@ -1,4 +1,37 @@ sources: + "3.6.0": + url: "https://github.com/odygrd/quill/archive/v3.6.0.tar.gz" + sha256: "ba9dc3df262f2e65c57904580cc8407eba9a462001340c17bab7ae1dccddb4bd" + "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" + "3.1.0": + url: "https://github.com/odygrd/quill/archive/v3.1.0.tar.gz" + sha256: "9e7aa64c4f8101ed2b59d1cf3156b1c6bdd712ca89a2ec7aa7166905edc3e621" + "3.0.2": + url: "https://github.com/odygrd/quill/archive/v3.0.2.tar.gz" + sha256: "76e9f607168f71cf1028ae7374fbe91225e400c11b5a51a6ebc992c85d012eed" + "2.9.2": + url: "https://github.com/odygrd/quill/archive/v2.9.2.tar.gz" + sha256: "5b5b502f33277d1ebdb39d57898b1ca25affef4819d390927499f368dd562d91" + "2.9.1": + url: "https://github.com/odygrd/quill/archive/v2.9.1.tar.gz" + sha256: "921e053118136f63cebb2ca1d7e42456fd0bf9626facb755884709092753c054" "2.9.0": url: "https://github.com/odygrd/quill/archive/v2.9.0.tar.gz" sha256: "dec64c0fbb4bfbafe28fdeeeefac10206285bf2be4a42ec5dfb7987ca4ccb372" @@ -11,24 +44,6 @@ sources: "2.6.0": url: "https://github.com/odygrd/quill/archive/v2.6.0.tar.gz" sha256: "d72fd5a01bf8d3e59ed93a789a8f103bc31efe0fb3c09182c74036a2e3a8451b" - "2.5.1": - url: "https://github.com/odygrd/quill/archive/v2.5.1.tar.gz" - sha256: "62227595cc2b4c0c42ed35f17ef5b7487d8231aca9e75234a4c0e346cea19928" - "2.4.2": - url: "https://github.com/odygrd/quill/archive/v2.4.2.tar.gz" - sha256: "4771dc08c0ff01cea9081d645ed7cae27cfa073185c986177ef3ce13743136af" - "2.3.4": - url: "https://github.com/odygrd/quill/archive/v2.3.4.tar.gz" - sha256: "b44d345c07b3023fcd1b88fd9d2554429bb8cccb6285d703d0b0907d9aa85fa1" - "2.2.0": - url: "https://github.com/odygrd/quill/archive/v2.2.0.tar.gz" - sha256: "6b123b60b16d41009228d907851f025c8be974d5fcf41af0b6afbe48edebbf73" - "2.1.0": - url: "https://github.com/odygrd/quill/archive/v2.1.0.tar.gz" - sha256: "66c59501ad827207e7d4682ccba0f1c33ca215269aa13a388df4d59ca195ee76" - "2.0.2": - url: "https://github.com/odygrd/quill/archive/v2.0.2.tar.gz" - sha256: "d2dc9004886b787f8357e97d2f2d0c74a460259f7f95d65ab49d060fe34a9b5c" "1.7.3": url: "https://github.com/odygrd/quill/archive/v1.7.3.tar.gz" sha256: "3fff0c5ffb19bbde5429369079741f84a6acce3a781b504cec5e677b05461208" diff --git a/recipes/quill/all/conanfile.py b/recipes/quill/all/conanfile.py index b91c210a46df0..96693e04b9fe8 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.2.1", transitive_headers=True) def validate(self): supported_archs = ["x86", "x86_64", "armv6", "armv7", "armv7hf", "armv8"] @@ -113,13 +113,11 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["QUILL_FMT_EXTERNAL"] = True tc.variables["QUILL_ENABLE_INSTALL"] = True - if Version(self.version) < "2.8.0": tc.variables["QUILL_USE_BOUNDED_QUEUE"] = self.options.with_bounded_queue else: if self.options.with_bounded_queue: tc.preprocessor_definitions["QUILL_USE_BOUNDED_QUEUE"] = 1 - tc.variables["QUILL_NO_EXCEPTIONS"] = self.options.with_no_exceptions tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True if self.is_quilll_x86_arch(): @@ -130,7 +128,8 @@ def generate(self): tc.variables["CMAKE_CXX_FLAGS"] = "-mclflushopt" if Version(self.version) >= "2.8.0" and self.options.get_safe("with_bounded_blocking_queue"): tc.preprocessor_definitions["QUILL_USE_BOUNDED_BLOCKING_QUEUE"] = 1 - + if Version(self.version) >= "3.2.0": + tc.variables["QUILL_DISABLE_POSITION_INDEPENDENT_CODE"] = not self.options.get_safe("fPIC") tc.generate() deps = CMakeDeps(self) @@ -141,7 +140,7 @@ def _patch_sources(self): rmdir(self, os.path.join(self.source_folder, "quill", "quill", "include", "quill", "bundled", "fmt")) rmdir(self, os.path.join(self.source_folder, "quill", "quill", "src", "bundled", "fmt")) - if Version(self.version) >= "2.0.0": + if "2.0.0" <= Version(self.version) < "2.9.1": replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), """set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/quill/cmake" CACHE STRING "Modules for CMake" FORCE)""", """set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_LIST_DIR}/quill/cmake")""" diff --git a/recipes/quill/all/test_package/CMakeLists.txt b/recipes/quill/all/test_package/CMakeLists.txt index d53c2b924044a..b6b657d776df5 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 ab2f3ef6f2de8..b02a6dd344b06 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 5cd8b62893f38..3aa843c1a29c6 100644 --- a/recipes/quill/config.yml +++ b/recipes/quill/config.yml @@ -1,23 +1,33 @@ versions: - "2.9.0": + "3.6.0": folder: "all" - "2.8.0": + "3.5.1": folder: "all" - "2.7.0": + "3.5.0": folder: "all" - "2.6.0": + "3.4.1": folder: "all" - "2.5.1": + "3.4.0": folder: "all" - "2.4.2": + "3.3.1": folder: "all" - "2.3.4": + "3.2.0": folder: "all" - "2.2.0": + "3.1.0": folder: "all" - "2.1.0": + "3.0.2": folder: "all" - "2.0.2": + "2.9.2": + folder: "all" + "2.9.1": + folder: "all" + "2.9.0": + folder: "all" + "2.8.0": + folder: "all" + "2.7.0": + folder: "all" + "2.6.0": folder: "all" "1.7.3": folder: "all" diff --git a/recipes/qwt/all/conanfile.py b/recipes/qwt/all/conanfile.py index 3c7b6925650a8..8cc76b47a4e49 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 27ad749e21214..1e70527306c74 100644 --- a/recipes/r8brain-free-src/all/conandata.yml +++ b/recipes/r8brain-free-src/all/conandata.yml @@ -1,4 +1,13 @@ 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" "6.2": url: "https://github.com/avaneev/r8brain-free-src/archive/refs/tags/version-6.2.tar.gz" sha256: "5e576ec8cb6ae3969c4bcacb630ddc957fc20f60a6b08593681d16e06942597d" diff --git a/recipes/r8brain-free-src/all/conanfile.py b/recipes/r8brain-free-src/all/conanfile.py index c6a956008c5c7..50f5693f0f6cb 100644 --- a/recipes/r8brain-free-src/all/conanfile.py +++ b/recipes/r8brain-free-src/all/conanfile.py @@ -15,6 +15,7 @@ class R8brainFreeSrcConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/avaneev/r8brain-free-src" topics = ("audio", "sample-rate", "conversion", "audio-processing", "resampler") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -78,7 +79,7 @@ def package_info(self): self.cpp_info.libs = ["r8brain"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["pthread", "m",]) if self.options.fft == "pffft": self.cpp_info.defines.append("R8B_PFFFT") diff --git a/recipes/r8brain-free-src/config.yml b/recipes/r8brain-free-src/config.yml index 541a5f21084de..79caa70a836d2 100644 --- a/recipes/r8brain-free-src/config.yml +++ b/recipes/r8brain-free-src/config.yml @@ -1,4 +1,10 @@ versions: + "6.5": + folder: all + "6.4": + folder: all + "6.3": + folder: all "6.2": folder: all "4.6": diff --git a/recipes/ragel/all/CMakeLists.txt b/recipes/ragel/all/CMakeLists.txt index b4afee381476c..1d3d3c24617fe 100644 --- a/recipes/ragel/all/CMakeLists.txt +++ b/recipes/ragel/all/CMakeLists.txt @@ -1,133 +1,131 @@ cmake_minimum_required(VERSION 3.0) -project(ragel) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(ragel LANGUAGES CXX) file(GLOB HEADERS - source_subfolder/ragel/buffer.h - source_subfolder/ragel/cdgoto.h - source_subfolder/ragel/cscodegen.h - source_subfolder/ragel/csipgoto.h - source_subfolder/ragel/inputdata.h - source_subfolder/ragel/rbxgoto.h - source_subfolder/ragel/rubyflat.h - source_subfolder/ragel/cdcodegen.h - source_subfolder/ragel/cdipgoto.h - source_subfolder/ragel/csfflat.h - source_subfolder/ragel/cssplit.h - source_subfolder/ragel/javacodegen.h - source_subfolder/ragel/redfsm.h - source_subfolder/ragel/rubyftable.h - source_subfolder/ragel/cdfflat.h - source_subfolder/ragel/cdsplit.h - source_subfolder/ragel/csfgoto.h - source_subfolder/ragel/cstable.h - source_subfolder/ragel/parsedata.h - source_subfolder/ragel/rlparse.h - source_subfolder/ragel/rubytable.h - source_subfolder/ragel/cdfgoto.h - source_subfolder/ragel/cdtable.h - source_subfolder/ragel/csflat.h - source_subfolder/ragel/dotcodegen.h - source_subfolder/ragel/parsetree.h - source_subfolder/ragel/rlscan.h - source_subfolder/ragel/version.h - source_subfolder/ragel/cdflat.h - source_subfolder/ragel/common.h - source_subfolder/ragel/csftable.h - source_subfolder/ragel/fsmgraph.h - source_subfolder/ragel/pcheck.h - source_subfolder/ragel/rubycodegen.h - source_subfolder/ragel/xmlcodegen.h - source_subfolder/ragel/cdftable.h - source_subfolder/ragel/csgoto.h - source_subfolder/ragel/gendata.h - source_subfolder/ragel/ragel.h - source_subfolder/ragel/rubyfflat.h - source_subfolder/ragel/gocodegen.h - source_subfolder/ragel/gotable.h - source_subfolder/ragel/goftable.h - source_subfolder/ragel/goflat.h - source_subfolder/ragel/gofflat.h - source_subfolder/ragel/gogoto.h - source_subfolder/ragel/gofgoto.h - source_subfolder/ragel/goipgoto.h - source_subfolder/ragel/gotablish.h - source_subfolder/ragel/mlcodegen.h - source_subfolder/ragel/mltable.h - source_subfolder/ragel/mlftable.h - source_subfolder/ragel/mlflat.h - source_subfolder/ragel/mlfflat.h - source_subfolder/ragel/mlgoto.h - source_subfolder/ragel/mlfgoto.h + ${RAGEL_SOURCE_DIR}/ragel/buffer.h + ${RAGEL_SOURCE_DIR}/ragel/cdgoto.h + ${RAGEL_SOURCE_DIR}/ragel/cscodegen.h + ${RAGEL_SOURCE_DIR}/ragel/csipgoto.h + ${RAGEL_SOURCE_DIR}/ragel/inputdata.h + ${RAGEL_SOURCE_DIR}/ragel/rbxgoto.h + ${RAGEL_SOURCE_DIR}/ragel/rubyflat.h + ${RAGEL_SOURCE_DIR}/ragel/cdcodegen.h + ${RAGEL_SOURCE_DIR}/ragel/cdipgoto.h + ${RAGEL_SOURCE_DIR}/ragel/csfflat.h + ${RAGEL_SOURCE_DIR}/ragel/cssplit.h + ${RAGEL_SOURCE_DIR}/ragel/javacodegen.h + ${RAGEL_SOURCE_DIR}/ragel/redfsm.h + ${RAGEL_SOURCE_DIR}/ragel/rubyftable.h + ${RAGEL_SOURCE_DIR}/ragel/cdfflat.h + ${RAGEL_SOURCE_DIR}/ragel/cdsplit.h + ${RAGEL_SOURCE_DIR}/ragel/csfgoto.h + ${RAGEL_SOURCE_DIR}/ragel/cstable.h + ${RAGEL_SOURCE_DIR}/ragel/parsedata.h + ${RAGEL_SOURCE_DIR}/ragel/rlparse.h + ${RAGEL_SOURCE_DIR}/ragel/rubytable.h + ${RAGEL_SOURCE_DIR}/ragel/cdfgoto.h + ${RAGEL_SOURCE_DIR}/ragel/cdtable.h + ${RAGEL_SOURCE_DIR}/ragel/csflat.h + ${RAGEL_SOURCE_DIR}/ragel/dotcodegen.h + ${RAGEL_SOURCE_DIR}/ragel/parsetree.h + ${RAGEL_SOURCE_DIR}/ragel/rlscan.h + ${RAGEL_SOURCE_DIR}/ragel/version.h + ${RAGEL_SOURCE_DIR}/ragel/cdflat.h + ${RAGEL_SOURCE_DIR}/ragel/common.h + ${RAGEL_SOURCE_DIR}/ragel/csftable.h + ${RAGEL_SOURCE_DIR}/ragel/fsmgraph.h + ${RAGEL_SOURCE_DIR}/ragel/pcheck.h + ${RAGEL_SOURCE_DIR}/ragel/rubycodegen.h + ${RAGEL_SOURCE_DIR}/ragel/xmlcodegen.h + ${RAGEL_SOURCE_DIR}/ragel/cdftable.h + ${RAGEL_SOURCE_DIR}/ragel/csgoto.h + ${RAGEL_SOURCE_DIR}/ragel/gendata.h + ${RAGEL_SOURCE_DIR}/ragel/ragel.h + ${RAGEL_SOURCE_DIR}/ragel/rubyfflat.h + ${RAGEL_SOURCE_DIR}/ragel/gocodegen.h + ${RAGEL_SOURCE_DIR}/ragel/gotable.h + ${RAGEL_SOURCE_DIR}/ragel/goftable.h + ${RAGEL_SOURCE_DIR}/ragel/goflat.h + ${RAGEL_SOURCE_DIR}/ragel/gofflat.h + ${RAGEL_SOURCE_DIR}/ragel/gogoto.h + ${RAGEL_SOURCE_DIR}/ragel/gofgoto.h + ${RAGEL_SOURCE_DIR}/ragel/goipgoto.h + ${RAGEL_SOURCE_DIR}/ragel/gotablish.h + ${RAGEL_SOURCE_DIR}/ragel/mlcodegen.h + ${RAGEL_SOURCE_DIR}/ragel/mltable.h + ${RAGEL_SOURCE_DIR}/ragel/mlftable.h + ${RAGEL_SOURCE_DIR}/ragel/mlflat.h + ${RAGEL_SOURCE_DIR}/ragel/mlfflat.h + ${RAGEL_SOURCE_DIR}/ragel/mlgoto.h + ${RAGEL_SOURCE_DIR}/ragel/mlfgoto.h ) file(GLOB SRC - source_subfolder/ragel/main.cpp - source_subfolder/ragel/parsetree.cpp - source_subfolder/ragel/parsedata.cpp - source_subfolder/ragel/fsmstate.cpp - source_subfolder/ragel/fsmbase.cpp - source_subfolder/ragel/fsmattach.cpp - source_subfolder/ragel/fsmmin.cpp - source_subfolder/ragel/fsmgraph.cpp - source_subfolder/ragel/fsmap.cpp - source_subfolder/ragel/rlscan.cpp - source_subfolder/ragel/rlparse.cpp - source_subfolder/ragel/inputdata.cpp - source_subfolder/ragel/common.cpp - source_subfolder/ragel/redfsm.cpp - source_subfolder/ragel/gendata.cpp - source_subfolder/ragel/cdcodegen.cpp - source_subfolder/ragel/cdtable.cpp - source_subfolder/ragel/cdftable.cpp - source_subfolder/ragel/cdflat.cpp - source_subfolder/ragel/cdfflat.cpp - source_subfolder/ragel/cdgoto.cpp - source_subfolder/ragel/cdfgoto.cpp - source_subfolder/ragel/cdipgoto.cpp - source_subfolder/ragel/cdsplit.cpp - source_subfolder/ragel/javacodegen.cpp - source_subfolder/ragel/rubycodegen.cpp - source_subfolder/ragel/rubytable.cpp - source_subfolder/ragel/rubyftable.cpp - source_subfolder/ragel/rubyflat.cpp - source_subfolder/ragel/rubyfflat.cpp - source_subfolder/ragel/rbxgoto.cpp - source_subfolder/ragel/cscodegen.cpp - source_subfolder/ragel/cstable.cpp - source_subfolder/ragel/csftable.cpp - source_subfolder/ragel/csflat.cpp - source_subfolder/ragel/csfflat.cpp - source_subfolder/ragel/csgoto.cpp - source_subfolder/ragel/csfgoto.cpp - source_subfolder/ragel/csipgoto.cpp - source_subfolder/ragel/cssplit.cpp - source_subfolder/ragel/dotcodegen.cpp - source_subfolder/ragel/xmlcodegen.cpp - source_subfolder/ragel/gocodegen.cpp - source_subfolder/ragel/gotable.cpp - source_subfolder/ragel/goftable.cpp - source_subfolder/ragel/goflat.cpp - source_subfolder/ragel/gofflat.cpp - source_subfolder/ragel/gogoto.cpp - source_subfolder/ragel/gofgoto.cpp - source_subfolder/ragel/goipgoto.cpp - source_subfolder/ragel/gotablish.cpp - source_subfolder/ragel/mlcodegen.cpp - source_subfolder/ragel/mltable.cpp - source_subfolder/ragel/mlftable.cpp - source_subfolder/ragel/mlflat.cpp - source_subfolder/ragel/mlfflat.cpp - source_subfolder/ragel/mlgoto.cpp - source_subfolder/ragel/mlfgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/main.cpp + ${RAGEL_SOURCE_DIR}/ragel/parsetree.cpp + ${RAGEL_SOURCE_DIR}/ragel/parsedata.cpp + ${RAGEL_SOURCE_DIR}/ragel/fsmstate.cpp + ${RAGEL_SOURCE_DIR}/ragel/fsmbase.cpp + ${RAGEL_SOURCE_DIR}/ragel/fsmattach.cpp + ${RAGEL_SOURCE_DIR}/ragel/fsmmin.cpp + ${RAGEL_SOURCE_DIR}/ragel/fsmgraph.cpp + ${RAGEL_SOURCE_DIR}/ragel/fsmap.cpp + ${RAGEL_SOURCE_DIR}/ragel/rlscan.cpp + ${RAGEL_SOURCE_DIR}/ragel/rlparse.cpp + ${RAGEL_SOURCE_DIR}/ragel/inputdata.cpp + ${RAGEL_SOURCE_DIR}/ragel/common.cpp + ${RAGEL_SOURCE_DIR}/ragel/redfsm.cpp + ${RAGEL_SOURCE_DIR}/ragel/gendata.cpp + ${RAGEL_SOURCE_DIR}/ragel/cdcodegen.cpp + ${RAGEL_SOURCE_DIR}/ragel/cdtable.cpp + ${RAGEL_SOURCE_DIR}/ragel/cdftable.cpp + ${RAGEL_SOURCE_DIR}/ragel/cdflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/cdfflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/cdgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/cdfgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/cdipgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/cdsplit.cpp + ${RAGEL_SOURCE_DIR}/ragel/javacodegen.cpp + ${RAGEL_SOURCE_DIR}/ragel/rubycodegen.cpp + ${RAGEL_SOURCE_DIR}/ragel/rubytable.cpp + ${RAGEL_SOURCE_DIR}/ragel/rubyftable.cpp + ${RAGEL_SOURCE_DIR}/ragel/rubyflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/rubyfflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/rbxgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/cscodegen.cpp + ${RAGEL_SOURCE_DIR}/ragel/cstable.cpp + ${RAGEL_SOURCE_DIR}/ragel/csftable.cpp + ${RAGEL_SOURCE_DIR}/ragel/csflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/csfflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/csgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/csfgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/csipgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/cssplit.cpp + ${RAGEL_SOURCE_DIR}/ragel/dotcodegen.cpp + ${RAGEL_SOURCE_DIR}/ragel/xmlcodegen.cpp + ${RAGEL_SOURCE_DIR}/ragel/gocodegen.cpp + ${RAGEL_SOURCE_DIR}/ragel/gotable.cpp + ${RAGEL_SOURCE_DIR}/ragel/goftable.cpp + ${RAGEL_SOURCE_DIR}/ragel/goflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/gofflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/gogoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/gofgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/goipgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/gotablish.cpp + ${RAGEL_SOURCE_DIR}/ragel/mlcodegen.cpp + ${RAGEL_SOURCE_DIR}/ragel/mltable.cpp + ${RAGEL_SOURCE_DIR}/ragel/mlftable.cpp + ${RAGEL_SOURCE_DIR}/ragel/mlflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/mlfflat.cpp + ${RAGEL_SOURCE_DIR}/ragel/mlgoto.cpp + ${RAGEL_SOURCE_DIR}/ragel/mlfgoto.cpp ) add_executable(${CMAKE_PROJECT_NAME} ${SRC} ${HEADERS}) target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC ${CONAN_LIBS}) -target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE source_subfolder/aapl - PRIVATE ${CMAKE_BINARY_DIR}) +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${RAGEL_SOURCE_DIR}/aapl + PRIVATE ${CMAKE_SOURCE_DIR} + PRIVATE ${CMAKE_BINARY_DIR}) install(TARGETS ${CMAKE_PROJECT_NAME} RUNTIME DESTINATION bin) diff --git a/recipes/ragel/all/conandata.yml b/recipes/ragel/all/conandata.yml index a561cfe4c7dce..cef6c070a411d 100644 --- a/recipes/ragel/all/conandata.yml +++ b/recipes/ragel/all/conandata.yml @@ -2,8 +2,8 @@ sources: "6.10": url: "http://www.colm.net/files/ragel/ragel-6.10.tar.gz" sha256: "5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f" - patches: "6.10": - patch_file: "patches/0001-unistd.patch" - base_path: "source_subfolder" + patch_description: "don't include unistd.h on MSVC" + patch_type: "portability" diff --git a/recipes/ragel/all/conanfile.py b/recipes/ragel/all/conanfile.py index ab235df3cddb0..f91723125a17b 100644 --- a/recipes/ragel/all/conanfile.py +++ b/recipes/ragel/all/conanfile.py @@ -1,68 +1,89 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment, CMake +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.layout import basic_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv import os -import glob +required_conan_version = ">=1.53.0" class RagelConan(ConanFile): name = "ragel" description = "Ragel compiles executable finite state machines from regular languages" - homepage = "http://www.colm.net/open-source/ragel" - url = "https://github.com/conan-io/conan-center-index" license = "GPL-2.0-or-later" - topics = ("ragel", "FSM", "regex", "fsm-compiler") - exports_sources = ["CMakeLists.txt", "config.h", "patches/*"] - generators = "cmake" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.colm.net/open-source/ragel" + topics = ("FSM", "regex", "fsm-compiler") + package_type = "application" settings = "os", "arch", "compiler", "build_type" - _cmake = None - _autotools = 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, "config.h", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + tc.variables["RAGEL_SOURCE_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() - def _configure_autotools(self): - if not self._autotools: - self._autotools = AutoToolsBuildEnvironment(self) - self._autotools.configure(configure_dir=self._source_subfolder) - return self._autotools + dpes = CMakeDeps(self) + dpes.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 _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + deps = AutotoolsDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) if self.settings.os == "Windows": - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - self.copy(pattern="CREDITS", dst="licenses", src=self._source_subfolder) + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="CREDITS", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if self.settings.os == "Windows": - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() else: - autotools = self._configure_autotools() + autotools = Autotools(self) autotools.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - - def package_id(self): - del self.info.settings.compiler + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.env_info.RAGEL_ROOT = self.package_folder bindir = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH environment variable: {}".format(bindir)) diff --git a/recipes/ragel/all/test_package/conanfile.py b/recipes/ragel/all/test_package/conanfile.py index 0299aedde34df..9eec930f11301 100644 --- a/recipes/ragel/all/test_package/conanfile.py +++ b/recipes/ragel/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import 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", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) - settings = "os", "arch", "build_type", "compiler" + def requirements(self): + self.requires(self.tested_reference_str) def test(self): - if not tools.cross_building(self): - self.run("ragel --version", run_environment=True) + if can_run(self): + self.run("ragel --version", env="conanrun") diff --git a/recipes/ragel/all/test_v1_package/conanfile.py b/recipes/ragel/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0299aedde34df --- /dev/null +++ b/recipes/ragel/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + + settings = "os", "arch", "build_type", "compiler" + + def test(self): + if not tools.cross_building(self): + self.run("ragel --version", run_environment=True) diff --git a/recipes/range-v3/all/conanfile.py b/recipes/range-v3/all/conanfile.py index 4f9a2a5174d9a..a5064cb229661 100644 --- a/recipes/range-v3/all/conanfile.py +++ b/recipes/range-v3/all/conanfile.py @@ -16,7 +16,8 @@ class Rangev3Conan(ConanFile): license = "BSL-1.0" homepage = "https://github.com/ericniebler/range-v3" url = "https://github.com/conan-io/conan-center-index" - description = "Experimental range library for C++11/14/17" + package_type = "header-library" + description = "Range library for C++14/17/20, basis for C++20's std::ranges" topics = ("range", "range-library", "proposal", "iterator", "header-only") settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -36,9 +37,9 @@ def _min_cppstd(self): return "17" else: return "14" - + def layout(self): - basic_layout(self) + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() @@ -67,6 +68,8 @@ def package(self): self.package_folder, "licenses"), src=self.source_folder) def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] self.cpp_info.components["range-v3-meta"].names["cmake_find_package"] = "meta" self.cpp_info.components["range-v3-meta"].names["cmake_find_package_multi"] = "meta" if is_msvc(self): diff --git a/recipes/rangeless/all/conanfile.py b/recipes/rangeless/all/conanfile.py index d37a7eb54aeb3..4eb06ece4e627 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 5e1e9d9b89fe0..6f31fb97ff44c 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 6c9d5dba712c7..ef5d7042163ec 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 4f49c17e155f2..96e45179153e6 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 0000000000000..91630d79f4abb --- /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 0000000000000..6c9d5dba712c7 --- /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 72383f2492ee7..f52ac4400f69a 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 b438391b226f9..6c7782838deee 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 2bd2a465ffb06..9b8b15ab7a013 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 6c9d5dba712c7..ef5d7042163ec 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 e25f23d096604..f1a7ea7bef564 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 0000000000000..91630d79f4abb --- /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 0000000000000..6c9d5dba712c7 --- /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/rapidcheck/all/conandata.yml b/recipes/rapidcheck/all/conandata.yml index 51a9ed8cc8578..b501c3fddaaca 100644 --- a/recipes/rapidcheck/all/conandata.yml +++ b/recipes/rapidcheck/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230815": + url: "https://github.com/emil-e/rapidcheck/archive/1c91f40e64d87869250cfb610376c629307bf77d.zip" + sha256: "21dc5ed99390bc62e10f45698aff2704cf994c27cb388b0296db741bf128d803" "cci.20220514": url: "https://github.com/emil-e/rapidcheck/archive/8fafda42e732164db58003e542196e94a28481f9.zip" sha256: "63853f74026678b5cfed5f18f5d8cbd4eccb2f48bb89a8f8cb1cd1cc69f22db8" diff --git a/recipes/rapidcheck/config.yml b/recipes/rapidcheck/config.yml index c35d572c8cdf5..02c0d5b9f9431 100644 --- a/recipes/rapidcheck/config.yml +++ b/recipes/rapidcheck/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20230815": + folder: all "cci.20220514": folder: all "cci.20210702": diff --git a/recipes/rapidcsv/all/conandata.yml b/recipes/rapidcsv/all/conandata.yml index 502ec08fa730f..22f73545deb36 100644 --- a/recipes/rapidcsv/all/conandata.yml +++ b/recipes/rapidcsv/all/conandata.yml @@ -1,4 +1,10 @@ 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" "8.75": url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.75.tar.gz" sha256: "004454890d371b4db370dfd44d64077f8f9b2b92e59d1d6471e1923f891485be" diff --git a/recipes/rapidcsv/all/conanfile.py b/recipes/rapidcsv/all/conanfile.py index a9d964b6536a3..758f7e3653563 100644 --- a/recipes/rapidcsv/all/conanfile.py +++ b/recipes/rapidcsv/all/conanfile.py @@ -13,6 +13,7 @@ class RapidcsvConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/d99kris/rapidcsv" topics = ("csv", "parser", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/rapidcsv/config.yml b/recipes/rapidcsv/config.yml index df34fa7350e3c..643c892898926 100644 --- a/recipes/rapidcsv/config.yml +++ b/recipes/rapidcsv/config.yml @@ -1,4 +1,8 @@ versions: + "8.80": + folder: "all" + "8.77": + folder: "all" "8.75": folder: "all" "8.69": diff --git a/recipes/rapidfuzz/all/conandata.yml b/recipes/rapidfuzz/all/conandata.yml index 040b401c838af..c548146b1f784 100644 --- a/recipes/rapidfuzz/all/conandata.yml +++ b/recipes/rapidfuzz/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "3.0.0": + url: "https://github.com/maxbachmann/rapidfuzz-cpp/archive/refs/tags/v3.0.0.tar.gz" + sha256: "26a76c5a881c07638567557c1d73f6601f0d444816de03f297d731b1e019f21b" + "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" "1.10.4": url: "https://github.com/maxbachmann/rapidfuzz-cpp/archive/refs/tags/v1.10.4.tar.gz" sha256: "84a1ea8759aaa5bc8587c26504421d6fd34ad2a8dc74bf469b0cc3cc6758e17a" diff --git a/recipes/rapidfuzz/all/conanfile.py b/recipes/rapidfuzz/all/conanfile.py index c1795c07d7730..7ffe16027b312 100644 --- a/recipes/rapidfuzz/all/conanfile.py +++ b/recipes/rapidfuzz/all/conanfile.py @@ -17,6 +17,7 @@ class PackageConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/maxbachmann/rapidfuzz-cpp" topics = ("levenshtein", "string-matching", "string-similarity", "string-comparison", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -54,7 +55,6 @@ def validate(self): 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, "rapidfuzz/*.hpp", self.source_folder, os.path.join(self.package_folder, "include")) diff --git a/recipes/rapidfuzz/all/test_package/CMakeLists.txt b/recipes/rapidfuzz/all/test_package/CMakeLists.txt index 2f63d271b136c..91a5e1677ee9b 100644 --- a/recipes/rapidfuzz/all/test_package/CMakeLists.txt +++ b/recipes/rapidfuzz/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) find_package(rapidfuzz REQUIRED CONFIG) diff --git a/recipes/rapidfuzz/config.yml b/recipes/rapidfuzz/config.yml index 5f45a18000f9c..ccf581bfbc4ab 100644 --- a/recipes/rapidfuzz/config.yml +++ b/recipes/rapidfuzz/config.yml @@ -1,4 +1,14 @@ versions: + "3.0.0": + folder: "all" + "2.2.3": + folder: "all" + "2.2.0": + folder: "all" + "2.1.1": + folder: "all" + "2.0.0": + folder: "all" "1.10.4": folder: "all" "cci.20210513": diff --git a/recipes/rapidjson/all/conandata.yml b/recipes/rapidjson/all/conandata.yml index dd7649f2b814f..4f7c0b1008ac2 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/all/conanfile.py b/recipes/rapidjson/all/conanfile.py index 01002651291b6..49a4bd4e70fd7 100644 --- a/recipes/rapidjson/all/conanfile.py +++ b/recipes/rapidjson/all/conanfile.py @@ -13,11 +13,13 @@ class RapidjsonConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "http://rapidjson.org" license = "MIT" + package_type = "header-library" + package_id_embed_mode = "minor" settings = "os", "arch", "compiler", "build_type" no_copy_source = True 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, @@ -33,6 +35,8 @@ def package_id(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "RapidJSON") self.cpp_info.set_property("cmake_target_name", "rapidjson") + 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"] = "RapidJSON" diff --git a/recipes/rapidjson/config.yml b/recipes/rapidjson/config.yml index 82e5350012d0b..e55a15ea06b31 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/CMakeLists.txt b/recipes/raylib/all/CMakeLists.txt deleted file mode 100644 index 0496b29838549..0000000000000 --- a/recipes/raylib/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/raylib/all/conandata.yml b/recipes/raylib/all/conandata.yml index 17c0c7abb4dfd..250dbbb87a9bc 100644 --- a/recipes/raylib/all/conandata.yml +++ b/recipes/raylib/all/conandata.yml @@ -1,15 +1,24 @@ sources: - "3.5.0": - url: "https://github.com/raysan5/raylib/archive/3.5.0.tar.gz" - sha256: "761985876092fa98a99cbf1fef7ca80c3ee0365fb6a107ab901a272178ba69f5" + "5.0": + url: "https://github.com/raysan5/raylib/archive/refs/tags/5.0.tar.gz" + sha256: "98f049b9ea2a9c40a14e4e543eeea1a7ec3090ebdcd329c4ca2cf98bc9793482" "4.0.0": - url: "https://github.com/raysan5/raylib/archive/4.0.0.tar.gz" + url: "https://github.com/raysan5/raylib/archive/refs/tags/4.0.0.tar.gz" sha256: "11f6087dc7bedf9efb3f69c0c872f637e421d914e5ecea99bbe7781f173dc38c" - -patches: "3.5.0": - - patch_file: "patches/0001-3.5.0-enable-cmake-build.patch" - base_path: "source_subfolder" + url: "https://github.com/raysan5/raylib/archive/refs/tags/3.5.0.tar.gz" + sha256: "761985876092fa98a99cbf1fef7ca80c3ee0365fb6a107ab901a272178ba69f5" +patches: "4.0.0": - - patch_file: "patches/0001-4.0.0-enable-cmake-build.patch" - base_path: "source_subfolder" + - 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/conanfile.py b/recipes/raylib/all/conanfile.py index 6003a95f7be72..b00589d9af8ba 100644 --- a/recipes/raylib/all/conanfile.py +++ b/recipes/raylib/all/conanfile.py @@ -1,8 +1,12 @@ -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, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.54.0" class RaylibConan(ConanFile): @@ -11,95 +15,77 @@ class RaylibConan(ConanFile): license = "Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.raylib.com/" - topics = ("raylib", "gamedev") - + topics = ("gamedev",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "use_external_glfw": [True, False], - "opengl_version":[None, "3.3","2.1","1.1","ES-2.0"] + "opengl_version": [None, "4.3", "3.3", "2.1", "1.1", "ES-2.0"], } default_options = { "shared": False, "fPIC": True, - "use_external_glfw": True, - "opengl_version" : None + "opengl_version": None, } - exports_sources = ["CMakeLists.txt","patches/**"] - generators = "cmake", "cmake_find_package_multi" - _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): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.os == "Android": + del self.options.opengl_version 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 layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - - if self.options.use_external_glfw and self.settings.os != "Android": - self.requires("glfw/3.3.6") - if self.settings.os != "Android": + self.requires("glfw/3.3.8") self.requires("opengl/system") - if self.settings.os == "Linux": self.requires("xorg/system") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - + def source(self): + 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_EXAMPLES"] = False - + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_EXAMPLES"] = False if self.settings.os == "Android": - self._cmake.definitions["PLATFORM"] = "Android" - self._cmake.definitions["USE_EXTERNAL_GLFW"] = "OFF" - self._cmake.definitions["OPENGL_VERSION"] = "ES 2.0" + tc.variables["PLATFORM"] = "Android" + tc.variables["USE_EXTERNAL_GLFW"] = "OFF" + tc.variables["OPENGL_VERSION"] = "ES 2.0" else: - self._cmake.definitions["USE_EXTERNAL_GLFW"] = "OFF" if self.options.use_external_glfw else "ON" - self._cmake.definitions["OPENGL_VERSION"] = "OFF" if not self.options.opengl_version else self.options.opengl_version - - self._cmake.definitions["WITH_PIC"] = self.options.get_safe("fPIC", True) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["USE_EXTERNAL_GLFW"] = "ON" + tc.variables["OPENGL_VERSION"] = "OFF" if not self.options.opengl_version else self.options.opengl_version + tc.variables["WITH_PIC"] = self.options.get_safe("fPIC", True) + # Due to a specific logic of cmakedeps_macros.cmake used by CMakeDeps to try to locate shared libs on Windows + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0054"] = "NEW" + 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, "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")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -107,44 +93,36 @@ def package(self): {"raylib": "raylib::raylib"} ) - @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) - - @property - def _module_subfolder(self): - return os.path.join("lib", "cmake") + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join(self._module_subfolder, - "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", "raylib") self.cpp_info.set_property("cmake_target_name", "raylib") self.cpp_info.set_property("pkg_config_name", "raylib") libname = "raylib" - if self._is_msvc and not self.options.shared and self.version == '3.5.0': + if is_msvc(self) and not self.options.shared and Version(self.version) < "4.0.0": libname += "_static" self.cpp_info.libs = [libname] - if self._is_msvc and self.options.shared: + if is_msvc(self) and self.options.shared: self.cpp_info.defines.append("USE_LIBTYPE_SHARED") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["m", "pthread"]) elif self.settings.os == "Windows": self.cpp_info.system_libs.append("winmm") - self.cpp_info.builddirs.append(self._module_subfolder) - # 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/raylib/all/patches/0001-3.5.0-enable-cmake-build.patch b/recipes/raylib/all/patches/0001-3.5.0-enable-cmake-build.patch deleted file mode 100644 index db2fcdc698196..0000000000000 --- a/recipes/raylib/all/patches/0001-3.5.0-enable-cmake-build.patch +++ /dev/null @@ -1,123 +0,0 @@ -diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt -index 57ba74d4..4f019db1 100644 ---- a/examples/CMakeLists.txt -+++ b/examples/CMakeLists.txt -@@ -28,7 +28,6 @@ if (APPLE AND NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0") - add_definitions(-DGL_SILENCE_DEPRECATION) - MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!") - endif() --list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) - - include(CheckIncludeFile) - CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC_H) -@@ -51,6 +50,7 @@ endif() - if(${PLATFORM} MATCHES "Android") - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c) -+ list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/opengl_interop.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_picking.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_vr_simulator.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_free.c) -@@ -119,19 +119,5 @@ foreach(example_source ${example_sources}) - endif() - endforeach() - --if (${PLATFORM} MATCHES "Desktop") -- # rlgl_standalone can't be linked with raylib because of duplicate rlgl symbols -- foreach (example_source "others/rlgl_standalone.c") -- # Create the basename for the example -- get_filename_component(example_name ${example_source} NAME) -- string(REPLACE ".c" "" example_name ${example_name}) -- add_executable(${example_name} ${example_source}) -- add_dependencies(${example_name} raylib) -- target_link_libraries(${example_name} ${raylib_LDFLAGS}) -- target_include_directories(${example_name} PRIVATE ${raylib_INCLUDE_DIRS}) -- -- endforeach() --endif() -- - # Copy all of the resource files to the destination - file(COPY ${example_resources} DESTINATION "resources/") -diff --git a/examples/shapes/shapes_draw_circle_sector.c b/examples/shapes/shapes_draw_circle_sector.c -index 8b1cf6ec..b58f3f35 100644 ---- a/examples/shapes/shapes_draw_circle_sector.c -+++ b/examples/shapes/shapes_draw_circle_sector.c -@@ -57,11 +57,11 @@ int main(void) - - // Draw GUI controls - //------------------------------------------------------------------------------ -- startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20}, "StartAngle", startAngle, 0, 720, true ); -- endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20}, "EndAngle", endAngle, 0, 720, true); -+ startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20}, "StartAngle",NULL, startAngle, 0, 720); -+ endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20}, "EndAngle", NULL, endAngle, 0, 720); - -- outerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20}, "Radius", outerRadius, 0, 200, true); -- segments = GuiSliderBar((Rectangle){ 600, 170, 120, 20}, "Segments", segments, 0, 100, true); -+ outerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20}, "Radius", NULL, outerRadius, 0, 200); -+ segments = GuiSliderBar((Rectangle){ 600, 170, 120, 20}, "Segments", NULL, segments, 0, 100); - //------------------------------------------------------------------------------ - - DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 200, 10, (segments >= 4)? MAROON : DARKGRAY); -diff --git a/examples/shapes/shapes_draw_ring.c b/examples/shapes/shapes_draw_ring.c -index b363dc07..a18fdaf2 100644 ---- a/examples/shapes/shapes_draw_ring.c -+++ b/examples/shapes/shapes_draw_ring.c -@@ -64,13 +64,13 @@ int main(void) - - // Draw GUI controls - //------------------------------------------------------------------------------ -- startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20 }, "StartAngle", startAngle, -450, 450, true); -- endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20 }, "EndAngle", endAngle, -450, 450, true); -+ startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20 }, "StartAngle", NULL, startAngle, -450, 450); -+ endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20 }, "EndAngle", NULL, endAngle, -450, 450); - -- innerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20 }, "InnerRadius", innerRadius, 0, 100, true); -- outerRadius = GuiSliderBar((Rectangle){ 600, 170, 120, 20 }, "OuterRadius", outerRadius, 0, 200, true); -+ innerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20 }, NULL, "InnerRadius", innerRadius, 0, 100); -+ outerRadius = GuiSliderBar((Rectangle){ 600, 170, 120, 20 }, NULL, "OuterRadius", outerRadius, 0, 200); - -- segments = GuiSliderBar((Rectangle){ 600, 240, 120, 20 }, "Segments", segments, 0, 100, true); -+ segments = GuiSliderBar((Rectangle){ 600, 240, 120, 20 }, "Segments", NULL, segments, 0, 100); - - drawRing = GuiCheckBox((Rectangle){ 600, 320, 20, 20 }, "Draw Ring", drawRing); - drawRingLines = GuiCheckBox((Rectangle){ 600, 350, 20, 20 }, "Draw RingLines", drawRingLines); -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 2e9861f8..08b149f1 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -108,7 +108,7 @@ elseif(${PLATFORM} MATCHES "Android") - add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS) - add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS) - add_definitions(-DANDROID -D__ANDROID_API__=21) -- include_directories(external/android/native_app_glue) -+ include_directories(${ANDROID_NDK}/sources/android/native_app_glue) - 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/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 - --#if defined(PLATFORM_DESKTOP) -+#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) - // Load OpenGL 3.3 extensions - // NOTE: GLFW loader function is passed as parameter - rlLoadExtensions(glfwGetProcAddress); -+#else -+ rlLoadExtensions(eglGetProcAddress); - #endif - - // Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS) diff --git a/recipes/raylib/all/patches/0001-4.0.0-enable-cmake-build.patch b/recipes/raylib/all/patches/0001-4.0.0-enable-cmake-build.patch deleted file mode 100644 index 9ef917874947c..0000000000000 --- a/recipes/raylib/all/patches/0001-4.0.0-enable-cmake-build.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake -index c156d6b3..608fe531 100644 ---- a/cmake/LibraryConfigurations.cmake -+++ b/cmake/LibraryConfigurations.cmake -@@ -42,7 +42,7 @@ elseif (${PLATFORM} MATCHES "Android") - set(CMAKE_POSITION_INDEPENDENT_CODE ON) - - add_definitions(-DANDROID -D__ANDROID_API__=21) -- include_directories(external/android/native_app_glue) -+ include_directories(${ANDROID_NDK}/sources/android/native_app_glue) - 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/examples/CMakeLists.txt b/examples/CMakeLists.txt -index 6ade9686..4e849ce4 100644 ---- a/examples/CMakeLists.txt -+++ b/examples/CMakeLists.txt -@@ -66,6 +66,7 @@ endif () - if (${PLATFORM} MATCHES "Android") - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c) -+ list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_picking.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_vr_simulator.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_free.c) -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/3.5.0-0001-enable-cmake-build-android.patch b/recipes/raylib/all/patches/3.5.0-0001-enable-cmake-build-android.patch new file mode 100644 index 0000000000000..18b6559a6f285 --- /dev/null +++ b/recipes/raylib/all/patches/3.5.0-0001-enable-cmake-build-android.patch @@ -0,0 +1,31 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 2e9861f8..08b149f1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -108,7 +108,7 @@ elseif(${PLATFORM} MATCHES "Android") + add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS) + add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS) + add_definitions(-DANDROID -D__ANDROID_API__=21) +- include_directories(external/android/native_app_glue) ++ include_directories(${ANDROID_NDK}/sources/android/native_app_glue) + 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/core.c b/src/core.c +index e6d27e5f..fb7014b0 100644 +--- a/src/core.c ++++ b/src/core.c +@@ -3346,10 +3346,12 @@ static bool InitGraphicsDevice(int width, int height) + glfwSwapInterval(0); // No V-Sync by default + #endif + +-#if defined(PLATFORM_DESKTOP) ++#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + // Load OpenGL 3.3 extensions + // NOTE: GLFW loader function is passed as parameter + rlLoadExtensions(glfwGetProcAddress); ++#else ++ rlLoadExtensions(eglGetProcAddress); + #endif + + // Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS) diff --git a/recipes/raylib/all/patches/3.5.0-0002-cmake-project.patch b/recipes/raylib/all/patches/3.5.0-0002-cmake-project.patch new file mode 100644 index 0000000000000..03464a8959dfc --- /dev/null +++ b/recipes/raylib/all/patches/3.5.0-0002-cmake-project.patch @@ -0,0 +1,8 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,5 @@ + cmake_minimum_required(VERSION 3.0) ++project(raylib) + set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + + if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") 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 0000000000000..d302d880e5990 --- /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 new file mode 100644 index 0000000000000..4ff586ccfe20d --- /dev/null +++ b/recipes/raylib/all/patches/4.0.0-0001-enable-cmake-build-android.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake +index c156d6b3..608fe531 100644 +--- a/cmake/LibraryConfigurations.cmake ++++ b/cmake/LibraryConfigurations.cmake +@@ -42,7 +42,7 @@ elseif (${PLATFORM} MATCHES "Android") + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + add_definitions(-DANDROID -D__ANDROID_API__=21) +- include_directories(external/android/native_app_glue) ++ include_directories(${ANDROID_NDK}/sources/android/native_app_glue) + 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/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 0000000000000..292c7cf7b3f37 --- /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/raylib/all/test_package/CMakeLists.txt b/recipes/raylib/all/test_package/CMakeLists.txt index a1f55e19ef5a2..b4df9cc28b40d 100644 --- a/recipes/raylib/all/test_package/CMakeLists.txt +++ b/recipes/raylib/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(raylib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} raylib) +target_link_libraries(${PROJECT_NAME} PRIVATE raylib) diff --git a/recipes/raylib/all/test_package/conanfile.py b/recipes/raylib/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/raylib/all/test_package/conanfile.py +++ b/recipes/raylib/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,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/raylib/all/test_v1_package/CMakeLists.txt b/recipes/raylib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/raylib/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/raylib/all/test_v1_package/conanfile.py b/recipes/raylib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/raylib/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/raylib/config.yml b/recipes/raylib/config.yml index 9d0cb9313a0f3..c0992b52b18d8 100644 --- a/recipes/raylib/config.yml +++ b/recipes/raylib/config.yml @@ -1,5 +1,7 @@ versions: - "3.5.0": + "5.0": folder: "all" "4.0.0": folder: "all" + "3.5.0": + folder: "all" diff --git a/recipes/re2/all/conandata.yml b/recipes/re2/all/conandata.yml index ae373a08facb0..c28d8dfdd5d72 100644 --- a/recipes/re2/all/conandata.yml +++ b/recipes/re2/all/conandata.yml @@ -1,4 +1,19 @@ 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" "20230301": url: "https://github.com/google/re2/archive/refs/tags/2023-03-01.tar.gz" sha256: "7a9a4824958586980926a300b4717202485c4b4115ac031822e29aa4ef207e48" @@ -20,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 c8ad0901b061a..8d2e83b161ad9 100644 --- a/recipes/re2/all/conanfile.py +++ b/recipes/re2/all/conanfile.py @@ -1,12 +1,13 @@ 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.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.54.0" - class Re2Conan(ConanFile): name = "re2" description = "Fast, safe, thread-friendly regular expression library" @@ -20,15 +21,35 @@ class Re2Conan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_icu": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_icu": False, } + @property + def _min_cppstd(self): + return 14 if Version(self.version) >= "20230601" 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, {}) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "20230201": + del self.options.with_icu def configure(self): if self.options.shared: @@ -37,9 +58,21 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + if self.options.get_safe("with_icu"): + self.requires("icu/73.2") + if Version(self.version) >= "20230601": + self.requires("abseil/20230802.1", transitive_headers=True) + 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], strip_root=True) @@ -49,6 +82,9 @@ def generate(self): tc.variables["RE2_BUILD_TESTING"] = False tc.generate() + deps = CMakeDeps(self) + deps.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/re2/all/test_package/CMakeLists.txt b/recipes/re2/all/test_package/CMakeLists.txt index dee70b6be9bd8..f2cb6370aee9f 100644 --- a/recipes/re2/all/test_package/CMakeLists.txt +++ b/recipes/re2/all/test_package/CMakeLists.txt @@ -5,4 +5,8 @@ find_package(re2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE re2::re2) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if (re2_VERSION VERSION_GREATER_EQUAL "20230602") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/re2/config.yml b/recipes/re2/config.yml index ff0398cb71456..56ae3dda8367b 100644 --- a/recipes/re2/config.yml +++ b/recipes/re2/config.yml @@ -1,4 +1,14 @@ versions: + "20231101": + folder: all + "20230901": + folder: all + "20230801": + folder: all + "20230701": + folder: all + "20230602": + folder: all "20230301": folder: all "20230201": @@ -13,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 6123ba01ce5a3..e8f43a925d5ec 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 fd56a51318aa2..99f065993da70 100644 --- a/recipes/re2c/all/conanfile.py +++ b/recipes/re2c/all/conanfile.py @@ -1,95 +1,115 @@ -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) + copy(self, "*.re", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include"), + 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 = [] + + include_dir = os.path.join(self.package_folder, "include") + self.buildenv_info.define("RE2C_STDLIB_DIR", include_dir) + + # 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) + self.env_info.RE2C_STDLIB_DIR = include_dir 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 c9bc0abc63639..0000000000000 --- 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 9f0917e64ea34..9ba5cb966b406 100644 --- a/recipes/re2c/all/test_package/CMakeLists.txt +++ b/recipes/re2c/all/test_package/CMakeLists.txt @@ -1,11 +1,10 @@ -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_program(RE2C NAMES re2c) 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" -I "$ENV{RE2C_STDLIB_DIR}" -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 a886f5f0a7632..91315a6314ef7 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/all/test_package/syntax.re b/recipes/re2c/all/test_package/syntax.re index b1b909b54562f..b2d424b9894c3 100644 --- a/recipes/re2c/all/test_package/syntax.re +++ b/recipes/re2c/all/test_package/syntax.re @@ -1,16 +1,21 @@ #include +#include + +/*!include:re2c "unicode_categories.re" */ /*!max:re2c*/ /*!re2c digit = [0-9]; number = digit+; + word = L+; */ static int lex(const char *YYCURSOR) { const char *YYMARKER; /*!re2c - re2c:define:YYCTYPE = char; + re2c:flags:utf-8 = 1; + re2c:define:YYCTYPE = 'unsigned char'; re2c:yyfill:enable = 0; * { return 1; } @@ -20,12 +25,18 @@ static int lex(const char *YYCURSOR) return 0; } + word { + printf("word\n"); + return 0; + } + */ } int main() { - lex("1024"); - lex(";]"); + assert(lex("1024") == 0); + assert(lex(";]") == 1); + assert(lex("Слово") == 0); return 0; } diff --git a/recipes/re2c/config.yml b/recipes/re2c/config.yml index ca4059985b6a4..fd91d5170215c 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 b01e397208475..a8ee60a2f8197 100644 --- a/recipes/reactiveplusplus/all/conandata.yml +++ b/recipes/reactiveplusplus/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.0.0": + url: "https://github.com/victimsnino/ReactivePlusPlus/archive/v2.0.0.tar.gz" + sha256: "8950fe579aea23be1a6affd4ec8845c78016454aaf875dbae6a52d10eeb6df02" + "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/all/conanfile.py b/recipes/reactiveplusplus/all/conanfile.py index d8d1eb5567b3d..44a04efc93ad3 100644 --- a/recipes/reactiveplusplus/all/conanfile.py +++ b/recipes/reactiveplusplus/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" @@ -28,13 +29,23 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): - return { - "Visual Studio": "16.10", - "msvc": "192", - "gcc": "10", - "clang": "12", - "apple-clang": "14", - } + if Version(self.version) >= "2.0.0": + # For 'consteval' support + return { + "Visual Studio": "17", + "msvc": "193", + "gcc": "12", + "clang": "14", + "apple-clang": "14", + } + else: + return { + "Visual Studio": "16.10", + "msvc": "192", + "gcc": "10", + "clang": "12", + "apple-clang": "14", + } def layout(self): basic_layout(self, src_folder="src") @@ -47,10 +58,7 @@ def validate(self): 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] + 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): @@ -59,8 +67,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/reactiveplusplus/all/test_package/CMakeLists.txt b/recipes/reactiveplusplus/all/test_package/CMakeLists.txt index 96e89147f81a9..1809dd95e5019 100644 --- a/recipes/reactiveplusplus/all/test_package/CMakeLists.txt +++ b/recipes/reactiveplusplus/all/test_package/CMakeLists.txt @@ -3,6 +3,10 @@ project(test_package LANGUAGES CXX) find_package(RPP REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) +if(RPP_VERSION VERSION_GREATER_EQUAL 2) + add_executable(${PROJECT_NAME} test_package_v2.cpp) +else() + add_executable(${PROJECT_NAME} test_package.cpp) +endif() target_link_libraries(${PROJECT_NAME} PRIVATE RPP::rpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/reactiveplusplus/all/test_package/test_package_v2.cpp b/recipes/reactiveplusplus/all/test_package/test_package_v2.cpp new file mode 100644 index 0000000000000..392c29a4ae623 --- /dev/null +++ b/recipes/reactiveplusplus/all/test_package/test_package_v2.cpp @@ -0,0 +1,18 @@ +// Source: https://github.com/victimsnino/ReactivePlusPlus/tree/v2/docs#operators + +#include + +#include +#include +#include + +int main() +{ + rpp::source::from_callable(&::getchar) + | rpp::operators::repeat() + | rpp::operators::take_while([](char v) { return v != '0'; }) + | rpp::operators::filter(std::not_fn(&::isdigit)) + | rpp::operators::map(&::toupper); + + return 0; +} diff --git a/recipes/reactiveplusplus/config.yml b/recipes/reactiveplusplus/config.yml index 4fec465c4ccad..feccf8f451435 100644 --- a/recipes/reactiveplusplus/config.yml +++ b/recipes/reactiveplusplus/config.yml @@ -1,4 +1,8 @@ versions: + "2.0.0": + folder: all + "0.2.3": + folder: all "0.2.1": folder: all "0.1.2": diff --git a/recipes/readline/all/conandata.yml b/recipes/readline/all/conandata.yml index 08a67ab543d70..e8d782e286b8b 100644 --- a/recipes/readline/all/conandata.yml +++ b/recipes/readline/all/conandata.yml @@ -5,3 +5,6 @@ sources: "8.1.2": url: "https://ftp.gnu.org/pub/gnu/readline/readline-8.1.2.tar.gz" sha256: "7589a2381a8419e68654a47623ce7dfcb756815c8fee726b98f90bf668af7bc6" + "8.2": + url: "https://ftp.gnu.org/pub/gnu/readline/readline-8.2.tar.gz" + sha256: "3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" diff --git a/recipes/readline/all/conanfile.py b/recipes/readline/all/conanfile.py index 607d6921916f3..0c46be5b31c24 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", transitive_headers=True, transitive_libs=True) def configure(self): if self.options.shared: @@ -74,9 +74,10 @@ def generate(self): deps.generate() def _patch_sources(self): - replace_in_file(self, os.path.join(self.source_folder, "shlib", "Makefile.in"), "-o $@ $(SHARED_OBJ) $(SHLIB_LIBS)", + if self.options.with_library == "termcap": + replace_in_file(self, os.path.join(self.source_folder, "shlib", "Makefile.in"), "-o $@ $(SHARED_OBJ) $(SHLIB_LIBS)", "-o $@ $(SHARED_OBJ) $(SHLIB_LIBS) -ltermcap") - replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), "@TERMCAP_LIB@", "-ltermcap") + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), "@TERMCAP_LIB@", "-ltermcap") def build(self): self._patch_sources() diff --git a/recipes/readline/config.yml b/recipes/readline/config.yml index aafdae05d7dc8..2aedc51249c31 100644 --- a/recipes/readline/config.yml +++ b/recipes/readline/config.yml @@ -3,3 +3,5 @@ versions: folder: "all" "8.1.2": folder: "all" + "8.2": + folder: "all" diff --git a/recipes/readosm/all/conanfile.py b/recipes/readosm/all/conanfile.py index b9c04661624b4..b9c849a552887 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 eab353d687736..0000000000000 --- 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 076654555cbc6..e93b6ba1b6012 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 c7332f9531164..f77182eff1815 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 2d0f2eeb0d746..4147475a867bb 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 16ec9f68ef974..ef5d7042163ec 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 b5c67148547b0..7a8bca93d7839 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 0000000000000..91630d79f4abb --- /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 0000000000000..90eb89e3f2f46 --- /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 ad87340ad9e35..edcba50235f7c 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 8fdf7f70084cf..2b3717a2d67c0 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 d57b3a725b42c..bb306edeaaa9c 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 38f4483872d47..ef5d7042163ec 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 65e10348b409b..a75d73b3ececd 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 ed9e26c6552eb..3eb6ce30d6747 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/conandata.yml b/recipes/redis-plus-plus/all/conandata.yml index 2437f2fe67b15..eb42b97f78519 100644 --- a/recipes/redis-plus-plus/all/conandata.yml +++ b/recipes/redis-plus-plus/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.3.11": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.11.tar.gz" + sha256: "bb4990eed60d3654cd6902b9e67b3ab43e52557e84315560660b0c9e64b6ff77" + "1.3.10": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.10.tar.gz" + sha256: "85d9d9ff84c873c4a14bd28bee569a1f311285fad8d4f2fb0e472f65d4bb842a" + "1.3.8": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.8.tar.gz" + sha256: "ad521b4a24d1591a1564f945ba6370875b501210222e324f398065251df41641" "1.3.7": url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.7.tar.gz" sha256: "89cb83b0a23ac5825300c301814eab74aa3cdcfcd12e87d443c2692e367768ba" @@ -11,10 +20,19 @@ sources: "1.2.3": url: "https://github.com/sewenew/redis-plus-plus/archive/1.2.3.tar.gz" sha256: "1a3336752133019c963e06c28667b96690d6395b804e5e326671777ff88982ea" - "1.2.1": - url: "https://github.com/sewenew/redis-plus-plus/archive/1.2.1.tar.gz" - sha256: "f09c9fcc362955edb887632cd008102887278c94934d7e8c9d0acb8707671902" patches: + "1.3.11": + - patch_file: "patches/1.3.8-0001-fix-dependencies-injection.patch" + patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" + patch_type: "conan" + "1.3.10": + - patch_file: "patches/1.3.8-0001-fix-dependencies-injection.patch" + patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" + patch_type: "conan" + "1.3.8": + - patch_file: "patches/1.3.8-0001-fix-dependencies-injection.patch" + patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" + patch_type: "conan" "1.3.7": - patch_file: "patches/1.3.7-0001-fix-dependencies-injection.patch" patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" @@ -31,10 +49,3 @@ patches: - patch_file: "patches/1.2.3-0001-fix-conan-cmake-package.patch" patch_description: "Robust discovery & injection of dependencies" patch_type: "conan" - "1.2.1": - - patch_file: "patches/1.2.1-0001-fix-hiredis-consumption.patch" - patch_description: "Robust discovery & injection of dependencies" - patch_type: "conan" - - patch_file: "patches/1.2.1-0002-cmake-minimum-required.patch" - patch_description: "CMake: move cmake_minimum_required() before project()" - patch_type: "conan" diff --git a/recipes/redis-plus-plus/all/conanfile.py b/recipes/redis-plus-plus/all/conanfile.py index b10c66e4f7f94..d7fbaf589b20b 100644 --- a/recipes/redis-plus-plus/all/conanfile.py +++ b/recipes/redis-plus-plus/all/conanfile.py @@ -2,21 +2,21 @@ 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 -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class RedisPlusPlusConan(ConanFile): name = "redis-plus-plus" - homepage = "https://github.com/sewenew/redis-plus-plus" description = "Redis client written in C++" - topics = ("database", "redis", "client", "tls") - 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/sewenew/redis-plus-plus" + topics = ("database", "redis", "client", "tls") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -58,18 +58,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("hiredis/1.1.0") + self.requires("hiredis/1.2.0", transitive_headers=True, transitive_libs=True) if self.options.get_safe("build_async"): - self.requires("libuv/1.44.2") + self.requires("libuv/1.47.0") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): @@ -85,8 +82,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.name}:with_tls=True requires hiredis:with_ssl=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) @@ -101,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 de2b4ddbe2f80..0000000000000 --- 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 d00f3b331f4ab..0000000000000 --- 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/redis-plus-plus/all/patches/1.3.8-0001-fix-dependencies-injection.patch b/recipes/redis-plus-plus/all/patches/1.3.8-0001-fix-dependencies-injection.patch new file mode 100644 index 0000000000000..620986816daec --- /dev/null +++ b/recipes/redis-plus-plus/all/patches/1.3.8-0001-fix-dependencies-injection.patch @@ -0,0 +1,58 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6470b32..d372d3d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,8 +34,7 @@ if(REDIS_PLUS_PLUS_BUILD_ASYNC) + message(STATUS "redis-plus-plus build async interface with libuv") + + # libuv dependency +- find_path(REDIS_PLUS_PLUS_ASYNC_LIB_HEADER NAMES uv.h) +- find_library(REDIS_PLUS_PLUS_ASYNC_LIB uv) ++ find_package(libuv REQUIRED CONFIG) + else() + message(FATAL_ERROR "invalid REDIS_PLUS_PLUS_BUILD_ASYNC") + endif() +@@ -133,7 +132,6 @@ if(hiredis_FOUND) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis) + + if(REDIS_PLUS_PLUS_USE_TLS) +- find_package(hiredis_ssl REQUIRED) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis_ssl) + find_package(OpenSSL REQUIRED) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS ${OPENSSL_LIBRARIES}) +@@ -163,16 +161,10 @@ endif() + set(HIREDIS_FEATURE_TEST_HEADER "${HIREDIS_FEATURE_TEST_INCLUDE}/hiredis/hiredis.h") + + include(CheckSymbolExists) +-set(CMAKE_REQUIRED_LIBRARIES_BACK ${CMAKE_REQUIRED_LIBRARIES}) +-set(CMAKE_REQUIRED_LIBRARIES ${HIREDIS_FEATURE_TEST_LIB}) +- + CHECK_SYMBOL_EXISTS(redisEnableKeepAliveWithInterval ${HIREDIS_FEATURE_TEST_HEADER} REDIS_PLUS_PLUS_HAS_redisEnableKeepAliveWithInterval) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hiredis_features.h.in ${CMAKE_CURRENT_SOURCE_DIR}/${REDIS_PLUS_PLUS_SOURCE_DIR}/hiredis_features.h) + +-# Restore CMAKE_REQUIRED_LIBRARIES +-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_BACK}) +- + # Build static library + option(REDIS_PLUS_PLUS_BUILD_STATIC "Build static library" ON) + message(STATUS "redis-plus-plus build static library: ${REDIS_PLUS_PLUS_BUILD_STATIC}") +@@ -214,7 +206,7 @@ if(REDIS_PLUS_PLUS_BUILD_STATIC) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${STATIC_LIB} PUBLIC $) +- target_include_directories(${STATIC_LIB} PUBLIC $) ++ target_link_libraries(${STATIC_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${STATIC_LIB} SYSTEM PUBLIC $) + endif() +@@ -267,8 +259,7 @@ if(REDIS_PLUS_PLUS_BUILD_SHARED) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${SHARED_LIB} PUBLIC $) +- target_include_directories(${SHARED_LIB} PUBLIC $) +- target_link_libraries(${SHARED_LIB} PUBLIC ${REDIS_PLUS_PLUS_ASYNC_LIB}) ++ target_link_libraries(${SHARED_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${SHARED_LIB} SYSTEM PUBLIC $) + endif() diff --git a/recipes/redis-plus-plus/all/test_package/CMakeLists.txt b/recipes/redis-plus-plus/all/test_package/CMakeLists.txt index df9a8c785c48c..a2c2b3348228e 100644 --- a/recipes/redis-plus-plus/all/test_package/CMakeLists.txt +++ b/recipes/redis-plus-plus/all/test_package/CMakeLists.txt @@ -9,10 +9,15 @@ if(TARGET redis++::redis++_static) else() target_link_libraries(${PROJECT_NAME} PRIVATE redis++::redis++) endif() -if(redis++_VERSION VERSION_GREATER_EQUAL "1.3.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -else() - # no target_compile_features here because redis-plus-plus < 1.3.0 is built - # with C++11 by default and is not ABI compatible if consumed with C++17... - set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) + +if(NOT CMAKE_CXX_STANDARD) + # Cover the case where compiler.cppstd is not defined in the Conan profile + # (e.g. Conan 1.x), and define the compiler standard assuming the library defaults instead + if(redis++_VERSION VERSION_GREATER_EQUAL "1.3.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + else() + # no target_compile_features here because redis-plus-plus < 1.3.0 is built + # with C++11 by default and is not ABI compatible if consumed with C++17... + set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) + endif() endif() diff --git a/recipes/redis-plus-plus/config.yml b/recipes/redis-plus-plus/config.yml index 923fc0f3c1acb..973c54194e222 100644 --- a/recipes/redis-plus-plus/config.yml +++ b/recipes/redis-plus-plus/config.yml @@ -1,4 +1,10 @@ versions: + "1.3.11": + folder: all + "1.3.10": + folder: all + "1.3.8": + folder: all "1.3.7": folder: all "1.3.3": @@ -7,5 +13,3 @@ versions: folder: all "1.2.3": folder: all - "1.2.1": - folder: all diff --git a/recipes/refl-cpp/all/conanfile.py b/recipes/refl-cpp/all/conanfile.py index 7ba2308354522..cfecdf8a0b5ec 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/reflect-cpp/all/conandata.yml b/recipes/reflect-cpp/all/conandata.yml new file mode 100644 index 0000000000000..e8f0dda436088 --- /dev/null +++ b/recipes/reflect-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.6.0": + url: "https://github.com/getml/reflect-cpp/archive/v0.6.0.tar.gz" + sha256: "D8231B91989397A67E841B56A0673FDCDF969DBE956D54BB629F14100B030664" diff --git a/recipes/reflect-cpp/all/conanfile.py b/recipes/reflect-cpp/all/conanfile.py new file mode 100644 index 0000000000000..4952fc02f03a6 --- /dev/null +++ b/recipes/reflect-cpp/all/conanfile.py @@ -0,0 +1,92 @@ +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.layout import basic_layout +import os + +required_conan_version = ">=1.51.1" + +class ReflectCppConan(ConanFile): + name = "reflect-cpp" + description = "C++-20 library for fast serialization, deserialization and validation using reflection" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/getml/reflect-cpp" + topics = ("reflection", "serialization", "memory", "json", "xml", "flatbuffers", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_json" : [True, False], + "with_xml" : [True, False], + "with_flatbuffers" : [True, False], + "with_yaml": [True, False], + } + default_options = { + "with_json" : False, + "with_xml" : False, + "with_flatbuffers" : False, + "with_yaml" : False, + } + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "17", + "msvc": "193", + "gcc": "11.4", + "clang": "16", + "apple-clang": "15", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_json: + self.requires("yyjson/0.8.0", transitive_headers=True) + if self.options.with_xml: + self.requires("pugixml/1.14", transitive_headers=True) + if self.options.with_flatbuffers: + self.requires("flatbuffers/23.5.26", transitive_headers=True) + if self.options.with_yaml: + self.requires("yaml-cpp/0.8.0", transitive_headers=True) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + 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): + apply_conandata_patches(self) + + 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/reflect-cpp/all/test_package/CMakeLists.txt b/recipes/reflect-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..66b58d7b20ff5 --- /dev/null +++ b/recipes/reflect-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(reflect-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE reflect-cpp::reflect-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/reflect-cpp/all/test_package/conanfile.py b/recipes/reflect-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/reflect-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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/reflect-cpp/all/test_package/test_package.cpp b/recipes/reflect-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..04e4309cba5ea --- /dev/null +++ b/recipes/reflect-cpp/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +struct TestStruct { + int x; + std::string name; +}; + +int main(void) { + for (const auto& f : rfl::fields()) { + (void) f.name(); + (void) f.type(); + } + return 0; +} diff --git a/recipes/reflect-cpp/all/test_v1_package/CMakeLists.txt b/recipes/reflect-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9652e22fc19d5 --- /dev/null +++ b/recipes/reflect-cpp/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/reflect-cpp/all/test_v1_package/conanfile.py b/recipes/reflect-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/reflect-cpp/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/reflect-cpp/config.yml b/recipes/reflect-cpp/config.yml new file mode 100644 index 0000000000000..7d9ba9dbc8ac9 --- /dev/null +++ b/recipes/reflect-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.6.0": + folder: all diff --git a/recipes/replxx/all/conandata.yml b/recipes/replxx/all/conandata.yml index 6dce0f8a4cabd..cc779ef163dc2 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 1d287dc51fe1f..72beed1028bdc 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 0000000000000..752c888324f23 --- /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 0000000000000..12104832cd70d --- /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 280ae0c8f5550..9579ce3b8a9cd 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 0e8accc6eec6a..fc3ecee6a8761 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 6e5e189f75c43..e10fab1825ee4 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 2f970874682b0..8d52b7021efe1 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 0e0b304948775..88ad6ceb45f48 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 0000000000000..91630d79f4abb --- /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 0000000000000..fdaba4642f464 --- /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 8eaf747a395e3..06ced9d2281b3 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 0b396c60ef333..576da558e85ba 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/9.1.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.6.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.81.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 c650402f2c503..df26f55e95f2c 100644 --- a/recipes/restinio/config.yml +++ b/recipes/restinio/config.yml @@ -1,25 +1,11 @@ versions: + "0.7.1": + folder: "v0.7" + "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 0000000000000..e74209bdf08a6 --- /dev/null +++ b/recipes/restinio/v0.7/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.7.1": + url: "https://github.com/Stiffstream/restinio/archive/v.0.7.1.tar.gz" + sha256: "46a3224ad23f768412c3494cd11f973b753b0d0be51906c46176ea7bafa687f6" + "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 0000000000000..29aee97b93a3d --- /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.2.0") + 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": "15", + "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 0000000000000..1f4ba6e706df2 --- /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 0000000000000..a9fb96656f203 --- /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 0000000000000..ac78ee51f9a8d --- /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 5f0b2b410ca60..5d4d0f4829476 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 43c69a50b6b5c..1a5ed53523f88 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 196188113685c..249e96fb582fb 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 bd7165a553cf4..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..7e2dfe859bb27 --- /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 62f3ee9f485a5..2978797a9067e 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 454c47bb2cbab..e86d42248fffd 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 be0a94674e5bd..ef5d7042163ec 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 136968a37d7d1..c4faf6d5e5b49 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 0000000000000..91630d79f4abb --- /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 0000000000000..f96c48347ffda --- /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/ring-span-lite/all/conanfile.py b/recipes/ring-span-lite/all/conanfile.py index b99c854a61b09..91e2240703f2a 100644 --- a/recipes/ring-span-lite/all/conanfile.py +++ b/recipes/ring-span-lite/all/conanfile.py @@ -10,8 +10,8 @@ class RingSpanLiteConan(ConanFile): name = "ring-span-lite" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinmoene/ring-span-lite" - description = ("ring-span lite - A ring_span type for C++98, C++11 and later in a \ - single-file header-only library ") + description = ( + "ring-span lite - A ring_span type for C++98, C++11 and later in a single-file header-only library ") topics = ("cpp98", "cpp11", "cpp14", "cpp17", "ring-span") license = "BSL-1.0" settings = "os", "arch", "compiler", "build_type" @@ -31,25 +31,30 @@ def build(self): pass def package(self): - copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) - copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "ring-span-lite") - self.cpp_info.set_property("cmake_target_name", "nonstd::ring-span-lite") + self.cpp_info.set_property( + "cmake_target_name", "nonstd::ring-span-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 + # TODO: to remove in conan v2 once cmake_find_package* generators + # removed. self.cpp_info.filenames["cmake_find_package"] = "ring-span-lite" self.cpp_info.filenames["cmake_find_package_multi"] = "ring-span-lite" self.cpp_info.names["cmake_find_package"] = "nonstd" self.cpp_info.names["cmake_find_package_multi"] = "nonstd" self.cpp_info.components["ringspanlite"].names["cmake_find_package"] = "ring-span-lite" self.cpp_info.components["ringspanlite"].names["cmake_find_package_multi"] = "ring-span-lite" - self.cpp_info.components["ringspanlite"].set_property("cmake_target_name", "nonstd::ring-span-lite") + self.cpp_info.components["ringspanlite"].set_property( + "cmake_target_name", "nonstd::ring-span-lite") self.cpp_info.components["ringspanlite"].bindirs = [] self.cpp_info.components["ringspanlite"].frameworkdirs = [] self.cpp_info.components["ringspanlite"].libdirs = [] diff --git a/recipes/rmm/all/conandata.yml b/recipes/rmm/all/conandata.yml new file mode 100644 index 0000000000000..67683994d5b6f --- /dev/null +++ b/recipes/rmm/all/conandata.yml @@ -0,0 +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 new file mode 100644 index 0000000000000..ca0e3861927c1 --- /dev/null +++ b/recipes/rmm/all/conanfile.py @@ -0,0 +1,111 @@ +import os +import textwrap + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, replace_in_file, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class RmmConan(ConanFile): + name = "rmm" + description = "RAPIDS Memory Manager" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rapidsai/rmm" + topics = ("cuda", "memory-management", "memory-allocation", "rapids", "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): + # Based partially on https://github.com/rapidsai/rmm/tree/v23.06.00#get-rmm-dependencies + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "9.3", + "clang": "8", + "apple-clang": "14.0", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("thrust/1.17.2") + self.requires("spdlog/1.12.0") + self.requires("fmt/10.1.1") + + 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 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 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." + ) + + if self.dependencies["thrust"].options.get_safe("backend") != "cuda": + self.output.warning( + "RMM requires the CUDA backend to be enabled in Thrust by setting thrust/*:backend=cuda." + ) + + def _write_version_header(self): + # Workaround for the `rapids_cmake_write_version_file(include/rmm/version_config.hpp)` CMakeLists.txt step + # https://github.com/rapidsai/rapids-cmake/blob/branch-23.08/rapids-cmake/cmake/write_version_file.cmake + # https://github.com/rapidsai/rapids-cmake/blob/branch-23.08/rapids-cmake/cmake/template/version.hpp.in + major, minor, patch = self.version.split(".")[:3] + save(self, os.path.join(self.source_folder, "include", "rmm", "version_config.hpp"), + textwrap.dedent(f"""\ + #pragma once + #define RMM_VERSION_MAJOR {int(major)} + #define RMM_VERSION_MINOR {int(minor)} + #define RMM_VERSION_PATCH {int(patch)} + """) + ) + + 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 ") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._write_version_header() + self._patch_sources() + + def package(self): + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + for pattern in ["*.hpp", "*.h"]: + 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.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/all/test_package/CMakeLists.txt b/recipes/rmm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..678b3e6095ba7 --- /dev/null +++ b/recipes/rmm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(rmm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rmm::rmm) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/rmm/all/test_package/conanfile.py b/recipes/rmm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/rmm/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/rmm/all/test_package/test_package.cpp b/recipes/rmm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..981cc677b6529 --- /dev/null +++ b/recipes/rmm/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include +#include +#include + +int main() { + // The log output will be sent to rmm_log.txt in the build directory by default + RMM_LOG_INFO("rmm version: {}.{}.{}", RMM_VERSION_MAJOR, RMM_VERSION_MINOR, RMM_VERSION_PATCH); + return EXIT_SUCCESS; +} diff --git a/recipes/rmm/config.yml b/recipes/rmm/config.yml new file mode 100644 index 0000000000000..20cd4f56dc99f --- /dev/null +++ b/recipes/rmm/config.yml @@ -0,0 +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 14b0607a44ca3..edc3ffb72f6d6 100644 --- a/recipes/roaring/all/conandata.yml +++ b/recipes/roaring/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "2.1.2": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.1.2.tar.gz" + sha256: "a53d2f540f78ddae31e30c573b1b7fd41d7257d6a090507ba35d9c398712e5ad" + "2.1.1": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.1.1.tar.gz" + sha256: "40a1c04e220bb2305c3adb5347f42b6b435c4bb4ac89dd0047ba8e73a7388dfb" + "2.1.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.1.0.tar.gz" + sha256: "75e2c106bf3c035f92560017b56b01602744b643a3fef08d69255c138c6c6f5c" + "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" + "1.1.5": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.1.5.tar.gz" + sha256: "5210a277ce83c3099dfee41d494c28aec61bdbc9160b3b124cb5afeab49cd123" "1.1.2": url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.1.2.tar.gz" sha256: "545fab4f00d946000743c563b3c315c1a11cee1f19c6ba4fb9493824a4e68b9a" @@ -11,36 +32,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 485a7146b02ba..f0d51742149de 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 60d328135f926..6e9e7fadde265 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 456ab7f7990a4..18169725770ed 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 d61f68fe0a402..cc4a150b9e961 100644 --- a/recipes/roaring/config.yml +++ b/recipes/roaring/config.yml @@ -1,31 +1,27 @@ versions: - "1.1.2": + "2.1.2": folder: all - "1.1.0": + "2.1.1": folder: all - "1.0.0": + "2.1.0": folder: all - "0.9.9": + "2.0.4": folder: all - "0.9.8": + "2.0.2": folder: all - "0.9.6": + "1.3.0": folder: all - "0.9.3": - folder: all - "0.9.0": - folder: all - "0.8.1": + "1.1.5": folder: all - "0.8.0": + "1.1.2": folder: all - "0.7.3": + "1.1.0": folder: all - "0.6.0": + "1.0.0": folder: all - "0.5.0": + "0.9.9": folder: all - "0.4.0": + "0.8.1": folder: all - "0.3.4": + "0.7.3": folder: all diff --git a/recipes/rocksdb/all/CMakeLists.txt b/recipes/rocksdb/all/CMakeLists.txt deleted file mode 100644 index f287ed21516c7..0000000000000 --- 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 2e0d65d48f078..1792c3284fadc 100644 --- a/recipes/rocksdb/all/conandata.yml +++ b/recipes/rocksdb/all/conandata.yml @@ -1,38 +1,19 @@ 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" + "8.8.1": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v8.8.1.tar.gz" + sha256: "056c7e21ad8ae36b026ac3b94b9d6e0fcc60e1d937fc80330921e4181be5c36e" 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 b10e35fb91648..09425b9f86390 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,22 @@ 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" + def _min_cppstd(self): + return "11" if Version(self.version) < "8.8.1" else "17" @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def _compilers_minimum_version(self): + return {} if self._min_cppstd == "11" else { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } 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 +78,104 @@ 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) - if self.settings.arch not in ["x86_64", "ppc64le", "ppc64", "mips64", "armv8"]: - raise ConanInvalidConfiguration("Rocksdb requires 64 bits") + check_min_cppstd(self, self._min_cppstd) - 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.") + 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.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.settings.arch not in ["x86_64", "ppc64le", "ppc64", "mips64", "armv8"]: + raise ConanInvalidConfiguration("Rocksdb requires 64 bits") - 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 +186,22 @@ 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")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) 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 +216,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 fa3904b84954a..0000000000000 --- 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 2e8cfd1a8a8aa..0000000000000 --- 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 99195907c0c6a..0000000000000 --- 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 862805a12fdf1..0000000000000 --- 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 0000000000000..05725bf2c9a65 --- /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 862805a12fdf1..0000000000000 --- 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 acaacf5868a66..0000000000000 --- 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 cab2ad0ef9d57..b23ea40acdad9 100644 --- a/recipes/rocksdb/all/test_package/CMakeLists.txt +++ b/recipes/rocksdb/all/test_package/CMakeLists.txt @@ -1,18 +1,23 @@ -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) + if(RocksDB_VERSION VERSION_LESS "8.8.1") + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11) + else() + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_17) + endif() + 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 326ef695da52e..06b097c220e7c 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 0000000000000..c23ed5cfe6d98 --- /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 0000000000000..5fc2cee9c5517 --- /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 51a8046980930..3691365f4f4a3 100644 --- a/recipes/rocksdb/config.yml +++ b/recipes/rocksdb/config.yml @@ -5,9 +5,5 @@ versions: folder: all "6.20.3": folder: all - "6.10.2": - folder: all - "6.8.1": - folder: all - "6.0.2": + "8.8.1": folder: all diff --git a/recipes/rpclib/all/CMakeLists.txt b/recipes/rpclib/all/CMakeLists.txt deleted file mode 100644 index de7e444eb2469..0000000000000 --- 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 696b41e86b171..d7b9eea3bb30c 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 30a8488efd8a1..111d6614af1be 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 0000000000000..47ffb5454d1b3 --- /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 e585430312fe0..6ea9e950e13d6 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 67c12602a84f3..3a91c9439218e 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 0000000000000..91630d79f4abb --- /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 0000000000000..d2f62e670fcd2 --- /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 0000000000000..a7d6fc86710c8 --- /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 0000000000000..c1c2765fe7084 --- /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 0000000000000..92140298fe340 --- /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 0000000000000..115b04e9ac779 --- /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 0000000000000..6f87c0e328a59 --- /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 0000000000000..7dc67f1d1ed6d --- /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 0000000000000..ea091707cc7ee --- /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 0000000000000..f52bd22d8d75b --- /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 0000000000000..326ac56093a5e --- /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 0000000000000..02eb5ce439fb4 --- /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 0000000000000..51c8582d96563 --- /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 0000000000000..8faa0eba5645f --- /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 09d3d16ab4076..41cc19013d6fa 100644 --- a/recipes/rtm/all/conandata.yml +++ b/recipes/rtm/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.2.1": + url: "https://github.com/nfrechette/rtm/archive/v2.2.1.tar.gz" + sha256: "678989368bc9859138db00719ad9e2f82b51acb0d8da6905426e4134223cee2a" + "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/all/conanfile.py b/recipes/rtm/all/conanfile.py index ab6e02732c88c..232084322c1ed 100644 --- a/recipes/rtm/all/conanfile.py +++ b/recipes/rtm/all/conanfile.py @@ -1,28 +1,46 @@ import os -from conans 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.52.0" class Rtmonan(ConanFile): name = "rtm" description = "Realtime Math" - topics = ("realtime", "math") license = "MIT" - homepage = "https://github.com/nfrechette/rtm" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nfrechette/rtm" + topics = ("realtime", "math", "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]) - 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 package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "includes")) + 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_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/rtm/all/test_package/CMakeLists.txt b/recipes/rtm/all/test_package/CMakeLists.txt index 33ae887aa6aea..6cc064494767b 100644 --- a/recipes/rtm/all/test_package/CMakeLists.txt +++ b/recipes/rtm/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(rtm REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE rtm::rtm) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/rtm/all/test_package/conanfile.py b/recipes/rtm/all/test_package/conanfile.py index a59a26a52c8dc..fae501d0afb9e 100644 --- a/recipes/rtm/all/test_package/conanfile.py +++ b/recipes/rtm/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" + 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/rtm/all/test_package/test_package.cpp b/recipes/rtm/all/test_package/test_package.cpp index 5e13600bd88fc..5392fd6c1108b 100644 --- a/recipes/rtm/all/test_package/test_package.cpp +++ b/recipes/rtm/all/test_package/test_package.cpp @@ -1,3 +1,6 @@ +// workaround for a missing include in rtm +#include + #include #include #include diff --git a/recipes/rtm/all/test_v1_package/CMakeLists.txt b/recipes/rtm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/rtm/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/rtm/all/test_v1_package/conanfile.py b/recipes/rtm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..abcaeed3f89b6 --- /dev/null +++ b/recipes/rtm/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/rtm/config.yml b/recipes/rtm/config.yml index 891ce064b3b74..3a396aa92fa44 100644 --- a/recipes/rtm/config.yml +++ b/recipes/rtm/config.yml @@ -1,4 +1,8 @@ versions: + "2.2.1": + folder: "all" + "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 53cfe6b111167..7f688e03dcce4 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 a347f4bbefb6f..c7428d7707336 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 30e9497f54064..f7c2ad14131bc 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 4e4f66d9ee7ef..0000000000000 --- 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 c7ee9cc9e4688..f5f8524c916a7 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 196188113685c..17ebed2c5661d 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 bd7165a553cf4..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..7e2dfe859bb27 --- /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 0000000000000..2320f21a27e4c --- /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 0000000000000..31e07fd7e0dc3 --- /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 0000000000000..1a458e9936c5d --- /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 0000000000000..4bb8e07c25908 --- /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 0000000000000..cc8c0e2143602 --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..1f6da7a09f6f2 --- /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 0000000000000..1b582dcf6716b --- /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 1f39628799a66..23e77bed0050e 100644 --- a/recipes/s2n/all/conandata.yml +++ b/recipes/s2n/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "1.4.1": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.1.tar.gz" + sha256: "d8c1d8e1142441412434feacb4947ce6430a244dcd8f58921af79b29bd901731" + "1.4.0": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.0.tar.gz" + sha256: "3f786cb2f35e0551e120e1747e7b510a8228cd852073afa241313939672046cb" + "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 611e0f7be0d88..516ed15f07d2b 100644 --- a/recipes/s2n/config.yml +++ b/recipes/s2n/config.yml @@ -1,4 +1,18 @@ versions: + "1.4.1": + folder: all + "1.4.0": + folder: all + "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 3233a1960c7bf..f34812471ebce 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 6832bd1f1a055..5f767c3bd62c5 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/2.0.33") - if self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") - elif self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") - if self.options.with_png: - self.requires("libpng/1.6.39") - if self.options.with_tiff: - self.requires("libtiff/4.4.0") - if self.options.with_webp: - self.requires("libwebp/1.2.4") + self.requires("libpng/1.6.40") + 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 98ec3b23d5ae9..0000000000000 --- 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 4b9680ce33efb..7dbf8a1dbf4a8 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 d10010d1fa9f9..b4ff07102a673 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 3c3caf72355d3..9bbf83edd6985 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 0a808db45f245..3a91c9439218e 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 0e8084dbaff4b..b54c9224b6c19 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/cmake/sbeppcTargets.cmake b/recipes/sbepp/all/cmake/sbeppcTargets.cmake new file mode 100644 index 0000000000000..826e03f948da8 --- /dev/null +++ b/recipes/sbepp/all/cmake/sbeppcTargets.cmake @@ -0,0 +1,34 @@ +# mimicking flatbuffers/all/cmake/FlatcTargets.cmake +if(NOT TARGET sbepp::sbeppc) + if(CMAKE_CROSSCOMPILING) + find_program(SBEPP_SBEPPC_EXECUTABLE + NAMES sbeppc + PATHS ENV PATH + NO_DEFAULT_PATH + ) + else() + find_program(SBEPP_SBEPPC_EXECUTABLE + NAMES sbeppc + PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + NO_DEFAULT_PATH + ) + endif() + # TODO: In conan v2 with CMakeToolchain, can be replaced by: + # find_program(SBEPP_SBEPPC_EXECUTABLE NAMES sbeppc) + # # Nice enough to handle sbeppc not in build_requires for native build + # if(NOT SBEPP_SBEPPC_EXECUTABLE AND NOT CMAKE_CROSSCOMPILING) + # find_program(SBEPP_SBEPPC_EXECUTABLE + # NAMES flatc + # PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + # NO_DEFAULT_PATH + # ) + # endif() + + if(SBEPP_SBEPPC_EXECUTABLE) + get_filename_component( + SBEPP_SBEPPC_EXECUTABLE "${SBEPP_SBEPPC_EXECUTABLE}" ABSOLUTE) + add_executable(sbepp::sbeppc IMPORTED) + set_property(TARGET sbepp::sbeppc + PROPERTY IMPORTED_LOCATION ${SBEPP_SBEPPC_EXECUTABLE}) + endif() +endif() diff --git a/recipes/sbepp/all/conandata.yml b/recipes/sbepp/all/conandata.yml new file mode 100644 index 0000000000000..2993d854f596e --- /dev/null +++ b/recipes/sbepp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.2.0": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.2.0.tar.gz" + sha256: "068cb8bc940316f8817af8da5c8de577ab49281308b2125c30f2f4e00431a68a" + "1.1.0": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.1.0.tar.gz" + sha256: "a5787c7204a2509c8d1eb6c65f0143020d7c7ceadd4a53d2cb9a64dc4f6b9e9a" + "1.0.1": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.0.1.tar.gz" + sha256: "c8ee54df0ae670bd7508a48947da6c6987eeb72481f1ab8cc05b8d4d03aaec8b" diff --git a/recipes/sbepp/all/conanfile.py b/recipes/sbepp/all/conanfile.py new file mode 100644 index 0000000000000..f1cab17bf2649 --- /dev/null +++ b/recipes/sbepp/all/conanfile.py @@ -0,0 +1,136 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import 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 PackageConan(ConanFile): + name = "sbepp" + description = "C++ implementation of the FIX Simple Binary Encoding" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OleksandrKvl/sbepp" + topics = ("trading", "fix", "sbe") + settings = "os", "arch", "compiler", "build_type" + options = { + "with_sbeppc": [True, False] + } + default_options = { + "with_sbeppc": True + } + + @property + def _min_cppstd(self): + if self.options.with_sbeppc: + return 17 + else: + return 11 + + @property + def _compilers_minimum_version(self): + if self.options.with_sbeppc: + return { + "gcc": "9", + "clang": "9", + "apple-clang": "11" + } + else: + return { + "gcc": "4.8.1", + "clang": "3.3", + "apple-clang": "9.4" + } + + def export_sources(self): + copy(self, os.path.join("cmake", "sbeppcTargets.cmake"), + self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + if not self.info.options.with_sbeppc: + self.info.clear() + else: + del self.info.settings.compiler + + def requirements(self): + if self.options.with_sbeppc: + # 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.2.0") + self.requires("pugixml/1.14") + + 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): + tc = CMakeToolchain(self) + if not self.options.with_sbeppc: + tc.variables["SBEPP_BUILD_SBEPPC"] = False + + tc.generate() + + if self.options.with_sbeppc: + tc = CMakeDeps(self) + tc.generate() + + def build(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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "sbeppcTargets.cmake", + src=os.path.join(self.source_folder, os.pardir, "cmake"), + dst=os.path.join(self.package_folder, self._module_path)) + if Version(self.version) >= "1.2.0": + copy(self, "sbeppcHelpers.cmake", + src=os.path.join(self.source_folder, "cmake"), + dst=os.path.join(self.package_folder, self._module_path)) + + @property + def _module_path(self): + return os.path.join("lib", "cmake") + + def package_info(self): + # provide sbepp::sbeppc target and CMake helpers from sbeppcHelpers.cmake + build_modules = [ + os.path.join(self._module_path, "sbeppcTargets.cmake") + ] + if Version(self.version) >= "1.2.0": + build_modules.append(os.path.join(self._module_path, "sbeppcHelpers.cmake")) + + self.cpp_info.builddirs.append(self._module_path) + self.cpp_info.set_property("cmake_build_modules", build_modules) + + # TODO: to remove in conan v2 + if self.options.with_sbeppc: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/sbepp/all/test_package/CMakeLists.txt b/recipes/sbepp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..de42d2a9dbead --- /dev/null +++ b/recipes/sbepp/all/test_package/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(sbepp REQUIRED CONFIG) + +# test `sbepp::sbeppc` executable +if(TARGET sbepp::sbeppc) + set(sbeppc_test_name "test_sbeppc") + set(schema "test_schema") + set(schema_path "${CMAKE_CURRENT_LIST_DIR}/${schema}.xml") + + add_executable(${sbeppc_test_name}) + target_sources(${sbeppc_test_name} PRIVATE test_sbeppc.cpp) + target_compile_features(${sbeppc_test_name} PRIVATE cxx_std_11) + + # `sbeppc_compile_schema` was introduced only in `1.2.0` + if(SBEPP_VERSION VERSION_GREATER_EQUAL "1.2.0") + sbeppc_compile_schema( + TARGET_NAME compiled_schema + SCHEMA_FILE "${schema_path}" + ) + + target_link_libraries(${sbeppc_test_name} PRIVATE compiled_schema) + else() + set(output_file "${CMAKE_CURRENT_BINARY_DIR}/${schema}/${schema}.hpp") + + add_custom_command( + OUTPUT "${output_file}" + COMMAND $ "${schema_path}" + DEPENDS "${schema_path}" + ) + + add_custom_target(compile_schema DEPENDS "${output_file}") + add_dependencies(${sbeppc_test_name} compile_schema) + target_include_directories(${sbeppc_test_name} + SYSTEM PRIVATE + "${CMAKE_CURRENT_BINARY_DIR}" + ) + + target_link_libraries(${sbeppc_test_name} PRIVATE sbepp::sbepp) + endif() +endif() + +# test `sbepp::sbepp` header-only library +add_executable(${PROJECT_NAME}) +target_sources(${PROJECT_NAME} PRIVATE test_sbepp.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sbepp::sbepp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sbepp/all/test_package/conanfile.py b/recipes/sbepp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f673d7c44446b --- /dev/null +++ b/recipes/sbepp/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + + +# It will become the standard on Conan 2.x +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) + tc.variables["SBEPP_VERSION"] = self.dependencies["sbepp"].ref.version + 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/sbepp/all/test_package/test_sbepp.cpp b/recipes/sbepp/all/test_package/test_sbepp.cpp new file mode 100644 index 0000000000000..8d76c1e4c80fb --- /dev/null +++ b/recipes/sbepp/all/test_package/test_sbepp.cpp @@ -0,0 +1,16 @@ +#include + +#include + +enum class Enum +{ + A, + B +}; + +int main() +{ + auto underlying = sbepp::to_underlying(Enum::A); + + return EXIT_SUCCESS; +} diff --git a/recipes/sbepp/all/test_package/test_sbeppc.cpp b/recipes/sbepp/all/test_package/test_sbeppc.cpp new file mode 100644 index 0000000000000..a2cc1c925f8a5 --- /dev/null +++ b/recipes/sbepp/all/test_package/test_sbeppc.cpp @@ -0,0 +1,12 @@ +#include + +#include +#include + +int main(void) +{ + std::array buf{}; + auto msg = sbepp::make_view( + buf.data(), buf.size()); + return EXIT_SUCCESS; +} diff --git a/recipes/sbepp/all/test_package/test_schema.xml b/recipes/sbepp/all/test_package/test_schema.xml new file mode 100644 index 0000000000000..e3d30c765baa7 --- /dev/null +++ b/recipes/sbepp/all/test_package/test_schema.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes/sbepp/all/test_v1_package/CMakeLists.txt b/recipes/sbepp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/sbepp/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/sbepp/all/test_v1_package/conanfile.py b/recipes/sbepp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f15a1e8fcf232 --- /dev/null +++ b/recipes/sbepp/all/test_v1_package/conanfile.py @@ -0,0 +1,25 @@ +from conans import ConanFile, CMake +from conan.tools.cmake import CMakeToolchain +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SBEPP_VERSION"] = self.deps_cpp_info["sbepp"].version + tc.generate() + + 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/sbepp/config.yml b/recipes/sbepp/config.yml new file mode 100644 index 0000000000000..be97eb7c8428b --- /dev/null +++ b/recipes/sbepp/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2.0": + folder: all + "1.1.0": + folder: all + "1.0.1": + folder: all diff --git a/recipes/sbp/all/CMakeLists.txt b/recipes/sbp/all/CMakeLists.txt deleted file mode 100644 index 454b398b885e5..0000000000000 --- a/recipes/sbp/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/c") diff --git a/recipes/sbp/all/conandata.yml b/recipes/sbp/all/conandata.yml index f640026c27acb..517606eaacf88 100644 --- a/recipes/sbp/all/conandata.yml +++ b/recipes/sbp/all/conandata.yml @@ -1,15 +1,29 @@ sources: - "3.4.10": + "5.0.4": cmake: - url: "https://github.com/swift-nav/cmake/archive/373d4fcafbbc0c208dc9ecb278d36ed8c9448eda.zip" - sha256: 6077d2a754d013e3cb9826f589e47b19ab01f4d91ede4f5bfc14db74bc5dc894 + url: "https://github.com/swift-nav/cmake/archive/954e6cebe4c902d07d33beef166df89073a7b4f2.zip" + sha256: "910e14e35d02fd766bc885cfc9b99626006c12ef26d6446cfbf728862d7cebab" source: - url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v3.4.10.tar.gz" - sha256: f2fb738f49112b25e7849ca0c75415159127e9b5373b13e7027362b8fa0b1224 + url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v5.0.4.tar.gz" + sha256: "0b51707780dec08f24fac091b935e041d0d61abf2093562df829e85b9510d72b" + "4.15.0": + cmake: + url: "https://github.com/swift-nav/cmake/archive/12b7f037e7cc721a9a36c7342ba2ca2b0cafc01e.zip" + sha256: "6a725914bf8c3ed13065812cf4d7b0a69e478eaa150561e0e3be4cd01bf3798f" + source: + url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v4.15.0.tar.gz" + sha256: "e71fd7dd5536058d6b93ade443913e68da7b4f1896aa720dc369baab1864e9e9" "4.2.0": cmake: url: "https://github.com/swift-nav/cmake/archive/31604e72e72c09fa32effdbc37acc79dda7c99d7.zip" - sha256: 22e0ef6915ad5accfa6c0b30cb75a7d409ee1e08746f5ee92311015aa3826246 + sha256: "22e0ef6915ad5accfa6c0b30cb75a7d409ee1e08746f5ee92311015aa3826246" source: url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v4.2.0.tar.gz" - sha256: 9ee9808394867405938505fb0aa52ffeb8d98b7ce222e47629ffabdc9e23d3e4 + sha256: "9ee9808394867405938505fb0aa52ffeb8d98b7ce222e47629ffabdc9e23d3e4" + "3.4.10": + cmake: + url: "https://github.com/swift-nav/cmake/archive/373d4fcafbbc0c208dc9ecb278d36ed8c9448eda.zip" + sha256: "6077d2a754d013e3cb9826f589e47b19ab01f4d91ede4f5bfc14db74bc5dc894" + source: + url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v3.4.10.tar.gz" + sha256: "f2fb738f49112b25e7849ca0c75415159127e9b5373b13e7027362b8fa0b1224" diff --git a/recipes/sbp/all/conanfile.py b/recipes/sbp/all/conanfile.py index 77edf2fd79a3e..b94c371fc9b5b 100644 --- a/recipes/sbp/all/conanfile.py +++ b/recipes/sbp/all/conanfile.py @@ -1,27 +1,30 @@ 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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy + +required_conan_version = ">=1.53.0" class SbpConan(ConanFile): name = "sbp" + description = "Swift Binary Protocol client library" license = "MIT" - homepage = "https://github.com/swift-nav/libsbp" url = "https://github.com/conan-io/conan-center-index" - description = "Swift Binary Protocol client library" + homepage = "https://github.com/swift-nav/libsbp" topics = ("gnss",) - 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", "c" - - _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, + } def config_options(self): if self.settings.os == "Windows": @@ -29,41 +32,46 @@ 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 validate(self): if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Windows shared builds are not supported right now, see issue https://github.com/swift-nav/libsbp/issues/1062") + raise ConanInvalidConfiguration( + "Windows shared builds are not supported right now, " + "see issue https://github.com/swift-nav/libsbp/issues/1062" + ) + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): data = self.conan_data["sources"][self.version] + get(self, **data["source"], strip_root=True) + get(self, **data["cmake"], strip_root=True, destination=os.path.join("c", "cmake", "common")) - tools.get(**data["source"], strip_root=True, destination=self._source_subfolder) - tools.get(**data["cmake"], strip_root=True, destination=os.path.join(self._source_subfolder, "c", "cmake", "common")) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["libsbp_ENABLE_TESTS"] = False - self._cmake.definitions["libsbp_ENABLE_DOCS"] = False - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["libsbp_ENABLE_TESTS"] = False + tc.variables["libsbp_ENABLE_DOCS"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder="c") cmake.build() def package(self): - self.copy( - "LICENSE", - src=self._source_subfolder, - dst="licenses", - ignore_case=True, - keep_path=False, + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, ) - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/sbp/all/test_package/CMakeLists.txt b/recipes/sbp/all/test_package/CMakeLists.txt index d9693fa5cada2..6da47266b9454 100644 --- a/recipes/sbp/all/test_package/CMakeLists.txt +++ b/recipes/sbp/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(sbp REQUIRED CONFIG) diff --git a/recipes/sbp/all/test_package/conanfile.py b/recipes/sbp/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/sbp/all/test_package/conanfile.py +++ b/recipes/sbp/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/sbp/config.yml b/recipes/sbp/config.yml index 84cd65924d4fb..e2fec4a93304d 100644 --- a/recipes/sbp/config.yml +++ b/recipes/sbp/config.yml @@ -1,5 +1,9 @@ versions: - "3.4.10": + "5.0.4": + folder: "all" + "4.15.0": folder: "all" "4.2.0": folder: "all" + "3.4.10": + folder: "all" diff --git a/recipes/scdoc/all/conandata.yml b/recipes/scdoc/all/conandata.yml index 9859fdd9fbe4b..e10d90bd8274f 100644 --- a/recipes/scdoc/all/conandata.yml +++ b/recipes/scdoc/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "1.11.12": + "1.11.2": url: "https://git.sr.ht/~sircmpwn/scdoc/archive/1.11.2.tar.gz" sha256: "e9ff9981b5854301789a6778ee64ef1f6d1e5f4829a9dd3e58a9a63eacc2e6f0" diff --git a/recipes/scdoc/all/conanfile.py b/recipes/scdoc/all/conanfile.py index 511b322627676..648e2b1eff89f 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 4864f9fac5f47..3d9ce4cf8ad9b 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 0000000000000..4e046a6fb6265 --- /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/scdoc/config.yml b/recipes/scdoc/config.yml index 4e3c90e52dc99..68804c58d126a 100644 --- a/recipes/scdoc/config.yml +++ b/recipes/scdoc/config.yml @@ -1,3 +1,3 @@ versions: - "1.11.12": + "1.11.2": folder: all diff --git a/recipes/scip/all/conandata.yml b/recipes/scip/all/conandata.yml new file mode 100644 index 0000000000000..aacd6d1a319fe --- /dev/null +++ b/recipes/scip/all/conandata.yml @@ -0,0 +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 new file mode 100644 index 0000000000000..30a113fa5330e --- /dev/null +++ b/recipes/scip/all/conanfile.py @@ -0,0 +1,151 @@ +from conan import ConanFile +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 copy, get +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from os.path import join + +required_conan_version = ">=1.53.0" + + +class SCIPConan(ConanFile): + name = "scip" + description = "SCIP mixed integer (nonlinear) programming solver" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://scipopt.org/" + topics = ("mip", "solver", "linear", "programming") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_gmp": [True, False], + "with_tpi": [False, "omp", "tny"], + "with_sym": [False, "bliss"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_gmp": True, + "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): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "4", + "apple-clang": "7", + } + + 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.") + if self.options.shared and self.options.with_sym == "bliss": + raise ConanInvalidConfiguration("Bliss is not supported in shared mode.") + comp = self.settings.compiler + if self.options.with_sym == "bliss" and comp == 'clang' and comp.libcxx and comp.libcxx == 'libc++': + raise ConanInvalidConfiguration("Bliss does not support libc++.") + if self.dependencies["soplex"].options.with_gmp and not self.options.with_gmp: + raise ConanInvalidConfiguration("The options 'with_gmp' should be aligned with 'soplex:with_gmp' too.") + + 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 requirements(self): + if self.options.with_gmp: + self.requires("gmp/6.3.0") + if self.options.with_sym == "bliss": + self.requires("bliss/0.77") + 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 + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + @staticmethod + def _to_cmake(*arrays): + return ";".join(item.replace("\\", "/") for sublist in arrays for item in sublist) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SHARED"] = self.options.shared + tc.variables["READLINE"] = False # required for interactive stuff + tc.variables["GMP"] = self.options.with_gmp + tc.variables["TPI"] = self.options.with_tpi or "none" + tc.variables["LPS"] = "spx" + tc.variables["SYM"] = self.options.with_sym or "none" + tc.variables["SOPLEX_INCLUDE_DIRS"] = self._to_cmake(self.dependencies["soplex"].cpp_info.includedirs) + if self.options.shared: + # CMakeLists accesses different variables for SoPlex depending on the SHARED option + tc.variables["SOPLEX_PIC_LIBRARIES"] = "soplex" + if self.dependencies["soplex"].options.with_boost: + # INFO: docu states BOOST_ROOT, yet that does not exist in CMakeLists + tc.variables["SOPLEX_INCLUDE_DIRS"] = self._to_cmake( + self.dependencies["soplex"].cpp_info.includedirs, + self.dependencies["boost"].cpp_info.includedirs + ) + tc.variables["PAPILO"] = False # LGPL + tc.variables["ZIMPL"] = False # LPGL + tc.variables["IPOPT"] = False # no such coin package on conan center yet + tc.generate() + deps = CMakeDeps(self) + deps.set_property("sopex", "cmake_file_name", "SOPEX") + deps.set_property("gmp", "cmake_file_name", "GMP") + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build(target="libscip") + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=join(self.package_folder, "licenses")) + # cmake install is not used as this requires the command line tools to be built, which we do not do + copy(self, pattern="*.h", src=join(self.source_folder, "src"), dst=join(self.package_folder, "include")) + copy(self, pattern="*.h", src=join(self.build_folder, "scip"), dst=join(self.package_folder, "include", "scip")) + 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")) + 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="*.lib", src=self.build_folder, dst=join(self.package_folder, "lib"), keep_path=False) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["libscip" if is_msvc(self) else "scip"] + if self.options.with_tpi == "omp": + self.cpp_info.system_libs.append("-fopenmp") diff --git a/recipes/scip/all/test_package/CMakeLists.txt b/recipes/scip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a3b0a4eba8335 --- /dev/null +++ b/recipes/scip/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 14) + +find_package(scip REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE scip::scip) diff --git a/recipes/scip/all/test_package/conanfile.py b/recipes/scip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/scip/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/scip/all/test_package/test_package.cpp b/recipes/scip/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..36b9c1c15a47d --- /dev/null +++ b/recipes/scip/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include "scip/scip.h" + + +int main() { + SCIP* scip; + SCIPcreate(&scip); + SCIPprintVersion(scip, NULL); + SCIPinfoMessage(scip, NULL, "\n"); + return EXIT_SUCCESS; +} diff --git a/recipes/scip/config.yml b/recipes/scip/config.yml new file mode 100644 index 0000000000000..f70b85bc6cf44 --- /dev/null +++ b/recipes/scip/config.yml @@ -0,0 +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 0000000000000..88b2816d64354 --- /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 0000000000000..77b8d49bdb43c --- /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 0000000000000..877c0c21bd3c0 --- /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 0000000000000..8a5bb47f50c4c --- /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 0000000000000..5244632b87e16 --- /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 0000000000000..a59308932f1d8 --- /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 3a41a75a21f73..fc615b57c8109 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 67178e9a18b6c..3760576fb6438 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/4.0.0") + self.requires("fast_float/6.0.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 0000000000000..97cf567063d67 --- /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 0000000000000..5a50483b54c0f --- /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 0000000000000..1b34af4ceeb25 --- /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 7205ca311ab8d..3305d97b32797 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/scons/all/conandata.yml b/recipes/scons/all/conandata.yml index 5c49097cbf659..5a281fd5282bb 100644 --- a/recipes/scons/all/conandata.yml +++ b/recipes/scons/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.6.0": + url: "http://prdownloads.sourceforge.net/scons/SCons-4.6.0.tar.gz" + sha256: "7db28958b188b800f803c287d0680cc3ac7c422ed0b1cf9895042c52567803ec" "4.3.0": url: "http://prdownloads.sourceforge.net/scons/SCons-4.3.0.tar.gz" sha256: "2efc81754a4491299c0c64a6230715dfe33f7a3a42a0834a4ce1756af117bdec" diff --git a/recipes/scons/all/conanfile.py b/recipes/scons/all/conanfile.py index f52d4fa5ffabe..c3cafc92f9e09 100644 --- a/recipes/scons/all/conanfile.py +++ b/recipes/scons/all/conanfile.py @@ -1,4 +1,6 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import copy, get, save +from conan.tools.scm import Version import os import shutil import textwrap @@ -11,17 +13,17 @@ class SConsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index/" homepage = "https://scons.org" topics = ("scons", "build", "configuration", "development") - settings = "os" # Added to let the CI test this package on all os'es + settings = "os" + package_type = "application" + no_copy_source = True + short_paths = True - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + self.folders.source = "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, destination=self.source_folder) def _chmod_x(self, path): if os.name == "posix": @@ -36,19 +38,19 @@ def _scons_cmd(self): return os.path.join(self.package_folder, "bin", "scons.cmd") def package_id(self): - self.info.header_only() + self.info.clear() 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 tools.Version(self.version) < 4: - shutil.copytree(os.path.join(self._source_subfolder, "engine", "SCons"), + if Version(self.version) < 4: + shutil.copytree(os.path.join(self.source_folder, "engine", "SCons"), os.path.join(self.package_folder, "res", "SCons")) else: - shutil.copytree(os.path.join(self._source_subfolder, "SCons"), + shutil.copytree(os.path.join(self.source_folder, "SCons"), os.path.join(self.package_folder, "res", "SCons")) - tools.save(self._scons_sh, textwrap.dedent("""\ + save(self, self._scons_sh, textwrap.dedent("""\ #!/bin/sh realpath() ( @@ -70,7 +72,7 @@ def package(self): exec ${PYTHON:-python3} "$currentdir/../res/SCons/__main__.py" "$@" """)) self._chmod_x(self._scons_sh) - tools.save(self._scons_cmd, textwrap.dedent(r""" + save(self, self._scons_cmd, textwrap.dedent(r""" @echo off set currentdir=%~dp0 if not defined PYTHON ( @@ -80,18 +82,14 @@ def package(self): CALL %PYTHON% %currentdir%\\..\\res\\SCons\\__main__.py %* """)) - # Mislead CI and create an empty header in the include directory - include_dir = os.path.join(self.package_folder, "include") - os.mkdir(include_dir) - tools.save(os.path.join(include_dir, "__nop.h"), "") - def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] self._chmod_x(self._scons_sh) - bindir = os.path.join(self.package_folder, "bin") + + # For Conan 1.x downstream consumers, can be removed once recipe is Conan 2.x only: self.output.info("Appending PATH environment var: {}".format(bindir)) self.env_info.PATH.append(bindir) diff --git a/recipes/scons/all/test_package/SConscript b/recipes/scons/all/test_package/SConscript index 4292c616da88f..d87b9971cdc64 100644 --- a/recipes/scons/all/test_package/SConscript +++ b/recipes/scons/all/test_package/SConscript @@ -3,15 +3,6 @@ import os env = Environment() -conan = SConscript("SConscript_conan") -if not conan: - print("File `SConscript_conan` is missing.") - print("It should be generated by running `conan install`.") - sys.exit(1) - -flags = conan["conan"] -env.MergeFlags(flags) - print("CC is: {}".format(env.subst('$CC'))) test_package = env.Program(["test_package.c"]) diff --git a/recipes/scons/all/test_package/SConstruct b/recipes/scons/all/test_package/SConstruct index a01f66f16099c..ef39d8e2323d3 100644 --- a/recipes/scons/all/test_package/SConstruct +++ b/recipes/scons/all/test_package/SConstruct @@ -2,5 +2,6 @@ import os SConsignFile(os.path.join(GetLaunchDir(), "db")) SConscript('SConscript', - variant_dir=GetLaunchDir(), + build_dir='build', + src='.', duplicate=False) diff --git a/recipes/scons/all/test_package/conanfile.py b/recipes/scons/all/test_package/conanfile.py index 315bdaa33b945..ae2a5c9cf4727 100644 --- a/recipes/scons/all/test_package/conanfile.py +++ b/recipes/scons/all/test_package/conanfile.py @@ -1,43 +1,37 @@ -from conans import ConanFile, tools -from conans.errors import ConanException +from conan import ConanFile +from conan.tools.build import build_jobs, cross_building +from conan.tools.layout import basic_layout from io import StringIO import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "scons" + generators = "VirtualBuildEnv" + test_type = "explicit" - def build(self): - scons_path = self.deps_user_info["scons"].scons - if not scons_path: - raise ConanException("scons could not be found") - if not scons_path.replace("\\", "/").startswith(self.deps_cpp_info["scons"].rootpath.replace("\\", "/")): - raise ConanException("an external scons was found") + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + def layout(self): + basic_layout(self) + + def build(self): output = StringIO() - self.run("{} --version".format(scons_path), run_environment=True, output=output, ignore_errors=True) - self.output.info("output: %s" % output.getvalue()) - output = StringIO() - self.run("{} --version".format(scons_path), run_environment=True, output=output) - text = output.getvalue() - if self.deps_cpp_info["scons"].version not in text: - raise ConanException("scons --version does not return correct version") + self.run("scons --version", output) + self.output.info(output.getvalue()) + assert("SCons by Steven Knight" in output.getvalue()) scons_args = [ - "-j", str(tools.cpu_count()), + "-j", str(build_jobs(self)), "-C", self.source_folder, "-f", os.path.join(self.source_folder, "SConstruct"), ] - self.run("scons {}".format(" ".join(scons_args)), run_environment=True) + self.run("scons {}".format(" ".join(scons_args))) def test(self): - from io import StringIO - - if not tools.cross_building(self): - bin_path = os.path.join(".", "test_package") - output = StringIO() - self.run(bin_path, run_environment=True, ignore_errors=True, output=output) - self.output.info("output: %s" % output.getvalue()) - self.run(bin_path, run_environment=True) + if not cross_building(self): + # Scons build put executable righe here + bin_path = os.path.join(self.recipe_folder, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/scons/config.yml b/recipes/scons/config.yml index 26cb9a182f8d1..39ec99bde0cb3 100644 --- a/recipes/scons/config.yml +++ b/recipes/scons/config.yml @@ -1,4 +1,6 @@ versions: + "4.6.0": + folder: all "4.3.0": folder: all "4.2.0": diff --git a/recipes/screen_capture_lite/all/conandata.yml b/recipes/screen_capture_lite/all/conandata.yml index 87497fb96911b..7bc7e84245c17 100644 --- a/recipes/screen_capture_lite/all/conandata.yml +++ b/recipes/screen_capture_lite/all/conandata.yml @@ -1,4 +1,10 @@ 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" "17.1.1173": url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.1173.tar.gz" sha256: "17875fb58f0e5920b13b6ef2516c8e973055347339d3dbaabfa97ef448fdfff2" diff --git a/recipes/screen_capture_lite/config.yml b/recipes/screen_capture_lite/config.yml index 863f787460bb7..d2022be0c81a1 100644 --- a/recipes/screen_capture_lite/config.yml +++ b/recipes/screen_capture_lite/config.yml @@ -1,4 +1,8 @@ versions: + "17.1.1369": + folder: "all" + "17.1.1327": + folder: "all" "17.1.1173": folder: "all" "17.1.613": diff --git a/recipes/sdbus-cpp/all/conandata.yml b/recipes/sdbus-cpp/all/conandata.yml index 4c4e5beb4bad0..ac3e9f3df9188 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 b93c27ec1b918..1f8bc66668fef 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 5ce2acc54a189..8706e3310f0bf 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 5daabc3db91f3..47a93884e54ef 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 027c0dc56075d..a48eafa88431d 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 091076bcd4337..5542cc7bb105c 100644 --- a/recipes/sdl/all/conandata.yml +++ b/recipes/sdl/all/conandata.yml @@ -1,4 +1,16 @@ 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" "2.26.1": url: "https://www.libsdl.org/release/SDL2-2.26.1.tar.gz" sha256: "02537cc7ebd74071631038b237ec4bfbb3f4830ba019e569434da33f42373e04" diff --git a/recipes/sdl/all/conanfile.py b/recipes/sdl/all/conanfile.py index 6d8d882403cbd..03ff0430a22b1 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 211e5780e8908..e05c00ea2969e 100644 --- a/recipes/sdl/config.yml +++ b/recipes/sdl/config.yml @@ -1,4 +1,12 @@ versions: + "2.28.5": + folder: all + "2.28.3": + folder: all + "2.28.2": + folder: all + "2.26.5": + folder: all "2.26.1": folder: all "2.26.0": diff --git a/recipes/sdl_image/all/conandata.yml b/recipes/sdl_image/all/conandata.yml index bc34556c048dd..0444df801e1ac 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 2bb32465a9dea..bca15363d987d 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.1", transitive_headers=True) + self.requires("sdl/2.28.3", transitive_headers=True) if self.options.with_libtiff: - self.requires("libtiff/4.4.0") + 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.39") + self.requires("libpng/1.6.40") if self.options.with_libwebp: - self.requires("libwebp/1.3.0") + 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 1630e08ca5f32..53a0b9c216274 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 c899c658f21bc..ce2f6091ea9cd 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 2337a1a3efdef..221605e46a6cf 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 744f9cf00c80f..3a507f665d331 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/conandata.yml b/recipes/sdl_ttf/all/conandata.yml index ac34ee3b6fceb..556b69cb6d777 100644 --- a/recipes/sdl_ttf/all/conandata.yml +++ b/recipes/sdl_ttf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.20.2": + url: "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.2/SDL2_ttf-2.20.2.tar.gz" + sha256: "9dc71ed93487521b107a2c4a9ca6bf43fb62f6bddd5c26b055e6b91418a22053" "2.20.1": url: "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.1/SDL2_ttf-2.20.1.tar.gz" sha256: "78cdad51f3cc3ada6932b1bb6e914b33798ab970a1e817763f22ddbfd97d0c57" @@ -13,6 +16,10 @@ patches: - patch_file: "patches/2.20.1-0001-fix-cmake-min-version.patch" patch_description: "Disable useless .pc file install to avoid relying on CMake 3.21 features" patch_type: "conan" + - patch_file: "patches/2.20.1-0002-remove-unsupported-property.patch" + patch_description: "remove DEPRECATION property is available on CMake 3.17+ (Linux C3i is 3.15 and the Conan min)" + patch_type: "portability" + patch_source: "https://github.com/libsdl-org/SDL_ttf/commit/e49b6030bd57b7aa3f0e4e42cb7ccc5fee876184" "2.0.18": - patch_file: "patches/2.0.18-0001-cmake-fix-link-target.patch" patch_description: "correct target name, disable PIC fixed" diff --git a/recipes/sdl_ttf/all/conanfile.py b/recipes/sdl_ttf/all/conanfile.py index 984ebd5896713..3fb325e526385 100644 --- a/recipes/sdl_ttf/all/conanfile.py +++ b/recipes/sdl_ttf/all/conanfile.py @@ -1,5 +1,6 @@ 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 apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save from conan.tools.microsoft import is_msvc @@ -50,10 +51,11 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.12.1") - self.requires("sdl/2.26.1") + self.requires("freetype/2.13.2") + # https://github.com/conan-io/conan-center-index/pull/18366#issuecomment-1625464996 + 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: @@ -121,6 +123,10 @@ def package_info(self): self.cpp_info.components["_sdl2_ttf"].requires = ["freetype::freetype", "sdl::libsdl2"] if self.options.get_safe("with_harfbuzz"): self.cpp_info.components["_sdl2_ttf"].requires.append("harfbuzz::harfbuzz") + if Version(self.version) <= "2.0.18" and is_apple_os(self) and self.options.shared: + self.cpp_info.components["_sdl2_ttf"].frameworks = [ + "AppKit", "CoreGraphics", "CoreFoundation", "CoreServices" + ] # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "SDL2_ttf" diff --git a/recipes/sdl_ttf/all/patches/2.20.1-0002-remove-unsupported-property.patch b/recipes/sdl_ttf/all/patches/2.20.1-0002-remove-unsupported-property.patch new file mode 100644 index 0000000000000..b1c27e03bcce2 --- /dev/null +++ b/recipes/sdl_ttf/all/patches/2.20.1-0002-remove-unsupported-property.patch @@ -0,0 +1,25 @@ +From e49b6030bd57b7aa3f0e4e42cb7ccc5fee876184 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Sat, 23 Jul 2022 17:28:28 +0200 +Subject: [PATCH] cmake: DEPRECATION property is available on CMake 3.17+ + +--- + CMakeLists.txt | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ebbe692d..64854ad3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -401,6 +401,9 @@ endif() + add_library(SDL2::ttf INTERFACE IMPORTED GLOBAL) + set_target_properties(SDL2::ttf PROPERTIES + INTERFACE_LINK_LIBRARIES "SDL2_ttf" +- DEPRECATION "Use SDL2_ttf::SDL2_ttf or SDL2_ttf::SDL2_ttf-static instead" + ) +- ++if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.17") ++ set_target_properties(SDL2::ttf PROPERTIES ++ DEPRECATION "Use SDL2_ttf::SDL2_ttf or SDL2_ttf::SDL2_ttf-static instead" ++ ) ++endif() diff --git a/recipes/sdl_ttf/config.yml b/recipes/sdl_ttf/config.yml index 0db264b704044..be62a6c021ae5 100644 --- a/recipes/sdl_ttf/config.yml +++ b/recipes/sdl_ttf/config.yml @@ -1,4 +1,6 @@ versions: + "2.20.2": + folder: all "2.20.1": folder: all "2.0.18": diff --git a/recipes/seadex-essentials/all/conanfile.py b/recipes/seadex-essentials/all/conanfile.py index e938a5f24cf68..118460968da91 100644 --- a/recipes/seadex-essentials/all/conanfile.py +++ b/recipes/seadex-essentials/all/conanfile.py @@ -39,7 +39,7 @@ def _compilers_minimum_version(self): "Visual Studio": "16", "msvc": "192", "apple-clang": "10" - } + } def config_options(self): if self.settings.os == "Windows": @@ -48,14 +48,12 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - self.options["fmt/*"].header_only = True - self.options["spdlog/*"].header_only = True 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/9.1.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/conandata.yml b/recipes/seadex-genesis/all/conandata.yml new file mode 100644 index 0000000000000..176a61239e9e8 --- /dev/null +++ b/recipes/seadex-genesis/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "2.0.0": + url: + - "https://github.com/SeadexGmbH/genesis/archive/refs/tags/2.0.0.tar.gz" + sha256: "22bd4e438c1475d7b023d6f8f7d541f49f55784c89e8607acc68a73157bb4ea4" diff --git a/recipes/seadex-genesis/all/conanfile.py b/recipes/seadex-genesis/all/conanfile.py new file mode 100644 index 0000000000000..2328e60870392 --- /dev/null +++ b/recipes/seadex-genesis/all/conanfile.py @@ -0,0 +1,92 @@ +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 +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 SeadexGenesisConan(ConanFile): + name = "seadex-genesis" + description = "genesis is a generator library developed by Seadex (written in C++11)." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://genesis.seadex.de/" + topics = ("generator", "c++") + 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.3", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + "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 requirements(self): + # Exposes headers and symbols: https://github.com/SeadexGmbH/genesis/blob/master/genesis/source/version.cpp + 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): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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, 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." + ) + 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 generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["GEN_BUILD_EXAMPLES"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", self.source_folder, os.path.join(self.package_folder, "licenses") ) + cmake = CMake(self) + cmake.configure() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["genesis"] diff --git a/recipes/seadex-genesis/all/test_package/CMakeLists.txt b/recipes/seadex-genesis/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..028f0b497eb5e --- /dev/null +++ b/recipes/seadex-genesis/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(seadex-genesis REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PUBLIC seadex-genesis::seadex-genesis) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/seadex-genesis/all/test_package/conanfile.py b/recipes/seadex-genesis/all/test_package/conanfile.py new file mode 100644 index 0000000000000..63dab6b31486d --- /dev/null +++ b/recipes/seadex-genesis/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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() + 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/seadex-genesis/all/test_package/test_package.cpp b/recipes/seadex-genesis/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..48dc86c10dbd5 --- /dev/null +++ b/recipes/seadex-genesis/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include "genesis/grammar.hpp" + + +int main() { + + std::cout<< sx::genesis::LOOP_START_COMMAND << " test " << sx::genesis::LOOP_END_COMMAND << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/seadex-genesis/all/test_v1_package/CMakeLists.txt b/recipes/seadex-genesis/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/seadex-genesis/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/seadex-genesis/all/test_v1_package/conanfile.py b/recipes/seadex-genesis/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/seadex-genesis/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +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/seadex-genesis/config.yml b/recipes/seadex-genesis/config.yml new file mode 100644 index 0000000000000..d77ad03cbf510 --- /dev/null +++ b/recipes/seadex-genesis/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.0": + folder: all diff --git a/recipes/seasocks/all/conandata.yml b/recipes/seasocks/all/conandata.yml index 8ea105850a8ba..412d4f0b76fdd 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 5a35a2a904c83..1662f1e11775f 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 bcda68af0d12d..b2a6b234212ab 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 21ccf617970ea..2687fcfc48fd4 100644 --- a/recipes/sentry-breakpad/all/conandata.yml +++ b/recipes/sentry-breakpad/all/conandata.yml @@ -1,16 +1,62 @@ sources: - "0.6.2": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.2/sentry-native.zip" - sha256: "9b9f4b2cec961ca132039c7887fb876b3dd6f4795b31ca01d188187f69758efa" - "0.6.1": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" - sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" - "0.6.0": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.0/sentry-native.zip" - sha256: "ae03c9c8487794cd0f6d7fb7bb9b3c13e1a253190b290eaf752e2b4f007fd089" + "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.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" "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 a7d5646c8989e..8e95117df3a32 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 0000000000000..a573e142644bb --- /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 0000000000000..2956814e8f096 --- /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 0000000000000..f97256dfd7ea1 --- /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 0000000000000..4af6201d0565f --- /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 0000000000000..5134a67b8fcd0 --- /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 0000000000000..e71cb09fcd187 --- /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 ad98cc168c24b..8cff93402e6c4 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-breakpad/config.yml b/recipes/sentry-breakpad/config.yml index 2e0e20ffce3ff..3450228c14b09 100644 --- a/recipes/sentry-breakpad/config.yml +++ b/recipes/sentry-breakpad/config.yml @@ -1,9 +1,9 @@ versions: - "0.6.2": + "0.6.5": folder: all - "0.6.1": + "0.6.4": folder: all - "0.6.0": + "0.6.3": folder: all "0.5.4": folder: all diff --git a/recipes/sentry-crashpad/all/conandata.yml b/recipes/sentry-crashpad/all/conandata.yml index 2bf59ee52fc8f..26aa302e7bd27 100644 --- a/recipes/sentry-crashpad/all/conandata.yml +++ b/recipes/sentry-crashpad/all/conandata.yml @@ -1,13 +1,23 @@ sources: - "0.6.1": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" - sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" - "0.6.0": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.0/sentry-native.zip" - sha256: "ae03c9c8487794cd0f6d7fb7bb9b3c13e1a253190b290eaf752e2b4f007fd089" + "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.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" "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 cd2118a3e0d3c..b18eacff4f64c 100644 --- a/recipes/sentry-crashpad/all/conanfile.py +++ b/recipes/sentry-crashpad/all/conanfile.py @@ -8,7 +8,7 @@ import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.53.0" class SentryCrashpadConan(ConanFile): @@ -18,9 +18,8 @@ class SentryCrashpadConan(ConanFile): homepage = "https://github.com/getsentry/sentry-native" license = "Apache-2.0" topics = ("crashpad", "error-reporting", "crash-reporting") - provides = "crashpad", "mini_chromium" - + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -41,6 +40,7 @@ def _is_mingw(self): def _minimum_compilers_version(self): return { "Visual Studio": "16", + "msvc": "191", "gcc": "6", "clang": "3.4", "apple-clang": "5.1", @@ -60,11 +60,11 @@ 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/7.87.0") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.get_safe("with_tls"): - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -144,6 +144,7 @@ def package_info(self): self.cpp_info.components["crashpad_util"].requires = ["crashpad_compat", "crashpad_mini_chromium", "zlib::zlib"] if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.components["crashpad_util"].system_libs.extend(["pthread", "rt"]) + # Requires libcurl https://github.com/getsentry/crashpad/blob/2237d97ee2c38c930c07001e660be57324f69a37/util/CMakeLists.txt#L256 self.cpp_info.components["crashpad_util"].requires.extend(["libcurl::libcurl"]) elif self.settings.os == "Windows": self.cpp_info.components["crashpad_util"].system_libs.append("winhttp") 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 4f57a94cccd7d..0000000000000 --- 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 0000000000000..b3a766009b3a7 --- /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-crashpad/all/test_package/CMakeLists.txt b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt index a9feb3cd284f7..f90e3b77e86ad 100644 --- a/recipes/sentry-crashpad/all/test_package/CMakeLists.txt +++ b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt @@ -4,6 +4,10 @@ project(test_package CXX) find_package(crashpad REQUIRED CONFIG) +if(HAS_PROXY) + add_compile_definitions(HAS_PROXY) +endif() + add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE crashpad::client) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/sentry-crashpad/all/test_package/conanfile.py b/recipes/sentry-crashpad/all/test_package/conanfile.py index 3a9d92c6be51d..7088406970539 100644 --- a/recipes/sentry-crashpad/all/test_package/conanfile.py +++ b/recipes/sentry-crashpad/all/test_package/conanfile.py @@ -1,13 +1,14 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.files import mkdir -from conan.tools.cmake import cmake_layout, CMake +from conan.tools.files import mkdir, save, load +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.scm import Version import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def requirements(self): @@ -16,6 +17,14 @@ def requirements(self): def layout(self): cmake_layout(self) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["HAS_PROXY"] = Version(self.dependencies[self.tested_reference_str].ref.version) > "0.6.2" + tc.generate() + handler_exe = "crashpad_handler.exe" if self.settings.os == "Windows" else "crashpad_handler" + handler_bin_path = os.path.join(self.dependencies[self.tested_reference_str].package_folder, "bin", handler_exe) + save(self, os.path.join(self.build_folder, "handler_bin_path"), handler_bin_path) + def build(self): cmake = CMake(self) cmake.configure() @@ -26,6 +35,5 @@ def test(self): test_env_dir = "test_env" mkdir(self, test_env_dir) bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - handler_exe = "crashpad_handler.exe" if self.settings.os == "Windows" else "crashpad_handler" - handler_bin_path = os.path.join(self.deps_cpp_info["sentry-crashpad"].bin_paths[0], handler_exe) - self.run(f"{bin_path} {test_env_dir} {handler_bin_path}", run_environment=True) + handler_bin_path = load(self, os.path.join(self.build_folder, "handler_bin_path")) + self.run(f"{bin_path} {test_env_dir} {handler_bin_path}", env="conanrun") diff --git a/recipes/sentry-crashpad/all/test_package/test_package.cpp b/recipes/sentry-crashpad/all/test_package/test_package.cpp index 8f5ca824f1a03..e968f17053dfa 100644 --- a/recipes/sentry-crashpad/all/test_package/test_package.cpp +++ b/recipes/sentry-crashpad/all/test_package/test_package.cpp @@ -21,6 +21,9 @@ bool startCrashpad(const base::FilePath &db, db, db, url, +#ifdef HAS_PROXY + "", +#endif annotations, arguments, true, diff --git a/recipes/sentry-crashpad/all/test_v1_package/conanfile.py b/recipes/sentry-crashpad/all/test_v1_package/conanfile.py index 07143b37b946f..62bd626cd935e 100644 --- a/recipes/sentry-crashpad/all/test_v1_package/conanfile.py +++ b/recipes/sentry-crashpad/all/test_v1_package/conanfile.py @@ -1,6 +1,7 @@ from conans import ConanFile, CMake from conan.tools.build import cross_building from conan.tools.files import mkdir +from conan.tools.scm import Version import os @@ -10,6 +11,7 @@ class TestPackageV1Conan(ConanFile): def build(self): cmake = CMake(self) + cmake.definitions["HAS_PROXY"] = Version(self.deps_cpp_info["sentry-crashpad"].version) > "0.6.2" cmake.configure() cmake.build() diff --git a/recipes/sentry-crashpad/config.yml b/recipes/sentry-crashpad/config.yml index ea4872076354c..3450228c14b09 100644 --- a/recipes/sentry-crashpad/config.yml +++ b/recipes/sentry-crashpad/config.yml @@ -1,7 +1,9 @@ versions: - "0.6.1": + "0.6.5": folder: all - "0.6.0": + "0.6.4": + folder: all + "0.6.3": folder: all "0.5.4": folder: all diff --git a/recipes/sentry-native/all/conandata.yml b/recipes/sentry-native/all/conandata.yml index 29cda14cad1e6..26aa302e7bd27 100644 --- a/recipes/sentry-native/all/conandata.yml +++ b/recipes/sentry-native/all/conandata.yml @@ -1,19 +1,23 @@ sources: - "0.6.1": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" - sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" - "0.6.0": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.0/sentry-native.zip" - sha256: "ae03c9c8487794cd0f6d7fb7bb9b3c13e1a253190b290eaf752e2b4f007fd089" + "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.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" "0.4.18": url: "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip" sha256: "41fdf6499cd8576142beb03104badcc9e0b80b8ef27080ca71cd4408cc1d7ece" + patches: - "0.6.0": - - patch_file: "patches/sentry-native-903c17a.patch" - patch_description: "Make it possible to build with support for the crashpad WER module while using the sentry-crashpad package" - patch_type: "official" - patch_source: "https://github.com/getsentry/sentry-native/pull/816" + "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-native/all/conanfile.py b/recipes/sentry-native/all/conanfile.py index 888d98c0fe1ef..8964b109c4ad8 100644 --- a/recipes/sentry-native/all/conanfile.py +++ b/recipes/sentry-native/all/conanfile.py @@ -4,8 +4,8 @@ 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, export_conandata_patches, apply_conandata_patches -from conan.tools.gnu import PkgConfigDeps +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -33,6 +33,7 @@ class SentryNativeConan(ConanFile): "transport": ["none", "curl", "winhttp"], "qt": [True, False], "with_crashpad": ["google", "sentry"], + "crashpad_with_tls": ["openssl", False], "with_breakpad": ["google", "sentry"], "wer" : [True, False], } @@ -43,20 +44,28 @@ class SentryNativeConan(ConanFile): "transport": "curl", # overwritten in config_options "qt": False, "with_crashpad": "sentry", + "crashpad_with_tls": "openssl", "with_breakpad": "sentry", "wer": False } @property def _min_cppstd(self): + if is_msvc(self): + return "17" + if self.options.get_safe("backend") == "breakpad" and Version(self.version) >= "0.5.4": + return 17 return "14" @property def _minimum_compilers_version(self): + minimum_gcc_version = "5" + if self.options.get_safe("backend") == "breakpad": + minimum_gcc_version = "7" return { "Visual Studio": "15", "msvc": "191", - "gcc": "5", + "gcc": minimum_gcc_version, "clang": "3.4", "apple-clang": "5.1", } @@ -89,6 +98,8 @@ def config_options(self): self.options.backend = "inproc" else: self.options.backend = "inproc" + if self.settings.os not in ("Linux", "Android") or self.options.backend != "crashpad" or self.options.with_crashpad != "sentry": + del self.options.crashpad_with_tls def configure(self): if self.options.shared: @@ -103,20 +114,22 @@ def layout(self): def requirements(self): if self.options.transport == "curl": - self.requires("libcurl/7.87.0") + 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}") if self.options.with_crashpad == "google": self.requires("crashpad/cci.20220219") + else: + self.requires("zlib/[>=1.2.11 <2]") + if self.settings.os in ("Linux", "FreeBSD"): + self.requires("libcurl/[>=7.78.0 <9]") + if self.options.get_safe("crashpad_with_tls"): + self.requires("openssl/[>=1.1 <4]") elif self.options.backend == "breakpad": - if self.options.with_breakpad == "sentry": - self.requires(f"sentry-breakpad/{self.version}") if self.options.with_breakpad == "google": self.requires("breakpad/cci.20210521") if self.options.get_safe("qt"): - self.requires("qt/5.15.8") - self.requires("openssl/1.1.1t") + self.requires("qt/5.15.11") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -132,23 +145,9 @@ def validate(self): if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "10.0": raise ConanInvalidConfiguration("apple-clang < 10.0 not supported") - def _cmake_new_enough(self, required_version): - try: - import re - from io import StringIO - output = StringIO() - self.run("cmake --version", output) - m = re.search(r"cmake version (\d+\.\d+\.\d+)", output.getvalue()) - return Version(m.group(1)) >= required_version - except: - return False - def build_requirements(self): - if self.settings.os == "Windows" and not self._cmake_new_enough("3.16.4"): - self.tool_requires("cmake/3.25.2") - if self.options.backend == "breakpad": - if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + if self.settings.os == "Windows": + self.tool_requires("cmake/[>=3.16.4 <4]") def source(self): get(self, **self.conan_data["sources"][self.version]) @@ -157,18 +156,20 @@ def generate(self): VirtualBuildEnv(self).generate() tc = CMakeToolchain(self) tc.variables["SENTRY_BACKEND"] = self.options.backend - tc.variables["SENTRY_CRASHPAD_SYSTEM"] = True - tc.variables["SENTRY_BREAKPAD_SYSTEM"] = True + if self.options.backend == "crashpad": + tc.variables["SENTRY_CRASHPAD_SYSTEM"] = self.options.with_crashpad == "google" + if self.options.backend == "breakpad": + tc.variables["SENTRY_BREAKPAD_SYSTEM"] = self.options.with_breakpad == "google" tc.variables["SENTRY_ENABLE_INSTALL"] = True tc.variables["SENTRY_TRANSPORT"] = self.options.transport tc.variables["SENTRY_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["SENTRY_BUILD_TESTS"] = False + tc.variables["SENTRY_BUILD_EXAMPLES"] = False tc.variables["SENTRY_INTEGRATION_QT"] = self.options.qt if self.options.get_safe("wer", False): tc.variables["CRASHPAD_WER_ENABLED"] = True tc.generate() CMakeDeps(self).generate() - if self.options.backend == "breakpad": - PkgConfigDeps(self).generate() def build(self): apply_conandata_patches(self) @@ -185,24 +186,148 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "sentry") - self.cpp_info.set_property("cmake_target_name", "sentry::sentry") - self.cpp_info.libs = ["sentry"] + + self.cpp_info.components["sentry"].set_property("cmake_target_name", "sentry::sentry") + self.cpp_info.components["sentry"].libs = ["sentry"] + if self.settings.os in ("Android", "FreeBSD", "Linux"): - self.cpp_info.exelinkflags = ["-Wl,-E,--build-id=sha1"] - self.cpp_info.sharedlinkflags = ["-Wl,-E,--build-id=sha1"] + self.cpp_info.components["sentry"].exelinkflags = ["-Wl,-E,--build-id=sha1"] + self.cpp_info.components["sentry"].sharedlinkflags = ["-Wl,-E,--build-id=sha1"] if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.system_libs = ["pthread", "dl"] + self.cpp_info.components["sentry"].system_libs = ["pthread", "dl"] elif is_apple_os(self): - self.cpp_info.frameworks = ["CoreGraphics", "CoreText"] + self.cpp_info.components["sentry"].frameworks = ["CoreGraphics", "CoreText"] elif self.settings.os == "Android": - self.cpp_info.system_libs = ["dl", "log"] + self.cpp_info.components["sentry"].system_libs = ["dl", "log"] elif self.settings.os == "Windows": - self.cpp_info.system_libs = ["shlwapi", "dbghelp", "version"] + self.cpp_info.components["sentry"].system_libs = ["shlwapi", "dbghelp", "version"] if self.options.transport == "winhttp": - self.cpp_info.system_libs.append("winhttp") + self.cpp_info.components["sentry"].system_libs.append("winhttp") + if self.options.transport == "curl": + self.cpp_info.components["sentry"].requires.extend(["libcurl::libcurl"]) + if self.options.get_safe("qt"): + self.cpp_info.components["sentry"].requires.extend(["qt::qt", "openssl::openssl"]) if not self.options.shared: - self.cpp_info.defines = ["SENTRY_BUILD_STATIC"] + self.cpp_info.components["sentry"].defines = ["SENTRY_BUILD_STATIC"] + + if self.options.backend == "breakpad" and self.options.with_breakpad == "sentry": + self.cpp_info.components["breakpad"].set_property("cmake_target_name", "breakpad_client") + self.cpp_info.components["breakpad"].libs = [] if self.options.shared else ["breakpad_client"] + if is_apple_os(self): + self.cpp_info.components["breakpad"].frameworks.append("CoreFoundation") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["breakpad"].system_libs.append("pthread") + + self.cpp_info.components["sentry"].requires.append("breakpad") + + if self.options.backend == "crashpad" and self.options.with_crashpad == "sentry": + # mini_chromium + self.cpp_info.components["crashpad_mini_chromium"].set_property("cmake_target_name", "crashpad::mini_chromium") + self.cpp_info.components["crashpad_mini_chromium"].libs = [] if self.options.shared else ["mini_chromium"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["crashpad_mini_chromium"].system_libs.append("pthread") + elif is_apple_os(self): + self.cpp_info.components["crashpad_mini_chromium"].frameworks = ["CoreFoundation", "Foundation", "Security"] + if self.settings.os == "Macos": + self.cpp_info.components["crashpad_mini_chromium"].frameworks.extend(["ApplicationServices", "IOKit"]) + else: # iOS + self.cpp_info.components["crashpad_mini_chromium"].frameworks.extend(["CoreGraphics", "CoreText"]) + + # compat + self.cpp_info.components["crashpad_compat"].set_property("cmake_target_name", "crashpad::compat") + # On Apple crashpad_compat is an interface library + if not is_apple_os(self): + self.cpp_info.components["crashpad_compat"].libs = [] if self.options.shared else ["crashpad_compat"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["crashpad_compat"].system_libs.append("dl") + + # util + self.cpp_info.components["crashpad_util"].set_property("cmake_target_name", "crashpad::util") + self.cpp_info.components["crashpad_util"].libs = [] if self.options.shared else ["crashpad_util"] + self.cpp_info.components["crashpad_util"].requires = ["crashpad_compat", "crashpad_mini_chromium", "zlib::zlib"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["crashpad_util"].system_libs.extend(["pthread", "rt"]) + # Requires libcurl https://github.com/getsentry/crashpad/blob/2237d97ee2c38c930c07001e660be57324f69a37/util/CMakeLists.txt#L256 + self.cpp_info.components["crashpad_util"].requires.extend(["libcurl::libcurl"]) + elif self.settings.os == "Windows": + self.cpp_info.components["crashpad_util"].system_libs.append("winhttp") + elif self.settings.os == "Macos": + self.cpp_info.components["crashpad_util"].frameworks.extend(["CoreFoundation", "Foundation", "IOKit"]) + self.cpp_info.components["crashpad_util"].system_libs.append("bsm") + if self.options.get_safe("crashpad_with_tls") == "openssl": + self.cpp_info.components["crashpad_util"].requires.append("openssl::openssl") + + # client + self.cpp_info.components["crashpad_client"].set_property("cmake_target_name", "crashpad::client") + self.cpp_info.components["crashpad_client"].libs = [] if self.options.shared else ["crashpad_client"] + self.cpp_info.components["crashpad_client"].requires = ["crashpad_util", "crashpad_mini_chromium"] + + self.cpp_info.components["sentry"].requires.append("crashpad_client") + + # snapshot + self.cpp_info.components["crashpad_snapshot"].set_property("cmake_target_name", "crashpad::snapshot") + self.cpp_info.components["crashpad_snapshot"].libs = [] if self.options.shared else ["crashpad_snapshot"] + self.cpp_info.components["crashpad_snapshot"].requires = [ + "crashpad_client", "crashpad_compat", + "crashpad_util", "crashpad_mini_chromium", + ] + if self.settings.os == "Windows": + self.cpp_info.components["snapshot"].system_libs.append("powrprof") + + # minidump + self.cpp_info.components["crashpad_minidump"].set_property("cmake_target_name", "crashpad::minidump") + self.cpp_info.components["crashpad_minidump"].libs = [] if self.options.shared else ["crashpad_minidump"] + self.cpp_info.components["crashpad_minidump"].requires = [ + "crashpad_compat", "crashpad_snapshot", + "crashpad_util", "crashpad_mini_chromium", + ] + + if self.settings.os == "Windows": + # getopt + self.cpp_info.components["crashpad_getopt"].set_property("cmake_target_name", "crashpad::getopt") + self.cpp_info.components["crashpad_getopt"].libs = [] if self.options.shared else ["crashpad_getopt"] + + # handler + self.cpp_info.components["crashpad_handler"].set_property("cmake_target_name", "crashpad::handler") + self.cpp_info.components["crashpad_handler"].libs = [] if self.options.shared else ["crashpad_handler_lib"] + self.cpp_info.components["crashpad_handler"].requires = [ + "crashpad_compat", "crashpad_minidump", "crashpad_snapshot", + "crashpad_util", "crashpad_mini_chromium", + ] + if self.settings.os == "Windows": + self.cpp_info.components["crashpad_handler"].requires.append("crashpad_getopt") + + # tools + self.cpp_info.components["crashpad_tools"].set_property("cmake_target_name", "crashpad::tools") + self.cpp_info.components["crashpad_tools"].libs = [] if self.options.shared else ["crashpad_tools"] + + 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 in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "crashpad" + self.cpp_info.names["cmake_find_package_multi"] = "crashpad" + self.cpp_info.components["crashpad_mini_chromium"].names["cmake_find_package"] = "mini_chromium" + self.cpp_info.components["crashpad_mini_chromium"].names["cmake_find_package_multi"] = "mini_chromium" + self.cpp_info.components["crashpad_compat"].names["cmake_find_package"] = "compat" + self.cpp_info.components["crashpad_compat"].names["cmake_find_package_multi"] = "compat" + self.cpp_info.components["crashpad_util"].names["cmake_find_package"] = "util" + self.cpp_info.components["crashpad_util"].names["cmake_find_package_multi"] = "util" + self.cpp_info.components["crashpad_client"].names["cmake_find_package"] = "client" + self.cpp_info.components["crashpad_client"].names["cmake_find_package_multi"] = "client" + self.cpp_info.components["crashpad_snapshot"].names["cmake_find_package"] = "snapshot" + self.cpp_info.components["crashpad_snapshot"].names["cmake_find_package_multi"] = "snapshot" + self.cpp_info.components["crashpad_minidump"].names["cmake_find_package"] = "minidump" + self.cpp_info.components["crashpad_minidump"].names["cmake_find_package_multi"] = "minidump" + if self.settings.os == "Windows": + self.cpp_info.components["crashpad_getopt"].names["cmake_find_package"] = "getopt" + self.cpp_info.components["crashpad_getopt"].names["cmake_find_package_multi"] = "getopt" + self.cpp_info.components["crashpad_handler"].names["cmake_find_package"] = "handler" + self.cpp_info.components["crashpad_handler"].names["cmake_find_package_multi"] = "handler" + self.cpp_info.components["crashpad_tools"].names["cmake_find_package"] = "tools" + self.cpp_info.components["crashpad_tools"].names["cmake_find_package_multi"] = "tools" # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "sentry" diff --git a/recipes/sentry-native/all/patches/0.6.5-0001-fix-for-gcc13.patch b/recipes/sentry-native/all/patches/0.6.5-0001-fix-for-gcc13.patch new file mode 100644 index 0000000000000..b3a766009b3a7 --- /dev/null +++ b/recipes/sentry-native/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/patches/sentry-native-903c17a.patch b/recipes/sentry-native/all/patches/sentry-native-903c17a.patch deleted file mode 100644 index ea2ffd463a7ad..0000000000000 --- a/recipes/sentry-native/all/patches/sentry-native-903c17a.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 903c17ae20888679caab1871cc74de577509452e Mon Sep 17 00:00:00 2001 -From: Cyriuz -Date: Mon, 13 Mar 2023 14:55:26 +0100 -Subject: [PATCH] Allow setting CRASHPAD_WER_ENABLED when using system crashpad - (#816) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 831e8e1..aeea09f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -426,8 +426,9 @@ if(SENTRY_BACKEND_CRASHPAD) - set(CRASHPAD_ENABLE_INSTALL ON CACHE BOOL "Enable crashpad installation" FORCE) - endif() - add_subdirectory(external/crashpad crashpad_build) -+ - if(CRASHPAD_WER_ENABLED) -- add_compile_definitions(CRASHPAD_WER_ENABLED) -+ add_dependencies(sentry crashpad::wer) - endif() - - # set static runtime if enabled -@@ -482,8 +483,9 @@ if(SENTRY_BACKEND_CRASHPAD) - endif() - endif() - add_dependencies(sentry crashpad::handler) -+ - if(CRASHPAD_WER_ENABLED) -- add_dependencies(sentry crashpad::wer) -+ add_compile_definitions(CRASHPAD_WER_ENABLED) - endif() - elseif(SENTRY_BACKEND_BREAKPAD) - option(SENTRY_BREAKPAD_SYSTEM "Use system breakpad" OFF) --- -2.39.1.windows.1 diff --git a/recipes/sentry-native/all/test_package/conanfile.py b/recipes/sentry-native/all/test_package/conanfile.py index 0a6bc68712d90..9c636a97657a4 100644 --- a/recipes/sentry-native/all/test_package/conanfile.py +++ b/recipes/sentry-native/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.files import mkdir, save, load +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain 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 +16,13 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + handler_exe = "crashpad_handler.exe" if self.settings.os == "Windows" else "crashpad_handler" + handler_bin_path = os.path.join(self.dependencies[self.tested_reference_str].package_folder, "bin", handler_exe) + save(self, os.path.join(self.build_folder, "handler_bin_path"), handler_bin_path) + def build(self): cmake = CMake(self) cmake.configure() @@ -22,5 +30,8 @@ def build(self): def test(self): if can_run(self): + test_env_dir = "test_env" + mkdir(self, test_env_dir) bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(bin_path, env="conanrun") + handler_bin_path = load(self, os.path.join(self.build_folder, "handler_bin_path")) + self.run(f"{bin_path} {test_env_dir} {handler_bin_path}", env="conanrun") diff --git a/recipes/sentry-native/config.yml b/recipes/sentry-native/config.yml index ea4872076354c..3450228c14b09 100644 --- a/recipes/sentry-native/config.yml +++ b/recipes/sentry-native/config.yml @@ -1,7 +1,9 @@ versions: - "0.6.1": + "0.6.5": folder: all - "0.6.0": + "0.6.4": + folder: all + "0.6.3": folder: all "0.5.4": folder: all diff --git a/recipes/seqan/2.x.x/conanfile.py b/recipes/seqan/2.x.x/conanfile.py index 5f567373a4d1a..fb2227d760d8f 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 64fd988616e27..6fdde597b12f4 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 a59a26a52c8dc..fae501d0afb9e 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 dd08405d3402d..d9a44258b866d 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 0000000000000..91630d79f4abb --- /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 0000000000000..abcaeed3f89b6 --- /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 ef55f38b024ff..10b57ed42fdf7 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 8c21ec19c6384..11e58315f3f7e 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 38f4483872d47..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 038ad977840b2..b5008dc8cfa01 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 a5bc02fad6305..48987703821e7 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 539c3a27d063b..433b310f78080 100644 --- a/recipes/serdepp/all/conanfile.py +++ b/recipes/serdepp/all/conanfile.py @@ -1,21 +1,26 @@ import os -from conans.errors import ConanInvalidConfiguration -from conans import ConanFile, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +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 -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class SerdeppConan(ConanFile): name = "serdepp" description = "c++ serialize and deserialize adaptor library like rust serde.rs" license = "MIT" - topics = ("yaml", "toml", "serialization", "json", "reflection") - homepage = "https://github.com/injae/serdepp" url = "https://github.com/conan-io/conan-center-index" - settings = "arch", "build_type", "compiler", "os" + homepage = "https://github.com/injae/serdepp" + topics = ("yaml", "toml", "serialization", "json", "reflection", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" options = { - # keeping the option in case upstream support dynamic linking "with_nlohmann_json": [True, False], "with_rapidjson": [True, False], "with_fmt": [True, False], @@ -32,16 +37,8 @@ class SerdeppConan(ConanFile): no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - 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() + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -52,48 +49,68 @@ 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.3") + self.requires("magic_enum/0.9.5") + if self.options.with_toml11: + self.requires("toml11/3.7.1") + if self.options.with_yamlcpp: + 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/10.1.0") + if self.options.with_nlohmann_json: + self.requires("nlohmann_json/3.11.2") + + def package_id(self): + self.info.clear() + def validate(self): compiler = self.settings.compiler if 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(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least 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++{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_subfolder, x) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - include = os.path.join('include', 'serdepp') - self.copy('*.hpp', dst=include, src=s(include)) - attribute = os.path.join(include, 'attribute') - self.copy('*.hpp', dst=attribute, src=s(attribute)) - adaptor = os.path.join(include, 'adaptor') - self.copy('reflection.hpp', dst=adaptor, src=s(adaptor)) - self.copy('sstream.hpp', dst=adaptor, src=s(adaptor)) + s = lambda x: os.path.join(self.source_folder, x) + p = lambda x: os.path.join(self.package_folder, x) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + include = os.path.join("include", "serdepp") + copy(self, "*.hpp", dst=p(include), src=s(include)) + attribute = os.path.join(include, "attribute") + copy(self, "*.hpp", dst=p(attribute), src=s(attribute)) + adaptor = os.path.join(include, "adaptor") + copy(self, "reflection.hpp", dst=p(adaptor), src=s(adaptor)) + copy(self, "sstream.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_toml11: - self.copy('toml11.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "toml11.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_yamlcpp: - self.copy('yaml-cpp.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "yaml-cpp.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_rapidjson: - self.copy('rapidjson.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "rapidjson.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_fmt: - self.copy('fmt.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "fmt.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_nlohmann_json: - self.copy('nlohmann_json.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "nlohmann_json.hpp", dst=p(adaptor), src=s(adaptor)) - def requirements(self): - self.requires("nameof/0.10.1") - self.requires("magic_enum/0.7.3") - if self.options.with_toml11: - self.requires("toml11/3.7.0") - if self.options.with_yamlcpp: - self.requires("yaml-cpp/0.7.0") - if self.options.with_rapidjson: - self.requires("rapidjson/1.1.0") - if self.options.with_fmt: - self.requires("fmt/8.1.1") - if self.options.with_nlohmann_json: - self.requires("nlohmann_json/3.10.5") + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] 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 0000000000000..1d276241e168b --- /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/serdepp/all/test_package/CMakeLists.txt b/recipes/serdepp/all/test_package/CMakeLists.txt index a4620c9ed66c9..f8c810f0f3968 100644 --- a/recipes/serdepp/all/test_package/CMakeLists.txt +++ b/recipes/serdepp/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(serdepp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/serdepp/all/test_package/conanfile.py b/recipes/serdepp/all/test_package/conanfile.py index e788460ad0765..fae501d0afb9e 100644 --- a/recipes/serdepp/all/test_package/conanfile.py +++ b/recipes/serdepp/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", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" - 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/serdepp/all/test_package/test_package.cpp b/recipes/serdepp/all/test_package/test_package.cpp index 427fde86f750f..c7b4aeafe407d 100644 --- a/recipes/serdepp/all/test_package/test_package.cpp +++ b/recipes/serdepp/all/test_package/test_package.cpp @@ -1,7 +1,9 @@ -#include -#include #include #include + +#include +#include + class test { public: template diff --git a/recipes/serdepp/all/test_v1_package/CMakeLists.txt b/recipes/serdepp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/serdepp/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/serdepp/all/test_v1_package/conanfile.py b/recipes/serdepp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e788460ad0765 --- /dev/null +++ b/recipes/serdepp/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/serf/all/CMakeLists.txt b/recipes/serf/all/CMakeLists.txt deleted file mode 100644 index a69305eb3971f..0000000000000 --- 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 10d6d086a2a84..6a0aa39d546ff 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 389e7ad59c4e3..cf758acbc390f 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 0000000000000..144bdf9d5c3cc --- /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 f8b971e2db377..6423a8f84e174 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 4aebe114eeb59..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..3f4a9f50f389e --- /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 25209c318b985..bb8bfce6bd49d 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 d5553000bbddb..b0bd05408cdc0 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 328eaf93b7304..344a587ace219 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 5493d58611803..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..1bf1c7e26255d --- /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 0000000000000..8cb01ed6a8b53 --- /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 58f8c7d9b6cc4..37e057f517a7d 100644 --- a/recipes/sfml/all/conandata.yml +++ b/recipes/sfml/all/conandata.yml @@ -1,22 +1,60 @@ 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" "2.5.1": 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" + 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.0-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.5.1": - - patch_file: "patches/0001-cmake-robust-find-deps.patch" + - patch_file: "patches/2.5.1-0001-cmake-robust-find-deps.patch" patch_description: "Robust discovery of dependencies" patch_type: "conan" - - patch_file: "patches/0002-allow-non-x86-64-macos.patch" + - patch_file: "patches/2.5.1-0002-allow-non-x86-64-macos.patch" patch_description: "Allow compilation for macOS arm" patch_type: "portability" - - patch_file: "patches/0003-allow-shared-MT.patch" + - patch_file: "patches/2.5.1-0003-allow-shared-MT.patch" patch_description: "Allow to build shared SFML with MT runtime" patch_type: "portability" - - patch_file: "patches/0004-fix-ios.patch" + - patch_file: "patches/2.5.1-0004-fix-ios.patch" patch_description: "Fix iOS detection logic in CMakeLists" patch_type: "portability" - - patch_file: "patches/0005-remove-auto-ptr.patch" + - patch_file: "patches/2.5.1-0005-remove-auto-ptr.patch" patch_description: "Remove usage of auto_ptr to allow compilation with C++17 standard" patch_type: "portability" patch_source: "https://github.com/SFML/SFML/commit/bf92efe9a4035fee0258386173d53556aa196e49" diff --git a/recipes/sfml/all/conanfile.py b/recipes/sfml/all/conanfile.py index 18f3ab2ca1e58..ca66440dcf795 100644 --- a/recipes/sfml/all/conanfile.py +++ b/recipes/sfml/all/conanfile.py @@ -2,8 +2,9 @@ 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 apply_conandata_patches, export_conandata_patches, get, rmdir, save +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save, copy from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os import textwrap @@ -14,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 = { @@ -52,18 +53,21 @@ def layout(self): def requirements(self): if self.options.window: + # FIXME: use cci's glad if self.settings.os in ["Windows", "Linux", "FreeBSD", "Macos"]: self.requires("opengl/system") if self.settings.os == "Linux": 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("flac/1.4.3") self.requires("openal-soft/1.22.2") self.requires("vorbis/1.3.7") + if Version(self.version) >= "2.6.0": + self.requires("minimp3/cci.20211201") def validate(self): if self.settings.os not in ["Windows", "Linux", "FreeBSD", "Android", "Macos", "iOS"]: @@ -73,7 +77,9 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - rmdir(self, os.path.join(self.source_folder, "extlibs")) + # sfml/2.6.0 uses minimp3 and glad in extlibs + if Version(self.version) < "2.6.0": + rmdir(self, os.path.join(self.source_folder, "extlibs")) def generate(self): tc = CMakeToolchain(self) @@ -86,6 +92,9 @@ def generate(self): tc.variables["SFML_INSTALL_PKGCONFIG_FILES"] = False tc.variables["SFML_GENERATE_PDB"] = False tc.variables["SFML_USE_SYSTEM_DEPS"] = True + tc.variables["WARNINGS_AS_ERRORS"] = False + if Version(self.version) >= "2.6.0": + tc.variables["CMAKE_CXX_STANDARD"] = 11 if is_msvc(self): tc.variables["SFML_USE_STATIC_STD_LIBS"] = is_msvc_static_runtime(self) tc.generate() @@ -99,9 +108,12 @@ def build(self): cmake.build() def package(self): + if Version(self.version) >= "2.6.0": + copy(self, pattern="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, "share")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -135,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 [] @@ -168,6 +183,9 @@ def carbon(): def iokit(): return ["IOKit"] if self.settings.os == "Macos" else [] + def coreservices(): + return ["CoreServices"] if self.settings.os == "Macos" else [] + def coregraphics(): return ["CoreGraphics"] if self.settings.os == "iOS" else [] @@ -189,6 +207,9 @@ def opengles_android(): def opengles_ios(): return ["OpenGLES"] if self.settings.os == "iOS" else [] + def objc(): + return ["-ObjC"] if not self.options.shared and self.settings.os == "Macos" else [] + suffix = "" if self.options.shared else "-s" suffix += "-d" if self.settings.build_type == "Debug" else "" @@ -217,10 +238,11 @@ def opengles_ios(): "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() + - coremotion() + opengles_ios(), + coreservices() + coremotion() + opengles_ios(), + "exelinkflags": objc(), }, }) if self.options.graphics: @@ -241,11 +263,14 @@ def opengles_ios(): }, }) if self.options.audio: + audio_requires = ["system", "flac::flac", "openal-soft::openal-soft", "vorbis::vorbis"] + if Version(self.version) >= "2.6.0": + audio_requires.append("minimp3::minimp3") sfml_components.update({ "audio": { "target": "sfml-audio", "libs": [f"sfml-audio{suffix}"], - "requires": ["system", "flac::flac", "openal-soft::openal-soft", "vorbis::vorbis"], + "requires": audio_requires, "system_libs": android(), }, }) @@ -264,6 +289,7 @@ def _register_components(components): requires = values.get("requires", []) system_libs = values.get("system_libs", []) frameworks = values.get("frameworks", []) + exelinkflags = values.get("exelinkflags", []) # TODO: Properly model COMPONENTS names in CMakeDeps for find_package() call # (see https://github.com/conan-io/conan/issues/10258) # It should be: @@ -277,6 +303,7 @@ def _register_components(components): self.cpp_info.components[component].requires = requires self.cpp_info.components[component].system_libs = system_libs self.cpp_info.components[component].frameworks = frameworks + self.cpp_info.components[component].exelinkflags = exelinkflags # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.components[component].build_modules["cmake_find_package"] = [self._module_file_rel_path] diff --git a/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch b/recipes/sfml/all/patches/2.5.1-0001-cmake-robust-find-deps.patch similarity index 100% rename from recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch rename to recipes/sfml/all/patches/2.5.1-0001-cmake-robust-find-deps.patch diff --git a/recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch b/recipes/sfml/all/patches/2.5.1-0002-allow-non-x86-64-macos.patch similarity index 100% rename from recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch rename to recipes/sfml/all/patches/2.5.1-0002-allow-non-x86-64-macos.patch diff --git a/recipes/sfml/all/patches/0003-allow-shared-MT.patch b/recipes/sfml/all/patches/2.5.1-0003-allow-shared-MT.patch similarity index 100% rename from recipes/sfml/all/patches/0003-allow-shared-MT.patch rename to recipes/sfml/all/patches/2.5.1-0003-allow-shared-MT.patch diff --git a/recipes/sfml/all/patches/0004-fix-ios.patch b/recipes/sfml/all/patches/2.5.1-0004-fix-ios.patch similarity index 100% rename from recipes/sfml/all/patches/0004-fix-ios.patch rename to recipes/sfml/all/patches/2.5.1-0004-fix-ios.patch diff --git a/recipes/sfml/all/patches/0005-remove-auto-ptr.patch b/recipes/sfml/all/patches/2.5.1-0005-remove-auto-ptr.patch similarity index 100% rename from recipes/sfml/all/patches/0005-remove-auto-ptr.patch rename to recipes/sfml/all/patches/2.5.1-0005-remove-auto-ptr.patch diff --git a/recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch b/recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch new file mode 100644 index 0000000000000..1e4a21511eb3b --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch @@ -0,0 +1,57 @@ +diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt +index d27dc6d..27c3386 100644 +--- a/src/SFML/Audio/CMakeLists.txt ++++ b/src/SFML/Audio/CMakeLists.txt +@@ -69,19 +69,17 @@ endif() + + # find external libraries + sfml_find_package(OpenAL INCLUDE "OPENAL_INCLUDE_DIR" LINK "OPENAL_LIBRARY") +-sfml_find_package(VORBIS INCLUDE "VORBIS_INCLUDE_DIRS" LINK "VORBIS_LIBRARIES") ++sfml_find_package(Vorbis INCLUDE "VORBIS_INCLUDE_DIRS" LINK "VORBIS_LIBRARIES") + sfml_find_package(FLAC INCLUDE "FLAC_INCLUDE_DIR" LINK "FLAC_LIBRARY") + + # avoids warnings in vorbisfile.h +-target_compile_definitions(VORBIS INTERFACE "OV_EXCLUDE_STATIC_CALLBACKS") +-target_compile_definitions(FLAC INTERFACE "FLAC__NO_DLL") + + # define the sfml-audio target + sfml_add_library(sfml-audio + SOURCES ${SRC} ${CODECS_SRC}) + + # setup dependencies +-target_link_libraries(sfml-audio PRIVATE OpenAL) ++target_link_libraries(sfml-audio PRIVATE OpenAL::OpenAL) + + # minimp3 sources + target_include_directories(sfml-audio SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/minimp3") +@@ -92,4 +90,4 @@ endif() + + target_link_libraries(sfml-audio + PUBLIC sfml-system +- PRIVATE VORBIS FLAC) ++ PRIVATE Vorbis::vorbisenc Vorbis::vorbisfile FLAC::FLAC) +diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt +index a939a98..bd6a89b 100644 +--- a/src/SFML/Graphics/CMakeLists.txt ++++ b/src/SFML/Graphics/CMakeLists.txt +@@ -93,7 +93,8 @@ sfml_add_library(sfml-graphics + target_link_libraries(sfml-graphics PUBLIC sfml-window) + + # stb_image sources +-target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image") ++find_package(stb REQUIRED CONFIG) ++target_link_libraries(sfml-graphics PRIVATE stb::stb) + + # glad sources + target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/glad/include") +@@ -123,8 +124,8 @@ if((SFML_COMPILER_MSVC AND SFML_MSVC_VERSION GREATER_EQUAL 14) OR (SFML_COMPILER + target_link_libraries(sfml-graphics PRIVATE legacy_stdio_definitions.lib) + endif() + +-sfml_find_package(Freetype INCLUDE "FREETYPE_INCLUDE_DIRS" LINK "FREETYPE_LIBRARY") +-target_link_libraries(sfml-graphics PRIVATE Freetype) ++find_package(freetype REQUIRED) ++target_link_libraries(sfml-graphics PRIVATE freetype) + + # add preprocessor symbols + target_compile_definitions(sfml-graphics PRIVATE "STBI_FAILURE_USERMSG") diff --git a/recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch b/recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch new file mode 100644 index 0000000000000..59b4bbd230de7 --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e3f89d..003857e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -223,7 +223,7 @@ if(SFML_OS_WINDOWS) + sfml_set_option(SFML_USE_STATIC_STD_LIBS FALSE BOOL "TRUE to statically link to the standard libraries, FALSE to use them as DLLs") + + # the following combination of flags is not valid +- if(BUILD_SHARED_LIBS AND SFML_USE_STATIC_STD_LIBS) ++ if(0) + message(FATAL_ERROR "BUILD_SHARED_LIBS and SFML_USE_STATIC_STD_LIBS cannot be used together") + endif() + diff --git a/recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch b/recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch new file mode 100644 index 0000000000000..34b49a186218d --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch @@ -0,0 +1,28 @@ +diff --git a/cmake/Config.cmake b/cmake/Config.cmake +index 2ce5ac4..3cd3a07 100644 +--- a/cmake/Config.cmake ++++ b/cmake/Config.cmake +@@ -39,13 +39,12 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "^NetBSD$") + set(SFML_OS_NETBSD 1) + # don't use the OpenGL ES implementation on NetBSD + set(OPENGL_ES 0) +-elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +- if(IOS) ++elseif(${CMAKE_SYSTEM_NAME} STREQUAL "iOS") + set(SFML_OS_IOS 1) + + # use the OpenGL ES implementation on iOS + set(OPENGL_ES 1) +- else() ++elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(SFML_OS_MACOSX 1) + + # don't use the OpenGL ES implementation on Mac OS X +@@ -58,7 +57,6 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + message(FATAL_ERROR "Unsupported version of OS X: ${MACOSX_VERSION_RAW}") + return() + endif() +- endif() + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android") + set(SFML_OS_ANDROID 1) + diff --git a/recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch b/recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch new file mode 100644 index 0000000000000..362c57e93365a --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake +index e0118eb..85a7714 100644 +--- a/cmake/Macros.cmake ++++ b/cmake/Macros.cmake +@@ -66,8 +66,6 @@ macro(sfml_add_library target) + add_library(${target} ${THIS_SOURCES}) + endif() + +- set_file_warnings(${THIS_SOURCES}) +- + # define the export symbol of the module + string(REPLACE "-" "_" NAME_UPPER "${target}") + string(TOUPPER "${NAME_UPPER}" NAME_UPPER) +@@ -265,8 +263,6 @@ macro(sfml_add_example target) + add_executable(${target} ${target_input}) + endif() + +- set_file_warnings(${target_input}) +- + # set the debug suffix + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) + diff --git a/recipes/sfml/all/patches/2.6.0-0007-use-cci-minimp3.patch b/recipes/sfml/all/patches/2.6.0-0007-use-cci-minimp3.patch new file mode 100644 index 0000000000000..d63dc230ed817 --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0007-use-cci-minimp3.patch @@ -0,0 +1,14 @@ +diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt +index 27c3386..6c455ca 100644 +--- a/src/SFML/Audio/CMakeLists.txt ++++ b/src/SFML/Audio/CMakeLists.txt +@@ -82,7 +82,8 @@ sfml_add_library(sfml-audio + target_link_libraries(sfml-audio PRIVATE OpenAL::OpenAL) + + # minimp3 sources +-target_include_directories(sfml-audio SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/minimp3") ++find_package(minimp3 REQUIRED CONFIG) ++target_include_directories(sfml-audio SYSTEM PRIVATE ${minimp3_INCLUDE_DIRS}) + + if(SFML_OS_ANDROID) + target_link_libraries(sfml-audio PRIVATE android OpenSLES) 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 0000000000000..5d44e698e2bfb --- /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 eab83a303df52..7ce3d994f27a7 100644 --- a/recipes/sfml/config.yml +++ b/recipes/sfml/config.yml @@ -1,3 +1,7 @@ versions: + "2.6.1": + folder: all + "2.6.0": + folder: all "2.5.1": folder: all diff --git a/recipes/shapelib/all/conandata.yml b/recipes/shapelib/all/conandata.yml index 5dde0cb6bfee1..1c122519c5ede 100644 --- a/recipes/shapelib/all/conandata.yml +++ b/recipes/shapelib/all/conandata.yml @@ -1,14 +1,24 @@ sources: + "1.6.0": + url: "https://github.com/OSGeo/shapelib/archive/v1.6.0.tar.gz" + sha256: "0bfd1eab9616ca3c420a5ad674b0d07c7c5018620d6ab6ae43917daa18ff0d1e" "1.5.0": - url: "https://github.com/OSGeo/shapelib/archive/v1.5.0.zip" - sha256: "673b00ef6caef254fe16d831b982e6bbed7397615c57b9ed92cf8b59017dd06b" + url: "https://github.com/OSGeo/shapelib/archive/v1.5.0.tar.gz" + sha256: "48de3a6a8691b0b111b909c0b908af4627635c75322b3a501c0c0885f3558cad" patches: + "1.6.0": + - patch_file: "patches/1.6.0-0003-relocatable-shared-macos.patch" + patch_description: "Relocatable shared lib on macOS" + patch_type: "conan" "1.5.0": - - patch_file: "patches/0001-cmake-minimum-required.patch" + - patch_file: "patches/1.5.0-0001-cmake-minimum-required.patch" patch_description: "Place the cmake_minimum_required call before the project command" patch_source: "https://github.com/OSGeo/shapelib/pull/45" patch_type: "portability" - - patch_file: "patches/0002-build-testing.patch" + - patch_file: "patches/1.5.0-0002-build-testing.patch" 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/1.5.0-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 19059022ab189..e4deabe7afba9 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" - topics = ("osgeo", "shapefile", "esri", "geospatial") - homepage = "https://github.com/OSGeo/shapelib" + license = "LGPL-2.0-or-later", "MIT" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OSGeo/shapelib" + topics = ("osgeo", "shapefile", "esri", "geospatial") + 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/0001-cmake-minimum-required.patch b/recipes/shapelib/all/patches/1.5.0-0001-cmake-minimum-required.patch similarity index 100% rename from recipes/shapelib/all/patches/0001-cmake-minimum-required.patch rename to recipes/shapelib/all/patches/1.5.0-0001-cmake-minimum-required.patch diff --git a/recipes/shapelib/all/patches/0002-build-testing.patch b/recipes/shapelib/all/patches/1.5.0-0002-build-testing.patch similarity index 100% rename from recipes/shapelib/all/patches/0002-build-testing.patch rename to recipes/shapelib/all/patches/1.5.0-0002-build-testing.patch diff --git a/recipes/shapelib/all/patches/1.5.0-0003-relocatable-shared-macos.patch b/recipes/shapelib/all/patches/1.5.0-0003-relocatable-shared-macos.patch new file mode 100644 index 0000000000000..5994e77d745e1 --- /dev/null +++ b/recipes/shapelib/all/patches/1.5.0-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/patches/1.6.0-0003-relocatable-shared-macos.patch b/recipes/shapelib/all/patches/1.6.0-0003-relocatable-shared-macos.patch new file mode 100644 index 0000000000000..13deeaed93d83 --- /dev/null +++ b/recipes/shapelib/all/patches/1.6.0-0003-relocatable-shared-macos.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 893328e..7d907ad 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -137,7 +137,7 @@ set(shp_VERSION ${PROJECT_VERSION}) + set_target_properties(${PACKAGE} PROPERTIES + SOVERSION ${shp_SOVERSION} + VERSION ${shp_VERSION} +- INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}" ++# 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 30289c1a8112b..2d8b5a050f64f 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 925ecbe19e448..2f11d9b196ef7 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/shapelib/config.yml b/recipes/shapelib/config.yml index 7f3d5d7f62dd8..04ffd79e144a1 100644 --- a/recipes/shapelib/config.yml +++ b/recipes/shapelib/config.yml @@ -1,3 +1,5 @@ versions: + "1.6.0": + folder: all "1.5.0": folder: all diff --git a/recipes/shield/all/conandata.yml b/recipes/shield/all/conandata.yml index 38803c2a64ad9..76d8f2a0a392d 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 b3c1faaf54b2b..ab08cd3e58a8c 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 6c3ae2de9686d..0000000000000 --- 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 5576f1491e1a5..b17e4f76ae2c0 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 38915243d0bef..ef396846127aa 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 14c1322818a6b..b7052eb3cd9b3 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 8ae9b638e62fe..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..8ae9b638e62fe --- /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 8530898d2c4b5..338eb274bf5be 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 0000000000000..6255a706e185e --- /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 0000000000000..c2bd67ed6c42a --- /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 0000000000000..d1721523eaa2c --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..94e057ccb6137 --- /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 0000000000000..cbec618d4f846 --- /dev/null +++ b/recipes/signals-light/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210616": + folder: all diff --git a/recipes/simde/all/conandata.yml b/recipes/simde/all/conandata.yml new file mode 100644 index 0000000000000..c108fd42332f1 --- /dev/null +++ b/recipes/simde/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + "0.7.6": + # A release tarball exists, but I want to use the archive tarball. + # Because the release tarball has only amalgatated(with lots of duplicate lines) header files. + url: "https://github.com/simd-everywhere/simde/archive/refs/tags/v0.7.6.tar.gz" + sha256: "c63e6c61392e324728da1c7e5de308cb31410908993a769594f5e21ff8de962b" diff --git a/recipes/simde/all/conanfile.py b/recipes/simde/all/conanfile.py new file mode 100644 index 0000000000000..492893a0540fb --- /dev/null +++ b/recipes/simde/all/conanfile.py @@ -0,0 +1,59 @@ +from conan import ConanFile +from conan.tools.files import copy, 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.52.0" + + +class SIMEeConan(ConanFile): + name = "simde" + description = "Implementations of SIMD instruction sets for systems which don't natively support them." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/simd-everywhere/simde" + topics = ("neon", "avx", "sse", "simd", "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 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["tests"] = False + tc.generate() + pkg = PkgConfigDeps(self) + pkg.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + meson = Meson(self) + meson.install() + + rmdir(self, os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("pkg_config_name", "SIMDe") diff --git a/recipes/simde/all/test_package/CMakeLists.txt b/recipes/simde/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..142cf36ac18b4 --- /dev/null +++ b/recipes/simde/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(simde REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE simde::simde) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/simde/all/test_package/conanfile.py b/recipes/simde/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/simde/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/simde/all/test_package/test_package.c b/recipes/simde/all/test_package/test_package.c new file mode 100644 index 0000000000000..7257838559828 --- /dev/null +++ b/recipes/simde/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include + +int main(void) { + simde__m128i a = simde_mm_set_epi8( + INT8_C(-105), INT8_C(-116), INT8_C( -45), INT8_C(-102), + INT8_C( -3), INT8_C( 92), INT8_C( -99), INT8_C( 100), + INT8_C( 30), INT8_C(-115), INT8_C( 82), INT8_C( 84), + INT8_C(-106), INT8_C( 66), INT8_C(-107), INT8_C( 116) + ); + int la = 0; + simde__m128i b = simde_mm_set_epi8( + INT8_C( -89), INT8_C( 65), INT8_C( 68), INT8_C( -29), + INT8_C(-101), INT8_C( 113), INT8_C( -11), INT8_C( 53), + INT8_C( -5), INT8_C( -76), INT8_C( 28), INT8_C(-120), + INT8_C( 64), INT8_C( 43), INT8_C(-127), INT8_C( -44) + ); + int lb = 2; + int r = simde_mm_cmpestrs(a, la, b, lb, 0); + + if (r != 1) { + return 1; + } + + return 0; +} diff --git a/recipes/simde/config.yml b/recipes/simde/config.yml new file mode 100644 index 0000000000000..1d3599e3efc2e --- /dev/null +++ b/recipes/simde/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7.6": + folder: all diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml index 4be0fb0333ac6..3f7b97847e169 100644 --- a/recipes/simdjson/all/conandata.yml +++ b/recipes/simdjson/all/conandata.yml @@ -1,40 +1,34 @@ 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" + "3.2.0": + url: "https://github.com/simdjson/simdjson/archive/v3.2.0.tar.gz" + sha256: "75a684dbbe38cf72b8b3bdbdc430764813f3615899a6029931c26ddd89812da4" "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" - "3.0.0": - url: "https://github.com/simdjson/simdjson/archive/v3.0.0.tar.gz" - sha256: "e6dd4bfaad2fd9599e6a026476db39a3bb9529436d3508ac3ae643bc663526c5" "2.2.3": url: "https://github.com/simdjson/simdjson/archive/v2.2.3.tar.gz" sha256: "4c62f2d82edec3dbc63650c10453dc471de9f1be689eb5b4bde89efed89db5d8" - "2.1.0": - url: "https://github.com/simdjson/simdjson/archive/v2.1.0.tar.gz" - sha256: "051b90427ddd1eac319f4eb34b973592728a6d8608fbac61e8aaa5a2dee4b693" - "2.0.4": - url: "https://github.com/simdjson/simdjson/archive/v2.0.4.tar.gz" - sha256: "c8a12cf60f6ce8c0e556f68bd80e7bd9f11f5876e198ed3637da8ccf182eaa24" - "1.1.0": - url: "https://github.com/simdjson/simdjson/archive/v1.1.0.tar.gz" - sha256: "9effcb21fe48e4bcc9b96031e60c3911c58aa656ad8c78212d269c0db9e0133e" - "1.0.2": - url: "https://github.com/simdjson/simdjson/archive/v1.0.2.tar.gz" - sha256: "46d5995488de76ae61f1c3bcff445a9085c8d34f6cbc9bf0422a99c6d98a002c" - "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 b0c6d0fa54bf1..7b42a92cdbbc8 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 6327300ad07ec..c4ccbb7735a04 100644 --- a/recipes/simdjson/config.yml +++ b/recipes/simdjson/config.yml @@ -1,27 +1,23 @@ versions: - "3.1.8": - folder: all - "3.1.7": + "3.6.1": folder: all - "3.1.5": + "3.6.0": folder: all - "3.1.1": + "3.5.0": folder: all - "3.1.0": - folder: all - "3.0.1": + "3.3.0": folder: all - "3.0.0": + "3.2.3": folder: all - "2.2.3": + "3.2.2": folder: all - "2.1.0": + "3.2.1": folder: all - "2.0.4": + "3.2.0": folder: all - "1.1.0": + "3.1.8": folder: all - "1.0.2": + "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 ccc7fafd76088..b28c517c6191a 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,4 +1,22 @@ 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" "3.2.2": url: "https://github.com/simdutf/simdutf/archive/v3.2.2.tar.gz" sha256: "5a5c84c05bf30d681126d1dcbde903615f2c927e201e0c6d489f74a91b7f506f" @@ -14,65 +32,36 @@ 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.2": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + "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.0": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + "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.1.0": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "3.0.0": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + "3.2.14": + - patch_file: "patches/3.2.14-0001-fix-cmake.patch" patch_description: "remove static build, enable rpath on macOS" patch_type: "conan" - "2.2.0": + "3.2.2": - 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": + "3.2.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": + "3.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.8": + "3.0.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.6": + "2.2.0": - 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 6bdedd0dd5b54..e0a52dd250245 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 @@ -15,6 +16,7 @@ class SimdutfConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/simdutf/simdutf" topics = ("unicode", "transcoding", "neon", "simd", "avx2", "sse2", "utf8", "utf16", ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,7 +28,7 @@ class SimdutfConan(ConanFile): } @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 11 def export_sources(self): @@ -44,11 +46,18 @@ 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], 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,10 +65,8 @@ 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 7110c904b0efe..0000000000000 --- 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 cdc06b6c7fd09..0000000000000 --- 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 957a9759ee2fa..0000000000000 --- 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.14-0001-fix-cmake.patch b/recipes/simdutf/all/patches/3.2.14-0001-fix-cmake.patch new file mode 100644 index 0000000000000..2fa471fee1dfb --- /dev/null +++ b/recipes/simdutf/all/patches/3.2.14-0001-fix-cmake.patch @@ -0,0 +1,30 @@ +diff --git a/cmake/simdutf-flags.cmake b/cmake/simdutf-flags.cmake +index 4844fa0..801e2b3 100644 +--- a/cmake/simdutf-flags.cmake ++++ b/cmake/simdutf-flags.cmake +@@ -24,4 +24,4 @@ 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) ++set(CMAKE_MACOSX_RPATH ON) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index f42e310..80ce35c 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 "$") + +@@ -38,4 +38,4 @@ if(SIMDUTF_SANITIZE_UNDEFINED) + endif() + if(MSVC AND BUILD_SHARED_LIBS) + set(SIMDUTF_WINDOWS_DLL TRUE) +-endif() +\ No newline at end of file ++endif() 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 0000000000000..6f1f0aa23c231 --- /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 c0a677b2e1801..d16a8ca4a324b 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,21 +1,23 @@ versions: - "3.2.2": + "4.0.5": folder: all - "3.2.0": + "4.0.4": folder: all - "3.1.0": + "4.0.3": folder: all - "3.0.0": + "3.2.17": folder: all - "2.2.0": + "3.2.15": folder: all - "2.1.0": + "3.2.14": folder: all - "2.0.9": + "3.2.2": folder: all - "2.0.8": + "3.2.0": folder: all - "2.0.6": + "3.1.0": folder: all - "1.0.1": + "3.0.0": + folder: all + "2.2.0": folder: all diff --git a/recipes/simple-websocket-server/all/conanfile.py b/recipes/simple-websocket-server/all/conanfile.py index 7af11bfe301d4..c4f98b42cbc3d 100644 --- a/recipes/simple-websocket-server/all/conanfile.py +++ b/recipes/simple-websocket-server/all/conanfile.py @@ -1,65 +1,76 @@ 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 SimpleWebSocketServerConan(ConanFile): name = "simple-websocket-server" + description = ( + "A very simple, fast, multithreaded, platform independent WebSocket (WS) " + "and WebSocket Secure (WSS) server and client library." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.com/eidheim/Simple-WebSocket-Server" - description = "A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library." topics = ("websocket", "socket", "server", "client", "header-only") - url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "arch", "build_type" + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = {"use_asio_standalone": [True, False]} + default_options = {"use_asio_standalone": True} no_copy_source = True - license = "MIT" - options = { - "use_asio_standalone": [True, False], - } - default_options = { - "use_asio_standalone": True, - } - @property - def _source_subfolder(self): - return "source_subfolder" + 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 tools.Version(self.version) <= "2.0.1": + if Version(self.version) <= "2.0.1": if self.options.use_asio_standalone: self.requires("asio/1.16.1") else: self.requires("boost/1.73.0") else: if self.options.use_asio_standalone: - self.requires("asio/1.23.0") + self.requires("asio/1.28.1") else: - self.requires("boost/1.79.0") + self.requires("boost/1.83.0") - def configure(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + def package_id(self): + self.info.clear() - def build(self): - if tools.Version(self.version) <= "2.0.1" and "asio" in self.deps_cpp_info.deps and tools.Version(self.deps_cpp_info["asio"].version) >= "1.18.0": - raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require asio < 1.18.0") - elif tools.Version(self.version) <= "2.0.1" and "boost" in self.deps_cpp_info.deps and tools.Version(self.deps_cpp_info["boost"].version) >= "1.74.0": - raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require boost < 1.74.0") + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if Version(self.version) <= "2.0.1": + if self.dependencies.get("asio"): + if Version(self.dependencies["asio"].ref.version) >= "1.18.0": + raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require asio < 1.18.0") + elif self.dependencies.get("boost"): + if Version(self.dependencies["boost"].ref.version) >= "1.74.0": + raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require boost < 1.74.0") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "Simple-WebSocket-Server-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(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.hpp", dst=os.path.join("include", "simple-websocket-server"), src=self._source_subfolder) + 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", "simple-websocket-server"), + src=self.source_folder) def package_info(self): - if self.options.use_asio_standalone: - self.cpp_info.defines.append('USE_STANDALONE_ASIO') + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] - def package_id(self): - self.info.header_only() + if self.options.use_asio_standalone: + self.cpp_info.defines.append("USE_STANDALONE_ASIO") diff --git a/recipes/simple-websocket-server/all/test_package/CMakeLists.txt b/recipes/simple-websocket-server/all/test_package/CMakeLists.txt index d50531ac251fb..fc5fbf247dae0 100644 --- a/recipes/simple-websocket-server/all/test_package/CMakeLists.txt +++ b/recipes/simple-websocket-server/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(simple-websocket-server REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE simple-websocket-server::simple-websocket-server) set_target_properties( ${PROJECT_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/recipes/simple-websocket-server/all/test_package/conanfile.py b/recipes/simple-websocket-server/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/simple-websocket-server/all/test_package/conanfile.py +++ b/recipes/simple-websocket-server/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" + 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/simple-websocket-server/all/test_v1_package/CMakeLists.txt b/recipes/simple-websocket-server/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/simple-websocket-server/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/simple-websocket-server/all/test_v1_package/conanfile.py b/recipes/simple-websocket-server/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/simple-websocket-server/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/simple-yaml/all/conanfile.py b/recipes/simple-yaml/all/conanfile.py index fea9f3e7e071f..afb2abee08c4c 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 506dba003a47f..08e8ff623e894 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 cbe0be23191a2..fae501d0afb9e 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 be9ad1f93084e..3e86876d293d0 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/all/conanfile.py b/recipes/sjson-cpp/all/conanfile.py index 98115a520a666..cf743b47f8442 100644 --- a/recipes/sjson-cpp/all/conanfile.py +++ b/recipes/sjson-cpp/all/conanfile.py @@ -1,34 +1,50 @@ -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 SjsonCppConan(ConanFile): name = "sjson-cpp" description = "An Simplified JSON (SJSON) C++ reader and writer" - topics = ("json", "sjson", "simplified") license = "MIT" - homepage = "https://github.com/nfrechette/sjson-cpp" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nfrechette/sjson-cpp" + topics = ("json", "sjson", "simplified", "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): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "includes")) + 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/sjson-cpp/all/test_package/CMakeLists.txt b/recipes/sjson-cpp/all/test_package/CMakeLists.txt index f5f3393af5f9a..401e13d3abd40 100644 --- a/recipes/sjson-cpp/all/test_package/CMakeLists.txt +++ b/recipes/sjson-cpp/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(sjson-cpp REQUIRED CONFIG) diff --git a/recipes/sjson-cpp/all/test_package/conanfile.py b/recipes/sjson-cpp/all/test_package/conanfile.py index 38f4483872d47..fae501d0afb9e 100644 --- a/recipes/sjson-cpp/all/test_package/conanfile.py +++ b/recipes/sjson-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" + 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/sjson-cpp/all/test_v1_package/CMakeLists.txt b/recipes/sjson-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/sjson-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/sjson-cpp/all/test_v1_package/conanfile.py b/recipes/sjson-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sjson-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/sjson-cpp/config.yml b/recipes/sjson-cpp/config.yml index a3d24ea0c5588..49ca784cf528f 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 11f0da24114c2..86286a2a911c0 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 3c49eae151250..39d52a814e37c 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 5ebc9beff7190..aff831fd45b0a 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 0ce00288cff64..d60c824527335 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 0000000000000..c99303582e711 --- /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 0000000000000..a4bcbd5587b10 --- /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 0000000000000..a3fbd51a23a25 --- /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 0000000000000..bfdc6f47fe273 --- /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 0000000000000..19d7688a6e4c0 --- /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 0000000000000..21081577ec035 --- /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 0000000000000..0d20897301b68 --- /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 0000000000000..c8d1d20a4e7d2 --- /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 0000000000000..6d9f399765e2d --- /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/snowhouse/all/conanfile.py b/recipes/snowhouse/all/conanfile.py index 8bca8ddf11dc6..ec6ca8d607092 100644 --- a/recipes/snowhouse/all/conanfile.py +++ b/recipes/snowhouse/all/conanfile.py @@ -1,28 +1,50 @@ -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 SnowHouseConan(ConanFile): name = "snowhouse" description = "An assertion library for C++" - topics = ("assertion", "header-only") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/banditcpp/snowhouse" - license = "BSL-1.0" + topics = ("assertion", "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], 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_1_0.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", 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, "*", + 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/snowhouse/all/test_package/CMakeLists.txt b/recipes/snowhouse/all/test_package/CMakeLists.txt index 33ae887aa6aea..2fd896601b32f 100644 --- a/recipes/snowhouse/all/test_package/CMakeLists.txt +++ b/recipes/snowhouse/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(snowhouse REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE snowhouse::snowhouse) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/snowhouse/all/test_package/conanfile.py b/recipes/snowhouse/all/test_package/conanfile.py index d4128b0450777..fae501d0afb9e 100644 --- a/recipes/snowhouse/all/test_package/conanfile.py +++ b/recipes/snowhouse/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" + 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/snowhouse/all/test_v1_package/CMakeLists.txt b/recipes/snowhouse/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/snowhouse/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/snowhouse/all/test_v1_package/conanfile.py b/recipes/snowhouse/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/snowhouse/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/so5extra/all/conandata.yml b/recipes/so5extra/all/conandata.yml index 18c9023e61809..3b66eb81644a0 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 080aef9395558..d9201d13883b2 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 933e0f59b04bd..6797a4d254c0a 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 38f4483872d47..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 f77c4a7405ffe..424326d97fc77 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 20ac539cce862..0000000000000 --- 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 d2eb9bdc8e4eb..9867b85e58972 100644 --- a/recipes/sobjectizer/all/conandata.yml +++ b/recipes/sobjectizer/all/conandata.yml @@ -30,3 +30,12 @@ sources: "5.7.4.3": url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.4.3.tar.gz" sha256: "ef54ec1c8c5c05a415e44a67ef02e95550b480594e459ccedab5a49d8c909a56" + "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 6ebed35c1f830..6dfd80e4c926f 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 9a72279fda74f..38c12b1dc72ca 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 38f4483872d47..a9fb96656f203 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 0000000000000..c960a336839f6 --- /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 0000000000000..9b63bd176646b --- /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 1e9d92d9b1885..648b2e28b68fb 100644 --- a/recipes/sobjectizer/config.yml +++ b/recipes/sobjectizer/config.yml @@ -19,3 +19,9 @@ versions: folder: all "5.7.4.3": 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 6b15a39df0e5f..1f10648c31235 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 7a99aaa5b5893..d4de8c6bcf502 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 de0c26b7bcf2a..a6912b42b0a98 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 28862f2194627..dd1a5b6930328 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 25320f6c19961..d5b10b1bcb9c1 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 aa516653323cf..f83f4a6a36735 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 93f899011d335..4ebb24964da6a 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 28097c1cf11a2..d6be5bd0bfdf0 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/sonic-cpp/all/conandata.yml b/recipes/sonic-cpp/all/conandata.yml new file mode 100644 index 0000000000000..d309d05a897b8 --- /dev/null +++ b/recipes/sonic-cpp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.0.0": + url: "https://github.com/bytedance/sonic-cpp/archive/refs/tags/v1.0.0.tar.gz" + sha256: "78af626fa070a2702fe9586d90617292b421d97d7ab1fe27a02cc20434467a80" +patches: + "1.0.0": + - patch_file: "patches/1.0.0-0001-use-cci.patch" + patch_description: "use cci recipes" + patch_type: "conan" diff --git a/recipes/sonic-cpp/all/conanfile.py b/recipes/sonic-cpp/all/conanfile.py new file mode 100644 index 0000000000000..8490a3d80c51b --- /dev/null +++ b/recipes/sonic-cpp/all/conanfile.py @@ -0,0 +1,79 @@ +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.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class SonicCppConan(ConanFile): + name = "sonic-cpp" + description = "A fast JSON serializing & deserializing library, accelerated by SIMD." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bytedance/sonic-cpp" + topics = ("json", "parser", "writer", "serializer", "deserializer", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def requirements(self): + cppstd = self.settings.get_safe("compiler.cppstd") + # Assume we would need it if not told otherwise + if not cppstd or cppstd < "17": + self.requires("string-view-lite/1.7.0") + + 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.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.ref} support x86, x86_64 only.") + + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC now.") + + 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( + 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.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.compiler in ["gcc", "clang", "apple-clang"]: + self.cpp_info.cxxflags.extend(["-mavx2", "-mpclmul"]) diff --git a/recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch b/recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch new file mode 100644 index 0000000000000..340323cf63a9a --- /dev/null +++ b/recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch @@ -0,0 +1,13 @@ +diff --git a/include/sonic/string_view.h b/include/sonic/string_view.h +index 67dfe2f..1fb2379 100644 +--- a/include/sonic/string_view.h ++++ b/include/sonic/string_view.h +@@ -21,7 +21,7 @@ namespace sonic_json { + using StringView = std::string_view; + } // namespace sonic_json + #else +-#include "thirdparty/string-view-lite/string_view.h" ++#include "nonstd/string_view.hpp" + namespace sonic_json { + using StringView = nonstd::string_view; + } // namespace sonic_json diff --git a/recipes/sonic-cpp/all/test_package/CMakeLists.txt b/recipes/sonic-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2af5927a3f12f --- /dev/null +++ b/recipes/sonic-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(sonic-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sonic-cpp::sonic-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sonic-cpp/all/test_package/conanfile.py b/recipes/sonic-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/sonic-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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sonic-cpp/all/test_package/test_package.cpp b/recipes/sonic-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..384ea13453551 --- /dev/null +++ b/recipes/sonic-cpp/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include "sonic/sonic.h" + +#include +#include + +int main() +{ + std::string json = R"( + { + "a": 1, + "b": 2 + } + )"; + + sonic_json::Document doc; + doc.Parse(json); + if (doc.HasParseError()) { + std::cout << "Parse failed!\n"; + } else { + std::cout << "Parse successful!\n"; + } + return 0; +} diff --git a/recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt b/recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/sonic-cpp/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/sonic-cpp/all/test_v1_package/conanfile.py b/recipes/sonic-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/sonic-cpp/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/sonic-cpp/config.yml b/recipes/sonic-cpp/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/sonic-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/sophus/all/conanfile.py b/recipes/sophus/all/conanfile.py index 7fa9bd18760cf..ef703f320333f 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 eaf5ac83b4427..b034a63a75693 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 d1ea6917fd3ef..047f359f2bb4b 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 8bf82de500d9f..0000000000000 --- 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 bce376a5fec90..73bcf839da618 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 dd8ee78498090..66a875621a86d 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/source_location/all/conanfile.py b/recipes/source_location/all/conanfile.py index cbc67bb2eac20..305de2e31b857 100644 --- a/recipes/source_location/all/conanfile.py +++ b/recipes/source_location/all/conanfile.py @@ -1,33 +1,30 @@ 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 SourceLocationConan(ConanFile): name = "source_location" + description = "source_location header for some older compilers" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Rechip/source_location" - description = "source_location header for some older compilers" - topics = ("cpp", "source_location", "header-only") - settings = ["compiler"] + topics = ("cpp", "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 source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - 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 11 @property def _minimum_compilers_version(self): @@ -38,17 +35,32 @@ def _minimum_compilers_version(self): "apple-clang": "12", } + 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, "11") - minimum_version = self._minimum_compilers_version.get( - str(self.settings.compiler), False) + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn( - "source_location requires C++11. Your compiler is unknown. Assuming it supports C++11 and required functionality.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - "source_location requires C++11 and some embedded functionality, which your compiler does not support.") + self.output.warning("source_location requires C++11. Your compiler is unknown. Assuming it supports C++11 and required functionality.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("source_location requires C++11 and some embedded functionality, 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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/source_location/all/test_package/CMakeLists.txt b/recipes/source_location/all/test_package/CMakeLists.txt index 955a59f6e9c84..27bf673b3e4ae 100644 --- a/recipes/source_location/all/test_package/CMakeLists.txt +++ b/recipes/source_location/all/test_package/CMakeLists.txt @@ -1,13 +1,10 @@ -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(source_location REQUIRED CONFIG) -find_package(source_location CONFIG REQUIRED) add_executable(${PROJECT_NAME} src/test.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE source_location::source_location) - set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/recipes/source_location/all/test_package/conanfile.py b/recipes/source_location/all/test_package/conanfile.py index cbe0be23191a2..fae501d0afb9e 100644 --- a/recipes/source_location/all/test_package/conanfile.py +++ b/recipes/source_location/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/source_location/all/test_v1_package/CMakeLists.txt b/recipes/source_location/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/source_location/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/source_location/all/test_v1_package/conanfile.py b/recipes/source_location/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cbe0be23191a2 --- /dev/null +++ b/recipes/source_location/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + self.cmake = CMake(self) + self.cmake.configure() + 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) diff --git a/recipes/source_location/all/test_v1_package/src/test.cpp b/recipes/source_location/all/test_v1_package/src/test.cpp new file mode 100644 index 0000000000000..1e3734bb24378 --- /dev/null +++ b/recipes/source_location/all/test_v1_package/src/test.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() { + constexpr auto loc = std::source_location::current(); + + return loc.line() == 5 ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/soxr/all/conanfile.py b/recipes/soxr/all/conanfile.py index d9c0a77657c80..452e658b2375d 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/conandata.yml b/recipes/spdlog/all/conandata.yml index 60c6a1f3b520c..be20cdd979110 100644 --- a/recipes/spdlog/all/conandata.yml +++ b/recipes/spdlog/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.13.0": + url: "https://github.com/gabime/spdlog/archive/v1.13.0.tar.gz" + sha256: "534f2ee1a4dcbeb22249856edfb2be76a1cf4f708a20b0ac2ed090ee24cfdbc9" + "1.12.0": + url: "https://github.com/gabime/spdlog/archive/v1.12.0.tar.gz" + sha256: "4dccf2d10f410c1e2feaff89966bfc49a1abb29ef6f08246335b110e001e09a9" "1.11.0": url: "https://github.com/gabime/spdlog/archive/v1.11.0.tar.gz" sha256: "ca5cae8d6cac15dae0ec63b21d6ad3530070650f68076f3a4a862ca293a858bb" @@ -8,6 +14,15 @@ sources: "1.9.2": url: "https://github.com/gabime/spdlog/archive/v1.9.2.tar.gz" sha256: "6fff9215f5cb81760be4cc16d033526d1080427d236e86d70bb02994f85e3d38" + "1.9.1": + url: "https://github.com/gabime/spdlog/archive/v1.9.1.tar.gz" + sha256: "9a452cfa24408baccc9b2bc2d421d68172a7630c99e9504a14754be840d31a62" "1.8.5": url: "https://github.com/gabime/spdlog/archive/v1.8.5.tar.gz" sha256: "944d0bd7c763ac721398dca2bb0f3b5ed16f67cef36810ede5061f35a543b4b8" +patches: + "1.11.0": + - patch_file: "patches/1.11.0-0001-fix-fmt10-build.patch" + patch_description: "Fix fmt 10.0.0 build" + patch_type: "conan" + patch_source: "https://github.com/gabime/spdlog/pull/2694" diff --git a/recipes/spdlog/all/conanfile.py b/recipes/spdlog/all/conanfile.py index 7c21d2c9559c3..82eb2fb07b1de 100644 --- a/recipes/spdlog/all/conanfile.py +++ b/recipes/spdlog/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.files import get, copy, rmdir, replace_in_file, apply_conandata_patches, export_conandata_patches from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version import os @@ -36,6 +36,9 @@ class SpdlogConan(ConanFile): "no_exceptions": False, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -53,8 +56,10 @@ def requirements(self): self_version = Version(self.version) fmt_version = "7.1.3" - if self_version >= "1.11.0": - fmt_version = "9.1.0" + if self_version >= "1.12.0": + fmt_version = "10.2.0" + elif self_version >= "1.11.0": + fmt_version = "10.0.0" elif self_version >= "1.10.0": fmt_version = "8.1.1" elif self_version >= "1.9.0": @@ -106,6 +111,7 @@ def _disable_werror(self): replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), "/WX", "") def build(self): + apply_conandata_patches(self) self._disable_werror() if not self.options.header_only: cmake = CMake(self) @@ -138,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/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch b/recipes/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch new file mode 100644 index 0000000000000..613990e4eb052 --- /dev/null +++ b/recipes/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch @@ -0,0 +1,34 @@ +From 576210a1363822a132657090b9f37e305bd0e2c2 Mon Sep 17 00:00:00 2001 +From: pwqbot +Date: Tue, 20 Jun 2023 10:41:48 +0800 +Subject: [PATCH] fix fmt build + +--- + include/spdlog/common.h | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/include/spdlog/common.h b/include/spdlog/common.h +index f97fd48c..00f4d728 100644 +--- a/include/spdlog/common.h ++++ b/include/spdlog/common.h +@@ -160,12 +160,19 @@ using format_string_t = fmt::format_string; + template + using remove_cvref_t = typename std::remove_cv::type>::type; + ++template ++# if FMT_VERSION >= 90101 ++using fmt_runtime_string = fmt::runtime_format_string; ++# else ++using fmt_runtime_string = fmt::basic_runtime; ++# endif ++ + // clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the condition from basic_format_string here, + // in addition, fmt::basic_runtime is only convertible to basic_format_string but not basic_string_view + template + struct is_convertible_to_basic_format_string + : std::integral_constant>::value || std::is_same, fmt::basic_runtime>::value> ++ std::is_convertible>::value || std::is_same, fmt_runtime_string>::value> + {}; + + # if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) diff --git a/recipes/spdlog/config.yml b/recipes/spdlog/config.yml index 2efd56b833781..86f1d33d1c720 100644 --- a/recipes/spdlog/config.yml +++ b/recipes/spdlog/config.yml @@ -1,9 +1,15 @@ versions: + "1.13.0": + folder: "all" + "1.12.0": + folder: "all" "1.11.0": folder: "all" "1.10.0": folder: "all" "1.9.2": folder: "all" + "1.9.1": + folder: "all" "1.8.5": folder: "all" diff --git a/recipes/spectra/all/conanfile.py b/recipes/spectra/all/conanfile.py index 084f85d8c4950..7f108912c8a5c 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 62c01a02172b5..124af978201fc 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 9334dea225892..0000000000000 --- 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 5a9c531331845..0000000000000 --- 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 1e4e265cd5154..0000000000000 --- 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 70c5857924141..0000000000000 --- 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 a557c0bb6d254..fee2421b06ee6 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 c9233e5ff87a6..44f2fdcf490ab 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 852af3d493684..854ef17328263 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 cb5c705d100c0..f615fa9738359 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 f29ee8c3fbf96..aec3e6ece4050 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 efb00f02f9f61..5530f21ad5289 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 292ee24f61cbb..87519b61c9623 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 85ea4e8fd6a62..69403c56106cb 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 375acd44db4e0..e4a33c59e2c81 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 0000000000000..0746373586081 --- /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 57a887729c2ab..74b40e9de2d7f 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 1c771e01ba689..a6f870e23b894 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 8b2584d0bea74..d61f784a9ae42 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 fcf18155285d5..1a94b824ea1f5 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 5741e4e0cec54..a2566c4cce099 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 0000000000000..91630d79f4abb --- /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 0000000000000..84b7364551610 --- /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 efde056fcf092..d1238ae4e2a8d 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 50ef72c5285ab..8f761c32c82b7 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 90bb95e386b2e..23fa807bf57d5 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 9f7fc37611e76..a10675f041108 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 70dd5900f9a1a..c0bfff9f89eee 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 71f5731f373e2..b3381f7005ac8 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 217b9530b904d..0000000000000 --- 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 6f7198fb9a268..9beca69bcc840 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 964d73c54cc6d..ceff1e9e63969 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 e9244768a488a..4404ff45a4a13 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 33ae887aa6aea..b337307874b0e 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 008c4dc3fb8e3..ad0d5f8f22ebd 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 0000000000000..91630d79f4abb --- /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 0000000000000..2e455dff72b5e --- /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 08915d57967e4..6b607672eff4f 100644 --- a/recipes/sqlpp11/all/conandata.yml +++ b/recipes/sqlpp11/all/conandata.yml @@ -1,13 +1,16 @@ sources: - "0.58": - url: "https://github.com/rbock/sqlpp11/archive/0.58.zip" - sha256: 8e2ba487b7a0ddc988bcfa5366443a0f5ca9f38ef86ac8e3f257801ab3cbf8eb - "0.59": - url: "https://github.com/rbock/sqlpp11/archive/0.59.zip" - sha256: 62ba9ba078e05901aa47cb056240bb474f9b8ef5cabf114f8219b4a6fa4f019b - "0.60": - url: "https://github.com/rbock/sqlpp11/archive/0.60.zip" - sha256: 27ccc750d5eb8f234445e26e41d53d72c9df329eb2b30d64dbf21078ae57c52c + "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" + "0.62": + url: "https://github.com/rbock/sqlpp11/archive/0.62.tar.gz" + sha256: "6d8326e94c5b14a863ead15688d853ab7854136caa9ebc47389a833fe79db7c5" "0.61": url: "https://github.com/rbock/sqlpp11/archive/0.61.tar.gz" sha256: "d5a95e28ae93930f7701f517b1342ac14bcf33a9b1c5b5f0dff6aea5e315bb50" + "0.60": + url: "https://github.com/rbock/sqlpp11/archive/0.60.zip" + sha256: 27ccc750d5eb8f234445e26e41d53d72c9df329eb2b30d64dbf21078ae57c52c diff --git a/recipes/sqlpp11/all/conanfile.py b/recipes/sqlpp11/all/conanfile.py index 384cf91a4b695..9b3a725b38559 100644 --- a/recipes/sqlpp11/all/conanfile.py +++ b/recipes/sqlpp11/all/conanfile.py @@ -1,8 +1,12 @@ -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 get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class Sqlpp11Conan(ConanFile): @@ -12,60 +16,53 @@ class Sqlpp11Conan(ConanFile): homepage = "https://github.com/rbock/sqlpp11" description = "A type safe SQL template library for C++" topics = ("sql", "dsl", "embedded", "data-base") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _min_stdcpp_version(self): - return 11 if tools.Version(self.version) < "0.61" else 14 + def _min_cppstd(self): + return 11 if Version(self.version) < "0.61" else 14 @property def _compilers_minimum_version(self): return { "gcc": "5", "Visual Studio": "14", + "msvc": "190", "clang": "3.4", "apple-clang": "10", } + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): self.requires("date/3.0.1") - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, self._min_stdcpp_version) - - if self._min_stdcpp_version > 11: - 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(f"{self.name} requires C++14, which your compiler does not support.") - else: - self.output.warn(f"{self.name} requires C++14. Your compiler is unknown. Assuming it supports C++14.") - 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) + 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", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*", dst="bin", src=os.path.join(self._source_subfolder, "scripts")) + copy(self, pattern="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, "bin"), src=os.path.join(self.source_folder, "scripts")) def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "Sqlpp11" - self.cpp_info.filenames["cmake_find_package_multi"] = "Sqlpp11" + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "Sqlpp11") + self.cpp_info.set_property("cmake_target_name", "sqlpp11::sqlpp11") - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/sqlpp11/all/test_package/CMakeLists.txt b/recipes/sqlpp11/all/test_package/CMakeLists.txt index 209e56f42630d..6c3b3cedf8364 100644 --- a/recipes/sqlpp11/all/test_package/CMakeLists.txt +++ b/recipes/sqlpp11/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -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(TARGETS) +find_package(Sqlpp11 REQUIRED CONFIG) -find_package(Sqlpp11 CONFIG REQUIRED) - -add_executable(example example.cpp) -set_property(TARGET example PROPERTY CXX_STANDARD 14) -target_link_libraries(example sqlpp11::sqlpp11) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sqlpp11::sqlpp11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sqlpp11/all/test_package/conanfile.py b/recipes/sqlpp11/all/test_package/conanfile.py index 11eb01c13ada3..3a91c9439218e 100644 --- a/recipes/sqlpp11/all/test_package/conanfile.py +++ b/recipes/sqlpp11/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 Sqlpp11TestConan(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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) 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/sqlpp11/all/test_package/example.cpp b/recipes/sqlpp11/all/test_package/example.cpp deleted file mode 100644 index 9b0644427156d..0000000000000 --- a/recipes/sqlpp11/all/test_package/example.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() -{ - sqlpp::connection c; -} diff --git a/recipes/sqlpp11/all/test_package/test_package.cpp b/recipes/sqlpp11/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aa306d637efdd --- /dev/null +++ b/recipes/sqlpp11/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include +#include + +int main() { + select(sqlpp::value(false).as(sqlpp::alias::a)); + return EXIT_SUCCESS; +} diff --git a/recipes/sqlpp11/all/test_v1_package/CMakeLists.txt b/recipes/sqlpp11/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/sqlpp11/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/sqlpp11/all/test_v1_package/conanfile.py b/recipes/sqlpp11/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..37ada808989d9 --- /dev/null +++ b/recipes/sqlpp11/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +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", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sqlpp11/config.yml b/recipes/sqlpp11/config.yml index a51d2c88cb4ae..cd4a669a1a8d7 100644 --- a/recipes/sqlpp11/config.yml +++ b/recipes/sqlpp11/config.yml @@ -1,9 +1,11 @@ versions: - "0.58": + "0.64": folder: "all" - "0.59": + "0.63": folder: "all" - "0.60": + "0.62": folder: "all" "0.61": folder: "all" + "0.60": + folder: "all" diff --git a/recipes/ssht/all/conandata.yml b/recipes/ssht/all/conandata.yml index 077fff5429d55..dab3a69b6f7e9 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 bbf74c31ff0c0..aa4695a01d154 100644 --- a/recipes/ssht/all/conanfile.py +++ b/recipes/ssht/all/conanfile.py @@ -1,9 +1,13 @@ from conan import ConanFile -from conan.tools import files from conan.errors import ConanInvalidConfiguration -from conans import CMake +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.50.0" class SshtConan(ConanFile): name = "ssht" @@ -13,47 +17,51 @@ class SshtConan(ConanFile): description = "Fast spin spherical harmonic transforms" settings = "os", "arch", "compiler", "build_type" topics = ("physics", "astrophysics", "radio interferometry") + package_type = "static-library" options = {"fPIC": [True, False]} default_options = {"fPIC": True} - requires = "fftw/3.3.9" - generators = "cmake", "cmake_find_package", "cmake_paths" - exports_sources = ["CMakeLists.txt"] - @property - def _source_subfolder(self): - return "source_subfolder" + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC - @property - def _build_subfolder(self): - return "build_subfolder" + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("fftw/3.3.10") - def config_options(self): - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - def validate(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("SSHT requires C99 support for complex numbers.") def source(self): - files.get(self, **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["tests"] = False - self._cmake.definitions["python"] = 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.cache_variables["tests"] = False + tc.cache_variables["python"] = 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, 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 = ["ssht"] diff --git a/recipes/ssht/all/test_package/CMakeLists.txt b/recipes/ssht/all/test_package/CMakeLists.txt index dfe499c06a976..ef70db67c0029 100644 --- a/recipes/ssht/all/test_package/CMakeLists.txt +++ b/recipes/ssht/all/test_package/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package LANGUAGES C) find_package(Ssht REQUIRED NO_MODULE) add_executable(${PROJECT_NAME} example.c) target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) -target_link_libraries(${PROJECT_NAME} ssht::ssht) +target_link_libraries(${PROJECT_NAME} PRIVATE ssht::ssht) diff --git a/recipes/ssht/all/test_package/conanfile.py b/recipes/ssht/all/test_package/conanfile.py index 4930d744506dc..ef5d7042163ec 100644 --- a/recipes/ssht/all/test_package/conanfile.py +++ b/recipes/ssht/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 -class SshtTestConan(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 configure(self): - del self.settings.compiler.libcxx + 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 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/ssht/config.yml b/recipes/ssht/config.yml index fc50f8a9c5846..aca406dbf9f3f 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 0000000000000..72dce2c480ffe --- /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 0000000000000..16b88f523f6b2 --- /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/6.0.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 0000000000000..16a9ddec50721 --- /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 0000000000000..e845ae751a301 --- /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 0000000000000..f3a0c45ba8513 --- /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 0000000000000..bd3f43d241a52 --- /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 2654379b52b95..0f32eb68fb548 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 bce4a94d44821..221a27bafd9ef 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 5d1d0c318d32c..ef5d7042163ec 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 661745efcb3f0..c0c0739831fe0 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 540bdbac942b9..7c777ca96ad4c 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 8542dee027505..a0248de0acece 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 a87f93d04cdef..a7dd10bef0b55 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 bfb07935d0412..3db9bf640436f 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 0000000000000..d3b13dcffb9ee --- /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 0000000000000..3b575a7ddbf0b --- /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 0000000000000..34e0429d48408 --- /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 0000000000000..7dfe706fa8ef8 --- /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 0000000000000..a42458e26851c --- /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 0000000000000..179d561335ad3 --- /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 0000000000000..754072b6056b3 --- /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 0000000000000..bdcd95e9feb1e --- /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 0000000000000..dc4730565ae0e --- /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 0000000000000..87d3c025b094b --- /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 0000000000000..73334d8cce8e6 --- /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 cb02ec2f29148..106008491388a 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 f5148b86a236f..740dfa380f1ad 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 0000000000000..840c78174c772 --- /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 0000000000000..fae5f65b66c25 --- /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/stlab/all/conandata.yml b/recipes/stlab/all/conandata.yml index cde4739b5d32c..5b3683503f4d0 100644 --- a/recipes/stlab/all/conandata.yml +++ b/recipes/stlab/all/conandata.yml @@ -1,16 +1,4 @@ sources: - "1.6.2": - url: "https://github.com/stlab/libraries/archive/v1.6.2.tar.gz" - sha256: "d0369d889c7bf78068d0c4f4b5125d7e9fe9abb0ad7a3be35bf13b6e2c271676" - "1.5.6": - url: "https://github.com/stlab/libraries/archive/refs/tags/v1.5.6.tar.gz" - sha256: "a6b788848be637b6d6c471de76c38486789e708997648e9b9731fdb5a631030c" - "1.5.5": - url: "https://github.com/stlab/libraries/archive/v1.5.5.tar.gz" - sha256: "30ec5a36b4c074feac72a1b9a744f0b279010e18c7bb04bbdc5d44fe9eaf5ad8" - "1.5.4": - url: "https://github.com/stlab/libraries/archive/v1.5.4.tar.gz" - sha256: "87306f58f6614f4a1ca54dda52fedff7e610d3b3dae035829657bac77bc33640" - "1.5.2": - url: https://github.com/stlab/libraries/archive/v1.5.2.tar.gz - sha256: a82eb013e51d0bb3ee2050f0eda31e11997cb4ca74d2abfdc2c8249c5c67c9fb + "1.7.1": + url: "https://github.com/stlab/libraries/archive/refs/tags/v1.7.1.tar.gz" + sha256: "0160b5f7be7d423100a9a8b205a99285b106dd438f806978028a82b9f01c6b64" diff --git a/recipes/stlab/all/conanfile.py b/recipes/stlab/all/conanfile.py index b315741f04d56..b78d535f7ef8e 100644 --- a/recipes/stlab/all/conanfile.py +++ b/recipes/stlab/all/conanfile.py @@ -1,180 +1,179 @@ -from conans import ConanFile, tools -from conans.tools import Version -from conans.errors import ConanInvalidConfiguration 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, get, rm, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + class Stlab(ConanFile): name = 'stlab' description = 'The Software Technology Lab libraries.' url = 'https://github.com/conan-io/conan-center-index' homepage = 'https://github.com/stlab/libraries' license = 'BSL-1.0' - topics = 'conan', 'c++', 'concurrency', 'futures', 'channels' - - settings = "arch", "os", "compiler", "build_type", - + topics = 'concurrency', 'futures', 'channels' + settings = "arch", "os", "compiler", "build_type", options = { - "boost_optional": [True, False], - "boost_variant": [True, False], - "coroutines": [True, False], - "task_system": ["portable", "libdispatch", "emscripten", "pnacl", "windows", "auto"], + "with_boost": [True, False], + "no_std_coroutines": [True, False], + "future_coroutines": [True, False], + "task_system": ["portable", "libdispatch", "emscripten", "pnacl", "windows"], + "thread_system": ["win32", "pthread", "pthread-emscripten", "pthread-apple", "none"], } - default_options = { - "boost_optional": False, - "boost_variant": False, - "coroutines": False, - "task_system": "auto", + "with_boost": False, + "no_std_coroutines": True, + "future_coroutines": False + # Handle default value for `thread_system` in `config_options` method + # Handle default value for `task_system` in `config_options` method } + package_type = "header-library" + short_paths = True - no_copy_source = True - _source_subfolder = 'source_subfolder' + def config_options(self): + self.options.thread_system = {"Macos": "pthread-apple", + "Linux": "pthread", + "Windows": "win32", + "Emscripten": "pthread-emscripten"}.get(str(self.settings.os), "none") + self.options.task_system = {"Macos": "libdispatch", + "Windows": "windows"}.get(str(self.settings.os), "portable") - def _use_boost(self): - return self.options.boost_optional or self.options.boost_variant + @property + def _minimum_cpp_standard(self): + return 17 - def _requires_libdispatch(self): - # On macOS it is not necessary to use the libdispatch conan package, because the library is - # included in the OS. - return self.options.task_system == "libdispatch" and self.settings.os != "Macos" + @property + def _compilers_minimum_version(self): + return {"gcc": "9", + "clang": "8", + "apple-clang": "13"} + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.23.3]") def requirements(self): - if self._use_boost(): - self.requires("boost/1.75.0") + if self.options.with_boost: + self.requires("boost/1.82.0") - if self._requires_libdispatch(): + # On macOS, it is not necessary to use the libdispatch conan package, because the library is + # included in the OS. + if self.options.task_system == "libdispatch" and self.settings.os != "Macos": self.requires("libdispatch/5.3.2") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "libraries-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def _fix_boost_components(self): - if self.settings.os != "Macos": return - if self.settings.compiler != "apple-clang": return - if Version(self.settings.compiler.version) >= "12": return - - # - # On Apple we have to force the usage of boost.variant, because Apple's implementation of C++17 is not complete. - # - self.output.info("Apple-Clang versions less than 12 do not correctly support std::optional or std::variant, so we will use boost::optional and boost::variant instead.") - self.options.boost_optional = True - self.options.boost_variant = True - - def _default_task_system(self): - if self.settings.os == "Macos": - return "libdispatch" - - if self.settings.os == "Windows": - return "windows" - - if self.settings.os == "Emscripten": - return "emscripten" - - return "portable" - - def _validate_task_system_libdispatch(self): - if self.settings.os == "Linux": - if self.settings.compiler != "clang": - raise ConanInvalidConfiguration("{}/{} task_system=libdispatch needs Clang compiler when using OS: {}. Use Clang compiler or switch to task_system=portable or task_system=auto".format(self.name, self.version, self.settings.os)) - elif self.settings.os != "Macos": - raise ConanInvalidConfiguration("{}/{} task_system=libdispatch is not supported on {}. Try using task_system=auto".format(self.name, self.version, self.settings.os)) - - def _validate_task_system_windows(self): - if self.settings.os != "Windows": - self.output.info("Libdispatch is not supported on {}. The task system is changed to {}.".format(self.settings.os, self.options.task_system)) - raise ConanInvalidConfiguration("{}/{} task_system=windows is not supported on {}. Try using task_system=auto".format(self.name, self.version, self.settings.os)) - - def _validate_task_system_emscripten(self): - if self.settings.os != "Emscripten": - raise ConanInvalidConfiguration("{}/{} task_system=emscripten is not supported on {}. Try using task_system=auto".format(self.name, self.version, self.settings.os)) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def _validate_task_system(self): if self.options.task_system == "libdispatch": - self._validate_task_system_libdispatch() - elif self.options.task_system == "windows": - self._validate_task_system_windows() - elif self.options.task_system == "emscripten": - self._validate_task_system_emscripten() + if self.settings.os == "Linux" and self.settings.compiler != "clang": + raise ConanInvalidConfiguration(f"{self.ref} task_system=libdispatch needs Clang compiler when using OS: {self.settings.os}." + f" Use Clang compiler or switch to task_system=portable") + elif self.settings.os != "Macos": + raise ConanInvalidConfiguration(f"{self.ref} task_system=libdispatch is not supported on {self.settings.os}") + elif self.options.task_system == "windows" and self.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} task_system=windows is not supported on {self.settings.os}") + + def _validate_thread_system(self): + if any([self.options.thread_system == "pthread-apple" and self.settings.os != "Macos", + self.options.thread_system == "pthread" and self.settings.os != "Linux", + self.options.thread_system == "win32" and self.settings.os != "Windows", + self.options.thread_system == "pthread-emscripten" and self.settings.os != "Emscripten"]): + raise ConanInvalidConfiguration(f"{self.ref} thread_system={self.options.thread_system} is not supported on {self.settings.os}") def _validate_boost_components(self): - if self.settings.os != "Macos": return - if self.settings.compiler != "apple-clang": return - if Version(self.settings.compiler.version) >= "12": return - if self.options.boost_optional and self.options.boost_variant: return - # - # On Apple we have to force the usage of boost.variant, because Apple's implementation of C++17 - # is not complete. - # - msg = "Apple-Clang versions less than 12 do not correctly support std::optional or std::variant, so we will use boost::optional and boost::variant instead. " - if not self.options.boost_optional and not self.options.boost_variant: - msg += "Try -o boost_optional=True -o boost_variant=True" - elif not self.options.boost_optional: - msg += "Try -o boost_optional=True." + if not any([self.settings.os != "Macos", self.settings.compiler != "apple-clang", + Version(str(self.settings.compiler.version)) >= "12", self.options.with_boost]): + # On Apple we have to force the usage of boost.variant and boost.optional, because Apple's implementation of C++17 + # is not complete. + raise ConanInvalidConfiguration( + f"Compiler Apple-Clang < 12 versions do not correctly support std::optional or std::variant, " + f"so we will use boost::optional and boost::variant instead. Try -o {self.ref}:with_boost=True.") + + def _validate_min_compiler_version(self): + if is_msvc(self): + check_min_vs(self, "192") else: - msg += "Try -o boost_variant=True." - - raise ConanInvalidConfiguration(msg) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn(f"{self.ref} requires C++{self._minimum_cpp_standard}. " + f"Your compiler is unknown. Assuming it supports C++{self._minimum_cpp_standard}.") + elif Version(str(self.settings.compiler.version)) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, " + f"which your compiler does not support.") + if self.settings.compiler == "clang" and str(self.settings.compiler.version) in ("13", "14"): + raise ConanInvalidConfiguration( + f"{self.ref} currently does not work with Clang {self.settings.compiler.version} on CCI, it enters " + f"in an infinite build loop (smells like a compiler bug). Contributions are welcomed!") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, '17') - - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9": - raise ConanInvalidConfiguration("Need GCC >= 9") - - if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "8": - raise ConanInvalidConfiguration("Need Clang >= 8") - - if self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) < "15.8": - raise ConanInvalidConfiguration("Need Visual Studio >= 2017 15.8 (MSVC 19.15)") - - # Actually, we want *at least* 15.8 (MSVC 19.15), but we cannot check this for now with Conan. - if self.settings.compiler == "msvc" and Version(self.settings.compiler.version) < "19.15": - raise ConanInvalidConfiguration("Need msvc >= 19.15") + check_min_cppstd(self, self._minimum_cpp_standard) + self._validate_min_compiler_version() self._validate_task_system() + self._validate_thread_system() self._validate_boost_components() def configure(self): - if self.options.task_system == "auto": - self.options.task_system = self._default_task_system() - self.output.info("Stlab Task System: {}.".format(self.options.task_system)) + self.output.info("STLab With Boost: {}.".format(self.options.with_boost)) + self.output.info("STLab Future Coroutines: {}.".format(self.options.future_coroutines)) + self.output.info("STLab No Standard Coroutines: {}.".format(self.options.no_std_coroutines)) + self.output.info("STLab Task System: {}.".format(self.options.task_system)) + self.output.info("STLab Thread System: {}.".format(self.options.thread_system)) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables['BUILD_TESTING'] = not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + tc.variables["STLAB_USE_BOOST_CPP17_SHIMS"] = self.options.with_boost + tc.variables["STLAB_NO_STD_COROUTINES"] = self.options.no_std_coroutines + tc.variables["STLAB_THREAD_SYSTEM"] = self.options.thread_system + tc.variables["STLAB_TASK_SYSTEM"] = self.options.task_system + if cross_building(self): + tc.variables["STLAB_HAVE_FUNCTIONAL_VARIANT_OPTIONAL"] = True + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy("*LICENSE", dst="licenses", keep_path=False) - self.copy("stlab/*", src=self._source_subfolder, dst='include/') + 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")) + rm(self, "msvcp*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "concrt*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "vcruntime*.dll", os.path.join(self.package_folder, "bin")) def package_id(self): - self.info.header_only() - self.info.options.boost_optional = "ANY" - self.info.options.boost_variant = "ANY" + # TODO: is header only but needs a header modified by cmake + # self.info.settings.clear() + # self.info.header_only() + pass def package_info(self): - coroutines_value = 1 if self.options.coroutines else 0 + future_coroutines_value = 1 if self.options.future_coroutines else 0 self.cpp_info.defines = [ - 'STLAB_FUTURE_COROUTINES={}'.format(coroutines_value) + 'STLAB_FUTURE_COROUTINES={}'.format(future_coroutines_value) ] - if self.options.boost_optional: - self.cpp_info.defines.append("STLAB_FORCE_BOOST_OPTIONAL") - - if self.options.boost_variant: - self.cpp_info.defines.append("STLAB_FORCE_BOOST_VARIANT") - - if self.options.task_system == "portable": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_PORTABLE") - elif self.options.task_system == "libdispatch": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_LIBDISPATCH") - elif self.options.task_system == "emscripten": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_EMSRIPTEN") #Note: there is a typo in Stlab Cmake. - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_EMSCRIPTEN") #Note: for typo fix in later versions - elif self.options.task_system == "pnacl": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_PNACL") - elif self.options.task_system == "windows": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_WINDOWS") + if self.settings.os == "Windows": + self.cpp_info.defines = ['NOMINMAX'] if self.settings.os == "Linux": self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/stlab/all/test_package/CMakeLists.txt b/recipes/stlab/all/test_package/CMakeLists.txt index 98fa8e5af1b41..b52ae3503ebad 100644 --- a/recipes/stlab/all/test_package/CMakeLists.txt +++ b/recipes/stlab/all/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) -set(CMAKE_CXX_STANDARD 17) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package CXX) # if the project uses c++ +find_package(stlab REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_compile_definitions( ${PROJECT_NAME} INTERFACE $<$:NOMINMAX> ) +target_link_libraries(${PROJECT_NAME} PRIVATE stlab::stlab) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + diff --git a/recipes/stlab/all/test_package/conanfile.py b/recipes/stlab/all/test_package/conanfile.py index bd7165a553cf4..ab351a264621f 100644 --- a/recipes/stlab/all/test_package/conanfile.py +++ b/recipes/stlab/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -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 + 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 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/stlab/all/test_package/test_package.cpp b/recipes/stlab/all/test_package/test_package.cpp index cbf630bd2f9a3..b125ed3c4bd3d 100644 --- a/recipes/stlab/all/test_package/test_package.cpp +++ b/recipes/stlab/all/test_package/test_package.cpp @@ -16,6 +16,8 @@ int main() { while (!f.get_try()) { this_thread::sleep_for(chrono::milliseconds(1)); } cout << "The answer is " << *f.get_try() << "\n"; + + stlab::pre_exit(); } /* diff --git a/recipes/stlab/config.yml b/recipes/stlab/config.yml index 28a287ac4f61d..4821864cf318a 100644 --- a/recipes/stlab/config.yml +++ b/recipes/stlab/config.yml @@ -1,11 +1,3 @@ versions: - "1.6.2": - folder: all - "1.5.6": - folder: all - "1.5.5": - folder: all - "1.5.4": - folder: all - "1.5.2": + "1.7.1": folder: all diff --git a/recipes/streamvbyte/all/conandata.yml b/recipes/streamvbyte/all/conandata.yml new file mode 100644 index 0000000000000..6ecc44a071052 --- /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 0000000000000..e296e0b170799 --- /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 0000000000000..99ab62225b638 --- /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 0000000000000..5d52b1fe170f0 --- /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 0000000000000..531d5c3182e36 --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..bda2ad161f942 --- /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 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/streamvbyte/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/stringtoolbox/all/conanfile.py b/recipes/stringtoolbox/all/conanfile.py index c1426333ba094..1753e2bcb8a5f 100644 --- a/recipes/stringtoolbox/all/conanfile.py +++ b/recipes/stringtoolbox/all/conanfile.py @@ -1,31 +1,41 @@ -from conans 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 +import os + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.33.0" class DawHeaderLibrariesConan(ConanFile): name = "stringtoolbox" - license = "MIT" description = "A simple header-only, single-file string toolbox library for C++." - topics = ("string", "header-only",) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/chrberger/stringtoolbox" - settings = "os", "arch", "compiler", "build_type", + topics = ("string", "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 validate(self): if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "11") - - def package_id(self): - self.info.header_only() + 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 package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("stringtoolbox.hpp", "include", self._source_subfolder) + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "stringtoolbox.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/stringtoolbox/all/test_package/CMakeLists.txt b/recipes/stringtoolbox/all/test_package/CMakeLists.txt index 76fbeefd9810e..012002471f6a4 100644 --- a/recipes/stringtoolbox/all/test_package/CMakeLists.txt +++ b/recipes/stringtoolbox/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(stringtoolbox CONFIG REQUIRED) +find_package(stringtoolbox REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} stringtoolbox::stringtoolbox) diff --git a/recipes/stringtoolbox/all/test_package/conanfile.py b/recipes/stringtoolbox/all/test_package/conanfile.py index de03d357e14e0..ef5d7042163ec 100644 --- a/recipes/stringtoolbox/all/test_package/conanfile.py +++ b/recipes/stringtoolbox/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 DawHeaderLibrariesTestConan(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/stringzilla/all/conandata.yml b/recipes/stringzilla/all/conandata.yml new file mode 100644 index 0000000000000..182ba818238f7 --- /dev/null +++ b/recipes/stringzilla/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.0.4": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v2.0.4.tar.gz" + sha256: "440d3d586f8cfe96bc7648f01f2d3c514c4e2dc22446caeb50599383d1970ed2" + "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 0000000000000..bded9fa3b6426 --- /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 0000000000000..6769ff716eab8 --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..c5ffe699dbc06 --- /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 0000000000000..c0ea771b63446 --- /dev/null +++ b/recipes/stringzilla/config.yml @@ -0,0 +1,11 @@ +versions: + "2.0.4": + folder: all + "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 3e0188fb65a1e..6f362b86eb346 100644 --- a/recipes/strong_type/all/conandata.yml +++ b/recipes/strong_type/all/conandata.yml @@ -1,13 +1,22 @@ sources: - "v7": - url: https://github.com/rollbear/strong_type/archive/refs/tags/v7.tar.gz - sha256: 854365b28dfaaee5c2047dd4d2e746c809b76035191b22a4ce24f4cac49d0891 - "v8": - url: https://github.com/rollbear/strong_type/archive/refs/tags/v8.tar.gz - sha256: 31ee68e097fec2ce65dbf2ed683911c5ee6a7a37808b28d84479ef7e17990fad - "v9": - url: https://github.com/rollbear/strong_type/archive/refs/tags/v9.tar.gz - sha256: 9d71ee02256b99c7f0189295514dd683cc1be8886444d5c04623fd491cf5aa40 + "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" "v10": - url: https://github.com/rollbear/strong_type/archive/refs/tags/v10.tar.gz - sha256: 154e4ceda6cf8fe734deb7eafdf58df5052822d04425dc7c22711ef54cdaeefa + url: "https://github.com/rollbear/strong_type/archive/refs/tags/v10.tar.gz" + sha256: "154e4ceda6cf8fe734deb7eafdf58df5052822d04425dc7c22711ef54cdaeefa" + "v9": + url: "https://github.com/rollbear/strong_type/archive/refs/tags/v9.tar.gz" + sha256: "9d71ee02256b99c7f0189295514dd683cc1be8886444d5c04623fd491cf5aa40" + "v8": + url: "https://github.com/rollbear/strong_type/archive/refs/tags/v8.tar.gz" + sha256: "31ee68e097fec2ce65dbf2ed683911c5ee6a7a37808b28d84479ef7e17990fad" + "v7": + url: "https://github.com/rollbear/strong_type/archive/refs/tags/v7.tar.gz" + sha256: "854365b28dfaaee5c2047dd4d2e746c809b76035191b22a4ce24f4cac49d0891" diff --git a/recipes/strong_type/all/conanfile.py b/recipes/strong_type/all/conanfile.py index 04af76b6e1170..a5d80e301881b 100644 --- a/recipes/strong_type/all/conanfile.py +++ b/recipes/strong_type/all/conanfile.py @@ -11,29 +11,33 @@ class StrongTypeConan(ConanFile): name = "strong_type" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/rollbear/strong_type" description = "An additive strong typedef library for C++14/17/20" - topics = ("cpp14", "cpp17", "strong_type") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rollbear/strong_type" + topics = ("cpp14", "cpp17", "strong_type", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 14 + + 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) + check_min_cppstd(self, self._min_cppstd) if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": raise ConanInvalidConfiguration("GCC < version 7 is 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 @@ -49,9 +53,12 @@ def package_info(self): self.cpp_info.set_property( "cmake_target_name", "rollbear::strong_type") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] + + self.cpp_info.components["strong_type"].set_property( + "cmake_target_name", "rollbear::strong_type") + self.cpp_info.components["strong_type"].bindirs = [] + self.cpp_info.components["strong_type"].libdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "strong_type" @@ -60,9 +67,3 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "rollbear" self.cpp_info.components["strong_type"].names["cmake_find_package"] = "strong_type" self.cpp_info.components["strong_type"].names["cmake_find_package_multi"] = "strong_type" - self.cpp_info.components["strong_type"].set_property( - "cmake_target_name", "rollbear::strong_type") - self.cpp_info.components["strong_type"].bindirs = [] - self.cpp_info.components["strong_type"].frameworkdirs = [] - self.cpp_info.components["strong_type"].libdirs = [] - self.cpp_info.components["strong_type"].resdirs = [] diff --git a/recipes/strong_type/all/test_package/conanfile.py b/recipes/strong_type/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/strong_type/all/test_package/conanfile.py +++ b/recipes/strong_type/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/strong_type/config.yml b/recipes/strong_type/config.yml index a45ecce57a17a..cf589fbd0a896 100644 --- a/recipes/strong_type/config.yml +++ b/recipes/strong_type/config.yml @@ -1,9 +1,15 @@ versions: - "v7": + "v13": folder: all - "v8": + "v12": folder: all - "v9": + "v11": folder: all "v10": folder: all + "v9": + folder: all + "v8": + folder: all + "v7": + folder: all diff --git a/recipes/structopt/all/conandata.yml b/recipes/structopt/all/conandata.yml index 6f0c202add0e6..0ba29b1eb7e13 100644 --- a/recipes/structopt/all/conandata.yml +++ b/recipes/structopt/all/conandata.yml @@ -13,14 +13,10 @@ sources: sha256: "a0552e81312cfafcc5319a25c0571ca2470f43461e9f3f72e5f9d89ea4139505" patches: "0.1.3": - - base_path: "source_subfolder" - patch_file: "patches/0.1.0-0001-use-recipes.patch" + - patch_file: "patches/0.1.0-0001-use-recipes.patch" "0.1.2": - - base_path: "source_subfolder" - patch_file: "patches/0.1.0-0001-use-recipes.patch" + - patch_file: "patches/0.1.0-0001-use-recipes.patch" "0.1.1": - - base_path: "source_subfolder" - patch_file: "patches/0.1.0-0001-use-recipes.patch" + - patch_file: "patches/0.1.0-0001-use-recipes.patch" "0.1.0": - - base_path: "source_subfolder" - patch_file: "patches/0.1.0-0001-use-recipes.patch" + - patch_file: "patches/0.1.0-0001-use-recipes.patch" diff --git a/recipes/structopt/all/conanfile.py b/recipes/structopt/all/conanfile.py index 08d36a1d38388..bca62b435e167 100644 --- a/recipes/structopt/all/conanfile.py +++ b/recipes/structopt/all/conanfile.py @@ -1,36 +1,32 @@ 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, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class StructoptConan(ConanFile): name = "structopt" description = "Parse command line arguments by defining a struct+" - topics = ("structopt", "argument-parser", "cpp17", "header-only", - "single-header-lib", "header-library", "command-line", "arguments", - "mit-license", "modern-cpp", "structopt", "lightweight", "reflection", - "cross-platform", "library", "type-safety", "type-safe", "argparse", - "clap",) license = "MIT" - homepage = "https://github.com/p-ranav/structopt" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/structopt" + topics = ("argument-parser", "cpp17", "header-only", "single-header-lib", "command-line", + "arguments", "mit-license", "modern-cpp", "lightweight", "reflection", + "cross-platform", "type-safety", "type-safe", "argparse", "clap") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) - - def requirements(self): - self.requires("magic_enum/0.8.0") - self.requires("visit_struct/1.0") - - def package_id(self): - self.info.header_only() + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -39,39 +35,58 @@ def _compilers_minimum_version(self): "Visual Studio": "15.0", "clang": "5", "apple-clang": "10", + "msvc": "191", } + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("magic_enum/0.9.2") + self.requires("visit_struct/1.1.0") + + 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) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("structopt: Unsupported compiler: {}-{} " - "(https://github.com/p-ranav/structopt#compiler-compatibility)." - .format(self.settings.compiler, self.settings.compiler.version)) + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"structopt: Unsupported compiler: {self.settings.compiler}-{self.settings.compiler.version} " + f"(https://github.com/p-ranav/structopt#compiler-compatibility)." + ) else: - self.output.warn("{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name)) + self.output.warning("{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name)) 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): - cmake = CMake(self) - cmake.configure(source_folder=self._source_subfolder) - return cmake + 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) - tools.rmdir(os.path.join(self._source_subfolder, "include", "structopt", "third_party")) - + apply_conandata_patches(self) + rmdir(self, os.path.join(self.source_folder, "include", "structopt", "third_party")) def package(self): - self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure() 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): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/structopt/all/test_package/CMakeLists.txt b/recipes/structopt/all/test_package/CMakeLists.txt index edf44ae8164be..ea6a19b7561c5 100644 --- a/recipes/structopt/all/test_package/CMakeLists.txt +++ b/recipes/structopt/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(structopt REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/structopt/all/test_package/conanfile.py b/recipes/structopt/all/test_package/conanfile.py index 49a3a66ea5bad..fae501d0afb9e 100644 --- a/recipes/structopt/all/test_package/conanfile.py +++ b/recipes/structopt/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/structopt/all/test_v1_package/CMakeLists.txt b/recipes/structopt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/structopt/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/structopt/all/test_v1_package/conanfile.py b/recipes/structopt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/structopt/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/stx/all/CMakeLists.txt b/recipes/stx/all/CMakeLists.txt deleted file mode 100644 index 8bdaa1e47bfa0..0000000000000 --- 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 8029486130779..d0f1a667ea097 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 b81962b835189..a4d52d28312f9 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 11c8ae870c7f2..0000000000000 --- 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 909cc4eabba22..0000000000000 --- 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 0000000000000..89363cb6ad87d --- /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 0000000000000..102b4d0e1195c --- /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 0000000000000..76dc480783923 --- /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 985bbfd508f2e..6d43705b506c0 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 46663ae7805d2..ef5d7042163ec 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 715e55357a17b..267193202c4e1 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 afbc1844ad677..565af62adb5d6 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 e662ea1d9f3b1..b1995dd599186 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 ec668b89c232d..10c8b53495cd6 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 d4128b0450777..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 0000000000000..31eb78c9466e9 --- /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 0000000000000..df3cfccf4abd0 --- /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 0000000000000..16ec5b9fe9802 --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..c6c6528f85a1f --- /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 0000000000000..3d9ceb6ab28c0 --- /dev/null +++ b/recipes/suyash-ulid/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20201213": + folder: all diff --git a/recipes/svector/all/conandata.yml b/recipes/svector/all/conandata.yml index 876425a447ec4..0a0746084cf0e 100644 --- a/recipes/svector/all/conandata.yml +++ b/recipes/svector/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.3": + url: "https://github.com/martinus/svector/archive/v1.0.3.tar.gz" + sha256: "40d597f5d8ade27059bef49012f23f2147c1a7dfbcd45492bb1057620c434b4f" "1.0.2": url: "https://github.com/martinus/svector/archive/refs/tags/v1.0.2.tar.gz" sha256: "317743113aff89c7c11682ad7ed504a043885be7497f791cb393ba5a7a8d3c41" diff --git a/recipes/svector/config.yml b/recipes/svector/config.yml index 8457ca9a4a8cd..f625d5d2b747f 100644 --- a/recipes/svector/config.yml +++ b/recipes/svector/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.3": + folder: all "1.0.2": folder: all diff --git a/recipes/svgpp/all/conandata.yml b/recipes/svgpp/all/conandata.yml new file mode 100644 index 0000000000000..b4612b4441137 --- /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 0000000000000..f683b8d50fc0b --- /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 0000000000000..366f84e91c306 --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..cb8c51e57fb33 --- /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 0000000000000..d6e527e7221f4 --- /dev/null +++ b/recipes/svgpp/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221030": + folder: "all" diff --git a/recipes/svgwrite/all/CMakeLists.txt b/recipes/svgwrite/all/CMakeLists.txt deleted file mode 100644 index a7a84f24be646..0000000000000 --- a/recipes/svgwrite/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(WIN32 AND BUILD_SHARED_LIBS) - -add_subdirectory("source_subfolder") diff --git a/recipes/svgwrite/all/conandata.yml b/recipes/svgwrite/all/conandata.yml index 2732ab9e3e8f7..d4fffab589e1b 100644 --- a/recipes/svgwrite/all/conandata.yml +++ b/recipes/svgwrite/all/conandata.yml @@ -1,13 +1,31 @@ sources: - "0.1.0": - url: "https://gitlab.com/dvd0101/svgwrite/-/archive/v0.1.0/svgwrite-v0.1.0.tar.gz" - sha256: "beca35ebd5f95fd8a09f6c5b612990c633fd1101e4dd4f72769d819e91ef27bb" "0.2.0": url: "https://gitlab.com/dvd0101/svgwrite/-/archive/v0.2.0/svgwrite-v0.2.0.tar.gz" sha256: "aec13438ac991b13c840488a8f7e878255bdbdf24e757aa3f75de4482eae8812" + "0.1.0": + url: "https://gitlab.com/dvd0101/svgwrite/-/archive/v0.1.0/svgwrite-v0.1.0.tar.gz" + sha256: "beca35ebd5f95fd8a09f6c5b612990c633fd1101e4dd4f72769d819e91ef27bb" patches: + "0.2.0": + - patch_file: "patches/0.2.0-0001-fix-cmake.patch" + patch_description: "remove old conan features" + patch_type: "conan" + - patch_file: "patches/0.2.0-0002-include-cstdint.patch" + patch_description: "include cstdint for gcc 13 or later" + patch_type: "portability" + - patch_file: "patches/0.1.0-0004-add-fmt-runtime.patch" + patch_description: "add fmt::runtime to non-constexpr string" + patch_type: "portability" "0.1.0": - - patch_file: "patches/0001-remove-gcc-flags.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-span-lite-ns.patch" - base_path: "source_subfolder" + - patch_file: "patches/0.1.0-0001-fix-cmake.patch" + patch_description: "remove old conan features" + patch_type: "conan" + - patch_file: "patches/0.1.0-0002-remove-gcc-flags.patch" + patch_description: "disable gcc flags" + patch_type: "portability" + - patch_file: "patches/0.1.0-0003-span-lite-ns.patch" + patch_description: "fix target name" + patch_type: "conan" + - patch_file: "patches/0.1.0-0004-add-fmt-runtime.patch" + patch_description: "add fmt::runtime to non-constexpr string" + patch_type: "portability" diff --git a/recipes/svgwrite/all/conanfile.py b/recipes/svgwrite/all/conanfile.py index bef96e5e83402..61be81d1368f4 100644 --- a/recipes/svgwrite/all/conanfile.py +++ b/recipes/svgwrite/all/conanfile.py @@ -1,79 +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 -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +required_conan_version = ">=1.53.0" class SvgwriteConan(ConanFile): name = "svgwrite" + description = "a streaming svg library" license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.com/dvd0101/svgwrite" - description = "SVGWrite - a streaming svg library" - topics = ("svg", "stream", "vector", "image") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - exports_sources = ("CMakeLists.txt", "patches/*") - requires = "span-lite/0.7.0", "fmt/6.1.2" - generators = "cmake", "cmake_find_package" - _cmake = None + topics = ("svg", "writer", "stream", "vector", "image") + 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 _min_cppstd(self): + return 17 @property - def _build_subfolder(self): - return "build_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "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): - compiler = str(self.settings.compiler) - compiler_version = tools.Version(self.settings.compiler.version) + if self.options.shared: + self.options.rm_safe("fPIC") - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "17") + def layout(self): + cmake_layout(self, src_folder="src") - minimal_version = { - "Visual Studio": "16", - "gcc": "7.3", - "clang": "6", - "apple-clang": "10.0" - } + def requirements(self): + self.requires("span-lite/0.10.3", transitive_headers=True) + self.requires("fmt/10.2.0") - if compiler not in minimal_version: - self.output.warn("{} recipe lacks information about the {} compiler" - " standard version support".format(self.name, compiler)) - elif compiler_version < minimal_version.get(compiler): - raise ConanInvalidConfiguration("%s requires a compiler that supports" - " at least C++17. %s %s is not" - " supported." % (self.name, compiler, compiler_version)) + 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): - tools.get(**self.conan_data["sources"][self.version]) - extracted_folder = self.name + "-v" + self.version - os.rename(extracted_folder, 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.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + 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("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, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = ["svgwrite"] diff --git a/recipes/svgwrite/all/patches/0.1.0-0001-fix-cmake.patch b/recipes/svgwrite/all/patches/0.1.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..1576eca80f5fc --- /dev/null +++ b/recipes/svgwrite/all/patches/0.1.0-0001-fix-cmake.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d70de08..df997b1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,7 @@ else() + set(BUILD_THIS_PROJECT False) + endif() + +-if(BUILD_THIS_PROJECT) ++if(0) + include(${CMAKE_BINARY_DIR}/conan_paths.cmake) + + include(CTest) diff --git a/recipes/svgwrite/all/patches/0001-remove-gcc-flags.patch b/recipes/svgwrite/all/patches/0.1.0-0002-remove-gcc-flags.patch similarity index 100% rename from recipes/svgwrite/all/patches/0001-remove-gcc-flags.patch rename to recipes/svgwrite/all/patches/0.1.0-0002-remove-gcc-flags.patch diff --git a/recipes/svgwrite/all/patches/0002-span-lite-ns.patch b/recipes/svgwrite/all/patches/0.1.0-0003-span-lite-ns.patch similarity index 100% rename from recipes/svgwrite/all/patches/0002-span-lite-ns.patch rename to recipes/svgwrite/all/patches/0.1.0-0003-span-lite-ns.patch diff --git a/recipes/svgwrite/all/patches/0.1.0-0004-add-fmt-runtime.patch b/recipes/svgwrite/all/patches/0.1.0-0004-add-fmt-runtime.patch new file mode 100644 index 0000000000000..dd055f311c058 --- /dev/null +++ b/recipes/svgwrite/all/patches/0.1.0-0004-add-fmt-runtime.patch @@ -0,0 +1,13 @@ +diff --git a/src/writer.cpp b/src/writer.cpp +index 81da66e..cd2419b 100644 +--- a/src/writer.cpp ++++ b/src/writer.cpp +@@ -56,7 +56,7 @@ namespace svgw::v1 { + template + void print(std::ostream& os, std::vector& buffer, std::string_view format_str, Args&&... args) { + buffer.clear(); +- fmt::format_to(std::back_inserter(buffer), format_str, args...); ++ fmt::format_to(std::back_inserter(buffer), fmt::runtime(format_str), args...); + buffer.push_back(0); + os << buffer.data(); + } diff --git a/recipes/svgwrite/all/patches/0.2.0-0001-fix-cmake.patch b/recipes/svgwrite/all/patches/0.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..c47884c595ab0 --- /dev/null +++ b/recipes/svgwrite/all/patches/0.2.0-0001-fix-cmake.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4467941..0212c5a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,13 +6,6 @@ option(SVGWRITE_BUILD_DOC "Build svgwrite documentation") + option(SVGWRITE_BUILD_EXAMPLES "Build svgwrite examples") + + if(SVGWRITE_BUILD_LIB) +- if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) +- include(${CMAKE_BINARY_DIR}/conan_paths.cmake) +- +- include(CTest) +- enable_testing() +- endif() +- + add_subdirectory(src) + + if(SVGWRITE_BUILD_EXAMPLES) diff --git a/recipes/svgwrite/all/patches/0.2.0-0002-include-cstdint.patch b/recipes/svgwrite/all/patches/0.2.0-0002-include-cstdint.patch new file mode 100644 index 0000000000000..a24c4a3a8233e --- /dev/null +++ b/recipes/svgwrite/all/patches/0.2.0-0002-include-cstdint.patch @@ -0,0 +1,19 @@ +diff --git a/include/svgwrite/writer.hpp b/include/svgwrite/writer.hpp +index d97bc96..711d453 100644 +--- a/include/svgwrite/writer.hpp ++++ b/include/svgwrite/writer.hpp +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + /** + * The svgw namespace +@@ -255,4 +256,4 @@ namespace svgw { + std::ostream* os; + }; + } +-} +\ No newline at end of file ++} diff --git a/recipes/svgwrite/all/test_package/CMakeLists.txt b/recipes/svgwrite/all/test_package/CMakeLists.txt index 5f358b17c3b77..682e5fb4ea0e1 100644 --- a/recipes/svgwrite/all/test_package/CMakeLists.txt +++ b/recipes/svgwrite/all/test_package/CMakeLists.txt @@ -1,9 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.15) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package LANGUAGES CXX) -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) -set_property(TARGET example PROPERTY CXX_STANDARD 17) +find_package(svgwrite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE svgwrite::svgwrite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/svgwrite/all/test_package/conanfile.py b/recipes/svgwrite/all/test_package/conanfile.py index 4ead2ad43af38..ef5d7042163ec 100644 --- a/recipes/svgwrite/all/test_package/conanfile.py +++ b/recipes/svgwrite/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 SvgwriteTestConan(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", "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/svgwrite/all/test_package/example.cpp b/recipes/svgwrite/all/test_package/test_package.cpp similarity index 100% rename from recipes/svgwrite/all/test_package/example.cpp rename to recipes/svgwrite/all/test_package/test_package.cpp diff --git a/recipes/svgwrite/config.yml b/recipes/svgwrite/config.yml index f97c9e447ad07..fc6f796e2eea9 100644 --- a/recipes/svgwrite/config.yml +++ b/recipes/svgwrite/config.yml @@ -1,5 +1,5 @@ versions: - "0.1.0": - folder: all "0.2.0": folder: all + "0.1.0": + folder: all diff --git a/recipes/symengine/all/conandata.yml b/recipes/symengine/all/conandata.yml index d0b808ba0adde..c52591b647475 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 cfb736044d218..c6d7a378b2e21 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 b95eb1527125e..b47e71fe86741 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 747ee2684985a..5b34c9bd3214a 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 6c1e792ccafa2..1c26e7784920a 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 57a3f498adec2..326fef01a251e 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 062e855b87030..f489f5c553c0f 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 189bd25a7c208..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..189bd25a7c208 --- /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 bd3083b512cb9..0000000000000 --- 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 db213ca0aa834..234032a9f92d2 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 e65862f8bd94b..60fb8e631adf2 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 46f27b30da924..3598e00cb51a5 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 83eead38732bc..5c4004ed81fc2 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 5d31301bc9ee2..86a595ce48e9a 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 49a3a66ea5bad..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 23a0beef8e885..816397a133c86 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 732888cb32c08..08a817ecfe94b 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 1c4b5480a0dce..fb0ab49d5fd2c 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/conandata.yml b/recipes/taocpp-taopq/all/conandata.yml index b825cbd0e993f..b23fe9c84afe7 100644 --- a/recipes/taocpp-taopq/all/conandata.yml +++ b/recipes/taocpp-taopq/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231219": + url: "https://github.com/taocpp/taopq/archive/855ae86e48f2380d230feae22830f0f9664859ed.tar.gz" + sha256: "bb23d88b8fb7737b8c99f8450b5ab19e1072260fc189634f23103198ac524511" "cci.20210727": url: "https://github.com/taocpp/taopq/archive/3212b6eb74637277b40095d2ab2db872a76c6d9f.tar.gz" sha256: "7d5b801984f71140a8579989e29b746d56167eccb710d821b2336eac723b51a3" diff --git a/recipes/taocpp-taopq/all/conanfile.py b/recipes/taocpp-taopq/all/conanfile.py index 4cf5de4b29231..e186bb806ba1b 100644 --- a/recipes/taocpp-taopq/all/conanfile.py +++ b/recipes/taocpp-taopq/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 get, rmdir +from conan.tools.files import get, rmdir, copy from conan.tools.scm import Version import os @@ -11,13 +11,13 @@ class TaoCPPTaopqConan(ConanFile): name = "taocpp-taopq" + description = "C++ client library for PostgreSQL" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/taocpp/taopq" - description = "C++ client library for PostgreSQL" topics = ("cpp17", "postgresql", "libpq", "data-base", "sql") - - settings = "os", "arch", "build_type", "compiler" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -34,8 +34,8 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "gcc": "7", - "clang": "6", + "gcc": "7" if self.version < "cci.20231219" else "8", + "clang": "6" if self.version < "cci.20231219" else "7", "apple-clang": "10", "Visual Studio": "15", "msvc": "191", @@ -53,12 +53,12 @@ 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"): 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( @@ -70,8 +70,13 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["TAOPQ_BUILD_TESTS"] = False - tc.variables["TAOPQ_INSTALL_DOC_DIR"] = "licenses" + # Option names changed in https://github.com/taocpp/taopq/commit/d77896ab80369f13512a7f0ba8af818a03de1cdf + if Version(self.version) < "cci.20211017": + tc.variables["TAOPQ_BUILD_TESTS"] = False + tc.variables["TAOPQ_INSTALL_DOC_DIR"] = "licenses" + else: + tc.variables["taopq_BUILD_TESTS"] = False + tc.variables["taopq_INSTALL_DOC_DIR"] = "licenses" tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() deps = CMakeDeps(self) @@ -83,9 +88,11 @@ def build(self): 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", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "taopq") diff --git a/recipes/taocpp-taopq/config.yml b/recipes/taocpp-taopq/config.yml index 73c3d88a4e083..08774e1ebdda9 100644 --- a/recipes/taocpp-taopq/config.yml +++ b/recipes/taocpp-taopq/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20231219": + folder: all "cci.20210727": folder: all "cci.20200222": diff --git a/recipes/tar/all/conanfile.py b/recipes/tar/all/conanfile.py index afe93c20c680f..96d4365b7ea60 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 68b1151321a11..5e1618addc3d0 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 0000000000000..68b1151321a11 --- /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 ddecf77805a4c..027d30d480cf0 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 c81bc94de1c84..89c037e770f6b 100644 --- a/recipes/tcl/all/conanfile.py +++ b/recipes/tcl/all/conanfile.py @@ -1,12 +1,16 @@ 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.layout import basic_layout +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 +19,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 = { @@ -45,12 +49,12 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") def layout(self): - # Not using basic_layout because package() needs the source folder to be a sub-directory of the build folder - self.folders.source = "src" - self.folders.generators = "conan" + basic_layout(self, src_folder="src") + # source folder must be a sub-directory of the build folder + self.folders.build = "." 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,8 +73,17 @@ def generate(self): if is_msvc(self): tc = NMakeToolchain(self) tc.generate() + + deps = NMakeDeps(self) + deps.generate() else: - tc = AutotoolsToolchain(self, prefix=self.package_folder) + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) def yes_no(v): return "yes" if v else "no" tc.configure_args.extend([ "--enable-threads", @@ -79,25 +92,17 @@ def yes_no(v): return "yes" if v else "no" ]) tc.generate() - def _get_default_build_system_subdir(self): - return { - "Macos": "macosx", - "Linux": "unix", - "Windows": "win", - }[str(self.settings.os)] - - def _get_configure_dir(self, build_system_subdir=None): - if build_system_subdir is None: - build_system_subdir = self._get_default_build_system_subdir() - return os.path.join(self.source_folder, build_system_subdir) + deps = AutotoolsDeps(self) + deps.generate() def _patch_sources(self): apply_conandata_patches(self) if is_apple_os(self) and self.settings.arch not in ("x86", "x86_64"): - replace_in_file(self, os.path.join(self._get_configure_dir(), "configure"), "#define HAVE_CPUID 1", "#undef HAVE_CPUID") + macos_configure = os.path.join(self.source_folder, "macosx", "configure") + replace_in_file(self, macos_configure, "#define HAVE_CPUID 1", "#undef HAVE_CPUID") - unix_config_dir = self._get_configure_dir("unix") + unix_config_dir = os.path.join(self.source_folder, "unix") # 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") replace_in_file(self, os.path.join(unix_config_dir, "configure"), @@ -112,9 +117,18 @@ def _patch_sources(self): replace_in_file(self, unix_makefile_in, "\nLDFLAGS\t", "\n#LDFLAGS\t") # Use CFLAGS and CPPFLAGS as argument to CC replace_in_file(self, unix_makefile_in, "${CFLAGS}", "${CFLAGS} ${CPPFLAGS}") + + win_config_dir = os.path.join(self.source_folder, "win") + + # Fix install for MinGW + win_makefile_in = os.path.join(win_config_dir, "Makefile.in") + replace_in_file(self, win_makefile_in, "INSTALL_ROOT =", "INSTALL_ROOT = $(DESTDIR)") + # No link to static libgcc for MinGW + win_tcl_m4 = os.path.join(win_config_dir, "tcl.m4") + replace_in_file(self, win_tcl_m4, "-static-libgcc", "") + # nmake creates a temporary file with mixed forward/backward slashes # force the filename to avoid cryptic error messages - win_config_dir = self._get_configure_dir("win") win_makefile_vc = os.path.join(win_config_dir, "makefile.vc") replace_in_file(self, win_makefile_vc, "@type << >$@", "type <$@") @@ -142,26 +156,38 @@ def _build_nmake(self, targets): if "d" not in msvc_runtime_flag(self): opts.append("unchecked") - with chdir(self, self._get_configure_dir("win")): + win_config_dir = os.path.join(self.source_folder, "win") + with chdir(self, win_config_dir): self.run('nmake -nologo -f "{cfgdir}/makefile.vc" INSTALLDIR="{pkgdir}" OPTS={opts} {targets}'.format( - cfgdir=self._get_configure_dir("win"), + cfgdir=win_config_dir, pkgdir=self.package_folder, opts=",".join(opts), targets=" ".join(targets), )) + def _get_configure_subdir(self): + return { + "Macos": "macosx", + "Linux": "unix", + "FreeBSD": "unix", + "Windows": "win", + }[str(self.settings.os)] + def build(self): self._patch_sources() if is_msvc(self): self._build_nmake(["release"]) else: autotools = Autotools(self) - autotools.configure(self._get_configure_dir()) - + autotools.configure(build_script_folder=self._get_configure_subdir()) # https://core.tcl.tk/tcl/tktview/840660e5a1 for root, _, list_of_files in os.walk(self.build_folder): if "Makefile" in list_of_files: replace_in_file(self, os.path.join(root, "Makefile"), "-Dstrtod=fixstrtod", "", strict=False) + # For some reason this target "binaries" may not be built before others + # on Windows while it's a dependency of many other targets + autotools.make(target="binaries") + autotools.make() def package(self): copy(self, "license.terms", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) @@ -169,83 +195,69 @@ def package(self): self._build_nmake(["install-binaries", "install-libraries"]) else: autotools = Autotools(self) - autotools.make(target="install") - autotools.make(target="install-private-headers") + autotools.install() + autotools.install(target="install-private-headers") 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")) + fix_apple_shared_install_name(self) + # Relocatable tclConfig.sh tclConfigShPath = os.path.join(self.package_folder, "lib", "tclConfig.sh") - package_path = self.package_folder - build_folder = self.build_folder - if self.settings.os == "Windows" and not is_msvc(self): - package_path = package_path.replace("\\", "/") - drive, path = os.path.splitdrive(self.build_folder) - build_folder = "".join([drive, path.lower().replace("\\", "/")]) - - replace_in_file(self, tclConfigShPath, - package_path, - "${TCL_ROOT}") - replace_in_file(self, tclConfigShPath, - build_folder, - "${TCL_BUILD_ROOT}") - - replace_in_file(self, tclConfigShPath, - "\nTCL_BUILD_", - "\n#TCL_BUILD_") - replace_in_file(self, tclConfigShPath, - "\nTCL_SRC_DIR", - "\n#TCL_SRC_DIR") - - #fix_apple_shared_install_name(self) + ## Comment out references to build folder + replace_in_file(self, tclConfigShPath, "\nTCL_BUILD_", "\n#TCL_BUILD_") + replace_in_file(self, tclConfigShPath, "\nTCL_SRC_DIR", "\n#TCL_SRC_DIR") + ## Replace references to package folder by TCL_ROOT env var supposed to be defined by VirtualRunEnv + if is_msvc(self): + replace_in_file(self, tclConfigShPath, self.package_folder, "${TCL_ROOT}") + else: + replace_in_file(self, tclConfigShPath, "TCL_PREFIX='/'", "TCL_PREFIX='${TCL_ROOT}'") + replace_in_file(self, tclConfigShPath, "TCL_EXEC_PREFIX='/'", "TCL_EXEC_PREFIX='${TCL_ROOT}'") + for to_replace in ["//", "/"]: + replace_in_file(self, tclConfigShPath, f"-L{to_replace}lib", "-L${TCL_ROOT}/lib", strict=False) + replace_in_file(self, tclConfigShPath, f"{{{to_replace}lib}}", "{${TCL_ROOT}/lib}", strict=False) + replace_in_file(self, tclConfigShPath, f"='{to_replace}lib", "='${TCL_ROOT}/lib", strict=False) + replace_in_file(self, tclConfigShPath, f"-I{to_replace}include", "-I${TCL_ROOT}/include", strict=False) 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 9e60b9c906676..108b4ab57b9c6 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/tclap/all/conandata.yml b/recipes/tclap/all/conandata.yml index f7a05c00a83b7..21dfdafb52e1c 100644 --- a/recipes/tclap/all/conandata.yml +++ b/recipes/tclap/all/conandata.yml @@ -1,10 +1,11 @@ +# INFO: Moved from a fork to the original repository sources: "1.2.5": - url: "https://github.com/xguerin/tclap/archive/v1.2.5.tar.gz" - sha256: "a475fc46d82092c5d244f6ca8b0d2c0010fcb2c41936afde10a9c950f42eb95f" + url: "https://github.com/mirror/tclap/archive/refs/tags/v1.2.5.tar.gz" + sha256: "7e87d13734076fa4f626f6144ce9a02717198b3f054341a6886e2107b048b235" "1.2.4": - url: "https://github.com/xguerin/tclap/archive/v1.2.4.tar.gz" - sha256: "7363f8f571e6e733b269c4b4e9c18f392d3cd7240d39a379d95de5a4c4bdc47f" + url: "https://sourceforge.net/projects/tclap/files/tclap-1.2.4.tar.gz" + sha256: "634c5b59dbb1ccbc9d6a5f6de494a257e29a3f59dcb6fc30445ff39b45188574" "1.2.3": - sha256: ccccd3471776f3198bb360aa6c09a1cd527d18b44360ff4d2b8356cdf984e980 - url: https://github.com/xguerin/tclap/archive/v1.2.3.tar.gz + url: "https://sourceforge.net/projects/tclap/files/tclap-1.2.3.tar.gz" + sha256: "19e7db5281540f154348770bc3a7484575f4f549aef8e00aabcc94b395f773c9" diff --git a/recipes/tclap/all/conanfile.py b/recipes/tclap/all/conanfile.py index 7eaf320075187..8b33301f47d32 100644 --- a/recipes/tclap/all/conanfile.py +++ b/recipes/tclap/all/conanfile.py @@ -1,30 +1,33 @@ -from conans import ConanFile, tools - +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout import os + class TclapConan(ConanFile): name = "tclap" license = "MIT" - homepage = "http://github.com/xguerin/tclap" + homepage = "https://sourceforge.net/projects/tclap/" url = "https://github.com/conan-io/conan-center-index" description = "Templatized Command Line Argument Parser" - topics = ("c++", "commandline parser") + topics = ("parser", "command-line", "header-only") + settings = "os", "compiler", "build_type", "arch" + package_type = "header-library" 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]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - self.copy(pattern="*", src=os.path.join(self._source_subfolder, "include"), dst="include", keep_path=True) + copy(self, pattern="COPYING", 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.names["pkg_config"] = "tclap" - - def package_id(self): - self.info.header_only() + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/tclap/all/test_package/CMakeLists.txt b/recipes/tclap/all/test_package/CMakeLists.txt index 943ae4571dee7..abb2293e73c6e 100644 --- a/recipes/tclap/all/test_package/CMakeLists.txt +++ b/recipes/tclap/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(tclap REQUIRED CONFIG) -add_executable(test_package test.cpp) -target_link_libraries(test_package CONAN_PKG::tclap) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package tclap::tclap) diff --git a/recipes/tclap/all/test_package/conanfile.py b/recipes/tclap/all/test_package/conanfile.py index 78a3d05a29256..3a91c9439218e 100644 --- a/recipes/tclap/all/test_package/conanfile.py +++ b/recipes/tclap/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 TestTclapConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - 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) @@ -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/tclap/all/test_package/test.cpp b/recipes/tclap/all/test_package/test_package.cpp similarity index 100% rename from recipes/tclap/all/test_package/test.cpp rename to recipes/tclap/all/test_package/test_package.cpp diff --git a/recipes/tclap/all/test_v1_package/CMakeLists.txt b/recipes/tclap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/tclap/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/tclap/all/test_v1_package/conanfile.py b/recipes/tclap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/tclap/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/tcp-wrappers/all/conandata.yml b/recipes/tcp-wrappers/all/conandata.yml index 59e770ecf55f2..9aa6d859497fa 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 505aeec0d08d6..3089488940a7d 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 6226de918d1da..6bc29bd3fc5c5 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 bd7165a553cf4..ef5d7042163ec 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 99571f4211816..297a2849f1a11 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 0000000000000..91630d79f4abb --- /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 0000000000000..7e2dfe859bb27 --- /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 c292824b18361..2bda12ab98758 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 cf5ea147a4f0e..c374a3551f1f2 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 6b713d97dfd9d..5f357d4371c77 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 49a3a66ea5bad..e77da04fcdfc5 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 fb3f52a80922c..c69d651b88257 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 0000000000000..91630d79f4abb --- /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 0000000000000..6bbeeb230e6b0 --- /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 14f04caec446d..d149ea7c80af7 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 8bdaa1e47bfa0..0000000000000 --- 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 f958e285c4af2..b24ca0f0a2b0f 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 03a96370cbb02..aed3fb5a97334 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 cb4d85b99bbcf..bf76cb9ad5867 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 49a3a66ea5bad..ef5d7042163ec 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 b8f028352cf82..91928632cfcba 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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 c744acd213406..db1dc037a6a68 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 490c174ebfda5..0b1e02d58ccdc 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 c34c6cc5a1060..1935bbe91290d 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/tensorflow-lite/all/conandata.yml b/recipes/tensorflow-lite/all/conandata.yml index 42304f36f76b1..4727adcc61017 100644 --- a/recipes/tensorflow-lite/all/conandata.yml +++ b/recipes/tensorflow-lite/all/conandata.yml @@ -1,8 +1,20 @@ sources: + "2.12.0": + url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.10.0.tar.gz" + sha256: "b5a1bb04c84b6fe1538377e5a1f649bb5d5f0b2e3625a3c526ff3a8af88633e8" "2.10.0": url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.10.0.tar.gz" sha256: "b5a1bb04c84b6fe1538377e5a1f649bb5d5f0b2e3625a3c526ff3a8af88633e8" patches: + "2.12.0": + - patch_file: "patches/remove_simple_memory_arena_debug_dump.patch" + patch_description: "Shared build fails on Windows with error LNK2005. Resolve the conflict by removing the conflicting implementation for now." + - patch_file: "patches/disable_fetch_content.patch" + patch_description: "Fail if the CMake build script tries to fetch external dependencies" + patch_type: "conan" + - patch_file: "patches/dependencies_2_10.patch" + patch_description: "Dependency compatibility: Patch CMakeLists.txt, updating package names, target names, etc" + patch_type: "conan" "2.10.0": - patch_file: "patches/remove_simple_memory_arena_debug_dump.patch" patch_description: "Shared build fails on Windows with error LNK2005. Resolve the conflict by removing the conflicting implementation for now." diff --git a/recipes/tensorflow-lite/all/conanfile.py b/recipes/tensorflow-lite/all/conanfile.py index 083c62e71120c..5b4b074e11411 100644 --- a/recipes/tensorflow-lite/all/conanfile.py +++ b/recipes/tensorflow-lite/all/conanfile.py @@ -77,7 +77,7 @@ def requirements(self): self.requires("eigen/3.4.0") self.requires("farmhash/cci.20190513") self.requires("fft/cci.20061228") - self.requires("flatbuffers/23.1.21", transitive_headers=True) + self.requires("flatbuffers/23.3.3", transitive_headers=True) self.requires("gemmlowp/cci.20210928") self.requires("ruy/cci.20220628") if self.settings.arch in ("x86", "x86_64"): diff --git a/recipes/tensorflow-lite/config.yml b/recipes/tensorflow-lite/config.yml index 22d65dcfdfac6..cabc9e91cd30c 100644 --- a/recipes/tensorflow-lite/config.yml +++ b/recipes/tensorflow-lite/config.yml @@ -1,3 +1,5 @@ versions: + "2.12.0": + folder: all "2.10.0": folder: all diff --git a/recipes/termcolor/all/conanfile.py b/recipes/termcolor/all/conanfile.py index 6c4c0eeda2585..1e7b2ef15d00e 100644 --- a/recipes/termcolor/all/conanfile.py +++ b/recipes/termcolor/all/conanfile.py @@ -1,36 +1,49 @@ import os -from conans import ConanFile, CMake, 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, rmdir + +required_conan_version = ">=1.50.0" + class TermcolorConan(ConanFile): name = "termcolor" description = "Termcolor is a header-only C++ library for printing colored messages to the terminal." - topics = ("termcolor", "terminal", "color") + topics = ("terminal", "color") license = "BSD-3-Clause" homepage = "https://github.com/ikalnytskyi/termcolor" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - generators = "cmake" - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + cmake_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 package_id(self): - self.info.header_only() + def generate(self): + tc = CMakeToolchain(self) + tc.generate() - def _configure_cmake(self): + def build(self): cmake = CMake(self) - cmake.configure(source_folder=self._source_subfolder) - return cmake + cmake.configure() + cmake.build() def package(self): - self.copy(pattern="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): + self.cpp_info.set_property("cmake_file_name", "termcolor") + self.cpp_info.set_property("cmake_target_name", "termcolor::termcolor") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/termcolor/all/test_package/CMakeLists.txt b/recipes/termcolor/all/test_package/CMakeLists.txt index 07ff01a5a223c..1d45a2e0c344b 100644 --- a/recipes/termcolor/all/test_package/CMakeLists.txt +++ b/recipes/termcolor/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -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(termcolor REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} termcolor::termcolor) +target_link_libraries(${PROJECT_NAME} PRIVATE termcolor::termcolor) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/termcolor/all/test_package/conanfile.py b/recipes/termcolor/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/termcolor/all/test_package/conanfile.py +++ b/recipes/termcolor/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,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/termcolor/all/test_v1_package/CMakeLists.txt b/recipes/termcolor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/termcolor/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/termcolor/all/test_v1_package/conanfile.py b/recipes/termcolor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/termcolor/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/tesseract/all/conandata.yml b/recipes/tesseract/all/conandata.yml index 7daa1a412e05d..00a8d11156c81 100644 --- a/recipes/tesseract/all/conandata.yml +++ b/recipes/tesseract/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.3.3": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.3.3.tar.gz" + sha256: "dc4329f85f41191b2d813b71b528ba6047745813474e583ccce8795ff2ff5681" "5.3.0": url: "https://github.com/tesseract-ocr/tesseract/archive/5.3.0.tar.gz" sha256: "7e70870f8341e5ea228af2836ce79a36eefa11b01b56177b4a8997f330c014b8" @@ -15,6 +18,10 @@ sources: url: "https://github.com/tesseract-ocr/tesseract/archive/4.1.1.tar.gz" sha256: "2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb" patches: + "5.3.3": + - patch_file: "patches/0004-control-optimizations-5.3.3.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" "5.3.0": - patch_file: "patches/0004-control-optimizations-5.3.0.patch" patch_description: "fix condition for cpu optimizations" diff --git a/recipes/tesseract/all/conanfile.py b/recipes/tesseract/all/conanfile.py index bbdcc2c253a14..861e7b6b85384 100644 --- a/recipes/tesseract/all/conanfile.py +++ b/recipes/tesseract/all/conanfile.py @@ -81,13 +81,18 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("leptonica/1.82.0") + if Version(self.version) >= "5.2.0": + self.requires("leptonica/1.83.1") + else: + 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.2") # 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"): @@ -175,7 +180,7 @@ def _module_file_rel_path(self): def package_info(self): # Official CMake imported target is: # - libtesseract if < 5.0.0 - # - Tesseract::libtesseract if >= 5.0.0 (not yet released) + # - Tesseract::libtesseract if >= 5.0.0 # We provide both targets self.cpp_info.set_property("cmake_file_name", "Tesseract") self.cpp_info.set_property("cmake_target_name", "Tesseract::libtesseract") @@ -185,6 +190,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/tesseract/all/patches/0004-control-optimizations-5.3.3.patch b/recipes/tesseract/all/patches/0004-control-optimizations-5.3.3.patch new file mode 100644 index 0000000000000..20b11b48bfcb9 --- /dev/null +++ b/recipes/tesseract/all/patches/0004-control-optimizations-5.3.3.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -166,7 +166,7 @@ + + message(STATUS "CMAKE_SYSTEM_PROCESSOR=<${CMAKE_SYSTEM_PROCESSOR}>") + +-if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") ++if(ENABLE_OPTIMIZATIONS AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") + + set(HAVE_NEON FALSE) + if(MSVC) diff --git a/recipes/tesseract/config.yml b/recipes/tesseract/config.yml index 18a9581e91b42..f1f981966776b 100644 --- a/recipes/tesseract/config.yml +++ b/recipes/tesseract/config.yml @@ -1,4 +1,6 @@ versions: + "5.3.3": + folder: all "5.3.0": folder: all "5.2.0": diff --git a/recipes/tgbot/all/CMakeLists.txt b/recipes/tgbot/all/CMakeLists.txt deleted file mode 100644 index 959835f6b0885..0000000000000 --- 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 054b04f19ea35..1279fcb4b2148 100644 --- a/recipes/tgbot/all/conandata.yml +++ b/recipes/tgbot/all/conandata.yml @@ -1,13 +1,10 @@ sources: + "1.7.2": + url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.7.2.tar.gz" + sha256: "3a41c25c5e4b60bda3f278550a380f1c7c382fd50ea1ab1801edc837d1535462" "1.5": url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.5.tar.gz" sha256: "ecd5a21ea45b890828aba1639ac49401cfdd5b30f791322cb1ba84c9ac77647c" "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 b7db60eafd261..1fb99e68206f6 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 b41fdddf1c066..ebe398c29035c 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 7122b776c7119..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..80f8edbcec938 --- /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 220c83c443ceb..02741b3fbce3e 100644 --- a/recipes/tgbot/config.yml +++ b/recipes/tgbot/config.yml @@ -1,9 +1,7 @@ versions: + "1.7.2": + folder: all "1.5": 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 05fc280a1c100..71bf293016c65 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/all/conanfile.py b/recipes/thelink2012-any/all/conanfile.py index 2ecc1a7f7608f..b909aaa407a58 100644 --- a/recipes/thelink2012-any/all/conanfile.py +++ b/recipes/thelink2012-any/all/conanfile.py @@ -1,37 +1,54 @@ -from conans import ConanFile, tools +# TODO: verify the Conan v2 migration +import os + +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" -required_conan_version = ">=1.33.0" class Thelink2012AnyConan(ConanFile): name = "thelink2012-any" - license = "BSL-1.0" description = "Implementation of std::experimental::any, including small object optimization, for C++11 compilers" - topics = ("any", "c++11", "data-structures") - homepage = "https://github.com/thelink2012/any" + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/thelink2012/any" + topics = ("any", "c++11", "data-structures", "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 _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"): - 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): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("any.hpp", "include", 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, "any.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 = [] + + self.cpp_info.set_property("cmake_file_name", "any") + self.cpp_info.set_property("cmake_target_name", "any::any") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "any" self.cpp_info.names["cmake_find_package_multi"] = "any" - self.cpp_info.set_property("cmake_target_name", "any::any") diff --git a/recipes/thelink2012-any/all/test_package/CMakeLists.txt b/recipes/thelink2012-any/all/test_package/CMakeLists.txt index 5e31011d1713d..6e9d1837691aa 100644 --- a/recipes/thelink2012-any/all/test_package/CMakeLists.txt +++ b/recipes/thelink2012-any/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(any CONFIG REQUIRED) +find_package(any REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} any::any) diff --git a/recipes/thelink2012-any/all/test_package/conanfile.py b/recipes/thelink2012-any/all/test_package/conanfile.py index 6b551939fbde3..fae501d0afb9e 100644 --- a/recipes/thelink2012-any/all/test_package/conanfile.py +++ b/recipes/thelink2012-any/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 TestConan(ConanFile): + +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) @@ -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/thelink2012-any/all/test_v1_package/CMakeLists.txt b/recipes/thelink2012-any/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/thelink2012-any/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/thelink2012-any/all/test_v1_package/conanfile.py b/recipes/thelink2012-any/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6b551939fbde3 --- /dev/null +++ b/recipes/thelink2012-any/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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/thelink2012-any/config.yml b/recipes/thelink2012-any/config.yml index 1eac063d13841..cdbc38379aaf4 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/conandata.yml b/recipes/thrift/all/conandata.yml index ab039201f49e0..57ad35a140baa 100644 --- a/recipes/thrift/all/conandata.yml +++ b/recipes/thrift/all/conandata.yml @@ -1,23 +1,30 @@ sources: + "0.18.1": + url: "http://archive.apache.org/dist/thrift/0.18.1/thrift-0.18.1.tar.gz" + sha256: "04c6f10e5d788ca78e13ee2ef0d2152c7b070c0af55483d6b942e29cff296726" "0.17.0": - url: "https://github.com/apache/thrift/archive/v0.17.0.tar.gz" - sha256: "f5888bcd3b8de40c2c2ab86896867ad9b18510deb412cba3e5da76fb4c604c29" + url: "http://archive.apache.org/dist/thrift/0.17.0/thrift-0.17.0.tar.gz" + sha256: "b272c1788bb165d99521a2599b31b97fa69e5931d099015d91ae107a0b0cc58f" "0.16.0": - url: "https://github.com/apache/thrift/archive/refs/tags/v0.16.0.tar.gz" - sha256: "df2931de646a366c2e5962af679018bca2395d586e00ba82d09c0379f14f8e7b" + url: "http://archive.apache.org/dist/thrift/0.16.0/thrift-0.16.0.tar.gz" + sha256: "f460b5c1ca30d8918ff95ea3eb6291b3951cf518553566088f3f2be8981f6209" "0.15.0": - url: "https://github.com/apache/thrift/archive/refs/tags/v0.15.0.tar.gz" - sha256: "32d2f18aa9be114619ee54e1abc3bb497febb2a8aa917894c20bae21185fac15" + url: "http://archive.apache.org/dist/thrift/0.15.0/thrift-0.15.0.tar.gz" + sha256: "d5883566d161f8f6ddd4e21f3a9e3e6b8272799d054820f1c25b11e86718f86b" "0.14.2": - url: "https://github.com/apache/thrift/archive/v0.14.2.tar.gz" - sha256: "f966cdac6bb8d149a9950a761e6ee6f3b22d5a6073da43a333d3468f159ebeaa" + url: "http://archive.apache.org/dist/thrift/0.14.2/thrift-0.14.2.tar.gz" + sha256: "4191bfc0b7490e20cc69f9f4dc6e991fbb612d4551aa9eef1dbf7f4c47ce554d" "0.14.1": - url: "https://github.com/apache/thrift/archive/refs/tags/v0.14.1.tar.gz" - sha256: "5ae1c4d16452a22eaf9d802ba7489907147c2b316ff38c9758918552fae5132c" - "0.13.0": - url: "https://github.com/apache/thrift/archive/0.13.0.tar.gz" - sha256: "8469c8d72c684c6de72ddf55fc65d1c10868a576e7dc4d1f4a21a59814b97110" + url: "http://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz" + sha256: "13da5e1cd9c8a3bb89778c0337cc57eb0c29b08f3090b41cf6ab78594b410ca5" patches: + "0.18.1": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0.18.1-0002-include-stddef.patch" + patch_description: "include cstddef" + patch_type: "portability" "0.17.0": - patch_file: "patches/cmake-0.16.0.patch" patch_description: "use cci packages" @@ -38,7 +45,3 @@ patches: - patch_file: "patches/cmake-0.14.1.patch" patch_description: "use cci packages" patch_type: "conan" - "0.13.0": - - patch_file: "patches/cmake-0.13.0.patch" - patch_description: "use cci packages" - patch_type: "conan" diff --git a/recipes/thrift/all/conanfile.py b/recipes/thrift/all/conanfile.py index 0aaa55ea7ce2b..312d6788c54a2 100644 --- a/recipes/thrift/all/conanfile.py +++ b/recipes/thrift/all/conanfile.py @@ -67,19 +67,19 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0", transitive_headers=True) + self.requires("boost/1.83.0", transitive_headers=True) 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: - self.requires("qt/5.15.9") + self.requires("qt/5.15.12") def build_requirements(self): if self._settings_build.os == "Windows": - self.tool_requires("winflexbison/2.5.24") + self.tool_requires("winflexbison/2.5.25") else: self.tool_requires("flex/2.6.4") self.tool_requires("bison/3.8.2") diff --git a/recipes/thrift/all/patches/0.18.1-0002-include-stddef.patch b/recipes/thrift/all/patches/0.18.1-0002-include-stddef.patch new file mode 100644 index 0000000000000..f8195ce2910ed --- /dev/null +++ b/recipes/thrift/all/patches/0.18.1-0002-include-stddef.patch @@ -0,0 +1,24 @@ +diff --git a/lib/cpp/src/thrift/numeric_cast.h b/lib/cpp/src/thrift/numeric_cast.h +index d7063db..8775121 100644 +--- a/lib/cpp/src/thrift/numeric_cast.h ++++ b/lib/cpp/src/thrift/numeric_cast.h +@@ -22,6 +22,7 @@ + + #include + #include ++#include + + #if defined(_MSC_VER) + // avoid compiler warnings and errors in MSVC if max is defined as a macro +diff --git a/lib/cpp/src/thrift/transport/TBufferTransports.h b/lib/cpp/src/thrift/transport/TBufferTransports.h +index f72d8f6..f745b8c 100644 +--- a/lib/cpp/src/thrift/transport/TBufferTransports.h ++++ b/lib/cpp/src/thrift/transport/TBufferTransports.h +@@ -22,6 +22,7 @@ + + #include + #include ++#include + #include + + #include diff --git a/recipes/thrift/all/patches/cmake-0.13.0.patch b/recipes/thrift/all/patches/cmake-0.13.0.patch deleted file mode 100644 index 1acf18b419ac5..0000000000000 --- a/recipes/thrift/all/patches/cmake-0.13.0.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- a/build/cmake/DefineOptions.cmake -+++ b/build/cmake/DefineOptions.cmake -@@ -39,10 +39,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) - # and enables the library if all are found. This means the default is to build as - # much as possible but leaving out libraries if their dependencies are not met. - --if (NOT Boost_USE_STATIC_LIBS) -- add_definitions(-DBOOST_ALL_DYN_LINK) -- add_definitions(-DBOOST_TEST_DYN_LINK) --endif() - - # as3 - option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON) -@@ -118,7 +114,12 @@ CMAKE_DEPENDENT_OPTION(BUILD_HASKELL "Build GHC library" ON - # Common library options - # https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html - # Default on Windows is static, shared mode library support needs work... --CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF "WIN32" ON) -+if(WIN32) -+ set(DEFAULT_BUILD_SHARED_LIBS ON) -+else() -+ set(DEFAULT_BUILD_SHARED_LIBS OFF) -+endif() -+option(BUILD_SHARED_LIBS "Build shared libraries" ${DEFAULT_BUILD_SHARED_LIBS}) - - if (WITH_SHARED_LIB) - message(WARNING "WITH_SHARED_LIB is deprecated; use -DBUILD_SHARED_LIBS=ON instead") ---- a/lib/c_glib/CMakeLists.txt -+++ b/lib/c_glib/CMakeLists.txt -@@ -59,13 +59,13 @@ set(thrift_c_glib_SOURCES - ) - - # If OpenSSL is not found just ignore the OpenSSL stuff --find_package(OpenSSL) --if(OPENSSL_FOUND AND WITH_OPENSSL) -+if(WITH_OPENSSL) -+ find_package(OpenSSL REQUIRED) - list( APPEND thrift_c_glib_SOURCES - src/thrift/c_glib/transport/thrift_ssl_socket.c - ) -- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") -- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") -+ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") -+ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) - endif() - - ---- a/lib/cpp/CMakeLists.txt -+++ b/lib/cpp/CMakeLists.txt -@@ -98,13 +98,13 @@ else() - endif() - - # If OpenSSL is not found or disabled just ignore the OpenSSL stuff --if(OPENSSL_FOUND AND WITH_OPENSSL) -+if(WITH_OPENSSL) - list( APPEND thriftcpp_SOURCES - src/thrift/transport/TSSLSocket.cpp - src/thrift/transport/TSSLServerSocket.cpp - ) -- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") -- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") -+ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") -+ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) - endif() - - if(UNIX) -@@ -152,11 +152,11 @@ ADD_PKGCONFIG_THRIFT(thrift) - - if(WITH_LIBEVENT) - find_package(Libevent REQUIRED) # Libevent comes with CMake support form upstream -- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) -+ #include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) - - ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) - LINK_AGAINST_THRIFT_LIBRARY(thriftnb thrift) -- TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} ${LIBEVENT_LIBRARIES}) -+ TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} libevent::core libevent::extra) - ADD_PKGCONFIG_THRIFT(thrift-nb) - endif() - diff --git a/recipes/thrift/config.yml b/recipes/thrift/config.yml index 66a1ad96af024..8ce3e9b3821f4 100644 --- a/recipes/thrift/config.yml +++ b/recipes/thrift/config.yml @@ -1,4 +1,6 @@ versions: + "0.18.1": + folder: all "0.17.0": folder: all "0.16.0": @@ -9,5 +11,3 @@ versions: folder: all "0.14.1": folder: all - "0.13.0": - folder: all diff --git a/recipes/thrust/all/conandata.yml b/recipes/thrust/all/conandata.yml index 702d317873355..4912f01513e01 100644 --- a/recipes/thrust/all/conandata.yml +++ b/recipes/thrust/all/conandata.yml @@ -1,10 +1,10 @@ sources: - "1.9.5": - url: "https://github.com/thrust/thrust/archive/1.9.5.tar.gz" - sha256: "d155dc2a260fe0c75c63c185fa4c4b4c6c5b7c444fcdac7109bb71941c9603f1" "1.16.0": url: "https://github.com/thrust/thrust/archive/1.16.0.tar.gz" sha256: "93b9553e3ee544e05395022bea67e6d600f8f3eb680950ec7cf73c0f55162487" "1.17.0": url: "https://github.com/thrust/thrust/archive/1.17.0.tar.gz" sha256: "b02aca5d2325e9128ed9d46785b8e72366f758b873b95001f905f22afcf31bbf" + "1.17.2": + url: "https://github.com/thrust/thrust/archive/1.17.2.tar.gz" + sha256: "d021e37f5aac30fd1b9737865399feb57db8e601ae2fc0af3cd41784435e9523" diff --git a/recipes/thrust/all/conanfile.py b/recipes/thrust/all/conanfile.py index 55d9c443a7b03..1519ec256e76b 100644 --- a/recipes/thrust/all/conanfile.py +++ b/recipes/thrust/all/conanfile.py @@ -1,44 +1,74 @@ -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 ThrustConan(ConanFile): name = "thrust" license = "Apache-2.0" - description = ("Thrust is a parallel algorithms library which resembles" - "the C++ Standard Template Library (STL).") - topics = ("parallel", "stl", "header-only") + description = ( + "Thrust is a parallel algorithms library which resembles " + "the C++ Standard Template Library (STL)." + ) + topics = ("parallel", "stl", "header-only", "cuda", "gpgpu") homepage = "https://thrust.github.io/" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - options = {"device_system": ["cuda", "cpp", "omp", "tbb"]} - default_options = {"device_system": "tbb"} + options = { + "device_system": ["cuda", "cpp", "omp", "tbb"], + } + default_options = { + "device_system": "tbb", + } - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): + # Otherwise CUB from system CUDA is used, which is not guaranteed to be compatible + self.requires("cub/1.17.2") + if self.options.device_system == "tbb": - self.requires("onetbb/2020.3") - elif self.options.device_system != "cpp": - self.output.warn('Conan package for {0} is not available,' - ' this package will use {0} from system.' - .format(str(self.options.device_system).upper())) + self.requires("onetbb/2021.10.0") + + if self.options.device_system in ["cuda", "omp"]: + dev = str(self.options.device_system).upper() + self.output.warning( + f"Conan package for {dev} is not available," + f" this package will use {dev} from system." + ) + + def package_id(self): + 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(pattern="LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("*[.h|.inl]", src=os.path.join(self._source_subfolder, "thrust"), - dst=os.path.join("include", "thrust")) - - def package_id(self): - self.info.header_only() + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + for pattern in ["*.h", "*.inl"]: + copy( + self, + pattern=pattern, + src=os.path.join(self.source_folder, "thrust"), + dst=os.path.join(self.package_folder, "include", "thrust"), + ) def package_info(self): - self.cpp_info.defines = ["THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_{}".format( - str(self.options.device_system).upper())] + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + dev = str(self.options.device_system).upper() + self.cpp_info.defines = [f"THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_{dev}"] + # Since CUB and Thrust are provided separately, their versions are not guaranteed to match + self.cpp_info.defines += ["THRUST_IGNORE_CUB_VERSION_CHECK=1"] diff --git a/recipes/thrust/all/test_package/CMakeLists.txt b/recipes/thrust/all/test_package/CMakeLists.txt index 00c2a09754018..1a734eec44011 100644 --- a/recipes/thrust/all/test_package/CMakeLists.txt +++ b/recipes/thrust/all/test_package/CMakeLists.txt @@ -1,11 +1,23 @@ -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(thrust CONFIG REQUIRED) -add_executable(test_package test_package.cpp) -target_link_libraries(test_package thrust::thrust) -set_target_properties(test_package PROPERTIES CXX_STANDARD 11) +if (THRUST_BACKEND STREQUAL "CUDA") + cmake_minimum_required(VERSION 3.18) + enable_language(CUDA) + find_package(CUDAToolkit REQUIRED) + add_executable(${PROJECT_NAME} test_package.cu) + target_link_libraries(${PROJECT_NAME} CUDA::cudart) + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") + set_target_properties(${PROJECT_NAME} PROPERTIES CUDA_ARCHITECTURES native) + else() + # Use the defaults from nvcc + set_target_properties(${PROJECT_NAME} PROPERTIES CUDA_ARCHITECTURES OFF) + endif() +else() + add_executable(${PROJECT_NAME} test_package.cpp) +endif() + +target_link_libraries(${PROJECT_NAME} thrust::thrust) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/thrust/all/test_package/conanfile.py b/recipes/thrust/all/test_package/conanfile.py index 9058f6e9a3054..1a1d2d0117430 100644 --- a/recipes/thrust/all/test_package/conanfile.py +++ b/recipes/thrust/all/test_package/conanfile.py @@ -1,10 +1,26 @@ 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, CMakeToolchain, cmake_layout -class ThrustTestConan(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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + backend = str(self.dependencies["thrust"].options.device_system).upper() + tc.variables["THRUST_BACKEND"] = backend + tc.generate() def build(self): cmake = CMake(self) @@ -12,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/thrust/all/test_package/test_package.cpp b/recipes/thrust/all/test_package/test_package.cpp index 48b3f8b33f1f7..28f5508b5fd2f 100644 --- a/recipes/thrust/all/test_package/test_package.cpp +++ b/recipes/thrust/all/test_package/test_package.cpp @@ -1,81 +1,11 @@ -// Adapted from https://github.com/thrust/thrust/blob/master/examples/monte_carlo.cu - -#include -#include -#include -#include +#include "test_package.cuh" #include #include -#include - -// we could vary M & N to find the perf sweet spot - -__host__ __device__ -unsigned int hash(unsigned int a) -{ - a = (a+0x7ed55d16) + (a<<12); - a = (a^0xc761c23c) ^ (a>>19); - a = (a+0x165667b1) + (a<<5); - a = (a+0xd3a2646c) ^ (a<<9); - a = (a+0xfd7046c5) + (a<<3); - a = (a^0xb55a4f09) ^ (a>>16); - return a; -} - -struct estimate_pi : public thrust::unary_function -{ - __host__ __device__ - float operator()(unsigned int thread_id) - { - float sum = 0; - unsigned int N = 100; // samples per thread - - unsigned int seed = hash(thread_id); - - // seed a random number generator - thrust::default_random_engine rng(seed); - - // create a mapping from random numbers to [0,1) - thrust::uniform_real_distribution u01(0,1); - - // take N samples in a quarter circle - for(unsigned int i = 0; i < N; ++i) - { - // draw a sample from the unit square - float x = u01(rng); - float y = u01(rng); - - // measure distance from the origin - float dist = sqrtf(x*x + y*y); - - // add 1.0f if (u0,u1) is inside the quarter circle - if(dist <= 1.0f) - sum += 1.0f; - } - - // multiply by 4 to get the area of the whole circle - sum *= 4.0f; - - // divide by N - return sum / N; - } -}; int main(void) { - // use 30 independent seeds - int M = 300; - - float estimate = thrust::transform_reduce(thrust::counting_iterator(0), - thrust::counting_iterator(M), - estimate_pi(), - 0.0f, - thrust::plus()); - estimate /= M; - std::cout << std::setprecision(3); - std::cout << "pi is approximately " << estimate << std::endl; - + std::cout << "pi is approximately " << estimate() << std::endl; return 0; } diff --git a/recipes/thrust/all/test_package/test_package.cu b/recipes/thrust/all/test_package/test_package.cu new file mode 100644 index 0000000000000..28f5508b5fd2f --- /dev/null +++ b/recipes/thrust/all/test_package/test_package.cu @@ -0,0 +1,11 @@ +#include "test_package.cuh" + +#include +#include + +int main(void) +{ + std::cout << std::setprecision(3); + std::cout << "pi is approximately " << estimate() << std::endl; + return 0; +} diff --git a/recipes/thrust/all/test_package/test_package.cuh b/recipes/thrust/all/test_package/test_package.cuh new file mode 100644 index 0000000000000..ccaa3b425e151 --- /dev/null +++ b/recipes/thrust/all/test_package/test_package.cuh @@ -0,0 +1,75 @@ +// Adapted from https://github.com/thrust/thrust/blob/master/examples/monte_carlo.cu +#pragma once + +#include +#include +#include +#include + +#include + +// we could vary M & N to find the perf sweet spot + +__host__ __device__ +unsigned int hash(unsigned int a) +{ + a = (a+0x7ed55d16) + (a<<12); + a = (a^0xc761c23c) ^ (a>>19); + a = (a+0x165667b1) + (a<<5); + a = (a+0xd3a2646c) ^ (a<<9); + a = (a+0xfd7046c5) + (a<<3); + a = (a^0xb55a4f09) ^ (a>>16); + return a; +} + +struct estimate_pi : public thrust::unary_function +{ + __host__ __device__ + float operator()(unsigned int thread_id) + { + float sum = 0; + unsigned int N = 100; // samples per thread + + unsigned int seed = hash(thread_id); + + // seed a random number generator + thrust::default_random_engine rng(seed); + + // create a mapping from random numbers to [0,1) + thrust::uniform_real_distribution u01(0,1); + + // take N samples in a quarter circle + for(unsigned int i = 0; i < N; ++i) + { + // draw a sample from the unit square + float x = u01(rng); + float y = u01(rng); + + // measure distance from the origin + float dist = sqrtf(x*x + y*y); + + // add 1.0f if (u0,u1) is inside the quarter circle + if(dist <= 1.0f) + sum += 1.0f; + } + + // multiply by 4 to get the area of the whole circle + sum *= 4.0f; + + // divide by N + return sum / N; + } +}; + +float estimate() { + // use 30 independent seeds + int M = 300; + + float estimate = thrust::transform_reduce(thrust::counting_iterator(0), + thrust::counting_iterator(M), + estimate_pi(), + 0.0f, + thrust::plus()); + estimate /= M; + return estimate; +} diff --git a/recipes/thrust/config.yml b/recipes/thrust/config.yml index 995f77f066bf1..f07d47b001a70 100644 --- a/recipes/thrust/config.yml +++ b/recipes/thrust/config.yml @@ -1,7 +1,7 @@ versions: - "1.9.5": - folder: all "1.16.0": folder: all "1.17.0": folder: all + "1.17.2": + folder: all diff --git a/recipes/tidy-html5/all/CMakeLists.txt b/recipes/tidy-html5/all/CMakeLists.txt deleted file mode 100644 index e5cb637716b89..0000000000000 --- 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 dbfb937f0f3c2..56deb76dc5c66 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 c7d99c3c56b67..cc182cadf26f4 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 7b9b613cbb24a..e21ed1c05b78f 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 bd7165a553cf4..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..7e2dfe859bb27 --- /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/timsort/all/conandata.yml b/recipes/timsort/all/conandata.yml index 47ca98338210c..494ae5cf97b30 100644 --- a/recipes/timsort/all/conandata.yml +++ b/recipes/timsort/all/conandata.yml @@ -1,25 +1,25 @@ sources: - "1.2.0": - sha256: 3a189cb8717efbf0442da1d62109b7e881c158ab8167f8997e79cdb3a2cd7c9a - url: https://github.com/timsort/cpp-TimSort/archive/v1.2.0.tar.gz - "1.2.1": - sha256: 4f32285926330c97290b102c92c4ae8c308f46f70488d383595ae5f191e1de55 - url: https://github.com/timsort/cpp-TimSort/archive/v1.2.1.tar.gz - "1.2.2": - sha256: 594a5e59248accd1caa6a9e0f145d91ed9cf5bf1044d46684df1e866a534ee76 - url: https://github.com/timsort/cpp-TimSort/archive/v1.2.2.tar.gz - "1.3.0": - sha256: 25fe8338ac053c09662d62bbcaab981e478054a75b9422c1a652e580026713f0 - url: https://github.com/timsort/cpp-TimSort/archive/v1.3.0.tar.gz - "2.0.0": - sha256: 6cb23b0efb83e1d4f6eab58cddd35b36ca49cd927a46294575b9c0d304a2e833 - url: https://github.com/timsort/cpp-TimSort/archive/v2.0.0.tar.gz - "2.0.1": - sha256: 5c7fe16ca8ead3a86691cb64c373b9ca634add6b6539254baa58f4e254e865c6 - url: https://github.com/timsort/cpp-TimSort/archive/v2.0.1.tar.gz - "2.0.2": - sha256: df15ac2cea751e573979ff97966f2b3d5d9c35a819c43d9944756974e069b2d7 - url: https://github.com/timsort/cpp-TimSort/archive/v2.0.2.tar.gz "2.1.0": - sha256: b16606f85316d9a3cfde638c02dd9ce23324b0a904bb020e4ad2497cb8cf9ebd - url: https://github.com/timsort/cpp-TimSort/archive/v2.1.0.tar.gz + url: "https://github.com/timsort/cpp-TimSort/archive/v2.1.0.tar.gz" + sha256: "b16606f85316d9a3cfde638c02dd9ce23324b0a904bb020e4ad2497cb8cf9ebd" + "2.0.2": + url: "https://github.com/timsort/cpp-TimSort/archive/v2.0.2.tar.gz" + sha256: "df15ac2cea751e573979ff97966f2b3d5d9c35a819c43d9944756974e069b2d7" + "2.0.1": + url: "https://github.com/timsort/cpp-TimSort/archive/v2.0.1.tar.gz" + sha256: "5c7fe16ca8ead3a86691cb64c373b9ca634add6b6539254baa58f4e254e865c6" + "2.0.0": + url: "https://github.com/timsort/cpp-TimSort/archive/v2.0.0.tar.gz" + sha256: "6cb23b0efb83e1d4f6eab58cddd35b36ca49cd927a46294575b9c0d304a2e833" + "1.3.0": + url: "https://github.com/timsort/cpp-TimSort/archive/v1.3.0.tar.gz" + sha256: "25fe8338ac053c09662d62bbcaab981e478054a75b9422c1a652e580026713f0" + "1.2.2": + url: "https://github.com/timsort/cpp-TimSort/archive/v1.2.2.tar.gz" + sha256: "594a5e59248accd1caa6a9e0f145d91ed9cf5bf1044d46684df1e866a534ee76" + "1.2.1": + url: "https://github.com/timsort/cpp-TimSort/archive/v1.2.1.tar.gz" + sha256: "4f32285926330c97290b102c92c4ae8c308f46f70488d383595ae5f191e1de55" + "1.2.0": + url: "https://github.com/timsort/cpp-TimSort/archive/v1.2.0.tar.gz" + sha256: "3a189cb8717efbf0442da1d62109b7e881c158ab8167f8997e79cdb3a2cd7c9a" diff --git a/recipes/timsort/all/conanfile.py b/recipes/timsort/all/conanfile.py index b1ba83d8496dd..9df11dc1a164c 100644 --- a/recipes/timsort/all/conanfile.py +++ b/recipes/timsort/all/conanfile.py @@ -1,42 +1,50 @@ -from conans 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 +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class TimsortConan(ConanFile): name = "timsort" description = "A C++ implementation of timsort" - topics = ("timsort", "sorting", "algorithms") + topics = ("sorting", "algorithms") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/timsort/cpp-TimSort" 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 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"): - if tools.Version(self.version) >= "2.0.0": - tools.check_min_cppstd(self, 11) - - def package_id(self): - self.info.header_only() + if Version(self.version) >= "2.0.0": + 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 build(self): + pass def package(self): - self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + 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.set_property("cmake_file_name", "gfx-timsort") self.cpp_info.set_property("cmake_target_name", "gfx::timsort") + 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"] = "gfx-timsort" diff --git a/recipes/timsort/all/test_package/CMakeLists.txt b/recipes/timsort/all/test_package/CMakeLists.txt index d7e20e564e8bd..0e39263ef4095 100644 --- a/recipes/timsort/all/test_package/CMakeLists.txt +++ b/recipes/timsort/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(gfx-timsort REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} gfx::timsort) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE gfx::timsort) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/timsort/all/test_package/conanfile.py b/recipes/timsort/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/timsort/all/test_package/conanfile.py +++ b/recipes/timsort/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,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/timsort/all/test_v1_package/CMakeLists.txt b/recipes/timsort/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/timsort/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/timsort/all/test_v1_package/conanfile.py b/recipes/timsort/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/timsort/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/timsort/config.yml b/recipes/timsort/config.yml index 95d7ff39635a1..798460e5d36d8 100644 --- a/recipes/timsort/config.yml +++ b/recipes/timsort/config.yml @@ -1,17 +1,17 @@ versions: - "1.2.0": - folder: all - "1.2.1": + "2.1.0": folder: all - "1.2.2": + "2.0.2": folder: all - "1.3.0": + "2.0.1": folder: all "2.0.0": folder: all - "2.0.1": + "1.3.0": folder: all - "2.0.2": + "1.2.2": folder: all - "2.1.0": + "1.2.1": + folder: all + "1.2.0": folder: all diff --git a/recipes/tinkerforge-bindings/all/CMakeLists.txt b/recipes/tinkerforge-bindings/all/CMakeLists.txt index 2ea059e4508ba..64a0e8e101bed 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/conandata.yml b/recipes/tinkerforge-bindings/all/conandata.yml index 4a2d6c836c7df..2db4c8cf9a932 100644 --- a/recipes/tinkerforge-bindings/all/conandata.yml +++ b/recipes/tinkerforge-bindings/all/conandata.yml @@ -1,5 +1,7 @@ sources: + "2.1.33": + url: "https://download.tinkerforge.com/bindings/c/tinkerforge_c_bindings_2_1_33.zip" + sha256: "50501ca76b574ed756fef8e647b2c0b14b8f970c3c7f28824db3b3a841d51798" "2.1.32": - url: https://download.tinkerforge.com/bindings/c/tinkerforge_c_bindings_2_1_32.zip + url: "https://download.tinkerforge.com/bindings/c/tinkerforge_c_bindings_2_1_32.zip" sha256: "228f8eb3e64170312ceaca7354ba5f3178e89389782b304657ccdd2a2fd2b6b5" - diff --git a/recipes/tinkerforge-bindings/all/conanfile.py b/recipes/tinkerforge-bindings/all/conanfile.py index fb57c7fccf3f7..43201b9ca3934 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 b831e148cc9c0..4be380621fecd 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 0245c9a8028a3..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..9b63bd176646b --- /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/tinkerforge-bindings/config.yml b/recipes/tinkerforge-bindings/config.yml index d03f744650d0a..a948d6b05afc2 100644 --- a/recipes/tinkerforge-bindings/config.yml +++ b/recipes/tinkerforge-bindings/config.yml @@ -1,3 +1,5 @@ versions: + "2.1.33": + folder: all "2.1.32": folder: all diff --git a/recipes/tiny-dnn/all/CMakeLists.txt b/recipes/tiny-dnn/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- 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 b3a57165d52a3..d88cf7b9a6e9e 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 e2d99200a80ab..efce3e2e31902 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 38f4483872d47..fae501d0afb9e 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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 e736cb9ab9606..2fbff13d26bb3 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 3475e6c4f17af..e88da3d9b79db 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 0000000000000..06261e0620b0d --- /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 0000000000000..c0749bfad8d12 --- /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 0000000000000..db679cccf2ab7 --- /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 05e771029ef2c..164aea9790081 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 481a3b9adeaa2..03f3d654478f9 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 0000000000000..0d20897301b68 --- /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 0000000000000..bb566468b9731 --- /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 16d1524b1696f..b8405fd5f1756 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/all/conanfile.py b/recipes/tinydir/all/conanfile.py index 02a2a8bc1ce2e..05e3a7a3c83ca 100644 --- a/recipes/tinydir/all/conanfile.py +++ b/recipes/tinydir/all/conanfile.py @@ -1,7 +1,11 @@ import os -from conans import ConanFile, tools -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 TinydirConan(ConanFile): name = "tinydir" @@ -10,19 +14,24 @@ class TinydirConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/cxong/tinydir" topics = ("portable", "filesystem", "directory", "posix", "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("tinydir.h", dst="include", src=self._source_subfolder) - self.copy("COPYING", dst="licenses", src=self._source_subfolder) + copy(self, "tinydir.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "COPYING", 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/tinydir/all/test_package/CMakeLists.txt b/recipes/tinydir/all/test_package/CMakeLists.txt index bd0eb537bad62..f2b0b480c35cb 100644 --- a/recipes/tinydir/all/test_package/CMakeLists.txt +++ b/recipes/tinydir/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 C) find_package(tinydir REQUIRED CONFIG) diff --git a/recipes/tinydir/all/test_package/conanfile.py b/recipes/tinydir/all/test_package/conanfile.py index 38f4483872d47..e0e49c1e8d6b6 100644 --- a/recipes/tinydir/all/test_package/conanfile.py +++ b/recipes/tinydir/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/tinydir/all/test_v1_package/CMakeLists.txt b/recipes/tinydir/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/tinydir/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/tinydir/all/test_v1_package/conanfile.py b/recipes/tinydir/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tinydir/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/tinydir/all/test_v1_package/test_package.c b/recipes/tinydir/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..cc0003c9c9d0c --- /dev/null +++ b/recipes/tinydir/all/test_v1_package/test_package.c @@ -0,0 +1,27 @@ +#include +#include + +#include "tinydir.h" + +int main() +{ + tinydir_dir dir; + tinydir_open(&dir, "."); + + while (dir.has_next) + { + tinydir_file file; + tinydir_readfile(&dir, &file); + + printf("%s", file.name); + if (file.is_dir) + { + printf("/"); + } + printf("\n"); + + tinydir_next(&dir); + } + + tinydir_close(&dir); +} diff --git a/recipes/tinydir/config.yml b/recipes/tinydir/config.yml index 712ebbf8b5754..065b272032773 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 6fdffb908d2c6..e57fb348a5c61 100644 --- a/recipes/tinyexr/all/conandata.yml +++ b/recipes/tinyexr/all/conandata.yml @@ -1,4 +1,10 @@ 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" "1.0.1": url: "https://github.com/syoyo/tinyexr/archive/v1.0.1.tar.gz" sha256: "4dbbd8c7d17597ad557518de5eb923bd02683d26d0de765f9224e8d57d121677" diff --git a/recipes/tinyexr/all/conanfile.py b/recipes/tinyexr/all/conanfile.py index 889c4c311e95f..cf57d86c16364 100644 --- a/recipes/tinyexr/all/conanfile.py +++ b/recipes/tinyexr/all/conanfile.py @@ -13,7 +13,7 @@ class TinyExrConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/syoyo/tinyexr" topics = ("exr", "header-only") - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_z": ["zlib", "miniz"], @@ -38,9 +38,9 @@ def layout(self): def requirements(self): if self.options.with_z == "miniz": - self.requires("miniz/3.0.1") + 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 af3bb0714e65c..675ce3be79396 100644 --- a/recipes/tinyexr/config.yml +++ b/recipes/tinyexr/config.yml @@ -1,4 +1,8 @@ versions: + "1.0.7": + folder: all + "1.0.6": + folder: all "1.0.1": folder: all "1.0.0": diff --git a/recipes/tinygltf/all/conandata.yml b/recipes/tinygltf/all/conandata.yml index 0e07d04c2de59..fb20b704f6ed3 100644 --- a/recipes/tinygltf/all/conandata.yml +++ b/recipes/tinygltf/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.8.19": + url: "https://github.com/syoyo/tinygltf/archive/v2.8.19.tar.gz" + sha256: "9e3f6206c6e922c7482e1b4612b62c5cddb7e053b6690fa20edfa5d97805053b" + "2.8.13": + url: "https://github.com/syoyo/tinygltf/archive/v2.8.13.tar.gz" + sha256: "72c3e5affa8389442582e4cf67426376e2dff418e998e19822260f4bf58b74b8" "2.5.0": url: "https://github.com/syoyo/tinygltf/archive/v2.5.0.tar.gz" sha256: "5d85bd556b60b1b69527189293cfa4902957d67fabb8582b6532f23a5ef27ec1" diff --git a/recipes/tinygltf/all/conanfile.py b/recipes/tinygltf/all/conanfile.py index 1d6e2279c2680..b9947293a173f 100644 --- a/recipes/tinygltf/all/conanfile.py +++ b/recipes/tinygltf/all/conanfile.py @@ -11,10 +11,10 @@ class TinygltfConan(ConanFile): name = "tinygltf" description = "Header only C++11 tiny glTF 2.0 library." license = "MIT" - topics = ("gltf") - homepage = "https://github.com/syoyo/tinygltf" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/syoyo/tinygltf" + topics = ("gltf", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "draco": [True, False], @@ -34,19 +34,18 @@ def package_id(self): self.info.clear() def requirements(self): - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.3") if self.options.draco: - self.requires("draco/1.5.5") + self.requires("draco/1.5.6") if self.options.stb_image or self.options.stb_image_write: - self.requires("stb/cci.20210910") + self.requires("stb/cci.20230920") 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], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): replace_in_file(self, os.path.join(self.source_folder, "tiny_gltf.h"), diff --git a/recipes/tinygltf/config.yml b/recipes/tinygltf/config.yml index a23d2b23eb439..0589bcf5301f7 100644 --- a/recipes/tinygltf/config.yml +++ b/recipes/tinygltf/config.yml @@ -1,4 +1,8 @@ versions: + "2.8.19": + folder: all + "2.8.13": + folder: all "2.5.0": folder: all "2.4.0": diff --git a/recipes/tinyxml/all/conanfile.py b/recipes/tinyxml/all/conanfile.py index 46d31e88896c2..3616d277c7fb4 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/tinyxml2/all/conandata.yml b/recipes/tinyxml2/all/conandata.yml index e2cd904cc1876..f8959f0c1aa8a 100644 --- a/recipes/tinyxml2/all/conandata.yml +++ b/recipes/tinyxml2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "10.0.0": + url: "https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz" + sha256: "3bdf15128ba16686e69bce256cc468e76c7b94ff2c7f391cc5ec09e40bff3839" "9.0.0": url: "https://github.com/leethomason/tinyxml2/archive/refs/tags/9.0.0.tar.gz" sha256: "cc2f1417c308b1f6acc54f88eb70771a0bf65f76282ce5c40e54cfe52952702c" diff --git a/recipes/tinyxml2/config.yml b/recipes/tinyxml2/config.yml index 0458a9c7b0da4..08bc3b64c9acc 100644 --- a/recipes/tinyxml2/config.yml +++ b/recipes/tinyxml2/config.yml @@ -1,4 +1,6 @@ versions: + "10.0.0": + folder: all "9.0.0": folder: all "8.0.0": diff --git a/recipes/tixi3/all/conanfile.py b/recipes/tixi3/all/conanfile.py index b8124c51186f6..9ec42f58000e7 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("libxslt/1.1.34") - self.requires("libcurl/7.84.0") + self.requires("libxml2/2.11.6") + self.requires("libxslt/1.1.37") + 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 c9358ca94ac50..9d54bfb6f94d4 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 0e104e3f9a662..ef5d7042163ec 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 80f9071294122..0000000000000 --- 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 d620b7c8ee1ca..0000000000000 --- 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 8cbbcf9134e3c..7e9e03ca25a75 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 97130833734db..2c3e88ddc0d5b 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 0000000000000..6fa4dea2761c6 --- /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 0000000000000..bd293b31a745e --- /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 0000000000000..ecabe8916794b --- /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 7672a2d37cdd9..5cec06aa08035 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 a7a94271504b6..91a8fc7a09b42 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 0000000000000..9a62551dccab6 --- /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 601b2c8c2b4fc..0000000000000 --- 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 0000000000000..0fe0f8ae90d2e --- /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 0000000000000..a7a94271504b6 --- /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/tl-function-ref/all/conanfile.py b/recipes/tl-function-ref/all/conanfile.py index 06ae98ab9af68..8868ec6b1b3e9 100644 --- a/recipes/tl-function-ref/all/conanfile.py +++ b/recipes/tl-function-ref/all/conanfile.py @@ -35,8 +35,10 @@ def build(self): pass def package(self): - copy(self, "COPYING", 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, "COPYING", 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", "tl-function-ref") @@ -46,14 +48,16 @@ def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.resdirs = [] - # TODO: to remove in conan v2 once cmake_find_package* generators removed + # TODO: to remove in conan v2 once cmake_find_package* generators + # removed. self.cpp_info.filenames["cmake_find_package"] = "tl-function-ref" self.cpp_info.filenames["cmake_find_package_multi"] = "tl-function-ref" self.cpp_info.names["cmake_find_package"] = "tl" self.cpp_info.names["cmake_find_package_multi"] = "tl" self.cpp_info.components["function-ref"].names["cmake_find_package"] = "function-ref" self.cpp_info.components["function-ref"].names["cmake_find_package_multi"] = "function-ref" - self.cpp_info.components["function-ref"].set_property("cmake_target_name", "tl::function-ref") + self.cpp_info.components["function-ref"].set_property( + "cmake_target_name", "tl::function-ref") self.cpp_info.components["function-ref"].bindirs = [] self.cpp_info.components["function-ref"].frameworkdirs = [] self.cpp_info.components["function-ref"].libdirs = [] diff --git a/recipes/tl-optional/all/conandata.yml b/recipes/tl-optional/all/conandata.yml index eb9035a81e907..bf26f6c9e3c77 100644 --- a/recipes/tl-optional/all/conandata.yml +++ b/recipes/tl-optional/all/conandata.yml @@ -2,3 +2,6 @@ sources: "1.0.0": url: https://github.com/TartanLlama/optional/archive/v1.0.0.zip sha256: 8bb68defc61da3de2b4cd73ef9792eba44570ec5cb52c4da731286f24aecbb95 + "1.1.0": + url: https://github.com/TartanLlama/optional/archive/v1.1.0.zip + sha256: a336bb10f51945369c1dd6dc6d2a7086602ab9cab52c98a7a6224bfd782bc0c7 diff --git a/recipes/tl-optional/config.yml b/recipes/tl-optional/config.yml index 40341aa3db6cd..b0abed6f3ca04 100644 --- a/recipes/tl-optional/config.yml +++ b/recipes/tl-optional/config.yml @@ -1,3 +1,5 @@ versions: "1.0.0": folder: all + "1.1.0": + folder: all diff --git a/recipes/tllist/all/conandata.yml b/recipes/tllist/all/conandata.yml index 57b91d7bbc8b2..b5b25e638eacf 100644 --- a/recipes/tllist/all/conandata.yml +++ b/recipes/tllist/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://codeberg.org/dnkl/tllist/archive/1.1.0.tar.gz" + sha256: "3f3fe2f7433719cec816c63937a7aa36e566bd317763ef46d11562073ab6361d" "1.0.5": url: "https://codeberg.org/dnkl/tllist/archive/1.0.5.tar.gz" - sha256: b0f32c9b2c2015c8d8dd068fd4e8b586aa91ca1670badc274ec962559ee0aadd + sha256: "b0f32c9b2c2015c8d8dd068fd4e8b586aa91ca1670badc274ec962559ee0aadd" diff --git a/recipes/tllist/all/conanfile.py b/recipes/tllist/all/conanfile.py index 3aefd5f1a8e81..35ff91663df3f 100644 --- a/recipes/tllist/all/conanfile.py +++ b/recipes/tllist/all/conanfile.py @@ -1,40 +1,70 @@ -from conan import ConanFile -from conans import 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.microsoft import is_msvc +from conan.tools.scm import Version -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class TllistConan(ConanFile): name = "tllist" + description = "A C header file only implementation of a typed linked list." license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://codeberg.org/dnkl/tllist" - description = "A C header file only implementation of a typed linked list." - topics = ("list", "utils", "typed-linked-list") - settings = "os", "arch", "build_type", "compiler" + topics = ("list", "utils", "typed-linked-list", "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 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "gcc": "7", + "clang": "5.0", + "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) + 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." + ) + # tllist relies on __typeof__, not implemented in Visual Studio - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("Visual Studio compiler is not supported") + 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", src=self._source_subfolder, dst="include") - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("pkg_config_name", "tllist") diff --git a/recipes/tllist/all/test_package/CMakeLists.txt b/recipes/tllist/all/test_package/CMakeLists.txt index 929cb14b5f70b..33ff310d27421 100644 --- a/recipes/tllist/all/test_package/CMakeLists.txt +++ b/recipes/tllist/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(tllist CONFIG REQUIRED) +find_package(tllist REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} tllist::tllist) diff --git a/recipes/tllist/all/test_package/conanfile.py b/recipes/tllist/all/test_package/conanfile.py index 49a3a66ea5bad..fae501d0afb9e 100644 --- a/recipes/tllist/all/test_package/conanfile.py +++ b/recipes/tllist/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/tllist/all/test_v1_package/CMakeLists.txt b/recipes/tllist/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/tllist/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/tllist/all/test_v1_package/conanfile.py b/recipes/tllist/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/tllist/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/tllist/all/test_v1_package/test_package.c b/recipes/tllist/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..77b3400127915 --- /dev/null +++ b/recipes/tllist/all/test_v1_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, const char *const *argv) { + tll(int) l = tll_init(); + + tll_push_back(l, 43); + + return EXIT_SUCCESS; +} diff --git a/recipes/tllist/config.yml b/recipes/tllist/config.yml index 9d896aecb9356..2c85a5a09f1df 100644 --- a/recipes/tllist/config.yml +++ b/recipes/tllist/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.0": + folder: "all" "1.0.5": folder: "all" diff --git a/recipes/tlx/all/conandata.yml b/recipes/tlx/all/conandata.yml index 5d98c93707e87..4dc1e534af439 100644 --- a/recipes/tlx/all/conandata.yml +++ b/recipes/tlx/all/conandata.yml @@ -1,8 +1,14 @@ sources: + "0.6.1": + url: "https://github.com/tlx/tlx/archive/refs/tags/v0.6.1.tar.gz" + sha256: "24dd1acf36dd43b8e0414420e3f9adc2e6bb0e75047e872a06167961aedad769" "0.5.20200222": url: "https://github.com/tlx/tlx/archive/refs/tags/v0.5.20200222.tar.gz" sha256: "99e63691af3ada066682243f3a65cd6eb32700071cdd6cfedb18777b5ff5ff4d" patches: + "0.6.1": + - patch_file: "patches/0001-fix-dll-install.patch" + - patch_file: "patches/0002-fix-shared-apple.patch" "0.5.20200222": - patch_file: "patches/0001-fix-dll-install.patch" - patch_file: "patches/0002-fix-shared-apple.patch" diff --git a/recipes/tlx/config.yml b/recipes/tlx/config.yml index 08dbe5e6d3977..1a2097579ad40 100644 --- a/recipes/tlx/config.yml +++ b/recipes/tlx/config.yml @@ -1,3 +1,5 @@ versions: + "0.6.1": + folder: all "0.5.20200222": folder: all diff --git a/recipes/tmx/all/conanfile.py b/recipes/tmx/all/conanfile.py index 5a3b3214bc42f..a45d56f04f970 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.6") 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 4a409ba3da2e2..326cababad6b6 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/toml11/all/conandata.yml b/recipes/toml11/all/conandata.yml index 473d7afa5e2db..4af534aa325d5 100644 --- a/recipes/toml11/all/conandata.yml +++ b/recipes/toml11/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.8.1": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.8.1.tar.gz" + sha256: "6a3d20080ecca5ea42102c078d3415bef80920f6c4ea2258e87572876af77849" + "3.8.0": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.8.0.tar.gz" + sha256: "36ce64b09f9151b57ba1970f12a591006fcae17b751ba011314c1f5518e77bc7" "3.7.1": url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.7.1.tar.gz" sha256: "afeaa9aa0416d4b6b2cd3897ca55d9317084103077b32a852247d8efd4cf6068" diff --git a/recipes/toml11/all/conanfile.py b/recipes/toml11/all/conanfile.py index 72284ac7310c2..7d770d91572aa 100644 --- a/recipes/toml11/all/conanfile.py +++ b/recipes/toml11/all/conanfile.py @@ -9,11 +9,12 @@ class Toml11Conan(ConanFile): name = "toml11" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/ToruNiina/toml11" description = "TOML for Modern C++" - topics = ("toml", "c-plus-plus-11", "c-plus-plus", "parser", "serializer") license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ToruNiina/toml11" + topics = ("toml", "c-plus-plus-11", "c-plus-plus", "parser", "serializer", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,11 +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) - - def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "toml.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "toml11")) diff --git a/recipes/toml11/config.yml b/recipes/toml11/config.yml index 2a3893e072fff..cc2a74e6a20e3 100644 --- a/recipes/toml11/config.yml +++ b/recipes/toml11/config.yml @@ -1,4 +1,8 @@ versions: + "3.8.1": + folder: all + "3.8.0": + folder: all "3.7.1": folder: all "3.7.0": diff --git a/recipes/tomlplusplus/all/conandata.yml b/recipes/tomlplusplus/all/conandata.yml index a459f949569ec..63de1cac4b075 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 44f523638d713..c7d9d9ea44bf5 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 db279683bd8cc..57da1f7d0d18b 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 aba957cc3efa9..0e8807dfd3ae4 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 4cd7ca8687e68..0705075264b76 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 266a1ecb7f6b1..de70002df8416 100644 --- a/recipes/tracy/all/conandata.yml +++ b/recipes/tracy/all/conandata.yml @@ -1,4 +1,10 @@ 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" "0.9": url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.9.tar.gz" sha256: "93a91544e3d88f3bc4c405bad3dbc916ba951cdaadd5fcec1139af6fa56e6bfc" diff --git a/recipes/tracy/all/conanfile.py b/recipes/tracy/all/conanfile.py index bdb852b534295..a056814ff0165 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 77aaa018b1794..7f42fe99a398a 100644 --- a/recipes/tracy/config.yml +++ b/recipes/tracy/config.yml @@ -1,4 +1,8 @@ versions: + "0.10": + folder: all + "0.9.1": + folder: all "0.9": folder: all "0.8.2.1": diff --git a/recipes/trantor/all/conandata.yml b/recipes/trantor/all/conandata.yml index 22a2a702c41db..5d96de887257b 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 eae8498e37414..9deee06df4b9b 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 0000000000000..ac4b2f2545dce --- /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 0000000000000..bbeb7c91c05b7 --- /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 12c881a36cc34..0000000000000 --- 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 57e22ce3a2fae..dddf9970713ce 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 0000000000000..cf9c37d17b6e1 --- /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 0000000000000..683be30ad0ede --- /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 0000000000000..a6886aa3b08d0 --- /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 0000000000000..dff3b713e92cc --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..605527c604de8 --- /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 0000000000000..b32c668575dde --- /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 2d76c83c9cbd4..a028ec4e4627c 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 fe7f567397167..f225285a8fae5 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 84ab13ea08213..9f73c2c805dce 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 48140fe26ab46..177a777e8ddf7 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 38f4483872d47..fc47f4cefd612 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 8304408636b4b..7070a273f171a 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/tree-sitter/all/CMakeLists.txt b/recipes/tree-sitter/all/CMakeLists.txt index 2d67e95f598b6..5f48ce80be466 100644 --- a/recipes/tree-sitter/all/CMakeLists.txt +++ b/recipes/tree-sitter/all/CMakeLists.txt @@ -1,21 +1,18 @@ cmake_minimum_required(VERSION 3.4) project(tree-sitter C) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - # Use cmake script instead of Makefile to support MSVC + follow fPIC option -file(GLOB SOURCES RELATIVE "${PROJECT_SOURCE_DIR}" source_subfolder/lib/src/*.c) -list(REMOVE_ITEM SOURCES source_subfolder/lib/src/lib.c) +file(GLOB SOURCES RELATIVE "${PROJECT_SOURCE_DIR}" src/lib/src/*.c) +list(REMOVE_ITEM SOURCES src/lib/src/lib.c) -file(GLOB HEADERS source_subfolder/lib/include/tree_sitter/*.h) +file(GLOB HEADERS src/lib/include/tree_sitter/*.h) add_library(${PROJECT_NAME} ${SOURCES}) target_include_directories(${PROJECT_NAME} PRIVATE - $ - $ + $ + $ ) set_target_properties(${PROJECT_NAME} PROPERTIES diff --git a/recipes/tree-sitter/all/conandata.yml b/recipes/tree-sitter/all/conandata.yml index d0e08afc47bc9..43b71bcba5f69 100644 --- a/recipes/tree-sitter/all/conandata.yml +++ b/recipes/tree-sitter/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.20.8": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.20.8.tar.gz" + sha256: "6181ede0b7470bfca37e293e7d5dc1d16469b9485d13f13a605baec4a8b1f791" "0.20.6": url: "https://github.com/tree-sitter/tree-sitter/archive/v0.20.6.tar.gz" sha256: "4d37eaef8a402a385998ff9aca3e1043b4a3bba899bceeff27a7178e1165b9de" diff --git a/recipes/tree-sitter/all/conanfile.py b/recipes/tree-sitter/all/conanfile.py index 0ab58caffc58f..db16033332a0c 100644 --- a/recipes/tree-sitter/all/conanfile.py +++ b/recipes/tree-sitter/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import CMake, ConanFile, tools -import functools +import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.files import get, copy + +required_conan_version = ">=1.53.0" class TreeSitterConan(ConanFile): @@ -11,6 +14,7 @@ class TreeSitterConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://tree-sitter.github.io/tree-sitter" license = "MIT" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -21,42 +25,39 @@ class TreeSitterConan(ConanFile): "shared": False, } - generators = "cmake" + generators = "CMakeToolchain" exports_sources = "CMakeLists.txt" - @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 - 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 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") - @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 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("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.names["pkg_config"] = "tree-sitter" self.cpp_info.libs = ["tree-sitter"] diff --git a/recipes/tree-sitter/all/test_package/CMakeLists.txt b/recipes/tree-sitter/all/test_package/CMakeLists.txt index 1f6c3d19b27a6..c0b053bd23a36 100644 --- a/recipes/tree-sitter/all/test_package/CMakeLists.txt +++ b/recipes/tree-sitter/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 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/tree-sitter/all/test_package/conanfile.py b/recipes/tree-sitter/all/test_package/conanfile.py index 38f4483872d47..a8ebbe0c45c36 100644 --- a/recipes/tree-sitter/all/test_package/conanfile.py +++ b/recipes/tree-sitter/all/test_package/conanfile.py @@ -1,17 +1,27 @@ -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", "cmake_find_package_multi" + +class TestPacakgeConan(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 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/tree-sitter/all/test_package/test_package.c b/recipes/tree-sitter/all/test_package/test_package.c index 6ed5f62951a82..08527638921d3 100644 --- a/recipes/tree-sitter/all/test_package/test_package.c +++ b/recipes/tree-sitter/all/test_package/test_package.c @@ -1,8 +1,9 @@ #include -//More detailed example search at https://tree-sitter.github.io/tree-sitter/using-parsers#getting-started +// More detailed example search at +// https://tree-sitter.github.io/tree-sitter/using-parsers#getting-started int main() { - TSParser *parser = ts_parser_new(); - ts_parser_delete(parser); - return 0; + TSParser *parser = ts_parser_new(); + ts_parser_delete(parser); + return 0; } diff --git a/recipes/tree-sitter/config.yml b/recipes/tree-sitter/config.yml index be011f8935f2a..30720fc6f1016 100644 --- a/recipes/tree-sitter/config.yml +++ b/recipes/tree-sitter/config.yml @@ -1,4 +1,6 @@ versions: + "0.20.8": + folder: all "0.20.6": folder: all "0.20.0": diff --git a/recipes/troldal-zippy/all/conandata.yml b/recipes/troldal-zippy/all/conandata.yml index 0c73d6b1de095..c40a62c37d987 100644 --- a/recipes/troldal-zippy/all/conandata.yml +++ b/recipes/troldal-zippy/all/conandata.yml @@ -1,8 +1,7 @@ sources: "cci.20200622": url: "https://github.com/troldal/Zippy/archive/a838de8522f9051df0d1b202473bb6befe648702.tar.gz" - sha256: "8be803861b69c51179ade1f2ce62f07fb1f2d301a084d705c8ec2374db22071a" + sha256: "0233303a49bae9f705cb25c44e7f8c9917c49a90c8e314ca79f48dd23dd1a836" patches: "cci.20200622": - patch_file: "patches/zippy-archive-mkdir.patch" - base_path: "source_subfolder" diff --git a/recipes/troldal-zippy/all/conanfile.py b/recipes/troldal-zippy/all/conanfile.py index 9264f7d6a36ec..999217a8ec5a5 100644 --- a/recipes/troldal-zippy/all/conanfile.py +++ b/recipes/troldal-zippy/all/conanfile.py @@ -1,25 +1,27 @@ -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 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 + +required_conan_version = ">=1.52.0" + class TroldalZippyConan(ConanFile): name = "troldal-zippy" - description = "A simple C++ wrapper around the \"miniz\" zip library " - topics = ("wrapper", "compression", "zip") + description = 'A simple C++ wrapper around the "miniz" zip library ' + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/troldal/Zippy" - license = "MIT" - settings = "compiler" - exports_sources = "patches/*" + topics = ("wrapper", "compression", "zip", "header-only") - @property - def _source_subfolder(self): - return "source_subfolder" - - def requirements(self): - self.requires("miniz/2.2.0") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _minimum_cpp_standard(self): @@ -28,40 +30,61 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): return { - "Visual Studio": "17", "gcc": "7", "clang": "6", "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("miniz/3.0.2") + + 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) - 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)) + check_min_cppstd(self, self._minimum_cpp_standard) + if is_msvc(self): + check_min_vs(self, "192") 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)) + 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): - 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): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.hpp", dst="include", src=os.path.join(self._source_subfolder, "library")) - - def package_id(self): - self.info.header_only() + apply_conandata_patches(self) + 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, "library")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + # To match the target created here - # https://github.com/troldal/Zippy/blob/a838de8522f9051df0d1b202473bb6befe648702/library/CMakeLists.txt#L10 + # https://github.com/troldal/Zippy/blob/a838de8522f9051df0d1b202473bb69befe648702/library/CMakeLists.txt#L10 + self.cpp_info.set_property("cmake_file_name", "Zippy") + self.cpp_info.set_property("cmake_target_name", "Zippy::Zippy") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "Zippy" self.cpp_info.filenames["cmake_find_package_multi"] = "Zippy" self.cpp_info.names["cmake_find_package"] = "Zippy" diff --git a/recipes/troldal-zippy/all/test_package/CMakeLists.txt b/recipes/troldal-zippy/all/test_package/CMakeLists.txt index 6c1d84c7e3d82..90b1ca052dca1 100644 --- a/recipes/troldal-zippy/all/test_package/CMakeLists.txt +++ b/recipes/troldal-zippy/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(Zippy REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE Zippy::Zippy) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/troldal-zippy/all/test_package/conanfile.py b/recipes/troldal-zippy/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/troldal-zippy/all/test_package/conanfile.py +++ b/recipes/troldal-zippy/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" + 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/troldal-zippy/all/test_v1_package/CMakeLists.txt b/recipes/troldal-zippy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/troldal-zippy/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/troldal-zippy/all/test_v1_package/conanfile.py b/recipes/troldal-zippy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/troldal-zippy/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/trompeloeil/all/conandata.yml b/recipes/trompeloeil/all/conandata.yml index bb27ac3c59d8a..ba2243425c538 100644 --- a/recipes/trompeloeil/all/conandata.yml +++ b/recipes/trompeloeil/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "47": + url: "https://github.com/rollbear/trompeloeil/archive/v47.tar.gz" + sha256: "4a1d79260c1e49e065efe0817c8b9646098ba27eed1802b0c3ba7d959e4e5e84" + "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 +21,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 c2548bfe997b8..e3776238f24cf 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 26645b05ba8da..b8ee3e687f441 100644 --- a/recipes/trompeloeil/config.yml +++ b/recipes/trompeloeil/config.yml @@ -1,4 +1,10 @@ versions: + "47": + folder: all + "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 f9a1b573dbe33..c1b715cc27747 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 eebfbab4ba7b5..0d20897301b68 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 f95fe9a099612..3281d0221c878 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 81d982b72282a..049388ce41611 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 8c6297fe62672..4e37fe94c1699 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 15d716d7a9505..0d20897301b68 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 fbce5d32f1f2b..0c2749d1da56d 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 6a1b5a8c7df69..0d20897301b68 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-hopscotch-map/all/conandata.yml b/recipes/tsl-hopscotch-map/all/conandata.yml index 6166a7c7730e6..191b340d98e5d 100644 --- a/recipes/tsl-hopscotch-map/all/conandata.yml +++ b/recipes/tsl-hopscotch-map/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.1": + url: "https://github.com/Tessil/hopscotch-map/archive/v2.3.1.tar.gz" + sha256: "53dab49005cd5dc859f2546d0d3eef058ec7fb3b74fc3b19f4965a9a151e9b20" "2.3.0": url: "https://github.com/Tessil/hopscotch-map/archive/v2.3.0.tar.gz" sha256: "a59d65b552dc7682521989842418c92257147f5068152b5af50e917892ad9317" diff --git a/recipes/tsl-hopscotch-map/all/conanfile.py b/recipes/tsl-hopscotch-map/all/conanfile.py index 6772f3c321bc9..cb1372f74dd49 100644 --- a/recipes/tsl-hopscotch-map/all/conanfile.py +++ b/recipes/tsl-hopscotch-map/all/conanfile.py @@ -11,9 +11,10 @@ class TslHopscotchMapConan(ConanFile): name = "tsl-hopscotch-map" license = "MIT" description = "C++ implementation of a fast hash map and hash set using hopscotch hashing" - topics = ("structure", "hash map", "hash set") - homepage = "https://github.com/Tessil/hopscotch-map" + topics = ("structure", "hash map", "hash set", "header-only") url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tessil/hopscotch-map" + 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::hopscotch_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-hopscotch-map" @@ -55,4 +54,3 @@ def package_info(self): self.cpp_info.components["hopscotch_map"].set_property("cmake_target_name", "tsl::hopscotch_map") self.cpp_info.components["hopscotch_map"].bindirs = [] self.cpp_info.components["hopscotch_map"].libdirs = [] - self.cpp_info.components["hopscotch_map"].resdirs = [] diff --git a/recipes/tsl-hopscotch-map/config.yml b/recipes/tsl-hopscotch-map/config.yml index d724287fc23cb..7e1b2aadac1de 100644 --- a/recipes/tsl-hopscotch-map/config.yml +++ b/recipes/tsl-hopscotch-map/config.yml @@ -1,3 +1,5 @@ versions: + "2.3.1": + folder: all "2.3.0": folder: all diff --git a/recipes/tsl-ordered-map/all/conanfile.py b/recipes/tsl-ordered-map/all/conanfile.py index d13b78edda147..9883b71a12ac3 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 60cfac70c1a0d..14ac380eaf691 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 4168882cba1a3..9afa37e182a6b 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 3e681dedd0cd4..0d20897301b68 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/conandata.yml b/recipes/tuplet/all/conandata.yml index 98eee37c105c5..defd879c8e383 100644 --- a/recipes/tuplet/all/conandata.yml +++ b/recipes/tuplet/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: "https://github.com/codeinred/tuplet/archive/v2.1.1.tar.gz" + sha256: "2df403ffeed38a9687a3f2a7d2a68419ba029f519244e9bcd30caa0e8ec2ead3" "2.1.0": url: "https://github.com/codeinred/tuplet/archive/v2.1.0.tar.gz" sha256: "e77503b81259c4d67d1b16b887b9ab778422e2ffc031d2171b5117d2fddb237c" diff --git a/recipes/tuplet/all/conanfile.py b/recipes/tuplet/all/conanfile.py index e4ef08ece551c..b8e4521ac3319 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/tuplet/config.yml b/recipes/tuplet/config.yml index dab8b51866d73..56682d1116e02 100644 --- a/recipes/tuplet/config.yml +++ b/recipes/tuplet/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.1": + folder: all "2.1.0": folder: all "2.0.0": diff --git a/recipes/turtle/all/conanfile.py b/recipes/turtle/all/conanfile.py index 9e4b9153b69bc..1f12c41eb77c7 100644 --- a/recipes/turtle/all/conanfile.py +++ b/recipes/turtle/all/conanfile.py @@ -1,30 +1,37 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout import os +required_conan_version = ">=1.53.0" class TurtleConan(ConanFile): name = "turtle" description = "Turtle is a C++ mock object library based on Boost with a focus on usability, simplicity and flexibility." - topics = ("conan", "turtule", "mock", "test", "boost") + topics = ("mock", "test", "boost") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mat007/turtle" license = "BSL-1.0" no_copy_source = True + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.73.0") + self.requires("boost/1.81.0") def package_id(self): - self.info.header_only() + self.info.clear() + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] 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 package(self): - self.copy("LICENSE_1_0.txt", dst="licenses", src=self._source_subfolder) - self.copy("*.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")) diff --git a/recipes/turtle/all/test_package/CMakeLists.txt b/recipes/turtle/all/test_package/CMakeLists.txt index 232bbd2abd280..284560de8122d 100644 --- a/recipes/turtle/all/test_package/CMakeLists.txt +++ b/recipes/turtle/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - find_package(turtle REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/turtle/all/test_package/conanfile.py b/recipes/turtle/all/test_package/conanfile.py index 7e2dfe859bb27..f13196f305151 100644 --- a/recipes/turtle/all/test_package/conanfile.py +++ b/recipes/turtle/all/test_package/conanfile.py @@ -1,10 +1,17 @@ -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" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +19,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/tweetnacl/all/CMakeLists.txt b/recipes/tweetnacl/all/CMakeLists.txt index 971f0647720b1..b90e7d4a682db 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 3dcc47bfef437..a3fbddf32a913 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 b5b3d196ced3e..0c97672dae4cc 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 7b9b613cbb24a..ff98951f060d9 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 bd7165a553cf4..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..7e2dfe859bb27 --- /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 3f96a3374441c..0000000000000 --- 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 4ddda5e545311..0ca341563c80b 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 9e025ba63f993..3f478da041a70 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 e9ef8141281a0..0b516bd88e539 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 d62079e114cc8..6ce9e9cc4ff9b 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 667b93ec41536..9e540f91ccbcd 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 d9dd1034a8272..673b6b659b166 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 5ba8bef81f80e..8d7d208570a6e 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 42a57ddd91913..e2e2490435629 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 0000000000000..91630d79f4abb --- /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 0000000000000..bbac244c5a058 --- /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 3f96a3374441c..0000000000000 --- 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 4c0490bd52328..ba721a294a6f3 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 8e59051225235..4ecfa76766259 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 0000000000000..61fef8d1ecbf9 --- /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 50f4073082df2..c9f535322388c 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 6f930d53958b3..8d52b7021efe1 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 0000000000000..91630d79f4abb --- /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 0000000000000..a4ca380f17734 --- /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/type_safe/all/conandata.yml b/recipes/type_safe/all/conandata.yml index 8703a48442789..0be0030fda0b5 100644 --- a/recipes/type_safe/all/conandata.yml +++ b/recipes/type_safe/all/conandata.yml @@ -1,7 +1,10 @@ sources: + "0.2.3": + url: "https://github.com/foonathan/type_safe/archive/v0.2.3.tar.gz" + sha256: "19008ab9526b0d2db1ae6bbd6640f5f7a398826bb2266561472e9f1b10d85bec" "0.2.2": url: "https://github.com/foonathan/type_safe/archive/v0.2.2.tar.gz" sha256: "34d97123fb9bca04a333565c4a2498425d602ec0c759de4be1b8cfae77d05823" '0.2.1': - url: https://github.com/foonathan/type_safe/archive/v0.2.1.zip - sha256: 1c941f7ecd5e17e80773a2d8c9c905f552cc80417f8006ade7e9fa3525ff1b55 + url: "https://github.com/foonathan/type_safe/archive/v0.2.1.tar.gz" + sha256: "49c703d52b724635cb9ee0cfeac9e2c9957134380da900a69791bd0e3d0c3673" diff --git a/recipes/type_safe/all/conanfile.py b/recipes/type_safe/all/conanfile.py index 0864c1a6720cf..a527bd249ec3e 100644 --- a/recipes/type_safe/all/conanfile.py +++ b/recipes/type_safe/all/conanfile.py @@ -1,37 +1,53 @@ -from conans import ConanFile, tools import os -class TypeSafe(ConanFile): - name = 'type_safe' - description = 'Zero overhead utilities for preventing bugs at compile time' - url = 'https://github.com/conan-io/conan-center-index' - homepage = 'https://foonathan.net/type_safe' - license = 'MIT' - topics = 'conan', 'c++', 'strong typing', 'vocabulary-types' +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 - settings = 'compiler' +required_conan_version = ">=1.52.0" - no_copy_source = True - _source_subfolder = 'source_subfolder' - requires = 'debug_assert/1.3.3' +class TypeSafe(ConanFile): + name = "type_safe" + description = "Zero overhead utilities for preventing bugs at compile time" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://type_safe.foonathan.net/" + topics = ("c++", "strong typing", "vocabulary-types", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property - def _repo_folder(self): - return os.path.join(self.source_folder, self._source_subfolder) + def _min_cppstd(self): + return 11 - 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 layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("debug_assert/1.3.3") - def configure(self): + def package_id(self): + 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 package(self): - self.copy("*LICENSE", dst="licenses", keep_path=False) - self.copy("*", src=os.path.join(self._repo_folder, 'include'), dst='include/') + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def package_id(self): - self.info.header_only() + def package(self): + copy(self, "*LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, keep_path=False) + 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 = [] diff --git a/recipes/type_safe/all/test_package/CMakeLists.txt b/recipes/type_safe/all/test_package/CMakeLists.txt index 33ae887aa6aea..d669047ac6039 100644 --- a/recipes/type_safe/all/test_package/CMakeLists.txt +++ b/recipes/type_safe/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(type_safe 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) +target_link_libraries(${PROJECT_NAME} PRIVATE type_safe::type_safe) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/type_safe/all/test_package/conanfile.py b/recipes/type_safe/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/type_safe/all/test_package/conanfile.py +++ b/recipes/type_safe/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" + 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/type_safe/all/test_v1_package/CMakeLists.txt b/recipes/type_safe/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/type_safe/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/type_safe/all/test_v1_package/conanfile.py b/recipes/type_safe/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/type_safe/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/type_safe/config.yml b/recipes/type_safe/config.yml index 3d99cc668cde3..ae20ba2754647 100644 --- a/recipes/type_safe/config.yml +++ b/recipes/type_safe/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.3": + folder: all "0.2.2": folder: all '0.2.1': diff --git a/recipes/tz/all/conandata.yml b/recipes/tz/all/conandata.yml new file mode 100644 index 0000000000000..dd6b60859c1a9 --- /dev/null +++ b/recipes/tz/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2023c": + url: "https://github.com/eggert/tz/archive/refs/tags/2023c.tar.gz" + sha256: "9aa20ef838183e58f09acca92098cf6aa6d8e229aecf24e098c3af2a38e596f8" diff --git a/recipes/tz/all/conanfile.py b/recipes/tz/all/conanfile.py new file mode 100644 index 0000000000000..38bd6ee601c91 --- /dev/null +++ b/recipes/tz/all/conanfile.py @@ -0,0 +1,73 @@ +import os + +from conan import ConanFile +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + +class TzConan(ConanFile): + name = "tz" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.iana.org/time-zones" + description = "The Time Zone Database contains data that represent the history of local time for many representative locations around the globe." + topics = ("tz", "tzdb", "time", "zone", "date") + settings = "os", "build_type", "arch", "compiler" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + 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 package_id(self): + del self.info.settings.compiler + + def build_requirements(self): + self.tool_requires("mawk/1.3.4-20230404") + 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): + tc = AutotoolsToolchain(self) + tc.generate() + + def _patch_sources(self): + # INFO: The Makefile enforces /usr/bin/awk, but we want to use tool requirements + awk_path = os.path.join(self.dependencies.direct_build['mawk'].package_folder, "bin", "mawk").replace("\\", "/") + replace_in_file(self, os.path.join(self.source_folder, "Makefile"), "AWK= awk", f"AWK={awk_path}") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.make(args=["-C", self.source_folder.replace("\\", "/")]) + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + autotools = Autotools(self) + destdir = self.package_folder.replace('\\', '/') + autotools.install(args=["-C", self.source_folder.replace("\\", "/"), f"DESTDIR={destdir}"]) + rmdir(self, os.path.join(self.package_folder, "usr", "share", "man")) + # INFO: The library does not have a public API, it's used to build the zic and zdump tools + rmdir(self, os.path.join(self.package_folder, "usr", "lib")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = [os.path.join("usr", "share")] + self.cpp_info.bindirs = [os.path.join("usr", "bin"), os.path.join("usr", "sbin")] + self.buildenv_info.define("TZDATA", os.path.join(self.package_folder, "usr", "share", "zoneinfo")) + self.runenv_info.define("TZDATA", os.path.join(self.package_folder, "usr", "share", "zoneinfo")) diff --git a/recipes/tz/all/test_package/conanfile.py b/recipes/tz/all/test_package/conanfile.py new file mode 100644 index 0000000000000..eaec136cd36cc --- /dev/null +++ b/recipes/tz/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.errors import ConanException +import os + + +class TzTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + tzdata = None + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def generate(self): + # INFO: zdump does not consume TZDATA, need to pass absolute path of the zoneinfo directory + self.tzdata = self.dependencies.build['tz'].buildenv_info.vars(self).get('TZDATA') + with open("tzdata.info", "w") as fd: + fd.write(self.tzdata) + + def build(self): + pass + + def test(self): + if can_run(self): + with open("tzdata.info", "r") as fd: + self.tzdata = fd.read() + self.run(f"zdump {os.path.join(self.tzdata, 'America', 'Los_Angeles')}") diff --git a/recipes/tz/config.yml b/recipes/tz/config.yml new file mode 100644 index 0000000000000..baca28b344a2b --- /dev/null +++ b/recipes/tz/config.yml @@ -0,0 +1,3 @@ +versions: + "2023c": + folder: all diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 0414764f76035..b0566af78f907 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.files import copy, get, load, save + +required_conan_version = ">=1.47.0" class UaNodeSetConan(ConanFile): @@ -12,32 +14,34 @@ class UaNodeSetConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" topics = ("opc-ua-specifications", "uanodeset", "normative-files", "companion-specification") - no_copy_source = True - - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "build-scripts" + settings = "os", "arch", "compiler", "build_type" + short_paths = True - def _extract_license(self): - content = tools.load(os.path.join(self.source_folder, self._source_subfolder, "AnsiC", "opcua_clientapi.c")) - license_contents = content[2:content.find("*/", 1)] - tools.save("LICENSE", license_contents) + def layout(self): + pass - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + def package_id(self): + self.info.clear() def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def _extract_license(self): + content = load(self, os.path.join(self.build_folder, "AnsiC", "opcua_clientapi.c")) + license_contents = content[2 : content.find("*/", 1)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package(self): self._extract_license() - self.copy("*", dst="res", src=self._source_subfolder) - self.copy("LICENSE", dst="licenses") - + copy(self, "*", dst=os.path.join(self.package_folder, "res"), src=self.build_folder) def package_info(self): - self.cpp_info.libdirs = [] + self.conf_info.define("user.ua-nodeset:nodeset_dir", os.path.join(self.package_folder, "res")) self.cpp_info.resdirs = ["res"] - self.user_info.nodeset_dir = os.path.join(self.package_folder, "res") + self.cpp_info.libdirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.includedirs = [] + # TODO: to remove in conan v2 + self.user_info.nodeset_dir = os.path.join(self.package_folder, "res") diff --git a/recipes/ua-nodeset/all/test_package/conanfile.py b/recipes/ua-nodeset/all/test_package/conanfile.py index 872e7a1f2874d..02a908bec924b 100644 --- a/recipes/ua-nodeset/all/test_package/conanfile.py +++ b/recipes/ua-nodeset/all/test_package/conanfile.py @@ -1,12 +1,24 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.files import load, save -class TestUaNodeSetConan(ConanFile): - def build(self): +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def layout(self): pass - def test(self): - assert os.path.exists(os.path.join(self.deps_user_info["ua-nodeset"].nodeset_dir, "PLCopen")) + def generate(self): + nodeset_dir = self.dependencies["ua-nodeset"].conf_info.get("user.ua-nodeset:nodeset_dir") + save(self, "nodeset_dir", nodeset_dir) + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + nodeset_dir = load(self, "nodeset_dir") + test_path = os.path.join(nodeset_dir, "PLCopen") + assert os.path.exists(test_path) diff --git a/recipes/ua-nodeset/all/test_v1_package/conanfile.py b/recipes/ua-nodeset/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..872e7a1f2874d --- /dev/null +++ b/recipes/ua-nodeset/all/test_v1_package/conanfile.py @@ -0,0 +1,12 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestUaNodeSetConan(ConanFile): + + def build(self): + pass + + def test(self): + assert os.path.exists(os.path.join(self.deps_user_info["ua-nodeset"].nodeset_dir, "PLCopen")) + diff --git a/recipes/uchardet/all/CMakeLists.txt b/recipes/uchardet/all/CMakeLists.txt deleted file mode 100644 index a17cdee90b035..0000000000000 --- 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/conandata.yml b/recipes/uchardet/all/conandata.yml index 30099f9e54a80..8d50fe442e1ff 100644 --- a/recipes/uchardet/all/conandata.yml +++ b/recipes/uchardet/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.0.8": + url: "https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.8.tar.xz" + sha256: "e97a60cfc00a1c147a674b097bb1422abd9fa78a2d9ce3f3fdcc2e78a34ac5f0" "0.0.7": - url: https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.7.tar.xz + url: "https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.7.tar.xz" sha256: "3fc79408ae1d84b406922fa9319ce005631c95ca0f34b205fad867e8b30e45b1" diff --git a/recipes/uchardet/all/conanfile.py b/recipes/uchardet/all/conanfile.py index bb92e982496c4..38d486d7a2d81 100644 --- a/recipes/uchardet/all/conanfile.py +++ b/recipes/uchardet/all/conanfile.py @@ -1,18 +1,28 @@ -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, save +from conan.tools.scm import Version + +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 +35,62 @@ 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 _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"), - "${CMAKE_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)') - # disable building tests - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "add_subdirectory(test)", - "#add_subdirectory(test)") + 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() - @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 + def _patch_sources(self): + if Version(self.version) < "0.0.8": + # fix problem with macOS + 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 of tests + save(self, os.path.join(self.source_folder, "doc", "CMakeLists.txt"), "") + save(self, os.path.join(self.source_folder, "test", "CMakeLists.txt"), "") 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", "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) 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 a726e6f66a3bd..6dbcda3f32f3c 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 38f4483872d47..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..38f4483872d47 --- /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/uchardet/config.yml b/recipes/uchardet/config.yml index 3b1adbf0ba92f..1c066f06099c5 100644 --- a/recipes/uchardet/config.yml +++ b/recipes/uchardet/config.yml @@ -1,3 +1,5 @@ versions: + "0.0.8": + folder: all "0.0.7": folder: all diff --git a/recipes/ulfius/all/conanfile.py b/recipes/ulfius/all/conanfile.py index 675ce5de0ba1e..cfafd90c8a600 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 22c525b3881bd..b95a9b875d7e4 100644 --- a/recipes/uncrustify/all/conandata.yml +++ b/recipes/uncrustify/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.78.1": + url: "https://github.com/uncrustify/uncrustify/archive/uncrustify-0.78.1.tar.gz" + sha256: "ecaf4c0adca14c36dfffa30bc28e69865115ecd602c90eb16a8cddccb41caad2" + "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 da8a4d29e3f0e..0c905f0cb5c35 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 ca7e7aabaf2bf..71b7668f5e09d 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 27d29acb91740..d0d1205acdb6e 100644 --- a/recipes/uncrustify/config.yml +++ b/recipes/uncrustify/config.yml @@ -1,4 +1,10 @@ versions: + "0.78.1": + folder: all + "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 5bec751a95929..8d8acc924ed24 100644 --- a/recipes/uni-algo/all/conandata.yml +++ b/recipes/uni-algo/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.2.0": + url: "https://github.com/uni-algo/uni-algo/archive/v1.2.0.tar.gz" + sha256: "f2a1539cd8635bc6088d05144a73ecfe7b4d74ee0361fabed6f87f9f19e74ca9" + "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" + "0.8.2": + url: "https://github.com/uni-algo/uni-algo/archive/v0.8.2.tar.gz" + sha256: "c0dab8ae1dbbab3e33b0c5bb512e927badb57f53e7ee96517c1dfd2e078b7669" + "0.8.1": + url: "https://github.com/uni-algo/uni-algo/archive/v0.8.1.tar.gz" + sha256: "11192280fa435a9d68131d5368d2b314201d7089e6d2f38f29a8591c9aafa776" "0.8.0": url: "https://github.com/uni-algo/uni-algo/archive/refs/tags/v0.8.0.tar.gz" sha256: "657f124f4fb4705f948e9c0835ec88484ee4745d7b19cb2ddb772119a7ea024e" diff --git a/recipes/uni-algo/config.yml b/recipes/uni-algo/config.yml index e65f3bb5dd3af..53399e9671402 100644 --- a/recipes/uni-algo/config.yml +++ b/recipes/uni-algo/config.yml @@ -1,4 +1,14 @@ versions: + "1.2.0": + folder: all + "1.1.0": + folder: all + "1.0.0": + folder: all + "0.8.2": + folder: all + "0.8.1": + folder: all "0.8.0": folder: all "0.7.1": diff --git a/recipes/units/all/conanfile.py b/recipes/units/all/conanfile.py index abb3f73f19041..f5e7559e8b3b4 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 b01d1d5fd06ef..0d20897301b68 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/unity/all/conandata.yml b/recipes/unity/all/conandata.yml new file mode 100644 index 0000000000000..a3d7facb1dfbb --- /dev/null +++ b/recipes/unity/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.5.2": + url: "https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/v2.5.2.tar.gz" + sha256: "3786de6c8f389be3894feae4f7d8680a02e70ed4dbcce36109c8f8646da2671a" diff --git a/recipes/unity/all/conanfile.py b/recipes/unity/all/conanfile.py new file mode 100644 index 0000000000000..7170cbf7699d0 --- /dev/null +++ b/recipes/unity/all/conanfile.py @@ -0,0 +1,62 @@ +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.53.0" + + +class UnityConan(ConanFile): + name = "unity" + description = "Unity Test is a unit testing framework built for C, with a focus on working with embedded toolchains" + topics = ("unit-test", "tdd", "bdd", "testing") + license = "MIT" + homepage = "http://www.throwtheswitch.org" + url = "https://github.com/conan-io/conan-center-index" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "fixture_extension": [True, False], + "memory_extension": [True, False], + } + default_options = { + "fPIC": True, + "fixture_extension": False, + "memory_extension": False, + } + + 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") + + 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["UNITY_EXTENSION_FIXTURE"] = self.options.fixture_extension + tc.cache_variables["UNITY_EXTENSION_MEMORY"] = self.options.memory_extension + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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")) + + def package_info(self): + self.cpp_info.libs = ["unity"] + self.cpp_info.includedirs = ["include", "include/unity"] diff --git a/recipes/unity/all/test_package/CMakeLists.txt b/recipes/unity/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ac959a17f44e2 --- /dev/null +++ b/recipes/unity/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(unity REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE unity::unity) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/unity/all/test_package/conanfile.py b/recipes/unity/all/test_package/conanfile.py new file mode 100644 index 0000000000000..254feca104287 --- /dev/null +++ b/recipes/unity/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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/unity/all/test_package/test_package.c b/recipes/unity/all/test_package/test_package.c new file mode 100644 index 0000000000000..ecc0ee2a6b4ef --- /dev/null +++ b/recipes/unity/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#include + + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test_Something(void) +{ + TEST_ASSERT_EQUAL_INT(1, 1); +} + +int main(void) +{ + UNITY_BEGIN(); + RUN_TEST(test_Something); + return UNITY_END(); +} diff --git a/recipes/unity/config.yml b/recipes/unity/config.yml new file mode 100644 index 0000000000000..2ac88b6313aec --- /dev/null +++ b/recipes/unity/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.2": + folder: all diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml index b69698c93c08e..86e169e3f5d8e 100644 --- a/recipes/unordered_dense/all/conandata.yml +++ b/recipes/unordered_dense/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "4.4.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.4.0.tar.gz" + sha256: "3976399793e8cb4db1409ce15610fbd9e5e406ced4745f262d393a9311efbd88" + "4.3.1": + url: "https://github.com/martinus/unordered_dense/archive/v4.3.1.tar.gz" + sha256: "ff069b0b7697a3601cd674e4a4405edc6ec1d60a5cc3e7fff18db9e24ecc8ec3" + "4.3.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.3.0.tar.gz" + sha256: "c8ffaf5277dd5c29871cc6359af7823c8137158d47511dd00c8193af84906b9c" + "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 +32,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 50c688a80fb21..10a6f06d5e35d 100644 --- a/recipes/unordered_dense/config.yml +++ b/recipes/unordered_dense/config.yml @@ -1,4 +1,16 @@ versions: + "4.4.0": + folder: all + "4.3.1": + folder: all + "4.3.0": + folder: all + "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 +21,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/conandata.yml b/recipes/upx/all/conandata.yml index e774dc1feea4d..1f17ad4f588bc 100644 --- a/recipes/upx/all/conandata.yml +++ b/recipes/upx/all/conandata.yml @@ -1,4 +1,28 @@ sources: + "4.2.1": + "Linux": + "x86_64": + url: "https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-amd64_linux.tar.xz" + sha256: "936e67a23d72338dad3304526a29f405e44e440a9983bbdb2566657d015cc56d" + "armv8": + url: "https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-arm64_linux.tar.xz" + sha256: "922b4d021a1fdd68a883d9c837b09035317c9a52e8087403bd0d1b062c006f22" + "armv7": + url: "https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-arm_linux.tar.xz" + sha256: "0ea0ca497b8fd4ecfd9201d100a0fde251214042b09d5e070c3435aae75913e0" + "ppc32": + url: "https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-powerpc_linux.tar.xz" + sha256: "c96b6c196c31e2d78a4095d1a4c0b1a22050a2141d40c9387806d14d7ed75035" + "ppc64le": + url: "https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-powerpc64le_linux.tar.xz" + sha256: "3f683b6de4e25c135c8ff7c91f116514b6cb30834a9708f4516b897502f6d34a" + "Windows": + "x86": + url: "https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-win32.zip" + sha256: "475504d9b2ae5fd9ede27919ee3b3fa8869a1398645c1239fc19193022054268" + "x86_64": + url: "https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-win64.zip" + sha256: "b6e20e35303a390c3b1211f5ed0559def2c34ec5774176bb22afee19b35b2138" "3.96": "Linux": "x86_64": diff --git a/recipes/upx/all/conanfile.py b/recipes/upx/all/conanfile.py index ebbe1deba6846..4a0f911cedf71 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 f31cfe1e1aa8e..e58a04fd19cf1 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 8274c17267c14..8d1367a88209a 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 725533f119f42..f81e0540072d7 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 0000000000000..91630d79f4abb --- /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 0000000000000..2b7a8250c9937 --- /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/upx/config.yml b/recipes/upx/config.yml index ec9befdb55388..417ec321f784d 100644 --- a/recipes/upx/config.yml +++ b/recipes/upx/config.yml @@ -1,3 +1,5 @@ versions: + "4.2.1": + folder: all "3.96": folder: all diff --git a/recipes/urdfdom/all/conandata.yml b/recipes/urdfdom/all/conandata.yml new file mode 100644 index 0000000000000..82a2012232450 --- /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 0000000000000..f7a710e7f7ea7 --- /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 0000000000000..a89c2b010b26c --- /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 0000000000000..cbb6f0fc84fb3 --- /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 0000000000000..b4095fcb7ba42 --- /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 0000000000000..2d7a881934a29 --- /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 0000000000000..ef5d7042163ec --- /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 0000000000000..a7e4a0d704e35 --- /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 0000000000000..fd9669719a7ad --- /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 5b4a41335be2a..df56cdd674867 100644 --- a/recipes/usockets/all/conandata.yml +++ b/recipes/usockets/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.8.7": + url: "https://github.com/uNetworking/uSockets/archive/v0.8.7.tar.gz" + sha256: "920313a2ae42bbda17bded6fc83b3df635af24cc9abefc87905ad60fdc596edf" + "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,58 +27,54 @@ sources: url: "https://github.com/uNetworking/uSockets/archive/v0.4.0.tar.gz" sha256: "f9f15b395def578cc79a5b32abc64fa9cff5dac873062911f515b984b90f7cc2" patches: + "0.8.7": + - patch_file: "patches/0001-makefile_0.8.6.patch" + patch_description: "remove lto options" + patch_type: "portability" + "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" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" "0.8.3": - patch_file: "patches/0001-makefile_0.8.3.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" "0.8.2": - patch_file: "patches/0001-makefile_0.8.2.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj_0.8.1.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" "0.8.1": - patch_file: "patches/0001-makefile_0.8.1.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj_0.8.1.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" "0.7.1": - patch_file: "patches/0001-makefile_0.6.0.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" "0.6.0": - patch_file: "patches/0001-makefile_0.6.0.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" "0.4.0": - patch_file: "patches/0001-makefile.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" diff --git a/recipes/usockets/all/conanfile.py b/recipes/usockets/all/conanfile.py index 09208942cd97e..0d84532828398 100644 --- a/recipes/usockets/all/conanfile.py +++ b/recipes/usockets/all/conanfile.py @@ -1,16 +1,16 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, chdir +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 +from conan.tools.microsoft import is_msvc, unix_path, MSBuild, MSBuildDeps, MSBuildToolchain from conan.tools.scm import Version -from conan.tools.microsoft import is_msvc -from conan.errors import ConanInvalidConfiguration -from conans import MSBuild, AutoToolsBuildEnvironment -from conans.tools import vcvars, environment_append, unix_path, get_env import os -import contextlib -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.57.0" class UsocketsConan(ConanFile): name = "usockets" @@ -19,6 +19,7 @@ class UsocketsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/uNetworking/uSockets" topics = ("socket", "network", "web") + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -32,42 +33,43 @@ 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", "gcc": "5", "clang": "3.4", "apple-clang": "10", }, "17": { "Visual Studio": "16", + "msvc": "192", "gcc": "7", "clang": "6", "apple-clang": "10", }, - } - return standards.get(cppstd) or {} - - @property - def _source_subfolder(self): - return "source_subfolder" + }.get(self._min_cppstd, {}) @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + @property + def _uses_msbuild(self): + return Version(self.version) < "0.8.3" and is_msvc(self) + def export_sources(self): export_conandata_patches(self) @@ -76,104 +78,132 @@ def config_options(self): del self.options.fPIC self.options.eventloop = "libuv" + def configure(self): + 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]") + elif self.options.with_ssl == "wolfssl": + self.requires("wolfssl/5.6.3") + + if self.options.eventloop == "libuv": + self.requires("libuv/1.46.0") + elif self.options.eventloop == "gcd": + self.requires("libdispatch/5.3.2") + elif self.options.eventloop == "boost": + self.requires("boost/1.83.0") + def validate(self): - if self.options.eventloop == "syscall" and self.info.settings.os == "Windows": + 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.info.settings.os != "Linux" or self.info.settings.compiler != "clang"): + 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"eventloop={self.options.eventloop} is not supported with {self.name}/{self.version}") + 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"with_ssl={self.options.with_ssl} is not supported with {self.name}/{self.version}. https://github.com/uNetworking/uSockets/issues/147") + 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.options["wolfssl"].opensslextra: + if self.options.with_ssl == "wolfssl" and not self.dependencies["wolfssl"].options.opensslextra: raise ConanInvalidConfiguration("wolfssl needs opensslextra option enabled for usockets") - cppstd = self._minimum_cpp_standard - if not cppstd: - return - - if self.info.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, cppstd) + 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(cppstd).get(str(self.info.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: - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass - - def requirements(self): - if self.options.with_ssl == "openssl": - self.requires("openssl/1.1.1s") - elif self.options.with_ssl == "wolfssl": - self.requires("wolfssl/5.5.1") - - if self.options.eventloop == "libuv": - self.requires("libuv/1.44.2") - elif self.options.eventloop == "gcd": - self.requires("libdispatch/5.3.2") - elif self.options.eventloop == "boost": - self.requires("boost/1.81.0") + 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 get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.5") + if self._settings_build.os == "Windows" and not self._uses_msbuild: + 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): - 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): apply_conandata_patches(self) - - def _build_msvc(self): - with chdir(self, os.path.join(self._source_subfolder)): - msbuild = MSBuild(self) - msbuild.build(project_file="uSockets.vcxproj", platforms={"x86": "Win32"}) - - @contextlib.contextmanager - def _build_context(self): - if is_msvc(self): - with vcvars(self): - env = { - "CC": "{} cl -nologo".format(unix_path(self.deps_user_info["automake"].compile)), - "CXX": "{} cl -nologo".format(unix_path(self.deps_user_info["automake"].compile)), - "CFLAGS": "-{}".format(self.settings.compiler.runtime), - "LD": "link", - "NM": "dumpbin -symbols", - "STRIP": ":", - "AR": "{} lib".format(unix_path(self.deps_user_info["automake"].ar_lib)), - "RANLIB": ":", - } + if self._uses_msbuild: + vcxproj_file = os.path.join(self.source_folder, "uSockets.vcxproj") + 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"" + + replace_in_file( + self, vcxproj_file, + "v141", + f"{platform_toolset}", + ) + if import_conan_generators: + replace_in_file( + self, vcxproj_file, + '''''', + f'''{import_conan_generators}\n''', + ) + + def generate(self): + if self._uses_msbuild: + tc = MSBuildToolchain(self) + tc.generate() + deps = MSBuildDeps(self) + deps.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, self.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", f"{compile_wrapper} link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") if self.options.eventloop == "libuv": - env["CPPFLAGS"] = "-I" + unix_path(self.deps_cpp_info["libuv"].include_paths[0]) + " " + # Workaround for: https://github.com/conan-io/conan/issues/12784 + # Otherwise AutotoolsDeps should suffice + 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) - with environment_append(env): - yield - else: - yield + deps = AutotoolsDeps(self) + deps.generate() + + def _build_msvc(self): + with chdir(self, os.path.join(self.source_folder)): + msbuild = MSBuild(self) + msbuild.build("uSockets.vcxproj") - def _build_configure(self): - autotools = AutoToolsBuildEnvironment(self) - autotools.fpic = self.options.get_safe("fPIC", False) - with chdir(self, self._source_subfolder): + def _build_autotools(self): + autotools = Autotools(self) + with chdir(self, self.source_folder): args = ["WITH_LTO=0"] if self.options.with_ssl == "openssl": args.append("WITH_OPENSSL=1") @@ -187,22 +217,20 @@ def _build_configure(self): elif self.options.eventloop == "boost": args.append("WITH_ASIO=1") - args.extend(f"{key}={value}" for key, value in autotools.vars.items()) autotools.make(target="default", args=args) def build(self): self._patch_sources() - if Version(self.version) < "0.8.3" and is_msvc(self): + if self._uses_msbuild: self._build_msvc() else: - with self._build_context(): - self._build_configure() + self._build_autotools() def package(self): - copy(self, pattern="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, "src"), keep_path=True) - copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) - copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + 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, "src"), keep_path=True) + 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.source_folder, keep_path=False) # drop internal headers rmdir(self, os.path.join(self.package_folder, "include", "internal")) 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 0000000000000..e77691ceeac47 --- /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/all/test_package/CMakeLists.txt b/recipes/usockets/all/test_package/CMakeLists.txt index 8502a8260d7ce..be191d27f55a9 100644 --- a/recipes/usockets/all/test_package/CMakeLists.txt +++ b/recipes/usockets/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(usockets REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/usockets/all/test_package/conanfile.py b/recipes/usockets/all/test_package/conanfile.py index 7895db93c24a6..e845ae751a301 100644 --- a/recipes/usockets/all/test_package/conanfile.py +++ b/recipes/usockets/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", "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) @@ -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/usockets/config.yml b/recipes/usockets/config.yml index c4f53d0a2aff0..c71afbcfba697 100644 --- a/recipes/usockets/config.yml +++ b/recipes/usockets/config.yml @@ -1,4 +1,8 @@ versions: + "0.8.7": + folder: all + "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 3bead6a0d9320..0000000000000 --- 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 61e799fd3d464..9dffac4dd65c9 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 73752d1325d3b..9eba2832eb8dd 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 a60174007a234..d8fa3f6efba33 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 7e2dfe859bb27..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..7e2dfe859bb27 --- /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 3c63ca89d6157..5053468bc7039 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 e35aca1f7a135..0d20897301b68 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 2e408e9011b37..c31447372a280 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 698e23be72ec9..39b2b7b1cced3 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 44b916f7f7e88..d7d36135481cf 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 f435f56f7acf1..03f2a95423481 100644 --- a/recipes/utfcpp/all/conandata.yml +++ b/recipes/utfcpp/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "4.0.4": + url: "https://github.com/nemtrif/utfcpp/archive/v4.0.4.tar.gz" + sha256: "7c8a403d0c575d52473c8644cd9eb46c6ba028d2549bc3e0cdc2d45f5cfd78a0" + "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 34e0685b4ddb2..247b54396ade2 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 fe794ae36be57..7624c13618914 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 00df0fb881cb8..46e4658742975 100644 --- a/recipes/utfcpp/config.yml +++ b/recipes/utfcpp/config.yml @@ -1,4 +1,14 @@ versions: + "4.0.4": + folder: all + "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 0000000000000..cecad30c0f60f --- /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 0000000000000..ae3832c2b5a97 --- /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 0000000000000..13e75e619c30a --- /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 0000000000000..3a91c9439218e --- /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 0000000000000..368ee976d0fb4 --- /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 0000000000000..d724287fc23cb --- /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 new file mode 100644 index 0000000000000..c84795c4daf4e --- /dev/null +++ b/recipes/util-linux-libuuid/all/conandata.yml @@ -0,0 +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 new file mode 100644 index 0000000000000..e5c35fe2c862b --- /dev/null +++ b/recipes/util-linux-libuuid/all/conanfile.py @@ -0,0 +1,119 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class UtilLinuxLibuuidConan(ConanFile): + name = "util-linux-libuuid" + description = "Universally unique id library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/util-linux/util-linux.git" + license = "BSD-3-Clause" + topics = "id", "identifier", "unique", "uuid" + package_type = "library" + provides = "libuuid" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _has_sys_file_header(self): + return self.settings.os in ["FreeBSD", "Linux", "Macos"] + + 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 _minimum_compiler_version(self, compiler, build_type): + min_version = { + "gcc": { + "Release": "4", + "Debug": "8", + }, + "clang": { + "Release": "3", + "Debug": "3", + }, + "apple-clang": { + "Release": "5", + "Debug": "5", + }, + } + return min_version.get(str(compiler), {}).get(str(build_type), "0") + + def validate(self): + min_version = self._minimum_compiler_version(self.settings.compiler, self.settings.build_type) + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"{self.settings.compiler} {self.settings.compiler.version} does not meet the minimum version requirement of version {min_version}") + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows") + + def requirements(self): + if self.settings.os == "Macos": + # Required because libintl.{a,dylib} is not distributed via libc on Macos + self.requires("libgettext/0.21") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-all-programs") + tc.configure_args.append("--enable-libuuid") + if self._has_sys_file_header: + tc.extra_defines.append("HAVE_SYS_FILE_H") + if "x86" in self.settings.arch: + tc.extra_cflags.append("-mstackrealign") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING.BSD-3-Clause", src=os.path.join(self.source_folder, "Documentation", "licenses"), dst=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")) + 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") + # 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 new file mode 100644 index 0000000000000..75c717f769900 --- /dev/null +++ b/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(libuuid REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libuuid::libuuid) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/util-linux-libuuid/all/test_package/conanfile.py b/recipes/util-linux-libuuid/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/util-linux-libuuid/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/util-linux-libuuid/all/test_package/test_package.c b/recipes/util-linux-libuuid/all/test_package/test_package.c new file mode 100644 index 0000000000000..792d1d3fbf414 --- /dev/null +++ b/recipes/util-linux-libuuid/all/test_package/test_package.c @@ -0,0 +1,33 @@ +#include + +#include "uuid/uuid.h" + +int main(int argc, char *argv[]) { + uuid_t uuid; + uuid_generate_time_safe(uuid); + + char uuid_str[37]; + uuid_unparse_lower(uuid, uuid_str); + printf("generate uuid=%s\n", uuid_str); + + uuid_t uuid2; + uuid_parse(uuid_str, uuid2); + + int rv; + rv = uuid_compare(uuid, uuid2); + printf("uuid_compare() result=%d\n", rv); + + uuid_t uuid3; + uuid_parse("1b4e28ba-2fa1-11d2-883f-0016d3cca427", uuid3); + rv = uuid_compare(uuid, uuid3); + printf("uuid_compare() result=%d\n", rv); + + rv = uuid_is_null(uuid); + printf("uuid_null() result=%d\n", rv); + + uuid_clear(uuid); + rv = uuid_is_null(uuid); + printf("uuid_null() result=%d\n", rv); + + return 0; +} diff --git a/recipes/util-linux-libuuid/config.yml b/recipes/util-linux-libuuid/config.yml new file mode 100644 index 0000000000000..4ab19fceb4d3b --- /dev/null +++ b/recipes/util-linux-libuuid/config.yml @@ -0,0 +1,5 @@ +versions: + "2.39.2": + folder: all + "2.39": + folder: all diff --git a/recipes/uvw/all/conandata.yml b/recipes/uvw/all/conandata.yml index 4130a1aca6e4b..2ce44b1f85239 100644 --- a/recipes/uvw/all/conandata.yml +++ b/recipes/uvw/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.2.0": + url: "https://github.com/skypjack/uvw/archive/v3.2.0_libuv_v1.46.tar.gz" + sha256: "bd5aed741765950074b1ea2507291dce81e528abdf56c406991ad4a27d8d1714" + "3.1.0": + url: "https://github.com/skypjack/uvw/archive/v3.1.0_libuv_v1.45.tar.gz" + sha256: "0a612bd243150fbbe1365cdaf48203d32061c1d14f93825a31876b183922f93b" "2.12.1": url: "https://github.com/skypjack/uvw/archive/v2.12.1_libuv_v1.44.tar.gz" sha256: "3460842778e91e7d2fae4201e49e4521e9d94fbbf3891ae6c52d3c9fc0673598" diff --git a/recipes/uvw/all/conanfile.py b/recipes/uvw/all/conanfile.py index 6b312583aebcd..af145be3d5ce2 100644 --- a/recipes/uvw/all/conanfile.py +++ b/recipes/uvw/all/conanfile.py @@ -13,13 +13,13 @@ class UvwConan(ConanFile): name = "uvw" description = "Header-only, event based, tiny and easy to use libuv wrapper in modern C++." - topics = ("libuv", "io", "networking", "header-only",) license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/skypjack/uvw" + topics = ("libuv", "io", "networking", "header-only",) package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = "compiler" @property def _min_cppstd(self): @@ -29,6 +29,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "Visual Studio": "15", + "msvc": "191", "gcc": "7", "clang": "5", "apple-clang": "10", @@ -37,6 +38,8 @@ def _compilers_minimum_version(self): @property def _required_libuv_version(self): return { + "3.2.0": "1.46.0", + "3.1.0": "1.45.0", "2.12.1": "1.44.2", "2.11.0": "1.43.0", "2.10.0": "1.42.0", diff --git a/recipes/uvw/all/test_package/CMakeLists.txt b/recipes/uvw/all/test_package/CMakeLists.txt index 2040ab68d4259..1bad80ec9ab42 100644 --- a/recipes/uvw/all/test_package/CMakeLists.txt +++ b/recipes/uvw/all/test_package/CMakeLists.txt @@ -1,8 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(uvw REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} uvw::uvw) +target_link_libraries(${PROJECT_NAME} PRIVATE uvw::uvw) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(uvw_VERSION VERSION_GREATER_EQUAL "3.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE UVW_API_3_0) +endif() diff --git a/recipes/uvw/all/test_package/test_package.cpp b/recipes/uvw/all/test_package/test_package.cpp index 79042982db2f2..864863c297929 100644 --- a/recipes/uvw/all/test_package/test_package.cpp +++ b/recipes/uvw/all/test_package/test_package.cpp @@ -1,5 +1,9 @@ #include int main() { +#ifdef UVW_API_3_0 + uvw::loop::get_default(); +#else uvw::Loop::getDefault(); +#endif } diff --git a/recipes/uvw/config.yml b/recipes/uvw/config.yml index 92580e1d6336d..f7ecad1e5c9ed 100644 --- a/recipes/uvw/config.yml +++ b/recipes/uvw/config.yml @@ -1,4 +1,8 @@ versions: + "3.2.0": + folder: "all" + "3.1.0": + folder: "all" "2.12.1": folder: "all" "2.11.0": diff --git a/recipes/uwebsockets/all/conandata.yml b/recipes/uwebsockets/all/conandata.yml index d0d6f814547b2..2e1be00494550 100644 --- a/recipes/uwebsockets/all/conandata.yml +++ b/recipes/uwebsockets/all/conandata.yml @@ -1,28 +1,31 @@ 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.56.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.56.0.tar.gz" + sha256: "bbac3e317eabf4e558dffe9bfeab4f5ae2d23affcc6df54fb8e580a9e0372767" + "20.55.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.55.0.tar.gz" + sha256: "bf6b22229fcd10c7cbd256bfd9abf31c829d44eefd56341c0f404e0fa0184f2f" + "20.53.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.53.0.tar.gz" + sha256: "324b857e787a472bd258aaa66f5ceeac6b01ebc41bbb423fff71559d72872783" + "20.51.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.51.0.tar.gz" + sha256: "6794e7895eb8cc182024a0ae482a581eaa82f55f7cca53ae88b30738449f3cb9" + "20.49.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.49.0.tar.gz" + sha256: "c596d6f63554a42397a86233aaa47883db1cad2a231ad8608dbaea165c0910b5" + "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 a7539cf95209b..374ab9a0e5e74 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") + self.requires("libdeflate/1.19") 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 be1e8815a9c32..1af0d5c400e72 100644 --- a/recipes/uwebsockets/config.yml +++ b/recipes/uwebsockets/config.yml @@ -1,19 +1,21 @@ versions: - "20.36.0": + "20.56.0": folder: all - "20.17.0": + "20.55.0": folder: all - "20.14.0": + "20.53.0": folder: all - "20.9.0": + "20.51.0": folder: all - "20.8.0": + "20.49.0": folder: all - "19.3.0": + "20.48.0": + folder: all + "20.47.0": folder: all - "19.2.0": + "20.45.0": folder: all - "19.1.0": + "19.3.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 0121a2fed52b8..7b0d91b504084 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/conandata.yml b/recipes/valijson/all/conandata.yml index 60d1924df1916..9c69d92d45720 100644 --- a/recipes/valijson/all/conandata.yml +++ b/recipes/valijson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.2": + url: "https://github.com/tristanpenman/valijson/archive/v1.0.2.tar.gz" + sha256: "35d86e54fc727f1265226434dc996e33000a570f833537a25c8b702b0b824431" "1.0.1": url: "https://github.com/tristanpenman/valijson/archive/v1.0.1.tar.gz" sha256: "b478b82af1db1d98c2ce47de4ad28647ec66800eaf704dba8b5e785cbca1d785" diff --git a/recipes/valijson/all/conanfile.py b/recipes/valijson/all/conanfile.py index 4c1f0676480ad..9e8080a170f30 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 f283c4c7cf92c..9fa0294a2d6c6 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 44512632f983b..81b93054985f7 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 679bcbb3ab1fd..a2f6329c538d2 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 1ffe3deaeb51c..f02d6b2bb8320 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/valijson/config.yml b/recipes/valijson/config.yml index 12f40d7975787..2244034e46866 100644 --- a/recipes/valijson/config.yml +++ b/recipes/valijson/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.2": + folder: "all" "1.0.1": folder: "all" "1.0": diff --git a/recipes/vc/all/conandata.yml b/recipes/vc/all/conandata.yml index b1e2f20f1981d..ef285ad3397b4 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 7cfaddf7b0838..12e8e45ebe604 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 492877a81dfa8..0d20897301b68 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 0ba616ecf92b2..f5a2ce84083be 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/CMakeLists.txt b/recipes/vcglib/all/CMakeLists.txt index 503836eca235b..bea5e105e4ff6 100644 --- a/recipes/vcglib/all/CMakeLists.txt +++ b/recipes/vcglib/all/CMakeLists.txt @@ -16,8 +16,8 @@ install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(DIRECTORY "${VCGLIB_SRC_DIR}/vcg" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING PATTERN "*.h") + FILES_MATCHING PATTERN "*.h" PATTERN "*.ipp") install(DIRECTORY "${VCGLIB_SRC_DIR}/wrap" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING PATTERN "*.h") + FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp") install(DIRECTORY "${VCGLIB_SRC_DIR}/img" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h") diff --git a/recipes/vcglib/all/conandata.yml b/recipes/vcglib/all/conandata.yml index d8dc31a26ed34..f9800a56a86d4 100644 --- a/recipes/vcglib/all/conandata.yml +++ b/recipes/vcglib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2023.12": + url: "https://github.com/cnr-isti-vclab/vcglib/archive/refs/tags/2023.12.tar.gz" + sha256: "5a84db6d596be1cb4abdc450d130dc8e2224a4c7b4198b60cd9ac55f45ac5c7b" "2022.02": url: "https://github.com/cnr-isti-vclab/vcglib/archive/refs/tags/2022.02.tar.gz" sha256: "724f5ef6ab9b9d21ff2e9e965c2ce909cc024b29f2aa7d39e2974b28ff25bc3f" @@ -6,6 +9,8 @@ sources: url: "https://github.com/cnr-isti-vclab/vcglib/archive/refs/tags/2020.12.tar.gz" sha256: "731c57435e39c4b958a1d766cadd9865d9db35e36410708f2da7818e9fa5f786" patches: + "2023.12": + - patch_file: "patches/0001-use-external-eigen.patch" "2022.02": - patch_file: "patches/0001-use-external-eigen.patch" "2020.12": diff --git a/recipes/vcglib/all/conanfile.py b/recipes/vcglib/all/conanfile.py index f452d7336181c..b05d8f64d4559 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 0b93c9e9b9c66..0d20897301b68 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/vcglib/config.yml b/recipes/vcglib/config.yml index 8fa4c473789d6..0faefee3a8749 100644 --- a/recipes/vcglib/config.yml +++ b/recipes/vcglib/config.yml @@ -1,4 +1,6 @@ versions: + "2023.12": + folder: all "2022.02": folder: all "2020.12": diff --git a/recipes/vectorclass/all/conanfile.py b/recipes/vectorclass/all/conanfile.py index 5696b99489d45..60e6bdcdc723a 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 1d531c5d5a930..0d20897301b68 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 fd7818ff4d997..91f7fd34d7f37 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 d120a992c06a6..0a6bc68712d90 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 394022f35f7ca..0d20897301b68 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/veque/all/conandata.yml b/recipes/veque/all/conandata.yml index 4a5e1d0f1ad9a..a57efe3175e66 100644 --- a/recipes/veque/all/conandata.yml +++ b/recipes/veque/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.7": + url: "https://github.com/Shmoopty/veque/archive/v1.3.7.tar.gz" + sha256: "f67ae3ce3f3e16e60f63bc8d4df0c606a6dfbc8651e01cba5a6c4ed1209349b1" "1.3.6": url: "https://github.com/Shmoopty/veque/archive/v1.3.6.tar.gz" sha256: "9d149b415d948529ac166c962501c59605ef24b3a8ab8561956a6d05f14870ea" diff --git a/recipes/veque/all/conanfile.py b/recipes/veque/all/conanfile.py index 54b31e162b380..8de4f7001f378 100644 --- a/recipes/veque/all/conanfile.py +++ b/recipes/veque/all/conanfile.py @@ -10,15 +10,19 @@ class VequeConan(ConanFile): name = "veque" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/Shmoopty/veque" description = "Fast C++ container combining the best features of std::vector and std::deque" - topics = ("cpp17", "vector", "deque") license = "BSL-1.0" - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Shmoopty/veque" + topics = ("cpp17", "vector", "deque", "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 { @@ -29,12 +33,15 @@ def _compilers_minimum_version(self): "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, "17") + check_min_cppstd(self, self._min_cppstd) def loose_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -45,15 +52,11 @@ 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.name} {self.version} requires C++17, which your compiler does not support.", + 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 @@ -64,6 +67,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/veque/all/test_package/conanfile.py b/recipes/veque/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/veque/all/test_package/conanfile.py +++ b/recipes/veque/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/veque/config.yml b/recipes/veque/config.yml index 10d3a845bf8c7..3da45bc778250 100644 --- a/recipes/veque/config.yml +++ b/recipes/veque/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.7": + folder: all "1.3.6": folder: all "1.3.5": diff --git a/recipes/very-simple-smtps/all/conandata.yml b/recipes/very-simple-smtps/all/conandata.yml new file mode 100644 index 0000000000000..4a556ac61a493 --- /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 0000000000000..d2c2b6bd073a1 --- /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 0000000000000..7433710099642 --- /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 0000000000000..fc49c0ed275f0 --- /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 0000000000000..d183aa32baa1f --- /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 0000000000000..40341aa3db6cd --- /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 new file mode 100644 index 0000000000000..f9462ed3ee48f --- /dev/null +++ b/recipes/vir-simd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2.0": + 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 new file mode 100644 index 0000000000000..b79fe3dc61b1b --- /dev/null +++ b/recipes/vir-simd/all/conanfile.py @@ -0,0 +1,76 @@ +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 VirSIMDConan(ConanFile): + name = "vir-simd" + description = "A fallback std::experimental::simd (Parallelism TS 2) implementation with additional features" + license = "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mattkretz/vir-simd" + topics = ("simd", "parallelism-ts", "cpp17", "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 { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "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." + ) + + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} Windows support is not provided so far.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + # Nothing to do + return + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="vir/*.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "vir-simd") + self.cpp_info.set_property("cmake_target_name", "vir-simd::vir-simd") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/vir-simd/all/test_package/CMakeLists.txt b/recipes/vir-simd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2737b968f7f8b --- /dev/null +++ b/recipes/vir-simd/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(vir-simd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vir-simd::vir-simd) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/vir-simd/all/test_package/conanfile.py b/recipes/vir-simd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/vir-simd/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/vir-simd/all/test_package/test_package.cpp b/recipes/vir-simd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fb0755d36c45f --- /dev/null +++ b/recipes/vir-simd/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include +#include + +namespace stdx = vir::stdx; + +template +std::ostream& operator<<(std::ostream& s, const stdx::simd& v) { + s << '[' << v[0]; + for (std::size_t i = 1; i < v.size(); ++i) { + s << ", " << v[i]; + } + return s << ']'; +} + +int main(void) { + + using floatv = stdx::simd>; + const floatv a{5}; + + std::cout << a * 3<< std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/vir-simd/all/test_v1_package/CMakeLists.txt b/recipes/vir-simd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..54d2c07bb9d41 --- /dev/null +++ b/recipes/vir-simd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +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/vir-simd/all/test_v1_package/conanfile.py b/recipes/vir-simd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/vir-simd/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +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/vir-simd/config.yml b/recipes/vir-simd/config.yml new file mode 100644 index 0000000000000..88f0acde73637 --- /dev/null +++ b/recipes/vir-simd/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "0.2.0": + folder: all diff --git a/recipes/visit_struct/all/conandata.yml b/recipes/visit_struct/all/conandata.yml index 959681c08c025..e688df3cb0abd 100644 --- a/recipes/visit_struct/all/conandata.yml +++ b/recipes/visit_struct/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/cbeck88/visit_struct/archive/refs/tags/v1.1.0.tar.gz" + sha256: "73a84f2d8a8844bc03a919163b27ee3b3f85d8c64f6151ce098ca50dbed6be51" "1.0": - url: "https://github.com/garbageslam/visit_struct/archive/refs/tags/v1.0.tar.gz" + url: "https://github.com/cbeck88/visit_struct/archive/refs/tags/v1.0.tar.gz" sha256: "7e5d727bd9fbe444d182840625f5eb21f2cf67f06f3aeab27a2d7c4724b3c09c" diff --git a/recipes/visit_struct/all/conanfile.py b/recipes/visit_struct/all/conanfile.py index f72295c8e8cc9..7cb8d11207ec2 100644 --- a/recipes/visit_struct/all/conanfile.py +++ b/recipes/visit_struct/all/conanfile.py @@ -1,15 +1,19 @@ +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 -from conans import ConanFile, tools -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class VisitStructConan(ConanFile): name = "visit_struct" description = "A miniature library for struct-field reflection in C++" - topics = ("reflection", "introspection", "visitor", "struct-field-visitor",) - homepage = "https://github.com/garbageslam/visit_struct" - url = "https://github.com/conan-io/conan-center-index" license = "BSL-1.0" + topics = ("reflection", "introspection", "visitor", "struct-field-visitor", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cbeck88/visit_struct" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type", options = { "with_boost_fusion": [True, False], @@ -22,28 +26,35 @@ class VisitStructConan(ConanFile): 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 requirements(self): if self.options.with_boost_fusion or self.options.with_boost_hana: - self.requires("boost/1.78.0") + self.requires("boost/1.83.0") 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], 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", src=self._source_subfolder, dst="licenses") - self.copy(pattern="*visit_struct.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") - self.copy(pattern="*visit_struct_intrusive.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*visit_struct.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*visit_struct_intrusive.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) if self.options.with_boost_fusion: - self.copy(pattern="*visit_struct_boost_fusion.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + copy(self, pattern="*visit_struct_boost_fusion.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) if self.options.with_boost_hana: - self.copy(pattern="*visit_struct_boost_hana.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + copy(self, pattern="*visit_struct_boost_hana.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/visit_struct/all/test_package/CMakeLists.txt b/recipes/visit_struct/all/test_package/CMakeLists.txt index 0b3daffae916f..24d52d34e85ac 100644 --- a/recipes/visit_struct/all/test_package/CMakeLists.txt +++ b/recipes/visit_struct/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -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(visit_struct REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} visit_struct::visit_struct) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE visit_struct::visit_struct) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/visit_struct/all/test_package/conanfile.py b/recipes/visit_struct/all/test_package/conanfile.py index 1d4478bedc297..3a91c9439218e 100644 --- a/recipes/visit_struct/all/test_package/conanfile.py +++ b/recipes/visit_struct/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" + 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): - 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/visit_struct/all/test_v1_package/CMakeLists.txt b/recipes/visit_struct/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/visit_struct/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/visit_struct/all/test_v1_package/conanfile.py b/recipes/visit_struct/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/visit_struct/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/visit_struct/config.yml b/recipes/visit_struct/config.yml index cbd84c934d0b3..f936952d5165b 100644 --- a/recipes/visit_struct/config.yml +++ b/recipes/visit_struct/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.0": + folder: "all" "1.0": folder: "all" diff --git a/recipes/vo-amrwbenc/all/conandata.yml b/recipes/vo-amrwbenc/all/conandata.yml new file mode 100644 index 0000000000000..942ba6a84fca6 --- /dev/null +++ b/recipes/vo-amrwbenc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.3": + url: "https://downloads.sourceforge.net/project/opencore-amr/vo-amrwbenc/vo-amrwbenc-0.1.3.tar.gz" + sha256: "5652b391e0f0e296417b841b02987d3fd33e6c0af342c69542cbb016a71d9d4e" diff --git a/recipes/vo-amrwbenc/all/conanfile.py b/recipes/vo-amrwbenc/all/conanfile.py new file mode 100644 index 0000000000000..71830859a3a43 --- /dev/null +++ b/recipes/vo-amrwbenc/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import copy, get, rename, 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 +import os + +required_conan_version = ">=1.54.0" + + +class OpencoreAmrConan(ConanFile): + name = "vo-amrwbenc" + homepage = "https://sourceforge.net/projects/opencore-amr/" + description = "VisualOn AMR-WB encoder library." + topics = ("audio-codec", "amr-wb", "G.722.2") + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + 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): + 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 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): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + if is_msvc(self): + tc.extra_cflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + 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 build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="NOTICE", src=self.source_folder, dst=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")) + + fix_apple_shared_install_name(self) + + if is_msvc(self) and self.options.shared: + for import_lib in ["vo-amrwbenc"]: + rename(self, os.path.join(self.package_folder, "lib", f"{import_lib}.dll.lib"), + os.path.join(self.package_folder, "lib", f"{import_lib}.lib")) + + def package_info(self): + self.cpp_info.libs = ["vo-amrwbenc"] + + self.cpp_info.set_property("pkg_config_name", "vo-amrwbenc") diff --git a/recipes/vo-amrwbenc/all/test_package/CMakeLists.txt b/recipes/vo-amrwbenc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..996db2c8839df --- /dev/null +++ b/recipes/vo-amrwbenc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(vo-amrwbenc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE vo-amrwbenc::vo-amrwbenc) diff --git a/recipes/vo-amrwbenc/all/test_package/conanfile.py b/recipes/vo-amrwbenc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/vo-amrwbenc/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/vo-amrwbenc/all/test_package/test_package.c b/recipes/vo-amrwbenc/all/test_package/test_package.c new file mode 100644 index 0000000000000..3680b1b652585 --- /dev/null +++ b/recipes/vo-amrwbenc/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include "vo-amrwbenc/enc_if.h" + +int main(void) +{ + void* state = E_IF_init(); + E_IF_exit(state); + + return EXIT_SUCCESS; +} diff --git a/recipes/vo-amrwbenc/config.yml b/recipes/vo-amrwbenc/config.yml new file mode 100644 index 0000000000000..ce394846b7adb --- /dev/null +++ b/recipes/vo-amrwbenc/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.3": + folder: "all" diff --git a/recipes/volk/all/conandata.yml b/recipes/volk/all/conandata.yml index 431eb95e238d7..ca101fd03c2bd 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 43237f89b69e7..ec73b65420573 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 d4cfc91f2ca48..76e46074dd1b4 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 07b65e3a51126..870e86ced00f7 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 93e2aa3a2a5d5..58d7504b2daef 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 0000000000000..e29a62c280484 --- /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 new file mode 100644 index 0000000000000..3b2abd6731e51 --- /dev/null +++ b/recipes/vsg/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.0": + url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/VulkanSceneGraph-1.0.0.tar.gz" + sha256: "5611284f4256893ea97a33f9e99f5ecc8bdda110cc9fb7770b291fb45e8f9cf6" + "1.0.3": + url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/VulkanSceneGraph-1.0.3.tar.gz" + sha256: "84aa1d445ecdd2702843f8f01e760d4db32c2ab3fe8c5d6122f8a83b67a50e36" + "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/all/conanfile.py b/recipes/vsg/all/conanfile.py new file mode 100644 index 0000000000000..104e5dc3d7219 --- /dev/null +++ b/recipes/vsg/all/conanfile.py @@ -0,0 +1,118 @@ +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 get, copy, rm, rmdir, collect_libs +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake +import os + +required_conan_version = ">=1.53.0" + +class VsgConan(ConanFile): + name = "vsg" + description = "VulkanSceneGraph" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.vulkanscenegraph.org" + topics = ("vulkan", "scenegraph", "graphics", "3d") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "max_devices": [1,2,3,4], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "max_devices" : 1, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "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 requirements(self): + self.requires("vulkan-loader/1.3.239.0", transitive_headers=True) + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.name} does not support MSVC static runtime (MT/MTd) configurations, only dynamic runtime (MD/MDd) is supported") + + if not is_msvc(self): + 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.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 generate(self): + tc = CMakeToolchain(self) + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = False + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["VSG_SUPPORTS_ShaderCompiler"] = 0 + tc.variables["VSG_MAX_DEVICES"] = self.options.max_devices + tc.generate() + + deps = CMakeDeps(self) + + deps.generate() + + def build(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() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + 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")) + rm(self, "Find*.cmake", os.path.join(self.package_folder, "lib/cmake/vsg")) + rm(self, "*Config.cmake", os.path.join(self.package_folder, "lib/cmake/vsg")) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + + self.cpp_info.set_property("cmake_file_name", "vsg") + self.cpp_info.set_property("cmake_target_name", "vsg::vsg") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "vsg" + self.cpp_info.filenames["cmake_find_package_multi"] = "vsg" + self.cpp_info.names["cmake_find_package"] = "VSG" + self.cpp_info.names["cmake_find_package_multi"] = "vsg" diff --git a/recipes/vsg/all/test_package/CMakeLists.txt b/recipes/vsg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5b45e894695a3 --- /dev/null +++ b/recipes/vsg/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) # if the project uses c++ + +find_package(vsg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vsg::vsg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/vsg/all/test_package/conanfile.py b/recipes/vsg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1111583fea732 --- /dev/null +++ b/recipes/vsg/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/vsg/all/test_package/test_package.cpp b/recipes/vsg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ef112a2f69aaf --- /dev/null +++ b/recipes/vsg/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ + +#include +#include +#include + + +#include + +#include +#include + +int main(int argc, char** argv) +{ + vsg::CommandLine arguments(&argc, argv); + auto numObjects = arguments.value(1u, {"---num-objects", "-n"}); + if (arguments.errors()) return arguments.writeErrorMessages(std::cerr); + + using Objects = std::vector>; + Objects objects; + objects.push_back(vsg::Node::create()); + + + return 0; +} diff --git a/recipes/vsg/config.yml b/recipes/vsg/config.yml new file mode 100644 index 0000000000000..9269a45607b90 --- /dev/null +++ b/recipes/vsg/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.9": + folder: all + "1.0.5": + folder: all + "1.0.3": + folder: all + "1.0.0": + folder: all diff --git a/recipes/vtu11/all/conandata.yml b/recipes/vtu11/all/conandata.yml index d079b9a80f826..bb58ee7fddaee 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 389169052faba..db420586fda77 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 eb80c0e4f2b2f..0000000000000 --- 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 a021c2306d89c..a2e54aa68230e 100644 --- a/recipes/vulkan-headers/all/conandata.yml +++ b/recipes/vulkan-headers/all/conandata.yml @@ -1,85 +1,19 @@ 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" "1.3.243.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.243.0.tar.gz" sha256: "29ddb2ef931f5fb0cabd1a78398f9c4da44d37f8c8a1e110f834f4c260c9d548" "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 a17cf251c00d3..beae2e733b6b4 100644 --- a/recipes/vulkan-headers/all/conanfile.py +++ b/recipes/vulkan-headers/all/conanfile.py @@ -14,6 +14,7 @@ class VulkanHeadersConan(ConanFile): homepage = "https://github.com/KhronosGroup/Vulkan-Headers" url = "https://github.com/conan-io/conan-center-index" package_type = "header-library" + package_id_embed_mode = "patch_mode" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -30,7 +31,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 63336383d3028..34a8efbe22307 100644 --- a/recipes/vulkan-headers/config.yml +++ b/recipes/vulkan-headers/config.yml @@ -1,57 +1,13 @@ versions: - "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": + "1.3.268.0": folder: all - "1.3.224.1": + "1.3.261.1": folder: all - "1.3.224.0": + "1.3.250.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": + "1.3.243.0": folder: all - "1.3.204": + "1.3.239.0": 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 fceeca688d80b..b31ce6fd5b07a 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 7d7adac29c32f..408b02f227457 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 a585b5a17fff5..0000000000000 --- 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 b0cda85f0d738..0000000000000 --- 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 0f841d44ccf38..0000000000000 --- 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 fe88588420cd9..0000000000000 --- 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 0000000000000..28d9fbd552cb1 --- /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 5a43176c74c66..b086288213558 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 19e6a0c06e3d8..0000000000000 --- 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 493a9fc0ba035..a9f30cdd286b9 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 d35351a8d12e7..7d88177b91710 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 85be3b03af743..0cfd3c5acf8f4 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 0000000000000..ef7fe08191476 --- /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 0000000000000..2852a9bd33619 --- /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 0000000000000..bab772d3242d7 --- /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 6220702ac9b05..d260c9a9e2cad 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 cce0aea3d2aac..71fbe37f78e18 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 9b4e7e7f28c9e..8d5cc5e6efcf4 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.1.0") if Version(self.version) >= "1.3.239": self.tool_requires("cmake/[>=3.17.2 <4]") @@ -225,5 +225,17 @@ def package_info(self): manifest_subfolder = "bin" if self.settings.os == "Windows" else os.path.join("res", "vulkan", "explicit_layer.d") vk_layer_path = os.path.join(self.package_folder, manifest_subfolder) self.runenv_info.prepend_path("VK_LAYER_PATH", vk_layer_path) + + # Update runtime discovery paths to allow libVkLayer_khronos_validation.{so,dll,dylib} to be discovered + # and loaded by vulkan-loader when the consumer executes + # This is necessary because this package exports a static lib to link against and a dynamic lib to load at runtime + runtime_lib_discovery_path = "LD_LIBRARY_PATH" + if self.settings.os == "Windows": + runtime_lib_discovery_path = "PATH" + if self.settings.os == "Macos": + runtime_lib_discovery_path = "DYLD_LIBRARY_PATH" + for libdir in [os.path.join(self.package_folder, libdir) for libdir in self.cpp_info.libdirs]: + self.runenv_info.prepend_path(runtime_lib_discovery_path, libdir) + # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator self.env_info.VK_LAYER_PATH.append(vk_layer_path) 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 c3e6505e83271..0000000000000 --- 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 dd52c0e08b282..0000000000000 --- 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 ac36ea35232c5..0000000000000 --- 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 e19c38225be30..0000000000000 --- 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/all/patches/1.2.182-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch deleted file mode 100644 index 1df1151c34367..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch +++ /dev/null @@ -1,83 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -102,7 +102,7 @@ if (TARGET Vulkan::Headers) - get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) - else() -- find_package(VulkanHeaders REQUIRED) -+ find_package(VulkanHeaders REQUIRED MODULE) - - # xxxnsubtil: this should eventually be replaced by exported targets - add_library(Vulkan-Headers INTERFACE) -@@ -154,7 +154,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux - endif() - - if(BUILD_WSI_WAYLAND_SUPPORT) -- find_package(Wayland REQUIRED) -+ find_package(Wayland REQUIRED MODULE) - include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) - endif() - endif() -@@ -237,13 +237,10 @@ option(BUILD_LAYERS "Build layers" ON) - option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers - option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) - if (USE_ROBIN_HOOD_HASHING) -- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) -- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") -- endif() -- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") -+ find_package(robin_hood REQUIRED CONFIG) - endif() - --if(BUILD_TESTS OR BUILD_LAYERS) -+if(BUILD_TESTS) - - set(GLSLANG_INSTALL_DIR "GLSLANG-NOTFOUND" CACHE PATH "Absolute path to a glslang install directory") - if(NOT GLSLANG_INSTALL_DIR AND NOT DEFINED ENV{GLSLANG_INSTALL_DIR} AND NOT TARGET glslang) -@@ -302,8 +299,14 @@ if(BUILD_TESTS OR BUILD_LAYERS) - set(GLSLANG_SPIRV_INCLUDE_DIR "${glslang_SOURCE_DIR}" CACHE PATH "Path to glslang spirv headers") - set(GLSLANG_LIBRARIES glslang SPIRV SPVRemapper) - endif() -+endif() - -+if(BUILD_TESTS OR BUILD_LAYERS) - # spirv-tools -+ find_package(SPIRV-Tools REQUIRED CONFIG) -+ if(NOT TARGET SPIRV-Tools-opt) -+ find_package(SPIRV-Tools-opt REQUIRED CONFIG) -+ endif() - if (NOT TARGET SPIRV-Tools) - if(NOT SPIRV_TOOLS_INSTALL_DIR) - set(SPIRV_TOOLS_INSTALL_DIR "${GLSLANG_INSTALL_DIR}") -@@ -389,7 +392,7 @@ target_include_directories(VkLayer_utils - ${VulkanHeaders_INCLUDE_DIR}) - - if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -+ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) - target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) - endif() - ---- a/cmake/FindVulkanHeaders.cmake -+++ b/cmake/FindVulkanHeaders.cmake -@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) - NO_CMAKE_FIND_ROOT_PATH) - find_path(VulkanRegistry_DIR - NAMES vk.xml -- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry -+ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry - NO_CMAKE_FIND_ROOT_PATH) - else() - # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, ---- a/layers/CMakeLists.txt -+++ b/layers/CMakeLists.txt -@@ -291,9 +291,6 @@ if(BUILD_LAYERS) - if(INSTRUMENT_OPTICK) - target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) - endif() -- if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -- endif() - target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) - - # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch deleted file mode 100644 index a5cb883c9cc3a..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -111,7 +111,7 @@ if (TARGET Vulkan::Headers) - get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) - else() -- find_package(VulkanHeaders REQUIRED) -+ find_package(VulkanHeaders REQUIRED MODULE) - - # xxxnsubtil: this should eventually be replaced by exported targets - add_library(Vulkan-Headers INTERFACE) -@@ -163,7 +163,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux - endif() - - if(BUILD_WSI_WAYLAND_SUPPORT) -- find_package(Wayland REQUIRED) -+ find_package(Wayland REQUIRED MODULE) - include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) - endif() - endif() -@@ -240,10 +240,7 @@ option(BUILD_LAYERS "Build layers" ON) - option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers - option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) - if (USE_ROBIN_HOOD_HASHING) -- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) -- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") -- endif() -- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") -+ find_package(robin_hood REQUIRED CONFIG) - endif() - - if(BUILD_TESTS) -@@ -307,6 +304,10 @@ endif() - - if(BUILD_TESTS OR BUILD_LAYERS) - # spirv-tools -+ find_package(SPIRV-Tools REQUIRED CONFIG) -+ if(NOT TARGET SPIRV-Tools-opt) -+ find_package(SPIRV-Tools-opt REQUIRED CONFIG) -+ endif() - if (NOT TARGET SPIRV-Tools) - if(NOT SPIRV_TOOLS_INSTALL_DIR) - set(SPIRV_TOOLS_INSTALL_DIR "${GLSLANG_INSTALL_DIR}") -@@ -375,7 +376,7 @@ target_include_directories(VkLayer_utils - ${VulkanHeaders_INCLUDE_DIR}) - - if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -+ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) - target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) - endif() - ---- a/cmake/FindVulkanHeaders.cmake -+++ b/cmake/FindVulkanHeaders.cmake -@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) - NO_CMAKE_FIND_ROOT_PATH) - find_path(VulkanRegistry_DIR - NAMES vk.xml -- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry -+ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry - NO_CMAKE_FIND_ROOT_PATH) - else() - # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, ---- a/layers/CMakeLists.txt -+++ b/layers/CMakeLists.txt -@@ -297,9 +297,6 @@ if(BUILD_LAYERS) - if(INSTRUMENT_OPTICK) - target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) - endif() -- if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -- endif() - target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) - - # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch deleted file mode 100644 index e482c6be482cf..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -108,7 +108,7 @@ if (TARGET Vulkan::Headers) - get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) - else() -- find_package(VulkanHeaders REQUIRED) -+ find_package(VulkanHeaders REQUIRED MODULE) - - # xxxnsubtil: this should eventually be replaced by exported targets - add_library(Vulkan-Headers INTERFACE) -@@ -160,7 +160,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux - endif() - - if(BUILD_WSI_WAYLAND_SUPPORT) -- find_package(Wayland REQUIRED) -+ find_package(Wayland REQUIRED MODULE) - include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) - endif() - endif() -@@ -237,10 +237,7 @@ option(BUILD_LAYERS "Build layers" ON) - option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers - option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) - if (USE_ROBIN_HOOD_HASHING) -- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) -- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") -- endif() -- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") -+ find_package(robin_hood REQUIRED CONFIG) - endif() - - if(BUILD_TESTS) -@@ -304,6 +301,10 @@ endif() - - if(BUILD_TESTS OR BUILD_LAYERS) - # spirv-tools -+ find_package(SPIRV-Tools REQUIRED CONFIG) -+ if(NOT TARGET SPIRV-Tools-opt) -+ find_package(SPIRV-Tools-opt REQUIRED CONFIG) -+ endif() - if (NOT TARGET SPIRV-Tools) - if(NOT SPIRV_TOOLS_INSTALL_DIR) - set(SPIRV_TOOLS_INSTALL_DIR "${GLSLANG_INSTALL_DIR}") -@@ -372,7 +373,7 @@ target_include_directories(VkLayer_utils - ${VulkanHeaders_INCLUDE_DIR}) - - if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -+ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) - target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) - endif() - ---- a/cmake/FindVulkanHeaders.cmake -+++ b/cmake/FindVulkanHeaders.cmake -@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) - NO_CMAKE_FIND_ROOT_PATH) - find_path(VulkanRegistry_DIR - NAMES vk.xml -- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry -+ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry - NO_CMAKE_FIND_ROOT_PATH) - else() - # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, ---- a/layers/CMakeLists.txt -+++ b/layers/CMakeLists.txt -@@ -301,9 +301,6 @@ if(BUILD_LAYERS) - if(INSTRUMENT_OPTICK) - target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) - endif() -- if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -- endif() - target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) - - # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/config.yml b/recipes/vulkan-validationlayers/config.yml index d99b3e54ca59d..15d0c149a289c 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 0000000000000..a3832678cf3e2 --- /dev/null +++ b/recipes/vvenc/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.10.0": + url: "https://github.com/fraunhoferhhi/vvenc/archive/refs/tags/v1.10.0.tar.gz" + sha256: "579e4b19de3b356a96ec436dbfeb3b9583cb0a854e55f81226990924a5cfd38c" + "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 0000000000000..50d169ed09a7f --- /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 0000000000000..efaabb8094acb --- /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 0000000000000..0f4e9c14439cf --- /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 0000000000000..2a6652d65f4eb --- /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 0000000000000..f88ad156fc791 --- /dev/null +++ b/recipes/vvenc/config.yml @@ -0,0 +1,5 @@ +versions: + "1.10.0": + folder: "all" + "1.8.0": + folder: "all" diff --git a/recipes/waf/all/conandata.yml b/recipes/waf/all/conandata.yml index 4d28ed8ee8074..07871b61a4101 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 cc8d7cdece540..6d2f8a76078a0 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 9d956eec26829..f47744ecfec84 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 0000000000000..252c1f1ae1d96 --- /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 e3883114dd1bb..9df1d7fdf59a0 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 0000000000000..507fb63f45893 --- /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 0000000000000..4cd796f406c9c --- /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 0000000000000..baf12ba1a1b62 --- /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 0000000000000..b67b2a33b5dea --- /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 0000000000000..3cf7f573410ea --- /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 0000000000000..d56a8c50a887a --- /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 0000000000000..6e413e2d402fc --- /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 0000000000000..18ac7653b0301 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 0000000000000..8e9d61bfcf7f1 --- /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 0000000000000..6d9f399765e2d --- /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 363797364db78..b7eef0f907d2e 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 22d9509121432..b520078c1a85d 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 a433b073bf6ea..d5682fcb1d31a 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 26c6ed136a298..13b6ff12faa84 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 7b9c9649cb8d8..17a89f2c17e7b 100644 --- a/recipes/wasmer/all/conandata.yml +++ b/recipes/wasmer/all/conandata.yml @@ -1,4 +1,139 @@ sources: + "4.2.5": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.5/wasmer-windows-amd64.tar.gz" + sha256: "3811f1637c8f32336aca159e63a0a4e09b3c7f713da3f5a58b0b3326e0ea941c" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.5/wasmer-windows-gnu64.tar.gz" + sha256: "8176ae9a3d12d619aa4ef9a56ce6f669af11c4b33a900a73739f8586d3291981" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.5/wasmer-linux-amd64.tar.gz" + sha256: "9a21c3a60c2c1f9cdebe91ec56df2d2d753b15d9b7e0be1a67e7a29080ca75f9" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.5/wasmer-linux-aarch64.tar.gz" + sha256: "b29117eebce282b63d49de6bb11920da439d68937bd6bc69575fb8f5f29ef293" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.5/wasmer-darwin-amd64.tar.gz" + sha256: "77d7baa0e54cbd310c53d93128240a098bf00d787bb7bb9b9661a0a5b09f1779" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.5/wasmer-darwin-arm64.tar.gz" + sha256: "0247863cc1546171305d556d69bf7fbad12a170b5a608ff8c9c01480a4af1ee7" + "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": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-windows-amd64.tar.gz" + sha256: "1ecbff4959fda10b316bdda3ea2230dcfaafabd4372125829e5dfaf01a75b1b6" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-windows-gnu64.tar.gz" + sha256: "80a2d653254c59791faffa35c15f264c6e9fc5725ba0733b62ee1e0186f53294" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-linux-amd64.tar.gz" + sha256: "6d905e328a155ef0059013d7315407bac13ea2a0cf9257e6cc957b96556df05e" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-linux-aarch64.tar.gz" + sha256: "20f98f4be160e73e387444437f87aeaa276b46c1efee12729ab1108ebeda1d16" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-darwin-amd64.tar.gz" + sha256: "435669d2bacf381f7c3c849a231825fb2d2126b0d3e90cb1298cc7a76d770184" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-darwin-arm64.tar.gz" + sha256: "0505c8423830fb0ce1634a27ef52dfacb3d4bc711f9354535e4e874c044730f4" + "3.2.1": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-windows-amd64.tar.gz" + sha256: "e5500d405de2f43ed00d4a3341e5dba463abc15ebbb2aac832aca9e18cbe090d" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-windows-gnu64.tar.gz" + sha256: "f16242f3ddca3c8a1294bb8feb34a2447f8d19f12e095fac7e7eb710a1f8ac9e" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-linux-amd64.tar.gz" + sha256: "43e8c84460da374d78e9c527da10145143d8bd46e49e93e18efa27fed0c42683" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-linux-aarch64.tar.gz" + sha256: "f1847405588339b4327ef9d68c266355b04d3d18d6fc2c9fdfb2c9f576f4d758" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-darwin-amd64.tar.gz" + sha256: "c1bd3bf73cb13c0f8ba7015356964414979b2e145168eef4b81a921ff18f582c" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-darwin-arm64.tar.gz" + sha256: "9e5360b4a494324824308891a7027bfd19199c53449a649f97a5db6e7ae028fb" "3.1.0": Windows: "x86_64": diff --git a/recipes/wasmer/all/conanfile.py b/recipes/wasmer/all/conanfile.py index 9db5f12cf18fe..402e36fdcca0f 100644 --- a/recipes/wasmer/all/conanfile.py +++ b/recipes/wasmer/all/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.files import get, copy, replace_in_file from conan.tools.layout import basic_layout from conan.tools.scm import Version +from conan.tools.apple import is_apple_os import os required_conan_version = ">=1.53.0" @@ -15,7 +16,8 @@ class WasmerConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/wasmerio/wasmer/" topics = ("webassembly", "wasm", "wasi", "emscripten") - settings = "os", "arch", "compiler" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], } @@ -26,9 +28,9 @@ class WasmerConan(ConanFile): @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): self.settings.rm_safe("compiler.libcxx") @@ -46,13 +48,13 @@ def validate(self): raise ConanInvalidConfiguration("Binaries for this combination of version/os/arch/compiler are not available") if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Shared Windows build of wasmer are non-working atm (no import libraries are available)") + raise ConanInvalidConfiguration(f"Shared Windows build of {self.ref} are non-working atm (no import libraries are available)") if self.settings.os == "Linux" and self.options.shared and "2.3.0" <= Version(self.version): - raise ConanInvalidConfiguration("Shared Linux build of wasmer are not working. It requires glibc >= 2.25") + raise ConanInvalidConfiguration(f"Shared Linux build of {self.ref} are not working. It requires glibc >= 2.25") - if is_msvc(self) and not self.options.shared and self.settings.compiler.runtime != "MT": - raise ConanInvalidConfiguration("wasmer is only available with compiler.runtime=MT") + if is_msvc(self) and not self.options.shared and not is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.ref} is only available with compiler.runtime=static") def package_id(self): del self.info.settings.compiler.version @@ -60,26 +62,26 @@ def package_id(self): def source(self): get( - self, - **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias], destination=self.source_folder + self, + **self.conan_data["sources"][self.version][str(self.info.settings.os)][str(self.info.settings.arch)][self._compiler_alias] ) def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - self.copy("*.h", src=os.path.join(self.source_folder, "include"), dst="include", keep_path=False) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) srclibdir = os.path.join(self.source_folder, "lib") dstlibdir = os.path.join(self.package_folder, "lib") dstbindir = os.path.join(self.package_folder, "bin") if self.options.shared: - self.copy("wasmer.dll.lib", src=srclibdir, dst=dstlibdir, keep_path=False) # FIXME: not available (yet) - self.copy("wasmer.dll", src=srclibdir, dst=dstbindir, keep_path=False) - self.copy("libwasmer.so*", src=srclibdir, dst=dstlibdir, keep_path=False) - self.copy("libwasmer.dylib", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="wasmer.dll.lib", dst=dstlibdir, src=srclibdir) # FIXME: not available (yet) + copy(self, pattern="wasmer.dll", dst=dstbindir, src=srclibdir) + copy(self, pattern="libwasmer.so*", dst=dstlibdir, src=srclibdir) + copy(self, pattern="libwasmer.dylib", dst=dstlibdir, src=srclibdir) else: - self.copy("wasmer.lib", src=srclibdir, dst=dstlibdir, keep_path=False) - self.copy("libwasmer.a", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="wasmer.lib", dst=dstlibdir, src=srclibdir) + copy(self, pattern="libwasmer.a", dst=dstlibdir, src=srclibdir) replace_in_file(self, os.path.join(self.package_folder, "include", "wasm.h"), "__declspec(dllimport)", "") @@ -92,3 +94,8 @@ def package_info(self): self.cpp_info.system_libs.append("rt") elif self.settings.os == "Windows": self.cpp_info.system_libs = ["bcrypt", "userenv", "ws2_32"] + elif is_apple_os(self): + if Version(self.version) >= "3.2.0": + self.cpp_info.frameworks += ["Security"] + if Version(self.version) >= "4.2.5": + self.cpp_info.frameworks += ["CoreFoundation", "SystemConfiguration"] diff --git a/recipes/wasmer/config.yml b/recipes/wasmer/config.yml index e0d445f36bd33..4c7ede684889d 100644 --- a/recipes/wasmer/config.yml +++ b/recipes/wasmer/config.yml @@ -1,4 +1,14 @@ versions: + "4.2.5": + folder: "all" + "4.2.0": + folder: "all" + "4.1.1": + folder: "all" + "4.0.0": + folder: "all" + "3.2.1": + folder: "all" "3.1.0": folder: "all" "3.0.2": diff --git a/recipes/wasmtime-cpp/all/conandata.yml b/recipes/wasmtime-cpp/all/conandata.yml index cc2a691b8c6c2..524a7021c9bc2 100644 --- a/recipes/wasmtime-cpp/all/conandata.yml +++ b/recipes/wasmtime-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v9.0.0.tar.gz" + sha256: "0ff8242a9dcbe43eb38c6a3e02be40ed585e6b88efd89092bf1b5318cb8fece1" "7.0.0": url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v7.0.0.tar.gz" sha256: "967df644901d9ade1568a9dcfd5f30a63ba44f8125a399842d192e258dbb7684" diff --git a/recipes/wasmtime-cpp/all/conanfile.py b/recipes/wasmtime-cpp/all/conanfile.py index 70992503d1ca8..9970e18861d77 100644 --- a/recipes/wasmtime-cpp/all/conanfile.py +++ b/recipes/wasmtime-cpp/all/conanfile.py @@ -43,6 +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": "12.0.2", } self.requires(f"wasmtime/{version_map.get(version, version)}") diff --git a/recipes/wasmtime-cpp/config.yml b/recipes/wasmtime-cpp/config.yml index 12bb2cdba162c..37168a28be705 100644 --- a/recipes/wasmtime-cpp/config.yml +++ b/recipes/wasmtime-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "9.0.0": + folder: all "7.0.0": folder: all "6.0.0": diff --git a/recipes/wasmtime/all/conandata.yml b/recipes/wasmtime/all/conandata.yml index bad0047d04374..59585bd0e0f08 100644 --- a/recipes/wasmtime/all/conandata.yml +++ b/recipes/wasmtime/all/conandata.yml @@ -1,4 +1,94 @@ sources: + "16.0.0": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v16.0.0/wasmtime-v16.0.0-x86_64-windows-c-api.zip" + sha256: "c832e904f0bf0e3958a82efd45f025bfa94bb5629825effb1c5700d47df79629" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v16.0.0/wasmtime-v16.0.0-x86_64-mingw-c-api.zip" + sha256: "dc6ea5781edaa1155cf38da30bf691d543010cb2a0c3c597d75a8e11df96ed25" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v16.0.0/wasmtime-v16.0.0-x86_64-linux-c-api.tar.xz" + sha256: "5c67576f977c4373b77fc1304ff56b426a27b3f3ac481437ee51d5e915d43f7b" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v16.0.0/wasmtime-v16.0.0-aarch64-linux-c-api.tar.xz" + sha256: "373b2def51a2ba7d1f73e82a5adf62dcf8dfba27149f6ff6ff69cb6bd97a1bfc" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v16.0.0/wasmtime-v16.0.0-s390x-linux-c-api.tar.xz" + sha256: "2340ca3abaaf0acf7185fe2e262e492c4b85c8d72fa9f8285ba58eb08418616b" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v16.0.0/wasmtime-v16.0.0-x86_64-macos-c-api.tar.xz" + sha256: "f9e4b9df2993f6b0eb6a642b10fc38342e33fb3a9d5deb25dbf765b098bb9069" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v16.0.0/wasmtime-v16.0.0-aarch64-macos-c-api.tar.xz" + sha256: "fff9a7516ea3befc23a0d7dcff6b2b23dbccc3674fb27359f2b2798242890943" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v16.0.0/wasmtime-v16.0.0-aarch64-linux-c-api.tar.xz" + sha256: "373b2def51a2ba7d1f73e82a5adf62dcf8dfba27149f6ff6ff69cb6bd97a1bfc" + "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" + "9.0.1": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v9.0.1/wasmtime-v9.0.1-x86_64-windows-c-api.zip" + sha256: "39bc0cf1a4e611427d7da9b16f7798321fe189ca2915a570f2df97d27848cfe3" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v9.0.1/wasmtime-v9.0.1-x86_64-mingw-c-api.zip" + sha256: "3672a99ba17c6755df5260f82916605ba36e2b9336fa2c16248c3b2c732e3318" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v9.0.1/wasmtime-v9.0.1-x86_64-linux-c-api.tar.xz" + sha256: "9141a08bec03cb727920f29c9f471b4b251613842096f65f0a462c838935bf41" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v9.0.1/wasmtime-v9.0.1-aarch64-linux-c-api.tar.xz" + sha256: "6b50b8f04f1cb77c39665286125db3f111470483c594d5d323d49b927e46c07b" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v9.0.1/wasmtime-v9.0.1-s390x-linux-c-api.tar.xz" + sha256: "701b1951325f0d9528ee7fd525afd1db059b8f38f0634c488e5f8a0418752983" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v9.0.1/wasmtime-v9.0.1-x86_64-macos-c-api.tar.xz" + sha256: "b1bba66e2bcab5ff88f217eab58fe145f00c7655be023807ccdef23fde3e8795" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v9.0.1/wasmtime-v9.0.1-aarch64-macos-c-api.tar.xz" + sha256: "c275e91dffcb6d6a3fb6b10e5de93d2553646f0bbfa4756d36178d0fc51c6334" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v9.0.1/wasmtime-v9.0.1-aarch64-linux-c-api.tar.xz" + sha256: "6b50b8f04f1cb77c39665286125db3f111470483c594d5d323d49b927e46c07b" "7.0.0": Windows: "x86_64": @@ -239,117 +329,3 @@ sources: "armv8": url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-aarch64-linux-c-api.tar.xz" sha256: "3fb770e9afa3114c3ffe9f60e696ba3e4a74d34e4b50b59cce27c3d118f215b1" - "0.38.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-x86_64-windows-c-api.zip" - sha256: "69b28fe9a89451e4561c628341c960c08d369caecfc319650660586dcf8c0c61" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-x86_64-mingw-c-api.zip" - sha256: "926177b45afe208e64011a2cb68dc73e064c25391269982ca74678eeade30faf" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-x86_64-linux-c-api.tar.xz" - sha256: "a4dfe18391feb807ae9c219734bc084ff11c1f2f26762dfb5252f5299cee434e" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-aarch64-linux-c-api.tar.xz" - sha256: "01dd81ac4eeff128ff762b6f2e61336b723a78b940006cd405f135e509046c4e" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-s390x-linux-c-api.tar.xz" - sha256: "552c991ab894fa250a5be296befb1c9f44c115de760ffe80b9ddf430f3e30ec0" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-x86_64-macos-c-api.tar.xz" - sha256: "651c41d4de8958caf80086bab46d0f326bbfa0f328f544a632df52b050f2776c" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-aarch64-macos-c-api.tar.xz" - sha256: "1e424122c73418c972287043a50555569afb09dc721fb6630503bf455cbd2856" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-aarch64-linux-c-api.tar.xz" - sha256: "01dd81ac4eeff128ff762b6f2e61336b723a78b940006cd405f135e509046c4e" - "0.37.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-x86_64-windows-c-api.zip" - sha256: "1e2db8ccb86d2da0607aca783bb3c929562e4fa688a94452dffa745867494a2d" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-x86_64-mingw-c-api.zip" - sha256: "62966da16277aaf3312525c1e5ce08202d56c8450855bfaf7b319ffa4355fd52" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-x86_64-linux-c-api.tar.xz" - sha256: "7b8de351808eb4dd3186bcc18b8f54d6c486ec1f21961521be49d02d38833696" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-aarch64-linux-c-api.tar.xz" - sha256: "926c4736cc79835f880f5b6f193891960a4fc32464ca00871ffd7228605387d9" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-s390x-linux-c-api.tar.xz" - sha256: "cdcefd0394cfaefdac9eba9417016c7a916a063f567b483d6df09b883d9b5976" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-x86_64-macos-c-api.tar.xz" - sha256: "0f785932fc69105dcecbb2d7c1ceb0cd63dffa5e4b0b3f198c4c56118bdb4ecd" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-aarch64-macos-c-api.tar.xz" - sha256: "0a0f5fd2283f52b3ab725650a5dfc77a8bf53de962344fabc37418af9e5e407a" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-aarch64-linux-c-api.tar.xz" - sha256: "926c4736cc79835f880f5b6f193891960a4fc32464ca00871ffd7228605387d9" - "0.36.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-windows-c-api.zip" - sha256: "7c0cc05d73b376bce31964c99720cecd9f595fc4a338e4a45bbc04cca5780508" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-mingw-c-api.zip" - sha256: "c4a6d3f0e428f3c912bef930c2d332fe09939b01b59f37a16ec6f4f7a89119e4" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-linux-c-api.tar.xz" - sha256: "c82c9fd1449a4a78710b8ada47db7386edb1caafcb8baa7cdedb79539fedb372" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-aarch64-linux-c-api.tar.xz" - sha256: "865e73764fca8552734eea72d990d32a670e8e7079f8fc5f15d70cb03ef3c8d9" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-s390x-linux-c-api.tar.xz" - sha256: "ec36bacf5b24b9da5ef1cdc979caf224412146d683ed6021f3bbd75adcb3754e" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-macos-c-api.tar.xz" - sha256: "8a97dfce791d9ad0acb346cdd6aa8f0f9ca85a94aa4c456ac9534c1994867dbf" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-aarch64-linux-c-api.tar.xz" - sha256: "865e73764fca8552734eea72d990d32a670e8e7079f8fc5f15d70cb03ef3c8d9" - "0.35.1": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-x86_64-windows-c-api.zip" - sha256: "055d0fead69eaf906bb68dd758fe4d59ee3638888503832142857f35feaba782" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-x86_64-mingw-c-api.zip" - sha256: "aee0f5f58915921191c4f9defda1a7172c6ca76c95e8d562e4cbefc5f0e1fff0" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-x86_64-linux-c-api.tar.xz" - sha256: "dd6ec4a87eed1a34ad386ca950ef01a7e9300b713beb38da8e51dd3f92ece002" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-aarch64-linux-c-api.tar.xz" - sha256: "8e263a62919a8dc8a7789abe3cfc69bdc0d6ea14b0cabee7a988bac250436785" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-s390x-linux-c-api.tar.xz" - sha256: "ed84e8b4c10c22ee5de3908aa006884bc1c38122e4a020cb9d91d86ed597d8a4" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-x86_64-macos-c-api.tar.xz" - sha256: "e32b46a537cf4311435477336cbcd30d68099097963b55c62ec5c12834326560" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.35.1/wasmtime-v0.35.1-aarch64-linux-c-api.tar.xz" - sha256: "8e263a62919a8dc8a7789abe3cfc69bdc0d6ea14b0cabee7a988bac250436785" diff --git a/recipes/wasmtime/all/conanfile.py b/recipes/wasmtime/all/conanfile.py index 1ceb2e856e777..4aec54bb577f2 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 604aa079994aa..53f9ed2965380 100644 --- a/recipes/wasmtime/config.yml +++ b/recipes/wasmtime/config.yml @@ -1,4 +1,10 @@ versions: + "16.0.0": + folder: all + "12.0.2": + folder: all + "9.0.1": + folder: all "7.0.0": folder: all "6.0.1": @@ -15,11 +21,3 @@ versions: folder: all "0.39.1": folder: all - "0.38.0": - folder: all - "0.37.0": - folder: all - "0.36.0": - folder: all - "0.35.1": - folder: all diff --git a/recipes/watcher/all/conandata.yml b/recipes/watcher/all/conandata.yml index f7df7228f93fd..857cc8ad36367 100644 --- a/recipes/watcher/all/conandata.yml +++ b/recipes/watcher/all/conandata.yml @@ -1,4 +1,16 @@ 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" + "0.8.7": + url: "https://github.com/e-dant/watcher/archive/release/0.8.7.tar.gz" + sha256: "e83eaf097f8ebe9b87bee2962e6e18f6f2597ae4e76d8d0258adc2c62fa545d2" "0.8.0": url: "https://github.com/e-dant/watcher/archive/release/0.8.0.tar.gz" sha256: "74530f5f6c083ec0348ec41938ae43b02bed1d125125623394f31038fec6f9d1" @@ -17,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 31b1acc6f5885..a860da1f34772 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 1c3d12d2130de..0000000000000 --- 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 18f5fe387b11a..7cb2b32a687ee 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,13 +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) + +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) + 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 5324e0d9a2b54..6e1dd6a280cc9 100644 --- a/recipes/watcher/all/test_package/test_package.cpp +++ b/recipes/watcher/all/test_package/test_package.cpp @@ -13,9 +13,13 @@ int main(int argc, char** argv) { "water.watcher.stream":{ )"; - auto const show_event_json = [](const WATCHER_NAMESPACE::watcher::event::event& this_event) { + auto const show_event_json = [](const WATCHER_EVENT_NAMESPACE::event& this_event) { std::cout << " " << this_event; - if (this_event.kind != WATCHER_NAMESPACE::watcher::event::kind::watcher) { +#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 3d179a6711efc..2b4b53a7cfb59 100644 --- a/recipes/watcher/config.yml +++ b/recipes/watcher/config.yml @@ -1,4 +1,12 @@ versions: + "0.9.5": + folder: all + "0.9.2": + folder: all + "0.8.8": + folder: all + "0.8.7": + folder: all "0.8.0": folder: all "0.6.0": @@ -11,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 fbf3768205fcc..16606180f5c32 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 69a04b499e31b..f322218f978f0 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.4") + 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 0000000000000..6621e790da38b --- /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 0000000000000..260b4ac4bbddc --- /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 d13fcfd021b7b..80a49141e8ea4 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 f5d4a91464dd2..9574e69bcf1e9 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 8641e38f36bfb..ad20a22df526e 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.0.0") + self.tool_requires("meson/1.3.0") 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 19d2d81011711..d6a32dbe0d2d5 100644 --- a/recipes/wayland-protocols/all/test_package/conanfile.py +++ b/recipes/wayland-protocols/all/test_package/conanfile.py @@ -17,13 +17,13 @@ def _has_build_profile(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("wayland/1.21.0") + self.requires("wayland/1.22.0") def build_requirements(self): - self.tool_requires("meson/1.0.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("wayland/1.21.0") + self.tool_requires("pkgconf/2.1.0") + self.tool_requires("wayland/1.22.0") def layout(self): basic_layout(self) diff --git a/recipes/wayland-protocols/config.yml b/recipes/wayland-protocols/config.yml index 81aded41c9822..f707ca2da06d2 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/conandata.yml b/recipes/wayland/all/conandata.yml index b49acf6707671..02888e74f53f7 100644 --- a/recipes/wayland/all/conandata.yml +++ b/recipes/wayland/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.22.0": + url: "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.22.0/downloads/wayland-1.22.0.tar.xz" + sha256: "1540af1ea698a471c2d8e9d288332c7e0fd360c8f1d12936ebb7e7cbc2425842" "1.21.0": url: "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.21.0/downloads/wayland-1.21.0.tar.xz" sha256: "6dc64d7fc16837a693a51cfdb2e568db538bfdc9f457d4656285bb9594ef11ac" diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py index 4deb10375518e..7694702f24251 100644 --- a/recipes/wayland/all/conanfile.py +++ b/recipes/wayland/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import copy, get, replace_in_file, rmdir from conan.tools.gnu import PkgConfigDeps @@ -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.12.3") self.requires("expat/2.5.0") def validate(self): @@ -58,10 +58,10 @@ 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") - if cross_building(self): + self.tool_requires("pkgconf/2.1.0") + if not can_run(self): self.tool_requires(str(self.ref)) def source(self): @@ -70,12 +70,12 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if not cross_building(self): + if can_run(self): env = VirtualRunEnv(self) env.generate(scope="build") pkg_config_deps = PkgConfigDeps(self) - if cross_building(self): + if not can_run(self): pkg_config_deps.build_context_activated = ["wayland"] elif self.dependencies["expat"].is_build_context: # wayland is being built as build_require # If wayland is the build_require, all its dependencies are treated as build_requires @@ -87,7 +87,7 @@ def generate(self): tc.project_options["libraries"] = self.options.enable_libraries tc.project_options["dtd_validation"] = self.options.enable_dtd_validation tc.project_options["documentation"] = False - if cross_building(self): + if not can_run(self): tc.project_options["build.pkg_config_path"] = self.generators_folder if Version(self.version) >= "1.18.91": tc.project_options["scanner"] = True diff --git a/recipes/wayland/all/test_package/conanfile.py b/recipes/wayland/all/test_package/conanfile.py index c201ad68aff34..ad22b7b8367de 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.1.0") def layout(self): cmake_layout(self) diff --git a/recipes/wayland/config.yml b/recipes/wayland/config.yml index 21b3598bd3d20..27ca5fdc22826 100644 --- a/recipes/wayland/config.yml +++ b/recipes/wayland/config.yml @@ -1,4 +1,6 @@ versions: + "1.22.0": + folder: all "1.21.0": folder: all "1.20.0": diff --git a/recipes/websocketpp/all/conanfile.py b/recipes/websocketpp/all/conanfile.py index 2e4962181cae1..8bc3d40999ef3 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/wglext/all/conanfile.py b/recipes/wglext/all/conanfile.py index 916b363760c68..7af57d6410b8e 100644 --- a/recipes/wglext/all/conanfile.py +++ b/recipes/wglext/all/conanfile.py @@ -1,37 +1,53 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, download, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.37.0" class WglextConan(ConanFile): name = "wglext" + description = "WGL extension interfaces" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.khronos.org/registry/OpenGL/index_gl.php" - description = "WGL extension interfaces" - topics = ("opengl", "gl", "wgl", "wglext") + topics = ("opengl", "gl", "wgl", "wglext", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - requires = "opengl/system" - settings = "os", + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("opengl/system") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.os != "Windows": raise ConanInvalidConfiguration("wglext is only supported on Windows") def source(self): - tools.download(filename="wglext.h", **self.conan_data["sources"][self.version]) + download(self, filename="wglext.h", **self.conan_data["sources"][self.version]) - def package(self): - self.copy(pattern="wglext.h", dst=os.path.join("include", "GL")) - license_data = tools.load(os.path.join(self.source_folder, "wglext.h")) + def _extract_license(self): + license_data = load(self, os.path.join(self.source_folder, "wglext.h")) begin = license_data.find("/*") + len("/*") end = license_data.find("*/") license_data = license_data[begin:end] license_data = license_data.replace("**", "") - tools.save("LICENSE", license_data) - self.copy("LICENSE", dst="licenses") + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_data) - def package_id(self): - self.info.header_only() + def package(self): + self._extract_license() + copy(self, pattern="wglext.h", dst=os.path.join(self.package_folder, "include", "GL"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/wglext/all/test_package/CMakeLists.txt b/recipes/wglext/all/test_package/CMakeLists.txt index 121f8f8e30a8e..06dc988df0340 100644 --- a/recipes/wglext/all/test_package/CMakeLists.txt +++ b/recipes/wglext/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(wglext REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/wglext/all/test_package/conanfile.py b/recipes/wglext/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/wglext/all/test_package/conanfile.py +++ b/recipes/wglext/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/CMakeLists.txt b/recipes/whereami/all/CMakeLists.txt index 9ad1b58bfdd92..4595ccd0654eb 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 323a8747c8641..6035268b447ee 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 7c0f4c847fb31..4789557edaa68 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 49a3a66ea5bad..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..49a3a66ea5bad --- /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/whisper-cpp/all/conandata.yml b/recipes/whisper-cpp/all/conandata.yml new file mode 100644 index 0000000000000..1c610fb8c4e68 --- /dev/null +++ b/recipes/whisper-cpp/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.5.2": + url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.5.2.tar.gz" + sha256: "be9c4d5d4b5f28f02e36f28e602b7d2dcfd734dd1c834ddae91ae8db601e951f" + "1.4.3": + url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.4.3.tar.gz" + sha256: "5f11c0542639bfb0b3c9d1b033d10ccd69ca26e739aec9366766617bc58a6e7c" + "1.2.1": + url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.2.1.tar.gz" + sha256: "69d47fc2ba982c42bd5bade4b7c827d5b3ed74b9c59323991c45a9f0f24eb6ed" +patches: + "1.2.1": + - patch_file: "patches/1.2.1-0001-find_package_openblas.patch" + patch_description: "Fix OpenBlas cmake target name" + patch_type: "conan" diff --git a/recipes/whisper-cpp/all/conanfile.py b/recipes/whisper-cpp/all/conanfile.py new file mode 100644 index 0000000000000..d3c14cc82e361 --- /dev/null +++ b/recipes/whisper-cpp/all/conanfile.py @@ -0,0 +1,189 @@ +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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class WhisperCppConan(ConanFile): + name = "whisper-cpp" + description = "High-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model" + topics = ("whisper", "asr") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ggerganov/whisper.cpp" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "sanitize_thread": [True, False], + "sanitize_address": [True, False], + "sanitize_undefined": [True, False], + "no_avx": [True, False], + "no_avx2": [True, False], + "no_fma": [True, False], + "no_f16c": [True, False], + "no_accelerate": [True, False], + "metal": [True, False], + "metal_ndebug": [True, False], + "with_coreml": [True, False], + "coreml_allow_fallback": [True, False], + "with_blas": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "sanitize_thread": False, + "sanitize_address": False, + "sanitize_undefined": False, + "no_avx": False, + "no_avx2": False, + "no_fma": False, + "no_f16c": False, + "no_accelerate": False, + "metal": False, + "metal_ndebug": False, + "with_coreml": False, + "coreml_allow_fallback": False, + "with_blas": False, + } + package_type = "library" + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "9", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + + def config_options(self): + if is_apple_os(self): + del self.options.with_blas + else: + del self.options.no_accelerate + del self.options.with_coreml + del self.options.coreml_allow_fallback + + if self.settings.os == "Windows": + del self.options.fPIC + + if Version(self.version) < "1.4.3": + del self.options.metal + del self.options.metal_ndebug + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + if is_apple_os(self): + if not self.options.with_coreml: + self.options.rm_safe("coreml_allow_fallback") + + 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 requirements(self): + if not is_apple_os(self): + if self.options.with_blas: + self.requires("openblas/0.3.24") + + def layout(self): + cmake_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + deps = CMakeDeps(self) + deps.set_property("openblas", "cmake_file_name", "BLAS") + deps.generate() + + tc = CMakeToolchain(self) + tc.variables["WHISPER_BUILD_TESTS"] = False + tc.variables["WHISPER_BUILD_EXAMPLES"] = False + + if self.options.shared: + tc.variables["BUILD_SHARED_LIBS"] = True + if self.options.sanitize_thread: + tc.variables["WHISPER_SANITIZE_THREAD"] = True + if self.options.sanitize_address: + tc.variables["WHISPER_SANITIZE_ADDRESS"] = True + if self.options.sanitize_undefined: + tc.variables["WHISPER_SANITIZE_UNDEFINED"] = True + if self.options.no_avx: + tc.variables["WHISPER_NO_AVX"] = True + if self.options.no_avx2: + tc.variables["WHISPER_NO_AVX2"] = True + if self.options.no_fma: + tc.variables["WHISPER_NO_FMA"] = True + if self.options.no_f16c: + tc.variables["WHISPER_NO_F16C"] = True + + if is_apple_os(self): + if self.options.no_accelerate: + tc.variables["WHISPER_NO_ACCELERATE"] = True + if not self.options.get_safe("metal"): + tc.variables["WHISPER_METAL"] = False + if self.options.get_safe("metal_ndebug"): + tc.variables["WHISPER_METAL_NDEBUG"] = True + if self.options.with_coreml: + tc.variables["WHISPER_COREML"] = True + if self.options.coreml_allow_fallback: + tc.variables["WHISPER_COREML_ALLOW_FALLBACK"] = True + else: + if self.options.with_blas: + if Version(self.version) >= "1.4.2": + tc.variables["WHISPER_OPENBLAS"] = True + else: + tc.variables["WHISPER_SUPPORT_OPENBLAS"] = True + + tc.generate() + + def build(self): + apply_conandata_patches(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() + copy(self, "*", os.path.join(self.source_folder, "models"), os.path.join(self.package_folder, "res", "models")) + + def package_info(self): + self.cpp_info.libs = ["whisper"] + self.cpp_info.resdirs = ["res"] + self.cpp_info.libdirs = ["lib", "lib/static"] + + if is_apple_os(self): + if not self.options.no_accelerate: + self.cpp_info.frameworks.append("Accelerate") + if self.options.with_coreml: + self.cpp_info.frameworks.append("CoreML") + elif self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) diff --git a/recipes/whisper-cpp/all/patches/1.2.1-0001-find_package_openblas.patch b/recipes/whisper-cpp/all/patches/1.2.1-0001-find_package_openblas.patch new file mode 100644 index 0000000000000..c8752384a40d1 --- /dev/null +++ b/recipes/whisper-cpp/all/patches/1.2.1-0001-find_package_openblas.patch @@ -0,0 +1,22 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -100,15 +100,7 @@ + endif() + + if (WHISPER_SUPPORT_OPENBLAS) +- find_library(OPENBLAS_LIB +- NAMES openblas libopenblas +- ) +- if (OPENBLAS_LIB) +- message(STATUS "OpenBLAS found") +- +- set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} ${OPENBLAS_LIB}) +- set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_OPENBLAS) +- else() +- message(WARNING "OpenBLAS not found") +- endif() ++ find_package(BLAS REQUIRED CONFIG) ++ set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} OpenBLAS::OpenBLAS) ++ set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_OPENBLAS) + endif() + diff --git a/recipes/whisper-cpp/all/test_package/CMakeLists.txt b/recipes/whisper-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6a90512af2d73 --- /dev/null +++ b/recipes/whisper-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) # if the project uses c++ + +find_package(whisper-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE whisper-cpp::whisper-cpp) + + +add_custom_command(TARGET test_package POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${whisper-cpp_INCLUDE_DIR}/../res/models + ${CMAKE_CURRENT_BINARY_DIR}/models) diff --git a/recipes/whisper-cpp/all/test_package/conanfile.py b/recipes/whisper-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7d2de09164073 --- /dev/null +++ b/recipes/whisper-cpp/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + + +# 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/whisper-cpp/all/test_package/test_package.cpp b/recipes/whisper-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1bc036b7b08b7 --- /dev/null +++ b/recipes/whisper-cpp/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include +#include +#include "whisper.h" + + +int main() { + auto context = std::unique_ptr( + whisper_init_from_file("models/for-tests-ggml-base.en.bin"), &whisper_free); + + if (context == nullptr) { + std::cout << "Failed to initialize whisper context!" << std::endl; + return 3; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/whisper-cpp/config.yml b/recipes/whisper-cpp/config.yml new file mode 100644 index 0000000000000..8c62d29e8f324 --- /dev/null +++ b/recipes/whisper-cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "1.5.2": + folder: "all" + "1.4.3": + folder: "all" + "1.2.1": + folder: "all" diff --git a/recipes/wide-integer/all/conandata.yml b/recipes/wide-integer/all/conandata.yml new file mode 100644 index 0000000000000..8e3a196e3ef2e --- /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 0000000000000..b8ab834969f4b --- /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 0000000000000..8e666755a1135 --- /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 0000000000000..e845ae751a301 --- /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 0000000000000..5b9232349b7ab --- /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 0000000000000..6fb64b738b18e --- /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 c9a6344cdb846..d5f4e93a4cb65 100644 --- a/recipes/wil/all/conandata.yml +++ b/recipes/wil/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.0.231216.1": + url: "https://github.com/microsoft/wil/archive/refs/tags/v1.0.231216.1.tar.gz" + sha256: "4c15ba5e357f19449222b89f6e34d590d9d3f3d67e704a5cc5f4caa74228dd7e" + "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" "1.0.230202.1": url: "https://github.com/microsoft/wil/archive/refs/tags/v1.0.230202.1.tar.gz" sha256: "7bf01e9d93fb93f0fe2614492fac4a423b3a97b435015db74f5ac4a0270ebc8a" diff --git a/recipes/wil/config.yml b/recipes/wil/config.yml index 5d004c574dfa1..58a0a4f3fc832 100644 --- a/recipes/wil/config.yml +++ b/recipes/wil/config.yml @@ -1,3 +1,13 @@ versions: + "1.0.231216.1": + folder: "all" + "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": folder: "all" diff --git a/recipes/wildmidi/all/conanfile.py b/recipes/wildmidi/all/conanfile.py index 0e6c15d33a72b..4648d8d359fa3 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/wilzegers-autotest/all/conanfile.py b/recipes/wilzegers-autotest/all/conanfile.py index 8ef12a62b9ce4..81cb48532fdf0 100644 --- a/recipes/wilzegers-autotest/all/conanfile.py +++ b/recipes/wilzegers-autotest/all/conanfile.py @@ -1,36 +1,70 @@ -from conans import 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.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 WilzegersAutotestConan(ConanFile): name = "wilzegers-autotest" + description = "Autotest facilitates the testing of class interfaces" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.com/wilzegers/autotest" - description = "Autotest facilitates the testing of class interfaces" - topics = ("autotest", "testing") - settings = "compiler" + topics = ("autotest", "testing", "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 source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "5.0", + "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) + 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.compiler != "clang": raise ConanInvalidConfiguration("Only clang allowed") - 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): - self.copy("*.hpp", src=os.path.join(self._source_subfolder, "autotest/include"), dst="include") - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "*.hpp", + src=os.path.join(self.source_folder, "autotest/include"), + dst=os.path.join(self.package_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 = [] diff --git a/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt b/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt index 041b6ec23c708..a64b138191fa5 100644 --- a/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt +++ b/recipes/wilzegers-autotest/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(wilzegers-autotest REQUIRED CONFIG) diff --git a/recipes/wilzegers-autotest/all/test_package/conanfile.py b/recipes/wilzegers-autotest/all/test_package/conanfile.py index 49a3a66ea5bad..fae501d0afb9e 100644 --- a/recipes/wilzegers-autotest/all/test_package/conanfile.py +++ b/recipes/wilzegers-autotest/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/wilzegers-autotest/all/test_package/test_package.cpp b/recipes/wilzegers-autotest/all/test_package/test_package.cpp index 152f5d33d3410..26e0bb71eb0f0 100644 --- a/recipes/wilzegers-autotest/all/test_package/test_package.cpp +++ b/recipes/wilzegers-autotest/all/test_package/test_package.cpp @@ -1,3 +1,6 @@ +// Workaround for a missing include in wilzegers-autotest/cci.20200921 +#include + #include #include diff --git a/recipes/wilzegers-autotest/all/test_v1_package/CMakeLists.txt b/recipes/wilzegers-autotest/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/wilzegers-autotest/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/wilzegers-autotest/all/test_v1_package/conanfile.py b/recipes/wilzegers-autotest/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/wilzegers-autotest/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/winflexbison/all/conandata.yml b/recipes/winflexbison/all/conandata.yml index c1a75693f1653..44c1f53fdafb9 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 0000000000000..54af813f75263 --- /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 480280b1fb8e8..4ae41b917c916 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 1882e7a4ae703..e37dc1cc239fe 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 9f6956c1ef7de..0a393b28e8b4a 100644 --- a/recipes/wolfssl/all/conandata.yml +++ b/recipes/wolfssl/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "5.6.6": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.6.6-stable.tar.gz" + sha256: "3d2ca672d41c2c2fa667885a80d6fa03c3e91f0f4f72f87aef2bc947e8c87237" + "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" "5.5.1": url: "https://github.com/wolfSSL/wolfssl/archive/v5.5.1-stable.tar.gz" sha256: "97339e6956c90e7c881ba5c748dd04f7c30e5dbe0c06da765418c51375a6dee3" diff --git a/recipes/wolfssl/all/conanfile.py b/recipes/wolfssl/all/conanfile.py index d1489495db5d2..7233278df2e56 100644 --- a/recipes/wolfssl/all/conanfile.py +++ b/recipes/wolfssl/all/conanfile.py @@ -1,11 +1,12 @@ 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.env import VirtualBuildEnv from conan.tools.files import copy, get, rename, 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 +from conan.tools.scm import Version import os required_conan_version = ">=1.54.0" @@ -157,3 +158,7 @@ def package_info(self): self.cpp_info.system_libs.extend(["m", "pthread"]) elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["advapi32", "ws2_32"]) + if Version(self.version) >= "5.6.0": + self.cpp_info.system_libs.append("crypt32") + elif is_apple_os(self) and Version(self.version) >= "5.6.0": + self.cpp_info.frameworks.extend(["CoreFoundation", "Security"]) diff --git a/recipes/wolfssl/config.yml b/recipes/wolfssl/config.yml index e4db787180ac0..e099f310174af 100644 --- a/recipes/wolfssl/config.yml +++ b/recipes/wolfssl/config.yml @@ -1,4 +1,10 @@ versions: + "5.6.6": + folder: all + "5.6.4": + folder: all + "5.6.3": + folder: all "5.5.1": folder: all "5.4.0": diff --git a/recipes/wslay/all/patches/0001-msvc-support.patch b/recipes/wslay/all/patches/0001-msvc-support.patch index a689fc2452be1..b8e26fd0b44af 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 8b83e78419f05..7c33a1e76efa3 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" @@ -14,19 +20,15 @@ sources: "4.6.0": url: "https://github.com/emweb/wt/archive/4.6.0.tar.gz" sha256: "7f709e132d32c4925e6db0a590c7ccc5613344e8b9052676ef891a25ccb550e6" - "4.5.1": - url: "https://github.com/emweb/wt/archive/4.5.1.tar.gz" - sha256: "c2820646095af5618fc235705c0108797e3898225fb1826f2c6185c405c21a17" - "4.5.0": - url: "https://github.com/emweb/wt/archive/4.5.0.tar.gz" - sha256: "119b1eae83285a153b9c901d3f4f25775c7a460d30b1e48242d7d2d649d61deb" - "4.4.0": - url: "https://github.com/emweb/wt/archive/4.4.0.tar.gz" - sha256: "2eabefea915ecc4deb36f9f67ab30dd3b1f6c73893d76c9d9fa39ac25f4f3690" - "4.3.1": - url: "https://github.com/emweb/wt/archive/4.3.1.tar.gz" - sha256: "6c0130f36c829ed67119679770c2f62d7768a62eaa281bb10070c4cf1b145139" 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" @@ -47,28 +49,3 @@ patches: - patch_file: "patches/4.6.2-0001-use-cci-package.patch" patch_description: "use cci package" patch_type: "conan" - "4.5.1": - - patch_file: "patches/4.3.1-0001-use-cci-package.patch" - patch_description: "use cci package" - patch_type: "conan" - "4.5.0": - - patch_file: "patches/4.3.1-0001-use-cci-package.patch" - patch_description: "use cci package" - patch_type: "conan" - - patch_file: "patches/4.3.1-0002-gcc_11.patch" - patch_description: "include limits header" - patch_type: "portability" - "4.4.0": - - patch_file: "patches/4.3.1-0001-use-cci-package.patch" - patch_description: "use cci package" - patch_type: "conan" - - patch_file: "patches/4.3.1-0002-gcc_11.patch" - patch_description: "include limits header" - patch_type: "portability" - "4.3.1": - - patch_file: "patches/4.3.1-0001-use-cci-package.patch" - patch_description: "use cci package" - patch_type: "conan" - - patch_file: "patches/4.3.1-0002-gcc_11.patch" - patch_description: "include limits header" - patch_type: "portability" diff --git a/recipes/wt/all/conanfile.py b/recipes/wt/all/conanfile.py index 6378a056d8e5c..fc0eb757303bd 100644 --- a/recipes/wt/all/conanfile.py +++ b/recipes/wt/all/conanfile.py @@ -1,13 +1,15 @@ -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.53.0" +required_conan_version = ">=1.54.0" + class WtConan(ConanFile): name = "wt" @@ -16,6 +18,7 @@ class WtConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/emweb/wt" topics = ("server", "web", "webapp", "websocket", "cgi", "fastcgi", "orm") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -91,26 +94,24 @@ def _required_boost_components(self): return ["program_options", "filesystem", "thread"] def requirements(self): - if Version(self.version) < "4.6.0": - self.requires("boost/1.76.0") - elif Version(self.version) < "4.9.0": - self.requires("boost/1.80.0") + if Version(self.version) < "4.9.0": + self.requires("boost/1.80.0", transitive_headers = True) else: - self.requires("boost/1.81.0") + 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.1t") + self.requires("openssl/[>=1.1 <4]") if self.options.get_safe("with_sqlite"): - self.requires("sqlite3/3.41.1") + 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/14.7", 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.6.2") + 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,25 +218,23 @@ 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 else: tc.variables["CONNECTOR_FCGI"] = self.options.connector_fcgi tc.variables["CONNECTOR_ISAPI"] = False - - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) @@ -234,12 +243,18 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - replace_in_file(self, cmakelists, "find_package(OpenSSL)", "#find_package(OpenSSL)") replace_in_file(self, cmakelists, "INCLUDE(cmake/WtFindMysql.txt)", "#INCLUDE(cmake/WtFindMysql.txt)") replace_in_file(self, cmakelists, "INCLUDE(cmake/WtFindPostgresql.txt)", "#INCLUDE(cmake/WtFindPostgresql.txt)") if self.settings.os != "Windows": replace_in_file(self, cmakelists, "INCLUDE(cmake/WtFindOdbc.txt)", "#INCLUDE(cmake/WtFindOdbc.txt)") + if self.options.with_ssl: + # Ensure the conan-generated config is used for OpenSSL when required as a dependency + replace_in_file(self, cmakelists, "find_package(OpenSSL)", "find_package(OpenSSL CONFIG REQUIRED)") + else: + # Avoid searching for OpenSSL if it is not required + replace_in_file(self, cmakelists, "find_package(OpenSSL)", "") + # Do not pollute rpath of shared libs of the install tree on macOS please replace_in_file(self, cmakelists, diff --git a/recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch b/recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch deleted file mode 100644 index af7c47db572a3..0000000000000 --- a/recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/src/Wt/Dbo/backend/CMakeLists.txt b/src/Wt/Dbo/backend/CMakeLists.txt -index 827abf3..5324034 100644 ---- a/src/Wt/Dbo/backend/CMakeLists.txt -+++ b/src/Wt/Dbo/backend/CMakeLists.txt -@@ -127,11 +127,12 @@ IF(ENABLE_POSTGRES AND POSTGRES_FOUND) - SET_PROPERTY(TARGET wtdbopostgres PROPERTY CXX_VISIBILITY_PRESET hidden) - SET_PROPERTY(TARGET wtdbopostgres PROPERTY VISIBILITY_INLINES_HIDDEN YES) - -+ find_package(PostgreSQL REQUIRED CONFIG) - TARGET_LINK_LIBRARIES(wtdbopostgres - PUBLIC - wtdbo - PRIVATE -- ${POSTGRES_LIBRARIES} -+ PostgreSQL::PostgreSQL - ) - - IF(TARGET Boost::headers) -@@ -291,11 +292,12 @@ IF(ENABLE_MYSQL AND MYSQL_FOUND) - SET_PROPERTY(TARGET wtdbomysql PROPERTY CXX_VISIBILITY_PRESET hidden) - SET_PROPERTY(TARGET wtdbomysql PROPERTY VISIBILITY_INLINES_HIDDEN YES) - -+ find_package(libmysqlclient REQUIRED CONFIG) - TARGET_LINK_LIBRARIES(wtdbomysql - PUBLIC - wtdbo - PRIVATE -- ${MYSQL_LIBRARIES} -+ libmysqlclient::libmysqlclient - ) - - INCLUDE_DIRECTORIES(${MYSQL_INCLUDE}) diff --git a/recipes/wt/all/patches/4.3.1-0002-gcc_11.patch b/recipes/wt/all/patches/4.3.1-0002-gcc_11.patch deleted file mode 100644 index 03d2aaff9236b..0000000000000 --- a/recipes/wt/all/patches/4.3.1-0002-gcc_11.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/Wt/Render/WTextRenderer.C -+++ b/src/Wt/Render/WTextRenderer.C -@@ -14,6 +14,7 @@ - #include "Block.h" - - #include -+#include - #include - - namespace { diff --git a/recipes/wt/config.yml b/recipes/wt/config.yml index f24f55b014506..fec9d209ef876 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": @@ -9,11 +13,3 @@ versions: folder: all "4.6.0": folder: all - "4.5.1": - folder: all - "4.5.0": - folder: all - "4.4.0": - folder: all - "4.3.1": - folder: all diff --git a/recipes/wyhash/all/conanfile.py b/recipes/wyhash/all/conanfile.py index 34e8d0350c888..5ef173786f6ec 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 f2cc68f3f1bd4..e5d0241981b9f 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 2e045a1c8a082..a117cdd9c7b95 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 9523784e16e7c..724743a916f47 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 9006396a7028a..e1673a246df2d 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 0496b29838549..0000000000000 --- 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 e3d748b348f87..eb147f1dcfc1f 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 dd28555a7ac65..26ea67c5823c3 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 2011b67ca68a5..e845ae751a301 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 e167cd38f70ed..0000000000000 --- 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 0000000000000..658780d07761b --- /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 0000000000000..91630d79f4abb --- /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 0000000000000..423b8142d5f25 --- /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/conandata.yml b/recipes/xerces-c/all/conandata.yml index b384861145f6b..42c60fa48a45e 100644 --- a/recipes/xerces-c/all/conandata.yml +++ b/recipes/xerces-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.5": + url: "https://github.com/apache/xerces-c/archive/v3.2.5.tar.gz" + sha256: "4042f6f11c9eba745dc0e5f8035d98b442097ee4efc69e4853410e4737a987f8" "3.2.4": url: "https://github.com/apache/xerces-c/archive/v3.2.4.tar.gz" sha256: "8dfaa30d6a641bda113625ef65e43c433e8ffd94fadd3b8d39dfe6faf450f26d" @@ -9,12 +12,11 @@ sources: url: "https://github.com/apache/xerces-c/archive/v3.2.2.tar.gz" sha256: "7fe5af7d7ad9d4a06503c15fb5bb0aa5f2ba7959700d16c21b8bd183ca542e7f" patches: + "3.2.5": + - patch_file: "patches/0002-find-icu-programs.patch" "3.2.4": - - patch_file: "patches/0001-remove-test-samples-324.patch" - patch_file: "patches/0002-find-icu-programs.patch" "3.2.3": - - patch_file: "patches/0001-remove-test-samples.patch" - patch_file: "patches/0002-find-icu-programs.patch" "3.2.2": - - patch_file: "patches/0001-remove-test-samples.patch" - patch_file: "patches/0002-find-icu-programs.patch" diff --git a/recipes/xerces-c/all/conanfile.py b/recipes/xerces-c/all/conanfile.py index 7f0ec271188e7..915980e982b8c 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.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir, save 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.2") 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) @@ -126,15 +129,21 @@ def generate(self): deps = CMakeDeps(self) deps.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + # Disable subdirectories + for subdir in ["doc", "tests", "samples"]: + save(self, os.path.join(self.source_folder, subdir, "CMakeLists.txt"), "") + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() 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/xerces-c/all/patches/0001-remove-test-samples-324.patch b/recipes/xerces-c/all/patches/0001-remove-test-samples-324.patch deleted file mode 100644 index 248d7401136e7..0000000000000 --- a/recipes/xerces-c/all/patches/0001-remove-test-samples-324.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 02f819bfda7f01d53d986db1c14ec704dd290b7b Mon Sep 17 00:00:00 2001 -From: Chris Mc -Date: Fri, 3 Sep 2021 20:30:03 -0400 -Subject: [PATCH] disable extra junk - ---- - CMakeLists.txt | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 33bc40f..ebd70c1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -164,10 +164,10 @@ install( - COMPONENT "development") - - # Process subdirectories --add_subdirectory(doc) -+#add_subdirectory(doc) - add_subdirectory(src) --add_subdirectory(tests) --add_subdirectory(samples) -+#add_subdirectory(tests) -+#add_subdirectory(samples) - - # Display configuration summary - message(STATUS "") diff --git a/recipes/xerces-c/all/patches/0001-remove-test-samples.patch b/recipes/xerces-c/all/patches/0001-remove-test-samples.patch deleted file mode 100644 index 9b610bf94fb8e..0000000000000 --- a/recipes/xerces-c/all/patches/0001-remove-test-samples.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 02f819bfda7f01d53d986db1c14ec704dd290b7b Mon Sep 17 00:00:00 2001 -From: Chris Mc -Date: Fri, 3 Sep 2021 20:30:03 -0400 -Subject: [PATCH] disable extra junk - ---- - CMakeLists.txt | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4254f89bb..dfd4bb01b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -175,10 +175,10 @@ install( - COMPONENT "development") - - # Process subdirectories --add_subdirectory(doc) -+#add_subdirectory(doc) - add_subdirectory(src) --add_subdirectory(tests) --add_subdirectory(samples) -+#add_subdirectory(tests) -+#add_subdirectory(samples) - - # Display configuration summary - message(STATUS "") diff --git a/recipes/xerces-c/config.yml b/recipes/xerces-c/config.yml index 795ad892ef369..a8902c8d470c0 100644 --- a/recipes/xerces-c/config.yml +++ b/recipes/xerces-c/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.5": + folder: all "3.2.4": folder: all "3.2.3": diff --git a/recipes/xkbcommon/all/conandata.yml b/recipes/xkbcommon/all/conandata.yml index 1c21a5c826ba0..35dd4985bdd4e 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 926843dcf8b92..aa22ef2b05309 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -65,24 +65,24 @@ 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.12.3") 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") + self.requires("wayland-protocols/1.32") def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: 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.3.1") 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.1.0") if self._has_build_profile and self.options.get_safe("with_wayland"): - self.tool_requires("wayland/1.21.0") - self.tool_requires("wayland-protocols/1.31") + self.tool_requires("wayland/") + self.tool_requires("wayland-protocols/1.32") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -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 aa62b1dc6f781..dc3bda303f68e 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/xkeyboard-config/all/conanfile.py b/recipes/xkeyboard-config/all/conanfile.py index ec1b8c4a6f2ed..bd171724a258d 100644 --- a/recipes/xkeyboard-config/all/conanfile.py +++ b/recipes/xkeyboard-config/all/conanfile.py @@ -8,6 +8,7 @@ class XkeyboardConfigConan(ConanFile): name = "xkeyboard-config" + package_type = "application" url = "https://github.com/conan-io/conan-center-index" license = "MIT" homepage = "https://www.freedesktop.org/wiki/Software/XKeyboardConfig/" diff --git a/recipes/xlsxio/all/conandata.yml b/recipes/xlsxio/all/conandata.yml new file mode 100644 index 0000000000000..026e7d4f464c4 --- /dev/null +++ b/recipes/xlsxio/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "0.2.34": + sha256: 726e3bc3cf571ac20e5c39b1f192f3793d24ebfdeaadcd210de74aa1ec100bb6 + url: https://github.com/brechtsanders/xlsxio/archive/refs/tags/0.2.34.tar.gz + "0.2.33": + sha256: f221ffff7d9ba33c87411ba76b371cac202f25e07bf4e740828592e1c7e79263 + url: https://github.com/brechtsanders/xlsxio/archive/refs/tags/0.2.33.tar.gz + +patches: + "0.2.34": + - patch_file: patches/0234_cmake.patch + patch_description: "conan build cmake support" + patch_type: "conan" + "0.2.33": + - patch_file: patches/0233_cmake.patch + patch_description: "conan build cmake support" + patch_type: "conan" diff --git a/recipes/xlsxio/all/conanfile.py b/recipes/xlsxio/all/conanfile.py new file mode 100644 index 0000000000000..7724a07d64464 --- /dev/null +++ b/recipes/xlsxio/all/conanfile.py @@ -0,0 +1,154 @@ +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, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class XlsxioConan(ConanFile): + name = "xlsxio" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/brechtsanders/xlsxio" + description = "Cross-platform C library for reading values from and writing values to .xlsx files." + topics = ("xlsx",) + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC":[True, False], + "shared": [True, False], + "with_libzip": [True, False], + "with_minizip_ng": [True, False], + "with_wide": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + "with_libzip": False, + "with_minizip_ng": False, + "with_wide": False, + } + 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.2.34": + del self.options.with_minizip_ng + + 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.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.10.1") + elif Version(self.version) >= "0.2.34" and self.options.with_minizip_ng : + self.requires("minizip-ng/4.0.1") + else: + 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 = CMakeToolchain(self) + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["WITH_LIBZIP"] = self.options.with_libzip + 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) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + 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, "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): + self.cpp_info.set_property("cmake_file_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("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("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("pkg_config_name", "libxlsxio_readw") + 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" + self.cpp_info.names["cmake_find_package_multi"] = "xlsxio" + self.cpp_info.components["xlsxio_read"].names["cmake_find_package"] = "xlsxio_read" + self.cpp_info.components["xlsxio_read"].names["cmake_find_package_multi"] = "xlsxio_read" + self.cpp_info.components["xlsxio_write"].names["cmake_find_package"] = "xlsxio_write" + self.cpp_info.components["xlsxio_write"].names["cmake_find_package_multi"] = "xlsxio_write" + if self.options.with_wide: + self.cpp_info.components["xlsxio_readw"].names["cmake_find_package"] = "xlsxio_readw" + self.cpp_info.components["xlsxio_readw"].names["cmake_find_package_multi"] = "xlsxio_readw" + diff --git a/recipes/xlsxio/all/patches/0233_cmake.patch b/recipes/xlsxio/all/patches/0233_cmake.patch new file mode 100644 index 0000000000000..a669955dfcba4 --- /dev/null +++ b/recipes/xlsxio/all/patches/0233_cmake.patch @@ -0,0 +1,86 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,13 +46,23 @@ ENDIF() + # dependancy: libzip + IF(WITH_LIBZIP) + FIND_PACKAGE(LibZip REQUIRED) +- SET(ANYZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIRS}) +- SET(ANYZIP_LIBRARIES ${LIBZIP_LIBRARIES}) ++ IF(LIBZIP_INCLUDE_DIRS) ++ SET(ANYZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIRS}) ++ SET(ANYZIP_LIBRARIES ${LIBZIP_LIBRARIES}) ++ ELSE() ++ SET(ANYZIP_INCLUDE_DIRS ${libzip_INCLUDE_DIRS}) ++ SET(ANYZIP_LIBRARIES ${libzip_LIBRARIES}) ++ ENDIF() + SET(ANYZIP_DEF USE_LIBZIP) + ELSE() +- FIND_PACKAGE(Minizip REQUIRED) +- SET(ANYZIP_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}) +- SET(ANYZIP_LIBRARIES ${MINIZIP_LIBRARIES}) ++ FIND_PACKAGE(Minizip 1 REQUIRED) ++ IF(MINIZIP_INCLUDE_DIRS) ++ SET(ANYZIP_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}) ++ SET(ANYZIP_LIBRARIES ${MINIZIP_LIBRARIES}) ++ ELSE() ++ SET(ANYZIP_INCLUDE_DIRS ${minizip_INCLUDE_DIRS}) ++ SET(ANYZIP_LIBRARIES ${minizip_LIBRARIES}) ++ ENDIF() + SET(ANYZIP_DEF USE_MINIZIP) + ENDIF() + # dependancy: expat +@@ -62,6 +72,9 @@ IF(EXPAT_DIR) + FIND_LIBRARY(EXPAT_LIBRARIES NAMES expat libexpat NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/lib ${EXPAT_DIR}) + ELSE() + FIND_PACKAGE(EXPAT REQUIRED) ++ IF(NOT EXPAT_LIBRARIES) ++ SET(EXPAT_LIBRARIES ${expat_LIBRARIES}) ++ ENDIF() + ENDIF() + # dependancy: expatw (if wide library was requested) + IF(WITH_WIDE) +@@ -70,6 +83,9 @@ IF(WITH_WIDE) + ELSE() + FIND_LIBRARY(EXPATW_LIBRARIES NAMES expatw) + ENDIF() ++ IF(NOT EXPATW_LIBRARIES) ++ SET(EXPATW_LIBRARIES ${EXPAT_LIBRARIES}) ++ ENDIF() + ENDIF() + + # Doxygen +@@ -101,7 +117,9 @@ ENDIF() + + FOREACH(LINKTYPE ${LINKTYPES}) + ADD_LIBRARY(xlsxio_read_${LINKTYPE} ${LINKTYPE} lib/xlsxio_read.c lib/xlsxio_read_sharedstrings.c) +- SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "BUILD_XLSXIO;${ANYZIP_DEF};BUILD_XLSXIO_${LINKTYPE}") ++ TARGET_COMPILE_DEFINITIONS(xlsxio_read_${LINKTYPE} PUBLIC BUILD_XLSXIO) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_read_${LINKTYPE} PUBLIC ${ANYZIP_DEF}) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_read_${LINKTYPE} PUBLIC BUILD_XLSXIO_${LINKTYPE}) + SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES OUTPUT_NAME xlsxio_read) + IF(MINGW AND LINKTYPE STREQUAL "SHARED") + SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES LINK_FLAGS "-Wl,--output-def=libxlsxio_read.def") +@@ -112,7 +130,9 @@ FOREACH(LINKTYPE ${LINKTYPES}) + SET(ALLTARGETS_LIB ${ALLTARGETS_LIB} xlsxio_read_${LINKTYPE}) + + ADD_LIBRARY(xlsxio_write_${LINKTYPE} ${LINKTYPE} lib/xlsxio_write.c) +- SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "BUILD_XLSXIO;${ANYZIP_DEF};BUILD_XLSXIO_${LINKTYPE}") ++ TARGET_COMPILE_DEFINITIONS(xlsxio_write_${LINKTYPE} PUBLIC BUILD_XLSXIO) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_write_${LINKTYPE} PUBLIC ${ANYZIP_DEF}) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_write_${LINKTYPE} PUBLIC BUILD_XLSXIO_${LINKTYPE}) + SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES OUTPUT_NAME xlsxio_write) + IF(MINGW AND LINKTYPE STREQUAL "SHARED") + SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES LINK_FLAGS "-Wl,--output-def=libxlsxio_write.def") +@@ -122,8 +142,10 @@ FOREACH(LINKTYPE ${LINKTYPES}) + + IF(WITH_WIDE) + ADD_LIBRARY(xlsxio_readw_${LINKTYPE} ${LINKTYPE} lib/xlsxio_read.c lib/xlsxio_read_sharedstrings.c) +- SET_TARGET_PROPERTIES(xlsxio_readw_${LINKTYPE} PROPERTIES DEFINE_SYMBOL "BUILD_XLSXIO_DLL") +- SET_TARGET_PROPERTIES(xlsxio_readw_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "XML_UNICODE;BUILD_XLSXIO;${ANYZIP_DEF}") ++ TARGET_COMPILE_DEFINITIONS(xlsxio_readw_${LINKTYPE} PUBLIC BUILD_XLSXIO_DLL) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_readw_${LINKTYPE} PUBLIC XML_UNICODE) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_readw_${LINKTYPE} PUBLIC BUILD_XLSXIO) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_readw_${LINKTYPE} PUBLIC ${ANYZIP_DEF}) + SET_TARGET_PROPERTIES(xlsxio_readw_${LINKTYPE} PROPERTIES OUTPUT_NAME xlsxio_readw) + IF(MINGW AND LINKTYPE STREQUAL "SHARED") + SET_TARGET_PROPERTIES(xlsxio_readw_${LINKTYPE} PROPERTIES LINK_FLAGS "-Wl,--output-def=libxlsxio_readw.def") diff --git a/recipes/xlsxio/all/patches/0234_cmake.patch b/recipes/xlsxio/all/patches/0234_cmake.patch new file mode 100644 index 0000000000000..ea858da988ead --- /dev/null +++ b/recipes/xlsxio/all/patches/0234_cmake.patch @@ -0,0 +1,111 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bf4e9bf..f0d6a0e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,8 +22,6 @@ OPTION(BUILD_PC_FILES "Build pkg-config .pc" ON) + OPTION(BUILD_TOOLS "Build tools" ON) + OPTION(BUILD_EXAMPLES "Build examples" ON) + OPTION(WITH_LIBZIP "Use libzip instead of Minizip" OFF) +-OPTION(WITH_MINIZIP_NG "Use Minizip NG" OFF) +-OPTION(MINIZIP_NG_SUFFIX "Minizip NG suffix (default is empty)" "") + OPTION(WITH_WIDE "Also build UTF-16 library (libxlsxio_readw)" OFF) + SET(ZLIB_DIR "" CACHE PATH "Path to the zlib library") + IF(WITH_LIBZIP) +@@ -48,18 +46,33 @@ ENDIF() + # dependancy: libzip/minizip/minizip-ng + IF(WITH_LIBZIP) + FIND_PACKAGE(LibZip REQUIRED) +- SET(ANYZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIRS}) +- SET(ANYZIP_LIBRARIES ${LIBZIP_LIBRARIES}) ++ IF(LIBZIP_INCLUDE_DIRS) ++ SET(ANYZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIRS}) ++ SET(ANYZIP_LIBRARIES ${LIBZIP_LIBRARIES}) ++ ELSE() ++ SET(ANYZIP_INCLUDE_DIRS ${libzip_INCLUDE_DIRS}) ++ SET(ANYZIP_LIBRARIES ${libzip_LIBRARIES}) ++ ENDIF() + SET(ANYZIP_DEF USE_LIBZIP) + ELSEIF(WITH_MINIZIP_NG) +- 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 REQUIRED) ++ IF(minizip_INCLUDE_DIRS) ++ SET(ANYZIP_INCLUDE_DIRS ${minizip_INCLUDE_DIRS}) ++ SET(ANYZIP_LIBRARIES ${minizip_LIBRARIES}) ++ ELSE() ++ SET(ANYZIP_INCLUDE_DIRS "${minizip-ng_DIR}/../../../include/minizip${MINIZIP_NG_SUFFIX}") ++ SET(ANYZIP_LIBRARIES minizip${MINIZIP_NG_SUFFIX}) ++ ENDIF() + SET(ANYZIP_DEF USE_MINIZIP;USE_MINIZIP_NG) + ELSE() +- FIND_PACKAGE(Minizip REQUIRED) +- SET(ANYZIP_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}) +- SET(ANYZIP_LIBRARIES ${MINIZIP_LIBRARIES}) ++ FIND_PACKAGE(Minizip 1 REQUIRED) ++ IF(MINIZIP_INCLUDE_DIRS) ++ SET(ANYZIP_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}) ++ SET(ANYZIP_LIBRARIES ${MINIZIP_LIBRARIES}) ++ ELSE() ++ SET(ANYZIP_INCLUDE_DIRS ${minizip_INCLUDE_DIRS}) ++ SET(ANYZIP_LIBRARIES ${minizip_LIBRARIES}) ++ ENDIF() + SET(ANYZIP_DEF USE_MINIZIP) + ENDIF() + # dependancy: expat +@@ -69,6 +82,9 @@ IF(EXPAT_DIR) + FIND_LIBRARY(EXPAT_LIBRARIES NAMES expat libexpat NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/lib ${EXPAT_DIR}) + ELSE() + FIND_PACKAGE(EXPAT REQUIRED) ++ IF(NOT EXPAT_LIBRARIES) ++ SET(EXPAT_LIBRARIES ${expat_LIBRARIES}) ++ ENDIF() + ENDIF() + # dependancy: expatw (if wide library was requested) + IF(WITH_WIDE) +@@ -77,6 +93,9 @@ IF(WITH_WIDE) + ELSE() + FIND_LIBRARY(EXPATW_LIBRARIES NAMES expatw) + ENDIF() ++ IF(NOT EXPATW_LIBRARIES) ++ SET(EXPATW_LIBRARIES ${EXPAT_LIBRARIES}) ++ ENDIF() + ENDIF() + + # Doxygen +@@ -108,7 +127,9 @@ ENDIF() + + FOREACH(LINKTYPE ${LINKTYPES}) + ADD_LIBRARY(xlsxio_read_${LINKTYPE} ${LINKTYPE} lib/xlsxio_read.c lib/xlsxio_read_sharedstrings.c) +- SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "BUILD_XLSXIO;${ANYZIP_DEF};BUILD_XLSXIO_${LINKTYPE}") ++ TARGET_COMPILE_DEFINITIONS(xlsxio_read_${LINKTYPE} PUBLIC BUILD_XLSXIO) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_read_${LINKTYPE} PUBLIC ${ANYZIP_DEF}) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_read_${LINKTYPE} PUBLIC BUILD_XLSXIO_${LINKTYPE}) + SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES OUTPUT_NAME xlsxio_read) + IF(MINGW AND LINKTYPE STREQUAL "SHARED") + SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES LINK_FLAGS "-Wl,--output-def=libxlsxio_read.def") +@@ -119,7 +140,9 @@ FOREACH(LINKTYPE ${LINKTYPES}) + SET(ALLTARGETS_LIB ${ALLTARGETS_LIB} xlsxio_read_${LINKTYPE}) + + ADD_LIBRARY(xlsxio_write_${LINKTYPE} ${LINKTYPE} lib/xlsxio_write.c) +- SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "BUILD_XLSXIO;${ANYZIP_DEF};BUILD_XLSXIO_${LINKTYPE}") ++ TARGET_COMPILE_DEFINITIONS(xlsxio_write_${LINKTYPE} PUBLIC BUILD_XLSXIO) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_write_${LINKTYPE} PUBLIC ${ANYZIP_DEF}) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_write_${LINKTYPE} PUBLIC BUILD_XLSXIO_${LINKTYPE}) + SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES OUTPUT_NAME xlsxio_write) + IF(MINGW AND LINKTYPE STREQUAL "SHARED") + SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES LINK_FLAGS "-Wl,--output-def=libxlsxio_write.def") +@@ -129,8 +152,11 @@ FOREACH(LINKTYPE ${LINKTYPES}) + + IF(WITH_WIDE) + ADD_LIBRARY(xlsxio_readw_${LINKTYPE} ${LINKTYPE} lib/xlsxio_read.c lib/xlsxio_read_sharedstrings.c) +- SET_TARGET_PROPERTIES(xlsxio_readw_${LINKTYPE} PROPERTIES DEFINE_SYMBOL "BUILD_XLSXIO_DLL") +- SET_TARGET_PROPERTIES(xlsxio_readw_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "XML_UNICODE;BUILD_XLSXIO;${ANYZIP_DEF}") ++ TARGET_COMPILE_DEFINITIONS(xlsxio_readw_${LINKTYPE} PUBLIC BUILD_XLSXIO_DLL) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_readw_${LINKTYPE} PUBLIC XML_UNICODE) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_readw_${LINKTYPE} PUBLIC BUILD_XLSXIO) ++ TARGET_COMPILE_DEFINITIONS(xlsxio_readw_${LINKTYPE} PUBLIC ${ANYZIP_DEF}) ++ + SET_TARGET_PROPERTIES(xlsxio_readw_${LINKTYPE} PROPERTIES OUTPUT_NAME xlsxio_readw) + IF(MINGW AND LINKTYPE STREQUAL "SHARED") + SET_TARGET_PROPERTIES(xlsxio_readw_${LINKTYPE} PROPERTIES LINK_FLAGS "-Wl,--output-def=libxlsxio_readw.def") diff --git a/recipes/xlsxio/all/test_package/CMakeLists.txt b/recipes/xlsxio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a6b2c7649a0c8 --- /dev/null +++ b/recipes/xlsxio/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(xlsxio REQUIRED CONFIG) + +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/conanfile.py b/recipes/xlsxio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/xlsxio/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/xlsxio/all/test_package/test_package.c b/recipes/xlsxio/all/test_package/test_package.c new file mode 100644 index 0000000000000..097bd99e0a65d --- /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_v1_package/CMakeLists.txt b/recipes/xlsxio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xlsxio/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/xlsxio/all/test_v1_package/conanfile.py b/recipes/xlsxio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/xlsxio/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/xlsxio/config.yml b/recipes/xlsxio/config.yml new file mode 100644 index 0000000000000..5b98871657b36 --- /dev/null +++ b/recipes/xlsxio/config.yml @@ -0,0 +1,5 @@ +versions: + "0.2.34": + folder: all + "0.2.33": + folder: all diff --git a/recipes/xmlsec/all/conandata.yml b/recipes/xmlsec/all/conandata.yml index 46664dc0decc9..7f3fc57bc6bab 100644 --- a/recipes/xmlsec/all/conandata.yml +++ b/recipes/xmlsec/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.3.2": + url: "https://github.com/lsh123/xmlsec/releases/download/xmlsec_1_3_2/xmlsec1-1.3.2.tar.gz" + sha256: "4003c56b3d356d21b1db7775318540fad6bfedaf5f117e8f7c010811219be3cf" + "1.2.38": + url: "https://github.com/lsh123/xmlsec/releases/download/xmlsec-1_2_38/xmlsec1-1.2.38.tar.gz" + sha256: "9de8cf8d7d2e288a9cef205cc6cb93c926a67dadfaf44aaff76ed63c28ce9902" + "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 6cbfca0ca36ca..acc967598ba2e 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.12.3", 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.1.0") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): @@ -120,6 +120,8 @@ def generate(self): "--enable-docs=no", "--enable-mans=no", ]) + if Version(self.version) >= "1.3.2": + tc.configure_args.append("--enable-pedantic=no") tc.generate() deps = AutotoolsDeps(self) @@ -158,11 +160,13 @@ def build(self): f"static={yes_no(not self.options.shared)}", "include=\"{}\"".format(";".join(deps_includedirs)), "lib=\"{}\"".format(";".join(deps_libdirs)), - "with-dl=no", + "with-dl={}".format(yes_no(Version(self.version) >= "1.2.35" and self.options.shared)), f"xslt={yes_no(self.options.with_xslt)}", "iconv=no", "crypto={}".format(",".join(crypto_engines)), ] + if Version(self.version) >= "1.2.35": + args.append("pedantic=no") with chdir(self, os.path.join(self.source_folder, "win32")): self.run(f"cscript configure.js {' '.join(args)}") @@ -199,8 +203,9 @@ def package(self): if not self.options.shared: rm(self, "*.dll", os.path.join(self.package_folder, "bin")) rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec-openssl_a.lib" if self.options.shared else "libxmlsec-openssl.lib")) - os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec_a.lib" if self.options.shared else "libxmlsec.lib")) + if Version(self.version) < "1.2.35": + os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec-openssl_a.lib" if self.options.shared else "libxmlsec-openssl.lib")) + os.unlink(os.path.join(self.package_folder, "lib", "libxmlsec_a.lib" if self.options.shared else "libxmlsec.lib")) else: autotools = Autotools(self) autotools.install() diff --git a/recipes/xmlsec/all/test_package/CMakeLists.txt b/recipes/xmlsec/all/test_package/CMakeLists.txt index 926e0b1fdcb15..80ae5f35a850c 100644 --- a/recipes/xmlsec/all/test_package/CMakeLists.txt +++ b/recipes/xmlsec/all/test_package/CMakeLists.txt @@ -2,13 +2,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) find_package(xmlsec REQUIRED CONFIG) -find_package(LibXml2 REQUIRED MODULE) -if(XMLSEC_WITH_XSLT) - find_package(LibXslt REQUIRED MODULE) -endif() -add_executable(${PROJECT_NAME} sign1.c) -target_link_libraries(${PROJECT_NAME} PRIVATE LibXml2::LibXml2 xmlsec::xmlsec) -if(XMLSEC_WITH_XSLT) - target_link_libraries(${PROJECT_NAME} PRIVATE LibXslt::LibXslt) -endif() +add_executable(${PROJECT_NAME} main.c) +target_link_libraries(${PROJECT_NAME} PRIVATE xmlsec::xmlsec) diff --git a/recipes/xmlsec/all/test_package/conanfile.py b/recipes/xmlsec/all/test_package/conanfile.py index e977f9247d9e3..98ab55852ad56 100644 --- a/recipes/xmlsec/all/test_package/conanfile.py +++ b/recipes/xmlsec/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, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "VirtualRunEnv" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" def layout(self): @@ -14,12 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("libxml2/2.10.4") - - def generate(self): - tc = CMakeToolchain(self) - tc.variables["XMLSEC_WITH_XSLT"] = self.dependencies["xmlsec"].options.with_xslt - tc.generate() def build(self): cmake = CMake(self) @@ -29,6 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - xml_file = os.path.join(self.source_folder, "sign1-tmpl.xml") - pem_file = os.path.join(self.source_folder, "rsakey.pem") - self.run(f"{bin_path} {xml_file} {pem_file}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/xmlsec/all/test_package/main.c b/recipes/xmlsec/all/test_package/main.c new file mode 100644 index 0000000000000..10ac70841525b --- /dev/null +++ b/recipes/xmlsec/all/test_package/main.c @@ -0,0 +1,28 @@ +#include + + +#include + + +int main(int argc, char **argv) { + /* Init xmlsec library */ + if(xmlSecInit() < 0) { + fprintf(stderr, "Error: xmlsec initialization failed.\n"); + return(-1); + } + + /* Check loaded library version */ + if(xmlSecCheckVersion() != 1) { + fprintf(stderr, "Error: loaded xmlsec library version is not compatible.\n"); + return(-1); + } + + if(xmlSecCheckVersionExact() != 1) { + fprintf(stderr, "Error: loaded xmlsec library version is not exact.\n"); + return(-1); + } + + /* Shutdown xmlsec library */ + xmlSecShutdown(); + return(0); +} diff --git a/recipes/xmlsec/all/test_package/rsakey.pem b/recipes/xmlsec/all/test_package/rsakey.pem deleted file mode 100644 index de07b7803966b..0000000000000 --- a/recipes/xmlsec/all/test_package/rsakey.pem +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIBPAIBAAJBANPQbQ92nlbeg1Q5JNHSO1Yey46nZ7GJltLWw1ccSvp7pnvmfUm+ -M521CpFpfr4EAE3UVBMoU9j/hqq3dFAc2H0CAwEAAQJBALFVCjmsAZyQ5jqZLO5N -qEfNuHZSSUol+xPBogFIOq3BWa269eNNcAK5or5g0XWWon7EPdyGT4qyDVH9KzXK -RLECIQDzm/Nj0epUGN51/rKJgRXWkXW/nfSCMO9fvQR6Ujoq3wIhAN6WeHK9vgWg -wBWqMdq5sR211+LlDH7rOUQ6rBpbsoQjAiEA7jzpfglgPPZFOOfo+oh/LuP6X3a+ -FER/FQXpRyb7M8kCIETUrwZ8WkiPPxbz/Fqw1W5kjw/g2I5e2uSYaCP2eyuVAiEA -mOI6RhRyMqgxQyy0plJVjG1s4fdu92AWYy9AwYeyd/8= ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/recipes/xmlsec/all/test_package/sign1-tmpl.xml b/recipes/xmlsec/all/test_package/sign1-tmpl.xml deleted file mode 100644 index 1c50319fad562..0000000000000 --- a/recipes/xmlsec/all/test_package/sign1-tmpl.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Hello, World! - - - - - - - - - - - - - - - - - - - diff --git a/recipes/xmlsec/all/test_package/sign1.c b/recipes/xmlsec/all/test_package/sign1.c deleted file mode 100644 index c081e62e344fd..0000000000000 --- a/recipes/xmlsec/all/test_package/sign1.c +++ /dev/null @@ -1,211 +0,0 @@ -/** - * XML Security Library example: Signing a template file. - * - * Signs a template file using a key from PEM file - * - * Usage: - * ./sign1 - * - * Example: - * ./sign1 sign1-tmpl.xml rsakey.pem > sign1-res.xml - * - * The result signature could be validated using verify1 example: - * ./verify1 sign1-res.xml rsapub.pem - * - * This is free software; see Copyright file in the source - * distribution for preciese wording. - * - * Copyright (C) 2002-2016 Aleksey Sanin . All Rights Reserved. - */ -#include -#include -#include - -#include -#include -#include - -#ifndef XMLSEC_NO_XSLT -#include -#include -#endif /* XMLSEC_NO_XSLT */ - -#include -#include -#include -#include - -int sign_file(const char* tmpl_file, const char* key_file); - -int -main(int argc, char **argv) { -#ifndef XMLSEC_NO_XSLT - xsltSecurityPrefsPtr xsltSecPrefs = NULL; -#endif /* XMLSEC_NO_XSLT */ - - assert(argv); - - if(argc != 3) { - fprintf(stderr, "Error: wrong number of arguments.\n"); - fprintf(stderr, "Usage: %s \n", argv[0]); - return(1); - } - - /* Init libxml and libxslt libraries */ - xmlInitParser(); - LIBXML_TEST_VERSION - xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - xmlSubstituteEntitiesDefault(1); -#ifndef XMLSEC_NO_XSLT - xmlIndentTreeOutput = 1; -#endif /* XMLSEC_NO_XSLT */ - - /* Init libxslt */ -#ifndef XMLSEC_NO_XSLT - /* disable everything */ - xsltSecPrefs = xsltNewSecurityPrefs(); - xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_READ_FILE, xsltSecurityForbid); - xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_WRITE_FILE, xsltSecurityForbid); - xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_CREATE_DIRECTORY, xsltSecurityForbid); - xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_READ_NETWORK, xsltSecurityForbid); - xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_WRITE_NETWORK, xsltSecurityForbid); - xsltSetDefaultSecurityPrefs(xsltSecPrefs); -#endif /* XMLSEC_NO_XSLT */ - - /* Init xmlsec library */ - if(xmlSecInit() < 0) { - fprintf(stderr, "Error: xmlsec initialization failed.\n"); - return(-1); - } - - /* Check loaded library version */ - if(xmlSecCheckVersion() != 1) { - fprintf(stderr, "Error: loaded xmlsec library version is not compatible.\n"); - return(-1); - } - - /* Load default crypto engine if we are supporting dynamic - * loading for xmlsec-crypto libraries. Use the crypto library - * name ("openssl", "nss", etc.) to load corresponding - * xmlsec-crypto library. - */ -#ifdef XMLSEC_CRYPTO_DYNAMIC_LOADING - if(xmlSecCryptoDLLoadLibrary(NULL) < 0) { - fprintf(stderr, "Error: unable to load default xmlsec-crypto library. Make sure\n" - "that you have it installed and check shared libraries path\n" - "(LD_LIBRARY_PATH and/or LTDL_LIBRARY_PATH) environment variables.\n"); - return(-1); - } -#endif /* XMLSEC_CRYPTO_DYNAMIC_LOADING */ - - /* Init crypto library */ - if(xmlSecCryptoAppInit(NULL) < 0) { - fprintf(stderr, "Error: crypto initialization failed.\n"); - return(-1); - } - - /* Init xmlsec-crypto library */ - if(xmlSecCryptoInit() < 0) { - fprintf(stderr, "Error: xmlsec-crypto initialization failed.\n"); - return(-1); - } - - if(sign_file(argv[1], argv[2]) < 0) { - return(-1); - } - - /* Shutdown xmlsec-crypto library */ - xmlSecCryptoShutdown(); - - /* Shutdown crypto library */ - xmlSecCryptoAppShutdown(); - - /* Shutdown xmlsec library */ - xmlSecShutdown(); - - /* Shutdown libxslt/libxml */ -#ifndef XMLSEC_NO_XSLT - xsltFreeSecurityPrefs(xsltSecPrefs); - xsltCleanupGlobals(); -#endif /* XMLSEC_NO_XSLT */ - xmlCleanupParser(); - - return(0); -} - -/** - * sign_file: - * @tmpl_file: the signature template file name. - * @key_file: the PEM private key file name. - * - * Signs the #tmpl_file using private key from #key_file. - * - * Returns 0 on success or a negative value if an error occurs. - */ -int -sign_file(const char* tmpl_file, const char* key_file) { - xmlDocPtr doc = NULL; - xmlNodePtr node = NULL; - xmlSecDSigCtxPtr dsigCtx = NULL; - int res = -1; - - assert(tmpl_file); - assert(key_file); - - /* load template */ - doc = xmlParseFile(tmpl_file); - if ((doc == NULL) || (xmlDocGetRootElement(doc) == NULL)){ - fprintf(stderr, "Error: unable to parse file \"%s\"\n", tmpl_file); - goto done; - } - - /* find start node */ - node = xmlSecFindNode(xmlDocGetRootElement(doc), xmlSecNodeSignature, xmlSecDSigNs); - if(node == NULL) { - fprintf(stderr, "Error: start node not found in \"%s\"\n", tmpl_file); - goto done; - } - - /* create signature context, we don't need keys manager in this example */ - dsigCtx = xmlSecDSigCtxCreate(NULL); - if(dsigCtx == NULL) { - fprintf(stderr,"Error: failed to create signature context\n"); - goto done; - } - - /* load private key, assuming that there is not password */ - dsigCtx->signKey = xmlSecCryptoAppKeyLoad(key_file, xmlSecKeyDataFormatPem, NULL, NULL, NULL); - if(dsigCtx->signKey == NULL) { - fprintf(stderr,"Error: failed to load private pem key from \"%s\"\n", key_file); - goto done; - } - - /* set key name to the file name, this is just an example! */ - if(xmlSecKeySetName(dsigCtx->signKey, key_file) < 0) { - fprintf(stderr,"Error: failed to set key name for key from \"%s\"\n", key_file); - goto done; - } - - /* sign the template */ - if(xmlSecDSigCtxSign(dsigCtx, node) < 0) { - fprintf(stderr,"Error: signature failed\n"); - goto done; - } - - /* print signed document to stdout */ - xmlDocDump(stdout, doc); - - /* success */ - res = 0; - -done: - /* cleanup */ - if(dsigCtx != NULL) { - xmlSecDSigCtxDestroy(dsigCtx); - } - - if(doc != NULL) { - xmlFreeDoc(doc); - } - return(res); -} diff --git a/recipes/xmlsec/config.yml b/recipes/xmlsec/config.yml index be77378a24392..f6bb070510906 100644 --- a/recipes/xmlsec/config.yml +++ b/recipes/xmlsec/config.yml @@ -1,4 +1,10 @@ versions: + "1.3.2": + folder: all + "1.2.38": + folder: all + "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 271fcb3d93eeb..97d441c786f9f 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 7263f61d28bb8..5d80f5f3cd167 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 d1b55a81c6c28..a1c159e3728ee 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/conandata.yml b/recipes/xorg-cf-files/all/conandata.yml index 6580982dad473..658b472b4c45f 100644 --- a/recipes/xorg-cf-files/all/conandata.yml +++ b/recipes/xorg-cf-files/all/conandata.yml @@ -1,7 +1,12 @@ sources: + "1.0.8": + url: "https://www.x.org/pub/individual/util/xorg-cf-files-1.0.8.tar.gz" + sha256: "c6f1c9ffce96278a9d7c72d081e508d81c219dec69ae0dbaf8ae88f4bc9ef977" "1.0.7": url: "https://www.x.org/pub/individual/util/xorg-cf-files-1.0.7.tar.gz" sha256: "a49478ba0c2138bc53de38979cd2dee073b6fd6728597c552d266a707747f472" patches: + "1.0.8": + - patch_file: "patches/1.0.7-0001-win-fixes.patch" "1.0.7": - patch_file: "patches/1.0.7-0001-win-fixes.patch" diff --git a/recipes/xorg-cf-files/all/conanfile.py b/recipes/xorg-cf-files/all/conanfile.py index aa2cb1d905e4c..1b0174ae22ceb 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 a1d91cfb0034d..3f15b70b2d474 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-cf-files/config.yml b/recipes/xorg-cf-files/config.yml index 377623d3a93f7..b0a4d47458ba1 100644 --- a/recipes/xorg-cf-files/config.yml +++ b/recipes/xorg-cf-files/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.8": + folder: all "1.0.7": folder: all diff --git a/recipes/xorg-gccmakedep/all/conanfile.py b/recipes/xorg-gccmakedep/all/conanfile.py index 813811cb7758d..1aafda519a470 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-macros/all/conandata.yml b/recipes/xorg-macros/all/conandata.yml index 69af08fff0a8f..2e869ee5f7766 100644 --- a/recipes/xorg-macros/all/conandata.yml +++ b/recipes/xorg-macros/all/conandata.yml @@ -1,7 +1,12 @@ sources: + "1.20.0": + url: "https://www.x.org/releases/individual/util/util-macros-1.20.0.tar.gz" + sha256: "8daf36913d551a90fd1013cb078401375dabae021cb4713b9b256a70f00eeb74" "1.19.3": url: "https://www.x.org/releases/individual/util/util-macros-1.19.3.tar.gz" sha256: "624bb6c3a4613d18114a7e3849a3d70f2d7af9dc6eabeaba98060d87e3aef35b" patches: + "1.20.0": + - patch_file: "patches/0001-export-XORG_MACROS_VERSION-macro.patch" "1.19.3": - patch_file: "patches/0001-export-XORG_MACROS_VERSION-macro.patch" diff --git a/recipes/xorg-macros/config.yml b/recipes/xorg-macros/config.yml index 4d76ebbbccd62..5cecce18ebb70 100644 --- a/recipes/xorg-macros/config.yml +++ b/recipes/xorg-macros/config.yml @@ -1,3 +1,5 @@ versions: + "1.20.0": + folder: "all" "1.19.3": folder: "all" diff --git a/recipes/xorg-makedepend/all/conandata.yml b/recipes/xorg-makedepend/all/conandata.yml index 17712580498cb..f052e3d0c52d9 100644 --- a/recipes/xorg-makedepend/all/conandata.yml +++ b/recipes/xorg-makedepend/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.8": + url: "https://www.x.org/archive/individual/util/makedepend-1.0.8.tar.xz" + sha256: "bfb26f8025189b2a01286ce6daacc2af8fe647440b40bb741dd5c397572cba5b" "1.0.6": url: "https://www.x.org/archive/individual/util/makedepend-1.0.6.tar.gz" sha256: "845f6708fc850bf53f5b1d0fb4352c4feab3949f140b26f71b22faba354c3365" diff --git a/recipes/xorg-makedepend/all/conanfile.py b/recipes/xorg-makedepend/all/conanfile.py index 6656dcd889cff..a0024be22451a 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-makedepend/config.yml b/recipes/xorg-makedepend/config.yml index c8c4465c97415..09dfd19800bb5 100644 --- a/recipes/xorg-makedepend/config.yml +++ b/recipes/xorg-makedepend/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.8": + folder: all "1.0.6": folder: all diff --git a/recipes/xorg-proto/all/conanfile.py b/recipes/xorg-proto/all/conanfile.py index b53e7215a2338..f20cc54f7acb5 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/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py index b8a810681f531..423aec281a1c2 100644 --- a/recipes/xorg/all/conanfile.py +++ b/recipes/xorg/all/conanfile.py @@ -1,4 +1,4 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.gnu import PkgConfig from conan.tools.system import package_manager from conan.errors import ConanInvalidConfiguration @@ -29,7 +29,7 @@ def system_requirements(self): "libxcomposite-dev", "libxcursor-dev", "libxdamage-dev", "libxdmcp-dev", "libxext-dev", "libxfixes-dev", "libxi-dev", "libxinerama-dev", "libxkbfile-dev", "libxmu-dev", "libxmuu-dev", "libxpm-dev", "libxrandr-dev", "libxrender-dev", "libxres-dev", "libxss-dev", "libxt-dev", "libxtst-dev", - "libxv-dev", "libxvmc-dev", "libxxf86vm-dev", "libxcb-render0-dev", + "libxv-dev", "libxxf86vm-dev", "libxcb-render0-dev", "libxcb-render-util0-dev", "libxcb-xkb-dev", "libxcb-icccm4-dev", "libxcb-image0-dev", "libxcb-keysyms1-dev", "libxcb-randr0-dev", "libxcb-shape0-dev", "libxcb-sync-dev", "libxcb-xfixes0-dev", "libxcb-xinerama0-dev", "libxcb-dri3-dev", "uuid-dev", "libxcb-cursor-dev"], update=True, check=True) @@ -39,7 +39,7 @@ def system_requirements(self): yum = package_manager.Yum(self) yum.install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", - "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", + "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", "xcb-util-devel", "libuuid-devel", "xcb-util-cursor-devel"], update=True, check=True) @@ -47,7 +47,7 @@ def system_requirements(self): dnf = package_manager.Dnf(self) dnf.install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", - "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", + "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", "xcb-util-devel", "libuuid-devel", "xcb-util-cursor-devel"], update=True, check=True) @@ -55,7 +55,7 @@ def system_requirements(self): zypper = package_manager.Zypper(self) zypper.install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", - "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXss-devel", "libXvMC-devel", + "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXss-devel", "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", "xcb-util-devel", "libuuid-devel", "xcb-util-cursor-devel"], update=True, check=True) @@ -63,19 +63,24 @@ def system_requirements(self): pacman = package_manager.PacMan(self) pacman.install(["libxcb", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", "libxdamage", "libxdmcp", "libxtst", "libxinerama", "libxkbfile", "libxrandr", "libxres", - "libxss", "libxvmc", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", + "libxss", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", "libxxf86vm", "libxv", "xcb-util", "util-linux-libs", "xcb-util-cursor"], update=True, check=True) package_manager.Pkg(self).install(["libX11", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", "libxdamage", "libxdmcp", "libxtst", "libxinerama", "libxkbfile", "libxrandr", "libxres", - "libXScrnSaver", "libxvmc", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", + "libXScrnSaver", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", "libxxf86vm", "libxv", "xkeyboard-config", "xcb-util", "xcb-util-cursor"], update=True, check=True) def package_info(self): + if conan_version.major >= 2: + self.cpp_info.bindirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + for name in ["x11", "x11-xcb", "fontenc", "ice", "sm", "xau", "xaw7", "xcomposite", "xcursor", "xdamage", "xdmcp", "xext", "xfixes", "xi", "xinerama", "xkbfile", "xmu", "xmuu", "xpm", "xrandr", "xrender", "xres", - "xscrnsaver", "xt", "xtst", "xv", "xvmc", "xxf86vm", + "xscrnsaver", "xt", "xtst", "xv", "xxf86vm", "xcb-xkb", "xcb-icccm", "xcb-image", "xcb-keysyms", "xcb-randr", "xcb-render", "xcb-renderutil", "xcb-shape", "xcb-shm", "xcb-sync", "xcb-xfixes", "xcb-xinerama", "xcb", "xcb-atom", "xcb-aux", "xcb-event", "xcb-util", @@ -88,6 +93,9 @@ def package_info(self): "pkg_config_name", name) self.cpp_info.components[name].set_property( "component_version", pkg_config.version) + self.cpp_info.components[name].bindirs = [] + self.cpp_info.components[name].includedirs = [] + self.cpp_info.components[name].libdirs = [] self.cpp_info.components[name].set_property("pkg_config_custom_content", "\n".join(f"{key}={value}" for key, value in pkg_config.variables.items() if key not in ["pcfiledir","prefix", "includedir"])) diff --git a/recipes/xorstr/all/conanfile.py b/recipes/xorstr/all/conanfile.py index 2712a05ac7044..f5d66df51bfdb 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/xoshiro-cpp/all/conanfile.py b/recipes/xoshiro-cpp/all/conanfile.py index c922c9e422fe2..97eea31fdbb08 100644 --- a/recipes/xoshiro-cpp/all/conanfile.py +++ b/recipes/xoshiro-cpp/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.files import copy, get from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.50.0" class XoshiroCppConan(ConanFile): @@ -17,7 +17,11 @@ class XoshiroCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" topics = ("prng", "xoshiro", "header-only") package_type = "header-library" - settings = "arch", "build_type", "compiler", "os" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "17" @property def _minimum_compilers_version(self): @@ -25,50 +29,32 @@ def _minimum_compilers_version(self): "apple-clang": "10", "clang": "6", "gcc": "7", - "Visual Studio": "16" + "Visual Studio": "16", + "msvc": "192", } - @property - def _minimum_cpp_standard(self): - return 17 - def package_id(self): self.info.clear() 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) - compiler = str(self.settings.compiler) - version = Version(self.settings.compiler.version) - try: - min_version = self._minimum_compilers_version[compiler] - if version < min_version: - msg = ( - f"{self.name} requires C++{self._minimum_cpp_standard} 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" + 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." ) - 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 package(self): copy(self, "*.hpp", src=self.source_folder, - dst=os.path.join(self.package_folder, "include/xoshiro-cpp/")) + dst=os.path.join(self.package_folder, "include", "xoshiro-cpp")) 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", "xoshiro-cpp") - self.cpp_info.set_property( - "cmake_target_name", "xoshiro-cpp::xoshiro-cpp") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/xoshiro-cpp/all/test_package/CMakeLists.txt b/recipes/xoshiro-cpp/all/test_package/CMakeLists.txt index 7b5f12d50e4ab..4a58eb5fc4eb1 100644 --- a/recipes/xoshiro-cpp/all/test_package/CMakeLists.txt +++ b/recipes/xoshiro-cpp/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 17) - find_package(xoshiro-cpp REQUIRED CONFIG) add_executable(test_package test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE xoshiro-cpp::xoshiro-cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_${CMAKE_CXX_STANDARD}) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt b/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt index 6044711e33fae..0d20897301b68 100644 --- a/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt +++ b/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt @@ -1,13 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.1) project(test_package) -set(CMAKE_CXX_STANDARD 17) - include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(xoshiro-cpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE xoshiro-cpp::xoshiro-cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_${CMAKE_CXX_STANDARD}) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xpack/all/conanfile.py b/recipes/xpack/all/conanfile.py index 87dad9562235b..fb4f7dbe93adb 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 f3db566cfff6d..e6eeff282118e 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 d0b47cfe2aef6..342ac8fd08fed 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 19183a5008e25..8d9e15a3818f4 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 7ea50ba1ad430..fd802956c6269 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 0000000000000..7ea50ba1ad430 --- /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 1a4062ea92a4a..f65775fd15ca5 100644 --- a/recipes/xsimd/all/conandata.yml +++ b/recipes/xsimd/all/conandata.yml @@ -1,4 +1,16 @@ 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" "11.0.0": url: "https://github.com/xtensor-stack/xsimd/archive/11.0.0.tar.gz" sha256: "50c31c319c8b36c8946eb954c7cca2e2ece86bf8a66a7ebf321b24cd273e7c47" diff --git a/recipes/xsimd/all/conanfile.py b/recipes/xsimd/all/conanfile.py index f94116c204e90..b22729f3e5ce1 100644 --- a/recipes/xsimd/all/conanfile.py +++ b/recipes/xsimd/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.layout import basic_layout from conan.tools.scm import Version from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd import os import textwrap @@ -12,11 +13,11 @@ class XsimdConan(ConanFile): name = "xsimd" + description = "C++ wrappers for SIMD intrinsics and parallelized, optimized mathematical functions (SSE, AVX, NEON, AVX512)" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/xtensor-stack/xsimd" - description = "C++ wrappers for SIMD intrinsics and parallelized, optimized mathematical functions (SSE, AVX, NEON, AVX512)" - topics = ("simd-intrinsics", "vectorization", "simd") + topics = ("simd-intrinsics", "vectorization", "simd", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { @@ -25,20 +26,43 @@ class XsimdConan(ConanFile): default_options = { "xtl_complex": False, } - no_copy_source = True + @property + def _min_cppstd(self): + return 14 if self.options.xtl_complex 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, {}) + def requirements(self): if self.options.xtl_complex: - self.requires("xtl/0.7.4") + self.requires("xtl/0.7.5") def package_id(self): self.info.clear() def validate(self): # TODO: check supported version (probably >= 8.0.0) - if Version(self.version) < "8.0.0" and self.settings.os == "Macos" and self.settings.arch in ["armv8", "armv8_32", "armv8.3"]: - raise ConanInvalidConfiguration(f"{self.name} doesn't support macOS M1") + if Version(self.version) < "8.0.0" and is_apple_os(self) and self.settings.arch in ["armv8", "armv8_32", "armv8.3"]: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support macOS M1") + + 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 layout(self): basic_layout(self, src_folder="src") @@ -79,9 +103,7 @@ def package_info(self): if self.options.xtl_complex: self.cpp_info.defines = ["XSIMD_ENABLE_XTL_COMPLEX=1"] self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] ## TODO: workaround for arm compilation issue : https://github.com/xtensor-stack/xsimd/issues/735 if Version(self.version) >= "9.0.0" and \ diff --git a/recipes/xsimd/all/test_package/CMakeLists.txt b/recipes/xsimd/all/test_package/CMakeLists.txt index 5d39cde644c56..0624e265ce85e 100644 --- a/recipes/xsimd/all/test_package/CMakeLists.txt +++ b/recipes/xsimd/all/test_package/CMakeLists.txt @@ -7,7 +7,12 @@ find_package(xsimd REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE xsimd) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) + +if (XSIMD_WITH_XTL) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") foreach(flag "/arch:AVX") diff --git a/recipes/xsimd/all/test_package/conanfile.py b/recipes/xsimd/all/test_package/conanfile.py index d120a992c06a6..21848efdbb9cb 100644 --- a/recipes/xsimd/all/test_package/conanfile.py +++ b/recipes/xsimd/all/test_package/conanfile.py @@ -1,18 +1,28 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout +from conan.tools.cmake import CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualBuildEnv import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def layout(self): + cmake_layout(self) def requirements(self): self.requires(self.tested_reference_str) - def layout(self): - cmake_layout(self) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["XSIMD_WITH_XTL"] = self.dependencies["xsimd"].options.xtl_complex + tc.generate() + tc = CMakeDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate(scope="build") def build(self): cmake = CMake(self) diff --git a/recipes/xsimd/all/test_v1_package/CMakeLists.txt b/recipes/xsimd/all/test_v1_package/CMakeLists.txt index b2359dc86fc74..9d54a092e0a67 100644 --- a/recipes/xsimd/all/test_v1_package/CMakeLists.txt +++ b/recipes/xsimd/all/test_v1_package/CMakeLists.txt @@ -1,29 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -include(CheckCXXCompilerFlag) - include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(xsimd REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE xsimd) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) - -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - foreach(flag "/arch:AVX") - CHECK_CXX_COMPILER_FLAG(${flag} COMPILER_SUPPORTS_MARCH_NATIVE) - if(COMPILER_SUPPORTS_MARCH_NATIVE) - target_compile_options(${PROJECT_NAME} PRIVATE ${flag}) - endif() - endforeach() -elseif ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) - foreach(flag "-march=native" "-mtune=native") - CHECK_CXX_COMPILER_FLAG(${flag} COMPILER_SUPPORTS_MARCH_NATIVE) - if(COMPILER_SUPPORTS_MARCH_NATIVE) - target_compile_options(${PROJECT_NAME} PRIVATE ${flag}) - endif() - endforeach() -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/xsimd/all/test_v1_package/conanfile.py b/recipes/xsimd/all/test_v1_package/conanfile.py index 38f4483872d47..71bd246c37e4e 100644 --- a/recipes/xsimd/all/test_v1_package/conanfile.py +++ b/recipes/xsimd/all/test_v1_package/conanfile.py @@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): def build(self): cmake = CMake(self) + cmake.definitions["XSIMD_WITH_XTL"] = self.options["xsimd"].xtl_complex cmake.configure() cmake.build() diff --git a/recipes/xsimd/config.yml b/recipes/xsimd/config.yml index 37e417d6caa91..65384140b0d83 100644 --- a/recipes/xsimd/config.yml +++ b/recipes/xsimd/config.yml @@ -1,4 +1,12 @@ versions: + "12.1.0": + folder: all + "12.0.0": + folder: all + "11.2.0": + folder: all + "11.1.0": + folder: all "11.0.0": folder: all "10.0.0": diff --git a/recipes/xtensor/all/conandata.yml b/recipes/xtensor/all/conandata.yml index 40af805ba9e93..c0af344ba276e 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 9a77cdf6361a6..892b72ea17486 100644 --- a/recipes/xtensor/all/conanfile.py +++ b/recipes/xtensor/all/conanfile.py @@ -12,6 +12,7 @@ class XtensorConan(ConanFile): name = "xtensor" + package_type = "header-library" description = "C++ tensors with broadcasting and lazy computing" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" @@ -51,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 785004e7c86cd..0000000000000 --- 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 b7c9e2acdedf0..0000000000000 --- 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 0077748f19ef0..f1891e507a429 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/xtl/all/conandata.yml b/recipes/xtl/all/conandata.yml index 826f7d639e616..de42ad34f303f 100644 --- a/recipes/xtl/all/conandata.yml +++ b/recipes/xtl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.6": + url: "https://github.com/xtensor-stack/xtl/archive/0.7.6.tar.gz" + sha256: "dda442dc81f390f77561913062471c39b6ef19ffc6f64d3cd12b5c4b4607c957" "0.7.5": url: "https://github.com/xtensor-stack/xtl/archive/0.7.5.tar.gz" sha256: "3286fef5fee5d58f82f7b91375cd449c819848584bae9367893501114d923cbe" diff --git a/recipes/xtl/config.yml b/recipes/xtl/config.yml index eb054d979da83..59f6a1275ac35 100644 --- a/recipes/xtl/config.yml +++ b/recipes/xtl/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.6": + folder: all "0.7.5": folder: all "0.7.4": diff --git a/recipes/xtr/all/conandata.yml b/recipes/xtr/all/conandata.yml index 73147ae073149..c4c7a036934fc 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 066b0d5ac74d1..ecc6dca2fd252 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 a0b4d68deb6b4..06fb02fd0ae83 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 7ce90e1beb92a..3e018a810c976 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 20824a4afbb4d..50595ee5e4913 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/xxsds-sdsl-lite/all/conandata.yml b/recipes/xxsds-sdsl-lite/all/conandata.yml index b6d6545a3fc79..f215951543959 100644 --- a/recipes/xxsds-sdsl-lite/all/conandata.yml +++ b/recipes/xxsds-sdsl-lite/all/conandata.yml @@ -8,11 +8,7 @@ sources: patches: cci.20210329: - patch_file: patches/bits.hpp.patch - base_path: source_subfolder - patch_file: patches/util.hpp.patch - base_path: source_subfolder 3.0.0: - patch_file: patches/bits.hpp.patch - base_path: source_subfolder - patch_file: patches/util.hpp.patch - base_path: source_subfolder diff --git a/recipes/xxsds-sdsl-lite/all/conanfile.py b/recipes/xxsds-sdsl-lite/all/conanfile.py index de8842c0e754e..1b6126a2f3e15 100644 --- a/recipes/xxsds-sdsl-lite/all/conanfile.py +++ b/recipes/xxsds-sdsl-lite/all/conanfile.py @@ -1,46 +1,65 @@ import os -from conans import ConanFile, tools -required_conan_version = ">=1.33.0" +from conan import ConanFile +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 +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.52.0" + class XXSDSSDSLLite(ConanFile): name = "xxsds-sdsl-lite" description = "SDSL - Succinct Data Structure Library" - homepage = "https://github.com/xxsds/sdsl-lite" - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" - topics = ("conan", "sdsl", "succint", "data-structures") - settings = "compiler" - exports_sources = "patches/*" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xxsds/sdsl-lite" + topics = ("sdsl", "succint", "data-structures", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True provides = "sdsl-lite" - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) + + 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, 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 build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) def package(self): - self.copy("*.hpp", dst="include", - src=os.path.join(self._source_subfolder, "include")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) def package_info(self): - if self.settings.compiler == "Visual Studio": + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "sdsl-lite") + self.cpp_info.set_property("cmake_target_name", "sdsl-lite::sdsl-lite") + self.cpp_info.set_property("pkg_config_name", "sdsl-lite") + + if is_msvc(self): self.cpp_info.defines.append("MSVC_COMPILER") - self.cpp_info.names["pkgconfig"] = "sdsl-lite" + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "sdsl-lite" self.cpp_info.names["cmake_find_package_multi"] = "sdsl-lite" diff --git a/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt b/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt index 18fda057023dc..6b3bf7b3cbccb 100644 --- a/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt +++ b/recipes/xxsds-sdsl-lite/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(sdsl-lite CONFIG REQUIRED) diff --git a/recipes/xxsds-sdsl-lite/all/test_package/conanfile.py b/recipes/xxsds-sdsl-lite/all/test_package/conanfile.py index 75634e62bcb66..fae501d0afb9e 100644 --- a/recipes/xxsds-sdsl-lite/all/test_package/conanfile.py +++ b/recipes/xxsds-sdsl-lite/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" + 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/xxsds-sdsl-lite/all/test_v1_package/CMakeLists.txt b/recipes/xxsds-sdsl-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/xxsds-sdsl-lite/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/xxsds-sdsl-lite/all/test_v1_package/conanfile.py b/recipes/xxsds-sdsl-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..75634e62bcb66 --- /dev/null +++ b/recipes/xxsds-sdsl-lite/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/xz_utils/all/conandata.yml b/recipes/xz_utils/all/conandata.yml index da0e232cb7e1a..09ca27188fcd2 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 326a90e52c837..d950dab72f7d0 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 4c35bd089113e..49364fbee5eed 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 20d4d2e28d57e..22642ac137bfa 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 21b18ea006ef3..423a49f097b2a 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 ba0bf3ca1a52e..0ce7fb086eb0d 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 0000000000000..3ef6d80c27339 --- /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 59546f980c76e..542de368538ce 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 1b66ae0cdf060..29c95c5649acc 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 1872344e829cb..293d6d71bbc1c 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 ecd70890a4473..3ad5266d60fe2 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 721b757b4db38..4d72913a6563c 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 109eee16dc1f2..4da522edd42b6 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 3b7c3844b7820..c6f6cbeee93dc 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 a614ddb69f634..8d52b7021efe1 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 0000000000000..91630d79f4abb --- /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 0000000000000..a614ddb69f634 --- /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 c03d35124053d..351234e35c85a 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 8cfe2a15884cf..4b089cd3a4efe 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 641059df6fa46..31c7068ad2a4f 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 bd7165a553cf4..ef5d7042163ec 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 0000000000000..91630d79f4abb --- /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 0000000000000..7e2dfe859bb27 --- /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 d027f053ed062..ffe23774e69d2 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 0000000000000..17011be7f593d --- /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 0000000000000..e8249b9860f59 --- /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 0000000000000..d3a76211634ca --- /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 0000000000000..4c709290f183b --- /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 0000000000000..02eb5ce439fb4 --- /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 0000000000000..ce6ef4ea1d25e --- /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 0000000000000..184166496d26e --- /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 683231e89f238..ad21b483cb840 100644 --- a/recipes/yyjson/all/conandata.yml +++ b/recipes/yyjson/all/conandata.yml @@ -1,4 +1,10 @@ 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" "0.6.0": url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.6.0.tar.gz" sha256: "75aa65d2944b3f64ce5918aa3da00f738dc695a0e8e0662de0063aafe1a8662f" diff --git a/recipes/yyjson/all/conanfile.py b/recipes/yyjson/all/conanfile.py index 5fd04cf964be2..3574d26b2c7d5 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" @@ -12,21 +13,25 @@ class YyjsonConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ibireme/yyjson" - topics = ("yyjson", "json", "serialization", "deserialization") - + topics = ("json", "serialization", "deserialization") + package_type = "library" settings = "os", "arch", "compiler", "build_type" 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: @@ -38,11 +43,12 @@ 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) + 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 c1abc92e2b1b8..f84f2efec202b 100644 --- a/recipes/yyjson/config.yml +++ b/recipes/yyjson/config.yml @@ -1,4 +1,8 @@ versions: + "0.8.0": + folder: all + "0.7.0": + folder: all "0.6.0": folder: all "0.5.1": diff --git a/recipes/z3/all/CMakeLists.txt b/recipes/z3/all/CMakeLists.txt deleted file mode 100644 index 9304b61295329..0000000000000 --- a/recipes/z3/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 KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/z3/all/conandata.yml b/recipes/z3/all/conandata.yml index 5f25ce5da1c6e..f57877f85f54a 100644 --- a/recipes/z3/all/conandata.yml +++ b/recipes/z3/all/conandata.yml @@ -1,30 +1,19 @@ sources: - "4.8.8": - url: "https://github.com/Z3Prover/z3/archive/z3-4.8.8.tar.gz" - sha256: "6962facdcdea287c5eeb1583debe33ee23043144d0e5308344e6a8ee4503bcff" + "4.12.4": + url: "https://github.com/Z3Prover/z3/archive/z3-4.12.4.tar.gz" + sha256: "25e9b18d04ee22f1d872dfe0daaf4c39034744525214e34fedd206e25140e96e" + "4.12.2": + url: "https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.12.2.tar.gz" + sha256: "9f58f3710bd2094085951a75791550f547903d75fe7e2fcb373c5f03fc761b8f" + "4.12.1": + url: "https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.12.1.tar.gz" + sha256: "a3735fabf00e1341adcc70394993c05fd3e2ae167a3e9bb46045e33084eb64a3" + "4.11.2": + url: "https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.11.2.tar.gz" + sha256: "e3a82431b95412408a9c994466fad7252135c8ed3f719c986cd75c8c5f234c7e" "4.10.2": - url: "https://github.com/Z3Prover/z3/archive/z3-4.10.2.tar.gz" + url: "https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.10.2.tar.gz" sha256: "889fd035b833775c8cd2eb4723eb011bf916a3e9bf08ce66b31c548acee7a321" - -patches: - "4.8.8": - - patch_file: "patches/0001-cmake-use-conan-mpir-4.8.8.patch" - patch_description: "Support building with MPIR" - patch_type: "conan" - base_path: "source_subfolder" - - - patch_file: "patches/0002-python-interp-3-4.8.8.patch" - patch_description: "Fix finding the Python interpreter" - patch_type: "backport" - base_path: "source_subfolder" - - "4.10.2": - - patch_file: "patches/0001-cmake-use-conan-mpir-4.10.2.patch" - patch_description: "Support building with MPIR" - patch_type: "conan" - base_path: "source_subfolder" - - - patch_file: "patches/0003-cmake-try-compile-flags-4.10.2.patch" - patch_description: "Fix flag transmission to CMake try_compile" - patch_type: "portability" - base_path: "source_subfolder" + "4.9.1": + url: "https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.9.1.tar.gz" + sha256: "ca08ba933481242507b2f8b303c3ebdf5d16b0005d397fb45018321dc639a0d7" diff --git a/recipes/z3/all/conanfile.py b/recipes/z3/all/conanfile.py index 1fa41bab49793..6d143a07d34f6 100644 --- a/recipes/z3/all/conanfile.py +++ b/recipes/z3/all/conanfile.py @@ -1,11 +1,14 @@ -from conans import CMake, ConanFile, tools -from conan.tools.files import apply_conandata_patches, get, rmdir -from conan.tools.scm import Version -from conan.errors import ConanException, ConanInvalidConfiguration import os -import textwrap -required_conan_version = ">=1.50.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.env import VirtualBuildEnv +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class Z3Conan(ConanFile): @@ -16,35 +19,36 @@ class Z3Conan(ConanFile): homepage = "https://github.com/Z3Prover/z3" license = "MIT" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "multithreaded": [True, False], - "multiprecision": ["internal", "gmp", "mpir"] + "use_gmp": [True, False] } default_options = { "shared": False, "fPIC": True, "multithreaded": True, - "multiprecision": "gmp" + "use_gmp": False } - generators = "cmake" - _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 export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + def _compilers_minimum_version(self): + # Z3 requires C++17, and it is recommended to use VS2019 or later + # Compiling z3 with GCC 7 results in a segfault + return { + "gcc": "8", + "clang": "5", + "apple-clang": "9", + "msvc": "192", + "Visual Studio": "16", + } def config_options(self): if self.settings.os == "Windows": @@ -52,78 +56,63 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - if self.options.multiprecision == "internal": - self.provides.append("gmp") - - def requirements(self): - self.output.info( - f"{self.name} will build using {self.options.multiprecision} multiprecision implementation.") - if self.options.multiprecision == "mpir": - self.requires("mpir/3.0.0") - elif self.options.multiprecision == "gmp": - self.requires("gmp/6.2.1") - elif self.options.multiprecision == "internal": - pass + self.options.rm_safe("fPIC") - def source(self): - get(self, **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["Z3_USE_LIB_GMP"] = self.options.multiprecision != "internal" - self._cmake.definitions["Z3_USE_LIB_MPIR"] = self.options.multiprecision == "mpir" - self._cmake.definitions["SINGLE_THREADED"] = not self.options.multithreaded - self._cmake.definitions["Z3_BUILD_LIBZ3_SHARED"] = self.options.shared - self._cmake.definitions["Z3_INCLUDE_GIT_HASH"] = False - self._cmake.definitions["Z3_INCLUDE_GIT_DESCRIBE"] = False - self._cmake.definitions["Z3_ENABLE_EXAMPLE_TARGETS"] = False - self._cmake.definitions["Z3_BUILD_DOCUMENTATION"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def layout(self): + cmake_layout(self, src_folder="src") - @property - def _compilers_minimum_version(self): - return { - "gcc": "7", - "Visual Studio": "15.7", - "clang": "5", - "apple-clang": "10", - } + def requirements(self): + if self.options.use_gmp: + self.requires("gmp/6.3.0") def validate(self): - if Version(self.version) >= "4.8.11": - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") - compiler = self.settings.compiler - min_version = self._compilers_minimum_version\ - .get(str(compiler), False) - if min_version: - if Version(compiler.version) < min_version: - raise ConanInvalidConfiguration( - f"{self.name} requires C++17, which {compiler} {compiler.version} does not support.") - else: - self.output.info( - f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - def build(self): - apply_conandata_patches(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 build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") - if self.options.multiprecision == "mpir": - tools.save(os.path.join(self._build_subfolder, "gmp.h"), textwrap.dedent("""\ - #pragma once - #include - """)) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + + tc = CMakeToolchain(self) + tc.variables["Z3_USE_LIB_GMP"] = self.options.use_gmp + tc.variables["Z3_SINGLE_THREADED"] = not self.options.multithreaded + tc.variables["Z3_BUILD_LIBZ3_SHARED"] = self.options.shared + tc.variables["Z3_INCLUDE_GIT_HASH"] = False + tc.variables["Z3_INCLUDE_GIT_DESCRIBE"] = False + tc.variables["Z3_ENABLE_EXAMPLE_TARGETS"] = False + tc.variables["Z3_BUILD_DOCUMENTATION"] = False + # Set the flag `stdlib` for Clang on Linux to fix the linker errors + if self.settings.os == "Linux" and self.settings.compiler == "clang": + # Possible values: `libc++`, `libstdc++11` and `libstdc++` + stdlib = f" -stdlib={self.settings.compiler.libcxx}".rstrip("1") + tc.variables["CMAKE_CXX_FLAGS"] = tc.variables.get("CMAKE_CXX_FLAGS", "") + stdlib + tc.generate() + + deps = CMakeDeps(self) + # Override the target name of the GMP library provided by Conan Center + deps.set_property("gmp", "cmake_target_name", "GMP::GMP") + deps.generate() - cmake = self._configure_cmake() + def build(self): + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", os.path.join(self.source_folder), 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")) @@ -133,12 +122,10 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "z3::libz3") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["libz3"].libs = [ - "libz3" if self.settings.os == "Windows" else "z3"] - if not self.options.shared: - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["libz3"]\ - .system_libs.extend(["pthread", "m"]) + self.cpp_info.components["libz3"].libs = ["libz3" if self.settings.os == "Windows" else "z3"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libz3"].system_libs.extend(["pthread", "m"]) + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "Z3" self.cpp_info.filenames["cmake_find_package_multi"] = "Z3" @@ -146,14 +133,5 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "z3" self.cpp_info.components["libz3"].names["cmake_find_package"] = "libz3" self.cpp_info.components["libz3"].names["cmake_find_package_multi"] = "libz3" - self.cpp_info.components["libz3"].set_property( - "cmake_target_name", "z3::libz3") - - libz3_requirements = [] - if self.options.multiprecision == "mpir": - libz3_requirements.append("mpir::mpir") - elif self.options.multiprecision == "gmp": - libz3_requirements.append("gmp::gmp") - elif self.options.multiprecision == "internal": - pass - self.cpp_info.components["libz3"].requires = libz3_requirements + self.cpp_info.components["libz3"].set_property("cmake_target_name", "z3::libz3") + self.cpp_info.components["libz3"].requires = ["gmp::gmp"] if self.options.use_gmp else [] diff --git a/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.10.2.patch b/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.10.2.patch deleted file mode 100644 index c510cb76b177f..0000000000000 --- a/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.10.2.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -242,10 +242,16 @@ - if (Z3_USE_LIB_GMP) - # Because this is off by default we will make the configure fail if libgmp - # can't be found -- find_package(GMP REQUIRED) -- message(STATUS "Using libgmp") -- list(APPEND Z3_DEPENDENT_LIBS GMP::GMP) -+ if (Z3_USE_LIB_MPIR) -+ message(STATUS "Using libmpir") -+ list(APPEND Z3_DEPENDENT_LIBS CONAN_PKG::mpir) -+ else() -+ message(STATUS "Using libgmp") -+ find_package(GMP REQUIRED) -+ list(APPEND Z3_DEPENDENT_LIBS GMP::GMP) -+ endif() -+ list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS "${CMAKE_BINARY_DIR}" ${CONAN_INCLUDE_DIRS}) - list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_MP_GMP") - else() - list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_MP_INTERNAL") - message(STATUS "Not using libgmp") diff --git a/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.8.8.patch b/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.8.8.patch deleted file mode 100644 index d7ee939df7e2f..0000000000000 --- a/recipes/z3/all/patches/0001-cmake-use-conan-mpir-4.8.8.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -246,10 +246,16 @@ - if (Z3_USE_LIB_GMP) - # Because this is off by default we will make the configure fail if libgmp - # can't be found -- find_package(GMP REQUIRED) -- message(STATUS "Using libgmp") -- list(APPEND Z3_DEPENDENT_LIBS ${GMP_C_LIBRARIES}) -- list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS ${GMP_INCLUDE_DIRS}) -+ if (Z3_USE_LIB_MPIR) -+ message(STATUS "Using libmpir") -+ list(APPEND Z3_DEPENDENT_LIBS CONAN_PKG::mpir) -+ else() -+ message(STATUS "Using libgmp") -+ find_package(GMP REQUIRED) -+ list(APPEND Z3_DEPENDENT_LIBS ${GMP_C_LIBRARIES}) -+ list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS ${GMP_INCLUDE_DIRS}) -+ endif() -+ list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS "${CMAKE_BINARY_DIR}" ${CONAN_INCLUDE_DIRS}) - list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_MP_GMP") - else() - list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_MP_INTERNAL") diff --git a/recipes/z3/all/patches/0002-python-interp-3-4.8.8.patch b/recipes/z3/all/patches/0002-python-interp-3-4.8.8.patch deleted file mode 100644 index 5f497703b3de0..0000000000000 --- a/recipes/z3/all/patches/0002-python-interp-3-4.8.8.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -169,7 +169,7 @@ - ################################################################################ - # Find Python - ################################################################################ --find_package(PythonInterp REQUIRED) -+find_package(PythonInterp 3 REQUIRED) - message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") - - ################################################################################ diff --git a/recipes/z3/all/patches/0003-cmake-try-compile-flags-4.10.2.patch b/recipes/z3/all/patches/0003-cmake-try-compile-flags-4.10.2.patch deleted file mode 100644 index 0a19de4afbb27..0000000000000 --- a/recipes/z3/all/patches/0003-cmake-try-compile-flags-4.10.2.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -1,2 +1,2 @@ - # Enforce some CMake policies --cmake_minimum_required(VERSION 3.4) -+cmake_minimum_required(VERSION 3.8) -@@ -179,9 +179,10 @@ - ################################################################################ - # C++ language version - ################################################################################ - set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) -+cmake_policy(SET CMP0067 NEW) # ensures try_compile uses the same standard - - ################################################################################ - # Platform detection - ################################################################################ diff --git a/recipes/z3/all/test_package/CMakeLists.txt b/recipes/z3/all/test_package/CMakeLists.txt index 04cd4a68ceb59..22ff0aeb773f3 100644 --- a/recipes/z3/all/test_package/CMakeLists.txt +++ b/recipes/z3/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(Z3 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE z3::libz3) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/z3/all/test_package/conanfile.py b/recipes/z3/all/test_package/conanfile.py index 38f4483872d47..a9fb96656f203 100644 --- a/recipes/z3/all/test_package/conanfile.py +++ b/recipes/z3/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/z3/all/test_package/test_package.cpp b/recipes/z3/all/test_package/test_package.cpp index 952704555d235..4e91c96764a96 100644 --- a/recipes/z3/all/test_package/test_package.cpp +++ b/recipes/z3/all/test_package/test_package.cpp @@ -141,5 +141,6 @@ void demorgan() int main() { simple_example(); - demorgan(); + // Z3 v4.11.2: Trigger a page fault when compiled with and Clang in release mode + // demorgan(); } diff --git a/recipes/z3/all/test_v1_package/CMakeLists.txt b/recipes/z3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/z3/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/z3/all/test_v1_package/conanfile.py b/recipes/z3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/z3/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/z3/config.yml b/recipes/z3/config.yml index 186c923c3a5de..3fad1114f7caf 100644 --- a/recipes/z3/config.yml +++ b/recipes/z3/config.yml @@ -1,5 +1,13 @@ versions: - "4.8.8": + "4.12.4": + folder: "all" + "4.12.2": + folder: "all" + "4.12.1": + folder: "all" + "4.11.2": folder: "all" "4.10.2": folder: "all" + "4.9.1": + folder: "all" diff --git a/recipes/zbar/all/conanfile.py b/recipes/zbar/all/conanfile.py index 3611c54ea21e1..277b16ca05ae4 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 099a8577c05d9..7060e3ef64de2 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 d7a259f237734..24e21533e207e 100644 --- a/recipes/zeromq/all/conanfile.py +++ b/recipes/zeromq/all/conanfile.py @@ -12,17 +12,17 @@ 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], "fPIC": [True, False], - "encryption": [None, "libsodium", "tweetnacl"], + "encryption": [False, "libsodium", "tweetnacl"], "with_norm": [True, False], "poller": [None, "kqueue", "epoll", "devpoll", "pollset", "poll", "select"], "with_draft_api": [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 0000000000000..05cc02222a9e2 --- /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 218db624c1eea..492566041769b 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/zfp/all/conandata.yml b/recipes/zfp/all/conandata.yml index 308872a236805..626b44e46becd 100644 --- a/recipes/zfp/all/conandata.yml +++ b/recipes/zfp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.1": + url: "https://github.com/LLNL/zfp/archive/1.0.1.tar.gz" + sha256: "4984db6a55bc919831966dd17ba5e47ca7ac58668f4fd278ebd98cd2200da66f" "1.0.0": url: "https://github.com/LLNL/zfp/releases/download/1.0.0/zfp-1.0.0.tar.gz" sha256: "0ea08ae3e50e3c92f8b8cf41ba5b6e2de8892bc4a4ca0c59b8945b6c2ab617c4" diff --git a/recipes/zfp/config.yml b/recipes/zfp/config.yml index 3e7309cad846c..ca1f6c2b3ad6d 100644 --- a/recipes/zfp/config.yml +++ b/recipes/zfp/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.1": + folder: all "1.0.0": folder: all "0.5.5": diff --git a/recipes/zimg/all/conandata.yml b/recipes/zimg/all/conandata.yml index 6f58da26deae3..808d05daf7b4d 100644 --- a/recipes/zimg/all/conandata.yml +++ b/recipes/zimg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.5": + url: "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.5.tar.gz" + sha256: "a9a0226bf85e0d83c41a8ebe4e3e690e1348682f6a2a7838f1b8cbff1b799bcf" "3.0.4": url: "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.4.tar.gz" sha256: "219d1bc6b7fde1355d72c9b406ebd730a4aed9c21da779660f0a4c851243e32f" @@ -15,6 +18,9 @@ sources: url: "https://github.com/sekrit-twc/zimg/archive/release-2.9.3.tar.gz" sha256: "a15c0483fbe945ffe695a1a989bc43b3381c8bf33e2d1760464ec21d32cdf30b" patches: + "3.0.5": + - patch_file: "patches/0001-msvc-remove-windows-target-platform.patch" + - patch_file: "patches/0002-msvc-solution.patch" "3.0.4": - patch_file: "patches/0001-msvc-remove-windows-target-platform.patch" - patch_file: "patches/0002-msvc-solution.patch" diff --git a/recipes/zimg/all/conanfile.py b/recipes/zimg/all/conanfile.py index 6332a7e16ebe2..48a20f5432af3 100644 --- a/recipes/zimg/all/conanfile.py +++ b/recipes/zimg/all/conanfile.py @@ -6,6 +6,7 @@ from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import check_min_vs, is_msvc, MSBuild, MSBuildToolchain +from conan.tools.scm import Version import os required_conan_version = ">=1.54.0" @@ -14,11 +15,11 @@ class ZimgConan(ConanFile): name = "zimg" description = "Scaling, colorspace conversion, and dithering library" - topics = ("image", "manipulation") - homepage = "https://github.com/sekrit-twc/zimg" - url = "https://github.com/conan-io/conan-center-index" license = "WTFPL" - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sekrit-twc/zimg" + topics = ("image", "manipulation") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -94,11 +95,18 @@ def build(self): platform_toolset = MSBuildToolchain(self).toolset conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) for vcxproj_file in vcxproj_files: - replace_in_file( - self, vcxproj_file, - "v142", - f"{platform_toolset}", - ) + if Version(self.version) >= "3.0.5": + replace_in_file( + self, vcxproj_file, + "v143", + f"{platform_toolset}", + ) + else: + replace_in_file( + self, vcxproj_file, + "v142", + f"{platform_toolset}", + ) replace_in_file( self, vcxproj_file, "", diff --git a/recipes/zimg/config.yml b/recipes/zimg/config.yml index b142332a0fe4c..4841523950979 100644 --- a/recipes/zimg/config.yml +++ b/recipes/zimg/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.5": + folder: "all" "3.0.4": folder: "all" "3.0.3": diff --git a/recipes/zint/all/conanfile.py b/recipes/zint/all/conanfile.py index 61596c6c982a7..f9c54ff2b86cf 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 14bd143a5e4a6..d4ac6daa22c07 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 1617e37109bc2..9523fb1ef2b63 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 d155f1e77d4aa..c23ed5cfe6d98 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 1ce37b6a52e77..723b5e4a6fa80 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 81a85da093ebb..c46c2b8a3621f 100644 --- a/recipes/zlib-ng/all/conandata.yml +++ b/recipes/zlib-ng/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "2.1.6": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.6.tar.gz" + sha256: "a5d504c0d52e2e2721e7e7d86988dec2e290d723ced2307145dedd06aeb6fef2" + "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" + "2.1.2": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.2.tar.gz" + sha256: "383560d6b00697c04e8878e26c0187b480971a8bce90ffd26a5a7b0f7ecf1a33" "2.0.7": url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.tar.gz" sha256: "6c0853bb27738b811f2b4d4af095323c3d5ce36ceed6b50e5f773204fb8f7200" diff --git a/recipes/zlib-ng/all/conanfile.py b/recipes/zlib-ng/all/conanfile.py index 810ef7d7bdec6..853a0a0f6a309 100644 --- a/recipes/zlib-ng/all/conanfile.py +++ b/recipes/zlib-ng/all/conanfile.py @@ -27,20 +27,24 @@ class ZlibNgConan(ConanFile): "with_optim": [True, False], "with_new_strategies": [True, False], "with_native_instructions": [True, False], + "with_reduced_mem": [True, False], } default_options = { "shared": False, "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, } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "2.1.0": + del self.options.with_reduced_mem def configure(self): if self.options.shared: @@ -61,11 +65,15 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["ZLIB_ENABLE_TESTS"] = False + tc.variables["ZLIBNG_ENABLE_TESTS"] = False + tc.variables["ZLIB_COMPAT"] = self.options.zlib_compat tc.variables["WITH_GZFILEOP"] = self.options.with_gzfileop tc.variables["WITH_OPTIM"] = self.options.with_optim tc.variables["WITH_NEW_STRATEGIES"] = self.options.with_new_strategies tc.variables["WITH_NATIVE_INSTRUCTIONS"] = self.options.with_native_instructions + if Version(self.version) >= "2.1.0": + tc.variables["WITH_REDUCED_MEM"] = self.options.with_reduced_mem tc.generate() def build(self): diff --git a/recipes/zlib-ng/config.yml b/recipes/zlib-ng/config.yml index 5e344c7c2810f..2b7d8b2941104 100644 --- a/recipes/zlib-ng/config.yml +++ b/recipes/zlib-ng/config.yml @@ -1,4 +1,14 @@ versions: + "2.1.6": + folder: all + "2.1.5": + folder: all + "2.1.4": + folder: all + "2.1.3": + folder: all + "2.1.2": + folder: all "2.0.7": folder: all "2.0.6": diff --git a/recipes/zlib/all/conandata.yml b/recipes/zlib/all/conandata.yml index 4da75436b4d71..bcebfb9b13b6d 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 3f81a6f53a248..0000000000000 --- 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 56b3fbe76ce8e..3de4978c30661 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 0000000000000..b2aa69d0684cf --- /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 0000000000000..d299f4962fa59 --- /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 351c06f68201f..132003f7c53b5 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 b8b843edf38c8..4bc0fe616e574 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 8d4bf7d455227..a4ed7a7549f25 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 new file mode 100644 index 0000000000000..0487be945d8c9 --- /dev/null +++ b/recipes/zookeeper-client-c/all/conandata.yml @@ -0,0 +1,16 @@ +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://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" + patch_type: "conan" diff --git a/recipes/zookeeper-client-c/all/conanfile.py b/recipes/zookeeper-client-c/all/conanfile.py new file mode 100644 index 0000000000000..ec48f11ba450f --- /dev/null +++ b/recipes/zookeeper-client-c/all/conanfile.py @@ -0,0 +1,94 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class ZookeeperClientCConan(ConanFile): + name = "zookeeper-client-c" + description = "ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://zookeeper.apache.org/" + topics = ("zookeeper", "client") + settings = "os", "arch", "compiler", "build_type" + package_type = "static-library" + options = { + "fPIC": [True, False], + "with_cyrus_sasl": [True, False], + "with_openssl": [True, False], + } + default_options = { + "fPIC": True, + "with_cyrus_sasl": False, + "with_openssl": False, + } + short_paths = 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_cyrus_sasl: + self.requires("cyrus-sasl/2.1.27") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def build_requirements(self): + self.tool_requires("maven/3.9.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WANT_CPPUNIT"] = False + tc.variables["WITH_CYRUS_SASL"] = "ON" if self.options.with_cyrus_sasl else "OFF" + tc.variables["WITH_OPENSSL"] = "ON" if self.options.with_openssl else "OFF" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + bvenv = VirtualBuildEnv(self) + bvenv.generate() + + def build(self): + apply_conandata_patches(self) + + # We have to install maven to generate jute files which are required by zookeeper-client + self.run("mvn compile", cwd=os.path.join(self.source_folder, "zookeeper-jute")) + + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "zookeeper-client", "zookeeper-client-c")) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder, "zookeeper-client", "zookeeper-client-c") + ) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["zookeeper", "hashtable"] + self.cpp_info.defines.append("USE_STATIC_LIB") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["rt", "pthread", "m"]) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["wsock32", "ws2_32", ]) diff --git a/recipes/zookeeper-client-c/all/patches/3.8.1-0001-add-install.patch b/recipes/zookeeper-client-c/all/patches/3.8.1-0001-add-install.patch new file mode 100644 index 0000000000000..fe59dd04ecacb --- /dev/null +++ b/recipes/zookeeper-client-c/all/patches/3.8.1-0001-add-install.patch @@ -0,0 +1,54 @@ +diff --git a/zookeeper-client/zookeeper-client-c/CMakeLists.txt b/zookeeper-client/zookeeper-client-c/CMakeLists.txt +index 5d0175e..9349bc0 100644 +--- a/zookeeper-client/zookeeper-client-c/CMakeLists.txt ++++ b/zookeeper-client/zookeeper-client-c/CMakeLists.txt +@@ -228,16 +228,6 @@ if(CYRUS_SASL_FOUND) + target_link_libraries(zookeeper PUBLIC CyrusSASL) + endif() + +-# cli executable +-add_executable(cli src/cli.c) +-target_link_libraries(cli zookeeper) +- +-# load_gen executable +-if(WANT_SYNCAPI AND NOT WIN32) +- add_executable(load_gen src/load_gen.c) +- target_link_libraries(load_gen zookeeper) +-endif() +- + # tests + set(test_sources + tests/TestDriver.cc +@@ -290,3 +280,32 @@ if(WANT_CPPUNIT) + "ZKROOT=${CMAKE_CURRENT_SOURCE_DIR}/../.." + "CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar") + endif() ++ ++include(GNUInstallDirs) ++ ++install( ++ TARGETS zookeeper ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ ++install( ++ TARGETS hashtable ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ ++install(FILES ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/proto.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/recordio.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/win_getopt.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/winconfig.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/zookeeper.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/zookeeper_log.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/zookeeper_version.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/generated/zookeeper.jute.h ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt b/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..614f9306973ce --- /dev/null +++ b/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +find_package(zookeeper-client-c REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE zookeeper-client-c::zookeeper-client-c) diff --git a/recipes/zookeeper-client-c/all/test_package/conanfile.py b/recipes/zookeeper-client-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/zookeeper-client-c/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/zookeeper-client-c/all/test_package/test_package.c b/recipes/zookeeper-client-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..d3ce6ffa2d6b7 --- /dev/null +++ b/recipes/zookeeper-client-c/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include "zookeeper_log.h" + +int main(void) { + zookeeper_close(0); + + return 0; +} diff --git a/recipes/zookeeper-client-c/config.yml b/recipes/zookeeper-client-c/config.yml new file mode 100644 index 0000000000000..31b8685d6b74a --- /dev/null +++ b/recipes/zookeeper-client-c/config.yml @@ -0,0 +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 1f0b88e512435..35dd2870f9a77 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 0d2662cb23a48..0d20897301b68 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 10471fdb07486..21dad3174e487 100644 --- a/recipes/zpp_bits/all/conandata.yml +++ b/recipes/zpp_bits/all/conandata.yml @@ -1,4 +1,16 @@ 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" "4.4.13": url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.13.tar.gz" sha256: "817be8218f1ef6ad66f2c18154d16a9577d0f939a29c76cb95c71f7f24c53fe1" diff --git a/recipes/zpp_bits/all/conanfile.py b/recipes/zpp_bits/all/conanfile.py index 4127bf8c567e7..6b48c8af049c7 100644 --- a/recipes/zpp_bits/all/conanfile.py +++ b/recipes/zpp_bits/all/conanfile.py @@ -16,6 +16,7 @@ class ZppBitsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/eyalz800/zpp_bits" topics = ("serialization", "rpc", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/zpp_bits/config.yml b/recipes/zpp_bits/config.yml index d7d24328031e4..4b6dc9c688350 100644 --- a/recipes/zpp_bits/config.yml +++ b/recipes/zpp_bits/config.yml @@ -1,4 +1,12 @@ versions: + "4.4.20": + folder: all + "4.4.19": + folder: all + "4.4.18": + folder: all + "4.4.17": + folder: all "4.4.13": folder: all "4.4.12": diff --git a/recipes/zpp_throwing/all/conandata.yml b/recipes/zpp_throwing/all/conandata.yml index 063b5be845f31..118abd17e3a22 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 6cfaa18e3dd02..7fb36897fcbae 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 edab1ee152d36..7b06dd8bf61ea 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/zserio/all/conandata.yml b/recipes/zserio/all/conandata.yml new file mode 100644 index 0000000000000..9a65ed8b0e67c --- /dev/null +++ b/recipes/zserio/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "2.13.0": + runtime: + url: "https://github.com/ndsev/zserio/releases/download/v2.13.0/zserio-2.13.0-runtime-libs.zip" + sha256: "a720bd3208190f44b232296c11f1a3880154431f2f005e7db8f07ab01c9d235d" + compiler: + url: "https://github.com/ndsev/zserio/releases/download/v2.13.0/zserio-2.13.0-bin.zip" + sha256: "be5cf2a08aa91adac034f12609ea0a697d9f3ef7a00c1c38e6b997f9455dacd4" + license: + url: "https://raw.githubusercontent.com/ndsev/zserio/v2.13.0/LICENSE" + sha256: "7049b75154737fd45754917ba3d1027ad0b00beac15cb8931edaee4de40978ac" diff --git a/recipes/zserio/all/conanfile.py b/recipes/zserio/all/conanfile.py new file mode 100644 index 0000000000000..2ab5a23336294 --- /dev/null +++ b/recipes/zserio/all/conanfile.py @@ -0,0 +1,99 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, download, get +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + +required_conan_version = ">=1.54.0" + +class ZserioConanFile(ConanFile): + name = "zserio" + description = "Zserio C++ Runtime Library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index/" + homepage = "https://zserio.org" + topics = ("zserio", "cpp", "c++", "serialization") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + short_paths = True # TODO: remove in conan v2 + options = { + "fPIC": [True, False] + } + default_options = { + "fPIC": True + } + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + copy(self, "zserio_compiler.cmake", self.recipe_folder, self.export_sources_folder) + + 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.os not in ["Linux", "Windows", "Macos"]: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support '{self.settings.os}'.") + + # experimental Macos support + if self.settings.os == "Macos": + self.output.warning("Macos is support is experimental! It's not (yet) supported by the upstream!") + + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + sources = self.conan_data["sources"][self.version] + get(self, **sources["runtime"], strip_root=True) + download(self, filename="LICENSE", **sources["license"]) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder="cpp") + cmake.build() + sources = self.conan_data["sources"][self.version] + get(self, **sources["compiler"], pattern="zserio.jar") + + @property + def _cmake_module_path(self): + return os.path.join("lib", "cmake", "zserio") + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + + include_dir = os.path.join(self.package_folder, "include") + lib_dir = os.path.join(self.package_folder, "lib") + copy(self, "*.h", os.path.join(self.source_folder, "cpp"), include_dir) + copy(self, "*.lib", self.build_folder, lib_dir, keep_path=False) + copy(self, "*.a", self.build_folder, lib_dir, keep_path=False) + + copy(self, "zserio.jar", self.build_folder, os.path.join(self.package_folder, "bin")) + copy(self, "zserio_compiler.cmake", self.export_sources_folder, + os.path.join(self.package_folder, self._cmake_module_path)) + + def package_info(self): + self.cpp_info.libs = ["ZserioCppRuntime"] + self.cpp_info.set_property("cmake_target_name", "zserio::ZserioCppRuntime") + + zserio_jar_file = os.path.join(self.package_folder, "bin", "zserio.jar") + self.buildenv_info.define("ZSERIO_JAR_FILE", zserio_jar_file) + + self.cpp_info.builddirs.append(self._cmake_module_path) + zserio_compiler_module = os.path.join(self.package_folder, self._cmake_module_path, + "zserio_compiler.cmake") + self.cpp_info.set_property("cmake_build_modules", [zserio_compiler_module]) + + # TODO: remove in conan v2 + self.env_info.ZSERIO_JAR_FILE = zserio_jar_file diff --git a/recipes/zserio/all/test_package/CMakeLists.txt b/recipes/zserio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e3ab3ca5ca033 --- /dev/null +++ b/recipes/zserio/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(zserio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zserio::ZserioCppRuntime) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +# check that ZSERIO_JAR_FILE exists +if (NOT DEFINED ENV{ZSERIO_JAR_FILE}) + message(FATAL_ERROR "ZSERIO_JAR_FILE in not defined!") +endif () +if (NOT EXISTS $ENV{ZSERIO_JAR_FILE}) + message(FATAL_ERROR "ZSERIO_JAR_FILE '$ENV{ZSERIO_JAR_FILE}' does not exist!") +endif () +# check that zserio_generate_cpp function is available +if (NOT COMMAND zserio_generate_cpp) + message(FATAL_ERROR("Function 'zserio_generate_cpp' is not available!")) +endif () diff --git a/recipes/zserio/all/test_package/conanfile.py b/recipes/zserio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..174d5cb36b6e7 --- /dev/null +++ b/recipes/zserio/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + +class ZserioTestPackageConanFile(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv", "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/zserio/all/test_package/test_package.cpp b/recipes/zserio/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b1416a5ae2ec0 --- /dev/null +++ b/recipes/zserio/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main(int argc, char* argv[]) +{ + zserio::BitBuffer bitBuffer(64); + zserio::BitStreamWriter writer(bitBuffer); + const uint64_t value = UINT64_MAX; + writer.writeBits64(value, 64); + + zserio::BitStreamReader reader(writer.getWriteBuffer(), writer.getBitPosition(), zserio::BitsTag()); + const uint64_t readValue = reader.readBits64(64); + + return value == readValue ? 0 : 1; +} diff --git a/recipes/zserio/all/zserio_compiler.cmake b/recipes/zserio/all/zserio_compiler.cmake new file mode 100644 index 0000000000000..7d82a869042ee --- /dev/null +++ b/recipes/zserio/all/zserio_compiler.cmake @@ -0,0 +1,69 @@ +function(zserio_generate_cpp) + find_program(JAVA java) + if (NOT JAVA) + message(FATAL_ERROR "Could not find java!") + endif() + if (NOT DEFINED ENV{ZSERIO_JAR_FILE} OR NOT EXISTS $ENV{ZSERIO_JAR_FILE}) + message(FATAL_ERROR "Could not fine zserio.jar!") + endif() + + cmake_parse_arguments(ZSERIO_GENERATE + "" + "TARGET;SRC_DIR;MAIN_ZS;GEN_DIR" + "EXTRA_ARGS" + ${ARGN}) + + # check required arguments + foreach (ARG TARGET GEN_DIR) + if (NOT DEFINED ZSERIO_GENERATE_${ARG}) + message(FATAL_ERROR "No value defined for required argument ${ARG}!") + endif () + endforeach () + + # default values + if (NOT DEFINED ZSERIO_GENERATE_SRC_DIR) + set(ZSERIO_GENERATE_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + endif () + if (NOT DEFINED ZSERIO_GENERATE_MAIN_ZS) + # try to get a single main zs + get_target_property(ZS_SOURCES ${ZSERIO_GENERATE_TARGET} SOURCES) + list(FILTER ZS_SOURCES INCLUDE REGEX "\\.zs$") + list(LENGTH ZS_SOURCES ZS_SOURCES_LENGTH) + if (${ZS_SOURCES_LENGTH} EQUAL 1) + list(GET ZS_SOURCES 0 ZSERIO_GENERATE_MAIN_ZS) + message(STATUS "Found main '*.zs' file: '${ZSERIO_GENERATE_MAIN_ZS}'") + else () + message(FATAL_ERROR "Main '*.zs* file not specifid and cannot be detected!") + endif () + endif () + + set(ZSERIO_COMMAND + ${JAVA} -jar $ENV{ZSERIO_JAR_FILE} + -src ${ZSERIO_GENERATE_SRC_DIR} ${ZSERIO_GENERATE_MAIN_ZS} + -cpp ${ZSERIO_GENERATE_GEN_DIR} + ${ZSERIO_GENERATE_EXTRA_ARGS} + ) + + # run the generator during configure phase, zserio has built in support to prevent sources re-generation + # and thus it should't make problems when cmake reconfigure is triggered from another reason + execute_process( + COMMAND ${ZSERIO_COMMAND} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + RESULT_VARIABLE ZSERIO_GENERATE_RESULT) + + if (NOT ${ZSERIO_GENERATE_RESULT} EQUAL 0) + message(FATAL_ERROR "Zserio generator failed!") + endif () + + # ensure cmake reconfigure when zserio sources are changed + file(GLOB_RECURSE ZSERIO_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" + "${ZSERIO_GENERATE_SRC_DIR}/*.zs") + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${ZSERIO_SOURCES} $ENV{ZSERIO_JAR_FILE}) + + file(GLOB_RECURSE GENERATED_SOURCES RELATIVE "${CMAKE_CURRENT_BINARY_DIR}" + "${ZSERIO_GENERATE_GEN_DIR}/*.h" + "${ZSERIO_GENERATE_GEN_DIR}/*.cpp") + + set_source_files_properties(${GENERATED_SOURCES} PROPERTIES GENERATED TRUE) + target_sources(${ZSERIO_GENERATE_TARGET} PRIVATE ${GENERATED_SOURCES}) +endfunction() diff --git a/recipes/zserio/config.yml b/recipes/zserio/config.yml new file mode 100644 index 0000000000000..319f45f887837 --- /dev/null +++ b/recipes/zserio/config.yml @@ -0,0 +1,3 @@ +versions: + "2.13.0": + folder: all diff --git a/recipes/zstd/all/conandata.yml b/recipes/zstd/all/conandata.yml index 01522ab9511c5..0deaf672d11b8 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 0b3e82a7fef9c..5920d50771523 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 0000000000000..ba58a24cceb49 --- /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 6f307ff1c207f..5c69b0e8faebe 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 512be7c200256..97a53cde0de88 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/zug/all/conandata.yml b/recipes/zug/all/conandata.yml index ebe78dab88a5e..eec3bc50f0058 100644 --- a/recipes/zug/all/conandata.yml +++ b/recipes/zug/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.1.1": + url: "https://github.com/arximboldi/zug/archive/refs/tags/v0.1.1.tar.gz" + sha256: "1b9c8f962e40baa6f0c6af35f957444850063d550078a3ebd0227727b8ef193c" "cci.20220125": url: "https://github.com/arximboldi/zug/archive/deb266f4c7c35d325de7eb3d033f06e0809495f2.tar.gz" sha256: "4b36442059899b8570336ff9e2901f62fd58b839c9e3ff5d35497454e2324625" + "0.1.0": + url: "https://github.com/arximboldi/zug/archive/refs/tags/v0.1.0.tar.gz" + sha256: "7d9d57a55399784392ba8fa67fcf246b9f5aec8f002c69e1fe4b5f66657214b8" diff --git a/recipes/zug/all/conanfile.py b/recipes/zug/all/conanfile.py index 6b0b0f5b3f121..c6c9a25ac397e 100644 --- a/recipes/zug/all/conanfile.py +++ b/recipes/zug/all/conanfile.py @@ -1,26 +1,31 @@ import os -from conans import ConanFile, tools + +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 conans.errors import ConanInvalidConfiguration +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class ZugConan(ConanFile): name = "zug" + description = "Transducers for C++ — Clojure style higher order push/pull sequence transformations" license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://sinusoid.es/zug/" - description = "Transducers for C++ — Clojure style higher order push/pull \ - sequence transformations" - topics = ("transducer", "algorithm", "signals") - settings = ("compiler", "arch", "os", "build_type") + topics = ("transducer", "algorithm", "signals", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def source(self): - tools.get( - **self.conan_data["sources"][self.version], - strip_root=True, - destination=self.source_folder - ) + @property + def _min_cppstd(self): + return 14 @property def _compilers_minimum_version(self): @@ -28,30 +33,42 @@ def _compilers_minimum_version(self): "Visual Studio": "15", "gcc": "5", "clang": "3.5", - "apple-clang": "10" + "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.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "14") + check_min_cppstd(self, self._min_cppstd) compiler = str(self.settings.compiler) if compiler not in self._compilers_minimum_version: - self.output.warn("Unknown compiler, assuming it supports at least C++14") + self.output.warning("Unknown compiler, assuming it supports at least C++14") return - version = tools.Version(self.settings.compiler.version) + 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++14") - 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): - self.copy(pattern="LICENSE", dst="licenses", src=self.source_folder) - self.copy(pattern="*.hpp", dst=os.path.join("include", "zug"), src=os.path.join(self.source_folder, "zug")) + 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", "zug"), + src=os.path.join(self.source_folder, "zug")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if is_msvc(self): self.cpp_info.cxxflags = ["/Zc:externConstexpr"] - diff --git a/recipes/zug/all/test_package/CMakeLists.txt b/recipes/zug/all/test_package/CMakeLists.txt index 415cd1f23e3ba..d3e67e2768597 100644 --- a/recipes/zug/all/test_package/CMakeLists.txt +++ b/recipes/zug/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(zug CONFIG REQUIRED) +find_package(zug REQUIRED CONFIG) add_executable(test_package example.cpp) target_link_libraries(test_package zug::zug) diff --git a/recipes/zug/all/test_package/conanfile.py b/recipes/zug/all/test_package/conanfile.py index 34e439b02360c..fae501d0afb9e 100644 --- a/recipes/zug/all/test_package/conanfile.py +++ b/recipes/zug/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 ZugTestConan(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" + 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/zug/all/test_package/example.cpp b/recipes/zug/all/test_package/example.cpp index a9657ec7c452c..eee3087fd4982 100644 --- a/recipes/zug/all/test_package/example.cpp +++ b/recipes/zug/all/test_package/example.cpp @@ -1,8 +1,8 @@ -#include - #include #include +#include + using namespace zug; int main() diff --git a/recipes/zug/all/test_v1_package/CMakeLists.txt b/recipes/zug/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/zug/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/zug/all/test_v1_package/conanfile.py b/recipes/zug/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..34e439b02360c --- /dev/null +++ b/recipes/zug/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class ZugTestConan(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/zug/config.yml b/recipes/zug/config.yml index 9fd2ace3e66a6..f6a5245cc2d90 100644 --- a/recipes/zug/config.yml +++ b/recipes/zug/config.yml @@ -1,3 +1,7 @@ versions: + "0.1.1": + folder: all "cci.20220125": folder: all + "0.1.0": + folder: all diff --git a/recipes/zulu-openjdk/all/conandata.yml b/recipes/zulu-openjdk/all/conandata.yml index 516a7ae7f4098..9e14b09c940cf 100644 --- a/recipes/zulu-openjdk/all/conandata.yml +++ b/recipes/zulu-openjdk/all/conandata.yml @@ -1,24 +1,61 @@ sources: - "11.0.12": + "21.0.1": "Windows": "x86_64": - url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-win_x64.zip" - sha256: "42ae65e75d615a3f06a674978e1fa85fdf078cad94e553fee3e779b2b42bb015" + 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/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz" - sha256: "b8e8a63b79bc312aa90f3558edbea59e71495ef1a9c340e38900dd28a1c579f3" + 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-embedded/bin/zulu11.50.19-ca-jdk11.0.12-linux_aarch64.tar.gz" - sha256: "61254688067454d3ccf0ef25993b5dcab7b56c8129e53b73566c28a8dd4d48fb" + 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/zulu11.50.19-ca-jdk11.0.12-macosx_x64.tar.gz" - sha256: "0b8c8b7cf89c7c55b7e2239b47201d704e8d2170884875b00f3103cf0662d6d7" + 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/zulu11.50.19-ca-jdk11.0.12-macosx_aarch64.tar.gz" - sha256: "e908a0b4c0da08d41c3e19230f819b364ff2e5f1dafd62d2cf991a85a34d3a17" - + 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": + url: "https://cdn.azul.com/zulu/bin/zulu11.64.19-ca-jdk11.0.19-win_x64.zip" + sha256: "19ef5239adddd63b47dd574119eeaacd116376e1a7a2449d013c2d23987c78a0" + "Linux": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.64.19-ca-jdk11.0.19-linux_x64.tar.gz" + sha256: "8b963105ad195c8f622b34dbac663ce11e5f73f4c84edd6dd1d364a26798b540" + "armv8": + url: "https://cdn.azul.com/zulu-embedded/bin/zulu11.64.19-ca-jdk11.0.19-linux_aarch64.tar.gz" + sha256: "edfea52958b765732e4ee97b821e78d6ebf66a69fc21bdf6035c38b0e2939820" + "Macos": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.64.19-ca-jdk11.0.19-macosx_x64.tar.gz" + sha256: "222630bd333f901f53cd0d2341975ec9a31fd6846166d4ce86e8a57a3d734ac5" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu11.64.19-ca-jdk11.0.19-macosx_aarch64.tar.gz" + sha256: "f0d84d5f1ae9d67bbb28d4e97fe365692fcdf8f5ad49c57b525281ebb5807577" "11.0.15": "Windows": "x86_64": @@ -38,3 +75,22 @@ sources: "armv8": url: "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_aarch64.tar.gz" sha256: "6bb0d2c6e8a29dcd9c577bbb2986352ba12481a9549ac2c0bcfd00ed60e538d2" + "11.0.12": + "Windows": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-win_x64.zip" + sha256: "42ae65e75d615a3f06a674978e1fa85fdf078cad94e553fee3e779b2b42bb015" + "Linux": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz" + sha256: "b8e8a63b79bc312aa90f3558edbea59e71495ef1a9c340e38900dd28a1c579f3" + "armv8": + url: "https://cdn.azul.com/zulu-embedded/bin/zulu11.50.19-ca-jdk11.0.12-linux_aarch64.tar.gz" + sha256: "61254688067454d3ccf0ef25993b5dcab7b56c8129e53b73566c28a8dd4d48fb" + "Macos": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-macosx_x64.tar.gz" + sha256: "0b8c8b7cf89c7c55b7e2239b47201d704e8d2170884875b00f3103cf0662d6d7" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-macosx_aarch64.tar.gz" + sha256: "e908a0b4c0da08d41c3e19230f819b364ff2e5f1dafd62d2cf991a85a34d3a17" diff --git a/recipes/zulu-openjdk/all/conanfile.py b/recipes/zulu-openjdk/all/conanfile.py index 05d28945d8c9a..648597913dd65 100644 --- a/recipes/zulu-openjdk/all/conanfile.py +++ b/recipes/zulu-openjdk/all/conanfile.py @@ -1,19 +1,19 @@ -import os - from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.files import get, copy +import os +required_conan_version = ">=1.53.0" class ZuluOpenJDK(ConanFile): name = "zulu-openjdk" - url = "https://github.com/conan-io/conan-center-index/" description = "A OpenJDK distribution" - homepage = "https://www.azul.com" license = "https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/" + url = "https://github.com/conan-io/conan-center-index/" + homepage = "https://www.azul.com" topics = ("java", "jdk", "openjdk") - settings = "os", "arch" package_type = "application" + settings = "os", "arch", "compiler", "build_type" @property def _settings_build(self): @@ -24,38 +24,41 @@ def _jni_folder(self): folder = {"Linux": "linux", "Macos": "darwin", "Windows": "win32"}.get(str(self._settings_build.os)) return os.path.join("include", folder) + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type def validate(self): supported_archs = ["x86_64", "armv8"] if self._settings_build.arch not in supported_archs: raise ConanInvalidConfiguration(f"Unsupported Architecture ({self._settings_build.arch}). " - "This version {self.version} currently only supports {supported_archs}.") + f"This version {self.version} currently only supports {supported_archs}.") supported_os = ["Windows", "Macos", "Linux"] if self._settings_build.os not in supported_os: raise ConanInvalidConfiguration(f"Unsupported os ({self._settings_build.os}). " - "This package currently only support {supported_os}.") + f"This package currently only support {supported_os}.") def build(self): get(self, **self.conan_data["sources"][self.version][str(self._settings_build.os)][str(self._settings_build.arch)], strip_root=True) 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")) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "bin"), + 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"), + copy(self, pattern="*", dst=os.path.join(self.package_folder, "lib"), src=os.path.join(self.source_folder, "lib")) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "res"), + copy(self, pattern="*", dst=os.path.join(self.package_folder, "res"), src=os.path.join(self.source_folder, "conf")) # conf folder is required for security settings, to avoid # java.lang.SecurityException: Can't read cryptographic policy directory: unlimited # https://github.com/conan-io/conan-center-index/pull/4491#issuecomment-774555069 - copy(self, pattern="*", dst=os.path.join(self.package_folder, "conf"), + copy(self, pattern="*", dst=os.path.join(self.package_folder, "conf"), src=os.path.join(self.source_folder, "conf")) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "licenses"), + copy(self, pattern="*", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "legal")) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "lib", "jmods"), + copy(self, pattern="*", dst=os.path.join(self.package_folder, "lib", "jmods"), src=os.path.join(self.source_folder, "jmods")) def package_info(self): @@ -65,10 +68,10 @@ def package_info(self): java_home = self.package_folder bin_path = os.path.join(java_home, "bin") - self.output.info("Creating JAVA_HOME environment variable with : {0}".format(java_home)) + self.output.info(f"Creating JAVA_HOME environment variable with : {java_home}") self.env_info.JAVA_HOME = java_home self.buildenv_info.define_path("JAVA_HOME", java_home) self.runenv_info.define_path("JAVA_HOME", java_home) - self.output.info("Appending PATH environment variable with : {0}".format(bin_path)) + self.output.info(f"Appending PATH environment variable with : {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/zulu-openjdk/config.yml b/recipes/zulu-openjdk/config.yml index 41d345875e1e8..d9b1272d1abe9 100644 --- a/recipes/zulu-openjdk/config.yml +++ b/recipes/zulu-openjdk/config.yml @@ -1,5 +1,11 @@ versions: - "11.0.12": + "21.0.1": + folder: all + "17.0.9": + folder: all + "11.0.19": folder: all "11.0.15": folder: all + "11.0.12": + folder: all diff --git a/recipes/zxing-cpp/all/conandata.yml b/recipes/zxing-cpp/all/conandata.yml index baac1087c0b36..de7e69d1a2cb4 100644 --- a/recipes/zxing-cpp/all/conandata.yml +++ b/recipes/zxing-cpp/all/conandata.yml @@ -1,4 +1,10 @@ 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" "2.0.0": url: "https://github.com/zxing-cpp/zxing-cpp/archive/v2.0.0.tar.gz" sha256: "12b76b7005c30d34265fc20356d340da179b0b4d43d2c1b35bcca86776069f76" diff --git a/recipes/zxing-cpp/all/conanfile.py b/recipes/zxing-cpp/all/conanfile.py index 2dd711e9b0caf..51a640fb637ef 100644 --- a/recipes/zxing-cpp/all/conanfile.py +++ b/recipes/zxing-cpp/all/conanfile.py @@ -16,7 +16,7 @@ class ZXingCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/zxing-cpp/zxing-cpp" topics = ("zxing", "barcode", "scanner", "generator") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/zxing-cpp/config.yml b/recipes/zxing-cpp/config.yml index a4e6ca74f0f31..335926844a15f 100644 --- a/recipes/zxing-cpp/config.yml +++ b/recipes/zxing-cpp/config.yml @@ -1,4 +1,8 @@ versions: + "2.2.1": + folder: all + "2.1.0": + folder: all "2.0.0": folder: all "1.4.0": diff --git a/recipes/zyre/all/CMakeLists.txt b/recipes/zyre/all/CMakeLists.txt deleted file mode 100644 index d04be130b6aa2..0000000000000 --- 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 cce2036293068..9f0637b08d296 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 2720136bcd4ee..bd990107ea362 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 1c404d27e174c..0000000000000 --- 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 055ebeaf29096..0000000000000 --- 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 961bb8d6f2a19..0000000000000 --- 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 b13f4721e04bf..156d0f5972669 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 cb1a41293b4f6..fb8dcf9d49558 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 38f4483872d47..ef5d7042163ec 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 7e0b34256ef83..1ec72703b4d64 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 184166496d26e..bb7eb85dfac49 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 140fd9378eebd..bb584cb53822b 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],